@@ -71,17 +71,6 @@ export class BootLoader {
7171 } ) ;
7272 }
7373
74- /**
75- * @abstract A using function encapsulated by a Promise.
76- *
77- * @async implements the Promise contract
78- * @param script - the url of the script to be loaded
79- * @returns - the Promise indicating the state of the transaction
80- */
81- async usingAsync ( script ) {
82- return this . promisify ( /*using*/ easyloader . load . bind ( easyloader ) , script ) ;
83- }
84-
8574 /**
8675 * @abstract The promise is fulfilled if the document becomes ready.
8776 *
@@ -101,77 +90,6 @@ export class BootLoader {
10190 return this . promisify ( setTimeout , delay ) ;
10291 }
10392
104- /**
105- * @abstract Initializes the scripts (css and js) using the easyloader.
106- *
107- * All but this boot loader and the easy loader is loaded here.
108- *
109- * @async implements the Promise contract
110- */
111- async initScripts ( ) {
112- this . baseLocation = this . getBaseLocation ( ) ;
113- easyloader . base = this . baseLocation ; // set the easyui base directory
114- easyloader . css = false ;
115- console . dir ( easyloader . modules ) ;
116-
117- var modules = [
118- 'parser' , 'layout' , 'window' , 'dialog' , 'panel' , 'datagrid' , 'tree' ,
119- 'menubutton' , 'menu' , 'accordion' , 'linkbutton' , 'tooltip' , 'tabs' ,
120- 'messager' , 'combobox' ] ;
121-
122- var scripts = [
123- //"./jquery.easyui.min.js",
124- "./datagrid-cellediting.js" ,
125- "./datagrid-filter.js" ,
126- "../jquery-colorpicker/js/colorpicker.js" ,
127- "../codemirror/lib/codemirror.js" ,
128- "../katex/katex.min.js" ,
129- "../katex/mhchem.min.js" ,
130-
131- "../patterns/observable.js" ,
132- "../localization.js" ,
133- "../themes.js" ,
134- "../parserExtension.js" ,
135- "../parameters.js" ,
136- "../fileHandling.js" ,
137- "../helpers.js" ,
138- "../math.js" ,
139- "../categoriesTree.js" ,
140- "../panels.js" ,
141- "../dialog.js"
142- ] ;
143-
144- var csss = [
145- "./themes/default/easyui.css" ,
146- "./themes/icon.css" ,
147- "../jquery-easyui-MathEditorExtend/themes/aguas/easyui.css" ,
148- "../jquery-easyui-MathEditorExtend/themes/icon.css" ,
149- "../jquery-colorpicker/css/colorpicker.css" ,
150- "../codemirror/lib/codemirror.css" ,
151- "../keyboard/Keyboard.css" ,
152- "../katex/katex.min.css" ,
153- "../dialog.css"
154- ] ;
155-
156- await this . usingAsync ( './jquery.min.js' ) ;
157-
158- for ( var module of modules ) {
159- await this . usingAsync ( module ) ;
160- }
161-
162- for ( var css of csss ) {
163- await this . usingAsync ( css ) ;
164- // works but has no effect
165- $ ( 'link' )
166- . last ( )
167- . removeAttr ( 'media' ) ;
168- }
169-
170- for ( var script of scripts ) {
171- await this . usingAsync ( script ) ;
172- }
173- }
174-
17593 /**
17694 * @abstract Initializes the app.
17795 *
@@ -209,55 +127,6 @@ export class BootLoader {
209127 console . debug ( 'Promise check : app started.' ) ;
210128 this . check ( ) ;
211129 }
212-
213- /**
214- * @abstract Initialization scenario 2 : with easy loader.
215- *
216- * @async implements the Promise contract
217- */
218- async init2 ( ) {
219- var counter = 0 ;
220- while ( ( typeof easyloader !== 'object' || ! document . currentScript ) && ++ counter <= 50 ) {
221- await this . setTimeoutAsync ( 100 ) ;
222- }
223- if ( counter > 50 ) {
224- throw Error ( "easyloader not loaded" ) ;
225- }
226- console . info ( `easyloader loaded : ${ typeof easyloader } ` ) ;
227-
228- await this . initScripts ( ) ;
229- console . debug ( 'Promise check : scripts loaded.' ) ;
230-
231- await this . readyAsync ( ) ;
232- console . debug ( 'Promise check : document ready.' ) ;
233-
234- // trial to shift misplaced menus
235- // $('#mFile, #mInsert, #mTools, #mView, #mOptions, #mInformations').append($('#menu'));
236-
237- await this . initApp ( true ) ;
238- console . debug ( 'Promise check : app started.' ) ;
239- this . check ( ) ;
240- }
241-
242- /**
243- * @abstract Sets the base location.
244- *
245- * This will be needed for relative paths of some content like css or js files.
246- * Is here used only for *easyloader*.
247- *
248- * @returns the location of this script, ending with a slash
249- */
250- getBaseLocation ( ) {
251- var location = document . currentScript . src
252- . split ( '/' )
253- . slice ( 0 , - 1 ) // up to js folder
254- . join ( '/' )
255- . replace ( / / g, '%20' )
256- . replace ( 'file:///' , 'file://' )
257- . replace ( 'file://' , 'file:///' ) + '/jquery-easyui/' ;
258-
259- return location ;
260- }
261130
262131 /**
263132 * @abstract Checks the presence of the required scripts.
@@ -372,9 +241,7 @@ if (!window.bootLoaderLoaded) {
372241 } ) ;
373242}
374243
375- /*
376244// This helps to import symbols in test suite
377245try {
378246 module . exports = BootLoader ;
379247} catch ( e ) { }
380- */
0 commit comments