diff --git a/ui (gen4)/cfg/requirejs.js b/ui (gen4)/cfg/requirejs.js new file mode 100644 index 00000000..7fe714ef --- /dev/null +++ b/ui (gen4)/cfg/requirejs.js @@ -0,0 +1,45 @@ +/********************************************************************** +* +* +* +**********************************************************************/ + +global.requirejs = global.requirejs || require('requirejs') +requirejs.config({ + nodeRequire: require, + //baseUrl: __dirname, + + // XXX this does not work on direct filesystem access... + //urlArgs: 'bust='+Date.now(), + + paths: { + //text: 'node_modules/requirejs-plugins/lib/text', + //json: 'node_modules/requirejs-plugins/src/json', + + //react: 'node_modules/react/dist/react-with-addons.min.js', + //'react-dom': 'node_modules/react-dom/dist/react-dom.min.js', + //'ext-lib/preact': './node_modules/preact/dist/preact.dev', + + 'lib/object': 'node_modules/ig-object/object', + 'lib/actions': 'node_modules/ig-actions/actions', + 'lib/features': 'node_modules/ig-features/features', + //'lib/keyboard': './node_modules/ig-keyboard/keyboard', + }, + map: { + '*': { + // back-refs + // ...these enable the npm modules reference each other in + // a cross-platform manner.... + 'ig-object': 'lib/object', + 'ig-actions': 'lib/actions', + 'ig-features': 'lib/features', + + //'ig-keyboard': 'lib/keyboard', + }, + }, +}) + + + +/********************************************************************** +* vim:set ts=4 sw=4 : */ diff --git a/ui (gen4)/e.js b/ui (gen4)/e.js index 3258f827..97f3a5e4 100644 --- a/ui (gen4)/e.js +++ b/ui (gen4)/e.js @@ -14,6 +14,13 @@ var path = require('path') var url = require('url') +//--------------------------------------------------------------------- + +//require('./cfg/requirejs') + +//var _require = require +//require = requirejs + /*********************************************************************/ @@ -37,7 +44,7 @@ function createWindow() { // and load the index.html of the app. win.loadURL(url.format({ // XXX for some reason the system is loaded twice... - pathname: path.join(__dirname, 'index.html'), + pathname: path.join(__dirname, 'electron.html'), protocol: 'file:', slashes: true })) diff --git a/ui (gen4)/electron.html b/ui (gen4)/electron.html new file mode 100755 index 00000000..507347a6 --- /dev/null +++ b/ui (gen4)/electron.html @@ -0,0 +1,124 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui (gen4)/features/app.js b/ui (gen4)/features/app.js index 6c8b4869..04aea70c 100755 --- a/ui (gen4)/features/app.js +++ b/ui (gen4)/features/app.js @@ -151,11 +151,11 @@ var ElectronHostActions = actions.Actions({ get size(){ return electron.remote.getCurrentWindow().getSize() }, set size(value){ - electron.remote.getCurrentWindow().setSize(value) }, + value && electron.remote.getCurrentWindow().setSize(value[0], value[1]) }, get position(){ return electron.remote.getCurrentWindow().getPosition() }, set position(value){ - electron.remote.getCurrentWindow().setPosition(value) }, + value && electron.remote.getCurrentWindow().setPosition(value[0], value[1]) }, show: ['- Window/', function(){ @@ -372,8 +372,8 @@ module.AppControl = core.ImageGridFeatures.Feature({ // - ready protocol breaks -- need to call .ready() to unstall // the viewer // ...does this all have anything to do with double init??? - //isApplicable: function(){ return this.runtime.desktop }, - isApplicable: function(){ return this.runtime.desktop && !this.runtime.electron }, + isApplicable: function(){ return this.runtime.desktop }, + //isApplicable: function(){ return this.runtime.desktop && !this.runtime.electron }, // XXX show main window... handlers: [ diff --git a/ui (gen4)/ig.js b/ui (gen4)/ig.js index 832daaae..c0772dfe 100644 --- a/ui (gen4)/ig.js +++ b/ui (gen4)/ig.js @@ -8,42 +8,13 @@ //var DEBUG = DEBUG != null ? DEBUG : true -global.requirejs = global.requirejs || require('requirejs') -requirejs.config({ - nodeRequire: require, - //baseUrl: __dirname, +require('./cfg/requirejs') - // XXX this does not work on direct filesystem access... - //urlArgs: 'bust='+Date.now(), - - paths: { - //text: 'node_modules/requirejs-plugins/lib/text', - //json: 'node_modules/requirejs-plugins/src/json', - - //react: 'node_modules/react/dist/react-with-addons.min.js', - //'react-dom': 'node_modules/react-dom/dist/react-dom.min.js', - - 'lib/object': 'node_modules/ig-object/object', - 'lib/actions': 'node_modules/ig-actions/actions', - 'lib/features': 'node_modules/ig-features/features', - }, - map: { - '*': { - // back-refs - // ...these enable the npm modules reference each other in - // a cross-platform manner.... - 'ig-object': 'lib/object', - 'ig-actions': 'lib/actions', - 'ig-features': 'lib/features', - - //'ig-keyboard': 'lib/keyboard', - }, - }, -}) var _require = require require = requirejs + //--------------------------------------------------------------------- // XXX need to automate this... diff --git a/ui (gen4)/ui.js b/ui (gen4)/ui.js index c597cc49..23eb94ee 100755 --- a/ui (gen4)/ui.js +++ b/ui (gen4)/ui.js @@ -15,6 +15,9 @@ if((typeof(process) != 'undefined' ? process : {}).__nwjs){ .addPath(path.dirname(process.execPath) + '/node_modules/') } +//require('./cfg/requirejs') + + //* // Setup modules loaded from npm... // @@ -34,9 +37,6 @@ var requirejs_cfg = { 'lib/actions': './node_modules/ig-actions/actions', 'lib/features': './node_modules/ig-features/features', - //'lib/keyboard': './node_modules/ig-keyboard/keyboard', - - //'ext-lib/preact': './node_modules/preact/dist/preact.dev', }, map: { '*': { @@ -46,8 +46,6 @@ var requirejs_cfg = { 'ig-object': 'lib/object', 'ig-actions': 'lib/actions', 'ig-features': 'lib/features', - - //'ig-keyboard': 'lib/keyboard', }, }, }