Comparing version 0.5.0-pre.0 to 0.5.0-pre.1
@@ -18,11 +18,13 @@ if( steal.config('env') === 'production' ) { | ||
load.metadata.execute = function(){ | ||
if(load.source) { | ||
var source = load.source+"/*# sourceURL="+load.address+" */"; | ||
source = source.replace(/url\(['"]?([^'"\)]*)['"]?\)/g, function( whole, part ) { | ||
return "url(" + steal.joinURIs( load.address, part) + ")"; | ||
}); | ||
if(load.source && typeof document !== "undefined") { | ||
var head = document.head || document.getElementsByTagName('head')[0], | ||
style = document.createElement('style'), | ||
source = load.source+"/*# sourceURL="+load.address+" */"; | ||
style = document.createElement('style'); | ||
// make source load relative to the current page | ||
source = source.replace(/url\(['"]?([^'"\)]*)['"]?\)/g, function( whole, part ) { | ||
return "url(" + steal.joinURIs( load.address, part) + ")"; | ||
}); | ||
style.type = 'text/css'; | ||
@@ -38,3 +40,3 @@ | ||
return System.newModule({}); | ||
return System.newModule({source: source}); | ||
}; | ||
@@ -41,0 +43,0 @@ load.metadata.format = "css"; |
@@ -12,3 +12,5 @@ var css = require("$css"); | ||
exports.translate = function(load) { | ||
var pathParts = (load.address+'').split('/'); | ||
var address = load.address.replace(/^file\:/,""); | ||
var pathParts = (address+'').split('/'); | ||
pathParts[pathParts.length - 1] = ''; // Remove filename | ||
@@ -23,3 +25,3 @@ | ||
return new Promise(function(resolve, reject){ | ||
options.filename = load.address; | ||
options.filename = address; | ||
options.paths = [pathParts.join('/')]; | ||
@@ -26,0 +28,0 @@ |
@@ -123,3 +123,8 @@ 'use strict'; | ||
} | ||
} | ||
}, | ||
simplemocha: { | ||
builders: { | ||
src: ["test/node_test.js"] | ||
} | ||
} | ||
}); | ||
@@ -132,8 +137,9 @@ | ||
grunt.loadNpmTasks('grunt-contrib-copy'); | ||
grunt.loadNpmTasks('grunt-simple-mocha'); | ||
grunt.loadNpmTasks('grunt-release'); | ||
grunt.loadNpmTasks('testee'); | ||
grunt.registerTask('test', [ 'build', 'testee' ]); | ||
grunt.registerTask('test', [ 'build', 'testee', 'simplemocha' ]); | ||
grunt.registerTask('build', [ /*'jshint', */'concat', 'uglify', 'copy:extensions','copy:toTest' ]); | ||
grunt.registerTask('default', [ 'build' ]); | ||
}; |
{ | ||
"name": "steal", | ||
"description": "Gets JavaScript.", | ||
"version": "0.5.0-pre.0", | ||
"version": "0.5.0-pre.1", | ||
"author": { | ||
@@ -29,2 +29,3 @@ "name": "Bitovi", | ||
"grunt-release": "^0.7.0", | ||
"grunt-simple-mocha": "^0.4.0", | ||
"testee": "0.1.1", | ||
@@ -31,0 +32,0 @@ "jquery": ">2.0" |
/* | ||
* steal v0.5.0-npm.3 | ||
* steal v0.5.0-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) 2015 Bitovi; Licensed MIT |
@@ -18,11 +18,13 @@ if( steal.config('env') === 'production' ) { | ||
load.metadata.execute = function(){ | ||
if(load.source) { | ||
var source = load.source+"/*# sourceURL="+load.address+" */"; | ||
source = source.replace(/url\(['"]?([^'"\)]*)['"]?\)/g, function( whole, part ) { | ||
return "url(" + steal.joinURIs( load.address, part) + ")"; | ||
}); | ||
if(load.source && typeof document !== "undefined") { | ||
var head = document.head || document.getElementsByTagName('head')[0], | ||
style = document.createElement('style'), | ||
source = load.source+"/*# sourceURL="+load.address+" */"; | ||
style = document.createElement('style'); | ||
// make source load relative to the current page | ||
source = source.replace(/url\(['"]?([^'"\)]*)['"]?\)/g, function( whole, part ) { | ||
return "url(" + steal.joinURIs( load.address, part) + ")"; | ||
}); | ||
style.type = 'text/css'; | ||
@@ -38,3 +40,3 @@ | ||
return System.newModule({}); | ||
return System.newModule({source: source}); | ||
}; | ||
@@ -41,0 +43,0 @@ load.metadata.format = "css"; |
@@ -12,3 +12,5 @@ var css = require("$css"); | ||
exports.translate = function(load) { | ||
var pathParts = (load.address+'').split('/'); | ||
var address = load.address.replace(/^file\:/,""); | ||
var pathParts = (address+'').split('/'); | ||
pathParts[pathParts.length - 1] = ''; // Remove filename | ||
@@ -23,3 +25,3 @@ | ||
return new Promise(function(resolve, reject){ | ||
options.filename = load.address; | ||
options.filename = address; | ||
options.paths = [pathParts.join('/')]; | ||
@@ -26,0 +28,0 @@ |
/* | ||
* steal v0.5.0-npm.3 | ||
* steal v0.5.0-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) 2015 Bitovi; Licensed MIT |
@@ -8,4 +8,4 @@ import 'dep_plugins/main.less!'; | ||
removeMyself(); | ||
} else { | ||
} else if(typeof document != "undefined") { | ||
console.log("width", document.getElementById("test-element").clientWidth); | ||
} |
Sorry, the diff of this file is not supported yet
3964121
231
94497
14