Esempio n. 1
0
 $.each(files, function(index, file) {
     if (file.match("node_modules") !== null) {
         return;
     }
     var name = path.basename(file);
     if (name == 'main.js') {
         try {
             var eng = require(pluginsDir + file);
             if (in_array(eng.engine_name.toLowerCase(), excludedPlugins)) {
                 return true;
             }
             if ((in_array(eng.engine_name.toLowerCase(), pluginsList) === false) || (in_array(eng.engine_name.toLowerCase(), settings.plugins))) {
                 engines[eng.engine_name] = eng;
                 // add entry to main gui menu
                 $('#engines_select').append('<option value="' + eng.engine_name + '">' + eng.engine_name + '</option>');
             }
         } catch (err) {
             console.log("can't load plugin " + file + ", error:" + err)
         }
     }
     if (index + 1 === files.length) {
         engine = currentEngine;
         $("#engines_select option[value='" + currentEngine + "']").attr('selected', 'selected');
     }
 });
Esempio n. 2
0
 $.each(files, function(index, file) {
     if (file.match("node_modules") !== null) {
         return;
     }
     var name = path.basename(file);
     if (name == 'main.js') {
         try {
             var eng = require(pluginsDir + file);
             if (in_array(eng.engine_name.toLowerCase(), excludedPlugins)) {
                 return true;
             }
             if (pluginsList.indexOf(eng.engine_name.toLowerCase()) == -1 || settings.plugins.indexOf(eng.engine_name.toLowerCase()) !== -1) {
                 engines[eng.engine_name] = eng;
                 // add entry to main gui menu
                 $('#engines_select').append('<option value="' + eng.engine_name + '">' + eng.engine_name + '</option>');
             }
         } catch (err) {
             console.log("can't load plugin " + file + ", error:" + err)
         }
     }
 });