commonplace
Advanced tools
Comparing version 0.2.5 to 0.2.6
@@ -289,2 +289,3 @@ var child_process = require('child_process'); | ||
'templates.js', | ||
'media/build_id.txt', | ||
'media/imgurls.txt', | ||
@@ -532,8 +533,7 @@ 'media/css/include.css', | ||
console.error('Error writing `build_id.py` to disk.'); | ||
return; | ||
} else { | ||
console.log('Created ' + build_id_file); | ||
} | ||
console.log('Created ' + build_id_file); | ||
callback(); | ||
}); | ||
callback(); | ||
} | ||
@@ -540,0 +540,0 @@ |
{ | ||
"name": "commonplace", | ||
"version": "0.2.5", | ||
"version": "0.2.6", | ||
"preferGlobal": true, | ||
"repository": { | ||
@@ -5,0 +6,0 @@ "url": "git://github.com/mozilla/commonplace.git", |
@@ -40,1 +40,5 @@ # Commonplace | ||
To update your commonplace installation, simply run `commonplace update --npm` from the root of your project. Commonplace will automatically update the global commonplace library to the latest version and update all of the shared modules. | ||
## I have questions! Where do I look for more information? | ||
You can check out the [Wiki](https://github.com/mozilla/commonplace/wiki/_pages), which has plenty of documentation about the project. |
@@ -1,2 +0,2 @@ | ||
define('forms', ['z'], function(z) { | ||
define('forms', ['jquery', 'z'], function($, z) { | ||
@@ -3,0 +3,0 @@ function checkValid(form) { |
@@ -128,3 +128,3 @@ define('helpers', | ||
escape: utils.escape_, | ||
len: function(x) {return x.length;}, | ||
len: function(x) {return x ? x.length || 0 : 0;}, | ||
max: Math.max, | ||
@@ -131,0 +131,0 @@ min: Math.min, |
@@ -185,23 +185,2 @@ // Browser bundle of nunjucks 1.0.0 (slim, only works with precompiled templates) | ||
exports.toArray = function(obj) { | ||
return Array.prototype.slice.call(obj); | ||
}; | ||
exports.without = function(array) { | ||
var result = []; | ||
if (!array) { | ||
return result; | ||
} | ||
var index = -1, | ||
length = array.length, | ||
contains = exports.toArray(arguments).slice(1); | ||
while(++index < length) { | ||
if(contains.indexOf(array[index]) === -1) { | ||
result.push(array[index]); | ||
} | ||
} | ||
return result; | ||
}; | ||
exports.extend = function(obj, obj2) { | ||
@@ -258,23 +237,2 @@ for(var k in obj2) { | ||
exports.asyncParallel = function(funcs, done) { | ||
var count = funcs.length, | ||
result = new Array(count), | ||
current = 0; | ||
var makeNext = function(i) { | ||
return function(res) { | ||
result[i] = res; | ||
current += 1; | ||
if (current === count) { | ||
done(result); | ||
} | ||
}; | ||
}; | ||
for (var i = 0; i < count; i++) { | ||
funcs[i](makeNext(i)); | ||
} | ||
}; | ||
exports.asyncIter = function(arr, iter, cb) { | ||
@@ -317,40 +275,2 @@ var i = -1; | ||
if(!Array.prototype.indexOf) { | ||
Array.prototype.indexOf = function(array, searchElement /*, fromIndex */) { | ||
if (array === null) { | ||
throw new TypeError(); | ||
} | ||
var t = Object(array); | ||
var len = t.length >>> 0; | ||
if (len === 0) { | ||
return -1; | ||
} | ||
var n = 0; | ||
if (arguments.length > 2) { | ||
n = Number(arguments[2]); | ||
if (n != n) { // shortcut for verifying if it's NaN | ||
n = 0; | ||
} else if (n !== 0 && n !== Infinity && n !== -Infinity) { | ||
n = (n > 0 || -1) * Math.floor(Math.abs(n)); | ||
} | ||
} | ||
if (n >= len) { | ||
return -1; | ||
} | ||
var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0); | ||
for (; k < len; k++) { | ||
if (k in t && t[k] === searchElement) { | ||
return k; | ||
} | ||
} | ||
return -1; | ||
}; | ||
} | ||
if(!Array.prototype.map) { | ||
Array.prototype.map = function() { | ||
throw new Error("map is unimplemented for this js engine"); | ||
}; | ||
} | ||
exports.keys = function(obj) { | ||
@@ -583,13 +503,2 @@ if(Object.prototype.keys) { | ||
function callWrap(obj, name, args) { | ||
if(!obj) { | ||
throw new Error('Unable to call `' + name + '`, which is undefined or falsey'); | ||
} | ||
else if(typeof obj !== 'function') { | ||
throw new Error('Unable to call `' + name + '`, which is not a function'); | ||
} | ||
return obj.apply(this, args); | ||
} | ||
function contextOrFrameLookup(context, frame, name) { | ||
@@ -694,3 +603,2 @@ var val = frame.lookup(name); | ||
contextOrFrameLookup: contextOrFrameLookup, | ||
callWrap: callWrap, | ||
handleError: handleError, | ||
@@ -1398,7 +1306,3 @@ isArray: lib.isArray, | ||
} | ||
var noWatch = 'watch' in opts ? !opts.watch : false; | ||
e = new env.Environment(null, opts); | ||
return e; | ||
return e = new env.Environment(null, opts); | ||
}; | ||
@@ -1405,0 +1309,0 @@ |
@@ -67,3 +67,3 @@ define('log', ['storage', 'utils'], function(storage, utils) { | ||
tagged: function(newTag) { | ||
return logger(type, tag + '][' + newTag, onlog); | ||
return logger(type, (tag ? tag + '][' : '') + newTag, onlog); | ||
} | ||
@@ -70,0 +70,0 @@ }; |
@@ -192,3 +192,3 @@ define('navigation', | ||
z.body.on('click', 'a', function(e) { | ||
z.doc.on('click', 'a', function(e) { | ||
var href = this.getAttribute('href'); | ||
@@ -195,0 +195,0 @@ var $elm = $(this); |
@@ -138,2 +138,5 @@ define('utils', ['jquery', 'l10n', 'underscore'], function($, l10n, _) { | ||
function translate(data, default_language, lang) { | ||
if (!data) { | ||
return ''; | ||
} | ||
if (typeof data === 'string') { | ||
@@ -140,0 +143,0 @@ return data; |
@@ -138,2 +138,5 @@ (function() { | ||
eq_(filters.translate({}, dlobj, 'es-PD'), ''); | ||
eq_(filters.translate('', dlobj, 'es-PD'), ''); | ||
eq_(filters.translate(null, dlobj, 'es-PD'), ''); | ||
eq_(filters.translate(undefined, dlobj, 'es-PD'), ''); | ||
done(); | ||
@@ -140,0 +143,0 @@ }); |
Sorry, the diff of this file is not supported yet
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
44
868348
11652