Libraryless. Click here for Pure Java version (30264L/196K).
!7 !include #1016871 // main is not run module SnippetsDB { bool withText, quickUpdate; transient ReliableSingleThread rst = new(r updateMe); start { updateInterval = quickUpdate ? 60 : 3600; autoDownloadText = withText; useDBOf(#1016871); addDirToDontBackupList(dbDir()); onConceptsChange(rst); fullUpdateAtStart = false; snippetsDB_init(); indexConceptField(CSnippet, 'type); } visualize { ret centerBoldLabel(jLiveValueLabel(dm_calculatedLiveValue(this, S, func -> S { n2(countConcepts(CSnippet), "snippet") }))); } enhanceFrame { addTitlePopupMenuItem(f, "Full download", r-thread enter { fullDownload(); }); dm_boolFieldMenuItem(f, 'withText, onSet := r { autoDownloadText = withText }); dm_boolFieldMenuItem(f, 'quickUpdate); } // API for other modules L<CSnippet> snippetsOfType(S type) { ret sortedByFieldDesc('snippetID, conceptsWhere(CSnippet, +type)); } L<CSnippet> allSnippets() { ret list(CSnippet); } S getSnippetText(S snippetID) enter { ret main.getSnippetText(snippetID); } }
Began life as a copy of #1016026
download show line numbers debug dex old transpilations
Travelled to 16 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, hpgrupgrauku, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment