Compare commits
333 Commits
v0.40.3
...
v0.41.0-beta
| Author | SHA1 | Date | |
|---|---|---|---|
| bab657e43d | |||
| 4b24d9562c | |||
| a73739d03e | |||
| 4485650cbc | |||
| 58f610b2c6 | |||
| 5024454914 | |||
| ca0e36ea81 | |||
| c9b2ff05e9 | |||
| 0973498fe9 | |||
| 189202b1f6 | |||
| cc298b1e7a | |||
| f8bd6183bf | |||
| ef60cb5395 | |||
| b10c083560 | |||
| 8eeb395523 | |||
| 084882a50e | |||
| 7c04521e9c | |||
| 0a0de7312c | |||
| 37255243f7 | |||
| b4b22d9353 | |||
| d3eb640aa2 | |||
| 78d431387b | |||
| c4bc53da59 | |||
| 34de8fb874 | |||
| 5a6ab68144 | |||
| c4e5b35187 | |||
| 2e55d544f1 | |||
| b778985b5e | |||
| f9a79fa00f | |||
| ef61e22f1f | |||
| 8a92786012 | |||
| a856463173 | |||
| cb168218fb | |||
| 978575498c | |||
| 8584de27ab | |||
| a36d6bf9be | |||
| 9b17e9976e | |||
| d927865cbd | |||
| 6de0b19569 | |||
| 84d7097b1a | |||
| 8ccc48c25d | |||
| 438da7cfbb | |||
| af5c4b5859 | |||
| 04360381b6 | |||
| 45e2dc96fb | |||
| ff426fc1fc | |||
| 6dfc2755e7 | |||
| 789f12ac8f | |||
| 9a1a76605a | |||
| debce78c7f | |||
| 48c57c7ce7 | |||
| 4a89df7ebf | |||
| 6295a1825d | |||
| 280955b3a2 | |||
| 72cc54a83f | |||
| c3b44b9a91 | |||
| 8a9875ecfa | |||
| 9230b07adb | |||
| 5a6066dcd1 | |||
| d4d54c5f01 | |||
| 141d4593ca | |||
| a7ddc33b6d | |||
| 173030e02e | |||
| 8ae78a9e23 | |||
| babc27f824 | |||
| 2c7eb723d5 | |||
| 40247a591e | |||
| 3a4d32f163 | |||
| 7f2c859b94 | |||
| a5764c269f | |||
| 6a1bfdeab9 | |||
| 6de0f75931 | |||
| fcf72262bd | |||
| 114017147f | |||
| a717ee00fb | |||
| f5e27278ab | |||
| 2cc0442ef2 | |||
| 687a466a35 | |||
| 20c24e26cc | |||
| 3bafc396fc | |||
| 08606f7d88 | |||
| 3fa3e912a4 | |||
| 44219e7ccc | |||
| 48abd765c6 | |||
| 2d38706ba8 | |||
| 8d45662bee | |||
| dc4024b6de | |||
| 5b67854cbe | |||
| 72745aca29 | |||
| e6e41adad0 | |||
| bcbf1b79c3 | |||
| 1d78432df4 | |||
| c6d912dcb7 | |||
| eb287917c1 | |||
| da53c1eaa8 | |||
| c67613a557 | |||
| 0ca107ff48 | |||
| 73bf2dcb02 | |||
| 719f10981e | |||
| 1774f48d07 | |||
| deb67d6275 | |||
| bafd829ff6 | |||
| e7aa84435b | |||
| 493d088d80 | |||
| 5f4d963580 | |||
| 5114f3f782 | |||
| 53f5df4e88 | |||
| e4039ea5e1 | |||
| 95fef8d2e5 | |||
| 7105b61aab | |||
| 78a50be663 | |||
| 3d3ad3b99b | |||
| 0d9cdcac85 | |||
| c4f7bb37db | |||
| 81ec85083a | |||
| 62da383623 | |||
| 8513e0201c | |||
| abd60581be | |||
| aff02184f8 | |||
| 8909d175d0 | |||
| 091eb8f791 | |||
| e10d23289e | |||
| 26599f057c | |||
| 4e0e2e8926 | |||
| 9c631e4398 | |||
| 687539cc95 | |||
| 03e0c98066 | |||
| 77f358b846 | |||
| 4c82e882e0 | |||
| 0f4ba43463 | |||
| f15239c006 | |||
| ed1b5e3843 | |||
| 607bdfef92 | |||
| 4f744564f2 | |||
| f64b343d8d | |||
| 47b803920b | |||
| 8888d04878 | |||
| 49398f5374 | |||
| 95d1952896 | |||
| 3ab2b41e8c | |||
| e5155130e7 | |||
| 724ba352e6 | |||
| 1239293435 | |||
| 16f42dd4ab | |||
| 350331e2ef | |||
| a2d6a5c3e9 | |||
| cb35284d37 | |||
| 2af37640d8 | |||
| 4bd298a55b | |||
| cd4b1235a7 | |||
| 5e3c85f891 | |||
| b2a3e1cc04 | |||
| d71763aedb | |||
| 368d0c55da | |||
| 637010577b | |||
| 7bcae9981b | |||
| 3752cf8cba | |||
| 7270bf287d | |||
| d821ea4095 | |||
| 41d1d83dc2 | |||
| a2fe110400 | |||
| fdc99bb6f9 | |||
| 36eac6badd | |||
| 7cac2521ef | |||
| e8a9e49e9e | |||
| fb55cdaea6 | |||
| b9b2cc8364 | |||
| 8dfdd090f5 | |||
| fe7705524a | |||
| 8e77d729e5 | |||
| 2b1b7774f8 | |||
| 2d58019d6e | |||
| fe31f08c0d | |||
| d9fb36a9a6 | |||
| 52f4876f2d | |||
| ad7a55d305 | |||
| 2e3534dfb7 | |||
| d288c1b052 | |||
| f2cf361acf | |||
| e7af24c139 | |||
| 9797942b8e | |||
| 32d60a7eb9 | |||
| 4330dc47a0 | |||
| 8ca9ad3497 | |||
| a679fedb58 | |||
| 880f4ad711 | |||
| e000fb4579 | |||
| 22c042e21f | |||
| 2c3f07521d | |||
| e06f3ef97e | |||
| 7e41a2750c | |||
| b2a48a1f3a | |||
| e1bf4dcbc9 | |||
| 6d847d22d3 | |||
| 9337564075 | |||
| 2fa41b44c5 | |||
| 8d2c2202fa | |||
| 380bb0cd01 | |||
| 789f62267c | |||
| 25553c9e67 | |||
| 81a54cd4a0 | |||
| 1d2fc773c2 | |||
| 7767edd82f | |||
| 99ea238c3f | |||
| 826c434630 | |||
| 4401a8e1e8 | |||
| 4ec671d199 | |||
| 9f4a514562 | |||
| 18ee239362 | |||
| 08687b76ea | |||
| 60d07a6871 | |||
| 81f4966a1a | |||
| 9acf723a9a | |||
| 47f7f5f4d9 | |||
| 14d6372bd8 | |||
| 6d912c4897 | |||
| 62e1284790 | |||
| d79ae261e1 | |||
| 92f6558e55 | |||
| 8d49249ed7 | |||
| d1bb62c40e | |||
| 42017fde5f | |||
| 786bbbc160 | |||
| 0cc013c13f | |||
| c5475765e5 | |||
| 9ea91f821c | |||
| b757dfcf79 | |||
| 44ddcdd852 | |||
| 66204811cf | |||
| 822a8509b3 | |||
| 9f62490a75 | |||
| b63ecba695 | |||
| d5ae3802d1 | |||
| 7c6cd63a53 | |||
| 62a80ef016 | |||
| 27ab55d26a | |||
| 34150e7177 | |||
| b946599320 | |||
| 3cd4be4e48 | |||
| 96e2b9bc18 | |||
| 0054a32dc7 | |||
| 513ce1a183 | |||
| 9f38ea6ee7 | |||
| 0e13678f7c | |||
| f0cbca2838 | |||
| f6f7836b8e | |||
| eeedb91ef7 | |||
| 05b51c0f68 | |||
| 8bf794f13b | |||
| 48b401164a | |||
| b65631be7e | |||
| 439b45b0b8 | |||
| 976b2aa6f5 | |||
| 88213c1bbd | |||
| d2e3aedf7f | |||
| 368d3b1b97 | |||
| 9301679707 | |||
| 865f7e1ee1 | |||
| c243d2e85c | |||
| 97a35d6fba | |||
| 3f0974d3d2 | |||
| 48a7c0235f | |||
| ac7d5f2e81 | |||
| 516e6c35da | |||
| 7cad386a56 | |||
| 60c908cd63 | |||
| 52a907651e | |||
| 3254b551d8 | |||
| 7a62d1636b | |||
| 7d9b720ea8 | |||
| ba500a3a80 | |||
| 606d5afcab | |||
| 4b66765cc1 | |||
| 8651e47118 | |||
| 34bc02965f | |||
| eacefeb08b | |||
| 11a61325f9 | |||
| 370c63986d | |||
| d103b16d9a | |||
| c63bb7ce8a | |||
| af5c623671 | |||
| 55d1f9e9f0 | |||
| 96a7b4e45e | |||
| c83ca78565 | |||
| c5eac8f438 | |||
| 9bc1f5af45 | |||
| 423a70d102 | |||
| 562c729ed6 | |||
| 0760dc742b | |||
| 1098d75ce0 | |||
| bd8e5f255b | |||
| 8da094cd3c | |||
| 44dc3c28de | |||
| 49c0d3199d | |||
| 416d733510 | |||
| 6de4914ea6 | |||
| 9f1e777e6d | |||
| adb9ce5e93 | |||
| 746181689f | |||
| a99c016818 | |||
| 37f279fab0 | |||
| e355b449c4 | |||
| 4fdea77c57 | |||
| 6d276582cb | |||
| 493730dff6 | |||
| b00a9f4415 | |||
| b25c1d6fa8 | |||
| 97b13ae91d | |||
| 0178232f26 | |||
| cc138ef9f8 | |||
| 1552c3804d | |||
| 7963de0abc | |||
| f98a20928c | |||
| 209b1610f6 | |||
| bd0f7d3680 | |||
| f852e1de81 | |||
| c9770573b2 | |||
| 23701219e1 | |||
| c9bc4ad108 | |||
| 8b9c235465 | |||
| 657d01da95 | |||
| 17e2627a34 | |||
| bf7541bfb9 | |||
| 9d81bf030d | |||
| f25d735b9d | |||
| 4d16018f6c | |||
| 5e11840137 | |||
| 61474defff | |||
| b12e38c231 | |||
| d1f679ab90 | |||
| 0f8a7bad06 | |||
| 9e031dcd60 | |||
| 51c3f98dde |
@@ -0,0 +1,3 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: [zadam]
|
||||
Generated
-3
@@ -6,9 +6,6 @@
|
||||
<synchronize>true</synchronize>
|
||||
<jdbc-driver>org.sqlite.JDBC</jdbc-driver>
|
||||
<jdbc-url>jdbc:sqlite:$PROJECT_DIR$/../trilium-data/document.db</jdbc-url>
|
||||
<driver-properties>
|
||||
<property name="enable_load_extension" value="true" />
|
||||
</driver-properties>
|
||||
</data-source>
|
||||
</component>
|
||||
</project>
|
||||
+10
-34
@@ -57,7 +57,6 @@
|
||||
<index id="24" parent="6" name="sqlite_autoindex_api_tokens_1">
|
||||
<NameSurrogate>1</NameSurrogate>
|
||||
<ColNames>apiTokenId</ColNames>
|
||||
<ColumnCollations></ColumnCollations>
|
||||
<Unique>1</Unique>
|
||||
</index>
|
||||
<key id="25" parent="6">
|
||||
@@ -131,21 +130,17 @@
|
||||
<index id="38" parent="7" name="sqlite_autoindex_attributes_1">
|
||||
<NameSurrogate>1</NameSurrogate>
|
||||
<ColNames>attributeId</ColNames>
|
||||
<ColumnCollations></ColumnCollations>
|
||||
<Unique>1</Unique>
|
||||
</index>
|
||||
<index id="39" parent="7" name="IDX_attributes_noteId_index">
|
||||
<ColNames>noteId</ColNames>
|
||||
<ColumnCollations></ColumnCollations>
|
||||
</index>
|
||||
<index id="40" parent="7" name="IDX_attributes_name_value">
|
||||
<ColNames>name
|
||||
value</ColNames>
|
||||
<ColumnCollations></ColumnCollations>
|
||||
</index>
|
||||
<index id="41" parent="7" name="IDX_attributes_value_index">
|
||||
<ColNames>value</ColNames>
|
||||
<ColumnCollations></ColumnCollations>
|
||||
</index>
|
||||
<key id="42" parent="7">
|
||||
<ColNames>attributeId</ColNames>
|
||||
@@ -212,17 +207,14 @@ value</ColNames>
|
||||
<index id="54" parent="8" name="sqlite_autoindex_branches_1">
|
||||
<NameSurrogate>1</NameSurrogate>
|
||||
<ColNames>branchId</ColNames>
|
||||
<ColumnCollations></ColumnCollations>
|
||||
<Unique>1</Unique>
|
||||
</index>
|
||||
<index id="55" parent="8" name="IDX_branches_noteId_parentNoteId">
|
||||
<ColNames>noteId
|
||||
parentNoteId</ColNames>
|
||||
<ColumnCollations></ColumnCollations>
|
||||
</index>
|
||||
<index id="56" parent="8" name="IDX_branches_parentNoteId">
|
||||
<ColNames>parentNoteId</ColNames>
|
||||
<ColumnCollations></ColumnCollations>
|
||||
</index>
|
||||
<key id="57" parent="8">
|
||||
<ColNames>branchId</ColNames>
|
||||
@@ -253,7 +245,6 @@ parentNoteId</ColNames>
|
||||
<index id="62" parent="9" name="sqlite_autoindex_note_contents_1">
|
||||
<NameSurrogate>1</NameSurrogate>
|
||||
<ColNames>noteId</ColNames>
|
||||
<ColumnCollations></ColumnCollations>
|
||||
<Unique>1</Unique>
|
||||
</index>
|
||||
<key id="63" parent="9">
|
||||
@@ -284,7 +275,6 @@ parentNoteId</ColNames>
|
||||
<index id="68" parent="10" name="sqlite_autoindex_note_revision_contents_1">
|
||||
<NameSurrogate>1</NameSurrogate>
|
||||
<ColNames>noteRevisionId</ColNames>
|
||||
<ColumnCollations></ColumnCollations>
|
||||
<Unique>1</Unique>
|
||||
</index>
|
||||
<key id="69" parent="10">
|
||||
@@ -369,28 +359,22 @@ parentNoteId</ColNames>
|
||||
<index id="84" parent="11" name="sqlite_autoindex_note_revisions_1">
|
||||
<NameSurrogate>1</NameSurrogate>
|
||||
<ColNames>noteRevisionId</ColNames>
|
||||
<ColumnCollations></ColumnCollations>
|
||||
<Unique>1</Unique>
|
||||
</index>
|
||||
<index id="85" parent="11" name="IDX_note_revisions_noteId">
|
||||
<ColNames>noteId</ColNames>
|
||||
<ColumnCollations></ColumnCollations>
|
||||
</index>
|
||||
<index id="86" parent="11" name="IDX_note_revisions_utcDateLastEdited">
|
||||
<ColNames>utcDateLastEdited</ColNames>
|
||||
<ColumnCollations></ColumnCollations>
|
||||
</index>
|
||||
<index id="87" parent="11" name="IDX_note_revisions_utcDateCreated">
|
||||
<ColNames>utcDateCreated</ColNames>
|
||||
<ColumnCollations></ColumnCollations>
|
||||
</index>
|
||||
<index id="88" parent="11" name="IDX_note_revisions_dateLastEdited">
|
||||
<ColNames>dateLastEdited</ColNames>
|
||||
<ColumnCollations></ColumnCollations>
|
||||
</index>
|
||||
<index id="89" parent="11" name="IDX_note_revisions_dateCreated">
|
||||
<ColNames>dateCreated</ColNames>
|
||||
<ColumnCollations></ColumnCollations>
|
||||
</index>
|
||||
<key id="90" parent="11">
|
||||
<ColNames>noteRevisionId</ColNames>
|
||||
@@ -477,36 +461,28 @@ parentNoteId</ColNames>
|
||||
<index id="105" parent="12" name="sqlite_autoindex_notes_1">
|
||||
<NameSurrogate>1</NameSurrogate>
|
||||
<ColNames>noteId</ColNames>
|
||||
<ColumnCollations></ColumnCollations>
|
||||
<Unique>1</Unique>
|
||||
</index>
|
||||
<index id="106" parent="12" name="IDX_notes_title">
|
||||
<ColNames>title</ColNames>
|
||||
<ColumnCollations></ColumnCollations>
|
||||
</index>
|
||||
<index id="107" parent="12" name="IDX_notes_type">
|
||||
<ColNames>type</ColNames>
|
||||
<ColumnCollations></ColumnCollations>
|
||||
</index>
|
||||
<index id="108" parent="12" name="IDX_notes_isDeleted">
|
||||
<ColNames>isDeleted</ColNames>
|
||||
<ColumnCollations></ColumnCollations>
|
||||
</index>
|
||||
<index id="109" parent="12" name="IDX_notes_dateCreated">
|
||||
<ColNames>dateCreated</ColNames>
|
||||
<ColumnCollations></ColumnCollations>
|
||||
</index>
|
||||
<index id="110" parent="12" name="IDX_notes_dateModified">
|
||||
<ColNames>dateModified</ColNames>
|
||||
<ColumnCollations></ColumnCollations>
|
||||
</index>
|
||||
<index id="111" parent="12" name="IDX_notes_utcDateCreated">
|
||||
<ColNames>utcDateCreated</ColNames>
|
||||
<ColumnCollations></ColumnCollations>
|
||||
</index>
|
||||
<index id="112" parent="12" name="IDX_notes_utcDateModified">
|
||||
<ColNames>utcDateModified</ColNames>
|
||||
<ColumnCollations></ColumnCollations>
|
||||
</index>
|
||||
<key id="113" parent="12">
|
||||
<ColNames>noteId</ColNames>
|
||||
@@ -547,7 +523,6 @@ parentNoteId</ColNames>
|
||||
<index id="120" parent="13" name="sqlite_autoindex_options_1">
|
||||
<NameSurrogate>1</NameSurrogate>
|
||||
<ColNames>name</ColNames>
|
||||
<ColumnCollations></ColumnCollations>
|
||||
<Unique>1</Unique>
|
||||
</index>
|
||||
<key id="121" parent="13">
|
||||
@@ -583,7 +558,6 @@ parentNoteId</ColNames>
|
||||
<index id="127" parent="14" name="sqlite_autoindex_recent_notes_1">
|
||||
<NameSurrogate>1</NameSurrogate>
|
||||
<ColNames>noteId</ColNames>
|
||||
<ColumnCollations></ColumnCollations>
|
||||
<Unique>1</Unique>
|
||||
</index>
|
||||
<key id="128" parent="14">
|
||||
@@ -604,12 +578,10 @@ parentNoteId</ColNames>
|
||||
<index id="131" parent="15" name="sqlite_autoindex_source_ids_1">
|
||||
<NameSurrogate>1</NameSurrogate>
|
||||
<ColNames>sourceId</ColNames>
|
||||
<ColumnCollations></ColumnCollations>
|
||||
<Unique>1</Unique>
|
||||
</index>
|
||||
<index id="132" parent="15" name="IDX_source_ids_utcDateCreated">
|
||||
<ColNames>utcDateCreated</ColNames>
|
||||
<ColumnCollations></ColumnCollations>
|
||||
</index>
|
||||
<key id="133" parent="15">
|
||||
<ColNames>sourceId</ColNames>
|
||||
@@ -663,22 +635,26 @@ parentNoteId</ColNames>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<column id="145" parent="18" name="utcSyncDate">
|
||||
<column id="145" parent="18" name="isSynced">
|
||||
<Position>5</Position>
|
||||
<DataType>INTEGER|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
<DefaultExpression>0</DefaultExpression>
|
||||
</column>
|
||||
<column id="146" parent="18" name="utcSyncDate">
|
||||
<Position>6</Position>
|
||||
<DataType>TEXT|0s</DataType>
|
||||
<NotNull>1</NotNull>
|
||||
</column>
|
||||
<index id="146" parent="18" name="IDX_sync_entityName_entityId">
|
||||
<index id="147" parent="18" name="IDX_sync_entityName_entityId">
|
||||
<ColNames>entityName
|
||||
entityId</ColNames>
|
||||
<ColumnCollations></ColumnCollations>
|
||||
<Unique>1</Unique>
|
||||
</index>
|
||||
<index id="147" parent="18" name="IDX_sync_utcSyncDate">
|
||||
<index id="148" parent="18" name="IDX_sync_utcSyncDate">
|
||||
<ColNames>utcSyncDate</ColNames>
|
||||
<ColumnCollations></ColumnCollations>
|
||||
</index>
|
||||
<key id="148" parent="18">
|
||||
<key id="149" parent="18">
|
||||
<ColNames>id</ColNames>
|
||||
<Primary>1</Primary>
|
||||
</key>
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
FROM node:12.14.0-alpine
|
||||
FROM node:12.16.1-alpine
|
||||
|
||||
# Create app directory
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
@@ -11,11 +11,9 @@ echo "Copying required linux-x64 binaries"
|
||||
|
||||
rm -r $SRC_DIR/node_modules/sqlite3/lib/binding/*
|
||||
rm -r $SRC_DIR/node_modules/pngquant-bin/vendor/*
|
||||
rm -r $SRC_DIR/node_modules/@felixrieseberg/spellchecker/build/Release/*
|
||||
|
||||
cp -r bin/deps/linux-x64/sqlite/* $SRC_DIR/node_modules/sqlite3/lib/binding/
|
||||
cp bin/deps/linux-x64/image/pngquant $SRC_DIR/node_modules/pngquant-bin/vendor/
|
||||
cp bin/deps/linux-x64/spellchecker/* $SRC_DIR/node_modules/@felixrieseberg/spellchecker/build/Release/
|
||||
|
||||
./node_modules/.bin/electron-packager $SRC_DIR --asar --out=dist --executable-name=trilium --platform=linux --arch=x64 --overwrite
|
||||
|
||||
|
||||
@@ -13,15 +13,11 @@ rm -r $SRC_DIR/node_modules/sqlite3/lib/binding/*
|
||||
rm -r $SRC_DIR/node_modules/mozjpeg/vendor/*
|
||||
rm -r $SRC_DIR/node_modules/pngquant-bin/vendor/*
|
||||
rm -r $SRC_DIR/node_modules/giflossy/vendor/*
|
||||
rm -r $SRC_DIR/node_modules/@felixrieseberg/spellchecker/build/Release/*
|
||||
rm -r $SRC_DIR/node_modules/keyboard-layout/build/Release/*
|
||||
|
||||
cp -r bin/deps/mac-x64/sqlite/* $SRC_DIR/node_modules/sqlite3/lib/binding/
|
||||
cp bin/deps/mac-x64/image/cjpeg $SRC_DIR/node_modules/mozjpeg/vendor/
|
||||
cp bin/deps/mac-x64/image/pngquant $SRC_DIR/node_modules/pngquant-bin/vendor/
|
||||
cp bin/deps/mac-x64/image/gifsicle $SRC_DIR/node_modules/giflossy/vendor/
|
||||
cp bin/deps/mac-x64/spellchecker/* $SRC_DIR/node_modules/@felixrieseberg/spellchecker/build/Release/
|
||||
cp bin/deps/mac-x64/keyboard-layout-manager.node $SRC_DIR/node_modules/keyboard-layout/build/Release/
|
||||
|
||||
./node_modules/.bin/electron-packager $SRC_DIR --asar --out=dist --executable-name=trilium --platform=darwin --arch=x64 --overwrite --icon=images/app-icons/mac/icon.icns
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
PKG_DIR=dist/trilium-linux-x64-server
|
||||
NODE_VERSION=12.14.0
|
||||
NODE_VERSION=12.16.1
|
||||
|
||||
if [ "$1" != "DONTCOPY" ]
|
||||
then
|
||||
|
||||
@@ -13,16 +13,11 @@ rm -r $SRC_DIR/node_modules/sqlite3/lib/binding/*
|
||||
rm -r $SRC_DIR/node_modules/mozjpeg/vendor/*
|
||||
rm -r $SRC_DIR/node_modules/pngquant-bin/vendor/*
|
||||
rm -r $SRC_DIR/node_modules/giflossy/vendor/*
|
||||
rm -r $SRC_DIR/node_modules/@felixrieseberg/spellchecker/build/Release/*
|
||||
rm -r $SRC_DIR/node_modules/keyboard-layout/build/Release/*
|
||||
rm -r $SRC_DIR/node_modules/cld/build/Release/*
|
||||
|
||||
cp -r bin/deps/win-x64/sqlite/* $SRC_DIR/node_modules/sqlite3/lib/binding/
|
||||
cp bin/deps/win-x64/image/cjpeg.exe $SRC_DIR/node_modules/mozjpeg/vendor/
|
||||
cp bin/deps/win-x64/image/pngquant.exe $SRC_DIR/node_modules/pngquant-bin/vendor/
|
||||
cp bin/deps/win-x64/image/gifsicle.exe $SRC_DIR/node_modules/giflossy/vendor/
|
||||
cp bin/deps/win-x64/spellchecker/* $SRC_DIR/node_modules/@felixrieseberg/spellchecker/build/Release/
|
||||
cp bin/deps/win-x64/keyboard-layout-manager.node $SRC_DIR/node_modules/keyboard-layout/build/Release/
|
||||
|
||||
./node_modules/.bin/electron-packager $SRC_DIR --asar --out=dist --executable-name=trilium --platform=win32 --arch=x64 --overwrite --icon=images/app-icons/win/icon.ico
|
||||
|
||||
|
||||
+1
-4
@@ -26,7 +26,4 @@ cp -r electron.js $DIR/
|
||||
# run in subshell (so we return to original dir)
|
||||
(cd $DIR && npm install --only=prod)
|
||||
|
||||
rm -r $DIR/node_modules/cld/deps
|
||||
|
||||
find $DIR/libraries -name "*.map" -type f -delete
|
||||
find $DIR/libraries -name "hunspell.lib" -type f -delete
|
||||
find $DIR/libraries -name "*.map" -type f -delete
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Regular → Executable
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -12,5 +12,4 @@ fi
|
||||
mkdir -p "$DIR"
|
||||
cd "$DIR"
|
||||
|
||||
openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 2000 -nodes
|
||||
|
||||
openssl req -newkey rsa:4096 -x509 -sha256 -days 3650 -nodes -out cert.crt -keyout key.key
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ instanceName=
|
||||
[Network]
|
||||
# host setting is relevant only for web deployments - set the host on which the server will listen
|
||||
# host=0.0.0.0
|
||||
# port setting is relevant only for web deployments, desktop builds run on random free port
|
||||
# port setting is relevant only for web deployments, desktop builds run on a fixed port (changeable with TRILIUM_PORT environment variable)
|
||||
port=8080
|
||||
# true for TLS/SSL/HTTPS (secure), false for HTTP (unsecure).
|
||||
https=false
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -0,0 +1,22 @@
|
||||
CREATE TABLE IF NOT EXISTS "sync_mig" (
|
||||
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
`entityName` TEXT NOT NULL,
|
||||
`entityId` TEXT NOT NULL,
|
||||
`sourceId` TEXT NOT NULL,
|
||||
`isSynced` INTEGER default 0 not null,
|
||||
`utcSyncDate` TEXT NOT NULL);
|
||||
|
||||
INSERT INTO sync_mig (id, entityName, entityId, sourceId, isSynced, utcSyncDate)
|
||||
SELECT id, entityName, entityId, sourceId, 1, utcSyncDate FROM sync;
|
||||
|
||||
DROP TABLE sync;
|
||||
|
||||
ALTER TABLE sync_mig RENAME TO sync;
|
||||
|
||||
CREATE UNIQUE INDEX `IDX_sync_entityName_entityId` ON `sync` (
|
||||
`entityName`,
|
||||
`entityId`
|
||||
);
|
||||
CREATE INDEX `IDX_sync_utcSyncDate` ON `sync` (
|
||||
`utcSyncDate`
|
||||
);
|
||||
+16
-15
@@ -1,16 +1,8 @@
|
||||
CREATE TABLE IF NOT EXISTS "sync" (
|
||||
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
`entityName` TEXT NOT NULL,
|
||||
`entityId` TEXT NOT NULL,
|
||||
`sourceId` TEXT NOT NULL,
|
||||
`utcSyncDate` TEXT NOT NULL);
|
||||
CREATE TABLE IF NOT EXISTS "source_ids" (
|
||||
`sourceId` TEXT NOT NULL,
|
||||
`utcDateCreated` TEXT NOT NULL,
|
||||
PRIMARY KEY(`sourceId`)
|
||||
);
|
||||
CREATE INDEX IDX_source_ids_utcDateCreated
|
||||
on source_ids (utcDateCreated);
|
||||
CREATE TABLE IF NOT EXISTS "api_tokens"
|
||||
(
|
||||
apiTokenId TEXT PRIMARY KEY NOT NULL,
|
||||
@@ -27,13 +19,6 @@ CREATE TABLE IF NOT EXISTS "options"
|
||||
utcDateCreated TEXT not null,
|
||||
utcDateModified TEXT NOT NULL
|
||||
);
|
||||
CREATE UNIQUE INDEX `IDX_sync_entityName_entityId` ON `sync` (
|
||||
`entityName`,
|
||||
`entityId`
|
||||
);
|
||||
CREATE INDEX `IDX_sync_utcSyncDate` ON `sync` (
|
||||
`utcSyncDate`
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS "note_contents" (
|
||||
`noteId` TEXT NOT NULL,
|
||||
`content` TEXT NULL DEFAULT NULL,
|
||||
@@ -72,6 +57,8 @@ CREATE INDEX `IDX_note_revisions_utcDateCreated` ON `note_revisions` (`utcDateCr
|
||||
CREATE INDEX `IDX_note_revisions_utcDateLastEdited` ON `note_revisions` (`utcDateLastEdited`);
|
||||
CREATE INDEX `IDX_note_revisions_dateCreated` ON `note_revisions` (`dateCreated`);
|
||||
CREATE INDEX `IDX_note_revisions_dateLastEdited` ON `note_revisions` (`dateLastEdited`);
|
||||
CREATE INDEX IDX_source_ids_utcDateCreated
|
||||
on source_ids (utcDateCreated);
|
||||
CREATE TABLE IF NOT EXISTS "notes" (
|
||||
`noteId` TEXT NOT NULL,
|
||||
`title` TEXT NOT NULL DEFAULT "note",
|
||||
@@ -130,3 +117,17 @@ CREATE INDEX IDX_attributes_noteId_index
|
||||
on attributes (noteId);
|
||||
CREATE INDEX IDX_attributes_value_index
|
||||
on attributes (value);
|
||||
CREATE TABLE IF NOT EXISTS "sync" (
|
||||
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
`entityName` TEXT NOT NULL,
|
||||
`entityId` TEXT NOT NULL,
|
||||
`sourceId` TEXT NOT NULL,
|
||||
`isSynced` INTEGER default 0 not null,
|
||||
`utcSyncDate` TEXT NOT NULL);
|
||||
CREATE UNIQUE INDEX `IDX_sync_entityName_entityId` ON `sync` (
|
||||
`entityName`,
|
||||
`entityId`
|
||||
);
|
||||
CREATE INDEX `IDX_sync_utcSyncDate` ON `sync` (
|
||||
`utcSyncDate`
|
||||
);
|
||||
|
||||
@@ -272,6 +272,32 @@
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>deleteId</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">string</span>
|
||||
|
|
||||
|
||||
<span class="param-type">null</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last">ID identifying delete transaction</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>utcDateCreated</code></td>
|
||||
@@ -352,7 +378,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line29">line 29</a>
|
||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line30">line 30</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -467,7 +493,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line46">line 46</a>
|
||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line47">line 47</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -569,7 +595,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line57">line 57</a>
|
||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line58">line 58</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -671,7 +697,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line76">line 76</a>
|
||||
<a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line77">line 77</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
@@ -396,7 +396,7 @@ the backend.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line394">line 394</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line395">line 395</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1117,6 +1117,8 @@ JSON MIME type. See also createNewNote() for more options.
|
||||
|
||||
|
||||
|
||||
<dt class="important tag-deprecated">Deprecated:</dt><dd><ul class="dummy"><li>please use createNote() API method instead</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1129,7 +1131,7 @@ JSON MIME type. See also createNewNote() for more options.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line258">line 258</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line259">line 259</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1815,7 +1817,7 @@ JSON MIME type. See also createNewNote() for more options.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line399">line 399</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line400">line 400</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -2279,7 +2281,7 @@ JSON MIME type. See also createNewNote() for more options.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line314">line 314</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line315">line 315</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3047,7 +3049,7 @@ if some action needs to happen on only one specific instance.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line341">line 341</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line342">line 342</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3700,7 +3702,7 @@ if some action needs to happen on only one specific instance.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line305">line 305</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line306">line 306</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3806,7 +3808,7 @@ if some action needs to happen on only one specific instance.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line322">line 322</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line323">line 323</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3984,7 +3986,7 @@ if some action needs to happen on only one specific instance.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line332">line 332</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line333">line 333</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4139,7 +4141,7 @@ if some action needs to happen on only one specific instance.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line350">line 350</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line351">line 351</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4289,7 +4291,7 @@ if some action needs to happen on only one specific instance.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line297">line 297</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line298">line 298</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4792,7 +4794,7 @@ This method looks similar to toggleNoteInParent() but differs because we're look
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line371">line 371</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line372">line 372</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4925,7 +4927,7 @@ This method looks similar to toggleNoteInParent() but differs because we're look
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line357">line 357</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line358">line 358</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -5300,7 +5302,7 @@ transactional by default.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line384">line 384</a>
|
||||
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line385">line 385</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
@@ -250,6 +250,32 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>deleteId</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">string</span>
|
||||
|
|
||||
|
||||
<span class="param-type">null</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last">ID identifying delete transaction</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>utcDateModified</code></td>
|
||||
@@ -330,7 +356,7 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line30">line 30</a>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line25">line 25</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -445,7 +471,7 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line38">line 38</a>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line32">line 32</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
+92
-66
@@ -293,6 +293,32 @@
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>deleteId</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">string</span>
|
||||
|
|
||||
|
||||
<span class="param-type">null</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last">ID identifying delete transaction</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>isErased</code></td>
|
||||
@@ -442,7 +468,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line43">line 43</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line44">line 44</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -557,7 +583,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line540">line 540</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line547">line 547</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -659,7 +685,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line868">line 868</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line877">line 877</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -837,7 +863,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line436">line 436</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line443">line 443</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1037,7 +1063,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line254">line 254</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line261">line 261</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1215,7 +1241,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line447">line 447</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line454">line 454</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1321,7 +1347,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line814">line 814</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line823">line 823</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1423,7 +1449,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line842">line 842</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line851">line 851</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1529,7 +1555,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line828">line 828</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line837">line 837</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1635,7 +1661,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line74">line 74</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line75">line 75</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1737,7 +1763,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line714">line 714</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line721">line 721</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -1970,7 +1996,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line737">line 737</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line744">line 744</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -2168,7 +2194,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line775">line 775</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line782">line 782</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -2366,7 +2392,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line784">line 784</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line791">line 791</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -2468,7 +2494,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line109">line 109</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line110">line 110</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -2619,7 +2645,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line591">line 591</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line598">line 598</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -2786,7 +2812,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line293">line 293</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line300">line 300</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -2953,7 +2979,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line277">line 277</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line284">line 284</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3108,7 +3134,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line615">line 615</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line622">line 622</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3220,7 +3246,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line801">line 801</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line808">line 808</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3322,7 +3348,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line236">line 236</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line243">line 243</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3529,7 +3555,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line212">line 212</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line219">line 219</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3707,7 +3733,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line458">line 458</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line465">line 465</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -3862,7 +3888,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line597">line 597</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line604">line 604</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4029,7 +4055,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line285">line 285</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line292">line 292</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4184,7 +4210,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line621">line 621</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line628">line 628</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4339,7 +4365,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line609">line 609</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line616">line 616</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4506,7 +4532,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line309">line 309</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line316">line 316</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4661,7 +4687,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line649">line 649</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line656">line 656</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4819,7 +4845,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line633">line 633</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line640">line 640</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -4925,7 +4951,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line854">line 854</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line863">line 863</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -5080,7 +5106,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line603">line 603</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line610">line 610</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -5247,7 +5273,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line332">line 332</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line339">line 339</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -5414,7 +5440,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line301">line 301</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line308">line 308</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -5569,7 +5595,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line639">line 639</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line646">line 646</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -5739,7 +5765,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line317">line 317</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line324">line 324</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -5890,7 +5916,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line627">line 627</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line634">line 634</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -6000,7 +6026,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line791">line 791</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line798">line 798</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -6102,7 +6128,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line183">line 183</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line190">line 190</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -6208,7 +6234,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line245">line 245</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line252">line 252</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -6386,7 +6412,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line418">line 418</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line425">line 425</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -6492,7 +6518,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line821">line 821</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line830">line 830</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -6647,7 +6673,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line567">line 567</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line574">line 574</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -6825,7 +6851,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line427">line 427</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line434">line 434</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -6980,7 +7006,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line573">line 573</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line580">line 580</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -7135,7 +7161,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line585">line 585</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line592">line 592</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -7290,7 +7316,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line579">line 579</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line586">line 586</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -7401,7 +7427,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line340">line 340</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line347">line 347</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -7529,7 +7555,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line889">line 889</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line898">line 898</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -7635,7 +7661,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line173">line 173</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line180">line 180</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -7741,7 +7767,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line165">line 165</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line172">line 172</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -7847,7 +7873,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line160">line 160</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line167">line 167</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -7953,7 +7979,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line155">line 155</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line162">line 162</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -8059,7 +8085,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line178">line 178</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line185">line 185</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -8165,7 +8191,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line346">line 346</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line353">line 353</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -8394,7 +8420,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line524">line 524</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line531">line 531</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -8592,7 +8618,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line700">line 700</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line707">line 707</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -8790,7 +8816,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line709">line 709</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line716">line 716</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -9019,7 +9045,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line490">line 490</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line497">line 497</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -9121,7 +9147,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line116">line 116</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line121">line 121</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -9223,7 +9249,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line150">line 150</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line157">line 157</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -9421,7 +9447,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line682">line 682</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line689">line 689</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -9619,7 +9645,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line691">line 691</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line698">line 698</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -9879,7 +9905,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line473">line 473</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line480">line 480</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -10108,7 +10134,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line663">line 663</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line670">line 670</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -10337,7 +10363,7 @@ Cache is note instance scoped.
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line673">line 673</a>
|
||||
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line680">line 680</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ const sql = require('../services/sql');
|
||||
* @property {int} position
|
||||
* @property {boolean} isInheritable
|
||||
* @property {boolean} isDeleted
|
||||
* @property {string|null} deleteId - ID identifying delete transaction
|
||||
* @property {string} utcDateCreated
|
||||
* @property {string} utcDateModified
|
||||
*
|
||||
@@ -143,6 +144,20 @@ class Attribute extends Entity {
|
||||
delete pojo.isOwned;
|
||||
delete pojo.__note;
|
||||
}
|
||||
|
||||
createClone(type, name, value) {
|
||||
return new Attribute({
|
||||
noteId: this.noteId,
|
||||
type: type,
|
||||
name: name,
|
||||
value: value,
|
||||
position: this.position,
|
||||
isInheritable: this.isInheritable,
|
||||
isDeleted: false,
|
||||
utcDateCreated: this.utcDateCreated,
|
||||
utcDateModified: this.utcDateModified
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Attribute;</code></pre>
|
||||
|
||||
@@ -44,6 +44,7 @@ const sql = require('../services/sql');
|
||||
* @property {string} prefix
|
||||
* @property {boolean} isExpanded
|
||||
* @property {boolean} isDeleted
|
||||
* @property {string|null} deleteId - ID identifying delete transaction
|
||||
* @property {string} utcDateModified
|
||||
* @property {string} utcDateCreated
|
||||
*
|
||||
@@ -53,14 +54,7 @@ class Branch extends Entity {
|
||||
static get entityName() { return "branches"; }
|
||||
static get primaryKeyName() { return "branchId"; }
|
||||
// notePosition is not part of hash because it would produce a lot of updates in case of reordering
|
||||
static get hashedProperties() { return ["branchId", "noteId", "parentNoteId", "isDeleted", "prefix"]; }
|
||||
|
||||
constructor(row = {}) {
|
||||
super(row);
|
||||
|
||||
// used to detect move in note tree
|
||||
this.origParentNoteId = this.parentNoteId;
|
||||
}
|
||||
static get hashedProperties() { return ["branchId", "noteId", "parentNoteId", "isDeleted", "deleteId", "prefix"]; }
|
||||
|
||||
/** @returns {Note|null} */
|
||||
async getNote() {
|
||||
@@ -92,9 +86,17 @@ class Branch extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
// cannot be static!
|
||||
updatePojo(pojo) {
|
||||
delete pojo.origParentNoteId;
|
||||
createClone(parentNoteId, notePosition) {
|
||||
return new Branch({
|
||||
noteId: this.noteId,
|
||||
parentNoteId: parentNoteId,
|
||||
notePosition: notePosition,
|
||||
prefix: this.prefix,
|
||||
isExpanded: this.isExpanded,
|
||||
isDeleted: false,
|
||||
utcDateCreated: this.utcDateCreated,
|
||||
utcDateModified: this.utcDateModified
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@ const RELATION_DEFINITION = 'relation-definition';
|
||||
* @property {int} contentLength - length of content
|
||||
* @property {boolean} isProtected - true if note is protected
|
||||
* @property {boolean} isDeleted - true if note is deleted
|
||||
* @property {string|null} deleteId - ID identifying delete transaction
|
||||
* @property {boolean} isErased - true if note's content is erased after it has been deleted
|
||||
* @property {string} dateCreated - local date time (with offset)
|
||||
* @property {string} dateModified - local date time (with offset)
|
||||
@@ -63,7 +64,7 @@ const RELATION_DEFINITION = 'relation-definition';
|
||||
class Note extends Entity {
|
||||
static get entityName() { return "notes"; }
|
||||
static get primaryKeyName() { return "noteId"; }
|
||||
static get hashedProperties() { return ["noteId", "title", "type", "isProtected", "isDeleted"]; }
|
||||
static get hashedProperties() { return ["noteId", "title", "type", "mime", "isProtected", "isDeleted", "deleteId"]; }
|
||||
|
||||
/**
|
||||
* @param row - object containing database row from "notes" table
|
||||
@@ -137,6 +138,10 @@ class Note extends Entity {
|
||||
async getJsonContent() {
|
||||
const content = await this.getContent();
|
||||
|
||||
if (!content || !content.trim()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return JSON.parse(content);
|
||||
}
|
||||
|
||||
@@ -146,9 +151,11 @@ class Note extends Entity {
|
||||
throw new Error(`Cannot set null content to note ${this.noteId}`);
|
||||
}
|
||||
|
||||
content = Buffer.isBuffer(content) ? content : Buffer.from(content);
|
||||
|
||||
// force updating note itself so that dateModified is represented correctly even for the content
|
||||
this.forcedChange = true;
|
||||
this.contentLength = content.length;
|
||||
this.contentLength = content.byteLength;
|
||||
await this.save();
|
||||
|
||||
this.content = content;
|
||||
@@ -157,7 +164,7 @@ class Note extends Entity {
|
||||
noteId: this.noteId,
|
||||
content: content,
|
||||
utcDateModified: dateUtils.utcNowDateTime(),
|
||||
hash: utils.hash(this.noteId + "|" + content)
|
||||
hash: utils.hash(this.noteId + "|" + content.toString())
|
||||
};
|
||||
|
||||
if (this.isProtected) {
|
||||
@@ -832,8 +839,10 @@ class Note extends Entity {
|
||||
FROM attributes
|
||||
WHERE noteId = ? AND
|
||||
isDeleted = 0 AND
|
||||
type = 'relation' AND
|
||||
name IN ('internalLink', 'imageLink', 'relationMapLink')`, [this.noteId]);
|
||||
((type = 'relation' AND
|
||||
name IN ('internalLink', 'imageLink', 'relationMapLink', 'includeNoteLink'))
|
||||
OR
|
||||
(type = 'label' AND name = 'externalLink'))`, [this.noteId]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -276,6 +276,7 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||
|
||||
/**
|
||||
* @method
|
||||
* @deprecated please use createNote() API method instead
|
||||
*
|
||||
* @param {string} parentNoteId - create new note under this parent
|
||||
* @param {string} title
|
||||
|
||||
@@ -183,7 +183,65 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line6">line 6</a>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line11">line 11</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="isDeleted"><span class="type-signature"></span>isDeleted<span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line23">line 23</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -241,7 +299,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line16">line 16</a>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line21">line 21</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -299,7 +357,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line8">line 8</a>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line13">line 13</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -357,7 +415,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line12">line 12</a>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line17">line 17</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -415,7 +473,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line10">line 10</a>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line15">line 15</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -473,7 +531,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line14">line 14</a>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line19">line 19</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -549,7 +607,109 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line20">line 20</a>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line27">line 27</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
|
||||
|
||||
<dl>
|
||||
<dt>
|
||||
Type
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type"><a href="NoteShort.html">NoteShort</a></span>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="getParentNote"><span class="type-signature">(async) </span>getParentNote<span class="signature">()</span><span class="type-signature"> → {<a href="NoteShort.html">NoteShort</a>}</span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line32">line 32</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -651,7 +811,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line25">line 25</a>
|
||||
<a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line37">line 37</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -719,7 +879,7 @@
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteFull.html">NoteFull</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
</nav>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,522 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>JSDoc: Class: NoteComplement</title>
|
||||
|
||||
<script src="scripts/prettify/prettify.js"> </script>
|
||||
<script src="scripts/prettify/lang-css.js"> </script>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="main">
|
||||
|
||||
<h1 class="page-title">Class: NoteComplement</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
|
||||
<header>
|
||||
|
||||
<h2><span class="attribs"><span class="type-signature"></span></span>NoteComplement<span class="signature">()</span><span class="type-signature"></span></h2>
|
||||
|
||||
<div class="class-description">Complements the NoteShort with the main note content and other extra attributes</div>
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<article>
|
||||
<div class="container-overview">
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Constructor</h2>
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="NoteComplement"><span class="type-signature"></span>new NoteComplement<span class="signature">()</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line5">line 5</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 class="subsection-title">Members</h3>
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="content"><span class="type-signature"></span>content<span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line10">line 10</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="dateCreated"><span class="type-signature"></span>dateCreated<span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line13">line 13</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="dateModified"><span class="type-signature"></span>dateModified<span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line16">line 16</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="noteId"><span class="type-signature"></span>noteId<span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line7">line 7</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="utcDateCreated"><span class="type-signature"></span>utcDateCreated<span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line19">line 19</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="utcDateModified"><span class="type-signature"></span>utcDateModified<span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line22">line 22</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
</nav>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
<script src="scripts/linenumber.js"> </script>
|
||||
</body>
|
||||
</html>
|
||||
+2424
-385
File diff suppressed because it is too large
Load Diff
@@ -29,6 +29,11 @@
|
||||
<pre class="prettyprint source linenums"><code>class Attribute {
|
||||
constructor(treeCache, row) {
|
||||
this.treeCache = treeCache;
|
||||
|
||||
this.update(row);
|
||||
}
|
||||
|
||||
update(row) {
|
||||
/** @param {string} attributeId */
|
||||
this.attributeId = row.attributeId;
|
||||
/** @param {string} noteId */
|
||||
@@ -43,12 +48,6 @@
|
||||
this.position = row.position;
|
||||
/** @param {boolean} isInheritable */
|
||||
this.isInheritable = row.isInheritable;
|
||||
/** @param {boolean} isDeleted */
|
||||
this.isDeleted = row.isDeleted;
|
||||
/** @param {string} utcDateCreated */
|
||||
this.utcDateCreated = row.utcDateCreated;
|
||||
/** @param {string} utcDateModified */
|
||||
this.utcDateModified = row.utcDateModified;
|
||||
}
|
||||
|
||||
/** @returns {NoteShort} */
|
||||
@@ -57,7 +56,7 @@
|
||||
}
|
||||
|
||||
get toString() {
|
||||
return `Attribute(attributeId=${this.attributeId}, type=${this.type}, name=${this.name})`;
|
||||
return `Attribute(attributeId=${this.attributeId}, type=${this.type}, name=${this.name}, value=${this.value})`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +70,7 @@ export default Attribute;</code></pre>
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteFull.html">NoteFull</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
</nav>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
@@ -30,6 +30,11 @@
|
||||
class Branch {
|
||||
constructor(treeCache, row) {
|
||||
this.treeCache = treeCache;
|
||||
|
||||
this.update(row);
|
||||
}
|
||||
|
||||
update(row) {
|
||||
/** @param {string} primary key */
|
||||
this.branchId = row.branchId;
|
||||
/** @param {string} */
|
||||
@@ -42,6 +47,8 @@ class Branch {
|
||||
this.prefix = row.prefix;
|
||||
/** @param {boolean} */
|
||||
this.isExpanded = !!row.isExpanded;
|
||||
/** @param {boolean} */
|
||||
this.isDeleted = !!row.isDeleted;
|
||||
}
|
||||
|
||||
/** @returns {NoteShort} */
|
||||
@@ -49,6 +56,11 @@ class Branch {
|
||||
return this.treeCache.getNote(this.noteId);
|
||||
}
|
||||
|
||||
/** @returns {NoteShort} */
|
||||
async getParentNote() {
|
||||
return this.treeCache.getNote(this.parentNoteId);
|
||||
}
|
||||
|
||||
/** @returns {boolean} true if it's top level, meaning its parent is root note */
|
||||
isTopLevel() {
|
||||
return this.parentNoteId === 'root';
|
||||
@@ -69,7 +81,7 @@ export default Branch;</code></pre>
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteFull.html">NoteFull</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
</nav>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>JSDoc: Source: entities/note_complement.js</title>
|
||||
|
||||
<script src="scripts/prettify/prettify.js"> </script>
|
||||
<script src="scripts/prettify/lang-css.js"> </script>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="main">
|
||||
|
||||
<h1 class="page-title">Source: entities/note_complement.js</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<article>
|
||||
<pre class="prettyprint source linenums"><code>/**
|
||||
* Complements the NoteShort with the main note content and other extra attributes
|
||||
*/
|
||||
class NoteComplement {
|
||||
constructor(row) {
|
||||
/** @param {string} */
|
||||
this.noteId = row.noteId;
|
||||
|
||||
/** @param {string} */
|
||||
this.content = row.content;
|
||||
|
||||
/** @param {string} */
|
||||
this.dateCreated = row.dateCreated;
|
||||
|
||||
/** @param {string} */
|
||||
this.dateModified = row.dateModified;
|
||||
|
||||
/** @param {string} */
|
||||
this.utcDateCreated = row.utcDateCreated;
|
||||
|
||||
/** @param {string} */
|
||||
this.utcDateModified = row.utcDateModified;
|
||||
}
|
||||
}
|
||||
|
||||
export default NoteComplement;</code></pre>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
</nav>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a>
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
<script src="scripts/linenumber.js"> </script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -41,30 +41,15 @@ class NoteShort {
|
||||
/**
|
||||
* @param {TreeCache} treeCache
|
||||
* @param {Object.<string, Object>} row
|
||||
* @param {Branch[]} branches - all relevant branches, i.e. where this note is either child or parent
|
||||
*/
|
||||
constructor(treeCache, row, branches) {
|
||||
constructor(treeCache, row) {
|
||||
this.treeCache = treeCache;
|
||||
/** @param {string} */
|
||||
this.noteId = row.noteId;
|
||||
/** @param {string} */
|
||||
this.title = row.title;
|
||||
/** @param {int} */
|
||||
this.contentLength = row.contentLength;
|
||||
/** @param {boolean} */
|
||||
this.isProtected = row.isProtected;
|
||||
/** @param {string} one of 'text', 'code', 'file' or 'render' */
|
||||
this.type = row.type;
|
||||
/** @param {string} content-type, e.g. "application/json" */
|
||||
this.mime = row.mime;
|
||||
/** @param {boolean} */
|
||||
this.isDeleted = row.isDeleted;
|
||||
/** @param {boolean} */
|
||||
this.archived = row.archived;
|
||||
/** @param {string} */
|
||||
this.cssClass = row.cssClass;
|
||||
/** @param {string} */
|
||||
this.iconClass = row.iconClass;
|
||||
|
||||
/** @type {string[]} */
|
||||
this.attributes = [];
|
||||
|
||||
/** @type {string[]} */
|
||||
this.targetRelations = [];
|
||||
|
||||
/** @type {string[]} */
|
||||
this.parents = [];
|
||||
@@ -77,19 +62,24 @@ class NoteShort {
|
||||
/** @type {Object.<string, string>} */
|
||||
this.childToBranch = {};
|
||||
|
||||
for (const branch of branches) {
|
||||
if (this.noteId === branch.noteId) {
|
||||
this.parents.push(branch.parentNoteId);
|
||||
this.parentToBranch[branch.parentNoteId] = branch.branchId;
|
||||
}
|
||||
else if (this.noteId === branch.parentNoteId) {
|
||||
this.children.push(branch.noteId);
|
||||
this.childToBranch[branch.noteId] = branch.branchId;
|
||||
}
|
||||
else {
|
||||
throw new Error(`Unknown branch ${branch.branchId} for note ${this.noteId}`);
|
||||
}
|
||||
}
|
||||
this.update(row);
|
||||
}
|
||||
|
||||
update(row) {
|
||||
/** @param {string} */
|
||||
this.noteId = row.noteId;
|
||||
/** @param {string} */
|
||||
this.title = row.title;
|
||||
/** @param {int} */
|
||||
this.contentLength = row.contentLength;
|
||||
/** @param {boolean} */
|
||||
this.isProtected = !!row.isProtected;
|
||||
/** @param {string} one of 'text', 'code', 'file' or 'render' */
|
||||
this.type = row.type;
|
||||
/** @param {string} content-type, e.g. "application/json" */
|
||||
this.mime = row.mime;
|
||||
/** @param {boolean} */
|
||||
this.isDeleted = row.isDeleted;
|
||||
}
|
||||
|
||||
addParent(parentNoteId, branchId) {
|
||||
@@ -141,8 +131,13 @@ class NoteShort {
|
||||
}
|
||||
}
|
||||
|
||||
/** @returns {Promise<Branch[]>} */
|
||||
async getBranches() {
|
||||
/** @returns {string[]} */
|
||||
getBranchIds() {
|
||||
return Object.values(this.parentToBranch);
|
||||
}
|
||||
|
||||
/** @returns {Branch[]} */
|
||||
getBranches() {
|
||||
const branchIds = Object.values(this.parentToBranch);
|
||||
|
||||
return this.treeCache.getBranches(branchIds);
|
||||
@@ -153,8 +148,8 @@ class NoteShort {
|
||||
return this.children.length > 0;
|
||||
}
|
||||
|
||||
/** @returns {Promise<Branch[]>} */
|
||||
async getChildBranches() {
|
||||
/** @returns {Branch[]} */
|
||||
getChildBranches() {
|
||||
// don't use Object.values() to guarantee order
|
||||
const branchIds = this.children.map(childNoteId => this.childToBranch[childNoteId]);
|
||||
|
||||
@@ -166,9 +161,9 @@ class NoteShort {
|
||||
return this.parents;
|
||||
}
|
||||
|
||||
/** @returns {Promise<NoteShort[]>} */
|
||||
async getParentNotes() {
|
||||
return await this.treeCache.getNotes(this.parents);
|
||||
/** @returns {NoteShort[]} */
|
||||
getParentNotes() {
|
||||
return this.treeCache.getNotesFromCache(this.parents);
|
||||
}
|
||||
|
||||
/** @returns {string[]} */
|
||||
@@ -184,126 +179,246 @@ class NoteShort {
|
||||
/**
|
||||
* @param {string} [type] - (optional) attribute type to filter
|
||||
* @param {string} [name] - (optional) attribute name to filter
|
||||
* @returns {Promise<Attribute[]>} all note's attributes, including inherited ones
|
||||
* @returns {Attribute[]} all note's attributes, including inherited ones
|
||||
*/
|
||||
async getAttributes(type, name) {
|
||||
if (!this.__attributeCache) {
|
||||
this.__attributeCache = (await server.get('notes/' + this.noteId + '/attributes'))
|
||||
.map(attrRow => new Attribute(this.treeCache, attrRow));
|
||||
getOwnedAttributes(type, name) {
|
||||
const attrs = this.attributes
|
||||
.map(attributeId => this.treeCache.attributes[attributeId])
|
||||
.filter(attr => !!attr);
|
||||
|
||||
return this.__filterAttrs(attrs, type, name)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} [type] - (optional) attribute type to filter
|
||||
* @param {string} [name] - (optional) attribute name to filter
|
||||
* @returns {Attribute[]} all note's attributes, including inherited ones
|
||||
*/
|
||||
getAttributes(type, name) {
|
||||
const ownedAttributes = this.getOwnedAttributes();
|
||||
|
||||
const attrArrs = [
|
||||
ownedAttributes
|
||||
];
|
||||
|
||||
for (const templateAttr of ownedAttributes.filter(oa => oa.type === 'relation' && oa.name === 'template')) {
|
||||
const templateNote = this.treeCache.getNoteFromCache(templateAttr.value);
|
||||
|
||||
if (templateNote) {
|
||||
attrArrs.push(templateNote.getAttributes());
|
||||
}
|
||||
}
|
||||
|
||||
if (this.noteId !== 'root') {
|
||||
for (const parentNote of this.getParentNotes()) {
|
||||
attrArrs.push(parentNote.getInheritableAttributes());
|
||||
}
|
||||
}
|
||||
|
||||
const attributes = attrArrs.flat();
|
||||
|
||||
return this.__filterAttrs(attributes, type, name);
|
||||
}
|
||||
|
||||
__filterAttrs(attributes, type, name) {
|
||||
if (type && name) {
|
||||
return this.__attributeCache.filter(attr => attr.type === type && attr.name === name);
|
||||
}
|
||||
else if (type) {
|
||||
return this.__attributeCache.filter(attr => attr.type === type);
|
||||
}
|
||||
else if (name) {
|
||||
return this.__attributeCache.filter(attr => attr.name === name);
|
||||
}
|
||||
else {
|
||||
return this.__attributeCache.slice();
|
||||
return attributes.filter(attr => attr.type === type && attr.name === name);
|
||||
} else if (type) {
|
||||
return attributes.filter(attr => attr.type === type);
|
||||
} else if (name) {
|
||||
return attributes.filter(attr => attr.name === name);
|
||||
} else {
|
||||
return attributes;
|
||||
}
|
||||
}
|
||||
|
||||
getInheritableAttributes() {
|
||||
const attrs = this.getAttributes();
|
||||
|
||||
return attrs.filter(attr => attr.isInheritable);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} [name] - label name to filter
|
||||
* @returns {Promise<Attribute[]>} all note's labels (attributes with type label), including inherited ones
|
||||
* @returns {Attribute[]} all note's labels (attributes with type label), including inherited ones
|
||||
*/
|
||||
async getLabels(name) {
|
||||
return await this.getAttributes(LABEL, name);
|
||||
getOwnedLabels(name) {
|
||||
return this.getOwnedAttributes(LABEL, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} [name] - label name to filter
|
||||
* @returns {Promise<Attribute[]>} all note's label definitions, including inherited ones
|
||||
* @returns {Attribute[]} all note's labels (attributes with type label), including inherited ones
|
||||
*/
|
||||
async getLabelDefinitions(name) {
|
||||
return await this.getAttributes(LABEL_DEFINITION, name);
|
||||
getLabels(name) {
|
||||
return this.getAttributes(LABEL, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} [name] - label name to filter
|
||||
* @returns {Attribute[]} all note's label definitions, including inherited ones
|
||||
*/
|
||||
getLabelDefinitions(name) {
|
||||
return this.getAttributes(LABEL_DEFINITION, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} [name] - relation name to filter
|
||||
* @returns {Promise<Attribute[]>} all note's relations (attributes with type relation), including inherited ones
|
||||
* @returns {Attribute[]} all note's relations (attributes with type relation), including inherited ones
|
||||
*/
|
||||
async getRelations(name) {
|
||||
return await this.getAttributes(RELATION, name);
|
||||
getOwnedRelations(name) {
|
||||
return this.getOwnedAttributes(RELATION, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} [name] - relation name to filter
|
||||
* @returns {Promise<Attribute[]>} all note's relation definitions including inherited ones
|
||||
* @returns {Attribute[]} all note's relations (attributes with type relation), including inherited ones
|
||||
*/
|
||||
async getRelationDefinitions(name) {
|
||||
return await this.getAttributes(RELATION_DEFINITION, name);
|
||||
getRelations(name) {
|
||||
return this.getAttributes(RELATION, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} [name] - relation name to filter
|
||||
* @returns {Attribute[]} all note's relation definitions including inherited ones
|
||||
*/
|
||||
getRelationDefinitions(name) {
|
||||
return this.getAttributes(RELATION_DEFINITION, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} type - attribute type (label, relation, etc.)
|
||||
* @param {string} name - attribute name
|
||||
* @returns {Promise<boolean>} true if note has an attribute with given type and name (including inherited)
|
||||
* @returns {boolean} true if note has an attribute with given type and name (including inherited)
|
||||
*/
|
||||
async hasAttribute(type, name) {
|
||||
return !!await this.getAttribute(type, name);
|
||||
hasAttribute(type, name) {
|
||||
return !!this.getAttribute(type, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} type - attribute type (label, relation, etc.)
|
||||
* @param {string} name - attribute name
|
||||
* @returns {Promise<Attribute>} attribute of given type and name. If there's more such attributes, first is returned. Returns null if there's no such attribute belonging to this note.
|
||||
* @returns {boolean} true if note has an attribute with given type and name (including inherited)
|
||||
*/
|
||||
async getAttribute(type, name) {
|
||||
const attributes = await this.getAttributes();
|
||||
|
||||
return attributes.find(attr => attr.type === type && attr.name === name);
|
||||
hasOwnedAttribute(type, name) {
|
||||
return !!this.getOwnedAttribute(type, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} type - attribute type (label, relation, etc.)
|
||||
* @param {string} name - attribute name
|
||||
* @returns {Promise<string>} attribute value of given type and name or null if no such attribute exists.
|
||||
* @returns {Attribute} attribute of given type and name. If there's more such attributes, first is returned. Returns null if there's no such attribute belonging to this note.
|
||||
*/
|
||||
async getAttributeValue(type, name) {
|
||||
const attr = await this.getAttribute(type, name);
|
||||
getOwnedAttribute(type, name) {
|
||||
const attributes = this.getOwnedAttributes(type, name);
|
||||
|
||||
return attributes.length > 0 ? attributes[0] : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} type - attribute type (label, relation, etc.)
|
||||
* @param {string} name - attribute name
|
||||
* @returns {Attribute} attribute of given type and name. If there's more such attributes, first is returned. Returns null if there's no such attribute belonging to this note.
|
||||
*/
|
||||
getAttribute(type, name) {
|
||||
const attributes = this.getAttributes(type, name);
|
||||
|
||||
return attributes.length > 0 ? attributes[0] : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} type - attribute type (label, relation, etc.)
|
||||
* @param {string} name - attribute name
|
||||
* @returns {string} attribute value of given type and name or null if no such attribute exists.
|
||||
*/
|
||||
getOwnedAttributeValue(type, name) {
|
||||
const attr = this.getOwnedAttribute(type, name);
|
||||
|
||||
return attr ? attr.value : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} type - attribute type (label, relation, etc.)
|
||||
* @param {string} name - attribute name
|
||||
* @returns {string} attribute value of given type and name or null if no such attribute exists.
|
||||
*/
|
||||
getAttributeValue(type, name) {
|
||||
const attr = this.getAttribute(type, name);
|
||||
|
||||
return attr ? attr.value : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} name - label name
|
||||
* @returns {Promise<boolean>} true if label exists (including inherited)
|
||||
* @returns {boolean} true if label exists (excluding inherited)
|
||||
*/
|
||||
async hasLabel(name) { return await this.hasAttribute(LABEL, name); }
|
||||
|
||||
/**
|
||||
* @param {string} name - relation name
|
||||
* @returns {Promise<boolean>} true if relation exists (including inherited)
|
||||
*/
|
||||
async hasRelation(name) { return await this.hasAttribute(RELATION, name); }
|
||||
hasOwnedLabel(name) { return this.hasOwnedAttribute(LABEL, name); }
|
||||
|
||||
/**
|
||||
* @param {string} name - label name
|
||||
* @returns {Promise<Attribute>} label if it exists, null otherwise
|
||||
* @returns {boolean} true if label exists (including inherited)
|
||||
*/
|
||||
async getLabel(name) { return await this.getAttribute(LABEL, name); }
|
||||
hasLabel(name) { return this.hasAttribute(LABEL, name); }
|
||||
|
||||
/**
|
||||
* @param {string} name - relation name
|
||||
* @returns {Promise<Attribute>} relation if it exists, null otherwise
|
||||
* @returns {boolean} true if relation exists (excluding inherited)
|
||||
*/
|
||||
async getRelation(name) { return await this.getAttribute(RELATION, name); }
|
||||
hasOwnedRelation(name) { return this.hasOwnedAttribute(RELATION, name); }
|
||||
|
||||
/**
|
||||
* @param {string} name - relation name
|
||||
* @returns {boolean} true if relation exists (including inherited)
|
||||
*/
|
||||
hasRelation(name) { return this.hasAttribute(RELATION, name); }
|
||||
|
||||
/**
|
||||
* @param {string} name - label name
|
||||
* @returns {Promise<string>} label value if label exists, null otherwise
|
||||
* @returns {Attribute} label if it exists, null otherwise
|
||||
*/
|
||||
async getLabelValue(name) { return await this.getAttributeValue(LABEL, name); }
|
||||
getOwnedLabel(name) { return this.getOwnedAttribute(LABEL, name); }
|
||||
|
||||
/**
|
||||
* @param {string} name - label name
|
||||
* @returns {Attribute} label if it exists, null otherwise
|
||||
*/
|
||||
getLabel(name) { return this.getAttribute(LABEL, name); }
|
||||
|
||||
/**
|
||||
* @param {string} name - relation name
|
||||
* @returns {Promise<string>} relation value if relation exists, null otherwise
|
||||
* @returns {Attribute} relation if it exists, null otherwise
|
||||
*/
|
||||
async getRelationValue(name) { return await this.getAttributeValue(RELATION, name); }
|
||||
getOwnedRelation(name) { return this.getOwnedAttribute(RELATION, name); }
|
||||
|
||||
/**
|
||||
* @param {string} name - relation name
|
||||
* @returns {Attribute} relation if it exists, null otherwise
|
||||
*/
|
||||
getRelation(name) { return this.getAttribute(RELATION, name); }
|
||||
|
||||
/**
|
||||
* @param {string} name - label name
|
||||
* @returns {string} label value if label exists, null otherwise
|
||||
*/
|
||||
getOwnedLabelValue(name) { return this.getOwnedAttributeValue(LABEL, name); }
|
||||
|
||||
/**
|
||||
* @param {string} name - label name
|
||||
* @returns {string} label value if label exists, null otherwise
|
||||
*/
|
||||
getLabelValue(name) { return this.getAttributeValue(LABEL, name); }
|
||||
|
||||
/**
|
||||
* @param {string} name - relation name
|
||||
* @returns {string} relation value if relation exists, null otherwise
|
||||
*/
|
||||
getOwnedRelationValue(name) { return this.getOwnedAttributeValue(RELATION, name); }
|
||||
|
||||
/**
|
||||
* @param {string} name - relation name
|
||||
* @returns {string} relation value if relation exists, null otherwise
|
||||
*/
|
||||
getRelationValue(name) { return this.getAttributeValue(RELATION, name); }
|
||||
|
||||
/**
|
||||
* @param {string} name
|
||||
@@ -320,7 +435,7 @@ class NoteShort {
|
||||
* @returns {Promise<NoteShort[]>}
|
||||
*/
|
||||
async getRelationTargets(name) {
|
||||
const relations = await this.getRelations(name);
|
||||
const relations = this.getRelations(name);
|
||||
const targets = [];
|
||||
|
||||
for (const relation of relations) {
|
||||
@@ -334,18 +449,18 @@ class NoteShort {
|
||||
* Clear note's attributes cache to force fresh reload for next attribute request.
|
||||
* Cache is note instance scoped.
|
||||
*/
|
||||
invalidate__attributeCache() {
|
||||
invalidateAttributeCache() {
|
||||
this.__attributeCache = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get relations which target this note
|
||||
*
|
||||
* @returns {Promise<Attribute[]>}
|
||||
* @returns {Attribute[]}
|
||||
*/
|
||||
async getTargetRelations() {
|
||||
return (await server.get('notes/' + this.noteId + '/target-relations'))
|
||||
.map(attrRow => new Attribute(this.treeCache, attrRow));
|
||||
getTargetRelations() {
|
||||
return this.targetRelations
|
||||
.map(attributeId => this.treeCache.attributes[attributeId]);
|
||||
}
|
||||
|
||||
get toString() {
|
||||
@@ -355,11 +470,14 @@ class NoteShort {
|
||||
get dto() {
|
||||
const dto = Object.assign({}, this);
|
||||
delete dto.treeCache;
|
||||
delete dto.archived;
|
||||
delete dto.__attributeCache;
|
||||
|
||||
return dto;
|
||||
}
|
||||
|
||||
getCssClass() {
|
||||
const labels = this.getLabels('cssClass');
|
||||
return labels.map(l => l.value).join(' ');
|
||||
}
|
||||
}
|
||||
|
||||
export default NoteShort;</code></pre>
|
||||
@@ -372,7 +490,7 @@ export default NoteShort;</code></pre>
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteFull.html">NoteFull</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
</nav>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
@@ -303,7 +303,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line72">line 72</a>
|
||||
<a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line64">line 64</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@@ -333,7 +333,7 @@
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteFull.html">NoteFull</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
</nav>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteFull.html">NoteFull</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
</nav>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
@@ -32,13 +32,13 @@ import utils from './utils.js';
|
||||
import toastService from './toast.js';
|
||||
import linkService from './link.js';
|
||||
import treeCache from './tree_cache.js';
|
||||
import noteDetailService from './note_detail.js';
|
||||
import noteTooltipService from './note_tooltip.js';
|
||||
import protectedSessionService from './protected_session.js';
|
||||
import dateNotesService from './date_notes.js';
|
||||
import StandardWidget from '../widgets/standard_widget.js';
|
||||
import CollapsibleWidget from '../widgets/collapsible_widget.js';
|
||||
import ws from "./ws.js";
|
||||
import hoistedNoteService from "./hoisted_note.js";
|
||||
import appContext from "./app_context.js";
|
||||
|
||||
/**
|
||||
* This is the main frontend API interface for scripts. It's published in the local "api" object.
|
||||
@@ -46,7 +46,7 @@ import hoistedNoteService from "./hoisted_note.js";
|
||||
* @constructor
|
||||
* @hideconstructor
|
||||
*/
|
||||
function FrontendScriptApi(startNote, currentNote, originEntity = null, tabContext = null, $container = null) {
|
||||
function FrontendScriptApi(startNote, currentNote, originEntity = null, $container = null) {
|
||||
const $pluginButtons = $("#plugin-buttons");
|
||||
|
||||
/** @property {jQuery} container of all the rendered script content */
|
||||
@@ -62,11 +62,8 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte
|
||||
// to keep consistency with backend API
|
||||
this.dayjs = dayjs;
|
||||
|
||||
/** @property {TabContext|null} - experimental! */
|
||||
this.tabContext = tabContext;
|
||||
|
||||
/** @property {StandardWidget} */
|
||||
this.StandardWidget = StandardWidget;
|
||||
/** @property {CollapsibleWidget} */
|
||||
this.CollapsibleWidget = CollapsibleWidget;
|
||||
|
||||
/**
|
||||
* Activates note in the tree and in the note detail.
|
||||
@@ -75,14 +72,8 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte
|
||||
* @param {string} notePath (or noteId)
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
this.activateNote = async (notePath, noteLoadedListener) => {
|
||||
await treeService.activateNote(notePath, async () => {
|
||||
await treeService.scrollToActiveNote();
|
||||
|
||||
if (noteLoadedListener) {
|
||||
noteLoadedListener();
|
||||
}
|
||||
});
|
||||
this.activateNote = async notePath => {
|
||||
await appContext.tabManager.getActiveTabContext().setNote(notePath);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -94,7 +85,8 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte
|
||||
this.activateNewNote = async notePath => {
|
||||
await ws.waitForMaxKnownSyncId();
|
||||
|
||||
await treeService.activateNote(notePath, noteDetailService.focusAndSelectTitle);
|
||||
await appContext.tabManager.getActiveTabContext().setNote(notePath);
|
||||
appContext.triggerEvent('focusAndSelectTitle');
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -172,9 +164,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte
|
||||
currentNoteId: currentNote.noteId,
|
||||
originEntityName: "notes", // currently there's no other entity on frontend which can trigger event
|
||||
originEntityId: originEntity ? originEntity.noteId : null
|
||||
}, {
|
||||
'trilium-source-id': "script"
|
||||
});
|
||||
}, "script");
|
||||
|
||||
if (ret.success) {
|
||||
// wait until all the changes done in the script has been synced to frontend before continuing
|
||||
@@ -299,22 +289,6 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte
|
||||
*/
|
||||
this.refreshTree = treeService.reload;
|
||||
|
||||
/**
|
||||
* Refresh active tab
|
||||
*
|
||||
* @method
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
this.refreshActiveTab = noteDetailService.reload;
|
||||
|
||||
/**
|
||||
* Refresh current tab
|
||||
*
|
||||
* @method
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
this.refreshAllTabs = noteDetailService.reloadAllTabs;
|
||||
|
||||
/**
|
||||
* Create note link (jQuery object) for given note.
|
||||
*
|
||||
@@ -327,49 +301,30 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte
|
||||
/**
|
||||
* Adds given text to the editor cursor
|
||||
*
|
||||
* @param {string} text
|
||||
* @param {string} text - this must be clear text, HTML is not supported.
|
||||
* @method
|
||||
*/
|
||||
this.addTextToActiveTabEditor = linkService.addTextToEditor;
|
||||
this.addTextToActiveTabEditor = text => appContext.triggerCommand('addTextToActiveEditor', {text});
|
||||
|
||||
/**
|
||||
* @method
|
||||
* @returns {NoteFull} active note (loaded into right pane)
|
||||
* @returns {NoteShort} active note (loaded into right pane)
|
||||
*/
|
||||
this.getActiveTabNote = noteDetailService.getActiveTabNote;
|
||||
this.getActiveTabNote = () => appContext.tabManager.getActiveTabNote();
|
||||
|
||||
/**
|
||||
* See https://ckeditor.com/docs/ckeditor5/latest/api/module_core_editor_editor-Editor.html for a documentation on the returned instance.
|
||||
*
|
||||
* @method
|
||||
* @returns {Editor|null} CKEditor instance or null (e.g. if active note is not a text note)
|
||||
* @param callback - method receiving "textEditor" instance
|
||||
*/
|
||||
this.getActiveTabTextEditor = noteDetailService.getActiveEditor;
|
||||
this.getActiveTabTextEditor = callback => appContext.triggerCommand('executeInActiveEditor', {callback});
|
||||
|
||||
/**
|
||||
* @method
|
||||
* @returns {Promise<string|null>} returns note path of active note or null if there isn't active note
|
||||
*/
|
||||
this.getActiveTabNotePath = noteDetailService.getActiveTabNotePath;
|
||||
|
||||
/**
|
||||
* This method checks whether user navigated away from the note from which the scripts has been started.
|
||||
* This is necessary because script execution is async and by the time it is finished, the user might have
|
||||
* already navigated away from this page - the end result would be that script might return data for the wrong
|
||||
* note.
|
||||
*
|
||||
* @method
|
||||
* @return {boolean} returns true if the original note is still loaded, false if user switched to another
|
||||
*/
|
||||
this.isNoteStillActive = () => {
|
||||
return tabContext.note && this.originEntity.noteId === tabContext.note.noteId;
|
||||
};
|
||||
|
||||
/**
|
||||
* @method
|
||||
* @param {function} func - callback called on note change as user is typing (not necessarily tied to save event)
|
||||
*/
|
||||
this.onNoteChange = noteDetailService.onNoteChange;
|
||||
this.getActiveTabNotePath = () => appContext.tabManager.getActiveTabNotePath();
|
||||
|
||||
/**
|
||||
* @method
|
||||
@@ -378,9 +333,32 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte
|
||||
this.setupElementTooltip = noteTooltipService.setupElementTooltip;
|
||||
|
||||
/**
|
||||
* @deprecated use protectNote and protectSubtree instead
|
||||
* @method
|
||||
*/
|
||||
this.protectActiveNote = protectedSessionService.protectNoteAndSendToServer;
|
||||
this.protectActiveNote = async () => {
|
||||
const activeNote = appContext.tabManager.getActiveTabNote();
|
||||
|
||||
await protectedSessionService.protectNote(activeNote.noteId, true, false);
|
||||
};
|
||||
|
||||
/**
|
||||
* @method
|
||||
* @param {string} noteId
|
||||
* @param {boolean} protect - true to protect note, false to unprotect
|
||||
*/
|
||||
this.protectNote = async (noteId, protect) => {
|
||||
await protectedSessionService.protectNote(noteId, protect, false);
|
||||
};
|
||||
|
||||
/**
|
||||
* @method
|
||||
* @param {string} noteId
|
||||
* @param {boolean} protect - true to protect subtree, false to unprotect
|
||||
*/
|
||||
this.protectSubTree = async (noteId, protect) => {
|
||||
await protectedSessionService.protectNote(noteId, protect, true);
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns date-note for today. If it doesn't exist, it is automatically created.
|
||||
@@ -455,7 +433,7 @@ export default FrontendScriptApi;</code></pre>
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteFull.html">NoteFull</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteComplement.html">NoteComplement</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3>
|
||||
</nav>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
+6
-3
@@ -26,9 +26,9 @@ app.on('ready', async () => {
|
||||
|
||||
await sqlInit.dbConnection;
|
||||
|
||||
// if schema doesn't exist -> setup process
|
||||
// if schema exists, then we need to wait until the migration process is finished
|
||||
if (await sqlInit.schemaExists()) {
|
||||
// if db is not initialized -> setup process
|
||||
// if db is initialized, then we need to wait until the migration process is finished
|
||||
if (await sqlInit.isDbInitialized()) {
|
||||
await sqlInit.dbReady;
|
||||
|
||||
await windowService.createMainWindow();
|
||||
@@ -44,4 +44,7 @@ app.on('will-quit', () => {
|
||||
globalShortcut.unregisterAll();
|
||||
});
|
||||
|
||||
// this is to disable electron warning spam in the dev console (local development only)
|
||||
process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true';
|
||||
|
||||
require('./src/www');
|
||||
|
||||
Vendored
+3
-3
File diff suppressed because one or more lines are too long
+1859
-1232
File diff suppressed because it is too large
Load Diff
+1
-1
File diff suppressed because one or more lines are too long
Binary file not shown.
+1441
-1232
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 797 KiB After Width: | Height: | Size: 912 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Vendored
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+5
-1
@@ -46,10 +46,11 @@
|
||||
const errors = new eslint().verify(text, {
|
||||
root: true,
|
||||
parserOptions: {
|
||||
ecmaVersion: 2017
|
||||
ecmaVersion: 2019
|
||||
},
|
||||
extends: ['eslint:recommended', 'airbnb-base'],
|
||||
env: {
|
||||
'browser': true,
|
||||
'node': true
|
||||
},
|
||||
rules: {
|
||||
@@ -62,6 +63,9 @@
|
||||
'no-unused-vars': ['warn', { vars: 'local', args: 'after-used' }],
|
||||
'no-nested-ternary': 'off',
|
||||
'no-underscore-dangle': ['error', {'allow': ['_super', '_lookupFactory']}]
|
||||
},
|
||||
globals: {
|
||||
"api": "readonly"
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Vendored
+2
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
||||
/*! jQuery Fancytree Plugin - 2.34.0 - 2019-12-26T14:16:19Z
|
||||
/*! jQuery Fancytree Plugin - 2.35.0 - 2020-03-27T22:41:58Z
|
||||
* https://github.com/mar10/fancytree
|
||||
* Copyright (c) 2019 Martin Wendt; Licensed MIT
|
||||
* Copyright (c) 2020 Martin Wendt; Licensed MIT
|
||||
*/
|
||||
/*! jQuery UI - v1.12.1 - 2018-05-20
|
||||
* http://jqueryui.com
|
||||
@@ -1361,12 +1361,12 @@ var uniqueId = $.fn.extend( {
|
||||
* Tree view control with support for lazy loading and much more.
|
||||
* https://github.com/mar10/fancytree/
|
||||
*
|
||||
* Copyright (c) 2008-2019, Martin Wendt (https://wwWendt.de)
|
||||
* Copyright (c) 2008-2020, Martin Wendt (https://wwWendt.de)
|
||||
* Released under the MIT license
|
||||
* https://github.com/mar10/fancytree/wiki/LicenseInfo
|
||||
*
|
||||
* @version 2.34.0
|
||||
* @date 2019-12-26T14:16:19Z
|
||||
* @version 2.35.0
|
||||
* @date 2020-03-27T22:41:58Z
|
||||
*/
|
||||
|
||||
/** Core Fancytree module.
|
||||
@@ -1405,7 +1405,7 @@ var uniqueId = $.fn.extend( {
|
||||
REX_HTML = /[&<>"'/]/g, // Escape those characters
|
||||
REX_TOOLTIP = /[<>"'/]/g, // Don't escape `&` in tooltips
|
||||
RECURSIVE_REQUEST_ERROR = "$recursive_request",
|
||||
// CLIPBOARD = null,
|
||||
INVALID_REQUEST_TARGET_ERROR = "$request_target_invalid",
|
||||
ENTITY_MAP = {
|
||||
"&": "&",
|
||||
"<": "<",
|
||||
@@ -2206,7 +2206,7 @@ var uniqueId = $.fn.extend( {
|
||||
*
|
||||
* @param {FancytreeNode} node source node
|
||||
* @param {string} [mode=child] 'before' | 'after' | 'child'
|
||||
* @param {Function} [map] callback function(NodeData) that could modify the new node
|
||||
* @param {Function} [map] callback function(NodeData, FancytreeNode) that could modify the new node
|
||||
* @returns {FancytreeNode} new
|
||||
*/
|
||||
copyTo: function(node, mode, map) {
|
||||
@@ -2970,10 +2970,9 @@ var uniqueId = $.fn.extend( {
|
||||
* @deprecated since 2014-02-16: use load() instead.
|
||||
*/
|
||||
lazyLoad: function(discard) {
|
||||
this.warn(
|
||||
$.error(
|
||||
"FancytreeNode.lazyLoad() is deprecated since 2014-02-16. Use .load() instead."
|
||||
);
|
||||
return this.load(discard);
|
||||
},
|
||||
/**
|
||||
* Load all children of a lazy node if neccessary. The <i>expanded</i> state is maintained.
|
||||
@@ -3496,9 +3495,9 @@ var uniqueId = $.fn.extend( {
|
||||
|
||||
// this.debug("scrollIntoView(), scrollTop=" + scrollTop, opts.scrollOfs);
|
||||
// _assert($(this.span).is(":visible"), "scrollIntoView node is invisible"); // otherwise we cannot calc offsets
|
||||
if (!this.isVisible()) {
|
||||
if (this.isRootNode() || !this.isVisible()) {
|
||||
// We cannot calc offsets for hidden elements
|
||||
this.warn("scrollIntoView(): node is invisible.");
|
||||
this.info("scrollIntoView(): node is invisible.");
|
||||
return _getResolvedPromise();
|
||||
}
|
||||
if (isParentWindow) {
|
||||
@@ -3610,7 +3609,7 @@ var uniqueId = $.fn.extend( {
|
||||
return this.tree._callHook("nodeSetSelected", this, flag, opts);
|
||||
},
|
||||
/**Mark a lazy node as 'error', 'loading', 'nodata', or 'ok'.
|
||||
* @param {string} status 'error'|'empty'|'ok'
|
||||
* @param {string} status 'error'|'loading'|'nodata'|'ok'
|
||||
* @param {string} [message]
|
||||
* @param {string} [details]
|
||||
*/
|
||||
@@ -3671,7 +3670,7 @@ var uniqueId = $.fn.extend( {
|
||||
*
|
||||
* @param {boolean} [recursive=false] include child nodes
|
||||
* @param {function} [callback] callback(dict, node) is called for every node, in order to allow modifications.
|
||||
* Return `false` to ignore this node or "skip" to include this node without its children.
|
||||
* Return `false` to ignore this node or `"skip"` to include this node without its children.
|
||||
* @returns {NodeData}
|
||||
*/
|
||||
toDict: function(recursive, callback) {
|
||||
@@ -3703,7 +3702,7 @@ var uniqueId = $.fn.extend( {
|
||||
}
|
||||
}
|
||||
if (recursive) {
|
||||
if (this.hasChildren()) {
|
||||
if ($.isArray(this.children)) {
|
||||
dict.children = [];
|
||||
for (i = 0, l = this.children.length; i < l; i++) {
|
||||
node = this.children[i];
|
||||
@@ -4328,8 +4327,8 @@ var uniqueId = $.fn.extend( {
|
||||
// case "copy":
|
||||
// clipboard = {
|
||||
// mode: cmd,
|
||||
// data: node.toDict(function(n) {
|
||||
// delete n.key;
|
||||
// data: node.toDict(function(d, n) {
|
||||
// delete d.key;
|
||||
// }),
|
||||
// };
|
||||
// break;
|
||||
@@ -5613,12 +5612,16 @@ var uniqueId = $.fn.extend( {
|
||||
nodeLoadChildren: function(ctx, source) {
|
||||
var ajax,
|
||||
delay,
|
||||
dfd,
|
||||
res,
|
||||
ajaxDfd = null,
|
||||
resultDfd,
|
||||
isAsync = true,
|
||||
tree = ctx.tree,
|
||||
node = ctx.node,
|
||||
nodePrevParent = node.parent,
|
||||
tag = "nodeLoadChildren",
|
||||
requestId = Date.now();
|
||||
|
||||
// `source` is a callback: use the returned result instead:
|
||||
if ($.isFunction(source)) {
|
||||
source = source.call(tree, { type: "source" }, ctx);
|
||||
_assert(
|
||||
@@ -5626,23 +5629,15 @@ var uniqueId = $.fn.extend( {
|
||||
"source callback must not return another function"
|
||||
);
|
||||
}
|
||||
if (source.url) {
|
||||
if (node._requestId) {
|
||||
node.warn(
|
||||
"Recursive load request #" +
|
||||
requestId +
|
||||
" while #" +
|
||||
node._requestId +
|
||||
" is pending."
|
||||
);
|
||||
// } else {
|
||||
// node.debug("Send load request #" + requestId);
|
||||
}
|
||||
// `source` is already a promise:
|
||||
if ($.isFunction(source.then)) {
|
||||
// _assert($.isFunction(source.always), "Expected jQuery?");
|
||||
ajaxDfd = source;
|
||||
} else if (source.url) {
|
||||
// `source` is an Ajax options object
|
||||
ajax = $.extend({}, ctx.options.ajax, source);
|
||||
node._requestId = requestId;
|
||||
if (ajax.debugDelay) {
|
||||
// simulate a slow server
|
||||
// Simulate a slow server
|
||||
delay = ajax.debugDelay;
|
||||
delete ajax.debugDelay; // remove debug option
|
||||
if ($.isArray(delay)) {
|
||||
@@ -5656,30 +5651,74 @@ var uniqueId = $.fn.extend( {
|
||||
Math.round(delay) +
|
||||
" ms ..."
|
||||
);
|
||||
dfd = $.Deferred(function(dfd) {
|
||||
ajaxDfd = $.Deferred(function(ajaxDfd) {
|
||||
setTimeout(function() {
|
||||
$.ajax(ajax)
|
||||
.done(function() {
|
||||
dfd.resolveWith(this, arguments);
|
||||
ajaxDfd.resolveWith(this, arguments);
|
||||
})
|
||||
.fail(function() {
|
||||
dfd.rejectWith(this, arguments);
|
||||
ajaxDfd.rejectWith(this, arguments);
|
||||
});
|
||||
}, delay);
|
||||
});
|
||||
} else {
|
||||
dfd = $.ajax(ajax);
|
||||
ajaxDfd = $.ajax(ajax);
|
||||
}
|
||||
} else if ($.isPlainObject(source) || $.isArray(source)) {
|
||||
// `source` is already a constant dict or list, but we convert
|
||||
// to a thenable for unified processing.
|
||||
// 2020-01-03: refactored.
|
||||
// `ajaxDfd = $.when(source)` would do the trick, but the returned
|
||||
// promise will resolve async, which broke some tests and
|
||||
// would probably also break current implementations out there.
|
||||
// So we mock-up a thenable that resolves synchronously:
|
||||
ajaxDfd = {
|
||||
then: function(resolve, reject) {
|
||||
resolve(source, null, null);
|
||||
},
|
||||
};
|
||||
isAsync = false;
|
||||
} else {
|
||||
$.error("Invalid source type: " + source);
|
||||
}
|
||||
|
||||
// Defer the deferred: we want to be able to reject, even if ajax
|
||||
// resolved ok.
|
||||
source = new $.Deferred();
|
||||
dfd.done(function(data, textStatus, jqXHR) {
|
||||
// Check for overlapping requests
|
||||
if (node._requestId) {
|
||||
node.warn(
|
||||
"Recursive load request #" +
|
||||
requestId +
|
||||
" while #" +
|
||||
node._requestId +
|
||||
" is pending."
|
||||
);
|
||||
node._requestId = requestId;
|
||||
// node.debug("Send load request #" + requestId);
|
||||
}
|
||||
|
||||
if (isAsync) {
|
||||
tree.debugTime(tag);
|
||||
tree.nodeSetStatus(ctx, "loading");
|
||||
}
|
||||
|
||||
// The async Ajax request has now started...
|
||||
// Defer the deferred:
|
||||
// we want to be able to reject invalid responses, even if
|
||||
// the raw HTTP Ajax XHR resolved as Ok.
|
||||
// We use the ajaxDfd.then() syntax here, which is compatible with
|
||||
// jQuery and ECMA6.
|
||||
// However resultDfd is a jQuery deferred, which is currently the
|
||||
// expected result type of nodeLoadChildren()
|
||||
resultDfd = new $.Deferred();
|
||||
ajaxDfd.then(
|
||||
function(data, textStatus, jqXHR) {
|
||||
// ajaxDfd was resolved, but we reject or resolve resultDfd
|
||||
// depending on the response data
|
||||
var errorObj, res;
|
||||
|
||||
if (
|
||||
(this.dataType === "json" ||
|
||||
this.dataType === "jsonp") &&
|
||||
(source.dataType === "json" ||
|
||||
source.dataType === "jsonp") &&
|
||||
typeof data === "string"
|
||||
) {
|
||||
$.error(
|
||||
@@ -5690,21 +5729,28 @@ var uniqueId = $.fn.extend( {
|
||||
// The expected request time stamp is later than `requestId`
|
||||
// (which was kept as as closure variable to this handler function)
|
||||
// node.warn("Ignored load response for obsolete request #" + requestId + " (expected #" + node._requestId + ")");
|
||||
source.rejectWith(this, [RECURSIVE_REQUEST_ERROR]);
|
||||
resultDfd.rejectWith(this, [
|
||||
RECURSIVE_REQUEST_ERROR,
|
||||
]);
|
||||
return;
|
||||
// } else {
|
||||
// node.debug("Response returned for load request #" + requestId);
|
||||
}
|
||||
// postProcess is similar to the standard ajax dataFilter hook,
|
||||
// but it is also called for JSONP
|
||||
if (node.parent === null && nodePrevParent !== null) {
|
||||
resultDfd.rejectWith(this, [
|
||||
INVALID_REQUEST_TARGET_ERROR,
|
||||
]);
|
||||
return;
|
||||
}
|
||||
// Allow to adjust the received response data in the `postProcess` event.
|
||||
if (ctx.options.postProcess) {
|
||||
// The handler may either
|
||||
// - modify `ctx.response` in-place (and leave `ctx.result` undefined)
|
||||
// => res = undefined
|
||||
// - return a replacement in `ctx.result`
|
||||
// => res = <new data>
|
||||
// If res contains an `error` property, an error status is displayed
|
||||
try {
|
||||
// The handler may either
|
||||
// - modify `ctx.response` in-place (and leave `ctx.result` undefined)
|
||||
// => res = undefined
|
||||
// - return a replacement in `ctx.result`
|
||||
// => res = <new data>
|
||||
// If res contains an `error` property, an error status is displayed
|
||||
res = tree._triggerNodeEvent(
|
||||
"postProcess",
|
||||
ctx,
|
||||
@@ -5712,7 +5758,7 @@ var uniqueId = $.fn.extend( {
|
||||
{
|
||||
response: data,
|
||||
error: null,
|
||||
dataType: this.dataType,
|
||||
dataType: source.dataType,
|
||||
}
|
||||
);
|
||||
} catch (e) {
|
||||
@@ -5723,6 +5769,8 @@ var uniqueId = $.fn.extend( {
|
||||
};
|
||||
}
|
||||
if (res.error) {
|
||||
// Either postProcess failed with an exception, or the returned
|
||||
// result object has an 'error' property attached:
|
||||
errorObj = $.isPlainObject(res.error)
|
||||
? res.error
|
||||
: { message: res.error };
|
||||
@@ -5731,7 +5779,7 @@ var uniqueId = $.fn.extend( {
|
||||
null,
|
||||
errorObj
|
||||
);
|
||||
source.rejectWith(this, [errorObj]);
|
||||
resultDfd.rejectWith(this, [errorObj]);
|
||||
return;
|
||||
}
|
||||
if (
|
||||
@@ -5749,175 +5797,158 @@ var uniqueId = $.fn.extend( {
|
||||
ctx.options.enableAspx
|
||||
) {
|
||||
// Process ASPX WebMethod JSON object inside "d" property
|
||||
// (only if no postProcess event was defined)
|
||||
if (ctx.options.enableAspx === 42) {
|
||||
tree.warn(
|
||||
"The default for enableAspx will change to `false` in the fututure. " +
|
||||
"Pass `enableAspx: true` or implement postProcess to silence this warning."
|
||||
);
|
||||
}
|
||||
data =
|
||||
typeof data.d === "string"
|
||||
? $.parseJSON(data.d)
|
||||
: data.d;
|
||||
}
|
||||
source.resolveWith(this, [data]);
|
||||
}).fail(function(jqXHR, textStatus, errorThrown) {
|
||||
resultDfd.resolveWith(this, [data]);
|
||||
},
|
||||
function(jqXHR, textStatus, errorThrown) {
|
||||
// ajaxDfd was rejected, so we reject resultDfd as well
|
||||
var errorObj = tree._makeHookContext(node, null, {
|
||||
error: jqXHR,
|
||||
args: Array.prototype.slice.call(arguments),
|
||||
message: errorThrown,
|
||||
details: jqXHR.status + ": " + errorThrown,
|
||||
});
|
||||
source.rejectWith(this, [errorObj]);
|
||||
});
|
||||
}
|
||||
// #383: accept and convert ECMAScript 6 Promise
|
||||
if ($.isFunction(source.then) && $.isFunction(source.catch)) {
|
||||
dfd = source;
|
||||
source = new $.Deferred();
|
||||
dfd.then(
|
||||
function(value) {
|
||||
source.resolve(value);
|
||||
},
|
||||
function(reason) {
|
||||
source.reject(reason);
|
||||
}
|
||||
);
|
||||
}
|
||||
if ($.isFunction(source.promise)) {
|
||||
// `source` is a deferred, i.e. ajax request
|
||||
// _assert(!node.isLoading(), "recursive load");
|
||||
tree.nodeSetStatus(ctx, "loading");
|
||||
resultDfd.rejectWith(this, [errorObj]);
|
||||
}
|
||||
);
|
||||
|
||||
source
|
||||
.done(function(children) {
|
||||
tree.nodeSetStatus(ctx, "ok");
|
||||
node._requestId = null;
|
||||
})
|
||||
.fail(function(error) {
|
||||
var ctxErr;
|
||||
// The async Ajax request has now started.
|
||||
// resultDfd will be resolved/rejected after the response arrived,
|
||||
// was postProcessed, and checked.
|
||||
// Now we implement the UI update and add the data to the tree.
|
||||
// We also return this promise to the caller.
|
||||
resultDfd
|
||||
.done(function(data) {
|
||||
tree.nodeSetStatus(ctx, "ok");
|
||||
var children, metaData, noDataRes;
|
||||
|
||||
if (error === RECURSIVE_REQUEST_ERROR) {
|
||||
node.warn(
|
||||
"Ignored response for obsolete load request #" +
|
||||
requestId +
|
||||
" (expected #" +
|
||||
node._requestId +
|
||||
")"
|
||||
);
|
||||
return;
|
||||
} else if (
|
||||
error.node &&
|
||||
error.error &&
|
||||
error.message
|
||||
) {
|
||||
// error is already a context object
|
||||
ctxErr = error;
|
||||
} else {
|
||||
ctxErr = tree._makeHookContext(node, null, {
|
||||
error: error, // it can be jqXHR or any custom error
|
||||
args: Array.prototype.slice.call(arguments),
|
||||
message: error
|
||||
? error.message || error.toString()
|
||||
: "",
|
||||
});
|
||||
if (ctxErr.message === "[object Object]") {
|
||||
ctxErr.message = "";
|
||||
if ($.isPlainObject(data)) {
|
||||
// We got {foo: 'abc', children: [...]}
|
||||
// Copy extra properties to tree.data.foo
|
||||
_assert(
|
||||
node.isRootNode(),
|
||||
"source may only be an object for root nodes (expecting an array of child objects otherwise)"
|
||||
);
|
||||
_assert(
|
||||
$.isArray(data.children),
|
||||
"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')"
|
||||
);
|
||||
metaData = data;
|
||||
children = data.children;
|
||||
delete metaData.children;
|
||||
// Copy some attributes to tree.data
|
||||
$.each(TREE_ATTRS, function(i, attr) {
|
||||
if (metaData[attr] !== undefined) {
|
||||
tree[attr] = metaData[attr];
|
||||
delete metaData[attr];
|
||||
}
|
||||
}
|
||||
node.warn(
|
||||
"Load children failed (" + ctxErr.message + ")",
|
||||
ctxErr
|
||||
);
|
||||
if (
|
||||
tree._triggerNodeEvent(
|
||||
"loadError",
|
||||
ctxErr,
|
||||
null
|
||||
) !== false
|
||||
) {
|
||||
tree.nodeSetStatus(
|
||||
ctx,
|
||||
"error",
|
||||
ctxErr.message,
|
||||
ctxErr.details
|
||||
});
|
||||
// Copy all other attributes to tree.data.NAME
|
||||
$.extend(tree.data, metaData);
|
||||
} else {
|
||||
children = data;
|
||||
}
|
||||
_assert(
|
||||
$.isArray(children),
|
||||
"expected array of children"
|
||||
);
|
||||
node._setChildren(children);
|
||||
|
||||
if (tree.options.nodata && children.length === 0) {
|
||||
if ($.isFunction(tree.options.nodata)) {
|
||||
noDataRes = tree.options.nodata.call(
|
||||
tree,
|
||||
{ type: "nodata" },
|
||||
ctx
|
||||
);
|
||||
} else if (
|
||||
tree.options.nodata === true &&
|
||||
node.isRootNode()
|
||||
) {
|
||||
noDataRes = tree.options.strings.noData;
|
||||
} else if (
|
||||
typeof tree.options.nodata === "string" &&
|
||||
node.isRootNode()
|
||||
) {
|
||||
noDataRes = tree.options.nodata;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (ctx.options.postProcess) {
|
||||
// #792: Call postProcess for non-deferred source
|
||||
res = tree._triggerNodeEvent(
|
||||
"postProcess",
|
||||
ctx,
|
||||
ctx.originalEvent,
|
||||
{
|
||||
response: source,
|
||||
error: null,
|
||||
dataType: typeof source,
|
||||
if (noDataRes) {
|
||||
node.setStatus("nodata", noDataRes);
|
||||
}
|
||||
);
|
||||
|
||||
if (
|
||||
$.isArray(res) ||
|
||||
($.isPlainObject(res) && $.isArray(res.children))
|
||||
) {
|
||||
// Use `ctx.result` if valid
|
||||
// (otherwise use existing data, which may have been modified in-place)
|
||||
source = res;
|
||||
}
|
||||
}
|
||||
}
|
||||
// $.when(source) resolves also for non-deferreds
|
||||
return $.when(source).done(function(children) {
|
||||
var metaData, noDataRes;
|
||||
// trigger fancytreeloadchildren
|
||||
tree._triggerNodeEvent("loadChildren", node);
|
||||
})
|
||||
.fail(function(error) {
|
||||
var ctxErr;
|
||||
|
||||
if ($.isPlainObject(children)) {
|
||||
// We got {foo: 'abc', children: [...]}
|
||||
// Copy extra properties to tree.data.foo
|
||||
_assert(
|
||||
node.isRootNode(),
|
||||
"source may only be an object for root nodes (expecting an array of child objects otherwise)"
|
||||
);
|
||||
_assert(
|
||||
$.isArray(children.children),
|
||||
"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')"
|
||||
);
|
||||
metaData = children;
|
||||
children = children.children;
|
||||
delete metaData.children;
|
||||
// Copy some attributes to tree.data
|
||||
$.each(TREE_ATTRS, function(i, attr) {
|
||||
if (metaData[attr] !== undefined) {
|
||||
tree[attr] = metaData[attr];
|
||||
delete metaData[attr];
|
||||
}
|
||||
});
|
||||
// Copy all other attributes to tree.data.NAME
|
||||
$.extend(tree.data, metaData);
|
||||
}
|
||||
_assert($.isArray(children), "expected array of children");
|
||||
node._setChildren(children);
|
||||
|
||||
if (tree.options.nodata && children.length === 0) {
|
||||
if ($.isFunction(tree.options.nodata)) {
|
||||
noDataRes = tree.options.nodata.call(
|
||||
tree,
|
||||
{ type: "nodata" },
|
||||
ctx
|
||||
if (error === RECURSIVE_REQUEST_ERROR) {
|
||||
node.warn(
|
||||
"Ignored response for obsolete load request #" +
|
||||
requestId +
|
||||
" (expected #" +
|
||||
node._requestId +
|
||||
")"
|
||||
);
|
||||
} else if (
|
||||
tree.options.nodata === true &&
|
||||
node.isRootNode()
|
||||
) {
|
||||
noDataRes = tree.options.strings.nodata;
|
||||
} else if (
|
||||
typeof tree.options.nodata === "string" &&
|
||||
node.isRootNode()
|
||||
) {
|
||||
noDataRes = tree.options.nodata;
|
||||
return;
|
||||
} else if (error === INVALID_REQUEST_TARGET_ERROR) {
|
||||
node.warn(
|
||||
"Lazy parent node was removed while loading: discarding response."
|
||||
);
|
||||
return;
|
||||
} else if (error.node && error.error && error.message) {
|
||||
// error is already a context object
|
||||
ctxErr = error;
|
||||
} else {
|
||||
ctxErr = tree._makeHookContext(node, null, {
|
||||
error: error, // it can be jqXHR or any custom error
|
||||
args: Array.prototype.slice.call(arguments),
|
||||
message: error
|
||||
? error.message || error.toString()
|
||||
: "",
|
||||
});
|
||||
if (ctxErr.message === "[object Object]") {
|
||||
ctxErr.message = "";
|
||||
}
|
||||
}
|
||||
if (noDataRes) {
|
||||
node.setStatus("nodata", noDataRes);
|
||||
node.warn(
|
||||
"Load children failed (" + ctxErr.message + ")",
|
||||
ctxErr
|
||||
);
|
||||
if (
|
||||
tree._triggerNodeEvent(
|
||||
"loadError",
|
||||
ctxErr,
|
||||
null
|
||||
) !== false
|
||||
) {
|
||||
tree.nodeSetStatus(
|
||||
ctx,
|
||||
"error",
|
||||
ctxErr.message,
|
||||
ctxErr.details
|
||||
);
|
||||
}
|
||||
}
|
||||
// trigger fancytreeloadchildren
|
||||
tree._triggerNodeEvent("loadChildren", node);
|
||||
});
|
||||
})
|
||||
.always(function() {
|
||||
node._requestId = null;
|
||||
if (isAsync) {
|
||||
tree.debugTimeEnd(tag);
|
||||
}
|
||||
});
|
||||
|
||||
return resultDfd.promise();
|
||||
},
|
||||
/** [Not Implemented] */
|
||||
nodeLoadKeyPath: function(ctx, keyPathList) {
|
||||
@@ -7591,7 +7622,7 @@ var uniqueId = $.fn.extend( {
|
||||
clickFolderMode: 4,
|
||||
debugLevel: null, // 0..4 (null: use global setting $.ui.fancytree.debugLevel)
|
||||
disabled: false, // TODO: required anymore?
|
||||
enableAspx: true,
|
||||
enableAspx: 42, // TODO: this is truethy, but distinguishable from true: default will change to false in the future
|
||||
escapeTitles: false,
|
||||
extensions: [],
|
||||
// fx: { height: "toggle", duration: 200 },
|
||||
@@ -8028,7 +8059,7 @@ var uniqueId = $.fn.extend( {
|
||||
{
|
||||
/** Version number `"MAJOR.MINOR.PATCH"`
|
||||
* @type {string} */
|
||||
version: "2.34.0", // Set to semver by 'grunt release'
|
||||
version: "2.35.0", // Set to semver by 'grunt release'
|
||||
/** @type {string}
|
||||
* @description `"production" for release builds` */
|
||||
buildType: "production", // Set to 'production' by 'grunt build'
|
||||
@@ -8658,13 +8689,13 @@ var uniqueId = $.fn.extend( {
|
||||
* Add a child counter bubble to tree nodes.
|
||||
* (Extension module for jquery.fancytree.js: https://github.com/mar10/fancytree/)
|
||||
*
|
||||
* Copyright (c) 2008-2019, Martin Wendt (https://wwWendt.de)
|
||||
* Copyright (c) 2008-2020, Martin Wendt (https://wwWendt.de)
|
||||
*
|
||||
* Released under the MIT license
|
||||
* https://github.com/mar10/fancytree/wiki/LicenseInfo
|
||||
*
|
||||
* @version 2.34.0
|
||||
* @date 2019-12-26T14:16:19Z
|
||||
* @version 2.35.0
|
||||
* @date 2020-03-27T22:41:58Z
|
||||
*/
|
||||
|
||||
// To keep the global namespace clean, we wrap everything in a closure.
|
||||
@@ -8745,7 +8776,7 @@ var uniqueId = $.fn.extend( {
|
||||
} else {
|
||||
$badge.remove();
|
||||
}
|
||||
if (extOpts.deep && !node.isTopLevel() && !node.isRoot()) {
|
||||
if (extOpts.deep && !node.isTopLevel() && !node.isRootNode()) {
|
||||
node.parent.updateCounters();
|
||||
}
|
||||
};
|
||||
@@ -8783,7 +8814,7 @@ var uniqueId = $.fn.extend( {
|
||||
// Every extension must be registered by a unique name.
|
||||
name: "childcounter",
|
||||
// Version information should be compliant with [semver](http://semver.org)
|
||||
version: "2.34.0",
|
||||
version: "2.35.0",
|
||||
|
||||
// Extension specific options and their defaults.
|
||||
// This options will be available as `tree.options.childcounter.hideExpanded`
|
||||
@@ -8889,13 +8920,13 @@ var uniqueId = $.fn.extend( {
|
||||
* Support faster lookup of nodes by key and shared ref-ids.
|
||||
* (Extension module for jquery.fancytree.js: https://github.com/mar10/fancytree/)
|
||||
*
|
||||
* Copyright (c) 2008-2019, Martin Wendt (https://wwWendt.de)
|
||||
* Copyright (c) 2008-2020, Martin Wendt (https://wwWendt.de)
|
||||
*
|
||||
* Released under the MIT license
|
||||
* https://github.com/mar10/fancytree/wiki/LicenseInfo
|
||||
*
|
||||
* @version 2.34.0
|
||||
* @date 2019-12-26T14:16:19Z
|
||||
* @version 2.35.0
|
||||
* @date 2020-03-27T22:41:58Z
|
||||
*/
|
||||
|
||||
(function(factory) {
|
||||
@@ -9253,7 +9284,7 @@ var uniqueId = $.fn.extend( {
|
||||
*/
|
||||
$.ui.fancytree.registerExtension({
|
||||
name: "clones",
|
||||
version: "2.34.0",
|
||||
version: "2.35.0",
|
||||
// Default options for this extension.
|
||||
options: {
|
||||
highlightActiveClones: true, // set 'fancytree-active-clone' on active clones and all peers
|
||||
@@ -9410,13 +9441,13 @@ var uniqueId = $.fn.extend( {
|
||||
* Drag-and-drop support (native HTML5).
|
||||
* (Extension module for jquery.fancytree.js: https://github.com/mar10/fancytree/)
|
||||
*
|
||||
* Copyright (c) 2008-2019, Martin Wendt (https://wwWendt.de)
|
||||
* Copyright (c) 2008-2020, Martin Wendt (https://wwWendt.de)
|
||||
*
|
||||
* Released under the MIT license
|
||||
* https://github.com/mar10/fancytree/wiki/LicenseInfo
|
||||
*
|
||||
* @version 2.34.0
|
||||
* @date 2019-12-26T14:16:19Z
|
||||
* @version 2.35.0
|
||||
* @date 2020-03-27T22:41:58Z
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -10201,6 +10232,10 @@ var uniqueId = $.fn.extend( {
|
||||
node.debug("Reject dropping below own ancestor.");
|
||||
DRAG_ENTER_RESPONSE = false;
|
||||
break;
|
||||
} else if (dndOpts.preventLazyParents && !node.isLoaded()) {
|
||||
node.warn("Drop over unloaded target node prevented.");
|
||||
DRAG_ENTER_RESPONSE = false;
|
||||
break;
|
||||
}
|
||||
$dropMarker.show();
|
||||
|
||||
@@ -10209,6 +10244,7 @@ var uniqueId = $.fn.extend( {
|
||||
r = dndOpts.dragEnter(node, data);
|
||||
|
||||
res = normalizeDragEnterResponse(r);
|
||||
// alert("res:" + JSON.stringify(res))
|
||||
DRAG_ENTER_RESPONSE = res;
|
||||
|
||||
allowDrop = res && (res.over || res.before || res.after);
|
||||
@@ -10254,6 +10290,7 @@ var uniqueId = $.fn.extend( {
|
||||
} else if (
|
||||
dndOpts.autoExpandMS &&
|
||||
Date.now() - DRAG_OVER_STAMP > dndOpts.autoExpandMS &&
|
||||
!node.isLoading() &&
|
||||
(!dndOpts.dragExpand ||
|
||||
dndOpts.dragExpand(node, data) !== false)
|
||||
) {
|
||||
@@ -10420,7 +10457,7 @@ var uniqueId = $.fn.extend( {
|
||||
|
||||
$.ui.fancytree.registerExtension({
|
||||
name: "dnd5",
|
||||
version: "2.34.0",
|
||||
version: "2.35.0",
|
||||
// Default options for this extension.
|
||||
options: {
|
||||
autoExpandMS: 1500, // Expand nodes after n milliseconds of hovering
|
||||
@@ -10431,6 +10468,7 @@ var uniqueId = $.fn.extend( {
|
||||
// dropEffect: "auto", // 'copy'|'link'|'move'|'auto'(calculate from `effectAllowed`+modifier keys) or callback(node, data) that returns such string.
|
||||
dropEffectDefault: "move", // Default dropEffect ('copy', 'link', or 'move') when no modifier is pressed (overide in dragDrag, dragOver).
|
||||
preventForeignNodes: false, // Prevent dropping nodes from different Fancytrees
|
||||
preventLazyParents: true, // Prevent dropping items on unloaded lazy Fancytree nodes
|
||||
preventNonNodes: false, // Prevent dropping items other than Fancytree nodes
|
||||
preventRecursion: true, // Prevent dropping nodes on own descendants
|
||||
preventSameParent: false, // Prevent dropping nodes under same direct parent
|
||||
@@ -10548,13 +10586,13 @@ var uniqueId = $.fn.extend( {
|
||||
* Make node titles editable.
|
||||
* (Extension module for jquery.fancytree.js: https://github.com/mar10/fancytree/)
|
||||
*
|
||||
* Copyright (c) 2008-2019, Martin Wendt (https://wwWendt.de)
|
||||
* Copyright (c) 2008-2020, Martin Wendt (https://wwWendt.de)
|
||||
*
|
||||
* Released under the MIT license
|
||||
* https://github.com/mar10/fancytree/wiki/LicenseInfo
|
||||
*
|
||||
* @version 2.34.0
|
||||
* @date 2019-12-26T14:16:19Z
|
||||
* @version 2.35.0
|
||||
* @date 2020-03-27T22:41:58Z
|
||||
*/
|
||||
|
||||
(function(factory) {
|
||||
@@ -10756,7 +10794,7 @@ var uniqueId = $.fn.extend( {
|
||||
// Re-enable mouse and keyboard handling
|
||||
tree.widget._bind();
|
||||
|
||||
if (local.lastDraggableAttrValue) {
|
||||
if (node && local.lastDraggableAttrValue) {
|
||||
node.span.draggable = true;
|
||||
}
|
||||
|
||||
@@ -10846,7 +10884,7 @@ var uniqueId = $.fn.extend( {
|
||||
*/
|
||||
$.ui.fancytree.registerExtension({
|
||||
name: "edit",
|
||||
version: "2.34.0",
|
||||
version: "2.35.0",
|
||||
// Default options for this extension.
|
||||
options: {
|
||||
adjustWidthOfs: 4, // null: don't adjust input size to content
|
||||
@@ -10952,13 +10990,13 @@ var uniqueId = $.fn.extend( {
|
||||
* Remove or highlight tree nodes, based on a filter.
|
||||
* (Extension module for jquery.fancytree.js: https://github.com/mar10/fancytree/)
|
||||
*
|
||||
* Copyright (c) 2008-2019, Martin Wendt (https://wwWendt.de)
|
||||
* Copyright (c) 2008-2020, Martin Wendt (https://wwWendt.de)
|
||||
*
|
||||
* Released under the MIT license
|
||||
* https://github.com/mar10/fancytree/wiki/LicenseInfo
|
||||
*
|
||||
* @version 2.34.0
|
||||
* @date 2019-12-26T14:16:19Z
|
||||
* @version 2.35.0
|
||||
* @date 2020-03-27T22:41:58Z
|
||||
*/
|
||||
|
||||
(function(factory) {
|
||||
@@ -11296,7 +11334,7 @@ var uniqueId = $.fn.extend( {
|
||||
*/
|
||||
$.ui.fancytree.registerExtension({
|
||||
name: "filter",
|
||||
version: "2.34.0",
|
||||
version: "2.35.0",
|
||||
// Default options for this extension.
|
||||
options: {
|
||||
autoApply: true, // Re-apply last filter if lazy data is loaded
|
||||
@@ -11411,13 +11449,13 @@ var uniqueId = $.fn.extend( {
|
||||
* Use glyph-fonts, ligature-fonts, or SVG icons instead of icon sprites.
|
||||
* (Extension module for jquery.fancytree.js: https://github.com/mar10/fancytree/)
|
||||
*
|
||||
* Copyright (c) 2008-2019, Martin Wendt (https://wwWendt.de)
|
||||
* Copyright (c) 2008-2020, Martin Wendt (https://wwWendt.de)
|
||||
*
|
||||
* Released under the MIT license
|
||||
* https://github.com/mar10/fancytree/wiki/LicenseInfo
|
||||
*
|
||||
* @version 2.34.0
|
||||
* @date 2019-12-26T14:16:19Z
|
||||
* @version 2.35.0
|
||||
* @date 2020-03-27T22:41:58Z
|
||||
*/
|
||||
|
||||
(function(factory) {
|
||||
@@ -11600,7 +11638,7 @@ var uniqueId = $.fn.extend( {
|
||||
|
||||
$.ui.fancytree.registerExtension({
|
||||
name: "glyph",
|
||||
version: "2.34.0",
|
||||
version: "2.35.0",
|
||||
// Default options for this extension.
|
||||
options: {
|
||||
preset: null, // 'awesome3', 'awesome4', 'bootstrap3', 'material'
|
||||
@@ -11634,7 +11672,7 @@ var uniqueId = $.fn.extend( {
|
||||
|
||||
res = this._super(ctx);
|
||||
|
||||
if (node.isRoot()) {
|
||||
if (node.isRootNode()) {
|
||||
return res;
|
||||
}
|
||||
span = $span.children("span.fancytree-expander").get(0);
|
||||
@@ -11749,13 +11787,13 @@ var uniqueId = $.fn.extend( {
|
||||
* Support keyboard navigation for trees with embedded input controls.
|
||||
* (Extension module for jquery.fancytree.js: https://github.com/mar10/fancytree/)
|
||||
*
|
||||
* Copyright (c) 2008-2019, Martin Wendt (https://wwWendt.de)
|
||||
* Copyright (c) 2008-2020, Martin Wendt (https://wwWendt.de)
|
||||
*
|
||||
* Released under the MIT license
|
||||
* https://github.com/mar10/fancytree/wiki/LicenseInfo
|
||||
*
|
||||
* @version 2.34.0
|
||||
* @date 2019-12-26T14:16:19Z
|
||||
* @version 2.35.0
|
||||
* @date 2020-03-27T22:41:58Z
|
||||
*/
|
||||
|
||||
(function(factory) {
|
||||
@@ -11872,7 +11910,7 @@ var uniqueId = $.fn.extend( {
|
||||
*/
|
||||
$.ui.fancytree.registerExtension({
|
||||
name: "gridnav",
|
||||
version: "2.34.0",
|
||||
version: "2.35.0",
|
||||
// Default options for this extension.
|
||||
options: {
|
||||
autofocusInput: false, // Focus first embedded input if node gets activated
|
||||
@@ -11974,13 +12012,13 @@ var uniqueId = $.fn.extend( {
|
||||
* Allow multiple selection of nodes by mouse or keyboard.
|
||||
* (Extension module for jquery.fancytree.js: https://github.com/mar10/fancytree/)
|
||||
*
|
||||
* Copyright (c) 2008-2019, Martin Wendt (https://wwWendt.de)
|
||||
* Copyright (c) 2008-2020, Martin Wendt (https://wwWendt.de)
|
||||
*
|
||||
* Released under the MIT license
|
||||
* https://github.com/mar10/fancytree/wiki/LicenseInfo
|
||||
*
|
||||
* @version 2.34.0
|
||||
* @date 2019-12-26T14:16:19Z
|
||||
* @version 2.35.0
|
||||
* @date 2020-03-27T22:41:58Z
|
||||
*/
|
||||
|
||||
(function(factory) {
|
||||
@@ -12009,7 +12047,7 @@ var uniqueId = $.fn.extend( {
|
||||
*/
|
||||
$.ui.fancytree.registerExtension({
|
||||
name: "multi",
|
||||
version: "2.34.0",
|
||||
version: "2.35.0",
|
||||
// Default options for this extension.
|
||||
options: {
|
||||
allowNoSelect: false, //
|
||||
@@ -12106,13 +12144,13 @@ var uniqueId = $.fn.extend( {
|
||||
*
|
||||
* @depends: js-cookie or jquery-cookie
|
||||
*
|
||||
* Copyright (c) 2008-2019, Martin Wendt (https://wwWendt.de)
|
||||
* Copyright (c) 2008-2020, Martin Wendt (https://wwWendt.de)
|
||||
*
|
||||
* Released under the MIT license
|
||||
* https://github.com/mar10/fancytree/wiki/LicenseInfo
|
||||
*
|
||||
* @version 2.34.0
|
||||
* @date 2019-12-26T14:16:19Z
|
||||
* @version 2.35.0
|
||||
* @date 2020-03-27T22:41:58Z
|
||||
*/
|
||||
|
||||
(function(factory) {
|
||||
@@ -12312,7 +12350,7 @@ var uniqueId = $.fn.extend( {
|
||||
*/
|
||||
$.ui.fancytree.registerExtension({
|
||||
name: "persist",
|
||||
version: "2.34.0",
|
||||
version: "2.35.0",
|
||||
// Default options for this extension.
|
||||
options: {
|
||||
cookieDelimiter: "~",
|
||||
@@ -12600,13 +12638,13 @@ var uniqueId = $.fn.extend( {
|
||||
* Render tree as table (aka 'tree grid', 'table tree').
|
||||
* (Extension module for jquery.fancytree.js: https://github.com/mar10/fancytree/)
|
||||
*
|
||||
* Copyright (c) 2008-2019, Martin Wendt (https://wwWendt.de)
|
||||
* Copyright (c) 2008-2020, Martin Wendt (https://wwWendt.de)
|
||||
*
|
||||
* Released under the MIT license
|
||||
* https://github.com/mar10/fancytree/wiki/LicenseInfo
|
||||
*
|
||||
* @version 2.34.0
|
||||
* @date 2019-12-26T14:16:19Z
|
||||
* @version 2.35.0
|
||||
* @date 2020-03-27T22:41:58Z
|
||||
*/
|
||||
|
||||
(function(factory) {
|
||||
@@ -12689,7 +12727,7 @@ var uniqueId = $.fn.extend( {
|
||||
|
||||
$.ui.fancytree.registerExtension({
|
||||
name: "table",
|
||||
version: "2.34.0",
|
||||
version: "2.35.0",
|
||||
// Default options for this extension.
|
||||
options: {
|
||||
checkboxColumnIdx: null, // render the checkboxes into the this column index (default: nodeColumnIdx)
|
||||
@@ -13150,13 +13188,13 @@ var uniqueId = $.fn.extend( {
|
||||
*
|
||||
* @see http://jqueryui.com/themeroller/
|
||||
*
|
||||
* Copyright (c) 2008-2019, Martin Wendt (https://wwWendt.de)
|
||||
* Copyright (c) 2008-2020, Martin Wendt (https://wwWendt.de)
|
||||
*
|
||||
* Released under the MIT license
|
||||
* https://github.com/mar10/fancytree/wiki/LicenseInfo
|
||||
*
|
||||
* @version 2.34.0
|
||||
* @date 2019-12-26T14:16:19Z
|
||||
* @version 2.35.0
|
||||
* @date 2020-03-27T22:41:58Z
|
||||
*/
|
||||
|
||||
(function(factory) {
|
||||
@@ -13179,7 +13217,7 @@ var uniqueId = $.fn.extend( {
|
||||
*/
|
||||
$.ui.fancytree.registerExtension({
|
||||
name: "themeroller",
|
||||
version: "2.34.0",
|
||||
version: "2.35.0",
|
||||
// Default options for this extension.
|
||||
options: {
|
||||
activeClass: "ui-state-active", // Class added to active node
|
||||
@@ -13270,13 +13308,13 @@ var uniqueId = $.fn.extend( {
|
||||
* Support for 100% wide selection bars.
|
||||
* (Extension module for jquery.fancytree.js: https://github.com/mar10/fancytree/)
|
||||
*
|
||||
* Copyright (c) 2008-2019, Martin Wendt (https://wwWendt.de)
|
||||
* Copyright (c) 2008-2020, Martin Wendt (https://wwWendt.de)
|
||||
*
|
||||
* Released under the MIT license
|
||||
* https://github.com/mar10/fancytree/wiki/LicenseInfo
|
||||
*
|
||||
* @version 2.34.0
|
||||
* @date 2019-12-26T14:16:19Z
|
||||
* @version 2.35.0
|
||||
* @date 2020-03-27T22:41:58Z
|
||||
*/
|
||||
|
||||
(function(factory) {
|
||||
@@ -13406,7 +13444,7 @@ var uniqueId = $.fn.extend( {
|
||||
*/
|
||||
$.ui.fancytree.registerExtension({
|
||||
name: "wide",
|
||||
version: "2.34.0",
|
||||
version: "2.35.0",
|
||||
// Default options for this extension.
|
||||
options: {
|
||||
iconWidth: null, // Adjust this if @fancy-icon-width != "16px"
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -9,12 +9,12 @@
|
||||
*
|
||||
* This section is automatically generated from the `skin-common.less` template.
|
||||
*
|
||||
* Copyright (c) 2008-2019, Martin Wendt (https://wwWendt.de)
|
||||
* Copyright (c) 2008-2020, Martin Wendt (https://wwWendt.de)
|
||||
* Released under the MIT license
|
||||
* https://github.com/mar10/fancytree/wiki/LicenseInfo
|
||||
*
|
||||
* @version 2.34.0
|
||||
* @date 2019-12-26T14:16:19Z
|
||||
* @version 2.35.0
|
||||
* @date 2020-03-27T22:41:58Z
|
||||
******************************************************************************/
|
||||
/*------------------------------------------------------------------------------
|
||||
* Helpers
|
||||
|
||||
Vendored
+417
-183
@@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* jQuery JavaScript Library v3.3.1
|
||||
* jQuery JavaScript Library v3.4.1
|
||||
* https://jquery.com/
|
||||
*
|
||||
* Includes Sizzle.js
|
||||
@@ -9,7 +9,7 @@
|
||||
* Released under the MIT license
|
||||
* https://jquery.org/license
|
||||
*
|
||||
* Date: 2018-01-20T17:24Z
|
||||
* Date: 2019-05-01T21:04Z
|
||||
*/
|
||||
( function( global, factory ) {
|
||||
|
||||
@@ -91,20 +91,33 @@ var isWindow = function isWindow( obj ) {
|
||||
var preservedScriptAttributes = {
|
||||
type: true,
|
||||
src: true,
|
||||
nonce: true,
|
||||
noModule: true
|
||||
};
|
||||
|
||||
function DOMEval( code, doc, node ) {
|
||||
function DOMEval( code, node, doc ) {
|
||||
doc = doc || document;
|
||||
|
||||
var i,
|
||||
var i, val,
|
||||
script = doc.createElement( "script" );
|
||||
|
||||
script.text = code;
|
||||
if ( node ) {
|
||||
for ( i in preservedScriptAttributes ) {
|
||||
if ( node[ i ] ) {
|
||||
script[ i ] = node[ i ];
|
||||
|
||||
// Support: Firefox 64+, Edge 18+
|
||||
// Some browsers don't support the "nonce" property on scripts.
|
||||
// On the other hand, just using `getAttribute` is not enough as
|
||||
// the `nonce` attribute is reset to an empty string whenever it
|
||||
// becomes browsing-context connected.
|
||||
// See https://github.com/whatwg/html/issues/2369
|
||||
// See https://html.spec.whatwg.org/#nonce-attributes
|
||||
// The `node.getAttribute` check was added for the sake of
|
||||
// `jQuery.globalEval` so that it can fake a nonce-containing node
|
||||
// via an object.
|
||||
val = node[ i ] || node.getAttribute && node.getAttribute( i );
|
||||
if ( val ) {
|
||||
script.setAttribute( i, val );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -129,7 +142,7 @@ function toType( obj ) {
|
||||
|
||||
|
||||
var
|
||||
version = "3.3.1",
|
||||
version = "3.4.1",
|
||||
|
||||
// Define a local copy of jQuery
|
||||
jQuery = function( selector, context ) {
|
||||
@@ -258,25 +271,28 @@ jQuery.extend = jQuery.fn.extend = function() {
|
||||
|
||||
// Extend the base object
|
||||
for ( name in options ) {
|
||||
src = target[ name ];
|
||||
copy = options[ name ];
|
||||
|
||||
// Prevent Object.prototype pollution
|
||||
// Prevent never-ending loop
|
||||
if ( target === copy ) {
|
||||
if ( name === "__proto__" || target === copy ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Recurse if we're merging plain objects or arrays
|
||||
if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
|
||||
( copyIsArray = Array.isArray( copy ) ) ) ) {
|
||||
src = target[ name ];
|
||||
|
||||
if ( copyIsArray ) {
|
||||
copyIsArray = false;
|
||||
clone = src && Array.isArray( src ) ? src : [];
|
||||
|
||||
// Ensure proper type for the source value
|
||||
if ( copyIsArray && !Array.isArray( src ) ) {
|
||||
clone = [];
|
||||
} else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {
|
||||
clone = {};
|
||||
} else {
|
||||
clone = src && jQuery.isPlainObject( src ) ? src : {};
|
||||
clone = src;
|
||||
}
|
||||
copyIsArray = false;
|
||||
|
||||
// Never move original objects, clone them
|
||||
target[ name ] = jQuery.extend( deep, clone, copy );
|
||||
@@ -329,9 +345,6 @@ jQuery.extend( {
|
||||
},
|
||||
|
||||
isEmptyObject: function( obj ) {
|
||||
|
||||
/* eslint-disable no-unused-vars */
|
||||
// See https://github.com/eslint/eslint/issues/6125
|
||||
var name;
|
||||
|
||||
for ( name in obj ) {
|
||||
@@ -341,8 +354,8 @@ jQuery.extend( {
|
||||
},
|
||||
|
||||
// Evaluates a script in a global context
|
||||
globalEval: function( code ) {
|
||||
DOMEval( code );
|
||||
globalEval: function( code, options ) {
|
||||
DOMEval( code, { nonce: options && options.nonce } );
|
||||
},
|
||||
|
||||
each: function( obj, callback ) {
|
||||
@@ -498,14 +511,14 @@ function isArrayLike( obj ) {
|
||||
}
|
||||
var Sizzle =
|
||||
/*!
|
||||
* Sizzle CSS Selector Engine v2.3.3
|
||||
* Sizzle CSS Selector Engine v2.3.4
|
||||
* https://sizzlejs.com/
|
||||
*
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
* Copyright JS Foundation and other contributors
|
||||
* Released under the MIT license
|
||||
* http://jquery.org/license
|
||||
* https://js.foundation/
|
||||
*
|
||||
* Date: 2016-08-08
|
||||
* Date: 2019-04-08
|
||||
*/
|
||||
(function( window ) {
|
||||
|
||||
@@ -539,6 +552,7 @@ var i,
|
||||
classCache = createCache(),
|
||||
tokenCache = createCache(),
|
||||
compilerCache = createCache(),
|
||||
nonnativeSelectorCache = createCache(),
|
||||
sortOrder = function( a, b ) {
|
||||
if ( a === b ) {
|
||||
hasDuplicate = true;
|
||||
@@ -600,8 +614,7 @@ var i,
|
||||
|
||||
rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
|
||||
rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
|
||||
|
||||
rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
|
||||
rdescend = new RegExp( whitespace + "|>" ),
|
||||
|
||||
rpseudo = new RegExp( pseudos ),
|
||||
ridentifier = new RegExp( "^" + identifier + "$" ),
|
||||
@@ -622,6 +635,7 @@ var i,
|
||||
whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
|
||||
},
|
||||
|
||||
rhtml = /HTML$/i,
|
||||
rinputs = /^(?:input|select|textarea|button)$/i,
|
||||
rheader = /^h\d$/i,
|
||||
|
||||
@@ -676,9 +690,9 @@ var i,
|
||||
setDocument();
|
||||
},
|
||||
|
||||
disabledAncestor = addCombinator(
|
||||
inDisabledFieldset = addCombinator(
|
||||
function( elem ) {
|
||||
return elem.disabled === true && ("form" in elem || "label" in elem);
|
||||
return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset";
|
||||
},
|
||||
{ dir: "parentNode", next: "legend" }
|
||||
);
|
||||
@@ -791,18 +805,22 @@ function Sizzle( selector, context, results, seed ) {
|
||||
|
||||
// Take advantage of querySelectorAll
|
||||
if ( support.qsa &&
|
||||
!compilerCache[ selector + " " ] &&
|
||||
(!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
|
||||
!nonnativeSelectorCache[ selector + " " ] &&
|
||||
(!rbuggyQSA || !rbuggyQSA.test( selector )) &&
|
||||
|
||||
if ( nodeType !== 1 ) {
|
||||
newContext = context;
|
||||
newSelector = selector;
|
||||
|
||||
// qSA looks outside Element context, which is not what we want
|
||||
// Thanks to Andrew Dupont for this workaround technique
|
||||
// Support: IE <=8
|
||||
// Support: IE 8 only
|
||||
// Exclude object elements
|
||||
} else if ( context.nodeName.toLowerCase() !== "object" ) {
|
||||
(nodeType !== 1 || context.nodeName.toLowerCase() !== "object") ) {
|
||||
|
||||
newSelector = selector;
|
||||
newContext = context;
|
||||
|
||||
// qSA considers elements outside a scoping root when evaluating child or
|
||||
// descendant combinators, which is not what we want.
|
||||
// In such cases, we work around the behavior by prefixing every selector in the
|
||||
// list with an ID selector referencing the scope context.
|
||||
// Thanks to Andrew Dupont for this technique.
|
||||
if ( nodeType === 1 && rdescend.test( selector ) ) {
|
||||
|
||||
// Capture the context ID, setting it first if necessary
|
||||
if ( (nid = context.getAttribute( "id" )) ) {
|
||||
@@ -824,17 +842,16 @@ function Sizzle( selector, context, results, seed ) {
|
||||
context;
|
||||
}
|
||||
|
||||
if ( newSelector ) {
|
||||
try {
|
||||
push.apply( results,
|
||||
newContext.querySelectorAll( newSelector )
|
||||
);
|
||||
return results;
|
||||
} catch ( qsaError ) {
|
||||
} finally {
|
||||
if ( nid === expando ) {
|
||||
context.removeAttribute( "id" );
|
||||
}
|
||||
try {
|
||||
push.apply( results,
|
||||
newContext.querySelectorAll( newSelector )
|
||||
);
|
||||
return results;
|
||||
} catch ( qsaError ) {
|
||||
nonnativeSelectorCache( selector, true );
|
||||
} finally {
|
||||
if ( nid === expando ) {
|
||||
context.removeAttribute( "id" );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -998,7 +1015,7 @@ function createDisabledPseudo( disabled ) {
|
||||
// Where there is no isDisabled, check manually
|
||||
/* jshint -W018 */
|
||||
elem.isDisabled !== !disabled &&
|
||||
disabledAncestor( elem ) === disabled;
|
||||
inDisabledFieldset( elem ) === disabled;
|
||||
}
|
||||
|
||||
return elem.disabled === disabled;
|
||||
@@ -1055,10 +1072,13 @@ support = Sizzle.support = {};
|
||||
* @returns {Boolean} True iff elem is a non-HTML XML node
|
||||
*/
|
||||
isXML = Sizzle.isXML = function( elem ) {
|
||||
// documentElement is verified for cases where it doesn't yet exist
|
||||
// (such as loading iframes in IE - #4833)
|
||||
var documentElement = elem && (elem.ownerDocument || elem).documentElement;
|
||||
return documentElement ? documentElement.nodeName !== "HTML" : false;
|
||||
var namespace = elem.namespaceURI,
|
||||
docElem = (elem.ownerDocument || elem).documentElement;
|
||||
|
||||
// Support: IE <=8
|
||||
// Assume HTML when documentElement doesn't yet exist, such as inside loading iframes
|
||||
// https://bugs.jquery.com/ticket/4833
|
||||
return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" );
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1480,11 +1500,8 @@ Sizzle.matchesSelector = function( elem, expr ) {
|
||||
setDocument( elem );
|
||||
}
|
||||
|
||||
// Make sure that attribute selectors are quoted
|
||||
expr = expr.replace( rattributeQuotes, "='$1']" );
|
||||
|
||||
if ( support.matchesSelector && documentIsHTML &&
|
||||
!compilerCache[ expr + " " ] &&
|
||||
!nonnativeSelectorCache[ expr + " " ] &&
|
||||
( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
|
||||
( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
|
||||
|
||||
@@ -1498,7 +1515,9 @@ Sizzle.matchesSelector = function( elem, expr ) {
|
||||
elem.document && elem.document.nodeType !== 11 ) {
|
||||
return ret;
|
||||
}
|
||||
} catch (e) {}
|
||||
} catch (e) {
|
||||
nonnativeSelectorCache( expr, true );
|
||||
}
|
||||
}
|
||||
|
||||
return Sizzle( expr, document, null, [ elem ] ).length > 0;
|
||||
@@ -1957,7 +1976,7 @@ Expr = Sizzle.selectors = {
|
||||
"contains": markFunction(function( text ) {
|
||||
text = text.replace( runescape, funescape );
|
||||
return function( elem ) {
|
||||
return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
|
||||
return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;
|
||||
};
|
||||
}),
|
||||
|
||||
@@ -2096,7 +2115,11 @@ Expr = Sizzle.selectors = {
|
||||
}),
|
||||
|
||||
"lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
|
||||
var i = argument < 0 ? argument + length : argument;
|
||||
var i = argument < 0 ?
|
||||
argument + length :
|
||||
argument > length ?
|
||||
length :
|
||||
argument;
|
||||
for ( ; --i >= 0; ) {
|
||||
matchIndexes.push( i );
|
||||
}
|
||||
@@ -3146,18 +3169,18 @@ jQuery.each( {
|
||||
return siblings( elem.firstChild );
|
||||
},
|
||||
contents: function( elem ) {
|
||||
if ( nodeName( elem, "iframe" ) ) {
|
||||
return elem.contentDocument;
|
||||
}
|
||||
if ( typeof elem.contentDocument !== "undefined" ) {
|
||||
return elem.contentDocument;
|
||||
}
|
||||
|
||||
// Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only
|
||||
// Treat the template element as a regular one in browsers that
|
||||
// don't support it.
|
||||
if ( nodeName( elem, "template" ) ) {
|
||||
elem = elem.content || elem;
|
||||
}
|
||||
// Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only
|
||||
// Treat the template element as a regular one in browsers that
|
||||
// don't support it.
|
||||
if ( nodeName( elem, "template" ) ) {
|
||||
elem = elem.content || elem;
|
||||
}
|
||||
|
||||
return jQuery.merge( [], elem.childNodes );
|
||||
return jQuery.merge( [], elem.childNodes );
|
||||
}
|
||||
}, function( name, fn ) {
|
||||
jQuery.fn[ name ] = function( until, selector ) {
|
||||
@@ -4466,6 +4489,26 @@ var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
|
||||
|
||||
var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
|
||||
|
||||
var documentElement = document.documentElement;
|
||||
|
||||
|
||||
|
||||
var isAttached = function( elem ) {
|
||||
return jQuery.contains( elem.ownerDocument, elem );
|
||||
},
|
||||
composed = { composed: true };
|
||||
|
||||
// Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only
|
||||
// Check attachment across shadow DOM boundaries when possible (gh-3504)
|
||||
// Support: iOS 10.0-10.2 only
|
||||
// Early iOS 10 versions support `attachShadow` but not `getRootNode`,
|
||||
// leading to errors. We need to check for `getRootNode`.
|
||||
if ( documentElement.getRootNode ) {
|
||||
isAttached = function( elem ) {
|
||||
return jQuery.contains( elem.ownerDocument, elem ) ||
|
||||
elem.getRootNode( composed ) === elem.ownerDocument;
|
||||
};
|
||||
}
|
||||
var isHiddenWithinTree = function( elem, el ) {
|
||||
|
||||
// isHiddenWithinTree might be called from jQuery#filter function;
|
||||
@@ -4480,7 +4523,7 @@ var isHiddenWithinTree = function( elem, el ) {
|
||||
// Support: Firefox <=43 - 45
|
||||
// Disconnected elements can have computed display: none, so first confirm that elem is
|
||||
// in the document.
|
||||
jQuery.contains( elem.ownerDocument, elem ) &&
|
||||
isAttached( elem ) &&
|
||||
|
||||
jQuery.css( elem, "display" ) === "none";
|
||||
};
|
||||
@@ -4522,7 +4565,8 @@ function adjustCSS( elem, prop, valueParts, tween ) {
|
||||
unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
|
||||
|
||||
// Starting value computation is required for potential unit mismatches
|
||||
initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
|
||||
initialInUnit = elem.nodeType &&
|
||||
( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
|
||||
rcssNum.exec( jQuery.css( elem, prop ) );
|
||||
|
||||
if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
|
||||
@@ -4669,7 +4713,7 @@ jQuery.fn.extend( {
|
||||
} );
|
||||
var rcheckableType = ( /^(?:checkbox|radio)$/i );
|
||||
|
||||
var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]+)/i );
|
||||
var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i );
|
||||
|
||||
var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
|
||||
|
||||
@@ -4741,7 +4785,7 @@ function setGlobalEval( elems, refElements ) {
|
||||
var rhtml = /<|&#?\w+;/;
|
||||
|
||||
function buildFragment( elems, context, scripts, selection, ignored ) {
|
||||
var elem, tmp, tag, wrap, contains, j,
|
||||
var elem, tmp, tag, wrap, attached, j,
|
||||
fragment = context.createDocumentFragment(),
|
||||
nodes = [],
|
||||
i = 0,
|
||||
@@ -4805,13 +4849,13 @@ function buildFragment( elems, context, scripts, selection, ignored ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
contains = jQuery.contains( elem.ownerDocument, elem );
|
||||
attached = isAttached( elem );
|
||||
|
||||
// Append to fragment
|
||||
tmp = getAll( fragment.appendChild( elem ), "script" );
|
||||
|
||||
// Preserve script evaluation history
|
||||
if ( contains ) {
|
||||
if ( attached ) {
|
||||
setGlobalEval( tmp );
|
||||
}
|
||||
|
||||
@@ -4854,8 +4898,6 @@ function buildFragment( elems, context, scripts, selection, ignored ) {
|
||||
div.innerHTML = "<textarea>x</textarea>";
|
||||
support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
|
||||
} )();
|
||||
var documentElement = document.documentElement;
|
||||
|
||||
|
||||
|
||||
var
|
||||
@@ -4871,8 +4913,19 @@ function returnFalse() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Support: IE <=9 - 11+
|
||||
// focus() and blur() are asynchronous, except when they are no-op.
|
||||
// So expect focus to be synchronous when the element is already active,
|
||||
// and blur to be synchronous when the element is not already active.
|
||||
// (focus and blur are always synchronous in other supported browsers,
|
||||
// this just defines when we can count on it).
|
||||
function expectSync( elem, type ) {
|
||||
return ( elem === safeActiveElement() ) === ( type === "focus" );
|
||||
}
|
||||
|
||||
// Support: IE <=9 only
|
||||
// See #13393 for more info
|
||||
// Accessing document.activeElement can throw unexpectedly
|
||||
// https://bugs.jquery.com/ticket/13393
|
||||
function safeActiveElement() {
|
||||
try {
|
||||
return document.activeElement;
|
||||
@@ -5172,9 +5225,10 @@ jQuery.event = {
|
||||
while ( ( handleObj = matched.handlers[ j++ ] ) &&
|
||||
!event.isImmediatePropagationStopped() ) {
|
||||
|
||||
// Triggered event must either 1) have no namespace, or 2) have namespace(s)
|
||||
// a subset or equal to those in the bound event (both can have no namespace).
|
||||
if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) {
|
||||
// If the event is namespaced, then each handler is only invoked if it is
|
||||
// specially universal or its namespaces are a superset of the event's.
|
||||
if ( !event.rnamespace || handleObj.namespace === false ||
|
||||
event.rnamespace.test( handleObj.namespace ) ) {
|
||||
|
||||
event.handleObj = handleObj;
|
||||
event.data = handleObj.data;
|
||||
@@ -5298,39 +5352,51 @@ jQuery.event = {
|
||||
// Prevent triggered image.load events from bubbling to window.load
|
||||
noBubble: true
|
||||
},
|
||||
focus: {
|
||||
|
||||
// Fire native event if possible so blur/focus sequence is correct
|
||||
trigger: function() {
|
||||
if ( this !== safeActiveElement() && this.focus ) {
|
||||
this.focus();
|
||||
return false;
|
||||
}
|
||||
},
|
||||
delegateType: "focusin"
|
||||
},
|
||||
blur: {
|
||||
trigger: function() {
|
||||
if ( this === safeActiveElement() && this.blur ) {
|
||||
this.blur();
|
||||
return false;
|
||||
}
|
||||
},
|
||||
delegateType: "focusout"
|
||||
},
|
||||
click: {
|
||||
|
||||
// For checkbox, fire native event so checked state will be right
|
||||
trigger: function() {
|
||||
if ( this.type === "checkbox" && this.click && nodeName( this, "input" ) ) {
|
||||
this.click();
|
||||
return false;
|
||||
// Utilize native event to ensure correct state for checkable inputs
|
||||
setup: function( data ) {
|
||||
|
||||
// For mutual compressibility with _default, replace `this` access with a local var.
|
||||
// `|| data` is dead code meant only to preserve the variable through minification.
|
||||
var el = this || data;
|
||||
|
||||
// Claim the first handler
|
||||
if ( rcheckableType.test( el.type ) &&
|
||||
el.click && nodeName( el, "input" ) ) {
|
||||
|
||||
// dataPriv.set( el, "click", ... )
|
||||
leverageNative( el, "click", returnTrue );
|
||||
}
|
||||
|
||||
// Return false to allow normal processing in the caller
|
||||
return false;
|
||||
},
|
||||
trigger: function( data ) {
|
||||
|
||||
// For mutual compressibility with _default, replace `this` access with a local var.
|
||||
// `|| data` is dead code meant only to preserve the variable through minification.
|
||||
var el = this || data;
|
||||
|
||||
// Force setup before triggering a click
|
||||
if ( rcheckableType.test( el.type ) &&
|
||||
el.click && nodeName( el, "input" ) ) {
|
||||
|
||||
leverageNative( el, "click" );
|
||||
}
|
||||
|
||||
// Return non-false to allow normal event-path propagation
|
||||
return true;
|
||||
},
|
||||
|
||||
// For cross-browser consistency, don't fire native .click() on links
|
||||
// For cross-browser consistency, suppress native .click() on links
|
||||
// Also prevent it if we're currently inside a leveraged native-event stack
|
||||
_default: function( event ) {
|
||||
return nodeName( event.target, "a" );
|
||||
var target = event.target;
|
||||
return rcheckableType.test( target.type ) &&
|
||||
target.click && nodeName( target, "input" ) &&
|
||||
dataPriv.get( target, "click" ) ||
|
||||
nodeName( target, "a" );
|
||||
}
|
||||
},
|
||||
|
||||
@@ -5347,6 +5413,93 @@ jQuery.event = {
|
||||
}
|
||||
};
|
||||
|
||||
// Ensure the presence of an event listener that handles manually-triggered
|
||||
// synthetic events by interrupting progress until reinvoked in response to
|
||||
// *native* events that it fires directly, ensuring that state changes have
|
||||
// already occurred before other listeners are invoked.
|
||||
function leverageNative( el, type, expectSync ) {
|
||||
|
||||
// Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add
|
||||
if ( !expectSync ) {
|
||||
if ( dataPriv.get( el, type ) === undefined ) {
|
||||
jQuery.event.add( el, type, returnTrue );
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Register the controller as a special universal handler for all event namespaces
|
||||
dataPriv.set( el, type, false );
|
||||
jQuery.event.add( el, type, {
|
||||
namespace: false,
|
||||
handler: function( event ) {
|
||||
var notAsync, result,
|
||||
saved = dataPriv.get( this, type );
|
||||
|
||||
if ( ( event.isTrigger & 1 ) && this[ type ] ) {
|
||||
|
||||
// Interrupt processing of the outer synthetic .trigger()ed event
|
||||
// Saved data should be false in such cases, but might be a leftover capture object
|
||||
// from an async native handler (gh-4350)
|
||||
if ( !saved.length ) {
|
||||
|
||||
// Store arguments for use when handling the inner native event
|
||||
// There will always be at least one argument (an event object), so this array
|
||||
// will not be confused with a leftover capture object.
|
||||
saved = slice.call( arguments );
|
||||
dataPriv.set( this, type, saved );
|
||||
|
||||
// Trigger the native event and capture its result
|
||||
// Support: IE <=9 - 11+
|
||||
// focus() and blur() are asynchronous
|
||||
notAsync = expectSync( this, type );
|
||||
this[ type ]();
|
||||
result = dataPriv.get( this, type );
|
||||
if ( saved !== result || notAsync ) {
|
||||
dataPriv.set( this, type, false );
|
||||
} else {
|
||||
result = {};
|
||||
}
|
||||
if ( saved !== result ) {
|
||||
|
||||
// Cancel the outer synthetic event
|
||||
event.stopImmediatePropagation();
|
||||
event.preventDefault();
|
||||
return result.value;
|
||||
}
|
||||
|
||||
// If this is an inner synthetic event for an event with a bubbling surrogate
|
||||
// (focus or blur), assume that the surrogate already propagated from triggering the
|
||||
// native event and prevent that from happening again here.
|
||||
// This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the
|
||||
// bubbling surrogate propagates *after* the non-bubbling base), but that seems
|
||||
// less bad than duplication.
|
||||
} else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {
|
||||
event.stopPropagation();
|
||||
}
|
||||
|
||||
// If this is a native event triggered above, everything is now in order
|
||||
// Fire an inner synthetic event with the original arguments
|
||||
} else if ( saved.length ) {
|
||||
|
||||
// ...and capture the result
|
||||
dataPriv.set( this, type, {
|
||||
value: jQuery.event.trigger(
|
||||
|
||||
// Support: IE <=9 - 11+
|
||||
// Extend with the prototype to reset the above stopImmediatePropagation()
|
||||
jQuery.extend( saved[ 0 ], jQuery.Event.prototype ),
|
||||
saved.slice( 1 ),
|
||||
this
|
||||
)
|
||||
} );
|
||||
|
||||
// Abort handling of the native event
|
||||
event.stopImmediatePropagation();
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
jQuery.removeEvent = function( elem, type, handle ) {
|
||||
|
||||
// This "if" is needed for plain objects
|
||||
@@ -5459,6 +5612,7 @@ jQuery.each( {
|
||||
shiftKey: true,
|
||||
view: true,
|
||||
"char": true,
|
||||
code: true,
|
||||
charCode: true,
|
||||
key: true,
|
||||
keyCode: true,
|
||||
@@ -5505,6 +5659,33 @@ jQuery.each( {
|
||||
}
|
||||
}, jQuery.event.addProp );
|
||||
|
||||
jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) {
|
||||
jQuery.event.special[ type ] = {
|
||||
|
||||
// Utilize native event if possible so blur/focus sequence is correct
|
||||
setup: function() {
|
||||
|
||||
// Claim the first handler
|
||||
// dataPriv.set( this, "focus", ... )
|
||||
// dataPriv.set( this, "blur", ... )
|
||||
leverageNative( this, type, expectSync );
|
||||
|
||||
// Return false to allow normal processing in the caller
|
||||
return false;
|
||||
},
|
||||
trigger: function() {
|
||||
|
||||
// Force setup before trigger
|
||||
leverageNative( this, type );
|
||||
|
||||
// Return non-false to allow normal event-path propagation
|
||||
return true;
|
||||
},
|
||||
|
||||
delegateType: delegateType
|
||||
};
|
||||
} );
|
||||
|
||||
// Create mouseenter/leave events using mouseover/out and event-time checks
|
||||
// so that event delegation works in jQuery.
|
||||
// Do the same for pointerenter/pointerleave and pointerover/pointerout
|
||||
@@ -5755,11 +5936,13 @@ function domManip( collection, args, callback, ignored ) {
|
||||
if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) {
|
||||
|
||||
// Optional AJAX dependency, but won't run scripts if not present
|
||||
if ( jQuery._evalUrl ) {
|
||||
jQuery._evalUrl( node.src );
|
||||
if ( jQuery._evalUrl && !node.noModule ) {
|
||||
jQuery._evalUrl( node.src, {
|
||||
nonce: node.nonce || node.getAttribute( "nonce" )
|
||||
} );
|
||||
}
|
||||
} else {
|
||||
DOMEval( node.textContent.replace( rcleanScript, "" ), doc, node );
|
||||
DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5781,7 +5964,7 @@ function remove( elem, selector, keepData ) {
|
||||
}
|
||||
|
||||
if ( node.parentNode ) {
|
||||
if ( keepData && jQuery.contains( node.ownerDocument, node ) ) {
|
||||
if ( keepData && isAttached( node ) ) {
|
||||
setGlobalEval( getAll( node, "script" ) );
|
||||
}
|
||||
node.parentNode.removeChild( node );
|
||||
@@ -5799,7 +5982,7 @@ jQuery.extend( {
|
||||
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
|
||||
var i, l, srcElements, destElements,
|
||||
clone = elem.cloneNode( true ),
|
||||
inPage = jQuery.contains( elem.ownerDocument, elem );
|
||||
inPage = isAttached( elem );
|
||||
|
||||
// Fix IE cloning issues
|
||||
if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
|
||||
@@ -6095,8 +6278,10 @@ var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
|
||||
|
||||
// Support: IE 9 only
|
||||
// Detect overflow:scroll screwiness (gh-3699)
|
||||
// Support: Chrome <=64
|
||||
// Don't get tricked when zoom affects offsetWidth (gh-4029)
|
||||
div.style.position = "absolute";
|
||||
scrollboxSizeVal = div.offsetWidth === 36 || "absolute";
|
||||
scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;
|
||||
|
||||
documentElement.removeChild( container );
|
||||
|
||||
@@ -6167,7 +6352,7 @@ function curCSS( elem, name, computed ) {
|
||||
if ( computed ) {
|
||||
ret = computed.getPropertyValue( name ) || computed[ name ];
|
||||
|
||||
if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
|
||||
if ( ret === "" && !isAttached( elem ) ) {
|
||||
ret = jQuery.style( elem, name );
|
||||
}
|
||||
|
||||
@@ -6223,30 +6408,13 @@ function addGetHookIf( conditionFn, hookFn ) {
|
||||
}
|
||||
|
||||
|
||||
var
|
||||
var cssPrefixes = [ "Webkit", "Moz", "ms" ],
|
||||
emptyStyle = document.createElement( "div" ).style,
|
||||
vendorProps = {};
|
||||
|
||||
// Swappable if display is none or starts with table
|
||||
// except "table", "table-cell", or "table-caption"
|
||||
// See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
|
||||
rdisplayswap = /^(none|table(?!-c[ea]).+)/,
|
||||
rcustomProp = /^--/,
|
||||
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
|
||||
cssNormalTransform = {
|
||||
letterSpacing: "0",
|
||||
fontWeight: "400"
|
||||
},
|
||||
|
||||
cssPrefixes = [ "Webkit", "Moz", "ms" ],
|
||||
emptyStyle = document.createElement( "div" ).style;
|
||||
|
||||
// Return a css property mapped to a potentially vendor prefixed property
|
||||
// Return a vendor-prefixed property or undefined
|
||||
function vendorPropName( name ) {
|
||||
|
||||
// Shortcut for names that are not vendor prefixed
|
||||
if ( name in emptyStyle ) {
|
||||
return name;
|
||||
}
|
||||
|
||||
// Check for vendor prefixed names
|
||||
var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
|
||||
i = cssPrefixes.length;
|
||||
@@ -6259,16 +6427,33 @@ function vendorPropName( name ) {
|
||||
}
|
||||
}
|
||||
|
||||
// Return a property mapped along what jQuery.cssProps suggests or to
|
||||
// a vendor prefixed property.
|
||||
// Return a potentially-mapped jQuery.cssProps or vendor prefixed property
|
||||
function finalPropName( name ) {
|
||||
var ret = jQuery.cssProps[ name ];
|
||||
if ( !ret ) {
|
||||
ret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;
|
||||
var final = jQuery.cssProps[ name ] || vendorProps[ name ];
|
||||
|
||||
if ( final ) {
|
||||
return final;
|
||||
}
|
||||
return ret;
|
||||
if ( name in emptyStyle ) {
|
||||
return name;
|
||||
}
|
||||
return vendorProps[ name ] = vendorPropName( name ) || name;
|
||||
}
|
||||
|
||||
|
||||
var
|
||||
|
||||
// Swappable if display is none or starts with table
|
||||
// except "table", "table-cell", or "table-caption"
|
||||
// See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
|
||||
rdisplayswap = /^(none|table(?!-c[ea]).+)/,
|
||||
rcustomProp = /^--/,
|
||||
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
|
||||
cssNormalTransform = {
|
||||
letterSpacing: "0",
|
||||
fontWeight: "400"
|
||||
};
|
||||
|
||||
function setPositiveNumber( elem, value, subtract ) {
|
||||
|
||||
// Any relative (+/-) values have already been
|
||||
@@ -6340,7 +6525,10 @@ function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computed
|
||||
delta -
|
||||
extra -
|
||||
0.5
|
||||
) );
|
||||
|
||||
// If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter
|
||||
// Use an explicit zero to avoid NaN (gh-3964)
|
||||
) ) || 0;
|
||||
}
|
||||
|
||||
return delta;
|
||||
@@ -6350,9 +6538,16 @@ function getWidthOrHeight( elem, dimension, extra ) {
|
||||
|
||||
// Start with computed style
|
||||
var styles = getStyles( elem ),
|
||||
|
||||
// To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).
|
||||
// Fake content-box until we know it's needed to know the true value.
|
||||
boxSizingNeeded = !support.boxSizingReliable() || extra,
|
||||
isBorderBox = boxSizingNeeded &&
|
||||
jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
|
||||
valueIsBorderBox = isBorderBox,
|
||||
|
||||
val = curCSS( elem, dimension, styles ),
|
||||
isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
|
||||
valueIsBorderBox = isBorderBox;
|
||||
offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 );
|
||||
|
||||
// Support: Firefox <=54
|
||||
// Return a confounding non-pixel value or feign ignorance, as appropriate.
|
||||
@@ -6363,22 +6558,29 @@ function getWidthOrHeight( elem, dimension, extra ) {
|
||||
val = "auto";
|
||||
}
|
||||
|
||||
// Check for style in case a browser which returns unreliable values
|
||||
// for getComputedStyle silently falls back to the reliable elem.style
|
||||
valueIsBorderBox = valueIsBorderBox &&
|
||||
( support.boxSizingReliable() || val === elem.style[ dimension ] );
|
||||
|
||||
// Fall back to offsetWidth/offsetHeight when value is "auto"
|
||||
// This happens for inline elements with no explicit setting (gh-3571)
|
||||
// Support: Android <=4.1 - 4.3 only
|
||||
// Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)
|
||||
if ( val === "auto" ||
|
||||
!parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) {
|
||||
// Support: IE 9-11 only
|
||||
// Also use offsetWidth/offsetHeight for when box sizing is unreliable
|
||||
// We use getClientRects() to check for hidden/disconnected.
|
||||
// In those cases, the computed value can be trusted to be border-box
|
||||
if ( ( !support.boxSizingReliable() && isBorderBox ||
|
||||
val === "auto" ||
|
||||
!parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) &&
|
||||
elem.getClientRects().length ) {
|
||||
|
||||
val = elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ];
|
||||
isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
|
||||
|
||||
// offsetWidth/offsetHeight provide border-box values
|
||||
valueIsBorderBox = true;
|
||||
// Where available, offsetWidth/offsetHeight approximate border box dimensions.
|
||||
// Where not available (e.g., SVG), assume unreliable box-sizing and interpret the
|
||||
// retrieved value as a content box dimension.
|
||||
valueIsBorderBox = offsetProp in elem;
|
||||
if ( valueIsBorderBox ) {
|
||||
val = elem[ offsetProp ];
|
||||
}
|
||||
}
|
||||
|
||||
// Normalize "" and auto
|
||||
@@ -6424,6 +6626,13 @@ jQuery.extend( {
|
||||
"flexGrow": true,
|
||||
"flexShrink": true,
|
||||
"fontWeight": true,
|
||||
"gridArea": true,
|
||||
"gridColumn": true,
|
||||
"gridColumnEnd": true,
|
||||
"gridColumnStart": true,
|
||||
"gridRow": true,
|
||||
"gridRowEnd": true,
|
||||
"gridRowStart": true,
|
||||
"lineHeight": true,
|
||||
"opacity": true,
|
||||
"order": true,
|
||||
@@ -6479,7 +6688,9 @@ jQuery.extend( {
|
||||
}
|
||||
|
||||
// If a number was passed in, add the unit (except for certain CSS properties)
|
||||
if ( type === "number" ) {
|
||||
// The isCustomProp check can be removed in jQuery 4.0 when we only auto-append
|
||||
// "px" to a few hardcoded values.
|
||||
if ( type === "number" && !isCustomProp ) {
|
||||
value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
|
||||
}
|
||||
|
||||
@@ -6579,18 +6790,29 @@ jQuery.each( [ "height", "width" ], function( i, dimension ) {
|
||||
set: function( elem, value, extra ) {
|
||||
var matches,
|
||||
styles = getStyles( elem ),
|
||||
isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
|
||||
subtract = extra && boxModelAdjustment(
|
||||
elem,
|
||||
dimension,
|
||||
extra,
|
||||
isBorderBox,
|
||||
styles
|
||||
);
|
||||
|
||||
// Only read styles.position if the test has a chance to fail
|
||||
// to avoid forcing a reflow.
|
||||
scrollboxSizeBuggy = !support.scrollboxSize() &&
|
||||
styles.position === "absolute",
|
||||
|
||||
// To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)
|
||||
boxSizingNeeded = scrollboxSizeBuggy || extra,
|
||||
isBorderBox = boxSizingNeeded &&
|
||||
jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
|
||||
subtract = extra ?
|
||||
boxModelAdjustment(
|
||||
elem,
|
||||
dimension,
|
||||
extra,
|
||||
isBorderBox,
|
||||
styles
|
||||
) :
|
||||
0;
|
||||
|
||||
// Account for unreliable border-box dimensions by comparing offset* to computed and
|
||||
// faking a content-box to get border and padding (gh-3699)
|
||||
if ( isBorderBox && support.scrollboxSize() === styles.position ) {
|
||||
if ( isBorderBox && scrollboxSizeBuggy ) {
|
||||
subtract -= Math.ceil(
|
||||
elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
|
||||
parseFloat( styles[ dimension ] ) -
|
||||
@@ -6758,9 +6980,9 @@ Tween.propHooks = {
|
||||
// Use .style if available and use plain properties where available.
|
||||
if ( jQuery.fx.step[ tween.prop ] ) {
|
||||
jQuery.fx.step[ tween.prop ]( tween );
|
||||
} else if ( tween.elem.nodeType === 1 &&
|
||||
( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null ||
|
||||
jQuery.cssHooks[ tween.prop ] ) ) {
|
||||
} else if ( tween.elem.nodeType === 1 && (
|
||||
jQuery.cssHooks[ tween.prop ] ||
|
||||
tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {
|
||||
jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
|
||||
} else {
|
||||
tween.elem[ tween.prop ] = tween.now;
|
||||
@@ -8467,6 +8689,10 @@ jQuery.param = function( a, traditional ) {
|
||||
encodeURIComponent( value == null ? "" : value );
|
||||
};
|
||||
|
||||
if ( a == null ) {
|
||||
return "";
|
||||
}
|
||||
|
||||
// If an array was passed in, assume that it is an array of form elements.
|
||||
if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
|
||||
|
||||
@@ -8969,12 +9195,14 @@ jQuery.extend( {
|
||||
if ( !responseHeaders ) {
|
||||
responseHeaders = {};
|
||||
while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
|
||||
responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ];
|
||||
responseHeaders[ match[ 1 ].toLowerCase() + " " ] =
|
||||
( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] )
|
||||
.concat( match[ 2 ] );
|
||||
}
|
||||
}
|
||||
match = responseHeaders[ key.toLowerCase() ];
|
||||
match = responseHeaders[ key.toLowerCase() + " " ];
|
||||
}
|
||||
return match == null ? null : match;
|
||||
return match == null ? null : match.join( ", " );
|
||||
},
|
||||
|
||||
// Raw string
|
||||
@@ -9363,7 +9591,7 @@ jQuery.each( [ "get", "post" ], function( i, method ) {
|
||||
} );
|
||||
|
||||
|
||||
jQuery._evalUrl = function( url ) {
|
||||
jQuery._evalUrl = function( url, options ) {
|
||||
return jQuery.ajax( {
|
||||
url: url,
|
||||
|
||||
@@ -9373,7 +9601,16 @@ jQuery._evalUrl = function( url ) {
|
||||
cache: true,
|
||||
async: false,
|
||||
global: false,
|
||||
"throws": true
|
||||
|
||||
// Only evaluate the response if it is successful (gh-4126)
|
||||
// dataFilter is not invoked for failure responses, so using it instead
|
||||
// of the default converter is kludgy but it works.
|
||||
converters: {
|
||||
"text script": function() {}
|
||||
},
|
||||
dataFilter: function( response ) {
|
||||
jQuery.globalEval( response, options );
|
||||
}
|
||||
} );
|
||||
};
|
||||
|
||||
@@ -9656,24 +9893,21 @@ jQuery.ajaxPrefilter( "script", function( s ) {
|
||||
// Bind script tag hack transport
|
||||
jQuery.ajaxTransport( "script", function( s ) {
|
||||
|
||||
// This transport only deals with cross domain requests
|
||||
if ( s.crossDomain ) {
|
||||
// This transport only deals with cross domain or forced-by-attrs requests
|
||||
if ( s.crossDomain || s.scriptAttrs ) {
|
||||
var script, callback;
|
||||
return {
|
||||
send: function( _, complete ) {
|
||||
script = jQuery( "<script>" ).prop( {
|
||||
charset: s.scriptCharset,
|
||||
src: s.url
|
||||
} ).on(
|
||||
"load error",
|
||||
callback = function( evt ) {
|
||||
script = jQuery( "<script>" )
|
||||
.attr( s.scriptAttrs || {} )
|
||||
.prop( { charset: s.scriptCharset, src: s.url } )
|
||||
.on( "load error", callback = function( evt ) {
|
||||
script.remove();
|
||||
callback = null;
|
||||
if ( evt ) {
|
||||
complete( evt.type === "error" ? 404 : 200, evt.type );
|
||||
}
|
||||
}
|
||||
);
|
||||
} );
|
||||
|
||||
// Use native DOM manipulation to avoid our domManip AJAX trickery
|
||||
document.head.appendChild( script[ 0 ] );
|
||||
|
||||
Vendored
+2
-2
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+642
-551
File diff suppressed because it is too large
Load Diff
Vendored
-3
File diff suppressed because one or more lines are too long
+78
-92
@@ -24,26 +24,10 @@
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(function () {
|
||||
return (root.returnExportsGlobal = factory());
|
||||
});
|
||||
} else if (typeof exports === 'object') {
|
||||
// Node. Does not work with strict CommonJS, but
|
||||
// only CommonJS-like enviroments that support module.exports,
|
||||
// like Node.
|
||||
module.exports = factory();
|
||||
} else {
|
||||
// Browser globals
|
||||
root.Springy = factory();
|
||||
}
|
||||
}(this, function() {
|
||||
window.Springy = function() {
|
||||
const Springy = {};
|
||||
|
||||
var Springy = {};
|
||||
|
||||
var Graph = Springy.Graph = function() {
|
||||
const Graph = Springy.Graph = function () {
|
||||
this.nodeSet = {};
|
||||
this.nodes = [];
|
||||
this.edges = [];
|
||||
@@ -54,25 +38,25 @@
|
||||
this.eventListeners = [];
|
||||
};
|
||||
|
||||
var Node = Springy.Node = function(id, data) {
|
||||
const Node = Springy.Node = function (id, data) {
|
||||
this.id = id;
|
||||
this.data = (data !== undefined) ? data : {};
|
||||
|
||||
// Data fields used by layout algorithm in this file:
|
||||
// this.data.mass
|
||||
// Data used by default renderer in springyui.js
|
||||
// this.data.label
|
||||
// Data fields used by layout algorithm in this file:
|
||||
// this.data.mass
|
||||
// Data used by default renderer in springyui.js
|
||||
// this.data.label
|
||||
};
|
||||
|
||||
var Edge = Springy.Edge = function(id, source, target, data) {
|
||||
const Edge = Springy.Edge = function (id, source, target, data) {
|
||||
this.id = id;
|
||||
this.source = source;
|
||||
this.target = target;
|
||||
this.data = (data !== undefined) ? data : {};
|
||||
|
||||
// Edge data field used by layout alorithm
|
||||
// this.data.length
|
||||
// this.data.type
|
||||
// Edge data field used by layout alorithm
|
||||
// this.data.length
|
||||
// this.data.type
|
||||
};
|
||||
|
||||
Graph.prototype.addNode = function(node) {
|
||||
@@ -89,15 +73,15 @@
|
||||
Graph.prototype.addNodes = function() {
|
||||
// accepts variable number of arguments, where each argument
|
||||
// is a string that becomes both node identifier and label
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
var name = arguments[i];
|
||||
var node = new Node(name, {label:name});
|
||||
for (let i = 0; i < arguments.length; i++) {
|
||||
const name = arguments[i];
|
||||
const node = new Node(name, {label: name});
|
||||
this.addNode(node);
|
||||
}
|
||||
};
|
||||
|
||||
Graph.prototype.addEdge = function(edge) {
|
||||
var exists = false;
|
||||
let exists = false;
|
||||
this.edges.forEach(function(e) {
|
||||
if (edge.id === e.id) { exists = true; }
|
||||
});
|
||||
@@ -129,30 +113,30 @@
|
||||
Graph.prototype.addEdges = function() {
|
||||
// accepts variable number of arguments, where each argument
|
||||
// is a triple [nodeid1, nodeid2, attributes]
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
var e = arguments[i];
|
||||
var node1 = this.nodeSet[e[0]];
|
||||
for (let i = 0; i < arguments.length; i++) {
|
||||
const e = arguments[i];
|
||||
const node1 = this.nodeSet[e[0]];
|
||||
if (node1 == undefined) {
|
||||
throw new TypeError("invalid node name: " + e[0]);
|
||||
}
|
||||
var node2 = this.nodeSet[e[1]];
|
||||
const node2 = this.nodeSet[e[1]];
|
||||
if (node2 == undefined) {
|
||||
throw new TypeError("invalid node name: " + e[1]);
|
||||
}
|
||||
var attr = e[2];
|
||||
const attr = e[2];
|
||||
|
||||
this.newEdge(node1, node2, attr);
|
||||
}
|
||||
};
|
||||
|
||||
Graph.prototype.newNode = function(data) {
|
||||
var node = new Node(this.nextNodeId++, data);
|
||||
const node = new Node(this.nextNodeId++, data);
|
||||
this.addNode(node);
|
||||
return node;
|
||||
};
|
||||
|
||||
Graph.prototype.newEdge = function(source, target, data) {
|
||||
var edge = new Edge(this.nextEdgeId++, source, target, data);
|
||||
const edge = new Edge(this.nextEdgeId++, source, target, data);
|
||||
this.addEdge(edge);
|
||||
return edge;
|
||||
};
|
||||
@@ -210,7 +194,7 @@
|
||||
delete this.nodeSet[node.id];
|
||||
}
|
||||
|
||||
for (var i = this.nodes.length - 1; i >= 0; i--) {
|
||||
for (let i = this.nodes.length - 1; i >= 0; i--) {
|
||||
if (this.nodes[i].id === node.id) {
|
||||
this.nodes.splice(i, 1);
|
||||
}
|
||||
@@ -221,7 +205,7 @@
|
||||
|
||||
// removes edges associated with a given node
|
||||
Graph.prototype.detachNode = function(node) {
|
||||
var tmpEdges = this.edges.slice();
|
||||
const tmpEdges = this.edges.slice();
|
||||
tmpEdges.forEach(function(e) {
|
||||
if (e.source.id === node.id || e.target.id === node.id) {
|
||||
this.removeEdge(e);
|
||||
@@ -233,17 +217,17 @@
|
||||
|
||||
// remove a node and it's associated edges from the graph
|
||||
Graph.prototype.removeEdge = function(edge) {
|
||||
for (var i = this.edges.length - 1; i >= 0; i--) {
|
||||
for (let i = this.edges.length - 1; i >= 0; i--) {
|
||||
if (this.edges[i].id === edge.id) {
|
||||
this.edges.splice(i, 1);
|
||||
}
|
||||
}
|
||||
|
||||
for (var x in this.adjacency) {
|
||||
for (var y in this.adjacency[x]) {
|
||||
var edges = this.adjacency[x][y];
|
||||
for (const x in this.adjacency) {
|
||||
for (const y in this.adjacency[x]) {
|
||||
const edges = this.adjacency[x][y];
|
||||
|
||||
for (var j=edges.length - 1; j>=0; j--) {
|
||||
for (let j = edges.length - 1; j >= 0; j--) {
|
||||
if (this.adjacency[x][y][j].id === edge.id) {
|
||||
this.adjacency[x][y].splice(j, 1);
|
||||
}
|
||||
@@ -276,28 +260,28 @@
|
||||
}
|
||||
*/
|
||||
Graph.prototype.merge = function(data) {
|
||||
var nodes = [];
|
||||
const nodes = [];
|
||||
data.nodes.forEach(function(n) {
|
||||
nodes.push(this.addNode(new Node(n.id, n.data)));
|
||||
}, this);
|
||||
|
||||
data.edges.forEach(function(e) {
|
||||
var from = nodes[e.from];
|
||||
var to = nodes[e.to];
|
||||
const from = nodes[e.from];
|
||||
const to = nodes[e.to];
|
||||
|
||||
var id = (e.directed)
|
||||
? (id = e.type + "-" + from.id + "-" + to.id)
|
||||
let id = (e.directed)
|
||||
? (e.type + "-" + from.id + "-" + to.id)
|
||||
: (from.id < to.id) // normalise id for non-directed edges
|
||||
? e.type + "-" + from.id + "-" + to.id
|
||||
: e.type + "-" + to.id + "-" + from.id;
|
||||
|
||||
var edge = this.addEdge(new Edge(id, from, to, e.data));
|
||||
const edge = this.addEdge(new Edge(id, from, to, e.data));
|
||||
edge.data.type = e.type;
|
||||
}, this);
|
||||
};
|
||||
|
||||
Graph.prototype.filterNodes = function(fn) {
|
||||
var tmpNodes = this.nodes.slice();
|
||||
const tmpNodes = this.nodes.slice();
|
||||
tmpNodes.forEach(function(n) {
|
||||
if (!fn(n)) {
|
||||
this.removeNode(n);
|
||||
@@ -306,7 +290,7 @@
|
||||
};
|
||||
|
||||
Graph.prototype.filterEdges = function(fn) {
|
||||
var tmpEdges = this.edges.slice();
|
||||
const tmpEdges = this.edges.slice();
|
||||
tmpEdges.forEach(function(e) {
|
||||
if (!fn(e)) {
|
||||
this.removeEdge(e);
|
||||
@@ -326,9 +310,10 @@
|
||||
};
|
||||
|
||||
// -----------
|
||||
var Layout = Springy.Layout = {};
|
||||
Layout.ForceDirected = function(graph, stiffness, repulsion, damping, minEnergyThreshold, maxSpeed) {
|
||||
const Layout = Springy.Layout = {};
|
||||
Layout.ForceDirected = function(graph, stopCheckerCallback, stiffness, repulsion, damping, minEnergyThreshold, maxSpeed) {
|
||||
this.graph = graph;
|
||||
this.stopCheckerCallback = stopCheckerCallback || (() => false);
|
||||
this.stiffness = stiffness; // spring stiffness constant
|
||||
this.repulsion = repulsion; // repulsion constant
|
||||
this.damping = damping; // velocity damping factor
|
||||
@@ -341,7 +326,7 @@
|
||||
|
||||
Layout.ForceDirected.prototype.point = function(node) {
|
||||
if (!(node.id in this.nodePoints)) {
|
||||
var mass = (node.data.mass !== undefined) ? node.data.mass : 1.0;
|
||||
const mass = (node.data.mass !== undefined) ? node.data.mass : 1.0;
|
||||
this.nodePoints[node.id] = new Layout.ForceDirected.Point(Vector.random(), mass);
|
||||
}
|
||||
|
||||
@@ -350,11 +335,11 @@
|
||||
|
||||
Layout.ForceDirected.prototype.spring = function(edge) {
|
||||
if (!(edge.id in this.edgeSprings)) {
|
||||
var length = (edge.data.length !== undefined) ? edge.data.length : 1.0;
|
||||
const length = (edge.data.length !== undefined) ? edge.data.length : 1.0;
|
||||
|
||||
var existingSpring = false;
|
||||
let existingSpring = false;
|
||||
|
||||
var from = this.graph.getEdges(edge.source, edge.target);
|
||||
const from = this.graph.getEdges(edge.source, edge.target);
|
||||
from.forEach(function(e) {
|
||||
if (existingSpring === false && e.id in this.edgeSprings) {
|
||||
existingSpring = this.edgeSprings[e.id];
|
||||
@@ -365,8 +350,8 @@
|
||||
return new Layout.ForceDirected.Spring(existingSpring.point1, existingSpring.point2, 0.0, 0.0);
|
||||
}
|
||||
|
||||
var to = this.graph.getEdges(edge.target, edge.source);
|
||||
from.forEach(function(e){
|
||||
const to = this.graph.getEdges(edge.target, edge.source);
|
||||
to.forEach(function(e){
|
||||
if (existingSpring === false && e.id in this.edgeSprings) {
|
||||
existingSpring = this.edgeSprings[e.id];
|
||||
}
|
||||
@@ -386,7 +371,7 @@
|
||||
|
||||
// callback should accept two arguments: Node, Point
|
||||
Layout.ForceDirected.prototype.eachNode = function(callback) {
|
||||
var t = this;
|
||||
const t = this;
|
||||
this.graph.nodes.forEach(function(n){
|
||||
callback.call(t, n, t.point(n));
|
||||
});
|
||||
@@ -394,7 +379,7 @@
|
||||
|
||||
// callback should accept two arguments: Edge, Spring
|
||||
Layout.ForceDirected.prototype.eachEdge = function(callback) {
|
||||
var t = this;
|
||||
const t = this;
|
||||
this.graph.edges.forEach(function(e){
|
||||
callback.call(t, e, t.spring(e));
|
||||
});
|
||||
@@ -402,7 +387,7 @@
|
||||
|
||||
// callback should accept one argument: Spring
|
||||
Layout.ForceDirected.prototype.eachSpring = function(callback) {
|
||||
var t = this;
|
||||
const t = this;
|
||||
this.graph.edges.forEach(function(e){
|
||||
callback.call(t, t.spring(e));
|
||||
});
|
||||
@@ -413,12 +398,11 @@
|
||||
Layout.ForceDirected.prototype.applyCoulombsLaw = function() {
|
||||
this.eachNode(function(n1, point1) {
|
||||
this.eachNode(function(n2, point2) {
|
||||
if (point1 !== point2)
|
||||
{
|
||||
var d = point1.p.subtract(point2.p);
|
||||
var distance = d.magnitude() + 0.1; // avoid massive forces at small distances (and divide by zero)
|
||||
if (point1 !== point2) {
|
||||
const d = point1.p.subtract(point2.p);
|
||||
const distance = d.magnitude() + 0.1; // avoid massive forces at small distances (and divide by zero)
|
||||
|
||||
var direction = d.normalise();
|
||||
const direction = d.normalise();
|
||||
|
||||
// apply force to each end point
|
||||
point1.applyForce(direction.multiply(this.repulsion).divide(distance * distance * distance * 0.5));
|
||||
@@ -430,9 +414,9 @@
|
||||
|
||||
Layout.ForceDirected.prototype.applyHookesLaw = function() {
|
||||
this.eachSpring(function(spring){
|
||||
var d = spring.point2.p.subtract(spring.point1.p); // the direction of the spring
|
||||
var displacement = spring.length - d.magnitude();
|
||||
var direction = d.normalise();
|
||||
const d = spring.point2.p.subtract(spring.point1.p); // the direction of the spring
|
||||
const displacement = spring.length - d.magnitude();
|
||||
const direction = d.normalise();
|
||||
|
||||
// apply force to each end point
|
||||
spring.point1.applyForce(direction.multiply(spring.k * displacement * -0.5));
|
||||
@@ -442,7 +426,7 @@
|
||||
|
||||
Layout.ForceDirected.prototype.attractToCentre = function() {
|
||||
this.eachNode(function(node, point) {
|
||||
var direction = point.p.multiply(-1.0);
|
||||
const direction = point.p.multiply(-1.0);
|
||||
point.applyForce(direction.multiply(this.repulsion / 50.0));
|
||||
});
|
||||
};
|
||||
@@ -470,9 +454,9 @@
|
||||
|
||||
// Calculate the total kinetic energy of the system
|
||||
Layout.ForceDirected.prototype.totalEnergy = function(timestep) {
|
||||
var energy = 0.0;
|
||||
let energy = 0.0;
|
||||
this.eachNode(function(node, point) {
|
||||
var speed = point.v.magnitude();
|
||||
const speed = point.v.magnitude();
|
||||
energy += 0.5 * point.m * speed * speed;
|
||||
});
|
||||
|
||||
@@ -484,7 +468,7 @@
|
||||
* In case it's running then the call is ignored, and none of the callbacks passed is ever executed.
|
||||
*/
|
||||
Layout.ForceDirected.prototype.start = function(onRenderStop) {
|
||||
var t = this;
|
||||
const t = this;
|
||||
|
||||
if (this._started) return;
|
||||
this._started = true;
|
||||
@@ -493,12 +477,16 @@
|
||||
function step() {
|
||||
t.tick(0.03);
|
||||
|
||||
if (t.stopCheckerCallback()) {
|
||||
onRenderStop();
|
||||
}
|
||||
|
||||
// stop simulation when energy of the system goes below a threshold
|
||||
if (t._stop || t.totalEnergy() < t.minEnergyThreshold) {
|
||||
t._started = false;
|
||||
onRenderStop();
|
||||
} else {
|
||||
requestIdleCallback(step, { timeout: 10 });
|
||||
requestIdleCallback(step, { timeout: 30 });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -519,11 +507,11 @@
|
||||
|
||||
// Find the nearest point to a particular position
|
||||
Layout.ForceDirected.prototype.nearest = function(pos) {
|
||||
var min = {node: null, point: null, distance: null};
|
||||
var t = this;
|
||||
let min = {node: null, point: null, distance: null};
|
||||
const t = this;
|
||||
this.graph.nodes.forEach(function(n){
|
||||
var point = t.point(n);
|
||||
var distance = point.p.subtract(pos).magnitude();
|
||||
const point = t.point(n);
|
||||
const distance = point.p.subtract(pos).magnitude();
|
||||
|
||||
if (min.distance === null || distance < min.distance) {
|
||||
min = {node: n, point: point, distance: distance};
|
||||
@@ -535,8 +523,8 @@
|
||||
|
||||
// returns [bottomleft, topright]
|
||||
Layout.ForceDirected.prototype.getBoundingBox = function() {
|
||||
var bottomleft = new Vector(-2,-2);
|
||||
var topright = new Vector(2,2);
|
||||
const bottomleft = new Vector(-2, -2);
|
||||
const topright = new Vector(2, 2);
|
||||
|
||||
this.eachNode(function(n, point) {
|
||||
if (point.p.x < bottomleft.x) {
|
||||
@@ -553,14 +541,14 @@
|
||||
}
|
||||
});
|
||||
|
||||
var padding = topright.subtract(bottomleft).multiply(0.07); // ~5% padding
|
||||
const padding = topright.subtract(bottomleft).multiply(0.07); // ~5% padding
|
||||
|
||||
return {bottomleft: bottomleft.subtract(padding), topright: topright.add(padding)};
|
||||
};
|
||||
|
||||
|
||||
// Vector
|
||||
var Vector = Springy.Vector = function(x, y) {
|
||||
const Vector = Springy.Vector = function(x, y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
};
|
||||
@@ -629,10 +617,8 @@
|
||||
/**
|
||||
* Renderer handles the layout rendering loop
|
||||
*/
|
||||
var Renderer = Springy.Renderer = function(layout, onRenderStop) {
|
||||
const Renderer = Springy.Renderer = function (layout) {
|
||||
this.layout = layout;
|
||||
this.onRenderStop = onRenderStop;
|
||||
|
||||
this.layout.graph.addGraphListener(this);
|
||||
};
|
||||
|
||||
@@ -657,8 +643,8 @@
|
||||
this.layout.stop();
|
||||
};
|
||||
|
||||
var isEmpty = function(obj) {
|
||||
for (var k in obj) {
|
||||
const isEmpty = function(obj) {
|
||||
for (const k in obj) {
|
||||
if (obj.hasOwnProperty(k)) {
|
||||
return false;
|
||||
}
|
||||
@@ -667,4 +653,4 @@
|
||||
};
|
||||
|
||||
return Springy;
|
||||
}));
|
||||
}();
|
||||
|
||||
Generated
+1429
-1313
File diff suppressed because it is too large
Load Diff
+33
-33
@@ -2,7 +2,7 @@
|
||||
"name": "trilium",
|
||||
"productName": "Trilium Notes",
|
||||
"description": "Trilium Notes",
|
||||
"version": "0.40.3",
|
||||
"version": "0.41.0-beta",
|
||||
"license": "AGPL-3.0-only",
|
||||
"main": "electron.js",
|
||||
"bin": {
|
||||
@@ -14,73 +14,73 @@
|
||||
},
|
||||
"scripts": {
|
||||
"start-server": "TRILIUM_ENV=dev node ./src/www",
|
||||
"start-electron": "TRILIUM_ENV=dev electron . --disable-gpu",
|
||||
"start-electron": "TRILIUM_ENV=dev electron .",
|
||||
"build-backend-docs": "./node_modules/.bin/jsdoc -c jsdoc-conf.json -d ./docs/backend_api src/entities/*.js src/services/backend_script_api.js",
|
||||
"build-frontend-docs": "./node_modules/.bin/jsdoc -c jsdoc-conf.json -d ./docs/frontend_api src/public/javascripts/entities/*.js src/public/javascripts/services/frontend_script_api.js",
|
||||
"build-docs": "npm run build-backend-docs && npm run build-frontend-docs"
|
||||
},
|
||||
"dependencies": {
|
||||
"async-mutex": "0.1.4",
|
||||
"axios": "0.19.1",
|
||||
"axios": "0.19.2",
|
||||
"body-parser": "1.19.0",
|
||||
"cls-hooked": "4.2.2",
|
||||
"commonmark": "0.29.1",
|
||||
"cookie-parser": "1.4.4",
|
||||
"csurf": "1.10.0",
|
||||
"dayjs": "1.8.19",
|
||||
"cookie-parser": "1.4.5",
|
||||
"csurf": "1.11.0",
|
||||
"dayjs": "1.8.23",
|
||||
"debug": "4.1.1",
|
||||
"ejs": "2.7.4",
|
||||
"ejs": "3.0.2",
|
||||
"electron-debug": "3.0.1",
|
||||
"electron-dl": "2.0.0",
|
||||
"electron-dl": "3.0.0",
|
||||
"electron-find": "1.0.6",
|
||||
"electron-spellchecker": "2.2.1",
|
||||
"electron-window-state": "5.0.3",
|
||||
"express": "4.17.1",
|
||||
"express-session": "1.17.0",
|
||||
"file-type": "13.0.3",
|
||||
"fs-extra": "8.1.0",
|
||||
"helmet": "3.21.2",
|
||||
"file-type": "14.1.4",
|
||||
"fs-extra": "9.0.0",
|
||||
"helmet": "3.22.0",
|
||||
"html": "1.0.0",
|
||||
"html2plaintext": "2.1.2",
|
||||
"http-proxy-agent": "3.0.0",
|
||||
"https-proxy-agent": "4.0.0",
|
||||
"http-proxy-agent": "4.0.1",
|
||||
"https-proxy-agent": "5.0.0",
|
||||
"image-type": "4.1.0",
|
||||
"imagemin": "7.0.1",
|
||||
"imagemin-giflossy": "5.1.10",
|
||||
"imagemin-mozjpeg": "8.0.0",
|
||||
"imagemin-pngquant": "8.0.0",
|
||||
"ini": "1.3.5",
|
||||
"jimp": "0.9.3",
|
||||
"is-svg": "4.2.1",
|
||||
"jimp": "0.10.0",
|
||||
"mime-types": "2.1.26",
|
||||
"moment": "2.24.0",
|
||||
"multer": "1.4.2",
|
||||
"node-abi": "2.13.0",
|
||||
"open": "7.0.0",
|
||||
"pngjs": "3.4.0",
|
||||
"node-abi": "2.15.0",
|
||||
"open": "7.0.3",
|
||||
"portscanner": "2.2.0",
|
||||
"rand-token": "0.4.0",
|
||||
"rcedit": "2.1.0",
|
||||
"rimraf": "3.0.0",
|
||||
"rand-token": "1.0.1",
|
||||
"rcedit": "2.1.1",
|
||||
"rimraf": "3.0.2",
|
||||
"sanitize-filename": "1.6.3",
|
||||
"sax": "1.2.4",
|
||||
"semver": "7.1.1",
|
||||
"semver": "7.1.3",
|
||||
"serve-favicon": "2.5.0",
|
||||
"session-file-store": "1.3.1",
|
||||
"simple-node-logger": "18.12.23",
|
||||
"sqlite": "3.0.3",
|
||||
"session-file-store": "1.4.0",
|
||||
"simple-node-logger": "18.12.24",
|
||||
"sqlite": "3.0.6",
|
||||
"sqlite3": "4.1.1",
|
||||
"string-similarity": "4.0.1",
|
||||
"tar-stream": "2.1.0",
|
||||
"turndown": "5.0.3",
|
||||
"tar-stream": "2.1.2",
|
||||
"turndown": "6.0.0",
|
||||
"turndown-plugin-gfm": "1.0.2",
|
||||
"unescape": "1.0.1",
|
||||
"ws": "7.2.1"
|
||||
"ws": "7.2.3",
|
||||
"yauzl": "^2.10.0",
|
||||
"yazl": "^2.5.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"electron": "6.0.12",
|
||||
"electron-builder": "21.2.0",
|
||||
"electron-packager": "14.1.1",
|
||||
"electron-rebuild": "1.8.8",
|
||||
"electron": "9.0.0-beta.12",
|
||||
"electron-builder": "22.4.1",
|
||||
"electron-packager": "14.2.1",
|
||||
"electron-rebuild": "1.10.1",
|
||||
"jsdoc": "3.6.3",
|
||||
"lorem-ipsum": "2.0.3"
|
||||
},
|
||||
|
||||
@@ -116,6 +116,20 @@ class Attribute extends Entity {
|
||||
delete pojo.isOwned;
|
||||
delete pojo.__note;
|
||||
}
|
||||
|
||||
createClone(type, name, value) {
|
||||
return new Attribute({
|
||||
noteId: this.noteId,
|
||||
type: type,
|
||||
name: name,
|
||||
value: value,
|
||||
position: this.position,
|
||||
isInheritable: this.isInheritable,
|
||||
isDeleted: false,
|
||||
utcDateCreated: this.utcDateCreated,
|
||||
utcDateModified: this.utcDateModified
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Attribute;
|
||||
+11
-10
@@ -28,13 +28,6 @@ class Branch extends Entity {
|
||||
// notePosition is not part of hash because it would produce a lot of updates in case of reordering
|
||||
static get hashedProperties() { return ["branchId", "noteId", "parentNoteId", "isDeleted", "deleteId", "prefix"]; }
|
||||
|
||||
constructor(row = {}) {
|
||||
super(row);
|
||||
|
||||
// used to detect move in note tree
|
||||
this.origParentNoteId = this.parentNoteId;
|
||||
}
|
||||
|
||||
/** @returns {Note|null} */
|
||||
async getNote() {
|
||||
return await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.noteId]);
|
||||
@@ -65,9 +58,17 @@ class Branch extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
// cannot be static!
|
||||
updatePojo(pojo) {
|
||||
delete pojo.origParentNoteId;
|
||||
createClone(parentNoteId, notePosition) {
|
||||
return new Branch({
|
||||
noteId: this.noteId,
|
||||
parentNoteId: parentNoteId,
|
||||
notePosition: notePosition,
|
||||
prefix: this.prefix,
|
||||
isExpanded: this.isExpanded,
|
||||
isDeleted: false,
|
||||
utcDateCreated: this.utcDateCreated,
|
||||
utcDateModified: this.utcDateModified
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,9 @@ const ENTITY_NAME_TO_ENTITY = {
|
||||
"attributes": Attribute,
|
||||
"branches": Branch,
|
||||
"notes": Note,
|
||||
"note_contents": Note,
|
||||
"note_revisions": NoteRevision,
|
||||
"note_revision_contents": NoteRevision,
|
||||
"recent_notes": RecentNote,
|
||||
"options": Option,
|
||||
"api_tokens": ApiToken,
|
||||
|
||||
@@ -36,7 +36,7 @@ const RELATION_DEFINITION = 'relation-definition';
|
||||
class Note extends Entity {
|
||||
static get entityName() { return "notes"; }
|
||||
static get primaryKeyName() { return "noteId"; }
|
||||
static get hashedProperties() { return ["noteId", "title", "type", "isProtected", "isDeleted", "deleteId"]; }
|
||||
static get hashedProperties() { return ["noteId", "title", "type", "mime", "isProtected", "isDeleted", "deleteId"]; }
|
||||
|
||||
/**
|
||||
* @param row - object containing database row from "notes" table
|
||||
@@ -95,15 +95,16 @@ class Note extends Entity {
|
||||
this.content = "";
|
||||
}
|
||||
}
|
||||
|
||||
if (this.isStringNote()) {
|
||||
this.content = this.content === null
|
||||
? ""
|
||||
: this.content.toString("UTF-8");
|
||||
}
|
||||
}
|
||||
|
||||
return this.content;
|
||||
if (this.isStringNote()) {
|
||||
return this.content === null
|
||||
? ""
|
||||
: this.content.toString("UTF-8");
|
||||
}
|
||||
else {
|
||||
return this.content;
|
||||
}
|
||||
}
|
||||
|
||||
/** @returns {Promise<*>} */
|
||||
|
||||
@@ -89,15 +89,16 @@ class NoteRevision extends Entity {
|
||||
this.content = "";
|
||||
}
|
||||
}
|
||||
|
||||
if (this.isStringNote()) {
|
||||
this.content = this.content === null
|
||||
? ""
|
||||
: this.content.toString("UTF-8");
|
||||
}
|
||||
}
|
||||
|
||||
return this.content;
|
||||
if (this.isStringNote()) {
|
||||
return this.content === null
|
||||
? ""
|
||||
: this.content.toString("UTF-8");
|
||||
}
|
||||
else {
|
||||
return this.content;
|
||||
}
|
||||
}
|
||||
|
||||
/** @returns {Promise} */
|
||||
|
||||
+155
-181
@@ -1,229 +1,203 @@
|
||||
import cloning from './services/cloning.js';
|
||||
import contextMenu from './services/tree_context_menu.js';
|
||||
import dragAndDropSetup from './services/drag_and_drop.js';
|
||||
import glob from './services/glob.js';
|
||||
import link from './services/link.js';
|
||||
import ws from './services/ws.js';
|
||||
import noteDetailService from './services/note_detail.js';
|
||||
import noteType from './services/note_type.js';
|
||||
import noteType from './widgets/note_type.js';
|
||||
import protectedSessionService from './services/protected_session.js';
|
||||
import protectedSessionHolder from './services/protected_session_holder.js';
|
||||
import searchNotesService from './services/search_notes.js';
|
||||
import FrontendScriptApi from './services/frontend_script_api.js';
|
||||
import ScriptContext from './services/script_context.js';
|
||||
import sync from './services/sync.js';
|
||||
import treeService from './services/tree.js';
|
||||
import treeChanges from './services/branches.js';
|
||||
import treeUtils from './services/tree_utils.js';
|
||||
import branchService from './services/branches.js';
|
||||
import utils from './services/utils.js';
|
||||
import server from './services/server.js';
|
||||
import entrypoints from './services/entrypoints.js';
|
||||
import Entrypoints from './services/entrypoints.js';
|
||||
import noteTooltipService from './services/note_tooltip.js';
|
||||
import bundle from "./services/bundle.js";
|
||||
import treeCache from "./services/tree_cache.js";
|
||||
import libraryLoader from "./services/library_loader.js";
|
||||
import hoistedNoteService from './services/hoisted_note.js';
|
||||
import noteTypeService from './services/note_type.js';
|
||||
import noteTypeService from './widgets/note_type.js';
|
||||
import linkService from './services/link.js';
|
||||
import noteAutocompleteService from './services/note_autocomplete.js';
|
||||
import macInit from './services/mac_init.js';
|
||||
import cssLoader from './services/css_loader.js';
|
||||
import dateNoteService from './services/date_notes.js';
|
||||
import sidebarService from './services/sidebar.js';
|
||||
import importService from './services/import.js';
|
||||
import keyboardActionService from "./services/keyboard_actions.js";
|
||||
import splitService from "./services/split.js";
|
||||
import optionService from "./services/options.js";
|
||||
import options from "./services/options.js";
|
||||
import noteContentRenderer from "./services/note_content_renderer.js";
|
||||
|
||||
window.glob.isDesktop = utils.isDesktop;
|
||||
window.glob.isMobile = utils.isMobile;
|
||||
|
||||
// required for CKEditor image upload plugin
|
||||
window.glob.getActiveNode = treeService.getActiveNode;
|
||||
window.glob.getHeaders = server.getHeaders;
|
||||
window.glob.showAddLinkDialog = () => import('./dialogs/add_link.js').then(d => d.showDialog());
|
||||
window.glob.showIncludeNoteDialog = cb => import('./dialogs/include_note.js').then(d => d.showDialog(cb));
|
||||
window.glob.loadIncludedNote = async (noteId, el) => {
|
||||
const note = await treeCache.getNote(noteId);
|
||||
|
||||
if (note) {
|
||||
$(el).empty().append($("<h3>").append(await linkService.createNoteLink(note.noteId, {
|
||||
showTooltip: false
|
||||
})));
|
||||
|
||||
const {renderedContent} = await noteContentRenderer.getRenderedContent(note);
|
||||
|
||||
$(el).append(renderedContent);
|
||||
}
|
||||
};
|
||||
// this is required by CKEditor when uploading images
|
||||
window.glob.noteChanged = noteDetailService.noteChanged;
|
||||
window.glob.refreshTree = treeService.reload;
|
||||
|
||||
// required for ESLint plugin
|
||||
window.glob.getActiveTabNote = noteDetailService.getActiveTabNote;
|
||||
window.glob.requireLibrary = libraryLoader.requireLibrary;
|
||||
window.glob.ESLINT = libraryLoader.ESLINT;
|
||||
|
||||
protectedSessionHolder.setProtectedSessionId(null);
|
||||
|
||||
window.onerror = function (msg, url, lineNo, columnNo, error) {
|
||||
const string = msg.toLowerCase();
|
||||
|
||||
let message = "Uncaught error: ";
|
||||
|
||||
if (string.includes("Cannot read property 'defaultView' of undefined")) {
|
||||
// ignore this specific error which is very common but we don't know where it comes from
|
||||
// and it seems to be harmless
|
||||
return true;
|
||||
}
|
||||
else if (string.includes("script error")) {
|
||||
message += 'No details available';
|
||||
}
|
||||
else {
|
||||
message += [
|
||||
'Message: ' + msg,
|
||||
'URL: ' + url,
|
||||
'Line: ' + lineNo,
|
||||
'Column: ' + columnNo,
|
||||
'Error object: ' + JSON.stringify(error)
|
||||
].join(' - ');
|
||||
}
|
||||
|
||||
ws.logError(message);
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
for (const appCssNoteId of window.appCssNoteIds) {
|
||||
cssLoader.requireCss(`api/notes/download/${appCssNoteId}`);
|
||||
}
|
||||
|
||||
const wikiBaseUrl = "https://github.com/zadam/trilium/wiki/";
|
||||
|
||||
$(document).on("click", "button[data-help-page]", e => {
|
||||
const $button = $(e.target);
|
||||
|
||||
window.open(wikiBaseUrl + $button.attr("data-help-page"), '_blank');
|
||||
});
|
||||
|
||||
$("#logout-button").toggle(!utils.isElectron());
|
||||
|
||||
$("#logout-button").on('click', () => {
|
||||
const $logoutForm = $('<form action="logout" method="POST">')
|
||||
.append($(`<input type="hidden" name="_csrf" value="${glob.csrfToken}"/>`));
|
||||
|
||||
$("body").append($logoutForm);
|
||||
$logoutForm.trigger('submit');
|
||||
});
|
||||
|
||||
$("#tree").on("click", ".unhoist-button", hoistedNoteService.unhoist);
|
||||
|
||||
$("#tree").on("click", ".refresh-search-button", searchNotesService.refreshSearch);
|
||||
|
||||
$("body").on("click", "a.external", function () {
|
||||
window.open($(this).attr("href"), '_blank');
|
||||
});
|
||||
import appContext from "./services/app_context.js";
|
||||
import FlexContainer from "./widgets/flex_container.js";
|
||||
import GlobalMenuWidget from "./widgets/global_menu.js";
|
||||
import TabRowWidget from "./widgets/tab_row.js";
|
||||
import TitleBarButtonsWidget from "./widgets/title_bar_buttons.js";
|
||||
import StandardTopWidget from "./widgets/standard_top_widget.js";
|
||||
import SidePaneContainer from "./widgets/side_pane_container.js";
|
||||
import GlobalButtonsWidget from "./widgets/global_buttons.js";
|
||||
import SearchBoxWidget from "./widgets/search_box.js";
|
||||
import SearchResultsWidget from "./widgets/search_results.js";
|
||||
import NoteTreeWidget from "./widgets/note_tree.js";
|
||||
import TabCachingWidget from "./widgets/tab_caching_widget.js";
|
||||
import NotePathsWidget from "./widgets/note_paths.js";
|
||||
import NoteTitleWidget from "./widgets/note_title.js";
|
||||
import RunScriptButtonsWidget from "./widgets/run_script_buttons.js";
|
||||
import ProtectedNoteSwitchWidget from "./widgets/protected_note_switch.js";
|
||||
import NoteTypeWidget from "./widgets/note_type.js";
|
||||
import NoteActionsWidget from "./widgets/note_actions.js";
|
||||
import PromotedAttributesWidget from "./widgets/promoted_attributes.js";
|
||||
import NoteDetailWidget from "./widgets/note_detail.js";
|
||||
import NoteInfoWidget from "./widgets/note_info.js";
|
||||
import CalendarWidget from "./widgets/calendar.js";
|
||||
import AttributesWidget from "./widgets/attributes.js";
|
||||
import LinkMapWidget from "./widgets/link_map.js";
|
||||
import NoteRevisionsWidget from "./widgets/note_revisions.js";
|
||||
import SimilarNotesWidget from "./widgets/similar_notes.js";
|
||||
import WhatLinksHereWidget from "./widgets/what_links_here.js";
|
||||
import SidePaneToggles from "./widgets/side_pane_toggles.js";
|
||||
import EmptyTypeWidget from "./widgets/type_widgets/empty.js";
|
||||
import TextTypeWidget from "./widgets/type_widgets/text.js";
|
||||
import CodeTypeWidget from "./widgets/type_widgets/code.js";
|
||||
import FileTypeWidget from "./widgets/type_widgets/file.js";
|
||||
import ImageTypeWidget from "./widgets/type_widgets/image.js";
|
||||
import SearchTypeWidget from "./widgets/type_widgets/search.js";
|
||||
import RenderTypeWidget from "./widgets/type_widgets/render.js";
|
||||
import RelationMapTypeWidget from "./widgets/type_widgets/relation_map.js";
|
||||
import ProtectedSessionTypeWidget from "./widgets/type_widgets/protected_session.js";
|
||||
import BookTypeWidget from "./widgets/type_widgets/book.js";
|
||||
import contextMenu from "./services/context_menu.js";
|
||||
import DesktopLayout from "./widgets/desktop_layout.js";
|
||||
import bundleService from "./services/bundle.js";
|
||||
|
||||
if (utils.isElectron()) {
|
||||
require('electron').ipcRenderer.on('globalShortcut', async function(event, actionName) {
|
||||
keyboardActionService.triggerAction(actionName);
|
||||
appContext.triggerCommand(actionName);
|
||||
});
|
||||
}
|
||||
|
||||
const $noteTabContainer = $("#note-tab-container");
|
||||
|
||||
$noteTabContainer.on("click", ".export-note-button", function () {
|
||||
if ($(this).hasClass("disabled")) {
|
||||
return;
|
||||
}
|
||||
|
||||
import('./dialogs/export.js').then(d => d.showDialog(treeService.getActiveNode(), 'single'));
|
||||
});
|
||||
|
||||
$noteTabContainer.on("click", ".import-files-button",
|
||||
() => import('./dialogs/import.js').then(d => d.showDialog(treeService.getActiveNode())));
|
||||
|
||||
async function printActiveNote() {
|
||||
if ($(this).hasClass("disabled")) {
|
||||
return;
|
||||
}
|
||||
|
||||
const $tabContext = noteDetailService.getActiveTabContext();
|
||||
if (!$tabContext) {
|
||||
return;
|
||||
}
|
||||
|
||||
await libraryLoader.requireLibrary(libraryLoader.PRINT_THIS);
|
||||
|
||||
$tabContext.$tabContent.find('.note-detail-component:visible').printThis({
|
||||
header: $("<h2>").text($tabContext.note && $tabContext.note.title).prop('outerHTML') ,
|
||||
importCSS: false,
|
||||
loadCSS: [
|
||||
"libraries/codemirror/codemirror.css",
|
||||
"libraries/ckeditor/ckeditor-content.css"
|
||||
],
|
||||
debug: true
|
||||
});
|
||||
}
|
||||
|
||||
keyboardActionService.setGlobalActionHandler("PrintActiveNote", printActiveNote);
|
||||
|
||||
$noteTabContainer.on("click", ".print-note-button", printActiveNote);
|
||||
|
||||
$('[data-toggle="tooltip"]').tooltip({
|
||||
html: true
|
||||
});
|
||||
|
||||
// for CKEditor integration (button on block toolbar)
|
||||
window.glob.importMarkdownInline = async () => {
|
||||
const dialog = await import("./dialogs/markdown_import.js");
|
||||
|
||||
dialog.importMarkdownInline();
|
||||
};
|
||||
|
||||
macInit.init();
|
||||
|
||||
searchNotesService.init(); // should be in front of treeService since that one manipulates address bar hash
|
||||
bundleService.getWidgetBundlesByParent().then(widgetBundles => {
|
||||
const desktopLayout = new DesktopLayout(widgetBundles);
|
||||
|
||||
treeService.showTree();
|
||||
|
||||
entrypoints.registerEntrypoints();
|
||||
appContext.setLayout(desktopLayout);
|
||||
appContext.start();
|
||||
});
|
||||
|
||||
noteTooltipService.setupGlobalTooltip();
|
||||
|
||||
noteAutocompleteService.init();
|
||||
|
||||
if (utils.isElectron()) {
|
||||
import("./services/spell_check.js").then(spellCheckService => spellCheckService.initSpellCheck());
|
||||
}
|
||||
const electron = require('electron');
|
||||
const {webContents} = electron.remote.getCurrentWindow();
|
||||
|
||||
optionService.waitForOptions().then(options => {
|
||||
if (utils.isElectron() && !options.is('nativeTitleBarVisible')) {
|
||||
$("#title-bar-buttons").show();
|
||||
webContents.on('context-menu', (event, params) => {
|
||||
const {editFlags} = params;
|
||||
const hasText = params.selectionText.trim().length > 0;
|
||||
const isMac = process.platform === "darwin";
|
||||
const platformModifier = isMac ? 'Meta' : 'Ctrl';
|
||||
|
||||
$("#minimize-btn").on('click', () => {
|
||||
$("#minimize-btn").trigger('blur');
|
||||
const {remote} = require('electron');
|
||||
remote.BrowserWindow.getFocusedWindow().minimize();
|
||||
});
|
||||
const items = [];
|
||||
|
||||
$("#maximize-btn").on('click', () => {
|
||||
$("#maximize-btn").trigger('blur');
|
||||
const {remote} = require('electron');
|
||||
const focusedWindow = remote.BrowserWindow.getFocusedWindow();
|
||||
if (params.misspelledWord) {
|
||||
for (const suggestion of params.dictionarySuggestions) {
|
||||
items.push({
|
||||
title: suggestion,
|
||||
command: "replaceMisspelling",
|
||||
spellingSuggestion: suggestion,
|
||||
uiIcon: "empty"
|
||||
});
|
||||
}
|
||||
|
||||
if (focusedWindow.isMaximized()) {
|
||||
focusedWindow.unmaximize();
|
||||
} else {
|
||||
focusedWindow.maximize();
|
||||
items.push({
|
||||
title: `Add "${params.misspelledWord}" to dictionary`,
|
||||
uiIcon: "plus",
|
||||
handler: () => webContents.session.addWordToSpellCheckerDictionary(params.misspelledWord)
|
||||
});
|
||||
|
||||
items.push({ title: `----` });
|
||||
}
|
||||
|
||||
if (params.isEditable) {
|
||||
items.push({
|
||||
enabled: editFlags.canCut && hasText,
|
||||
title: `Cut <kbd>${platformModifier}+X`,
|
||||
uiIcon: "cut",
|
||||
handler: () => webContents.cut()
|
||||
});
|
||||
}
|
||||
|
||||
if (params.isEditable || hasText) {
|
||||
items.push({
|
||||
enabled: editFlags.canCopy && hasText,
|
||||
title: `Copy <kbd>${platformModifier}+C`,
|
||||
uiIcon: "copy",
|
||||
handler: () => webContents.copy()
|
||||
});
|
||||
}
|
||||
|
||||
if (params.linkURL.length !== 0 && params.mediaType === 'none') {
|
||||
items.push({
|
||||
title: `Copy link`,
|
||||
uiIcon: "copy",
|
||||
handler: () => {
|
||||
electron.clipboard.write({
|
||||
bookmark: params.linkText,
|
||||
text: params.linkURL
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (params.isEditable) {
|
||||
items.push({
|
||||
enabled: editFlags.canPaste,
|
||||
title: `Paste <kbd>${platformModifier}+V`,
|
||||
uiIcon: "paste",
|
||||
handler: () => webContents.paste()
|
||||
});
|
||||
}
|
||||
|
||||
if (params.isEditable) {
|
||||
items.push({
|
||||
enabled: editFlags.canPaste,
|
||||
title: `Paste as plain text <kbd>${platformModifier}+Shift+V`,
|
||||
uiIcon: "paste",
|
||||
handler: () => webContents.pasteAndMatchStyle()
|
||||
});
|
||||
}
|
||||
|
||||
if (hasText) {
|
||||
const shortenedSelection = params.selectionText.length > 15
|
||||
? (params.selectionText.substr(0, 13) + "…")
|
||||
: params.selectionText;
|
||||
|
||||
items.push({
|
||||
enabled: editFlags.canPaste,
|
||||
title: `Search for "${shortenedSelection}" with DuckDuckGo`,
|
||||
uiIcon: "search-alt",
|
||||
handler: () => electron.shell.openExternal(`https://duckduckgo.com/?q=${encodeURIComponent(params.selectionText)}`)
|
||||
});
|
||||
}
|
||||
|
||||
if (items.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
contextMenu.show({
|
||||
x: params.x,
|
||||
y: params.y,
|
||||
items,
|
||||
selectMenuItemHandler: ({command, spellingSuggestion}) => {
|
||||
if (command === 'replaceMisspelling') {
|
||||
webContents.insertText(spellingSuggestion);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$("#close-btn").on('click', () => {
|
||||
$("#close-btn").trigger('blur');
|
||||
const {remote} = require('electron');
|
||||
remote.BrowserWindow.getFocusedWindow().close();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -1,6 +1,4 @@
|
||||
import linkService from '../services/link.js';
|
||||
import noteDetailService from '../services/note_detail.js';
|
||||
import treeUtils from '../services/tree_utils.js';
|
||||
import treeService from '../services/tree.js';
|
||||
import noteAutocompleteService from "../services/note_autocomplete.js";
|
||||
import utils from "../services/utils.js";
|
||||
|
||||
@@ -8,10 +6,19 @@ const $dialog = $("#add-link-dialog");
|
||||
const $form = $("#add-link-form");
|
||||
const $autoComplete = $("#add-link-note-autocomplete");
|
||||
const $linkTitle = $("#link-title");
|
||||
const $addLinkTitleSettings = $("#add-link-title-settings");
|
||||
const $addLinkTitleFormGroup = $("#add-link-title-form-group");
|
||||
|
||||
export async function showDialog() {
|
||||
$addLinkTitleFormGroup.toggle(!hasSelection());
|
||||
/** @var TextTypeWidget */
|
||||
let textTypeWidget;
|
||||
|
||||
export async function showDialog(widget) {
|
||||
textTypeWidget = widget;
|
||||
|
||||
$addLinkTitleSettings.toggle(!textTypeWidget.hasSelection());
|
||||
|
||||
updateTitleFormGroupVisibility();
|
||||
$addLinkTitleSettings.find('input[type=radio]').on('change', updateTitleFormGroupVisibility);
|
||||
|
||||
utils.openDialog($dialog);
|
||||
|
||||
@@ -19,7 +26,7 @@ export async function showDialog() {
|
||||
$linkTitle.val('');
|
||||
|
||||
async function setDefaultLinkTitle(noteId) {
|
||||
const noteTitle = await treeUtils.getNoteTitle(noteId);
|
||||
const noteTitle = await treeService.getNoteTitle(noteId);
|
||||
|
||||
$linkTitle.val(noteTitle);
|
||||
}
|
||||
@@ -31,7 +38,7 @@ export async function showDialog() {
|
||||
return false;
|
||||
}
|
||||
|
||||
const noteId = treeUtils.getNoteIdFromNotePath(suggestion.path);
|
||||
const noteId = treeService.getNoteIdFromNotePath(suggestion.path);
|
||||
|
||||
if (noteId) {
|
||||
setDefaultLinkTitle(noteId);
|
||||
@@ -39,45 +46,39 @@ export async function showDialog() {
|
||||
});
|
||||
|
||||
$autoComplete.on('autocomplete:cursorchanged', function(event, suggestion, dataset) {
|
||||
const noteId = treeUtils.getNoteIdFromNotePath(suggestion.path);
|
||||
const noteId = treeService.getNoteIdFromNotePath(suggestion.path);
|
||||
|
||||
setDefaultLinkTitle(noteId);
|
||||
if (noteId) {
|
||||
setDefaultLinkTitle(noteId);
|
||||
}
|
||||
});
|
||||
|
||||
noteAutocompleteService.showRecentNotes($autoComplete);
|
||||
}
|
||||
|
||||
function getLinkType() {
|
||||
return $addLinkTitleSettings.find('input[type=radio]:checked').val();
|
||||
}
|
||||
|
||||
function updateTitleFormGroupVisibility() {
|
||||
const visible = getLinkType() === 'hyper-link';
|
||||
|
||||
$addLinkTitleFormGroup.toggle(visible);
|
||||
}
|
||||
|
||||
$form.on('submit', () => {
|
||||
const notePath = $autoComplete.getSelectedPath();
|
||||
|
||||
if (notePath) {
|
||||
const linkTitle = $linkTitle.val();
|
||||
|
||||
$dialog.modal('hide');
|
||||
|
||||
const linkHref = '#' + notePath;
|
||||
const editor = noteDetailService.getActiveEditor();
|
||||
const linkTitle = getLinkType() === 'reference-link' ? null : $linkTitle.val();
|
||||
|
||||
if (hasSelection()) {
|
||||
editor.execute('link', linkHref);
|
||||
}
|
||||
else {
|
||||
linkService.addLinkToEditor(linkTitle, linkHref);
|
||||
}
|
||||
|
||||
editor.editing.view.focus();
|
||||
textTypeWidget.addLink(notePath, linkTitle);
|
||||
}
|
||||
else {
|
||||
console.error("No path to add link.");
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
// returns true if user selected some text, false if there's no selection
|
||||
function hasSelection() {
|
||||
const model = noteDetailService.getActiveEditor().model;
|
||||
const selection = model.document.selection;
|
||||
|
||||
return !selection.isCollapsed;
|
||||
}
|
||||
});
|
||||
@@ -1,13 +1,12 @@
|
||||
import noteDetailService from '../services/note_detail.js';
|
||||
import server from '../services/server.js';
|
||||
import toastService from "../services/toast.js";
|
||||
import treeUtils from "../services/tree_utils.js";
|
||||
import treeService from "../services/tree.js";
|
||||
import attributeAutocompleteService from "../services/attribute_autocomplete.js";
|
||||
import utils from "../services/utils.js";
|
||||
import linkService from "../services/link.js";
|
||||
import libraryLoader from "../services/library_loader.js";
|
||||
import noteAutocompleteService from "../services/note_autocomplete.js";
|
||||
import treeService from "../services/tree.js";
|
||||
import appContext from "../services/app_context.js";
|
||||
|
||||
const $dialog = $("#attributes-dialog");
|
||||
const $saveAttributesButton = $("#save-attributes-button");
|
||||
@@ -65,7 +64,7 @@ function AttributesModel() {
|
||||
|
||||
for (const attr of ownedAttributes) {
|
||||
attr.labelValue = attr.type === 'label' ? attr.value : '';
|
||||
attr.relationValue = attr.type === 'relation' ? (await treeUtils.getNoteTitle(attr.value)) : '';
|
||||
attr.relationValue = attr.type === 'relation' ? (await treeService.getNoteTitle(attr.value)) : '';
|
||||
attr.selectedPath = attr.type === 'relation' ? attr.value : '';
|
||||
attr.labelDefinition = (attr.type === 'label-definition' && attr.value) ? attr.value : {
|
||||
labelType: "text",
|
||||
@@ -93,7 +92,7 @@ function AttributesModel() {
|
||||
}
|
||||
|
||||
this.loadAttributes = async function() {
|
||||
const noteId = noteDetailService.getActiveTabNoteId();
|
||||
const noteId = appContext.tabManager.getActiveTabNoteId();
|
||||
|
||||
const attributes = await server.get('notes/' + noteId + '/attributes');
|
||||
|
||||
@@ -139,7 +138,7 @@ function AttributesModel() {
|
||||
|
||||
self.updateAttributePositions();
|
||||
|
||||
const noteId = noteDetailService.getActiveTabNoteId();
|
||||
const noteId = appContext.tabManager.getActiveTabNoteId();
|
||||
|
||||
const attributesToSave = self.ownedAttributes()
|
||||
.map(attribute => attribute())
|
||||
@@ -150,7 +149,7 @@ function AttributesModel() {
|
||||
attr.value = attr.labelValue;
|
||||
}
|
||||
else if (attr.type === 'relation') {
|
||||
attr.value = treeUtils.getNoteIdFromNotePath(attr.selectedPath);
|
||||
attr.value = treeService.getNoteIdFromNotePath(attr.selectedPath);
|
||||
}
|
||||
else if (attr.type === 'label-definition') {
|
||||
attr.value = attr.labelDefinition;
|
||||
@@ -170,13 +169,6 @@ function AttributesModel() {
|
||||
await showAttributes(attributes);
|
||||
|
||||
toastService.showMessage("Attributes have been saved.");
|
||||
|
||||
const ctx = noteDetailService.getActiveTabContext();
|
||||
|
||||
ctx.attributes.refreshAttributes();
|
||||
|
||||
noteDetailService.reload();
|
||||
treeService.reload();
|
||||
};
|
||||
|
||||
function addLastEmptyRow() {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import treeService from '../services/tree.js';
|
||||
import server from '../services/server.js';
|
||||
import treeCache from "../services/tree_cache.js";
|
||||
import treeUtils from "../services/tree_utils.js";
|
||||
import toastService from "../services/toast.js";
|
||||
import utils from "../services/utils.js";
|
||||
|
||||
@@ -12,11 +11,17 @@ const $noteTitle = $('#branch-prefix-note-title');
|
||||
|
||||
let branchId;
|
||||
|
||||
export async function showDialog(node) {
|
||||
branchId = node.data.branchId;
|
||||
export async function showDialog(notePath) {
|
||||
const {noteId, parentNoteId} = treeService.getNoteIdAndParentIdFromNotePath(notePath);
|
||||
|
||||
if (!noteId || !parentNoteId) {
|
||||
return;
|
||||
}
|
||||
|
||||
branchId = await treeCache.getBranchId(parentNoteId, noteId);
|
||||
const branch = treeCache.getBranch(branchId);
|
||||
|
||||
if (branch.noteId === 'root') {
|
||||
if (!branch || branch.noteId === 'root') {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -30,7 +35,7 @@ export async function showDialog(node) {
|
||||
|
||||
$treePrefixInput.val(branch.prefix);
|
||||
|
||||
const noteTitle = await treeUtils.getNoteTitle(node.data.noteId);
|
||||
const noteTitle = await treeService.getNoteTitle(noteId);
|
||||
|
||||
$noteTitle.text(" - " + noteTitle);
|
||||
}
|
||||
@@ -40,8 +45,6 @@ async function savePrefix() {
|
||||
|
||||
await server.put('branches/' + branchId + '/set-prefix', { prefix: prefix });
|
||||
|
||||
await treeService.setPrefix(branchId, prefix);
|
||||
|
||||
$dialog.modal('hide');
|
||||
|
||||
toastService.showMessage("Branch prefix has been saved.");
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import noteAutocompleteService from "../services/note_autocomplete.js";
|
||||
import utils from "../services/utils.js";
|
||||
import cloningService from "../services/cloning.js";
|
||||
import treeUtils from "../services/tree_utils.js";
|
||||
import treeService from "../services/tree.js";
|
||||
import toastService from "../services/toast.js";
|
||||
import treeCache from "../services/tree_cache.js";
|
||||
import branchService from "../services/branches.js";
|
||||
|
||||
const $dialog = $("#clone-to-dialog");
|
||||
const $form = $("#clone-to-form");
|
||||
@@ -39,10 +39,10 @@ export async function showDialog(noteIds) {
|
||||
}
|
||||
|
||||
async function cloneNotesTo(notePath) {
|
||||
const targetNoteId = treeUtils.getNoteIdFromNotePath(notePath);
|
||||
const targetNoteId = treeService.getNoteIdFromNotePath(notePath);
|
||||
|
||||
for (const cloneNoteId of clonedNoteIds) {
|
||||
await cloningService.cloneNoteTo(cloneNoteId, targetNoteId, $clonePrefix.val());
|
||||
await branchService.cloneNoteTo(cloneNoteId, targetNoteId, $clonePrefix.val());
|
||||
|
||||
const clonedNote = await treeCache.getNote(cloneNoteId);
|
||||
const targetNote = await treeCache.getNote(targetNoteId);
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import treeUtils from "../services/tree_utils.js";
|
||||
import treeService from "../services/tree.js";
|
||||
import utils from "../services/utils.js";
|
||||
import ws from "../services/ws.js";
|
||||
import toastService from "../services/toast.js";
|
||||
import treeCache from "../services/tree_cache.js";
|
||||
|
||||
const $dialog = $("#export-dialog");
|
||||
const $form = $("#export-form");
|
||||
@@ -16,7 +17,7 @@ const $opmlVersions = $("#opml-versions");
|
||||
let taskId = '';
|
||||
let branchId = null;
|
||||
|
||||
export async function showDialog(node, defaultType) {
|
||||
export async function showDialog(notePath, defaultType) {
|
||||
// each opening of the dialog resets the taskId so we don't associate it with previous exports anymore
|
||||
taskId = '';
|
||||
$exportButton.removeAttr("disabled");
|
||||
@@ -38,9 +39,11 @@ export async function showDialog(node, defaultType) {
|
||||
|
||||
utils.openDialog($dialog);
|
||||
|
||||
branchId = node.data.branchId;
|
||||
const {noteId, parentNoteId} = treeService.getNoteIdAndParentIdFromNotePath(notePath);
|
||||
|
||||
const noteTitle = await treeUtils.getNoteTitle(node.data.noteId);
|
||||
branchId = await treeCache.getBranchId(parentNoteId, noteId);
|
||||
|
||||
const noteTitle = await treeService.getNoteTitle(noteId);
|
||||
|
||||
$noteTitle.html(noteTitle);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import utils from '../services/utils.js';
|
||||
import treeUtils from "../services/tree_utils.js";
|
||||
import treeService from "../services/tree.js";
|
||||
import importService from "../services/import.js";
|
||||
|
||||
const $dialog = $("#import-dialog");
|
||||
@@ -15,7 +15,7 @@ const $explodeArchivesCheckbox = $("#explode-archives-checkbox");
|
||||
|
||||
let parentNoteId = null;
|
||||
|
||||
export async function showDialog(node) {
|
||||
export async function showDialog(noteId) {
|
||||
$fileUploadInput.val('').trigger('change'); // to trigger Import button disabling listener below
|
||||
|
||||
$safeImportCheckbox.prop("checked", true);
|
||||
@@ -24,9 +24,9 @@ export async function showDialog(node) {
|
||||
$codeImportedAsCodeCheckbox.prop("checked", true);
|
||||
$explodeArchivesCheckbox.prop("checked", true);
|
||||
|
||||
parentNoteId = node.data.noteId;
|
||||
parentNoteId = noteId;
|
||||
|
||||
$noteTitle.text(await treeUtils.getNoteTitle(parentNoteId));
|
||||
$noteTitle.text(await treeService.getNoteTitle(parentNoteId));
|
||||
|
||||
utils.openDialog($dialog);
|
||||
}
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
import treeUtils from '../services/tree_utils.js';
|
||||
import treeService from '../services/tree.js';
|
||||
import noteAutocompleteService from '../services/note_autocomplete.js';
|
||||
import utils from "../services/utils.js";
|
||||
import treeCache from "../services/tree_cache.js";
|
||||
|
||||
const $dialog = $("#include-note-dialog");
|
||||
const $form = $("#include-note-form");
|
||||
const $autoComplete = $("#include-note-autocomplete");
|
||||
let callback = null;
|
||||
|
||||
export async function showDialog(cb) {
|
||||
callback = cb;
|
||||
/** @var TextTypeWidget */
|
||||
let textTypeWidget;
|
||||
|
||||
export async function showDialog(widget) {
|
||||
textTypeWidget = widget;
|
||||
|
||||
$autoComplete.val('');
|
||||
|
||||
@@ -18,15 +21,27 @@ export async function showDialog(cb) {
|
||||
noteAutocompleteService.showRecentNotes($autoComplete);
|
||||
}
|
||||
|
||||
async function includeNote(notePath) {
|
||||
const noteId = treeService.getNoteIdFromNotePath(notePath);
|
||||
const note = await treeCache.getNote(noteId);
|
||||
|
||||
if (note.type === 'image') {
|
||||
// there's no benefit to use insert note functionlity for images
|
||||
// so we'll just add an IMG tag
|
||||
textTypeWidget.addImage(noteId);
|
||||
}
|
||||
else {
|
||||
textTypeWidget.addIncludeNote(noteId);
|
||||
}
|
||||
}
|
||||
|
||||
$form.on('submit', () => {
|
||||
const notePath = $autoComplete.getSelectedPath();
|
||||
|
||||
if (notePath) {
|
||||
$dialog.modal('hide');
|
||||
|
||||
if (callback) {
|
||||
callback(treeUtils.getNoteIdFromNotePath(notePath));
|
||||
}
|
||||
includeNote(notePath);
|
||||
}
|
||||
else {
|
||||
console.error("No noteId to include.");
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import treeService from '../services/tree.js';
|
||||
import searchNotesService from '../services/search_notes.js';
|
||||
import noteAutocompleteService from '../services/note_autocomplete.js';
|
||||
import utils from "../services/utils.js";
|
||||
import appContext from "../services/app_context.js";
|
||||
|
||||
const $dialog = $("#jump-to-note-dialog");
|
||||
const $autoComplete = $("#jump-to-note-autocomplete");
|
||||
@@ -18,7 +17,7 @@ export async function showDialog() {
|
||||
return false;
|
||||
}
|
||||
|
||||
treeService.activateNote(suggestion.path);
|
||||
appContext.tabManager.getActiveTabContext().setNote(suggestion.path);
|
||||
});
|
||||
|
||||
noteAutocompleteService.showRecentNotes($autoComplete);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import utils from "../services/utils.js";
|
||||
import LinkMapService from "../services/link_map.js";
|
||||
import noteDetailService from "../services/note_detail.js";
|
||||
import appContext from "../services/app_context.js";
|
||||
|
||||
const $linkMapContainer = $("#link-map-container");
|
||||
|
||||
@@ -27,7 +27,7 @@ export async function showDialog() {
|
||||
}
|
||||
|
||||
$dialog.on('shown.bs.modal', () => {
|
||||
const note = noteDetailService.getActiveTabNote();
|
||||
const note = appContext.tabManager.getActiveTabNote();
|
||||
|
||||
linkMapService = new LinkMapService(note, $linkMapContainer, getOptions());
|
||||
linkMapService.render();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import libraryLoader from "../services/library_loader.js";
|
||||
import toastService from "../services/toast.js";
|
||||
import utils from "../services/utils.js";
|
||||
import noteDetailService from "../services/note_detail.js";
|
||||
import appContext from "../services/app_context.js";
|
||||
|
||||
const $dialog = $('#markdown-import-dialog');
|
||||
const $importTextarea = $('#markdown-import-textarea');
|
||||
@@ -16,17 +16,20 @@ async function convertMarkdownToHtml(text) {
|
||||
|
||||
const result = writer.render(parsed);
|
||||
|
||||
const textEditor = noteDetailService.getActiveEditor();
|
||||
const viewFragment = textEditor.data.processor.toView(result);
|
||||
const modelFragment = textEditor.data.toModel(viewFragment);
|
||||
appContext.triggerCommand('executeInActiveEditor', {
|
||||
callback: textEditor => {
|
||||
const viewFragment = textEditor.data.processor.toView(result);
|
||||
const modelFragment = textEditor.data.toModel(viewFragment);
|
||||
|
||||
textEditor.model.insertContent(modelFragment, textEditor.model.document.selection);
|
||||
textEditor.model.insertContent(modelFragment, textEditor.model.document.selection);
|
||||
|
||||
toastService.showMessage("Markdown content has been imported into the document.");
|
||||
toastService.showMessage("Markdown content has been imported into the document.");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export async function importMarkdownInline() {
|
||||
if (noteDetailService.getActiveTabNoteType() !== 'text') {
|
||||
if (appContext.tabManager.getActiveTabNoteType() !== 'text') {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,19 +2,18 @@ import noteAutocompleteService from "../services/note_autocomplete.js";
|
||||
import utils from "../services/utils.js";
|
||||
import toastService from "../services/toast.js";
|
||||
import treeCache from "../services/tree_cache.js";
|
||||
import treeChangesService from "../services/branches.js";
|
||||
import branchService from "../services/branches.js";
|
||||
import treeService from "../services/tree.js";
|
||||
|
||||
const $dialog = $("#move-to-dialog");
|
||||
const $form = $("#move-to-form");
|
||||
const $noteAutoComplete = $("#move-to-note-autocomplete");
|
||||
const $movePrefix = $("#move-prefix");
|
||||
const $noteList = $("#move-to-note-list");
|
||||
|
||||
let movedNodes;
|
||||
let movedBranchIds;
|
||||
|
||||
export async function showDialog(nodes) {
|
||||
movedNodes = nodes;
|
||||
export async function showDialog(branchIds) {
|
||||
movedBranchIds = branchIds;
|
||||
|
||||
utils.openDialog($dialog);
|
||||
|
||||
@@ -22,8 +21,9 @@ export async function showDialog(nodes) {
|
||||
|
||||
$noteList.empty();
|
||||
|
||||
for (const node of movedNodes) {
|
||||
const note = await treeCache.getNote(node.data.noteId);
|
||||
for (const branchId of movedBranchIds) {
|
||||
const branch = treeCache.getBranch(branchId);
|
||||
const note = await treeCache.getNote(branch.noteId);
|
||||
|
||||
$noteList.append($("<li>").text(note.title));
|
||||
}
|
||||
@@ -32,12 +32,12 @@ export async function showDialog(nodes) {
|
||||
noteAutocompleteService.showRecentNotes($noteAutoComplete);
|
||||
}
|
||||
|
||||
async function moveNotesTo(notePath) {
|
||||
const targetNode = await treeService.getNodeFromPath(notePath);
|
||||
async function moveNotesTo(parentNoteId) {
|
||||
await branchService.moveToParentNote(movedBranchIds, parentNoteId);
|
||||
|
||||
await treeChangesService.moveToNode(movedNodes, targetNode);
|
||||
const parentNote = await treeCache.getNote(parentNoteId);
|
||||
|
||||
toastService.showMessage(`Selected notes have been moved into ${targetNode.title}`);
|
||||
toastService.showMessage(`Selected notes have been moved into ${parentNote.title}`);
|
||||
}
|
||||
|
||||
$form.on('submit', () => {
|
||||
@@ -46,7 +46,9 @@ $form.on('submit', () => {
|
||||
if (notePath) {
|
||||
$dialog.modal('hide');
|
||||
|
||||
moveNotesTo(notePath);
|
||||
const noteId = treeService.getNoteIdFromNotePath(notePath);
|
||||
|
||||
moveNotesTo(noteId);
|
||||
}
|
||||
else {
|
||||
console.error("No path to move to.");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import noteDetailService from '../services/note_detail.js';
|
||||
import utils from "../services/utils.js";
|
||||
import appContext from "../services/app_context.js";
|
||||
|
||||
const $dialog = $("#note-info-dialog");
|
||||
const $noteId = $("#note-info-note-id");
|
||||
@@ -9,16 +9,18 @@ const $type = $("#note-info-type");
|
||||
const $mime = $("#note-info-mime");
|
||||
const $okButton = $("#note-info-ok-button");
|
||||
|
||||
export function showDialog() {
|
||||
export async function showDialog() {
|
||||
utils.openDialog($dialog);
|
||||
|
||||
const activeNote = noteDetailService.getActiveTabNote();
|
||||
const activeTabContext = appContext.tabManager.getActiveTabContext();
|
||||
const {note} = activeTabContext;
|
||||
const noteComplement = await activeTabContext.getNoteComplement();
|
||||
|
||||
$noteId.text(activeNote.noteId);
|
||||
$dateCreated.text(activeNote.dateCreated);
|
||||
$dateModified.text(activeNote.dateModified);
|
||||
$type.text(activeNote.type);
|
||||
$mime.text(activeNote.mime);
|
||||
$noteId.text(note.noteId);
|
||||
$dateCreated.text(noteComplement.dateCreated);
|
||||
$dateModified.text(noteComplement.dateModified);
|
||||
$type.text(note.type);
|
||||
$mime.text(note.mime);
|
||||
}
|
||||
|
||||
$okButton.on('click', () => $dialog.modal('hide'));
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import noteDetailService from '../services/note_detail.js';
|
||||
import utils from '../services/utils.js';
|
||||
import server from '../services/server.js';
|
||||
import toastService from "../services/toast.js";
|
||||
import appContext from "../services/app_context.js";
|
||||
|
||||
const $dialog = $("#note-revisions-dialog");
|
||||
const $list = $("#note-revision-list");
|
||||
@@ -25,7 +25,7 @@ let note;
|
||||
let noteRevisionId;
|
||||
|
||||
export async function showCurrentNoteRevisions() {
|
||||
await showNoteRevisionsDialog(noteDetailService.getActiveTabNoteId());
|
||||
await showNoteRevisionsDialog(appContext.tabManager.getActiveTabNoteId());
|
||||
}
|
||||
|
||||
export async function showNoteRevisionsDialog(noteId, noteRevisionId) {
|
||||
@@ -38,7 +38,7 @@ async function loadNoteRevisions(noteId, noteRevId) {
|
||||
$list.empty();
|
||||
$content.empty();
|
||||
|
||||
note = noteDetailService.getActiveTabNote();
|
||||
note = appContext.tabManager.getActiveTabNote();
|
||||
revisionItems = await server.get(`notes/${noteId}/revisions`);
|
||||
|
||||
for (const item of revisionItems) {
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import noteDetailService from '../services/note_detail.js';
|
||||
import appContext from "../services/app_context.js";
|
||||
import utils from "../services/utils.js";
|
||||
|
||||
const $dialog = $("#note-source-dialog");
|
||||
const $noteSource = $("#note-source");
|
||||
|
||||
export function showDialog() {
|
||||
export async function showDialog() {
|
||||
utils.openDialog($dialog);
|
||||
|
||||
const noteText = noteDetailService.getActiveTabNote().content;
|
||||
const noteCompletement = await appContext.tabManager.getActiveTabContext().getNoteComplement();
|
||||
|
||||
$noteSource.text(formatHtml(noteText));
|
||||
$noteSource.text(formatHtml(noteCompletement.content));
|
||||
}
|
||||
|
||||
function formatHtml(str) {
|
||||
|
||||
@@ -14,9 +14,8 @@ export async function showDialog() {
|
||||
import('./options/advanced.js'),
|
||||
import('./options/appearance.js'),
|
||||
import('./options/code_notes.js'),
|
||||
import('./options/change_password.js'),
|
||||
import('./options/credentials.js'),
|
||||
import('./options/other.js'),
|
||||
import('./options/sidebar.js'),
|
||||
import('./options/sync.js'),
|
||||
import('./options/keyboard_shortcuts.js'),
|
||||
]))
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user