mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 10:20:08 +00:00
now all targets start correctly...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
d456103823
commit
82886db092
@ -4,11 +4,7 @@
|
|||||||
*
|
*
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
|
|
||||||
global.requirejs = global.requirejs || require('requirejs')
|
var cfg = {
|
||||||
requirejs.config({
|
|
||||||
nodeRequire: require,
|
|
||||||
//baseUrl: __dirname,
|
|
||||||
|
|
||||||
// XXX this does not work on direct filesystem access...
|
// XXX this does not work on direct filesystem access...
|
||||||
//urlArgs: 'bust='+Date.now(),
|
//urlArgs: 'bust='+Date.now(),
|
||||||
|
|
||||||
@ -37,7 +33,21 @@ requirejs.config({
|
|||||||
//'ig-keyboard': 'lib/keyboard',
|
//'ig-keyboard': 'lib/keyboard',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(typeof(require) != 'undefined'){
|
||||||
|
cfg.nodeRequire = require
|
||||||
|
//cfg.baseUrl = __dirname
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(typeof(require) != 'undefined' && typeof(global) != 'undefined'){
|
||||||
|
global.requirejs = global.requirejs || require('requirejs')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
requirejs.config(cfg)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -84,7 +84,10 @@ if(window.require && window.nw){
|
|||||||
<script>if (window.module) module = window.module;</script>
|
<script>if (window.module) module = window.module;</script>
|
||||||
|
|
||||||
|
|
||||||
<script data-main="ui" src="ext-lib/require.js"></script>
|
<!--script data-main="ui" src="ext-lib/require.js"></script-->
|
||||||
|
<script src="ext-lib/require.js"></script>
|
||||||
|
<script src="cfg/requirejs.js"></script>
|
||||||
|
<script> requirejs(['ui']) </script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@ -15,43 +15,6 @@ if((typeof(process) != 'undefined' ? process : {}).__nwjs){
|
|||||||
.addPath(path.dirname(process.execPath) + '/node_modules/')
|
.addPath(path.dirname(process.execPath) + '/node_modules/')
|
||||||
}
|
}
|
||||||
|
|
||||||
//require('./cfg/requirejs')
|
|
||||||
|
|
||||||
|
|
||||||
//*
|
|
||||||
// Setup modules loaded from npm...
|
|
||||||
//
|
|
||||||
// XXX for some reason this breaks in browser if run after the if below...
|
|
||||||
// XXX not sure if this strategy is correct...
|
|
||||||
// ...most likely this is not actually a good idea, need to think of
|
|
||||||
// a way of organizing things without so much manual hoop jumping...
|
|
||||||
var requirejs_cfg = {
|
|
||||||
paths: {
|
|
||||||
//text: 'node_modules/requirejs-plugins/lib/text',
|
|
||||||
//json: 'node_modules/requirejs-plugins/src/json',
|
|
||||||
|
|
||||||
// XXX one approach to avoid at least this section is to copy the
|
|
||||||
// modules to lib/*, this way we'll need the map section below
|
|
||||||
// only... (without automation this also sounds bad)
|
|
||||||
'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',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
// config the browser version of requirejs...
|
|
||||||
requirejs.config(requirejs_cfg)
|
|
||||||
//*/
|
|
||||||
|
|
||||||
// Setup requirejs if we are in node/nw...
|
// Setup requirejs if we are in node/nw...
|
||||||
//
|
//
|
||||||
@ -71,9 +34,6 @@ if(typeof(process) != 'undefined'){
|
|||||||
// node stuff to node...
|
// node stuff to node...
|
||||||
require('requirejs')
|
require('requirejs')
|
||||||
|
|
||||||
// config the node version of requirejs...
|
|
||||||
requirejs.config(requirejs_cfg)
|
|
||||||
|
|
||||||
nodeRequire =
|
nodeRequire =
|
||||||
global.nodeRequire =
|
global.nodeRequire =
|
||||||
window.nodeRequire =
|
window.nodeRequire =
|
||||||
@ -93,9 +53,6 @@ var viewer = require('imagegrid/viewer')
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*********************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
/*********************************************************************/
|
/*********************************************************************/
|
||||||
|
|
||||||
$(function(){
|
$(function(){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user