Comparing version 0.9.53 to 0.9.54
@@ -11,3 +11,4 @@ | ||
'solution/solution', | ||
'builder/build' | ||
'builder/build', | ||
'io/files/style' | ||
], | ||
@@ -19,5 +20,3 @@ | ||
'html' | ||
], | ||
io: 'files/style' | ||
// | ||
] | ||
@@ -24,0 +23,0 @@ }) |
@@ -9,3 +9,3 @@ { | ||
}, | ||
"version": "0.9.53", | ||
"version": "0.9.54", | ||
"bin": { | ||
@@ -12,0 +12,0 @@ "atma": "atma" |
@@ -10,3 +10,14 @@ include | ||
var UglifyJS = global.UglifyJS || require('uglify-js'); | ||
function ast_getBody(code) { | ||
return typeof code === 'string' | ||
? UglifyJS.parse(code).body | ||
: code; | ||
} | ||
function ast_append(ast, code) { | ||
ast.body = ast.body.concat(ast_getBody(code)); | ||
} | ||
var BuilderHelper = { | ||
@@ -69,7 +80,9 @@ jsRaw: function(solution, stack, output) { | ||
function appendInfo(method, object) { | ||
arr.push(String.format('include.%1(%2);', method, JSON.stringify(object))); | ||
arr.push('include.%1(%2);'.format( | ||
method, | ||
object ? JSON.stringify(object) : '')); | ||
} | ||
appendInfo('pauseStack'); | ||
appendInfo('register', solution.bin); | ||
appendInfo('routes', resp.includeMock.toJsonRoutes()); | ||
@@ -80,4 +93,3 @@ | ||
ast.body = ast.body.concat(UglifyJS.parse(info).body); | ||
ast_append(ast, info); | ||
} | ||
@@ -105,2 +117,7 @@ | ||
return; | ||
if (includeIndex === -1){ | ||
includeIndex = -2; | ||
embedInfo(); | ||
} | ||
@@ -110,23 +127,24 @@ resp.JS.reduceIncludes(resource); | ||
var setCurrentInclude = defineCurrentInclude(i, resource); | ||
if (setCurrentInclude) { | ||
var code = "include.setCurrent({ id: '#{id}', namespace: '#{namespace}', url: '#{url}'});".format({ | ||
id: resource.appuri, | ||
namespace: resource.namespace || '', | ||
url: resource.appuri | ||
}), | ||
body = UglifyJS.parse(code).body; | ||
if (setCurrentInclude && resource.appuri) { | ||
var code = "include.setCurrent({ id: '#{id}', namespace: '#{namespace}', url: '#{url}'});" | ||
.format({ | ||
id: resource.appuri, | ||
namespace: resource.namespace || '', | ||
url: resource.appuri | ||
}); | ||
ast.body = ast.body.concat(body); | ||
ast_append(ast, code); | ||
} | ||
ast_append(ast, resource.ast.body); | ||
ast_append(ast, ';'); | ||
ast.body = ast.body.concat(resource.ast.body); | ||
ast.body = ast.body.concat(UglifyJS.parse(';').body); | ||
if (setCurrentInclude) { | ||
var code = "include.getResource('%1', 'js').readystatechanged(3);".format(resource.appuri), | ||
body = UglifyJS.parse(code).body; | ||
ast.body = ast.body.concat(body); | ||
if (setCurrentInclude && resource.appuri) { | ||
var code = "include.getResource('%1', 'js').readystatechanged(3);" | ||
.format(resource.appuri); | ||
ast_append(ast, code); | ||
} | ||
@@ -138,4 +156,6 @@ | ||
}); | ||
ast_append(ast, 'include.resumeStack();'); | ||
return (output.js = ast); | ||
@@ -142,0 +162,0 @@ }, |
@@ -17,4 +17,26 @@ (function() { | ||
.trim() | ||
.replace(/[ ]{2,}/g,' ') | ||
.split(' '); | ||
.split(/\s+/); | ||
// merge quotet arg, as: git commit -m "some value with spaces" | ||
var c, index; | ||
for (var j = 0; j < x.length; j++) { | ||
if (x[j].length < 1) { | ||
continue; | ||
} | ||
c = x[j][0]; | ||
if (c !== '"' && c !== "'") | ||
continue; | ||
index = j; | ||
for (;j < x.length; j++) { | ||
if (x[j][x[j].length - 1] === c) { | ||
debugger; | ||
var str = x.splice(index, j - index + 1).join(' '); | ||
x.splice(index, 0, str.substring(1, str.length - 1)); | ||
break; | ||
} | ||
} | ||
} | ||
@@ -21,0 +43,0 @@ this.commands[i] = { |
@@ -16,14 +16,16 @@ include.exports = { | ||
if (isAbsolute(href) === false) { | ||
var base = href[0] === '/' ? baseuri : uri, | ||
imguri = new net.Uri(href[0] === '/' ? href.substring(1) : href); | ||
imgbin.push({ | ||
mimeType: 'image/png', | ||
href: href, | ||
uri: base.combine(imguri), | ||
baseuri: uri | ||
}); | ||
} | ||
var base = href[0] === '/' ? baseuri : uri, | ||
imguri = new net.Uri(href[0] === '/' ? href.substring(1) : href); | ||
imgbin.push({ | ||
mimeType: 'image/png', | ||
href: href, | ||
uri: base.combine(imguri), | ||
baseuri: uri | ||
}); | ||
match = regexp.exec(content); | ||
@@ -45,2 +47,7 @@ } | ||
} | ||
}; | ||
function isAbsolute(href) { | ||
return /^[\w]{1,8}:\/\//.exec(href) != null; | ||
} |
@@ -7,5 +7,3 @@ include.js('controllers/static.js::Statics').done(function(resp) { | ||
Construct: function(socket) { | ||
Class.bind(this, 'fileChanged', 'disconnected'); | ||
this.socket = socket; | ||
@@ -16,13 +14,19 @@ | ||
staticHandler.on('filechange', this.fileChanged); | ||
}, | ||
fileChanged: function(path, root) { | ||
path = path.replace(root, ''); | ||
console.log('changed path', path); | ||
this.socket.emit('filechange', path); | ||
}, | ||
disconnected: function(){ | ||
staticHandler.off('filechange', this.fileChanged); | ||
Self: { | ||
fileChanged: function(path, root) { | ||
path = path.replace(root, ''); | ||
if (this.socket == null) { | ||
console.error('File changed %s, but socket is undefined', path); | ||
return; | ||
} | ||
console.log('<file:change>'.green, path); | ||
this.socket.emit('filechange', path); | ||
}, | ||
disconnected: function(){ | ||
staticHandler.off('filechange', this.fileChanged); | ||
} | ||
} | ||
@@ -29,0 +33,0 @@ }); |
@@ -33,3 +33,5 @@ include.js('SocketConnection.js').done(function(resp) { | ||
for (var key in SocketListeners) { | ||
io.of(key).on('connection', listen(key, SocketListeners[key])); | ||
io | ||
.of(key) | ||
.on('connection', listen(key, SocketListeners[key])); | ||
} | ||
@@ -36,0 +38,0 @@ }, |
@@ -30,4 +30,2 @@ include.js({ | ||
console.log('R:', this.appuri); | ||
if (__cache[this.appuri]) | ||
@@ -66,3 +64,3 @@ return __cache[this.appuri]; | ||
if (file.exists() === false){ | ||
console.log('404 - '.red.bold, this.uri.toLocalFile()); | ||
logger.error('<file> 404 - ', this.uri.toLocalFile()); | ||
return this; | ||
@@ -72,2 +70,10 @@ } | ||
this.content = file.read(); | ||
if (this.content) { | ||
logger.log('<resource>', this.type, this.uri.file.bold.green); | ||
}else{ | ||
logger.warn('<file:empty>', this.uri.file); | ||
} | ||
} | ||
@@ -137,7 +143,11 @@ | ||
var array = resources.map(function(x){ | ||
var res = new Resource(x); | ||
return res; | ||
}); | ||
var array = ruqq.arr(resources) | ||
.remove(function(x){ | ||
return !x.url && !x.content; | ||
}) | ||
.map(function(x){ | ||
return new Resource(x); | ||
}) | ||
.items; | ||
@@ -144,0 +154,0 @@ return { |
include.js({ | ||
atma_ruqq: ['dom/jquery', 'arr', 'routes'], | ||
atma_lib: ['mask'] | ||
atma: ['mask'] | ||
}).ready(function(){ | ||
@@ -5,0 +5,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1142240
26503