diff --git a/benchmarks/benchjs/casting.js b/benchmarks/benchjs/casting.js index 21800a76a0..ab3326c2a5 100644 --- a/benchmarks/benchjs/casting.js +++ b/benchmarks/benchjs/casting.js @@ -1,3 +1,4 @@ +'use strict'; const mongoose = require('../../lib'); const Benchmark = require('benchmark'); diff --git a/benchmarks/benchjs/delete.js b/benchmarks/benchjs/delete.js index d79082fa45..da343dc85d 100644 --- a/benchmarks/benchjs/delete.js +++ b/benchmarks/benchjs/delete.js @@ -1,3 +1,4 @@ +'use strict'; const mongoose = require('../../lib'); const Benchmark = require('benchmark'); diff --git a/benchmarks/benchjs/insert.js b/benchmarks/benchjs/insert.js index 8b6bca637f..026e76bb9b 100644 --- a/benchmarks/benchjs/insert.js +++ b/benchmarks/benchjs/insert.js @@ -1,3 +1,4 @@ +'use strict'; const mongoose = require('../../lib'); const Benchmark = require('benchmark'); diff --git a/benchmarks/benchjs/multiop.js b/benchmarks/benchjs/multiop.js index 24077faef5..685ba697a4 100644 --- a/benchmarks/benchjs/multiop.js +++ b/benchmarks/benchjs/multiop.js @@ -1,3 +1,4 @@ +'use strict'; const mongoose = require('../../lib'); const Benchmark = require('benchmark'); diff --git a/benchmarks/benchjs/population.js b/benchmarks/benchjs/population.js index 7fb98f3aaa..4c4069772b 100644 --- a/benchmarks/benchjs/population.js +++ b/benchmarks/benchjs/population.js @@ -1,3 +1,4 @@ +'use strict'; const mongoose = require('../../lib'); const Benchmark = require('benchmark'); diff --git a/benchmarks/benchjs/read.js b/benchmarks/benchjs/read.js index d7117a3e49..31079bd4e5 100644 --- a/benchmarks/benchjs/read.js +++ b/benchmarks/benchjs/read.js @@ -1,3 +1,4 @@ +'use strict'; const mongoose = require('../../lib'); const Benchmark = require('benchmark'); diff --git a/benchmarks/benchjs/update.js b/benchmarks/benchjs/update.js index 72b33a7db8..6b10ea3440 100644 --- a/benchmarks/benchjs/update.js +++ b/benchmarks/benchjs/update.js @@ -1,3 +1,4 @@ +'use strict'; const mongoose = require('../../lib'); const Benchmark = require('benchmark'); diff --git a/benchmarks/clone.js b/benchmarks/clone.js index cc07b410e9..c8c65a5c8d 100644 --- a/benchmarks/clone.js +++ b/benchmarks/clone.js @@ -1,3 +1,4 @@ +'use strict'; let mongoose = require('../'), Schema = mongoose.Schema; diff --git a/benchmarks/create.js b/benchmarks/create.js index 591107446f..beb6bf148a 100644 --- a/benchmarks/create.js +++ b/benchmarks/create.js @@ -1,5 +1,7 @@ // require('nodetime').profile(); +'use strict'; + const mongoose = require('../../mongoose'); const fs = require('fs'); diff --git a/benchmarks/index.js b/benchmarks/index.js index 50e2447491..d4b6299d0c 100644 --- a/benchmarks/index.js +++ b/benchmarks/index.js @@ -1,3 +1,4 @@ +'use strict'; const Buffer = require('safe-buffer').Buffer; Error.stackTraceLimit = Infinity; diff --git a/benchmarks/mem.js b/benchmarks/mem.js index 23c8609e73..77d098ff7f 100644 --- a/benchmarks/mem.js +++ b/benchmarks/mem.js @@ -1,3 +1,4 @@ +'use strict'; let mongoose = require('../'), Schema = mongoose.Schema; diff --git a/benchmarks/populate.js b/benchmarks/populate.js index 54477d0546..f4460209dd 100644 --- a/benchmarks/populate.js +++ b/benchmarks/populate.js @@ -1,3 +1,4 @@ +'use strict'; const mongoose = require('../'); const Schema = mongoose.Schema; const docs = process.argv[2] ? process.argv[2] | 0 : 100; diff --git a/benchmarks/populationHeavyLoad.js b/benchmarks/populationHeavyLoad.js index edcebce89a..8904d9f831 100644 --- a/benchmarks/populationHeavyLoad.js +++ b/benchmarks/populationHeavyLoad.js @@ -1,3 +1,4 @@ +'use strict'; const tbd = require('tbd'); const mongoose = require('../'); const Schema = mongoose.Schema; diff --git a/browser.js b/browser.js index 764c49a796..4cf822804e 100644 --- a/browser.js +++ b/browser.js @@ -3,4 +3,6 @@ * */ +'use strict'; + module.exports = require('./lib/browser'); diff --git a/docs/3.0.x/docs/helpers/filters.js b/docs/3.0.x/docs/helpers/filters.js index 33546a7e80..95ff08931d 100644 --- a/docs/3.0.x/docs/helpers/filters.js +++ b/docs/3.0.x/docs/helpers/filters.js @@ -1,4 +1,5 @@ +'use strict'; var hl = require('highlight.js') module.exports = exports = function (jade) { diff --git a/docs/3.0.x/docs/helpers/highlight.js b/docs/3.0.x/docs/helpers/highlight.js index 8aca9b9e22..e9f850d131 100644 --- a/docs/3.0.x/docs/helpers/highlight.js +++ b/docs/3.0.x/docs/helpers/highlight.js @@ -1,4 +1,5 @@ +'use strict'; var h = require('highlight.js') function hl (str) { diff --git a/docs/3.0.x/docs/helpers/href.js b/docs/3.0.x/docs/helpers/href.js index e7299b1cf0..0e8285c34d 100644 --- a/docs/3.0.x/docs/helpers/href.js +++ b/docs/3.0.x/docs/helpers/href.js @@ -1,4 +1,5 @@ +'use strict'; module.exports = exports = function (str, char) { if ('string' != typeof str) return str; return encodeURIComponent(str.replace(/\.js$/, '').replace(/\.|#/g, char || '-')); diff --git a/docs/3.0.x/docs/helpers/klass.js b/docs/3.0.x/docs/helpers/klass.js index 0c4a865b43..d2009b87c3 100644 --- a/docs/3.0.x/docs/helpers/klass.js +++ b/docs/3.0.x/docs/helpers/klass.js @@ -1,4 +1,5 @@ +'use strict'; module.exports = exports = function (str) { var parts = str.replace(/\.js$/, '').split('/'); return parts.join('_'); diff --git a/docs/3.0.x/docs/helpers/linktype.js b/docs/3.0.x/docs/helpers/linktype.js index 997e740f67..fc1ec39d48 100644 --- a/docs/3.0.x/docs/helpers/linktype.js +++ b/docs/3.0.x/docs/helpers/linktype.js @@ -1,4 +1,5 @@ +'use strict'; var types = {}; types.Object = 'https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object'; types.Boolean = 'https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean' diff --git a/docs/3.0.x/docs/js/zepto.min.js b/docs/3.0.x/docs/js/zepto.min.js index 428f84a28c..1cf1a23af7 100644 --- a/docs/3.0.x/docs/js/zepto.min.js +++ b/docs/3.0.x/docs/js/zepto.min.js @@ -1,2 +1,4 @@ /* Zepto v1.0rc1 - polyfill zepto event detect fx ajax form touch - zeptojs.com/license */ +'use strict'; + (function(a){String.prototype.trim===a&&(String.prototype.trim=function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}),Array.prototype.reduce===a&&(Array.prototype.reduce=function(b){if(this===void 0||this===null)throw new TypeError;var c=Object(this),d=c.length>>>0,e=0,f;if(typeof b!="function")throw new TypeError;if(d==0&&arguments.length==1)throw new TypeError;if(arguments.length>=2)f=arguments[1];else do{if(e in c){f=c[e++];break}if(++e>=d)throw new TypeError}while(!0);while(e0?[].concat.apply([],a):a}function H(a){return a.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function I(a){return a in i?i[a]:i[a]=new RegExp("(^|\\s)"+a+"(\\s|$)")}function J(a,b){return typeof b=="number"&&!k[H(a)]?b+"px":b}function K(a){var b,c;return h[a]||(b=g.createElement(a),g.body.appendChild(b),c=j(b,"").getPropertyValue("display"),b.parentNode.removeChild(b),c=="none"&&(c="block"),h[a]=c),h[a]}function L(b,d){return d===a?c(b):c(b).filter(d)}function M(a,b,c,d){return A(b)?b.call(a,c,d):b}function N(a,b,d){var e=a%2?b:b.parentNode;e?e.insertBefore(d,a?a==1?e.firstChild:a==2?b:null:b.nextSibling):c(d).remove()}function O(a,b){b(a);for(var c in a.childNodes)O(a.childNodes[c],b)}var a,b,c,d,e=[],f=e.slice,g=window.document,h={},i={},j=g.defaultView.getComputedStyle,k={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},l=/^\s*<(\w+|!)[^>]*>/,m=[1,3,8,9,11],n=["after","prepend","before","append"],o=g.createElement("table"),p=g.createElement("tr"),q={tr:g.createElement("tbody"),tbody:o,thead:o,tfoot:o,td:p,th:p,"*":g.createElement("div")},r=/complete|loaded|interactive/,s=/^\.([\w-]+)$/,t=/^#([\w-]+)$/,u=/^[\w-]+$/,v={}.toString,w={},x,y,z=g.createElement("div");return w.matches=function(a,b){if(!a||a.nodeType!==1)return!1;var c=a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.matchesSelector;if(c)return c.call(a,b);var d,e=a.parentNode,f=!e;return f&&(e=z).appendChild(a),d=~w.qsa(e,b).indexOf(a),f&&z.removeChild(a),d},x=function(a){return a.replace(/-+(.)?/g,function(a,b){return b?b.toUpperCase():""})},y=function(a){return a.filter(function(b,c){return a.indexOf(b)==c})},w.fragment=function(b,d){d===a&&(d=l.test(b)&&RegExp.$1),d in q||(d="*");var e=q[d];return e.innerHTML=""+b,c.each(f.call(e.childNodes),function(){e.removeChild(this)})},w.Z=function(a,b){return a=a||[],a.__proto__=arguments.callee.prototype,a.selector=b||"",a},w.isZ=function(a){return a instanceof w.Z},w.init=function(b,d){if(!b)return w.Z();if(A(b))return c(g).ready(b);if(w.isZ(b))return b;var e;if(D(b))e=F(b);else if(C(b))e=[c.extend({},b)],b=null;else if(m.indexOf(b.nodeType)>=0||b===window)e=[b],b=null;else if(l.test(b))e=w.fragment(b.trim(),RegExp.$1),b=null;else{if(d!==a)return c(d).find(b);e=w.qsa(g,b)}return w.Z(e,b)},c=function(a,b){return w.init(a,b)},c.extend=function(c){return f.call(arguments,1).forEach(function(d){for(b in d)d[b]!==a&&(c[b]=d[b])}),c},w.qsa=function(a,b){var c;return a===g&&t.test(b)?(c=a.getElementById(RegExp.$1))?[c]:e:a.nodeType!==1&&a.nodeType!==9?e:f.call(s.test(b)?a.getElementsByClassName(RegExp.$1):u.test(b)?a.getElementsByTagName(b):a.querySelectorAll(b))},c.isFunction=A,c.isObject=B,c.isArray=D,c.isPlainObject=C,c.inArray=function(a,b,c){return e.indexOf.call(b,a,c)},c.trim=function(a){return a.trim()},c.uuid=0,c.map=function(a,b){var c,d=[],e,f;if(E(a))for(e=0;e0&&w.matches(this[0],a)},not:function(b){var d=[];if(A(b)&&b.call!==a)this.each(function(a){b.call(this,a)||d.push(this)});else{var e=typeof b=="string"?this.filter(b):E(b)&&A(b.item)?f.call(b):c(b);this.forEach(function(a){e.indexOf(a)<0&&d.push(a)})}return c(d)},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){var a=this[0];return a&&!B(a)?a:c(a)},last:function(){var a=this[this.length-1];return a&&!B(a)?a:c(a)},find:function(a){var b;return this.length==1?b=w.qsa(this[0],a):b=this.map(function(){return w.qsa(this,a)}),c(b)},closest:function(a,b){var d=this[0];while(d&&!w.matches(d,a))d=d!==b&&d!==g&&d.parentNode;return c(d)},parents:function(a){var b=[],d=this;while(d.length>0)d=c.map(d,function(a){if((a=a.parentNode)&&a!==g&&b.indexOf(a)<0)return b.push(a),a});return L(b,a)},parent:function(a){return L(y(this.pluck("parentNode")),a)},children:function(a){return L(this.map(function(){return f.call(this.children)}),a)},siblings:function(a){return L(this.map(function(a,b){return f.call(b.parentNode.children).filter(function(a){return a!==b})}),a)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(a){return this.map(function(){return this[a]})},show:function(){return this.each(function(){this.style.display=="none"&&(this.style.display=null),j(this,"").getPropertyValue("display")=="none"&&(this.style.display=K(this.nodeName))})},replaceWith:function(a){return this.before(a).remove()},wrap:function(a){return this.each(function(){c(this).wrapAll(c(a)[0].cloneNode(!1))})},wrapAll:function(a){return this[0]&&(c(this[0]).before(a=c(a)),a.append(this)),this},unwrap:function(){return this.parent().each(function(){c(this).replaceWith(c(this).children())}),this},clone:function(){return c(this.map(function(){return this.cloneNode(!0)}))},hide:function(){return this.css("display","none")},toggle:function(b){return(b===a?this.css("display")=="none":b)?this.show():this.hide()},prev:function(){return c(this.pluck("previousElementSibling"))},next:function(){return c(this.pluck("nextElementSibling"))},html:function(b){return b===a?this.length>0?this[0].innerHTML:null:this.each(function(a){var d=this.innerHTML;c(this).empty().append(M(this,b,a,d))})},text:function(b){return b===a?this.length>0?this[0].textContent:null:this.each(function(){this.textContent=b})},attr:function(c,d){var e;return typeof c=="string"&&d===a?this.length==0||this[0].nodeType!==1?a:c=="value"&&this[0].nodeName=="INPUT"?this.val():!(e=this[0].getAttribute(c))&&c in this[0]?this[0][c]:e:this.each(function(a){if(this.nodeType!==1)return;if(B(c))for(b in c)this.setAttribute(b,c[b]);else this.setAttribute(c,M(this,d,a,this.getAttribute(c)))})},removeAttr:function(a){return this.each(function(){this.nodeType===1&&this.removeAttribute(a)})},prop:function(b,c){return c===a?this[0]?this[0][b]:a:this.each(function(a){this[b]=M(this,c,a,this[b])})},data:function(b,c){var d=this.attr("data-"+H(b),c);return d!==null?d:a},val:function(b){return b===a?this.length>0?this[0].value:a:this.each(function(a){this.value=M(this,b,a,this.value)})},offset:function(){if(this.length==0)return null;var a=this[0].getBoundingClientRect();return{left:a.left+window.pageXOffset,top:a.top+window.pageYOffset,width:a.width,height:a.height}},css:function(c,d){if(d===a&&typeof c=="string")return this.length==0?a:this[0].style[x(c)]||j(this[0],"").getPropertyValue(c);var e="";for(b in c)typeof c[b]=="string"&&c[b]==""?this.each(function(){this.style.removeProperty(H(b))}):e+=H(b)+":"+J(b,c[b])+";";return typeof c=="string"&&(d==""?this.each(function(){this.style.removeProperty(H(c))}):e=H(c)+":"+J(c,d)),this.each(function(){this.style.cssText+=";"+e})},index:function(a){return a?this.indexOf(c(a)[0]):this.parent().children().indexOf(this[0])},hasClass:function(a){return this.length<1?!1:I(a).test(this[0].className)},addClass:function(a){return this.each(function(b){d=[];var e=this.className,f=M(this,a,b,e);f.split(/\s+/g).forEach(function(a){c(this).hasClass(a)||d.push(a)},this),d.length&&(this.className+=(e?" ":"")+d.join(" "))})},removeClass:function(b){return this.each(function(c){if(b===a)return this.className="";d=this.className,M(this,b,c,d).split(/\s+/g).forEach(function(a){d=d.replace(I(a)," ")}),this.className=d.trim()})},toggleClass:function(b,d){return this.each(function(e){var f=M(this,b,e,this.className);(d===a?!c(this).hasClass(f):d)?c(this).addClass(f):c(this).removeClass(f)})}},["width","height"].forEach(function(b){c.fn[b]=function(d){var e,f=b.replace(/./,function(a){return a[0].toUpperCase()});return d===a?this[0]==window?window["inner"+f]:this[0]==g?g.documentElement["offset"+f]:(e=this.offset())&&e[b]:this.each(function(a){var e=c(this);e.css(b,M(this,d,a,e[b]()))})}}),n.forEach(function(a,b){c.fn[a]=function(){var a=c.map(arguments,function(a){return B(a)?a:w.fragment(a)});if(a.length<1)return this;var d=this.length,e=d>1,f=b<2;return this.each(function(c,g){for(var h=0;h0&&this.bind(o,n),setTimeout(function(){m.css(i),e<=0&&setTimeout(function(){m.each(function(){n.call(this)})},0)},0),this},i=null}(Zepto),function($){function triggerAndReturn(a,b,c){var d=$.Event(b);return $(a).trigger(d,c),!d.defaultPrevented}function triggerGlobal(a,b,c,d){if(a.global)return triggerAndReturn(b||document,c,d)}function ajaxStart(a){a.global&&$.active++===0&&triggerGlobal(a,null,"ajaxStart")}function ajaxStop(a){a.global&&!--$.active&&triggerGlobal(a,null,"ajaxStop")}function ajaxBeforeSend(a,b){var c=b.context;if(b.beforeSend.call(c,a,b)===!1||triggerGlobal(b,c,"ajaxBeforeSend",[a,b])===!1)return!1;triggerGlobal(b,c,"ajaxSend",[a,b])}function ajaxSuccess(a,b,c){var d=c.context,e="success";c.success.call(d,a,e,b),triggerGlobal(c,d,"ajaxSuccess",[b,c,a]),ajaxComplete(e,b,c)}function ajaxError(a,b,c,d){var e=d.context;d.error.call(e,c,b,a),triggerGlobal(d,e,"ajaxError",[c,d,a]),ajaxComplete(b,c,d)}function ajaxComplete(a,b,c){var d=c.context;c.complete.call(d,b,a),triggerGlobal(c,d,"ajaxComplete",[b,c]),ajaxStop(c)}function empty(){}function mimeToDataType(a){return a&&(a==htmlType?"html":a==jsonType?"json":scriptTypeRE.test(a)?"script":xmlTypeRE.test(a)&&"xml")||"text"}function appendQuery(a,b){return(a+"&"+b).replace(/[&?]{1,2}/,"?")}function serializeData(a){isObject(a.data)&&(a.data=$.param(a.data)),a.data&&(!a.type||a.type.toUpperCase()=="GET")&&(a.url=appendQuery(a.url,a.data))}function serialize(a,b,c,d){var e=$.isArray(b);$.each(b,function(b,f){d&&(b=c?d:d+"["+(e?"":b)+"]"),!d&&e?a.add(f.name,f.value):(c?$.isArray(f):isObject(f))?serialize(a,f,c,b):a.add(b,f)})}var jsonpID=0,isObject=$.isObject,document=window.document,key,name,rscript=/)<[^<]*)*<\/script>/gi,scriptTypeRE=/^(?:text|application)\/javascript/i,xmlTypeRE=/^(?:text|application)\/xml/i,jsonType="application/json",htmlType="text/html",blankRE=/^\s*$/;$.active=0,$.ajaxJSONP=function(a){var b="jsonp"+ ++jsonpID,c=document.createElement("script"),d=function(){$(c).remove(),b in window&&(window[b]=empty),ajaxComplete("abort",e,a)},e={abort:d},f;return a.error&&(c.onerror=function(){e.abort(),a.error()}),window[b]=function(d){clearTimeout(f),$(c).remove(),delete window[b],ajaxSuccess(d,e,a)},serializeData(a),c.src=a.url.replace(/=\?/,"="+b),$("head").append(c),a.timeout>0&&(f=setTimeout(function(){e.abort(),ajaxComplete("timeout",e,a)},a.timeout)),e},$.ajaxSettings={type:"GET",beforeSend:empty,success:empty,error:empty,complete:empty,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript",json:jsonType,xml:"application/xml, text/xml",html:htmlType,text:"text/plain"},crossDomain:!1,timeout:0},$.ajax=function(options){var settings=$.extend({},options||{});for(key in $.ajaxSettings)settings[key]===undefined&&(settings[key]=$.ajaxSettings[key]);ajaxStart(settings),settings.crossDomain||(settings.crossDomain=/^([\w-]+:)?\/\/([^\/]+)/.test(settings.url)&&RegExp.$2!=window.location.host);var dataType=settings.dataType,hasPlaceholder=/=\?/.test(settings.url);if(dataType=="jsonp"||hasPlaceholder)return hasPlaceholder||(settings.url=appendQuery(settings.url,"callback=?")),$.ajaxJSONP(settings);settings.url||(settings.url=window.location.toString()),serializeData(settings);var mime=settings.accepts[dataType],baseHeaders={},protocol=/^([\w-]+:)\/\//.test(settings.url)?RegExp.$1:window.location.protocol,xhr=$.ajaxSettings.xhr(),abortTimeout;settings.crossDomain||(baseHeaders["X-Requested-With"]="XMLHttpRequest"),mime&&(baseHeaders.Accept=mime,mime.indexOf(",")>-1&&(mime=mime.split(",",2)[0]),xhr.overrideMimeType&&xhr.overrideMimeType(mime));if(settings.contentType||settings.data&&settings.type.toUpperCase()!="GET")baseHeaders["Content-Type"]=settings.contentType||"application/x-www-form-urlencoded";settings.headers=$.extend(baseHeaders,settings.headers||{}),xhr.onreadystatechange=function(){if(xhr.readyState==4){clearTimeout(abortTimeout);var result,error=!1;if(xhr.status>=200&&xhr.status<300||xhr.status==304||xhr.status==0&&protocol=="file:"){dataType=dataType||mimeToDataType(xhr.getResponseHeader("content-type")),result=xhr.responseText;try{dataType=="script"?(1,eval)(result):dataType=="xml"?result=xhr.responseXML:dataType=="json"&&(result=blankRE.test(result)?null:JSON.parse(result))}catch(e){error=e}error?ajaxError(error,"parsererror",xhr,settings):ajaxSuccess(result,xhr,settings)}else ajaxError(null,"error",xhr,settings)}};var async="async"in settings?settings.async:!0;xhr.open(settings.type,settings.url,async);for(name in settings.headers)xhr.setRequestHeader(name,settings.headers[name]);return ajaxBeforeSend(xhr,settings)===!1?(xhr.abort(),!1):(settings.timeout>0&&(abortTimeout=setTimeout(function(){xhr.onreadystatechange=empty,xhr.abort(),ajaxError(null,"timeout",xhr,settings)},settings.timeout)),xhr.send(settings.data?settings.data:null),xhr)},$.get=function(a,b){return $.ajax({url:a,success:b})},$.post=function(a,b,c,d){return $.isFunction(b)&&(d=d||c,c=b,b=null),$.ajax({type:"POST",url:a,data:b,success:c,dataType:d})},$.getJSON=function(a,b){return $.ajax({url:a,success:b,dataType:"json"})},$.fn.load=function(a,b){if(!this.length)return this;var c=this,d=a.split(/\s/),e;return d.length>1&&(a=d[0],e=d[1]),$.get(a,function(a){c.html(e?$(document.createElement("div")).html(a.replace(rscript,"")).find(e).html():a),b&&b.call(c)}),this};var escape=encodeURIComponent;$.param=function(a,b){var c=[];return c.add=function(a,b){this.push(escape(a)+"="+escape(b))},serialize(c,a,b),c.join("&").replace("%20","+")}}(Zepto),function(a){a.fn.serializeArray=function(){var b=[],c;return a(Array.prototype.slice.call(this.get(0).elements)).each(function(){c=a(this);var d=c.attr("type");this.nodeName.toLowerCase()!="fieldset"&&!this.disabled&&d!="submit"&&d!="reset"&&d!="button"&&(d!="radio"&&d!="checkbox"||this.checked)&&b.push({name:c.attr("name"),value:c.val()})}),b},a.fn.serialize=function(){var a=[];return this.serializeArray().forEach(function(b){a.push(encodeURIComponent(b.name)+"="+encodeURIComponent(b.value))}),a.join("&")},a.fn.submit=function(b){if(b)this.bind("submit",b);else if(this.length){var c=a.Event("submit");this.eq(0).trigger(c),c.defaultPrevented||this.get(0).submit()}return this}}(Zepto),function(a){function d(a){return"tagName"in a?a:a.parentNode}function e(a,b,c,d){var e=Math.abs(a-b),f=Math.abs(c-d);return e>=f?a-b>0?"Left":"Right":c-d>0?"Up":"Down"}function h(){g=null,b.last&&(b.el.trigger("longTap"),b={})}function i(){g&&clearTimeout(g),g=null}var b={},c,f=750,g;a(document).ready(function(){var j,k;a(document.body).bind("touchstart",function(e){j=Date.now(),k=j-(b.last||j),b.el=a(d(e.touches[0].target)),c&&clearTimeout(c),b.x1=e.touches[0].pageX,b.y1=e.touches[0].pageY,k>0&&k<=250&&(b.isDoubleTap=!0),b.last=j,g=setTimeout(h,f)}).bind("touchmove",function(a){i(),b.x2=a.touches[0].pageX,b.y2=a.touches[0].pageY}).bind("touchend",function(a){i(),b.isDoubleTap?(b.el.trigger("doubleTap"),b={}):b.x2&&Math.abs(b.x1-b.x2)>30||b.y2&&Math.abs(b.y1-b.y2)>30?(b.el.trigger("swipe")&&b.el.trigger("swipe"+e(b.x1,b.x2,b.y1,b.y2)),b={}):"last"in b&&(b.el.trigger("tap"),c=setTimeout(function(){c=null,b.el.trigger("singleTap"),b={}},250))}).bind("touchcancel",function(){c&&clearTimeout(c),g&&clearTimeout(g),g=c=null,b={}})}),["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap","singleTap","longTap"].forEach(function(b){a.fn[b]=function(a){return this.bind(b,a)}})}(Zepto); \ No newline at end of file diff --git a/docs/3.0.x/docs/source/api.js b/docs/3.0.x/docs/source/api.js index 8fd87f0035..cadfbe41d1 100644 --- a/docs/3.0.x/docs/source/api.js +++ b/docs/3.0.x/docs/source/api.js @@ -2,6 +2,8 @@ * Module dependencies */ +'use strict'; + var fs = require('fs'); var link = require('../helpers/linktype'); var hl = require('highlight.js') diff --git a/docs/3.0.x/docs/source/index.js b/docs/3.0.x/docs/source/index.js index d54229720a..54c7342253 100644 --- a/docs/3.0.x/docs/source/index.js +++ b/docs/3.0.x/docs/source/index.js @@ -1,4 +1,5 @@ +'use strict'; exports['index.jade'] = require('./home') exports['docs/api.jade'] = require('./api') exports['docs/index.jade'] = { title: 'Getting Started' } diff --git a/docs/3.0.x/docs/source/prior.js b/docs/3.0.x/docs/source/prior.js index 2e03811d21..b10cf31086 100644 --- a/docs/3.0.x/docs/source/prior.js +++ b/docs/3.0.x/docs/source/prior.js @@ -1,3 +1,4 @@ +'use strict'; var fs = require('fs') var releases = fs.readFileSync(__dirname + '/../releases', 'utf8'); releases = releases.split('\n').filter(Boolean); diff --git a/docs/3.1.x/docs/helpers/filters.js b/docs/3.1.x/docs/helpers/filters.js index 33546a7e80..95ff08931d 100644 --- a/docs/3.1.x/docs/helpers/filters.js +++ b/docs/3.1.x/docs/helpers/filters.js @@ -1,4 +1,5 @@ +'use strict'; var hl = require('highlight.js') module.exports = exports = function (jade) { diff --git a/docs/3.1.x/docs/helpers/highlight.js b/docs/3.1.x/docs/helpers/highlight.js index 8aca9b9e22..e9f850d131 100644 --- a/docs/3.1.x/docs/helpers/highlight.js +++ b/docs/3.1.x/docs/helpers/highlight.js @@ -1,4 +1,5 @@ +'use strict'; var h = require('highlight.js') function hl (str) { diff --git a/docs/3.1.x/docs/helpers/href.js b/docs/3.1.x/docs/helpers/href.js index e7299b1cf0..0e8285c34d 100644 --- a/docs/3.1.x/docs/helpers/href.js +++ b/docs/3.1.x/docs/helpers/href.js @@ -1,4 +1,5 @@ +'use strict'; module.exports = exports = function (str, char) { if ('string' != typeof str) return str; return encodeURIComponent(str.replace(/\.js$/, '').replace(/\.|#/g, char || '-')); diff --git a/docs/3.1.x/docs/helpers/klass.js b/docs/3.1.x/docs/helpers/klass.js index 0c4a865b43..d2009b87c3 100644 --- a/docs/3.1.x/docs/helpers/klass.js +++ b/docs/3.1.x/docs/helpers/klass.js @@ -1,4 +1,5 @@ +'use strict'; module.exports = exports = function (str) { var parts = str.replace(/\.js$/, '').split('/'); return parts.join('_'); diff --git a/docs/3.1.x/docs/helpers/linktype.js b/docs/3.1.x/docs/helpers/linktype.js index 997e740f67..fc1ec39d48 100644 --- a/docs/3.1.x/docs/helpers/linktype.js +++ b/docs/3.1.x/docs/helpers/linktype.js @@ -1,4 +1,5 @@ +'use strict'; var types = {}; types.Object = 'https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object'; types.Boolean = 'https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean' diff --git a/docs/3.1.x/docs/js/zepto.min.js b/docs/3.1.x/docs/js/zepto.min.js index 428f84a28c..1cf1a23af7 100644 --- a/docs/3.1.x/docs/js/zepto.min.js +++ b/docs/3.1.x/docs/js/zepto.min.js @@ -1,2 +1,4 @@ /* Zepto v1.0rc1 - polyfill zepto event detect fx ajax form touch - zeptojs.com/license */ +'use strict'; + (function(a){String.prototype.trim===a&&(String.prototype.trim=function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}),Array.prototype.reduce===a&&(Array.prototype.reduce=function(b){if(this===void 0||this===null)throw new TypeError;var c=Object(this),d=c.length>>>0,e=0,f;if(typeof b!="function")throw new TypeError;if(d==0&&arguments.length==1)throw new TypeError;if(arguments.length>=2)f=arguments[1];else do{if(e in c){f=c[e++];break}if(++e>=d)throw new TypeError}while(!0);while(e0?[].concat.apply([],a):a}function H(a){return a.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function I(a){return a in i?i[a]:i[a]=new RegExp("(^|\\s)"+a+"(\\s|$)")}function J(a,b){return typeof b=="number"&&!k[H(a)]?b+"px":b}function K(a){var b,c;return h[a]||(b=g.createElement(a),g.body.appendChild(b),c=j(b,"").getPropertyValue("display"),b.parentNode.removeChild(b),c=="none"&&(c="block"),h[a]=c),h[a]}function L(b,d){return d===a?c(b):c(b).filter(d)}function M(a,b,c,d){return A(b)?b.call(a,c,d):b}function N(a,b,d){var e=a%2?b:b.parentNode;e?e.insertBefore(d,a?a==1?e.firstChild:a==2?b:null:b.nextSibling):c(d).remove()}function O(a,b){b(a);for(var c in a.childNodes)O(a.childNodes[c],b)}var a,b,c,d,e=[],f=e.slice,g=window.document,h={},i={},j=g.defaultView.getComputedStyle,k={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},l=/^\s*<(\w+|!)[^>]*>/,m=[1,3,8,9,11],n=["after","prepend","before","append"],o=g.createElement("table"),p=g.createElement("tr"),q={tr:g.createElement("tbody"),tbody:o,thead:o,tfoot:o,td:p,th:p,"*":g.createElement("div")},r=/complete|loaded|interactive/,s=/^\.([\w-]+)$/,t=/^#([\w-]+)$/,u=/^[\w-]+$/,v={}.toString,w={},x,y,z=g.createElement("div");return w.matches=function(a,b){if(!a||a.nodeType!==1)return!1;var c=a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.matchesSelector;if(c)return c.call(a,b);var d,e=a.parentNode,f=!e;return f&&(e=z).appendChild(a),d=~w.qsa(e,b).indexOf(a),f&&z.removeChild(a),d},x=function(a){return a.replace(/-+(.)?/g,function(a,b){return b?b.toUpperCase():""})},y=function(a){return a.filter(function(b,c){return a.indexOf(b)==c})},w.fragment=function(b,d){d===a&&(d=l.test(b)&&RegExp.$1),d in q||(d="*");var e=q[d];return e.innerHTML=""+b,c.each(f.call(e.childNodes),function(){e.removeChild(this)})},w.Z=function(a,b){return a=a||[],a.__proto__=arguments.callee.prototype,a.selector=b||"",a},w.isZ=function(a){return a instanceof w.Z},w.init=function(b,d){if(!b)return w.Z();if(A(b))return c(g).ready(b);if(w.isZ(b))return b;var e;if(D(b))e=F(b);else if(C(b))e=[c.extend({},b)],b=null;else if(m.indexOf(b.nodeType)>=0||b===window)e=[b],b=null;else if(l.test(b))e=w.fragment(b.trim(),RegExp.$1),b=null;else{if(d!==a)return c(d).find(b);e=w.qsa(g,b)}return w.Z(e,b)},c=function(a,b){return w.init(a,b)},c.extend=function(c){return f.call(arguments,1).forEach(function(d){for(b in d)d[b]!==a&&(c[b]=d[b])}),c},w.qsa=function(a,b){var c;return a===g&&t.test(b)?(c=a.getElementById(RegExp.$1))?[c]:e:a.nodeType!==1&&a.nodeType!==9?e:f.call(s.test(b)?a.getElementsByClassName(RegExp.$1):u.test(b)?a.getElementsByTagName(b):a.querySelectorAll(b))},c.isFunction=A,c.isObject=B,c.isArray=D,c.isPlainObject=C,c.inArray=function(a,b,c){return e.indexOf.call(b,a,c)},c.trim=function(a){return a.trim()},c.uuid=0,c.map=function(a,b){var c,d=[],e,f;if(E(a))for(e=0;e0&&w.matches(this[0],a)},not:function(b){var d=[];if(A(b)&&b.call!==a)this.each(function(a){b.call(this,a)||d.push(this)});else{var e=typeof b=="string"?this.filter(b):E(b)&&A(b.item)?f.call(b):c(b);this.forEach(function(a){e.indexOf(a)<0&&d.push(a)})}return c(d)},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){var a=this[0];return a&&!B(a)?a:c(a)},last:function(){var a=this[this.length-1];return a&&!B(a)?a:c(a)},find:function(a){var b;return this.length==1?b=w.qsa(this[0],a):b=this.map(function(){return w.qsa(this,a)}),c(b)},closest:function(a,b){var d=this[0];while(d&&!w.matches(d,a))d=d!==b&&d!==g&&d.parentNode;return c(d)},parents:function(a){var b=[],d=this;while(d.length>0)d=c.map(d,function(a){if((a=a.parentNode)&&a!==g&&b.indexOf(a)<0)return b.push(a),a});return L(b,a)},parent:function(a){return L(y(this.pluck("parentNode")),a)},children:function(a){return L(this.map(function(){return f.call(this.children)}),a)},siblings:function(a){return L(this.map(function(a,b){return f.call(b.parentNode.children).filter(function(a){return a!==b})}),a)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(a){return this.map(function(){return this[a]})},show:function(){return this.each(function(){this.style.display=="none"&&(this.style.display=null),j(this,"").getPropertyValue("display")=="none"&&(this.style.display=K(this.nodeName))})},replaceWith:function(a){return this.before(a).remove()},wrap:function(a){return this.each(function(){c(this).wrapAll(c(a)[0].cloneNode(!1))})},wrapAll:function(a){return this[0]&&(c(this[0]).before(a=c(a)),a.append(this)),this},unwrap:function(){return this.parent().each(function(){c(this).replaceWith(c(this).children())}),this},clone:function(){return c(this.map(function(){return this.cloneNode(!0)}))},hide:function(){return this.css("display","none")},toggle:function(b){return(b===a?this.css("display")=="none":b)?this.show():this.hide()},prev:function(){return c(this.pluck("previousElementSibling"))},next:function(){return c(this.pluck("nextElementSibling"))},html:function(b){return b===a?this.length>0?this[0].innerHTML:null:this.each(function(a){var d=this.innerHTML;c(this).empty().append(M(this,b,a,d))})},text:function(b){return b===a?this.length>0?this[0].textContent:null:this.each(function(){this.textContent=b})},attr:function(c,d){var e;return typeof c=="string"&&d===a?this.length==0||this[0].nodeType!==1?a:c=="value"&&this[0].nodeName=="INPUT"?this.val():!(e=this[0].getAttribute(c))&&c in this[0]?this[0][c]:e:this.each(function(a){if(this.nodeType!==1)return;if(B(c))for(b in c)this.setAttribute(b,c[b]);else this.setAttribute(c,M(this,d,a,this.getAttribute(c)))})},removeAttr:function(a){return this.each(function(){this.nodeType===1&&this.removeAttribute(a)})},prop:function(b,c){return c===a?this[0]?this[0][b]:a:this.each(function(a){this[b]=M(this,c,a,this[b])})},data:function(b,c){var d=this.attr("data-"+H(b),c);return d!==null?d:a},val:function(b){return b===a?this.length>0?this[0].value:a:this.each(function(a){this.value=M(this,b,a,this.value)})},offset:function(){if(this.length==0)return null;var a=this[0].getBoundingClientRect();return{left:a.left+window.pageXOffset,top:a.top+window.pageYOffset,width:a.width,height:a.height}},css:function(c,d){if(d===a&&typeof c=="string")return this.length==0?a:this[0].style[x(c)]||j(this[0],"").getPropertyValue(c);var e="";for(b in c)typeof c[b]=="string"&&c[b]==""?this.each(function(){this.style.removeProperty(H(b))}):e+=H(b)+":"+J(b,c[b])+";";return typeof c=="string"&&(d==""?this.each(function(){this.style.removeProperty(H(c))}):e=H(c)+":"+J(c,d)),this.each(function(){this.style.cssText+=";"+e})},index:function(a){return a?this.indexOf(c(a)[0]):this.parent().children().indexOf(this[0])},hasClass:function(a){return this.length<1?!1:I(a).test(this[0].className)},addClass:function(a){return this.each(function(b){d=[];var e=this.className,f=M(this,a,b,e);f.split(/\s+/g).forEach(function(a){c(this).hasClass(a)||d.push(a)},this),d.length&&(this.className+=(e?" ":"")+d.join(" "))})},removeClass:function(b){return this.each(function(c){if(b===a)return this.className="";d=this.className,M(this,b,c,d).split(/\s+/g).forEach(function(a){d=d.replace(I(a)," ")}),this.className=d.trim()})},toggleClass:function(b,d){return this.each(function(e){var f=M(this,b,e,this.className);(d===a?!c(this).hasClass(f):d)?c(this).addClass(f):c(this).removeClass(f)})}},["width","height"].forEach(function(b){c.fn[b]=function(d){var e,f=b.replace(/./,function(a){return a[0].toUpperCase()});return d===a?this[0]==window?window["inner"+f]:this[0]==g?g.documentElement["offset"+f]:(e=this.offset())&&e[b]:this.each(function(a){var e=c(this);e.css(b,M(this,d,a,e[b]()))})}}),n.forEach(function(a,b){c.fn[a]=function(){var a=c.map(arguments,function(a){return B(a)?a:w.fragment(a)});if(a.length<1)return this;var d=this.length,e=d>1,f=b<2;return this.each(function(c,g){for(var h=0;h0&&this.bind(o,n),setTimeout(function(){m.css(i),e<=0&&setTimeout(function(){m.each(function(){n.call(this)})},0)},0),this},i=null}(Zepto),function($){function triggerAndReturn(a,b,c){var d=$.Event(b);return $(a).trigger(d,c),!d.defaultPrevented}function triggerGlobal(a,b,c,d){if(a.global)return triggerAndReturn(b||document,c,d)}function ajaxStart(a){a.global&&$.active++===0&&triggerGlobal(a,null,"ajaxStart")}function ajaxStop(a){a.global&&!--$.active&&triggerGlobal(a,null,"ajaxStop")}function ajaxBeforeSend(a,b){var c=b.context;if(b.beforeSend.call(c,a,b)===!1||triggerGlobal(b,c,"ajaxBeforeSend",[a,b])===!1)return!1;triggerGlobal(b,c,"ajaxSend",[a,b])}function ajaxSuccess(a,b,c){var d=c.context,e="success";c.success.call(d,a,e,b),triggerGlobal(c,d,"ajaxSuccess",[b,c,a]),ajaxComplete(e,b,c)}function ajaxError(a,b,c,d){var e=d.context;d.error.call(e,c,b,a),triggerGlobal(d,e,"ajaxError",[c,d,a]),ajaxComplete(b,c,d)}function ajaxComplete(a,b,c){var d=c.context;c.complete.call(d,b,a),triggerGlobal(c,d,"ajaxComplete",[b,c]),ajaxStop(c)}function empty(){}function mimeToDataType(a){return a&&(a==htmlType?"html":a==jsonType?"json":scriptTypeRE.test(a)?"script":xmlTypeRE.test(a)&&"xml")||"text"}function appendQuery(a,b){return(a+"&"+b).replace(/[&?]{1,2}/,"?")}function serializeData(a){isObject(a.data)&&(a.data=$.param(a.data)),a.data&&(!a.type||a.type.toUpperCase()=="GET")&&(a.url=appendQuery(a.url,a.data))}function serialize(a,b,c,d){var e=$.isArray(b);$.each(b,function(b,f){d&&(b=c?d:d+"["+(e?"":b)+"]"),!d&&e?a.add(f.name,f.value):(c?$.isArray(f):isObject(f))?serialize(a,f,c,b):a.add(b,f)})}var jsonpID=0,isObject=$.isObject,document=window.document,key,name,rscript=/)<[^<]*)*<\/script>/gi,scriptTypeRE=/^(?:text|application)\/javascript/i,xmlTypeRE=/^(?:text|application)\/xml/i,jsonType="application/json",htmlType="text/html",blankRE=/^\s*$/;$.active=0,$.ajaxJSONP=function(a){var b="jsonp"+ ++jsonpID,c=document.createElement("script"),d=function(){$(c).remove(),b in window&&(window[b]=empty),ajaxComplete("abort",e,a)},e={abort:d},f;return a.error&&(c.onerror=function(){e.abort(),a.error()}),window[b]=function(d){clearTimeout(f),$(c).remove(),delete window[b],ajaxSuccess(d,e,a)},serializeData(a),c.src=a.url.replace(/=\?/,"="+b),$("head").append(c),a.timeout>0&&(f=setTimeout(function(){e.abort(),ajaxComplete("timeout",e,a)},a.timeout)),e},$.ajaxSettings={type:"GET",beforeSend:empty,success:empty,error:empty,complete:empty,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript",json:jsonType,xml:"application/xml, text/xml",html:htmlType,text:"text/plain"},crossDomain:!1,timeout:0},$.ajax=function(options){var settings=$.extend({},options||{});for(key in $.ajaxSettings)settings[key]===undefined&&(settings[key]=$.ajaxSettings[key]);ajaxStart(settings),settings.crossDomain||(settings.crossDomain=/^([\w-]+:)?\/\/([^\/]+)/.test(settings.url)&&RegExp.$2!=window.location.host);var dataType=settings.dataType,hasPlaceholder=/=\?/.test(settings.url);if(dataType=="jsonp"||hasPlaceholder)return hasPlaceholder||(settings.url=appendQuery(settings.url,"callback=?")),$.ajaxJSONP(settings);settings.url||(settings.url=window.location.toString()),serializeData(settings);var mime=settings.accepts[dataType],baseHeaders={},protocol=/^([\w-]+:)\/\//.test(settings.url)?RegExp.$1:window.location.protocol,xhr=$.ajaxSettings.xhr(),abortTimeout;settings.crossDomain||(baseHeaders["X-Requested-With"]="XMLHttpRequest"),mime&&(baseHeaders.Accept=mime,mime.indexOf(",")>-1&&(mime=mime.split(",",2)[0]),xhr.overrideMimeType&&xhr.overrideMimeType(mime));if(settings.contentType||settings.data&&settings.type.toUpperCase()!="GET")baseHeaders["Content-Type"]=settings.contentType||"application/x-www-form-urlencoded";settings.headers=$.extend(baseHeaders,settings.headers||{}),xhr.onreadystatechange=function(){if(xhr.readyState==4){clearTimeout(abortTimeout);var result,error=!1;if(xhr.status>=200&&xhr.status<300||xhr.status==304||xhr.status==0&&protocol=="file:"){dataType=dataType||mimeToDataType(xhr.getResponseHeader("content-type")),result=xhr.responseText;try{dataType=="script"?(1,eval)(result):dataType=="xml"?result=xhr.responseXML:dataType=="json"&&(result=blankRE.test(result)?null:JSON.parse(result))}catch(e){error=e}error?ajaxError(error,"parsererror",xhr,settings):ajaxSuccess(result,xhr,settings)}else ajaxError(null,"error",xhr,settings)}};var async="async"in settings?settings.async:!0;xhr.open(settings.type,settings.url,async);for(name in settings.headers)xhr.setRequestHeader(name,settings.headers[name]);return ajaxBeforeSend(xhr,settings)===!1?(xhr.abort(),!1):(settings.timeout>0&&(abortTimeout=setTimeout(function(){xhr.onreadystatechange=empty,xhr.abort(),ajaxError(null,"timeout",xhr,settings)},settings.timeout)),xhr.send(settings.data?settings.data:null),xhr)},$.get=function(a,b){return $.ajax({url:a,success:b})},$.post=function(a,b,c,d){return $.isFunction(b)&&(d=d||c,c=b,b=null),$.ajax({type:"POST",url:a,data:b,success:c,dataType:d})},$.getJSON=function(a,b){return $.ajax({url:a,success:b,dataType:"json"})},$.fn.load=function(a,b){if(!this.length)return this;var c=this,d=a.split(/\s/),e;return d.length>1&&(a=d[0],e=d[1]),$.get(a,function(a){c.html(e?$(document.createElement("div")).html(a.replace(rscript,"")).find(e).html():a),b&&b.call(c)}),this};var escape=encodeURIComponent;$.param=function(a,b){var c=[];return c.add=function(a,b){this.push(escape(a)+"="+escape(b))},serialize(c,a,b),c.join("&").replace("%20","+")}}(Zepto),function(a){a.fn.serializeArray=function(){var b=[],c;return a(Array.prototype.slice.call(this.get(0).elements)).each(function(){c=a(this);var d=c.attr("type");this.nodeName.toLowerCase()!="fieldset"&&!this.disabled&&d!="submit"&&d!="reset"&&d!="button"&&(d!="radio"&&d!="checkbox"||this.checked)&&b.push({name:c.attr("name"),value:c.val()})}),b},a.fn.serialize=function(){var a=[];return this.serializeArray().forEach(function(b){a.push(encodeURIComponent(b.name)+"="+encodeURIComponent(b.value))}),a.join("&")},a.fn.submit=function(b){if(b)this.bind("submit",b);else if(this.length){var c=a.Event("submit");this.eq(0).trigger(c),c.defaultPrevented||this.get(0).submit()}return this}}(Zepto),function(a){function d(a){return"tagName"in a?a:a.parentNode}function e(a,b,c,d){var e=Math.abs(a-b),f=Math.abs(c-d);return e>=f?a-b>0?"Left":"Right":c-d>0?"Up":"Down"}function h(){g=null,b.last&&(b.el.trigger("longTap"),b={})}function i(){g&&clearTimeout(g),g=null}var b={},c,f=750,g;a(document).ready(function(){var j,k;a(document.body).bind("touchstart",function(e){j=Date.now(),k=j-(b.last||j),b.el=a(d(e.touches[0].target)),c&&clearTimeout(c),b.x1=e.touches[0].pageX,b.y1=e.touches[0].pageY,k>0&&k<=250&&(b.isDoubleTap=!0),b.last=j,g=setTimeout(h,f)}).bind("touchmove",function(a){i(),b.x2=a.touches[0].pageX,b.y2=a.touches[0].pageY}).bind("touchend",function(a){i(),b.isDoubleTap?(b.el.trigger("doubleTap"),b={}):b.x2&&Math.abs(b.x1-b.x2)>30||b.y2&&Math.abs(b.y1-b.y2)>30?(b.el.trigger("swipe")&&b.el.trigger("swipe"+e(b.x1,b.x2,b.y1,b.y2)),b={}):"last"in b&&(b.el.trigger("tap"),c=setTimeout(function(){c=null,b.el.trigger("singleTap"),b={}},250))}).bind("touchcancel",function(){c&&clearTimeout(c),g&&clearTimeout(g),g=c=null,b={}})}),["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap","singleTap","longTap"].forEach(function(b){a.fn[b]=function(a){return this.bind(b,a)}})}(Zepto); \ No newline at end of file diff --git a/docs/3.1.x/docs/source/api.js b/docs/3.1.x/docs/source/api.js index 8fd87f0035..cadfbe41d1 100644 --- a/docs/3.1.x/docs/source/api.js +++ b/docs/3.1.x/docs/source/api.js @@ -2,6 +2,8 @@ * Module dependencies */ +'use strict'; + var fs = require('fs'); var link = require('../helpers/linktype'); var hl = require('highlight.js') diff --git a/docs/3.1.x/docs/source/index.js b/docs/3.1.x/docs/source/index.js index d54229720a..54c7342253 100644 --- a/docs/3.1.x/docs/source/index.js +++ b/docs/3.1.x/docs/source/index.js @@ -1,4 +1,5 @@ +'use strict'; exports['index.jade'] = require('./home') exports['docs/api.jade'] = require('./api') exports['docs/index.jade'] = { title: 'Getting Started' } diff --git a/docs/3.1.x/docs/source/prior.js b/docs/3.1.x/docs/source/prior.js index 2e03811d21..b10cf31086 100644 --- a/docs/3.1.x/docs/source/prior.js +++ b/docs/3.1.x/docs/source/prior.js @@ -1,3 +1,4 @@ +'use strict'; var fs = require('fs') var releases = fs.readFileSync(__dirname + '/../releases', 'utf8'); releases = releases.split('\n').filter(Boolean); diff --git a/docs/3.2.x/docs/helpers/filters.js b/docs/3.2.x/docs/helpers/filters.js index 33546a7e80..95ff08931d 100644 --- a/docs/3.2.x/docs/helpers/filters.js +++ b/docs/3.2.x/docs/helpers/filters.js @@ -1,4 +1,5 @@ +'use strict'; var hl = require('highlight.js') module.exports = exports = function (jade) { diff --git a/docs/3.2.x/docs/helpers/highlight.js b/docs/3.2.x/docs/helpers/highlight.js index 8aca9b9e22..e9f850d131 100644 --- a/docs/3.2.x/docs/helpers/highlight.js +++ b/docs/3.2.x/docs/helpers/highlight.js @@ -1,4 +1,5 @@ +'use strict'; var h = require('highlight.js') function hl (str) { diff --git a/docs/3.2.x/docs/helpers/href.js b/docs/3.2.x/docs/helpers/href.js index e7299b1cf0..0e8285c34d 100644 --- a/docs/3.2.x/docs/helpers/href.js +++ b/docs/3.2.x/docs/helpers/href.js @@ -1,4 +1,5 @@ +'use strict'; module.exports = exports = function (str, char) { if ('string' != typeof str) return str; return encodeURIComponent(str.replace(/\.js$/, '').replace(/\.|#/g, char || '-')); diff --git a/docs/3.2.x/docs/helpers/klass.js b/docs/3.2.x/docs/helpers/klass.js index 0c4a865b43..d2009b87c3 100644 --- a/docs/3.2.x/docs/helpers/klass.js +++ b/docs/3.2.x/docs/helpers/klass.js @@ -1,4 +1,5 @@ +'use strict'; module.exports = exports = function (str) { var parts = str.replace(/\.js$/, '').split('/'); return parts.join('_'); diff --git a/docs/3.2.x/docs/helpers/linktype.js b/docs/3.2.x/docs/helpers/linktype.js index 997e740f67..fc1ec39d48 100644 --- a/docs/3.2.x/docs/helpers/linktype.js +++ b/docs/3.2.x/docs/helpers/linktype.js @@ -1,4 +1,5 @@ +'use strict'; var types = {}; types.Object = 'https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object'; types.Boolean = 'https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean' diff --git a/docs/3.2.x/docs/js/zepto.min.js b/docs/3.2.x/docs/js/zepto.min.js index 428f84a28c..1cf1a23af7 100644 --- a/docs/3.2.x/docs/js/zepto.min.js +++ b/docs/3.2.x/docs/js/zepto.min.js @@ -1,2 +1,4 @@ /* Zepto v1.0rc1 - polyfill zepto event detect fx ajax form touch - zeptojs.com/license */ +'use strict'; + (function(a){String.prototype.trim===a&&(String.prototype.trim=function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}),Array.prototype.reduce===a&&(Array.prototype.reduce=function(b){if(this===void 0||this===null)throw new TypeError;var c=Object(this),d=c.length>>>0,e=0,f;if(typeof b!="function")throw new TypeError;if(d==0&&arguments.length==1)throw new TypeError;if(arguments.length>=2)f=arguments[1];else do{if(e in c){f=c[e++];break}if(++e>=d)throw new TypeError}while(!0);while(e0?[].concat.apply([],a):a}function H(a){return a.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function I(a){return a in i?i[a]:i[a]=new RegExp("(^|\\s)"+a+"(\\s|$)")}function J(a,b){return typeof b=="number"&&!k[H(a)]?b+"px":b}function K(a){var b,c;return h[a]||(b=g.createElement(a),g.body.appendChild(b),c=j(b,"").getPropertyValue("display"),b.parentNode.removeChild(b),c=="none"&&(c="block"),h[a]=c),h[a]}function L(b,d){return d===a?c(b):c(b).filter(d)}function M(a,b,c,d){return A(b)?b.call(a,c,d):b}function N(a,b,d){var e=a%2?b:b.parentNode;e?e.insertBefore(d,a?a==1?e.firstChild:a==2?b:null:b.nextSibling):c(d).remove()}function O(a,b){b(a);for(var c in a.childNodes)O(a.childNodes[c],b)}var a,b,c,d,e=[],f=e.slice,g=window.document,h={},i={},j=g.defaultView.getComputedStyle,k={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},l=/^\s*<(\w+|!)[^>]*>/,m=[1,3,8,9,11],n=["after","prepend","before","append"],o=g.createElement("table"),p=g.createElement("tr"),q={tr:g.createElement("tbody"),tbody:o,thead:o,tfoot:o,td:p,th:p,"*":g.createElement("div")},r=/complete|loaded|interactive/,s=/^\.([\w-]+)$/,t=/^#([\w-]+)$/,u=/^[\w-]+$/,v={}.toString,w={},x,y,z=g.createElement("div");return w.matches=function(a,b){if(!a||a.nodeType!==1)return!1;var c=a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.matchesSelector;if(c)return c.call(a,b);var d,e=a.parentNode,f=!e;return f&&(e=z).appendChild(a),d=~w.qsa(e,b).indexOf(a),f&&z.removeChild(a),d},x=function(a){return a.replace(/-+(.)?/g,function(a,b){return b?b.toUpperCase():""})},y=function(a){return a.filter(function(b,c){return a.indexOf(b)==c})},w.fragment=function(b,d){d===a&&(d=l.test(b)&&RegExp.$1),d in q||(d="*");var e=q[d];return e.innerHTML=""+b,c.each(f.call(e.childNodes),function(){e.removeChild(this)})},w.Z=function(a,b){return a=a||[],a.__proto__=arguments.callee.prototype,a.selector=b||"",a},w.isZ=function(a){return a instanceof w.Z},w.init=function(b,d){if(!b)return w.Z();if(A(b))return c(g).ready(b);if(w.isZ(b))return b;var e;if(D(b))e=F(b);else if(C(b))e=[c.extend({},b)],b=null;else if(m.indexOf(b.nodeType)>=0||b===window)e=[b],b=null;else if(l.test(b))e=w.fragment(b.trim(),RegExp.$1),b=null;else{if(d!==a)return c(d).find(b);e=w.qsa(g,b)}return w.Z(e,b)},c=function(a,b){return w.init(a,b)},c.extend=function(c){return f.call(arguments,1).forEach(function(d){for(b in d)d[b]!==a&&(c[b]=d[b])}),c},w.qsa=function(a,b){var c;return a===g&&t.test(b)?(c=a.getElementById(RegExp.$1))?[c]:e:a.nodeType!==1&&a.nodeType!==9?e:f.call(s.test(b)?a.getElementsByClassName(RegExp.$1):u.test(b)?a.getElementsByTagName(b):a.querySelectorAll(b))},c.isFunction=A,c.isObject=B,c.isArray=D,c.isPlainObject=C,c.inArray=function(a,b,c){return e.indexOf.call(b,a,c)},c.trim=function(a){return a.trim()},c.uuid=0,c.map=function(a,b){var c,d=[],e,f;if(E(a))for(e=0;e0&&w.matches(this[0],a)},not:function(b){var d=[];if(A(b)&&b.call!==a)this.each(function(a){b.call(this,a)||d.push(this)});else{var e=typeof b=="string"?this.filter(b):E(b)&&A(b.item)?f.call(b):c(b);this.forEach(function(a){e.indexOf(a)<0&&d.push(a)})}return c(d)},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){var a=this[0];return a&&!B(a)?a:c(a)},last:function(){var a=this[this.length-1];return a&&!B(a)?a:c(a)},find:function(a){var b;return this.length==1?b=w.qsa(this[0],a):b=this.map(function(){return w.qsa(this,a)}),c(b)},closest:function(a,b){var d=this[0];while(d&&!w.matches(d,a))d=d!==b&&d!==g&&d.parentNode;return c(d)},parents:function(a){var b=[],d=this;while(d.length>0)d=c.map(d,function(a){if((a=a.parentNode)&&a!==g&&b.indexOf(a)<0)return b.push(a),a});return L(b,a)},parent:function(a){return L(y(this.pluck("parentNode")),a)},children:function(a){return L(this.map(function(){return f.call(this.children)}),a)},siblings:function(a){return L(this.map(function(a,b){return f.call(b.parentNode.children).filter(function(a){return a!==b})}),a)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(a){return this.map(function(){return this[a]})},show:function(){return this.each(function(){this.style.display=="none"&&(this.style.display=null),j(this,"").getPropertyValue("display")=="none"&&(this.style.display=K(this.nodeName))})},replaceWith:function(a){return this.before(a).remove()},wrap:function(a){return this.each(function(){c(this).wrapAll(c(a)[0].cloneNode(!1))})},wrapAll:function(a){return this[0]&&(c(this[0]).before(a=c(a)),a.append(this)),this},unwrap:function(){return this.parent().each(function(){c(this).replaceWith(c(this).children())}),this},clone:function(){return c(this.map(function(){return this.cloneNode(!0)}))},hide:function(){return this.css("display","none")},toggle:function(b){return(b===a?this.css("display")=="none":b)?this.show():this.hide()},prev:function(){return c(this.pluck("previousElementSibling"))},next:function(){return c(this.pluck("nextElementSibling"))},html:function(b){return b===a?this.length>0?this[0].innerHTML:null:this.each(function(a){var d=this.innerHTML;c(this).empty().append(M(this,b,a,d))})},text:function(b){return b===a?this.length>0?this[0].textContent:null:this.each(function(){this.textContent=b})},attr:function(c,d){var e;return typeof c=="string"&&d===a?this.length==0||this[0].nodeType!==1?a:c=="value"&&this[0].nodeName=="INPUT"?this.val():!(e=this[0].getAttribute(c))&&c in this[0]?this[0][c]:e:this.each(function(a){if(this.nodeType!==1)return;if(B(c))for(b in c)this.setAttribute(b,c[b]);else this.setAttribute(c,M(this,d,a,this.getAttribute(c)))})},removeAttr:function(a){return this.each(function(){this.nodeType===1&&this.removeAttribute(a)})},prop:function(b,c){return c===a?this[0]?this[0][b]:a:this.each(function(a){this[b]=M(this,c,a,this[b])})},data:function(b,c){var d=this.attr("data-"+H(b),c);return d!==null?d:a},val:function(b){return b===a?this.length>0?this[0].value:a:this.each(function(a){this.value=M(this,b,a,this.value)})},offset:function(){if(this.length==0)return null;var a=this[0].getBoundingClientRect();return{left:a.left+window.pageXOffset,top:a.top+window.pageYOffset,width:a.width,height:a.height}},css:function(c,d){if(d===a&&typeof c=="string")return this.length==0?a:this[0].style[x(c)]||j(this[0],"").getPropertyValue(c);var e="";for(b in c)typeof c[b]=="string"&&c[b]==""?this.each(function(){this.style.removeProperty(H(b))}):e+=H(b)+":"+J(b,c[b])+";";return typeof c=="string"&&(d==""?this.each(function(){this.style.removeProperty(H(c))}):e=H(c)+":"+J(c,d)),this.each(function(){this.style.cssText+=";"+e})},index:function(a){return a?this.indexOf(c(a)[0]):this.parent().children().indexOf(this[0])},hasClass:function(a){return this.length<1?!1:I(a).test(this[0].className)},addClass:function(a){return this.each(function(b){d=[];var e=this.className,f=M(this,a,b,e);f.split(/\s+/g).forEach(function(a){c(this).hasClass(a)||d.push(a)},this),d.length&&(this.className+=(e?" ":"")+d.join(" "))})},removeClass:function(b){return this.each(function(c){if(b===a)return this.className="";d=this.className,M(this,b,c,d).split(/\s+/g).forEach(function(a){d=d.replace(I(a)," ")}),this.className=d.trim()})},toggleClass:function(b,d){return this.each(function(e){var f=M(this,b,e,this.className);(d===a?!c(this).hasClass(f):d)?c(this).addClass(f):c(this).removeClass(f)})}},["width","height"].forEach(function(b){c.fn[b]=function(d){var e,f=b.replace(/./,function(a){return a[0].toUpperCase()});return d===a?this[0]==window?window["inner"+f]:this[0]==g?g.documentElement["offset"+f]:(e=this.offset())&&e[b]:this.each(function(a){var e=c(this);e.css(b,M(this,d,a,e[b]()))})}}),n.forEach(function(a,b){c.fn[a]=function(){var a=c.map(arguments,function(a){return B(a)?a:w.fragment(a)});if(a.length<1)return this;var d=this.length,e=d>1,f=b<2;return this.each(function(c,g){for(var h=0;h0&&this.bind(o,n),setTimeout(function(){m.css(i),e<=0&&setTimeout(function(){m.each(function(){n.call(this)})},0)},0),this},i=null}(Zepto),function($){function triggerAndReturn(a,b,c){var d=$.Event(b);return $(a).trigger(d,c),!d.defaultPrevented}function triggerGlobal(a,b,c,d){if(a.global)return triggerAndReturn(b||document,c,d)}function ajaxStart(a){a.global&&$.active++===0&&triggerGlobal(a,null,"ajaxStart")}function ajaxStop(a){a.global&&!--$.active&&triggerGlobal(a,null,"ajaxStop")}function ajaxBeforeSend(a,b){var c=b.context;if(b.beforeSend.call(c,a,b)===!1||triggerGlobal(b,c,"ajaxBeforeSend",[a,b])===!1)return!1;triggerGlobal(b,c,"ajaxSend",[a,b])}function ajaxSuccess(a,b,c){var d=c.context,e="success";c.success.call(d,a,e,b),triggerGlobal(c,d,"ajaxSuccess",[b,c,a]),ajaxComplete(e,b,c)}function ajaxError(a,b,c,d){var e=d.context;d.error.call(e,c,b,a),triggerGlobal(d,e,"ajaxError",[c,d,a]),ajaxComplete(b,c,d)}function ajaxComplete(a,b,c){var d=c.context;c.complete.call(d,b,a),triggerGlobal(c,d,"ajaxComplete",[b,c]),ajaxStop(c)}function empty(){}function mimeToDataType(a){return a&&(a==htmlType?"html":a==jsonType?"json":scriptTypeRE.test(a)?"script":xmlTypeRE.test(a)&&"xml")||"text"}function appendQuery(a,b){return(a+"&"+b).replace(/[&?]{1,2}/,"?")}function serializeData(a){isObject(a.data)&&(a.data=$.param(a.data)),a.data&&(!a.type||a.type.toUpperCase()=="GET")&&(a.url=appendQuery(a.url,a.data))}function serialize(a,b,c,d){var e=$.isArray(b);$.each(b,function(b,f){d&&(b=c?d:d+"["+(e?"":b)+"]"),!d&&e?a.add(f.name,f.value):(c?$.isArray(f):isObject(f))?serialize(a,f,c,b):a.add(b,f)})}var jsonpID=0,isObject=$.isObject,document=window.document,key,name,rscript=/)<[^<]*)*<\/script>/gi,scriptTypeRE=/^(?:text|application)\/javascript/i,xmlTypeRE=/^(?:text|application)\/xml/i,jsonType="application/json",htmlType="text/html",blankRE=/^\s*$/;$.active=0,$.ajaxJSONP=function(a){var b="jsonp"+ ++jsonpID,c=document.createElement("script"),d=function(){$(c).remove(),b in window&&(window[b]=empty),ajaxComplete("abort",e,a)},e={abort:d},f;return a.error&&(c.onerror=function(){e.abort(),a.error()}),window[b]=function(d){clearTimeout(f),$(c).remove(),delete window[b],ajaxSuccess(d,e,a)},serializeData(a),c.src=a.url.replace(/=\?/,"="+b),$("head").append(c),a.timeout>0&&(f=setTimeout(function(){e.abort(),ajaxComplete("timeout",e,a)},a.timeout)),e},$.ajaxSettings={type:"GET",beforeSend:empty,success:empty,error:empty,complete:empty,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript",json:jsonType,xml:"application/xml, text/xml",html:htmlType,text:"text/plain"},crossDomain:!1,timeout:0},$.ajax=function(options){var settings=$.extend({},options||{});for(key in $.ajaxSettings)settings[key]===undefined&&(settings[key]=$.ajaxSettings[key]);ajaxStart(settings),settings.crossDomain||(settings.crossDomain=/^([\w-]+:)?\/\/([^\/]+)/.test(settings.url)&&RegExp.$2!=window.location.host);var dataType=settings.dataType,hasPlaceholder=/=\?/.test(settings.url);if(dataType=="jsonp"||hasPlaceholder)return hasPlaceholder||(settings.url=appendQuery(settings.url,"callback=?")),$.ajaxJSONP(settings);settings.url||(settings.url=window.location.toString()),serializeData(settings);var mime=settings.accepts[dataType],baseHeaders={},protocol=/^([\w-]+:)\/\//.test(settings.url)?RegExp.$1:window.location.protocol,xhr=$.ajaxSettings.xhr(),abortTimeout;settings.crossDomain||(baseHeaders["X-Requested-With"]="XMLHttpRequest"),mime&&(baseHeaders.Accept=mime,mime.indexOf(",")>-1&&(mime=mime.split(",",2)[0]),xhr.overrideMimeType&&xhr.overrideMimeType(mime));if(settings.contentType||settings.data&&settings.type.toUpperCase()!="GET")baseHeaders["Content-Type"]=settings.contentType||"application/x-www-form-urlencoded";settings.headers=$.extend(baseHeaders,settings.headers||{}),xhr.onreadystatechange=function(){if(xhr.readyState==4){clearTimeout(abortTimeout);var result,error=!1;if(xhr.status>=200&&xhr.status<300||xhr.status==304||xhr.status==0&&protocol=="file:"){dataType=dataType||mimeToDataType(xhr.getResponseHeader("content-type")),result=xhr.responseText;try{dataType=="script"?(1,eval)(result):dataType=="xml"?result=xhr.responseXML:dataType=="json"&&(result=blankRE.test(result)?null:JSON.parse(result))}catch(e){error=e}error?ajaxError(error,"parsererror",xhr,settings):ajaxSuccess(result,xhr,settings)}else ajaxError(null,"error",xhr,settings)}};var async="async"in settings?settings.async:!0;xhr.open(settings.type,settings.url,async);for(name in settings.headers)xhr.setRequestHeader(name,settings.headers[name]);return ajaxBeforeSend(xhr,settings)===!1?(xhr.abort(),!1):(settings.timeout>0&&(abortTimeout=setTimeout(function(){xhr.onreadystatechange=empty,xhr.abort(),ajaxError(null,"timeout",xhr,settings)},settings.timeout)),xhr.send(settings.data?settings.data:null),xhr)},$.get=function(a,b){return $.ajax({url:a,success:b})},$.post=function(a,b,c,d){return $.isFunction(b)&&(d=d||c,c=b,b=null),$.ajax({type:"POST",url:a,data:b,success:c,dataType:d})},$.getJSON=function(a,b){return $.ajax({url:a,success:b,dataType:"json"})},$.fn.load=function(a,b){if(!this.length)return this;var c=this,d=a.split(/\s/),e;return d.length>1&&(a=d[0],e=d[1]),$.get(a,function(a){c.html(e?$(document.createElement("div")).html(a.replace(rscript,"")).find(e).html():a),b&&b.call(c)}),this};var escape=encodeURIComponent;$.param=function(a,b){var c=[];return c.add=function(a,b){this.push(escape(a)+"="+escape(b))},serialize(c,a,b),c.join("&").replace("%20","+")}}(Zepto),function(a){a.fn.serializeArray=function(){var b=[],c;return a(Array.prototype.slice.call(this.get(0).elements)).each(function(){c=a(this);var d=c.attr("type");this.nodeName.toLowerCase()!="fieldset"&&!this.disabled&&d!="submit"&&d!="reset"&&d!="button"&&(d!="radio"&&d!="checkbox"||this.checked)&&b.push({name:c.attr("name"),value:c.val()})}),b},a.fn.serialize=function(){var a=[];return this.serializeArray().forEach(function(b){a.push(encodeURIComponent(b.name)+"="+encodeURIComponent(b.value))}),a.join("&")},a.fn.submit=function(b){if(b)this.bind("submit",b);else if(this.length){var c=a.Event("submit");this.eq(0).trigger(c),c.defaultPrevented||this.get(0).submit()}return this}}(Zepto),function(a){function d(a){return"tagName"in a?a:a.parentNode}function e(a,b,c,d){var e=Math.abs(a-b),f=Math.abs(c-d);return e>=f?a-b>0?"Left":"Right":c-d>0?"Up":"Down"}function h(){g=null,b.last&&(b.el.trigger("longTap"),b={})}function i(){g&&clearTimeout(g),g=null}var b={},c,f=750,g;a(document).ready(function(){var j,k;a(document.body).bind("touchstart",function(e){j=Date.now(),k=j-(b.last||j),b.el=a(d(e.touches[0].target)),c&&clearTimeout(c),b.x1=e.touches[0].pageX,b.y1=e.touches[0].pageY,k>0&&k<=250&&(b.isDoubleTap=!0),b.last=j,g=setTimeout(h,f)}).bind("touchmove",function(a){i(),b.x2=a.touches[0].pageX,b.y2=a.touches[0].pageY}).bind("touchend",function(a){i(),b.isDoubleTap?(b.el.trigger("doubleTap"),b={}):b.x2&&Math.abs(b.x1-b.x2)>30||b.y2&&Math.abs(b.y1-b.y2)>30?(b.el.trigger("swipe")&&b.el.trigger("swipe"+e(b.x1,b.x2,b.y1,b.y2)),b={}):"last"in b&&(b.el.trigger("tap"),c=setTimeout(function(){c=null,b.el.trigger("singleTap"),b={}},250))}).bind("touchcancel",function(){c&&clearTimeout(c),g&&clearTimeout(g),g=c=null,b={}})}),["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap","singleTap","longTap"].forEach(function(b){a.fn[b]=function(a){return this.bind(b,a)}})}(Zepto); \ No newline at end of file diff --git a/docs/3.2.x/docs/source/api.js b/docs/3.2.x/docs/source/api.js index 8fd87f0035..cadfbe41d1 100644 --- a/docs/3.2.x/docs/source/api.js +++ b/docs/3.2.x/docs/source/api.js @@ -2,6 +2,8 @@ * Module dependencies */ +'use strict'; + var fs = require('fs'); var link = require('../helpers/linktype'); var hl = require('highlight.js') diff --git a/docs/3.2.x/docs/source/index.js b/docs/3.2.x/docs/source/index.js index 7eaf8a85b1..588f6430da 100644 --- a/docs/3.2.x/docs/source/index.js +++ b/docs/3.2.x/docs/source/index.js @@ -1,4 +1,5 @@ +'use strict'; exports['index.jade'] = require('./home') exports['docs/api.jade'] = require('./api') exports['docs/index.jade'] = { title: 'Getting Started' } diff --git a/docs/3.2.x/docs/source/prior.js b/docs/3.2.x/docs/source/prior.js index 2e03811d21..b10cf31086 100644 --- a/docs/3.2.x/docs/source/prior.js +++ b/docs/3.2.x/docs/source/prior.js @@ -1,3 +1,4 @@ +'use strict'; var fs = require('fs') var releases = fs.readFileSync(__dirname + '/../releases', 'utf8'); releases = releases.split('\n').filter(Boolean); diff --git a/docs/3.3.x/docs/helpers/filters.js b/docs/3.3.x/docs/helpers/filters.js index 33546a7e80..95ff08931d 100644 --- a/docs/3.3.x/docs/helpers/filters.js +++ b/docs/3.3.x/docs/helpers/filters.js @@ -1,4 +1,5 @@ +'use strict'; var hl = require('highlight.js') module.exports = exports = function (jade) { diff --git a/docs/3.3.x/docs/helpers/highlight.js b/docs/3.3.x/docs/helpers/highlight.js index 8aca9b9e22..e9f850d131 100644 --- a/docs/3.3.x/docs/helpers/highlight.js +++ b/docs/3.3.x/docs/helpers/highlight.js @@ -1,4 +1,5 @@ +'use strict'; var h = require('highlight.js') function hl (str) { diff --git a/docs/3.3.x/docs/helpers/href.js b/docs/3.3.x/docs/helpers/href.js index e7299b1cf0..0e8285c34d 100644 --- a/docs/3.3.x/docs/helpers/href.js +++ b/docs/3.3.x/docs/helpers/href.js @@ -1,4 +1,5 @@ +'use strict'; module.exports = exports = function (str, char) { if ('string' != typeof str) return str; return encodeURIComponent(str.replace(/\.js$/, '').replace(/\.|#/g, char || '-')); diff --git a/docs/3.3.x/docs/helpers/klass.js b/docs/3.3.x/docs/helpers/klass.js index 0c4a865b43..d2009b87c3 100644 --- a/docs/3.3.x/docs/helpers/klass.js +++ b/docs/3.3.x/docs/helpers/klass.js @@ -1,4 +1,5 @@ +'use strict'; module.exports = exports = function (str) { var parts = str.replace(/\.js$/, '').split('/'); return parts.join('_'); diff --git a/docs/3.3.x/docs/helpers/linktype.js b/docs/3.3.x/docs/helpers/linktype.js index 997e740f67..fc1ec39d48 100644 --- a/docs/3.3.x/docs/helpers/linktype.js +++ b/docs/3.3.x/docs/helpers/linktype.js @@ -1,4 +1,5 @@ +'use strict'; var types = {}; types.Object = 'https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object'; types.Boolean = 'https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean' diff --git a/docs/3.3.x/docs/js/cookies.min.js b/docs/3.3.x/docs/js/cookies.min.js index dc94dbc5bb..8f9c5b0cc5 100644 --- a/docs/3.3.x/docs/js/cookies.min.js +++ b/docs/3.3.x/docs/js/cookies.min.js @@ -1,4 +1,6 @@ /*! Cookies.js - 0.2.0; Copyright (c) 2012, Scott Hamper; http://www.opensource.org/licenses/MIT */ +'use strict'; + (function(f,e){var b=function(c,d,a){return 1===arguments.length?b.get(c):b.set(c,d,a)};b.get=function(c){f.cookie!==b._cacheString&&b._populateCache();return b._cache[c]};b.defaults={path:"/"};b.set=function(c,d,a){a={path:a&&a.path||b.defaults.path,domain:a&&a.domain||b.defaults.domain,expires:a&&a.expires||b.defaults.expires,secure:a&&a.secure!==e?a.secure:b.defaults.secure};d===e&&(a.expires=-1);switch(typeof a.expires){case "number":a.expires=new Date((new Date).getTime()+1E3*a.expires);break; case "string":a.expires=new Date(a.expires)}c=encodeURIComponent(c)+"="+(d+"").replace(/[^!#-+\--:<-[\]-~]/g,encodeURIComponent);c+=a.path?";path="+a.path:"";c+=a.domain?";domain="+a.domain:"";c+=a.expires?";expires="+a.expires.toGMTString():"";c+=a.secure?";secure":"";f.cookie=c;return b};b.expire=function(c,d){return b.set(c,e,d)};b._populateCache=function(){b._cache={};b._cacheString=f.cookie;for(var c=b._cacheString.split("; "),d=0;d>>0,e=0,f;if(typeof b!="function")throw new TypeError;if(d==0&&arguments.length==1)throw new TypeError;if(arguments.length>=2)f=arguments[1];else do{if(e in c){f=c[e++];break}if(++e>=d)throw new TypeError}while(!0);while(e0?[].concat.apply([],a):a}function H(a){return a.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function I(a){return a in i?i[a]:i[a]=new RegExp("(^|\\s)"+a+"(\\s|$)")}function J(a,b){return typeof b=="number"&&!k[H(a)]?b+"px":b}function K(a){var b,c;return h[a]||(b=g.createElement(a),g.body.appendChild(b),c=j(b,"").getPropertyValue("display"),b.parentNode.removeChild(b),c=="none"&&(c="block"),h[a]=c),h[a]}function L(b,d){return d===a?c(b):c(b).filter(d)}function M(a,b,c,d){return A(b)?b.call(a,c,d):b}function N(a,b,d){var e=a%2?b:b.parentNode;e?e.insertBefore(d,a?a==1?e.firstChild:a==2?b:null:b.nextSibling):c(d).remove()}function O(a,b){b(a);for(var c in a.childNodes)O(a.childNodes[c],b)}var a,b,c,d,e=[],f=e.slice,g=window.document,h={},i={},j=g.defaultView.getComputedStyle,k={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},l=/^\s*<(\w+|!)[^>]*>/,m=[1,3,8,9,11],n=["after","prepend","before","append"],o=g.createElement("table"),p=g.createElement("tr"),q={tr:g.createElement("tbody"),tbody:o,thead:o,tfoot:o,td:p,th:p,"*":g.createElement("div")},r=/complete|loaded|interactive/,s=/^\.([\w-]+)$/,t=/^#([\w-]+)$/,u=/^[\w-]+$/,v={}.toString,w={},x,y,z=g.createElement("div");return w.matches=function(a,b){if(!a||a.nodeType!==1)return!1;var c=a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.matchesSelector;if(c)return c.call(a,b);var d,e=a.parentNode,f=!e;return f&&(e=z).appendChild(a),d=~w.qsa(e,b).indexOf(a),f&&z.removeChild(a),d},x=function(a){return a.replace(/-+(.)?/g,function(a,b){return b?b.toUpperCase():""})},y=function(a){return a.filter(function(b,c){return a.indexOf(b)==c})},w.fragment=function(b,d){d===a&&(d=l.test(b)&&RegExp.$1),d in q||(d="*");var e=q[d];return e.innerHTML=""+b,c.each(f.call(e.childNodes),function(){e.removeChild(this)})},w.Z=function(a,b){return a=a||[],a.__proto__=arguments.callee.prototype,a.selector=b||"",a},w.isZ=function(a){return a instanceof w.Z},w.init=function(b,d){if(!b)return w.Z();if(A(b))return c(g).ready(b);if(w.isZ(b))return b;var e;if(D(b))e=F(b);else if(C(b))e=[c.extend({},b)],b=null;else if(m.indexOf(b.nodeType)>=0||b===window)e=[b],b=null;else if(l.test(b))e=w.fragment(b.trim(),RegExp.$1),b=null;else{if(d!==a)return c(d).find(b);e=w.qsa(g,b)}return w.Z(e,b)},c=function(a,b){return w.init(a,b)},c.extend=function(c){return f.call(arguments,1).forEach(function(d){for(b in d)d[b]!==a&&(c[b]=d[b])}),c},w.qsa=function(a,b){var c;return a===g&&t.test(b)?(c=a.getElementById(RegExp.$1))?[c]:e:a.nodeType!==1&&a.nodeType!==9?e:f.call(s.test(b)?a.getElementsByClassName(RegExp.$1):u.test(b)?a.getElementsByTagName(b):a.querySelectorAll(b))},c.isFunction=A,c.isObject=B,c.isArray=D,c.isPlainObject=C,c.inArray=function(a,b,c){return e.indexOf.call(b,a,c)},c.trim=function(a){return a.trim()},c.uuid=0,c.map=function(a,b){var c,d=[],e,f;if(E(a))for(e=0;e0&&w.matches(this[0],a)},not:function(b){var d=[];if(A(b)&&b.call!==a)this.each(function(a){b.call(this,a)||d.push(this)});else{var e=typeof b=="string"?this.filter(b):E(b)&&A(b.item)?f.call(b):c(b);this.forEach(function(a){e.indexOf(a)<0&&d.push(a)})}return c(d)},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){var a=this[0];return a&&!B(a)?a:c(a)},last:function(){var a=this[this.length-1];return a&&!B(a)?a:c(a)},find:function(a){var b;return this.length==1?b=w.qsa(this[0],a):b=this.map(function(){return w.qsa(this,a)}),c(b)},closest:function(a,b){var d=this[0];while(d&&!w.matches(d,a))d=d!==b&&d!==g&&d.parentNode;return c(d)},parents:function(a){var b=[],d=this;while(d.length>0)d=c.map(d,function(a){if((a=a.parentNode)&&a!==g&&b.indexOf(a)<0)return b.push(a),a});return L(b,a)},parent:function(a){return L(y(this.pluck("parentNode")),a)},children:function(a){return L(this.map(function(){return f.call(this.children)}),a)},siblings:function(a){return L(this.map(function(a,b){return f.call(b.parentNode.children).filter(function(a){return a!==b})}),a)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(a){return this.map(function(){return this[a]})},show:function(){return this.each(function(){this.style.display=="none"&&(this.style.display=null),j(this,"").getPropertyValue("display")=="none"&&(this.style.display=K(this.nodeName))})},replaceWith:function(a){return this.before(a).remove()},wrap:function(a){return this.each(function(){c(this).wrapAll(c(a)[0].cloneNode(!1))})},wrapAll:function(a){return this[0]&&(c(this[0]).before(a=c(a)),a.append(this)),this},unwrap:function(){return this.parent().each(function(){c(this).replaceWith(c(this).children())}),this},clone:function(){return c(this.map(function(){return this.cloneNode(!0)}))},hide:function(){return this.css("display","none")},toggle:function(b){return(b===a?this.css("display")=="none":b)?this.show():this.hide()},prev:function(){return c(this.pluck("previousElementSibling"))},next:function(){return c(this.pluck("nextElementSibling"))},html:function(b){return b===a?this.length>0?this[0].innerHTML:null:this.each(function(a){var d=this.innerHTML;c(this).empty().append(M(this,b,a,d))})},text:function(b){return b===a?this.length>0?this[0].textContent:null:this.each(function(){this.textContent=b})},attr:function(c,d){var e;return typeof c=="string"&&d===a?this.length==0||this[0].nodeType!==1?a:c=="value"&&this[0].nodeName=="INPUT"?this.val():!(e=this[0].getAttribute(c))&&c in this[0]?this[0][c]:e:this.each(function(a){if(this.nodeType!==1)return;if(B(c))for(b in c)this.setAttribute(b,c[b]);else this.setAttribute(c,M(this,d,a,this.getAttribute(c)))})},removeAttr:function(a){return this.each(function(){this.nodeType===1&&this.removeAttribute(a)})},prop:function(b,c){return c===a?this[0]?this[0][b]:a:this.each(function(a){this[b]=M(this,c,a,this[b])})},data:function(b,c){var d=this.attr("data-"+H(b),c);return d!==null?d:a},val:function(b){return b===a?this.length>0?this[0].value:a:this.each(function(a){this.value=M(this,b,a,this.value)})},offset:function(){if(this.length==0)return null;var a=this[0].getBoundingClientRect();return{left:a.left+window.pageXOffset,top:a.top+window.pageYOffset,width:a.width,height:a.height}},css:function(c,d){if(d===a&&typeof c=="string")return this.length==0?a:this[0].style[x(c)]||j(this[0],"").getPropertyValue(c);var e="";for(b in c)typeof c[b]=="string"&&c[b]==""?this.each(function(){this.style.removeProperty(H(b))}):e+=H(b)+":"+J(b,c[b])+";";return typeof c=="string"&&(d==""?this.each(function(){this.style.removeProperty(H(c))}):e=H(c)+":"+J(c,d)),this.each(function(){this.style.cssText+=";"+e})},index:function(a){return a?this.indexOf(c(a)[0]):this.parent().children().indexOf(this[0])},hasClass:function(a){return this.length<1?!1:I(a).test(this[0].className)},addClass:function(a){return this.each(function(b){d=[];var e=this.className,f=M(this,a,b,e);f.split(/\s+/g).forEach(function(a){c(this).hasClass(a)||d.push(a)},this),d.length&&(this.className+=(e?" ":"")+d.join(" "))})},removeClass:function(b){return this.each(function(c){if(b===a)return this.className="";d=this.className,M(this,b,c,d).split(/\s+/g).forEach(function(a){d=d.replace(I(a)," ")}),this.className=d.trim()})},toggleClass:function(b,d){return this.each(function(e){var f=M(this,b,e,this.className);(d===a?!c(this).hasClass(f):d)?c(this).addClass(f):c(this).removeClass(f)})}},["width","height"].forEach(function(b){c.fn[b]=function(d){var e,f=b.replace(/./,function(a){return a[0].toUpperCase()});return d===a?this[0]==window?window["inner"+f]:this[0]==g?g.documentElement["offset"+f]:(e=this.offset())&&e[b]:this.each(function(a){var e=c(this);e.css(b,M(this,d,a,e[b]()))})}}),n.forEach(function(a,b){c.fn[a]=function(){var a=c.map(arguments,function(a){return B(a)?a:w.fragment(a)});if(a.length<1)return this;var d=this.length,e=d>1,f=b<2;return this.each(function(c,g){for(var h=0;h0&&this.bind(o,n),setTimeout(function(){m.css(i),e<=0&&setTimeout(function(){m.each(function(){n.call(this)})},0)},0),this},i=null}(Zepto),function($){function triggerAndReturn(a,b,c){var d=$.Event(b);return $(a).trigger(d,c),!d.defaultPrevented}function triggerGlobal(a,b,c,d){if(a.global)return triggerAndReturn(b||document,c,d)}function ajaxStart(a){a.global&&$.active++===0&&triggerGlobal(a,null,"ajaxStart")}function ajaxStop(a){a.global&&!--$.active&&triggerGlobal(a,null,"ajaxStop")}function ajaxBeforeSend(a,b){var c=b.context;if(b.beforeSend.call(c,a,b)===!1||triggerGlobal(b,c,"ajaxBeforeSend",[a,b])===!1)return!1;triggerGlobal(b,c,"ajaxSend",[a,b])}function ajaxSuccess(a,b,c){var d=c.context,e="success";c.success.call(d,a,e,b),triggerGlobal(c,d,"ajaxSuccess",[b,c,a]),ajaxComplete(e,b,c)}function ajaxError(a,b,c,d){var e=d.context;d.error.call(e,c,b,a),triggerGlobal(d,e,"ajaxError",[c,d,a]),ajaxComplete(b,c,d)}function ajaxComplete(a,b,c){var d=c.context;c.complete.call(d,b,a),triggerGlobal(c,d,"ajaxComplete",[b,c]),ajaxStop(c)}function empty(){}function mimeToDataType(a){return a&&(a==htmlType?"html":a==jsonType?"json":scriptTypeRE.test(a)?"script":xmlTypeRE.test(a)&&"xml")||"text"}function appendQuery(a,b){return(a+"&"+b).replace(/[&?]{1,2}/,"?")}function serializeData(a){isObject(a.data)&&(a.data=$.param(a.data)),a.data&&(!a.type||a.type.toUpperCase()=="GET")&&(a.url=appendQuery(a.url,a.data))}function serialize(a,b,c,d){var e=$.isArray(b);$.each(b,function(b,f){d&&(b=c?d:d+"["+(e?"":b)+"]"),!d&&e?a.add(f.name,f.value):(c?$.isArray(f):isObject(f))?serialize(a,f,c,b):a.add(b,f)})}var jsonpID=0,isObject=$.isObject,document=window.document,key,name,rscript=/)<[^<]*)*<\/script>/gi,scriptTypeRE=/^(?:text|application)\/javascript/i,xmlTypeRE=/^(?:text|application)\/xml/i,jsonType="application/json",htmlType="text/html",blankRE=/^\s*$/;$.active=0,$.ajaxJSONP=function(a){var b="jsonp"+ ++jsonpID,c=document.createElement("script"),d=function(){$(c).remove(),b in window&&(window[b]=empty),ajaxComplete("abort",e,a)},e={abort:d},f;return a.error&&(c.onerror=function(){e.abort(),a.error()}),window[b]=function(d){clearTimeout(f),$(c).remove(),delete window[b],ajaxSuccess(d,e,a)},serializeData(a),c.src=a.url.replace(/=\?/,"="+b),$("head").append(c),a.timeout>0&&(f=setTimeout(function(){e.abort(),ajaxComplete("timeout",e,a)},a.timeout)),e},$.ajaxSettings={type:"GET",beforeSend:empty,success:empty,error:empty,complete:empty,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript",json:jsonType,xml:"application/xml, text/xml",html:htmlType,text:"text/plain"},crossDomain:!1,timeout:0},$.ajax=function(options){var settings=$.extend({},options||{});for(key in $.ajaxSettings)settings[key]===undefined&&(settings[key]=$.ajaxSettings[key]);ajaxStart(settings),settings.crossDomain||(settings.crossDomain=/^([\w-]+:)?\/\/([^\/]+)/.test(settings.url)&&RegExp.$2!=window.location.host);var dataType=settings.dataType,hasPlaceholder=/=\?/.test(settings.url);if(dataType=="jsonp"||hasPlaceholder)return hasPlaceholder||(settings.url=appendQuery(settings.url,"callback=?")),$.ajaxJSONP(settings);settings.url||(settings.url=window.location.toString()),serializeData(settings);var mime=settings.accepts[dataType],baseHeaders={},protocol=/^([\w-]+:)\/\//.test(settings.url)?RegExp.$1:window.location.protocol,xhr=$.ajaxSettings.xhr(),abortTimeout;settings.crossDomain||(baseHeaders["X-Requested-With"]="XMLHttpRequest"),mime&&(baseHeaders.Accept=mime,mime.indexOf(",")>-1&&(mime=mime.split(",",2)[0]),xhr.overrideMimeType&&xhr.overrideMimeType(mime));if(settings.contentType||settings.data&&settings.type.toUpperCase()!="GET")baseHeaders["Content-Type"]=settings.contentType||"application/x-www-form-urlencoded";settings.headers=$.extend(baseHeaders,settings.headers||{}),xhr.onreadystatechange=function(){if(xhr.readyState==4){clearTimeout(abortTimeout);var result,error=!1;if(xhr.status>=200&&xhr.status<300||xhr.status==304||xhr.status==0&&protocol=="file:"){dataType=dataType||mimeToDataType(xhr.getResponseHeader("content-type")),result=xhr.responseText;try{dataType=="script"?(1,eval)(result):dataType=="xml"?result=xhr.responseXML:dataType=="json"&&(result=blankRE.test(result)?null:JSON.parse(result))}catch(e){error=e}error?ajaxError(error,"parsererror",xhr,settings):ajaxSuccess(result,xhr,settings)}else ajaxError(null,"error",xhr,settings)}};var async="async"in settings?settings.async:!0;xhr.open(settings.type,settings.url,async);for(name in settings.headers)xhr.setRequestHeader(name,settings.headers[name]);return ajaxBeforeSend(xhr,settings)===!1?(xhr.abort(),!1):(settings.timeout>0&&(abortTimeout=setTimeout(function(){xhr.onreadystatechange=empty,xhr.abort(),ajaxError(null,"timeout",xhr,settings)},settings.timeout)),xhr.send(settings.data?settings.data:null),xhr)},$.get=function(a,b){return $.ajax({url:a,success:b})},$.post=function(a,b,c,d){return $.isFunction(b)&&(d=d||c,c=b,b=null),$.ajax({type:"POST",url:a,data:b,success:c,dataType:d})},$.getJSON=function(a,b){return $.ajax({url:a,success:b,dataType:"json"})},$.fn.load=function(a,b){if(!this.length)return this;var c=this,d=a.split(/\s/),e;return d.length>1&&(a=d[0],e=d[1]),$.get(a,function(a){c.html(e?$(document.createElement("div")).html(a.replace(rscript,"")).find(e).html():a),b&&b.call(c)}),this};var escape=encodeURIComponent;$.param=function(a,b){var c=[];return c.add=function(a,b){this.push(escape(a)+"="+escape(b))},serialize(c,a,b),c.join("&").replace("%20","+")}}(Zepto),function(a){a.fn.serializeArray=function(){var b=[],c;return a(Array.prototype.slice.call(this.get(0).elements)).each(function(){c=a(this);var d=c.attr("type");this.nodeName.toLowerCase()!="fieldset"&&!this.disabled&&d!="submit"&&d!="reset"&&d!="button"&&(d!="radio"&&d!="checkbox"||this.checked)&&b.push({name:c.attr("name"),value:c.val()})}),b},a.fn.serialize=function(){var a=[];return this.serializeArray().forEach(function(b){a.push(encodeURIComponent(b.name)+"="+encodeURIComponent(b.value))}),a.join("&")},a.fn.submit=function(b){if(b)this.bind("submit",b);else if(this.length){var c=a.Event("submit");this.eq(0).trigger(c),c.defaultPrevented||this.get(0).submit()}return this}}(Zepto),function(a){function d(a){return"tagName"in a?a:a.parentNode}function e(a,b,c,d){var e=Math.abs(a-b),f=Math.abs(c-d);return e>=f?a-b>0?"Left":"Right":c-d>0?"Up":"Down"}function h(){g=null,b.last&&(b.el.trigger("longTap"),b={})}function i(){g&&clearTimeout(g),g=null}var b={},c,f=750,g;a(document).ready(function(){var j,k;a(document.body).bind("touchstart",function(e){j=Date.now(),k=j-(b.last||j),b.el=a(d(e.touches[0].target)),c&&clearTimeout(c),b.x1=e.touches[0].pageX,b.y1=e.touches[0].pageY,k>0&&k<=250&&(b.isDoubleTap=!0),b.last=j,g=setTimeout(h,f)}).bind("touchmove",function(a){i(),b.x2=a.touches[0].pageX,b.y2=a.touches[0].pageY}).bind("touchend",function(a){i(),b.isDoubleTap?(b.el.trigger("doubleTap"),b={}):b.x2&&Math.abs(b.x1-b.x2)>30||b.y2&&Math.abs(b.y1-b.y2)>30?(b.el.trigger("swipe")&&b.el.trigger("swipe"+e(b.x1,b.x2,b.y1,b.y2)),b={}):"last"in b&&(b.el.trigger("tap"),c=setTimeout(function(){c=null,b.el.trigger("singleTap"),b={}},250))}).bind("touchcancel",function(){c&&clearTimeout(c),g&&clearTimeout(g),g=c=null,b={}})}),["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap","singleTap","longTap"].forEach(function(b){a.fn[b]=function(a){return this.bind(b,a)}})}(Zepto); \ No newline at end of file diff --git a/docs/3.3.x/docs/source/api.js b/docs/3.3.x/docs/source/api.js index 8fd87f0035..cadfbe41d1 100644 --- a/docs/3.3.x/docs/source/api.js +++ b/docs/3.3.x/docs/source/api.js @@ -2,6 +2,8 @@ * Module dependencies */ +'use strict'; + var fs = require('fs'); var link = require('../helpers/linktype'); var hl = require('highlight.js') diff --git a/docs/3.3.x/docs/source/index.js b/docs/3.3.x/docs/source/index.js index 18b3eeb571..82921f05ee 100644 --- a/docs/3.3.x/docs/source/index.js +++ b/docs/3.3.x/docs/source/index.js @@ -1,4 +1,5 @@ +'use strict'; exports['index.jade'] = require('./home') exports['docs/api.jade'] = require('./api') exports['docs/index.jade'] = { title: 'Getting Started' } diff --git a/docs/3.3.x/docs/source/prior.js b/docs/3.3.x/docs/source/prior.js index 2e03811d21..b10cf31086 100644 --- a/docs/3.3.x/docs/source/prior.js +++ b/docs/3.3.x/docs/source/prior.js @@ -1,3 +1,4 @@ +'use strict'; var fs = require('fs') var releases = fs.readFileSync(__dirname + '/../releases', 'utf8'); releases = releases.split('\n').filter(Boolean); diff --git a/docs/3.3.x/docs/source/production.js b/docs/3.3.x/docs/source/production.js index 9fdbcfffbc..1b2bfcbd32 100644 --- a/docs/3.3.x/docs/source/production.js +++ b/docs/3.3.x/docs/source/production.js @@ -1,4 +1,5 @@ +'use strict'; var fs = require('fs') var images = fs.readFileSync(__dirname + '/../images/apps/urls', 'utf-8').split('\n'); diff --git a/docs/3.4.x/docs/helpers/filters.js b/docs/3.4.x/docs/helpers/filters.js index 33546a7e80..95ff08931d 100644 --- a/docs/3.4.x/docs/helpers/filters.js +++ b/docs/3.4.x/docs/helpers/filters.js @@ -1,4 +1,5 @@ +'use strict'; var hl = require('highlight.js') module.exports = exports = function (jade) { diff --git a/docs/3.4.x/docs/helpers/highlight.js b/docs/3.4.x/docs/helpers/highlight.js index 8aca9b9e22..e9f850d131 100644 --- a/docs/3.4.x/docs/helpers/highlight.js +++ b/docs/3.4.x/docs/helpers/highlight.js @@ -1,4 +1,5 @@ +'use strict'; var h = require('highlight.js') function hl (str) { diff --git a/docs/3.4.x/docs/helpers/href.js b/docs/3.4.x/docs/helpers/href.js index e7299b1cf0..0e8285c34d 100644 --- a/docs/3.4.x/docs/helpers/href.js +++ b/docs/3.4.x/docs/helpers/href.js @@ -1,4 +1,5 @@ +'use strict'; module.exports = exports = function (str, char) { if ('string' != typeof str) return str; return encodeURIComponent(str.replace(/\.js$/, '').replace(/\.|#/g, char || '-')); diff --git a/docs/3.4.x/docs/helpers/klass.js b/docs/3.4.x/docs/helpers/klass.js index 0c4a865b43..d2009b87c3 100644 --- a/docs/3.4.x/docs/helpers/klass.js +++ b/docs/3.4.x/docs/helpers/klass.js @@ -1,4 +1,5 @@ +'use strict'; module.exports = exports = function (str) { var parts = str.replace(/\.js$/, '').split('/'); return parts.join('_'); diff --git a/docs/3.4.x/docs/helpers/linktype.js b/docs/3.4.x/docs/helpers/linktype.js index 997e740f67..fc1ec39d48 100644 --- a/docs/3.4.x/docs/helpers/linktype.js +++ b/docs/3.4.x/docs/helpers/linktype.js @@ -1,4 +1,5 @@ +'use strict'; var types = {}; types.Object = 'https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object'; types.Boolean = 'https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean' diff --git a/docs/3.4.x/docs/js/cookies.min.js b/docs/3.4.x/docs/js/cookies.min.js index dc94dbc5bb..8f9c5b0cc5 100644 --- a/docs/3.4.x/docs/js/cookies.min.js +++ b/docs/3.4.x/docs/js/cookies.min.js @@ -1,4 +1,6 @@ /*! Cookies.js - 0.2.0; Copyright (c) 2012, Scott Hamper; http://www.opensource.org/licenses/MIT */ +'use strict'; + (function(f,e){var b=function(c,d,a){return 1===arguments.length?b.get(c):b.set(c,d,a)};b.get=function(c){f.cookie!==b._cacheString&&b._populateCache();return b._cache[c]};b.defaults={path:"/"};b.set=function(c,d,a){a={path:a&&a.path||b.defaults.path,domain:a&&a.domain||b.defaults.domain,expires:a&&a.expires||b.defaults.expires,secure:a&&a.secure!==e?a.secure:b.defaults.secure};d===e&&(a.expires=-1);switch(typeof a.expires){case "number":a.expires=new Date((new Date).getTime()+1E3*a.expires);break; case "string":a.expires=new Date(a.expires)}c=encodeURIComponent(c)+"="+(d+"").replace(/[^!#-+\--:<-[\]-~]/g,encodeURIComponent);c+=a.path?";path="+a.path:"";c+=a.domain?";domain="+a.domain:"";c+=a.expires?";expires="+a.expires.toGMTString():"";c+=a.secure?";secure":"";f.cookie=c;return b};b.expire=function(c,d){return b.set(c,e,d)};b._populateCache=function(){b._cache={};b._cacheString=f.cookie;for(var c=b._cacheString.split("; "),d=0;d>>0,e=0,f;if(typeof b!="function")throw new TypeError;if(d==0&&arguments.length==1)throw new TypeError;if(arguments.length>=2)f=arguments[1];else do{if(e in c){f=c[e++];break}if(++e>=d)throw new TypeError}while(!0);while(e0?[].concat.apply([],a):a}function H(a){return a.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function I(a){return a in i?i[a]:i[a]=new RegExp("(^|\\s)"+a+"(\\s|$)")}function J(a,b){return typeof b=="number"&&!k[H(a)]?b+"px":b}function K(a){var b,c;return h[a]||(b=g.createElement(a),g.body.appendChild(b),c=j(b,"").getPropertyValue("display"),b.parentNode.removeChild(b),c=="none"&&(c="block"),h[a]=c),h[a]}function L(b,d){return d===a?c(b):c(b).filter(d)}function M(a,b,c,d){return A(b)?b.call(a,c,d):b}function N(a,b,d){var e=a%2?b:b.parentNode;e?e.insertBefore(d,a?a==1?e.firstChild:a==2?b:null:b.nextSibling):c(d).remove()}function O(a,b){b(a);for(var c in a.childNodes)O(a.childNodes[c],b)}var a,b,c,d,e=[],f=e.slice,g=window.document,h={},i={},j=g.defaultView.getComputedStyle,k={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},l=/^\s*<(\w+|!)[^>]*>/,m=[1,3,8,9,11],n=["after","prepend","before","append"],o=g.createElement("table"),p=g.createElement("tr"),q={tr:g.createElement("tbody"),tbody:o,thead:o,tfoot:o,td:p,th:p,"*":g.createElement("div")},r=/complete|loaded|interactive/,s=/^\.([\w-]+)$/,t=/^#([\w-]+)$/,u=/^[\w-]+$/,v={}.toString,w={},x,y,z=g.createElement("div");return w.matches=function(a,b){if(!a||a.nodeType!==1)return!1;var c=a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.matchesSelector;if(c)return c.call(a,b);var d,e=a.parentNode,f=!e;return f&&(e=z).appendChild(a),d=~w.qsa(e,b).indexOf(a),f&&z.removeChild(a),d},x=function(a){return a.replace(/-+(.)?/g,function(a,b){return b?b.toUpperCase():""})},y=function(a){return a.filter(function(b,c){return a.indexOf(b)==c})},w.fragment=function(b,d){d===a&&(d=l.test(b)&&RegExp.$1),d in q||(d="*");var e=q[d];return e.innerHTML=""+b,c.each(f.call(e.childNodes),function(){e.removeChild(this)})},w.Z=function(a,b){return a=a||[],a.__proto__=arguments.callee.prototype,a.selector=b||"",a},w.isZ=function(a){return a instanceof w.Z},w.init=function(b,d){if(!b)return w.Z();if(A(b))return c(g).ready(b);if(w.isZ(b))return b;var e;if(D(b))e=F(b);else if(C(b))e=[c.extend({},b)],b=null;else if(m.indexOf(b.nodeType)>=0||b===window)e=[b],b=null;else if(l.test(b))e=w.fragment(b.trim(),RegExp.$1),b=null;else{if(d!==a)return c(d).find(b);e=w.qsa(g,b)}return w.Z(e,b)},c=function(a,b){return w.init(a,b)},c.extend=function(c){return f.call(arguments,1).forEach(function(d){for(b in d)d[b]!==a&&(c[b]=d[b])}),c},w.qsa=function(a,b){var c;return a===g&&t.test(b)?(c=a.getElementById(RegExp.$1))?[c]:e:a.nodeType!==1&&a.nodeType!==9?e:f.call(s.test(b)?a.getElementsByClassName(RegExp.$1):u.test(b)?a.getElementsByTagName(b):a.querySelectorAll(b))},c.isFunction=A,c.isObject=B,c.isArray=D,c.isPlainObject=C,c.inArray=function(a,b,c){return e.indexOf.call(b,a,c)},c.trim=function(a){return a.trim()},c.uuid=0,c.map=function(a,b){var c,d=[],e,f;if(E(a))for(e=0;e0&&w.matches(this[0],a)},not:function(b){var d=[];if(A(b)&&b.call!==a)this.each(function(a){b.call(this,a)||d.push(this)});else{var e=typeof b=="string"?this.filter(b):E(b)&&A(b.item)?f.call(b):c(b);this.forEach(function(a){e.indexOf(a)<0&&d.push(a)})}return c(d)},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){var a=this[0];return a&&!B(a)?a:c(a)},last:function(){var a=this[this.length-1];return a&&!B(a)?a:c(a)},find:function(a){var b;return this.length==1?b=w.qsa(this[0],a):b=this.map(function(){return w.qsa(this,a)}),c(b)},closest:function(a,b){var d=this[0];while(d&&!w.matches(d,a))d=d!==b&&d!==g&&d.parentNode;return c(d)},parents:function(a){var b=[],d=this;while(d.length>0)d=c.map(d,function(a){if((a=a.parentNode)&&a!==g&&b.indexOf(a)<0)return b.push(a),a});return L(b,a)},parent:function(a){return L(y(this.pluck("parentNode")),a)},children:function(a){return L(this.map(function(){return f.call(this.children)}),a)},siblings:function(a){return L(this.map(function(a,b){return f.call(b.parentNode.children).filter(function(a){return a!==b})}),a)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(a){return this.map(function(){return this[a]})},show:function(){return this.each(function(){this.style.display=="none"&&(this.style.display=null),j(this,"").getPropertyValue("display")=="none"&&(this.style.display=K(this.nodeName))})},replaceWith:function(a){return this.before(a).remove()},wrap:function(a){return this.each(function(){c(this).wrapAll(c(a)[0].cloneNode(!1))})},wrapAll:function(a){return this[0]&&(c(this[0]).before(a=c(a)),a.append(this)),this},unwrap:function(){return this.parent().each(function(){c(this).replaceWith(c(this).children())}),this},clone:function(){return c(this.map(function(){return this.cloneNode(!0)}))},hide:function(){return this.css("display","none")},toggle:function(b){return(b===a?this.css("display")=="none":b)?this.show():this.hide()},prev:function(){return c(this.pluck("previousElementSibling"))},next:function(){return c(this.pluck("nextElementSibling"))},html:function(b){return b===a?this.length>0?this[0].innerHTML:null:this.each(function(a){var d=this.innerHTML;c(this).empty().append(M(this,b,a,d))})},text:function(b){return b===a?this.length>0?this[0].textContent:null:this.each(function(){this.textContent=b})},attr:function(c,d){var e;return typeof c=="string"&&d===a?this.length==0||this[0].nodeType!==1?a:c=="value"&&this[0].nodeName=="INPUT"?this.val():!(e=this[0].getAttribute(c))&&c in this[0]?this[0][c]:e:this.each(function(a){if(this.nodeType!==1)return;if(B(c))for(b in c)this.setAttribute(b,c[b]);else this.setAttribute(c,M(this,d,a,this.getAttribute(c)))})},removeAttr:function(a){return this.each(function(){this.nodeType===1&&this.removeAttribute(a)})},prop:function(b,c){return c===a?this[0]?this[0][b]:a:this.each(function(a){this[b]=M(this,c,a,this[b])})},data:function(b,c){var d=this.attr("data-"+H(b),c);return d!==null?d:a},val:function(b){return b===a?this.length>0?this[0].value:a:this.each(function(a){this.value=M(this,b,a,this.value)})},offset:function(){if(this.length==0)return null;var a=this[0].getBoundingClientRect();return{left:a.left+window.pageXOffset,top:a.top+window.pageYOffset,width:a.width,height:a.height}},css:function(c,d){if(d===a&&typeof c=="string")return this.length==0?a:this[0].style[x(c)]||j(this[0],"").getPropertyValue(c);var e="";for(b in c)typeof c[b]=="string"&&c[b]==""?this.each(function(){this.style.removeProperty(H(b))}):e+=H(b)+":"+J(b,c[b])+";";return typeof c=="string"&&(d==""?this.each(function(){this.style.removeProperty(H(c))}):e=H(c)+":"+J(c,d)),this.each(function(){this.style.cssText+=";"+e})},index:function(a){return a?this.indexOf(c(a)[0]):this.parent().children().indexOf(this[0])},hasClass:function(a){return this.length<1?!1:I(a).test(this[0].className)},addClass:function(a){return this.each(function(b){d=[];var e=this.className,f=M(this,a,b,e);f.split(/\s+/g).forEach(function(a){c(this).hasClass(a)||d.push(a)},this),d.length&&(this.className+=(e?" ":"")+d.join(" "))})},removeClass:function(b){return this.each(function(c){if(b===a)return this.className="";d=this.className,M(this,b,c,d).split(/\s+/g).forEach(function(a){d=d.replace(I(a)," ")}),this.className=d.trim()})},toggleClass:function(b,d){return this.each(function(e){var f=M(this,b,e,this.className);(d===a?!c(this).hasClass(f):d)?c(this).addClass(f):c(this).removeClass(f)})}},["width","height"].forEach(function(b){c.fn[b]=function(d){var e,f=b.replace(/./,function(a){return a[0].toUpperCase()});return d===a?this[0]==window?window["inner"+f]:this[0]==g?g.documentElement["offset"+f]:(e=this.offset())&&e[b]:this.each(function(a){var e=c(this);e.css(b,M(this,d,a,e[b]()))})}}),n.forEach(function(a,b){c.fn[a]=function(){var a=c.map(arguments,function(a){return B(a)?a:w.fragment(a)});if(a.length<1)return this;var d=this.length,e=d>1,f=b<2;return this.each(function(c,g){for(var h=0;h0&&this.bind(o,n),setTimeout(function(){m.css(i),e<=0&&setTimeout(function(){m.each(function(){n.call(this)})},0)},0),this},i=null}(Zepto),function($){function triggerAndReturn(a,b,c){var d=$.Event(b);return $(a).trigger(d,c),!d.defaultPrevented}function triggerGlobal(a,b,c,d){if(a.global)return triggerAndReturn(b||document,c,d)}function ajaxStart(a){a.global&&$.active++===0&&triggerGlobal(a,null,"ajaxStart")}function ajaxStop(a){a.global&&!--$.active&&triggerGlobal(a,null,"ajaxStop")}function ajaxBeforeSend(a,b){var c=b.context;if(b.beforeSend.call(c,a,b)===!1||triggerGlobal(b,c,"ajaxBeforeSend",[a,b])===!1)return!1;triggerGlobal(b,c,"ajaxSend",[a,b])}function ajaxSuccess(a,b,c){var d=c.context,e="success";c.success.call(d,a,e,b),triggerGlobal(c,d,"ajaxSuccess",[b,c,a]),ajaxComplete(e,b,c)}function ajaxError(a,b,c,d){var e=d.context;d.error.call(e,c,b,a),triggerGlobal(d,e,"ajaxError",[c,d,a]),ajaxComplete(b,c,d)}function ajaxComplete(a,b,c){var d=c.context;c.complete.call(d,b,a),triggerGlobal(c,d,"ajaxComplete",[b,c]),ajaxStop(c)}function empty(){}function mimeToDataType(a){return a&&(a==htmlType?"html":a==jsonType?"json":scriptTypeRE.test(a)?"script":xmlTypeRE.test(a)&&"xml")||"text"}function appendQuery(a,b){return(a+"&"+b).replace(/[&?]{1,2}/,"?")}function serializeData(a){isObject(a.data)&&(a.data=$.param(a.data)),a.data&&(!a.type||a.type.toUpperCase()=="GET")&&(a.url=appendQuery(a.url,a.data))}function serialize(a,b,c,d){var e=$.isArray(b);$.each(b,function(b,f){d&&(b=c?d:d+"["+(e?"":b)+"]"),!d&&e?a.add(f.name,f.value):(c?$.isArray(f):isObject(f))?serialize(a,f,c,b):a.add(b,f)})}var jsonpID=0,isObject=$.isObject,document=window.document,key,name,rscript=/)<[^<]*)*<\/script>/gi,scriptTypeRE=/^(?:text|application)\/javascript/i,xmlTypeRE=/^(?:text|application)\/xml/i,jsonType="application/json",htmlType="text/html",blankRE=/^\s*$/;$.active=0,$.ajaxJSONP=function(a){var b="jsonp"+ ++jsonpID,c=document.createElement("script"),d=function(){$(c).remove(),b in window&&(window[b]=empty),ajaxComplete("abort",e,a)},e={abort:d},f;return a.error&&(c.onerror=function(){e.abort(),a.error()}),window[b]=function(d){clearTimeout(f),$(c).remove(),delete window[b],ajaxSuccess(d,e,a)},serializeData(a),c.src=a.url.replace(/=\?/,"="+b),$("head").append(c),a.timeout>0&&(f=setTimeout(function(){e.abort(),ajaxComplete("timeout",e,a)},a.timeout)),e},$.ajaxSettings={type:"GET",beforeSend:empty,success:empty,error:empty,complete:empty,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript",json:jsonType,xml:"application/xml, text/xml",html:htmlType,text:"text/plain"},crossDomain:!1,timeout:0},$.ajax=function(options){var settings=$.extend({},options||{});for(key in $.ajaxSettings)settings[key]===undefined&&(settings[key]=$.ajaxSettings[key]);ajaxStart(settings),settings.crossDomain||(settings.crossDomain=/^([\w-]+:)?\/\/([^\/]+)/.test(settings.url)&&RegExp.$2!=window.location.host);var dataType=settings.dataType,hasPlaceholder=/=\?/.test(settings.url);if(dataType=="jsonp"||hasPlaceholder)return hasPlaceholder||(settings.url=appendQuery(settings.url,"callback=?")),$.ajaxJSONP(settings);settings.url||(settings.url=window.location.toString()),serializeData(settings);var mime=settings.accepts[dataType],baseHeaders={},protocol=/^([\w-]+:)\/\//.test(settings.url)?RegExp.$1:window.location.protocol,xhr=$.ajaxSettings.xhr(),abortTimeout;settings.crossDomain||(baseHeaders["X-Requested-With"]="XMLHttpRequest"),mime&&(baseHeaders.Accept=mime,mime.indexOf(",")>-1&&(mime=mime.split(",",2)[0]),xhr.overrideMimeType&&xhr.overrideMimeType(mime));if(settings.contentType||settings.data&&settings.type.toUpperCase()!="GET")baseHeaders["Content-Type"]=settings.contentType||"application/x-www-form-urlencoded";settings.headers=$.extend(baseHeaders,settings.headers||{}),xhr.onreadystatechange=function(){if(xhr.readyState==4){clearTimeout(abortTimeout);var result,error=!1;if(xhr.status>=200&&xhr.status<300||xhr.status==304||xhr.status==0&&protocol=="file:"){dataType=dataType||mimeToDataType(xhr.getResponseHeader("content-type")),result=xhr.responseText;try{dataType=="script"?(1,eval)(result):dataType=="xml"?result=xhr.responseXML:dataType=="json"&&(result=blankRE.test(result)?null:JSON.parse(result))}catch(e){error=e}error?ajaxError(error,"parsererror",xhr,settings):ajaxSuccess(result,xhr,settings)}else ajaxError(null,"error",xhr,settings)}};var async="async"in settings?settings.async:!0;xhr.open(settings.type,settings.url,async);for(name in settings.headers)xhr.setRequestHeader(name,settings.headers[name]);return ajaxBeforeSend(xhr,settings)===!1?(xhr.abort(),!1):(settings.timeout>0&&(abortTimeout=setTimeout(function(){xhr.onreadystatechange=empty,xhr.abort(),ajaxError(null,"timeout",xhr,settings)},settings.timeout)),xhr.send(settings.data?settings.data:null),xhr)},$.get=function(a,b){return $.ajax({url:a,success:b})},$.post=function(a,b,c,d){return $.isFunction(b)&&(d=d||c,c=b,b=null),$.ajax({type:"POST",url:a,data:b,success:c,dataType:d})},$.getJSON=function(a,b){return $.ajax({url:a,success:b,dataType:"json"})},$.fn.load=function(a,b){if(!this.length)return this;var c=this,d=a.split(/\s/),e;return d.length>1&&(a=d[0],e=d[1]),$.get(a,function(a){c.html(e?$(document.createElement("div")).html(a.replace(rscript,"")).find(e).html():a),b&&b.call(c)}),this};var escape=encodeURIComponent;$.param=function(a,b){var c=[];return c.add=function(a,b){this.push(escape(a)+"="+escape(b))},serialize(c,a,b),c.join("&").replace("%20","+")}}(Zepto),function(a){a.fn.serializeArray=function(){var b=[],c;return a(Array.prototype.slice.call(this.get(0).elements)).each(function(){c=a(this);var d=c.attr("type");this.nodeName.toLowerCase()!="fieldset"&&!this.disabled&&d!="submit"&&d!="reset"&&d!="button"&&(d!="radio"&&d!="checkbox"||this.checked)&&b.push({name:c.attr("name"),value:c.val()})}),b},a.fn.serialize=function(){var a=[];return this.serializeArray().forEach(function(b){a.push(encodeURIComponent(b.name)+"="+encodeURIComponent(b.value))}),a.join("&")},a.fn.submit=function(b){if(b)this.bind("submit",b);else if(this.length){var c=a.Event("submit");this.eq(0).trigger(c),c.defaultPrevented||this.get(0).submit()}return this}}(Zepto),function(a){function d(a){return"tagName"in a?a:a.parentNode}function e(a,b,c,d){var e=Math.abs(a-b),f=Math.abs(c-d);return e>=f?a-b>0?"Left":"Right":c-d>0?"Up":"Down"}function h(){g=null,b.last&&(b.el.trigger("longTap"),b={})}function i(){g&&clearTimeout(g),g=null}var b={},c,f=750,g;a(document).ready(function(){var j,k;a(document.body).bind("touchstart",function(e){j=Date.now(),k=j-(b.last||j),b.el=a(d(e.touches[0].target)),c&&clearTimeout(c),b.x1=e.touches[0].pageX,b.y1=e.touches[0].pageY,k>0&&k<=250&&(b.isDoubleTap=!0),b.last=j,g=setTimeout(h,f)}).bind("touchmove",function(a){i(),b.x2=a.touches[0].pageX,b.y2=a.touches[0].pageY}).bind("touchend",function(a){i(),b.isDoubleTap?(b.el.trigger("doubleTap"),b={}):b.x2&&Math.abs(b.x1-b.x2)>30||b.y2&&Math.abs(b.y1-b.y2)>30?(b.el.trigger("swipe")&&b.el.trigger("swipe"+e(b.x1,b.x2,b.y1,b.y2)),b={}):"last"in b&&(b.el.trigger("tap"),c=setTimeout(function(){c=null,b.el.trigger("singleTap"),b={}},250))}).bind("touchcancel",function(){c&&clearTimeout(c),g&&clearTimeout(g),g=c=null,b={}})}),["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap","singleTap","longTap"].forEach(function(b){a.fn[b]=function(a){return this.bind(b,a)}})}(Zepto); \ No newline at end of file diff --git a/docs/3.4.x/docs/source/api.js b/docs/3.4.x/docs/source/api.js index 8fd87f0035..cadfbe41d1 100644 --- a/docs/3.4.x/docs/source/api.js +++ b/docs/3.4.x/docs/source/api.js @@ -2,6 +2,8 @@ * Module dependencies */ +'use strict'; + var fs = require('fs'); var link = require('../helpers/linktype'); var hl = require('highlight.js') diff --git a/docs/3.4.x/docs/source/index.js b/docs/3.4.x/docs/source/index.js index 18b3eeb571..82921f05ee 100644 --- a/docs/3.4.x/docs/source/index.js +++ b/docs/3.4.x/docs/source/index.js @@ -1,4 +1,5 @@ +'use strict'; exports['index.jade'] = require('./home') exports['docs/api.jade'] = require('./api') exports['docs/index.jade'] = { title: 'Getting Started' } diff --git a/docs/3.4.x/docs/source/prior.js b/docs/3.4.x/docs/source/prior.js index 2e03811d21..b10cf31086 100644 --- a/docs/3.4.x/docs/source/prior.js +++ b/docs/3.4.x/docs/source/prior.js @@ -1,3 +1,4 @@ +'use strict'; var fs = require('fs') var releases = fs.readFileSync(__dirname + '/../releases', 'utf8'); releases = releases.split('\n').filter(Boolean); diff --git a/docs/3.4.x/docs/source/production.js b/docs/3.4.x/docs/source/production.js index 9fdbcfffbc..1b2bfcbd32 100644 --- a/docs/3.4.x/docs/source/production.js +++ b/docs/3.4.x/docs/source/production.js @@ -1,4 +1,5 @@ +'use strict'; var fs = require('fs') var images = fs.readFileSync(__dirname + '/../images/apps/urls', 'utf-8').split('\n'); diff --git a/docs/3.5.x/docs/helpers/filters.js b/docs/3.5.x/docs/helpers/filters.js index 33546a7e80..95ff08931d 100644 --- a/docs/3.5.x/docs/helpers/filters.js +++ b/docs/3.5.x/docs/helpers/filters.js @@ -1,4 +1,5 @@ +'use strict'; var hl = require('highlight.js') module.exports = exports = function (jade) { diff --git a/docs/3.5.x/docs/helpers/highlight.js b/docs/3.5.x/docs/helpers/highlight.js index 8aca9b9e22..e9f850d131 100644 --- a/docs/3.5.x/docs/helpers/highlight.js +++ b/docs/3.5.x/docs/helpers/highlight.js @@ -1,4 +1,5 @@ +'use strict'; var h = require('highlight.js') function hl (str) { diff --git a/docs/3.5.x/docs/helpers/href.js b/docs/3.5.x/docs/helpers/href.js index e6d6568b12..c36746ebba 100644 --- a/docs/3.5.x/docs/helpers/href.js +++ b/docs/3.5.x/docs/helpers/href.js @@ -1,4 +1,5 @@ +'use strict'; module.exports = exports = function (str, char) { if ('string' != typeof str) return str; return encodeURIComponent( diff --git a/docs/3.5.x/docs/helpers/klass.js b/docs/3.5.x/docs/helpers/klass.js index 0c4a865b43..d2009b87c3 100644 --- a/docs/3.5.x/docs/helpers/klass.js +++ b/docs/3.5.x/docs/helpers/klass.js @@ -1,4 +1,5 @@ +'use strict'; module.exports = exports = function (str) { var parts = str.replace(/\.js$/, '').split('/'); return parts.join('_'); diff --git a/docs/3.5.x/docs/helpers/linktype.js b/docs/3.5.x/docs/helpers/linktype.js index 997e740f67..fc1ec39d48 100644 --- a/docs/3.5.x/docs/helpers/linktype.js +++ b/docs/3.5.x/docs/helpers/linktype.js @@ -1,4 +1,5 @@ +'use strict'; var types = {}; types.Object = 'https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object'; types.Boolean = 'https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean' diff --git a/docs/3.5.x/docs/js/cookies.min.js b/docs/3.5.x/docs/js/cookies.min.js index dc94dbc5bb..8f9c5b0cc5 100644 --- a/docs/3.5.x/docs/js/cookies.min.js +++ b/docs/3.5.x/docs/js/cookies.min.js @@ -1,4 +1,6 @@ /*! Cookies.js - 0.2.0; Copyright (c) 2012, Scott Hamper; http://www.opensource.org/licenses/MIT */ +'use strict'; + (function(f,e){var b=function(c,d,a){return 1===arguments.length?b.get(c):b.set(c,d,a)};b.get=function(c){f.cookie!==b._cacheString&&b._populateCache();return b._cache[c]};b.defaults={path:"/"};b.set=function(c,d,a){a={path:a&&a.path||b.defaults.path,domain:a&&a.domain||b.defaults.domain,expires:a&&a.expires||b.defaults.expires,secure:a&&a.secure!==e?a.secure:b.defaults.secure};d===e&&(a.expires=-1);switch(typeof a.expires){case "number":a.expires=new Date((new Date).getTime()+1E3*a.expires);break; case "string":a.expires=new Date(a.expires)}c=encodeURIComponent(c)+"="+(d+"").replace(/[^!#-+\--:<-[\]-~]/g,encodeURIComponent);c+=a.path?";path="+a.path:"";c+=a.domain?";domain="+a.domain:"";c+=a.expires?";expires="+a.expires.toGMTString():"";c+=a.secure?";secure":"";f.cookie=c;return b};b.expire=function(c,d){return b.set(c,e,d)};b._populateCache=function(){b._cache={};b._cacheString=f.cookie;for(var c=b._cacheString.split("; "),d=0;d>>0,e=0,f;if(typeof b!="function")throw new TypeError;if(d==0&&arguments.length==1)throw new TypeError;if(arguments.length>=2)f=arguments[1];else do{if(e in c){f=c[e++];break}if(++e>=d)throw new TypeError}while(!0);while(e0?[].concat.apply([],a):a}function H(a){return a.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function I(a){return a in i?i[a]:i[a]=new RegExp("(^|\\s)"+a+"(\\s|$)")}function J(a,b){return typeof b=="number"&&!k[H(a)]?b+"px":b}function K(a){var b,c;return h[a]||(b=g.createElement(a),g.body.appendChild(b),c=j(b,"").getPropertyValue("display"),b.parentNode.removeChild(b),c=="none"&&(c="block"),h[a]=c),h[a]}function L(b,d){return d===a?c(b):c(b).filter(d)}function M(a,b,c,d){return A(b)?b.call(a,c,d):b}function N(a,b,d){var e=a%2?b:b.parentNode;e?e.insertBefore(d,a?a==1?e.firstChild:a==2?b:null:b.nextSibling):c(d).remove()}function O(a,b){b(a);for(var c in a.childNodes)O(a.childNodes[c],b)}var a,b,c,d,e=[],f=e.slice,g=window.document,h={},i={},j=g.defaultView.getComputedStyle,k={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},l=/^\s*<(\w+|!)[^>]*>/,m=[1,3,8,9,11],n=["after","prepend","before","append"],o=g.createElement("table"),p=g.createElement("tr"),q={tr:g.createElement("tbody"),tbody:o,thead:o,tfoot:o,td:p,th:p,"*":g.createElement("div")},r=/complete|loaded|interactive/,s=/^\.([\w-]+)$/,t=/^#([\w-]+)$/,u=/^[\w-]+$/,v={}.toString,w={},x,y,z=g.createElement("div");return w.matches=function(a,b){if(!a||a.nodeType!==1)return!1;var c=a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.matchesSelector;if(c)return c.call(a,b);var d,e=a.parentNode,f=!e;return f&&(e=z).appendChild(a),d=~w.qsa(e,b).indexOf(a),f&&z.removeChild(a),d},x=function(a){return a.replace(/-+(.)?/g,function(a,b){return b?b.toUpperCase():""})},y=function(a){return a.filter(function(b,c){return a.indexOf(b)==c})},w.fragment=function(b,d){d===a&&(d=l.test(b)&&RegExp.$1),d in q||(d="*");var e=q[d];return e.innerHTML=""+b,c.each(f.call(e.childNodes),function(){e.removeChild(this)})},w.Z=function(a,b){return a=a||[],a.__proto__=arguments.callee.prototype,a.selector=b||"",a},w.isZ=function(a){return a instanceof w.Z},w.init=function(b,d){if(!b)return w.Z();if(A(b))return c(g).ready(b);if(w.isZ(b))return b;var e;if(D(b))e=F(b);else if(C(b))e=[c.extend({},b)],b=null;else if(m.indexOf(b.nodeType)>=0||b===window)e=[b],b=null;else if(l.test(b))e=w.fragment(b.trim(),RegExp.$1),b=null;else{if(d!==a)return c(d).find(b);e=w.qsa(g,b)}return w.Z(e,b)},c=function(a,b){return w.init(a,b)},c.extend=function(c){return f.call(arguments,1).forEach(function(d){for(b in d)d[b]!==a&&(c[b]=d[b])}),c},w.qsa=function(a,b){var c;return a===g&&t.test(b)?(c=a.getElementById(RegExp.$1))?[c]:e:a.nodeType!==1&&a.nodeType!==9?e:f.call(s.test(b)?a.getElementsByClassName(RegExp.$1):u.test(b)?a.getElementsByTagName(b):a.querySelectorAll(b))},c.isFunction=A,c.isObject=B,c.isArray=D,c.isPlainObject=C,c.inArray=function(a,b,c){return e.indexOf.call(b,a,c)},c.trim=function(a){return a.trim()},c.uuid=0,c.map=function(a,b){var c,d=[],e,f;if(E(a))for(e=0;e0&&w.matches(this[0],a)},not:function(b){var d=[];if(A(b)&&b.call!==a)this.each(function(a){b.call(this,a)||d.push(this)});else{var e=typeof b=="string"?this.filter(b):E(b)&&A(b.item)?f.call(b):c(b);this.forEach(function(a){e.indexOf(a)<0&&d.push(a)})}return c(d)},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){var a=this[0];return a&&!B(a)?a:c(a)},last:function(){var a=this[this.length-1];return a&&!B(a)?a:c(a)},find:function(a){var b;return this.length==1?b=w.qsa(this[0],a):b=this.map(function(){return w.qsa(this,a)}),c(b)},closest:function(a,b){var d=this[0];while(d&&!w.matches(d,a))d=d!==b&&d!==g&&d.parentNode;return c(d)},parents:function(a){var b=[],d=this;while(d.length>0)d=c.map(d,function(a){if((a=a.parentNode)&&a!==g&&b.indexOf(a)<0)return b.push(a),a});return L(b,a)},parent:function(a){return L(y(this.pluck("parentNode")),a)},children:function(a){return L(this.map(function(){return f.call(this.children)}),a)},siblings:function(a){return L(this.map(function(a,b){return f.call(b.parentNode.children).filter(function(a){return a!==b})}),a)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(a){return this.map(function(){return this[a]})},show:function(){return this.each(function(){this.style.display=="none"&&(this.style.display=null),j(this,"").getPropertyValue("display")=="none"&&(this.style.display=K(this.nodeName))})},replaceWith:function(a){return this.before(a).remove()},wrap:function(a){return this.each(function(){c(this).wrapAll(c(a)[0].cloneNode(!1))})},wrapAll:function(a){return this[0]&&(c(this[0]).before(a=c(a)),a.append(this)),this},unwrap:function(){return this.parent().each(function(){c(this).replaceWith(c(this).children())}),this},clone:function(){return c(this.map(function(){return this.cloneNode(!0)}))},hide:function(){return this.css("display","none")},toggle:function(b){return(b===a?this.css("display")=="none":b)?this.show():this.hide()},prev:function(){return c(this.pluck("previousElementSibling"))},next:function(){return c(this.pluck("nextElementSibling"))},html:function(b){return b===a?this.length>0?this[0].innerHTML:null:this.each(function(a){var d=this.innerHTML;c(this).empty().append(M(this,b,a,d))})},text:function(b){return b===a?this.length>0?this[0].textContent:null:this.each(function(){this.textContent=b})},attr:function(c,d){var e;return typeof c=="string"&&d===a?this.length==0||this[0].nodeType!==1?a:c=="value"&&this[0].nodeName=="INPUT"?this.val():!(e=this[0].getAttribute(c))&&c in this[0]?this[0][c]:e:this.each(function(a){if(this.nodeType!==1)return;if(B(c))for(b in c)this.setAttribute(b,c[b]);else this.setAttribute(c,M(this,d,a,this.getAttribute(c)))})},removeAttr:function(a){return this.each(function(){this.nodeType===1&&this.removeAttribute(a)})},prop:function(b,c){return c===a?this[0]?this[0][b]:a:this.each(function(a){this[b]=M(this,c,a,this[b])})},data:function(b,c){var d=this.attr("data-"+H(b),c);return d!==null?d:a},val:function(b){return b===a?this.length>0?this[0].value:a:this.each(function(a){this.value=M(this,b,a,this.value)})},offset:function(){if(this.length==0)return null;var a=this[0].getBoundingClientRect();return{left:a.left+window.pageXOffset,top:a.top+window.pageYOffset,width:a.width,height:a.height}},css:function(c,d){if(d===a&&typeof c=="string")return this.length==0?a:this[0].style[x(c)]||j(this[0],"").getPropertyValue(c);var e="";for(b in c)typeof c[b]=="string"&&c[b]==""?this.each(function(){this.style.removeProperty(H(b))}):e+=H(b)+":"+J(b,c[b])+";";return typeof c=="string"&&(d==""?this.each(function(){this.style.removeProperty(H(c))}):e=H(c)+":"+J(c,d)),this.each(function(){this.style.cssText+=";"+e})},index:function(a){return a?this.indexOf(c(a)[0]):this.parent().children().indexOf(this[0])},hasClass:function(a){return this.length<1?!1:I(a).test(this[0].className)},addClass:function(a){return this.each(function(b){d=[];var e=this.className,f=M(this,a,b,e);f.split(/\s+/g).forEach(function(a){c(this).hasClass(a)||d.push(a)},this),d.length&&(this.className+=(e?" ":"")+d.join(" "))})},removeClass:function(b){return this.each(function(c){if(b===a)return this.className="";d=this.className,M(this,b,c,d).split(/\s+/g).forEach(function(a){d=d.replace(I(a)," ")}),this.className=d.trim()})},toggleClass:function(b,d){return this.each(function(e){var f=M(this,b,e,this.className);(d===a?!c(this).hasClass(f):d)?c(this).addClass(f):c(this).removeClass(f)})}},["width","height"].forEach(function(b){c.fn[b]=function(d){var e,f=b.replace(/./,function(a){return a[0].toUpperCase()});return d===a?this[0]==window?window["inner"+f]:this[0]==g?g.documentElement["offset"+f]:(e=this.offset())&&e[b]:this.each(function(a){var e=c(this);e.css(b,M(this,d,a,e[b]()))})}}),n.forEach(function(a,b){c.fn[a]=function(){var a=c.map(arguments,function(a){return B(a)?a:w.fragment(a)});if(a.length<1)return this;var d=this.length,e=d>1,f=b<2;return this.each(function(c,g){for(var h=0;h0&&this.bind(o,n),setTimeout(function(){m.css(i),e<=0&&setTimeout(function(){m.each(function(){n.call(this)})},0)},0),this},i=null}(Zepto),function($){function triggerAndReturn(a,b,c){var d=$.Event(b);return $(a).trigger(d,c),!d.defaultPrevented}function triggerGlobal(a,b,c,d){if(a.global)return triggerAndReturn(b||document,c,d)}function ajaxStart(a){a.global&&$.active++===0&&triggerGlobal(a,null,"ajaxStart")}function ajaxStop(a){a.global&&!--$.active&&triggerGlobal(a,null,"ajaxStop")}function ajaxBeforeSend(a,b){var c=b.context;if(b.beforeSend.call(c,a,b)===!1||triggerGlobal(b,c,"ajaxBeforeSend",[a,b])===!1)return!1;triggerGlobal(b,c,"ajaxSend",[a,b])}function ajaxSuccess(a,b,c){var d=c.context,e="success";c.success.call(d,a,e,b),triggerGlobal(c,d,"ajaxSuccess",[b,c,a]),ajaxComplete(e,b,c)}function ajaxError(a,b,c,d){var e=d.context;d.error.call(e,c,b,a),triggerGlobal(d,e,"ajaxError",[c,d,a]),ajaxComplete(b,c,d)}function ajaxComplete(a,b,c){var d=c.context;c.complete.call(d,b,a),triggerGlobal(c,d,"ajaxComplete",[b,c]),ajaxStop(c)}function empty(){}function mimeToDataType(a){return a&&(a==htmlType?"html":a==jsonType?"json":scriptTypeRE.test(a)?"script":xmlTypeRE.test(a)&&"xml")||"text"}function appendQuery(a,b){return(a+"&"+b).replace(/[&?]{1,2}/,"?")}function serializeData(a){isObject(a.data)&&(a.data=$.param(a.data)),a.data&&(!a.type||a.type.toUpperCase()=="GET")&&(a.url=appendQuery(a.url,a.data))}function serialize(a,b,c,d){var e=$.isArray(b);$.each(b,function(b,f){d&&(b=c?d:d+"["+(e?"":b)+"]"),!d&&e?a.add(f.name,f.value):(c?$.isArray(f):isObject(f))?serialize(a,f,c,b):a.add(b,f)})}var jsonpID=0,isObject=$.isObject,document=window.document,key,name,rscript=/)<[^<]*)*<\/script>/gi,scriptTypeRE=/^(?:text|application)\/javascript/i,xmlTypeRE=/^(?:text|application)\/xml/i,jsonType="application/json",htmlType="text/html",blankRE=/^\s*$/;$.active=0,$.ajaxJSONP=function(a){var b="jsonp"+ ++jsonpID,c=document.createElement("script"),d=function(){$(c).remove(),b in window&&(window[b]=empty),ajaxComplete("abort",e,a)},e={abort:d},f;return a.error&&(c.onerror=function(){e.abort(),a.error()}),window[b]=function(d){clearTimeout(f),$(c).remove(),delete window[b],ajaxSuccess(d,e,a)},serializeData(a),c.src=a.url.replace(/=\?/,"="+b),$("head").append(c),a.timeout>0&&(f=setTimeout(function(){e.abort(),ajaxComplete("timeout",e,a)},a.timeout)),e},$.ajaxSettings={type:"GET",beforeSend:empty,success:empty,error:empty,complete:empty,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript",json:jsonType,xml:"application/xml, text/xml",html:htmlType,text:"text/plain"},crossDomain:!1,timeout:0},$.ajax=function(options){var settings=$.extend({},options||{});for(key in $.ajaxSettings)settings[key]===undefined&&(settings[key]=$.ajaxSettings[key]);ajaxStart(settings),settings.crossDomain||(settings.crossDomain=/^([\w-]+:)?\/\/([^\/]+)/.test(settings.url)&&RegExp.$2!=window.location.host);var dataType=settings.dataType,hasPlaceholder=/=\?/.test(settings.url);if(dataType=="jsonp"||hasPlaceholder)return hasPlaceholder||(settings.url=appendQuery(settings.url,"callback=?")),$.ajaxJSONP(settings);settings.url||(settings.url=window.location.toString()),serializeData(settings);var mime=settings.accepts[dataType],baseHeaders={},protocol=/^([\w-]+:)\/\//.test(settings.url)?RegExp.$1:window.location.protocol,xhr=$.ajaxSettings.xhr(),abortTimeout;settings.crossDomain||(baseHeaders["X-Requested-With"]="XMLHttpRequest"),mime&&(baseHeaders.Accept=mime,mime.indexOf(",")>-1&&(mime=mime.split(",",2)[0]),xhr.overrideMimeType&&xhr.overrideMimeType(mime));if(settings.contentType||settings.data&&settings.type.toUpperCase()!="GET")baseHeaders["Content-Type"]=settings.contentType||"application/x-www-form-urlencoded";settings.headers=$.extend(baseHeaders,settings.headers||{}),xhr.onreadystatechange=function(){if(xhr.readyState==4){clearTimeout(abortTimeout);var result,error=!1;if(xhr.status>=200&&xhr.status<300||xhr.status==304||xhr.status==0&&protocol=="file:"){dataType=dataType||mimeToDataType(xhr.getResponseHeader("content-type")),result=xhr.responseText;try{dataType=="script"?(1,eval)(result):dataType=="xml"?result=xhr.responseXML:dataType=="json"&&(result=blankRE.test(result)?null:JSON.parse(result))}catch(e){error=e}error?ajaxError(error,"parsererror",xhr,settings):ajaxSuccess(result,xhr,settings)}else ajaxError(null,"error",xhr,settings)}};var async="async"in settings?settings.async:!0;xhr.open(settings.type,settings.url,async);for(name in settings.headers)xhr.setRequestHeader(name,settings.headers[name]);return ajaxBeforeSend(xhr,settings)===!1?(xhr.abort(),!1):(settings.timeout>0&&(abortTimeout=setTimeout(function(){xhr.onreadystatechange=empty,xhr.abort(),ajaxError(null,"timeout",xhr,settings)},settings.timeout)),xhr.send(settings.data?settings.data:null),xhr)},$.get=function(a,b){return $.ajax({url:a,success:b})},$.post=function(a,b,c,d){return $.isFunction(b)&&(d=d||c,c=b,b=null),$.ajax({type:"POST",url:a,data:b,success:c,dataType:d})},$.getJSON=function(a,b){return $.ajax({url:a,success:b,dataType:"json"})},$.fn.load=function(a,b){if(!this.length)return this;var c=this,d=a.split(/\s/),e;return d.length>1&&(a=d[0],e=d[1]),$.get(a,function(a){c.html(e?$(document.createElement("div")).html(a.replace(rscript,"")).find(e).html():a),b&&b.call(c)}),this};var escape=encodeURIComponent;$.param=function(a,b){var c=[];return c.add=function(a,b){this.push(escape(a)+"="+escape(b))},serialize(c,a,b),c.join("&").replace("%20","+")}}(Zepto),function(a){a.fn.serializeArray=function(){var b=[],c;return a(Array.prototype.slice.call(this.get(0).elements)).each(function(){c=a(this);var d=c.attr("type");this.nodeName.toLowerCase()!="fieldset"&&!this.disabled&&d!="submit"&&d!="reset"&&d!="button"&&(d!="radio"&&d!="checkbox"||this.checked)&&b.push({name:c.attr("name"),value:c.val()})}),b},a.fn.serialize=function(){var a=[];return this.serializeArray().forEach(function(b){a.push(encodeURIComponent(b.name)+"="+encodeURIComponent(b.value))}),a.join("&")},a.fn.submit=function(b){if(b)this.bind("submit",b);else if(this.length){var c=a.Event("submit");this.eq(0).trigger(c),c.defaultPrevented||this.get(0).submit()}return this}}(Zepto),function(a){function d(a){return"tagName"in a?a:a.parentNode}function e(a,b,c,d){var e=Math.abs(a-b),f=Math.abs(c-d);return e>=f?a-b>0?"Left":"Right":c-d>0?"Up":"Down"}function h(){g=null,b.last&&(b.el.trigger("longTap"),b={})}function i(){g&&clearTimeout(g),g=null}var b={},c,f=750,g;a(document).ready(function(){var j,k;a(document.body).bind("touchstart",function(e){j=Date.now(),k=j-(b.last||j),b.el=a(d(e.touches[0].target)),c&&clearTimeout(c),b.x1=e.touches[0].pageX,b.y1=e.touches[0].pageY,k>0&&k<=250&&(b.isDoubleTap=!0),b.last=j,g=setTimeout(h,f)}).bind("touchmove",function(a){i(),b.x2=a.touches[0].pageX,b.y2=a.touches[0].pageY}).bind("touchend",function(a){i(),b.isDoubleTap?(b.el.trigger("doubleTap"),b={}):b.x2&&Math.abs(b.x1-b.x2)>30||b.y2&&Math.abs(b.y1-b.y2)>30?(b.el.trigger("swipe")&&b.el.trigger("swipe"+e(b.x1,b.x2,b.y1,b.y2)),b={}):"last"in b&&(b.el.trigger("tap"),c=setTimeout(function(){c=null,b.el.trigger("singleTap"),b={}},250))}).bind("touchcancel",function(){c&&clearTimeout(c),g&&clearTimeout(g),g=c=null,b={}})}),["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap","singleTap","longTap"].forEach(function(b){a.fn[b]=function(a){return this.bind(b,a)}})}(Zepto); \ No newline at end of file diff --git a/docs/3.5.x/docs/source/api.js b/docs/3.5.x/docs/source/api.js index 2acf17aeeb..97546c780a 100644 --- a/docs/3.5.x/docs/source/api.js +++ b/docs/3.5.x/docs/source/api.js @@ -2,6 +2,8 @@ * Module dependencies */ +'use strict'; + var fs = require('fs'); var link = require('../helpers/linktype'); var hl = require('highlight.js') diff --git a/docs/3.5.x/docs/source/index.js b/docs/3.5.x/docs/source/index.js index 18b3eeb571..82921f05ee 100644 --- a/docs/3.5.x/docs/source/index.js +++ b/docs/3.5.x/docs/source/index.js @@ -1,4 +1,5 @@ +'use strict'; exports['index.jade'] = require('./home') exports['docs/api.jade'] = require('./api') exports['docs/index.jade'] = { title: 'Getting Started' } diff --git a/docs/3.5.x/docs/source/prior.js b/docs/3.5.x/docs/source/prior.js index 350ec4994b..1f2ee54e06 100644 --- a/docs/3.5.x/docs/source/prior.js +++ b/docs/3.5.x/docs/source/prior.js @@ -1,3 +1,4 @@ +'use strict'; var fs = require('fs') var releases = fs.readFileSync(__dirname + '/../releases', 'utf8'); releases = releases.split('\n').filter(Boolean); diff --git a/docs/3.5.x/docs/source/production.js b/docs/3.5.x/docs/source/production.js index 9fdbcfffbc..1b2bfcbd32 100644 --- a/docs/3.5.x/docs/source/production.js +++ b/docs/3.5.x/docs/source/production.js @@ -1,4 +1,5 @@ +'use strict'; var fs = require('fs') var images = fs.readFileSync(__dirname + '/../images/apps/urls', 'utf-8').split('\n'); diff --git a/docs/helpers/href.js b/docs/helpers/href.js index 471843440a..73d265b7e3 100644 --- a/docs/helpers/href.js +++ b/docs/helpers/href.js @@ -1,4 +1,5 @@ +'use strict'; module.exports = exports = function (str, char) { if ('string' !== typeof str) return str; return encodeURIComponent( diff --git a/docs/helpers/klass.js b/docs/helpers/klass.js index 0c4a865b43..d2009b87c3 100644 --- a/docs/helpers/klass.js +++ b/docs/helpers/klass.js @@ -1,4 +1,5 @@ +'use strict'; module.exports = exports = function (str) { var parts = str.replace(/\.js$/, '').split('/'); return parts.join('_'); diff --git a/docs/helpers/linktype.js b/docs/helpers/linktype.js index fdd4ec0238..e7c22cfdb5 100644 --- a/docs/helpers/linktype.js +++ b/docs/helpers/linktype.js @@ -1,4 +1,5 @@ +'use strict'; var types = {}; types.Object = 'https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object'; types.Boolean = 'https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean' diff --git a/docs/js/cookies.min.js b/docs/js/cookies.min.js index dc94dbc5bb..8f9c5b0cc5 100644 --- a/docs/js/cookies.min.js +++ b/docs/js/cookies.min.js @@ -1,4 +1,6 @@ /*! Cookies.js - 0.2.0; Copyright (c) 2012, Scott Hamper; http://www.opensource.org/licenses/MIT */ +'use strict'; + (function(f,e){var b=function(c,d,a){return 1===arguments.length?b.get(c):b.set(c,d,a)};b.get=function(c){f.cookie!==b._cacheString&&b._populateCache();return b._cache[c]};b.defaults={path:"/"};b.set=function(c,d,a){a={path:a&&a.path||b.defaults.path,domain:a&&a.domain||b.defaults.domain,expires:a&&a.expires||b.defaults.expires,secure:a&&a.secure!==e?a.secure:b.defaults.secure};d===e&&(a.expires=-1);switch(typeof a.expires){case "number":a.expires=new Date((new Date).getTime()+1E3*a.expires);break; case "string":a.expires=new Date(a.expires)}c=encodeURIComponent(c)+"="+(d+"").replace(/[^!#-+\--:<-[\]-~]/g,encodeURIComponent);c+=a.path?";path="+a.path:"";c+=a.domain?";domain="+a.domain:"";c+=a.expires?";expires="+a.expires.toGMTString():"";c+=a.secure?";secure":"";f.cookie=c;return b};b.expire=function(c,d){return b.set(c,e,d)};b._populateCache=function(){b._cache={};b._cacheString=f.cookie;for(var c=b._cacheString.split("; "),d=0;d>>0,e=0,f;if(typeof b!="function")throw new TypeError;if(d==0&&arguments.length==1)throw new TypeError;if(arguments.length>=2)f=arguments[1];else do{if(e in c){f=c[e++];break}if(++e>=d)throw new TypeError}while(!0);while(e0?[].concat.apply([],a):a}function H(a){return a.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function I(a){return a in i?i[a]:i[a]=new RegExp("(^|\\s)"+a+"(\\s|$)")}function J(a,b){return typeof b=="number"&&!k[H(a)]?b+"px":b}function K(a){var b,c;return h[a]||(b=g.createElement(a),g.body.appendChild(b),c=j(b,"").getPropertyValue("display"),b.parentNode.removeChild(b),c=="none"&&(c="block"),h[a]=c),h[a]}function L(b,d){return d===a?c(b):c(b).filter(d)}function M(a,b,c,d){return A(b)?b.call(a,c,d):b}function N(a,b,d){var e=a%2?b:b.parentNode;e?e.insertBefore(d,a?a==1?e.firstChild:a==2?b:null:b.nextSibling):c(d).remove()}function O(a,b){b(a);for(var c in a.childNodes)O(a.childNodes[c],b)}var a,b,c,d,e=[],f=e.slice,g=window.document,h={},i={},j=g.defaultView.getComputedStyle,k={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},l=/^\s*<(\w+|!)[^>]*>/,m=[1,3,8,9,11],n=["after","prepend","before","append"],o=g.createElement("table"),p=g.createElement("tr"),q={tr:g.createElement("tbody"),tbody:o,thead:o,tfoot:o,td:p,th:p,"*":g.createElement("div")},r=/complete|loaded|interactive/,s=/^\.([\w-]+)$/,t=/^#([\w-]+)$/,u=/^[\w-]+$/,v={}.toString,w={},x,y,z=g.createElement("div");return w.matches=function(a,b){if(!a||a.nodeType!==1)return!1;var c=a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.matchesSelector;if(c)return c.call(a,b);var d,e=a.parentNode,f=!e;return f&&(e=z).appendChild(a),d=~w.qsa(e,b).indexOf(a),f&&z.removeChild(a),d},x=function(a){return a.replace(/-+(.)?/g,function(a,b){return b?b.toUpperCase():""})},y=function(a){return a.filter(function(b,c){return a.indexOf(b)==c})},w.fragment=function(b,d){d===a&&(d=l.test(b)&&RegExp.$1),d in q||(d="*");var e=q[d];return e.innerHTML=""+b,c.each(f.call(e.childNodes),function(){e.removeChild(this)})},w.Z=function(a,b){return a=a||[],a.__proto__=arguments.callee.prototype,a.selector=b||"",a},w.isZ=function(a){return a instanceof w.Z},w.init=function(b,d){if(!b)return w.Z();if(A(b))return c(g).ready(b);if(w.isZ(b))return b;var e;if(D(b))e=F(b);else if(C(b))e=[c.extend({},b)],b=null;else if(m.indexOf(b.nodeType)>=0||b===window)e=[b],b=null;else if(l.test(b))e=w.fragment(b.trim(),RegExp.$1),b=null;else{if(d!==a)return c(d).find(b);e=w.qsa(g,b)}return w.Z(e,b)},c=function(a,b){return w.init(a,b)},c.extend=function(c){return f.call(arguments,1).forEach(function(d){for(b in d)d[b]!==a&&(c[b]=d[b])}),c},w.qsa=function(a,b){var c;return a===g&&t.test(b)?(c=a.getElementById(RegExp.$1))?[c]:e:a.nodeType!==1&&a.nodeType!==9?e:f.call(s.test(b)?a.getElementsByClassName(RegExp.$1):u.test(b)?a.getElementsByTagName(b):a.querySelectorAll(b))},c.isFunction=A,c.isObject=B,c.isArray=D,c.isPlainObject=C,c.inArray=function(a,b,c){return e.indexOf.call(b,a,c)},c.trim=function(a){return a.trim()},c.uuid=0,c.map=function(a,b){var c,d=[],e,f;if(E(a))for(e=0;e0&&w.matches(this[0],a)},not:function(b){var d=[];if(A(b)&&b.call!==a)this.each(function(a){b.call(this,a)||d.push(this)});else{var e=typeof b=="string"?this.filter(b):E(b)&&A(b.item)?f.call(b):c(b);this.forEach(function(a){e.indexOf(a)<0&&d.push(a)})}return c(d)},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){var a=this[0];return a&&!B(a)?a:c(a)},last:function(){var a=this[this.length-1];return a&&!B(a)?a:c(a)},find:function(a){var b;return this.length==1?b=w.qsa(this[0],a):b=this.map(function(){return w.qsa(this,a)}),c(b)},closest:function(a,b){var d=this[0];while(d&&!w.matches(d,a))d=d!==b&&d!==g&&d.parentNode;return c(d)},parents:function(a){var b=[],d=this;while(d.length>0)d=c.map(d,function(a){if((a=a.parentNode)&&a!==g&&b.indexOf(a)<0)return b.push(a),a});return L(b,a)},parent:function(a){return L(y(this.pluck("parentNode")),a)},children:function(a){return L(this.map(function(){return f.call(this.children)}),a)},siblings:function(a){return L(this.map(function(a,b){return f.call(b.parentNode.children).filter(function(a){return a!==b})}),a)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(a){return this.map(function(){return this[a]})},show:function(){return this.each(function(){this.style.display=="none"&&(this.style.display=null),j(this,"").getPropertyValue("display")=="none"&&(this.style.display=K(this.nodeName))})},replaceWith:function(a){return this.before(a).remove()},wrap:function(a){return this.each(function(){c(this).wrapAll(c(a)[0].cloneNode(!1))})},wrapAll:function(a){return this[0]&&(c(this[0]).before(a=c(a)),a.append(this)),this},unwrap:function(){return this.parent().each(function(){c(this).replaceWith(c(this).children())}),this},clone:function(){return c(this.map(function(){return this.cloneNode(!0)}))},hide:function(){return this.css("display","none")},toggle:function(b){return(b===a?this.css("display")=="none":b)?this.show():this.hide()},prev:function(){return c(this.pluck("previousElementSibling"))},next:function(){return c(this.pluck("nextElementSibling"))},html:function(b){return b===a?this.length>0?this[0].innerHTML:null:this.each(function(a){var d=this.innerHTML;c(this).empty().append(M(this,b,a,d))})},text:function(b){return b===a?this.length>0?this[0].textContent:null:this.each(function(){this.textContent=b})},attr:function(c,d){var e;return typeof c=="string"&&d===a?this.length==0||this[0].nodeType!==1?a:c=="value"&&this[0].nodeName=="INPUT"?this.val():!(e=this[0].getAttribute(c))&&c in this[0]?this[0][c]:e:this.each(function(a){if(this.nodeType!==1)return;if(B(c))for(b in c)this.setAttribute(b,c[b]);else this.setAttribute(c,M(this,d,a,this.getAttribute(c)))})},removeAttr:function(a){return this.each(function(){this.nodeType===1&&this.removeAttribute(a)})},prop:function(b,c){return c===a?this[0]?this[0][b]:a:this.each(function(a){this[b]=M(this,c,a,this[b])})},data:function(b,c){var d=this.attr("data-"+H(b),c);return d!==null?d:a},val:function(b){return b===a?this.length>0?this[0].value:a:this.each(function(a){this.value=M(this,b,a,this.value)})},offset:function(){if(this.length==0)return null;var a=this[0].getBoundingClientRect();return{left:a.left+window.pageXOffset,top:a.top+window.pageYOffset,width:a.width,height:a.height}},css:function(c,d){if(d===a&&typeof c=="string")return this.length==0?a:this[0].style[x(c)]||j(this[0],"").getPropertyValue(c);var e="";for(b in c)typeof c[b]=="string"&&c[b]==""?this.each(function(){this.style.removeProperty(H(b))}):e+=H(b)+":"+J(b,c[b])+";";return typeof c=="string"&&(d==""?this.each(function(){this.style.removeProperty(H(c))}):e=H(c)+":"+J(c,d)),this.each(function(){this.style.cssText+=";"+e})},index:function(a){return a?this.indexOf(c(a)[0]):this.parent().children().indexOf(this[0])},hasClass:function(a){return this.length<1?!1:I(a).test(this[0].className)},addClass:function(a){return this.each(function(b){d=[];var e=this.className,f=M(this,a,b,e);f.split(/\s+/g).forEach(function(a){c(this).hasClass(a)||d.push(a)},this),d.length&&(this.className+=(e?" ":"")+d.join(" "))})},removeClass:function(b){return this.each(function(c){if(b===a)return this.className="";d=this.className,M(this,b,c,d).split(/\s+/g).forEach(function(a){d=d.replace(I(a)," ")}),this.className=d.trim()})},toggleClass:function(b,d){return this.each(function(e){var f=M(this,b,e,this.className);(d===a?!c(this).hasClass(f):d)?c(this).addClass(f):c(this).removeClass(f)})}},["width","height"].forEach(function(b){c.fn[b]=function(d){var e,f=b.replace(/./,function(a){return a[0].toUpperCase()});return d===a?this[0]==window?window["inner"+f]:this[0]==g?g.documentElement["offset"+f]:(e=this.offset())&&e[b]:this.each(function(a){var e=c(this);e.css(b,M(this,d,a,e[b]()))})}}),n.forEach(function(a,b){c.fn[a]=function(){var a=c.map(arguments,function(a){return B(a)?a:w.fragment(a)});if(a.length<1)return this;var d=this.length,e=d>1,f=b<2;return this.each(function(c,g){for(var h=0;h0&&this.bind(o,n),setTimeout(function(){m.css(i),e<=0&&setTimeout(function(){m.each(function(){n.call(this)})},0)},0),this},i=null}(Zepto),function($){function triggerAndReturn(a,b,c){var d=$.Event(b);return $(a).trigger(d,c),!d.defaultPrevented}function triggerGlobal(a,b,c,d){if(a.global)return triggerAndReturn(b||document,c,d)}function ajaxStart(a){a.global&&$.active++===0&&triggerGlobal(a,null,"ajaxStart")}function ajaxStop(a){a.global&&!--$.active&&triggerGlobal(a,null,"ajaxStop")}function ajaxBeforeSend(a,b){var c=b.context;if(b.beforeSend.call(c,a,b)===!1||triggerGlobal(b,c,"ajaxBeforeSend",[a,b])===!1)return!1;triggerGlobal(b,c,"ajaxSend",[a,b])}function ajaxSuccess(a,b,c){var d=c.context,e="success";c.success.call(d,a,e,b),triggerGlobal(c,d,"ajaxSuccess",[b,c,a]),ajaxComplete(e,b,c)}function ajaxError(a,b,c,d){var e=d.context;d.error.call(e,c,b,a),triggerGlobal(d,e,"ajaxError",[c,d,a]),ajaxComplete(b,c,d)}function ajaxComplete(a,b,c){var d=c.context;c.complete.call(d,b,a),triggerGlobal(c,d,"ajaxComplete",[b,c]),ajaxStop(c)}function empty(){}function mimeToDataType(a){return a&&(a==htmlType?"html":a==jsonType?"json":scriptTypeRE.test(a)?"script":xmlTypeRE.test(a)&&"xml")||"text"}function appendQuery(a,b){return(a+"&"+b).replace(/[&?]{1,2}/,"?")}function serializeData(a){isObject(a.data)&&(a.data=$.param(a.data)),a.data&&(!a.type||a.type.toUpperCase()=="GET")&&(a.url=appendQuery(a.url,a.data))}function serialize(a,b,c,d){var e=$.isArray(b);$.each(b,function(b,f){d&&(b=c?d:d+"["+(e?"":b)+"]"),!d&&e?a.add(f.name,f.value):(c?$.isArray(f):isObject(f))?serialize(a,f,c,b):a.add(b,f)})}var jsonpID=0,isObject=$.isObject,document=window.document,key,name,rscript=/)<[^<]*)*<\/script>/gi,scriptTypeRE=/^(?:text|application)\/javascript/i,xmlTypeRE=/^(?:text|application)\/xml/i,jsonType="application/json",htmlType="text/html",blankRE=/^\s*$/;$.active=0,$.ajaxJSONP=function(a){var b="jsonp"+ ++jsonpID,c=document.createElement("script"),d=function(){$(c).remove(),b in window&&(window[b]=empty),ajaxComplete("abort",e,a)},e={abort:d},f;return a.error&&(c.onerror=function(){e.abort(),a.error()}),window[b]=function(d){clearTimeout(f),$(c).remove(),delete window[b],ajaxSuccess(d,e,a)},serializeData(a),c.src=a.url.replace(/=\?/,"="+b),$("head").append(c),a.timeout>0&&(f=setTimeout(function(){e.abort(),ajaxComplete("timeout",e,a)},a.timeout)),e},$.ajaxSettings={type:"GET",beforeSend:empty,success:empty,error:empty,complete:empty,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript",json:jsonType,xml:"application/xml, text/xml",html:htmlType,text:"text/plain"},crossDomain:!1,timeout:0},$.ajax=function(options){var settings=$.extend({},options||{});for(key in $.ajaxSettings)settings[key]===undefined&&(settings[key]=$.ajaxSettings[key]);ajaxStart(settings),settings.crossDomain||(settings.crossDomain=/^([\w-]+:)?\/\/([^\/]+)/.test(settings.url)&&RegExp.$2!=window.location.host);var dataType=settings.dataType,hasPlaceholder=/=\?/.test(settings.url);if(dataType=="jsonp"||hasPlaceholder)return hasPlaceholder||(settings.url=appendQuery(settings.url,"callback=?")),$.ajaxJSONP(settings);settings.url||(settings.url=window.location.toString()),serializeData(settings);var mime=settings.accepts[dataType],baseHeaders={},protocol=/^([\w-]+:)\/\//.test(settings.url)?RegExp.$1:window.location.protocol,xhr=$.ajaxSettings.xhr(),abortTimeout;settings.crossDomain||(baseHeaders["X-Requested-With"]="XMLHttpRequest"),mime&&(baseHeaders.Accept=mime,mime.indexOf(",")>-1&&(mime=mime.split(",",2)[0]),xhr.overrideMimeType&&xhr.overrideMimeType(mime));if(settings.contentType||settings.data&&settings.type.toUpperCase()!="GET")baseHeaders["Content-Type"]=settings.contentType||"application/x-www-form-urlencoded";settings.headers=$.extend(baseHeaders,settings.headers||{}),xhr.onreadystatechange=function(){if(xhr.readyState==4){clearTimeout(abortTimeout);var result,error=!1;if(xhr.status>=200&&xhr.status<300||xhr.status==304||xhr.status==0&&protocol=="file:"){dataType=dataType||mimeToDataType(xhr.getResponseHeader("content-type")),result=xhr.responseText;try{dataType=="script"?(1,eval)(result):dataType=="xml"?result=xhr.responseXML:dataType=="json"&&(result=blankRE.test(result)?null:JSON.parse(result))}catch(e){error=e}error?ajaxError(error,"parsererror",xhr,settings):ajaxSuccess(result,xhr,settings)}else ajaxError(null,"error",xhr,settings)}};var async="async"in settings?settings.async:!0;xhr.open(settings.type,settings.url,async);for(name in settings.headers)xhr.setRequestHeader(name,settings.headers[name]);return ajaxBeforeSend(xhr,settings)===!1?(xhr.abort(),!1):(settings.timeout>0&&(abortTimeout=setTimeout(function(){xhr.onreadystatechange=empty,xhr.abort(),ajaxError(null,"timeout",xhr,settings)},settings.timeout)),xhr.send(settings.data?settings.data:null),xhr)},$.get=function(a,b){return $.ajax({url:a,success:b})},$.post=function(a,b,c,d){return $.isFunction(b)&&(d=d||c,c=b,b=null),$.ajax({type:"POST",url:a,data:b,success:c,dataType:d})},$.getJSON=function(a,b){return $.ajax({url:a,success:b,dataType:"json"})},$.fn.load=function(a,b){if(!this.length)return this;var c=this,d=a.split(/\s/),e;return d.length>1&&(a=d[0],e=d[1]),$.get(a,function(a){c.html(e?$(document.createElement("div")).html(a.replace(rscript,"")).find(e).html():a),b&&b.call(c)}),this};var escape=encodeURIComponent;$.param=function(a,b){var c=[];return c.add=function(a,b){this.push(escape(a)+"="+escape(b))},serialize(c,a,b),c.join("&").replace("%20","+")}}(Zepto),function(a){a.fn.serializeArray=function(){var b=[],c;return a(Array.prototype.slice.call(this.get(0).elements)).each(function(){c=a(this);var d=c.attr("type");this.nodeName.toLowerCase()!="fieldset"&&!this.disabled&&d!="submit"&&d!="reset"&&d!="button"&&(d!="radio"&&d!="checkbox"||this.checked)&&b.push({name:c.attr("name"),value:c.val()})}),b},a.fn.serialize=function(){var a=[];return this.serializeArray().forEach(function(b){a.push(encodeURIComponent(b.name)+"="+encodeURIComponent(b.value))}),a.join("&")},a.fn.submit=function(b){if(b)this.bind("submit",b);else if(this.length){var c=a.Event("submit");this.eq(0).trigger(c),c.defaultPrevented||this.get(0).submit()}return this}}(Zepto),function(a){function d(a){return"tagName"in a?a:a.parentNode}function e(a,b,c,d){var e=Math.abs(a-b),f=Math.abs(c-d);return e>=f?a-b>0?"Left":"Right":c-d>0?"Up":"Down"}function h(){g=null,b.last&&(b.el.trigger("longTap"),b={})}function i(){g&&clearTimeout(g),g=null}var b={},c,f=750,g;a(document).ready(function(){var j,k;a(document.body).bind("touchstart",function(e){j=Date.now(),k=j-(b.last||j),b.el=a(d(e.touches[0].target)),c&&clearTimeout(c),b.x1=e.touches[0].pageX,b.y1=e.touches[0].pageY,k>0&&k<=250&&(b.isDoubleTap=!0),b.last=j,g=setTimeout(h,f)}).bind("touchmove",function(a){i(),b.x2=a.touches[0].pageX,b.y2=a.touches[0].pageY}).bind("touchend",function(a){i(),b.isDoubleTap?(b.el.trigger("doubleTap"),b={}):b.x2&&Math.abs(b.x1-b.x2)>30||b.y2&&Math.abs(b.y1-b.y2)>30?(b.el.trigger("swipe")&&b.el.trigger("swipe"+e(b.x1,b.x2,b.y1,b.y2)),b={}):"last"in b&&(b.el.trigger("tap"),c=setTimeout(function(){c=null,b.el.trigger("singleTap"),b={}},250))}).bind("touchcancel",function(){c&&clearTimeout(c),g&&clearTimeout(g),g=c=null,b={}})}),["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap","singleTap","longTap"].forEach(function(b){a.fn[b]=function(a){return this.bind(b,a)}})}(Zepto); \ No newline at end of file diff --git a/docs/source/acquit.js b/docs/source/acquit.js index 91ede15c43..c53ba3866b 100644 --- a/docs/source/acquit.js +++ b/docs/source/acquit.js @@ -1,3 +1,4 @@ +'use strict'; var fs = require('fs'); var acquit = require('acquit'); var hl = require('highlight.js'); diff --git a/docs/source/index.js b/docs/source/index.js index 2c415f2e18..74662c4ea9 100644 --- a/docs/source/index.js +++ b/docs/source/index.js @@ -1,4 +1,5 @@ +'use strict'; exports['index.jade'] = require('./home'); exports['docs/api.jade'] = require('./api'); exports['docs/browser.jade'] = { guide: true, title: 'Browser Library', acquit: true }; diff --git a/docs/source/prior.js b/docs/source/prior.js index 350ec4994b..1f2ee54e06 100644 --- a/docs/source/prior.js +++ b/docs/source/prior.js @@ -1,3 +1,4 @@ +'use strict'; var fs = require('fs') var releases = fs.readFileSync(__dirname + '/../releases', 'utf8'); releases = releases.split('\n').filter(Boolean); diff --git a/docs/source/production.js b/docs/source/production.js index c10a8b91bd..9a9cb59beb 100644 --- a/docs/source/production.js +++ b/docs/source/production.js @@ -1,3 +1,4 @@ +'use strict'; module.exports = { images: [] , title: 'Production' diff --git a/examples/aggregate/aggregate.js b/examples/aggregate/aggregate.js index d64f1c799f..4e9de2a669 100644 --- a/examples/aggregate/aggregate.js +++ b/examples/aggregate/aggregate.js @@ -1,5 +1,7 @@ // import async to make control flow simplier +'use strict'; + const async = require('async'); // import the rest of the normal stuff diff --git a/examples/aggregate/person.js b/examples/aggregate/person.js index 8288c55033..76ec8a0cab 100644 --- a/examples/aggregate/person.js +++ b/examples/aggregate/person.js @@ -1,5 +1,7 @@ // import the necessary modules +'use strict'; + const mongoose = require('../../lib'); const Schema = mongoose.Schema; diff --git a/examples/doc-methods.js b/examples/doc-methods.js index d64434070d..51d7048923 100644 --- a/examples/doc-methods.js +++ b/examples/doc-methods.js @@ -1,4 +1,5 @@ +'use strict'; const mongoose = require('mongoose'); const Schema = mongoose.Schema; diff --git a/examples/express/connection-sharing/app.js b/examples/express/connection-sharing/app.js index 9122d84e9f..750e1db0da 100644 --- a/examples/express/connection-sharing/app.js +++ b/examples/express/connection-sharing/app.js @@ -1,4 +1,5 @@ +'use strict'; const express = require('express'); const mongoose = require('../../../lib'); diff --git a/examples/express/connection-sharing/modelA.js b/examples/express/connection-sharing/modelA.js index 354e527f10..85b8cc2d7d 100644 --- a/examples/express/connection-sharing/modelA.js +++ b/examples/express/connection-sharing/modelA.js @@ -1,3 +1,4 @@ +'use strict'; const Schema = require('../../../lib').Schema; const mySchema = Schema({name: String}); diff --git a/examples/express/connection-sharing/routes.js b/examples/express/connection-sharing/routes.js index 022205e7de..231f5fb2c8 100644 --- a/examples/express/connection-sharing/routes.js +++ b/examples/express/connection-sharing/routes.js @@ -1,4 +1,5 @@ +'use strict'; const model = require('./modelA'); exports.home = function(req, res, next) { diff --git a/examples/geospatial/geoJSONSchema.js b/examples/geospatial/geoJSONSchema.js index 4457d4fde5..d85a951122 100644 --- a/examples/geospatial/geoJSONSchema.js +++ b/examples/geospatial/geoJSONSchema.js @@ -1,5 +1,7 @@ // import the necessary modules +'use strict'; + const mongoose = require('../../lib'); const Schema = mongoose.Schema; diff --git a/examples/geospatial/geoJSONexample.js b/examples/geospatial/geoJSONexample.js index fca21fecac..749dbd9d3e 100644 --- a/examples/geospatial/geoJSONexample.js +++ b/examples/geospatial/geoJSONexample.js @@ -1,4 +1,6 @@ // import async to make control flow simplier +'use strict'; + const async = require('async'); // import the rest of the normal stuff diff --git a/examples/geospatial/geospatial.js b/examples/geospatial/geospatial.js index 8245466e01..6241fdcfc7 100644 --- a/examples/geospatial/geospatial.js +++ b/examples/geospatial/geospatial.js @@ -1,4 +1,6 @@ // import async to make control flow simplier +'use strict'; + const async = require('async'); // import the rest of the normal stuff diff --git a/examples/geospatial/person.js b/examples/geospatial/person.js index 2327b56dbe..1f51af1943 100644 --- a/examples/geospatial/person.js +++ b/examples/geospatial/person.js @@ -1,4 +1,6 @@ // import the necessary modules +'use strict'; + const mongoose = require('../../lib'); const Schema = mongoose.Schema; diff --git a/examples/globalschemas/gs_example.js b/examples/globalschemas/gs_example.js index d1551a1eb7..da1416f0d2 100644 --- a/examples/globalschemas/gs_example.js +++ b/examples/globalschemas/gs_example.js @@ -1,3 +1,4 @@ +'use strict'; const mongoose = require('../../lib'); diff --git a/examples/globalschemas/person.js b/examples/globalschemas/person.js index a158e7d968..f598dd3fb6 100644 --- a/examples/globalschemas/person.js +++ b/examples/globalschemas/person.js @@ -1,4 +1,6 @@ // import the necessary modules +'use strict'; + const mongoose = require('../../lib'); const Schema = mongoose.Schema; diff --git a/examples/lean/lean.js b/examples/lean/lean.js index 3947668db2..b244ae0266 100644 --- a/examples/lean/lean.js +++ b/examples/lean/lean.js @@ -1,5 +1,7 @@ // import async to make control flow simplier +'use strict'; + const async = require('async'); // import the rest of the normal stuff diff --git a/examples/lean/person.js b/examples/lean/person.js index 233226352a..c052f7f24d 100644 --- a/examples/lean/person.js +++ b/examples/lean/person.js @@ -1,4 +1,6 @@ // import the necessary modules +'use strict'; + const mongoose = require('../../lib'); const Schema = mongoose.Schema; diff --git a/examples/mapreduce/mapreduce.js b/examples/mapreduce/mapreduce.js index 063ae5a01f..493d8d43b4 100644 --- a/examples/mapreduce/mapreduce.js +++ b/examples/mapreduce/mapreduce.js @@ -1,4 +1,6 @@ // import async to make control flow simplier +'use strict'; + const async = require('async'); // import the rest of the normal stuff diff --git a/examples/mapreduce/person.js b/examples/mapreduce/person.js index efdd108a00..3f1a651a3d 100644 --- a/examples/mapreduce/person.js +++ b/examples/mapreduce/person.js @@ -1,5 +1,7 @@ // import the necessary modules +'use strict'; + const mongoose = require('../../lib'); const Schema = mongoose.Schema; diff --git a/examples/population/population-across-three-collections.js b/examples/population/population-across-three-collections.js index 0374f7d2a3..630ea5f2db 100644 --- a/examples/population/population-across-three-collections.js +++ b/examples/population/population-across-three-collections.js @@ -1,4 +1,5 @@ +'use strict'; const assert = require('assert'); const mongoose = require('../../lib'); const Schema = mongoose.Schema; diff --git a/examples/population/population-basic.js b/examples/population/population-basic.js index 8fc4350dbb..da1b1cd3f4 100644 --- a/examples/population/population-basic.js +++ b/examples/population/population-basic.js @@ -1,4 +1,5 @@ +'use strict'; const mongoose = require('../../lib'); const Schema = mongoose.Schema; diff --git a/examples/population/population-of-existing-doc.js b/examples/population/population-of-existing-doc.js index 7da866a6e0..543a161a9b 100644 --- a/examples/population/population-of-existing-doc.js +++ b/examples/population/population-of-existing-doc.js @@ -1,4 +1,5 @@ +'use strict'; const mongoose = require('../../lib'); const Schema = mongoose.Schema; diff --git a/examples/population/population-of-multiple-existing-docs.js b/examples/population/population-of-multiple-existing-docs.js index 4dfeee7663..9e9b99493f 100644 --- a/examples/population/population-of-multiple-existing-docs.js +++ b/examples/population/population-of-multiple-existing-docs.js @@ -1,4 +1,5 @@ +'use strict'; const mongoose = require('../../lib'); const Schema = mongoose.Schema; diff --git a/examples/population/population-options.js b/examples/population/population-options.js index 2a5b57c2de..ab32e20385 100644 --- a/examples/population/population-options.js +++ b/examples/population/population-options.js @@ -1,4 +1,5 @@ +'use strict'; const mongoose = require('../../lib'); const Schema = mongoose.Schema; diff --git a/examples/population/population-plain-objects.js b/examples/population/population-plain-objects.js index cdaf870e9e..aad5fa50e4 100644 --- a/examples/population/population-plain-objects.js +++ b/examples/population/population-plain-objects.js @@ -1,4 +1,5 @@ +'use strict'; const mongoose = require('../../lib'); const Schema = mongoose.Schema; diff --git a/examples/promises/person.js b/examples/promises/person.js index 4dbe4c6a05..2f8f6b0429 100644 --- a/examples/promises/person.js +++ b/examples/promises/person.js @@ -1,5 +1,7 @@ // import the necessary modules +'use strict'; + const mongoose = require('../../lib'); const Schema = mongoose.Schema; diff --git a/examples/promises/promise.js b/examples/promises/promise.js index 735eb6b47c..ae4ba45a8b 100644 --- a/examples/promises/promise.js +++ b/examples/promises/promise.js @@ -1,4 +1,6 @@ // import async to make control flow simplier +'use strict'; + const async = require('async'); // import the rest of the normal stuff diff --git a/examples/querybuilder/person.js b/examples/querybuilder/person.js index 4dbe4c6a05..2f8f6b0429 100644 --- a/examples/querybuilder/person.js +++ b/examples/querybuilder/person.js @@ -1,5 +1,7 @@ // import the necessary modules +'use strict'; + const mongoose = require('../../lib'); const Schema = mongoose.Schema; diff --git a/examples/querybuilder/querybuilder.js b/examples/querybuilder/querybuilder.js index 889f4c1ae1..67fbb79b50 100644 --- a/examples/querybuilder/querybuilder.js +++ b/examples/querybuilder/querybuilder.js @@ -1,5 +1,7 @@ // import async to make control flow simplier +'use strict'; + const async = require('async'); // import the rest of the normal stuff diff --git a/examples/replicasets/person.js b/examples/replicasets/person.js index 4dbe4c6a05..2f8f6b0429 100644 --- a/examples/replicasets/person.js +++ b/examples/replicasets/person.js @@ -1,5 +1,7 @@ // import the necessary modules +'use strict'; + const mongoose = require('../../lib'); const Schema = mongoose.Schema; diff --git a/examples/replicasets/replica-sets.js b/examples/replicasets/replica-sets.js index bfd4603b50..b52298f161 100644 --- a/examples/replicasets/replica-sets.js +++ b/examples/replicasets/replica-sets.js @@ -1,5 +1,7 @@ // import async to make control flow simplier +'use strict'; + const async = require('async'); // import the rest of the normal stuff diff --git a/examples/schema/schema.js b/examples/schema/schema.js index ac64b1f504..7ecd66fd73 100644 --- a/examples/schema/schema.js +++ b/examples/schema/schema.js @@ -2,8 +2,9 @@ * Module dependencies. */ -let mongoose = require('../../lib'), - Schema = mongoose.Schema; +'use strict'; + +let mongoose = require('../../lib'), Schema = mongoose.Schema; /** * Schema definition diff --git a/examples/schema/storing-schemas-as-json/index.js b/examples/schema/storing-schemas-as-json/index.js index 1d1764fc6c..cbc6942c4f 100644 --- a/examples/schema/storing-schemas-as-json/index.js +++ b/examples/schema/storing-schemas-as-json/index.js @@ -1,5 +1,7 @@ // modules +'use strict'; + const mongoose = require('../../../lib'); const Schema = mongoose.Schema; diff --git a/examples/statics/person.js b/examples/statics/person.js index 7750260b3a..02987f90a2 100644 --- a/examples/statics/person.js +++ b/examples/statics/person.js @@ -1,4 +1,6 @@ // import the necessary modules +'use strict'; + const mongoose = require('../../lib'); const Schema = mongoose.Schema; diff --git a/examples/statics/statics.js b/examples/statics/statics.js index c09632eb05..53a0106deb 100644 --- a/examples/statics/statics.js +++ b/examples/statics/statics.js @@ -1,3 +1,4 @@ +'use strict'; const mongoose = require('../../lib'); diff --git a/format_deps.js b/format_deps.js index 7fbc0cc632..90908b9cd6 100644 --- a/format_deps.js +++ b/format_deps.js @@ -1,3 +1,4 @@ +'use strict'; const p = require('./package.json'); const _ = require('lodash'); diff --git a/index.js b/index.js index e7e6278591..a938b443d4 100644 --- a/index.js +++ b/index.js @@ -4,4 +4,6 @@ * */ +'use strict'; + module.exports = require('./lib/'); diff --git a/lib/aggregate.js b/lib/aggregate.js index 75f13eb4fd..6ce0ee634f 100644 --- a/lib/aggregate.js +++ b/lib/aggregate.js @@ -2,6 +2,8 @@ * Module dependencies */ +'use strict'; + const AggregationCursor = require('./cursor/AggregationCursor'); const Query = require('./query'); const util = require('util'); diff --git a/lib/browser.js b/lib/browser.js index b53d51a512..8b9b4b7bd2 100644 --- a/lib/browser.js +++ b/lib/browser.js @@ -1,5 +1,7 @@ /* eslint-env browser */ +'use strict'; + require('./driver').set(require('./drivers/browser')); const DocumentProvider = require('./document_provider.js'); diff --git a/lib/browserDocument.js b/lib/browserDocument.js index bc9c4a7148..80976ca268 100644 --- a/lib/browserDocument.js +++ b/lib/browserDocument.js @@ -2,6 +2,8 @@ * Module dependencies. */ +'use strict'; + const NodeJSDocument = require('./document'); const EventEmitter = require('events').EventEmitter; const MongooseError = require('./error'); diff --git a/lib/connectionstate.js b/lib/connectionstate.js index 7e426b4721..920f45bee9 100644 --- a/lib/connectionstate.js +++ b/lib/connectionstate.js @@ -3,6 +3,8 @@ * Connection states */ +'use strict'; + const STATES = module.exports = exports = Object.create(null); const disconnected = 'disconnected'; diff --git a/lib/cursor/AggregationCursor.js b/lib/cursor/AggregationCursor.js index 6c00c2e1ba..76b0828501 100644 --- a/lib/cursor/AggregationCursor.js +++ b/lib/cursor/AggregationCursor.js @@ -2,6 +2,8 @@ * Module dependencies. */ +'use strict'; + const Readable = require('stream').Readable; const eachAsync = require('../helpers/cursor/eachAsync'); const util = require('util'); diff --git a/lib/cursor/QueryCursor.js b/lib/cursor/QueryCursor.js index 52ca63e999..3a7cf68270 100644 --- a/lib/cursor/QueryCursor.js +++ b/lib/cursor/QueryCursor.js @@ -2,6 +2,8 @@ * Module dependencies. */ +'use strict'; + const Readable = require('stream').Readable; const eachAsync = require('../helpers/cursor/eachAsync'); const helpers = require('../queryhelpers'); diff --git a/lib/drivers/browser/ReadPreference.js b/lib/drivers/browser/ReadPreference.js index f20cd6cc0d..1363570810 100644 --- a/lib/drivers/browser/ReadPreference.js +++ b/lib/drivers/browser/ReadPreference.js @@ -2,4 +2,6 @@ * ignore */ +'use strict'; + module.exports = function() {}; diff --git a/lib/drivers/browser/binary.js b/lib/drivers/browser/binary.js index bc565fbd2b..4658f7b9e0 100644 --- a/lib/drivers/browser/binary.js +++ b/lib/drivers/browser/binary.js @@ -3,6 +3,8 @@ * Module dependencies. */ +'use strict'; + const Binary = require('bson').Binary; /*! diff --git a/lib/drivers/browser/decimal128.js b/lib/drivers/browser/decimal128.js index ecc1ae3b9b..5668182b35 100644 --- a/lib/drivers/browser/decimal128.js +++ b/lib/drivers/browser/decimal128.js @@ -2,4 +2,6 @@ * ignore */ +'use strict'; + module.exports = require('bson').Decimal128; diff --git a/lib/drivers/browser/index.js b/lib/drivers/browser/index.js index a996fdb526..56d0b8a75c 100644 --- a/lib/drivers/browser/index.js +++ b/lib/drivers/browser/index.js @@ -2,6 +2,8 @@ * Module exports. */ +'use strict'; + exports.Binary = require('./binary'); exports.Collection = function() { throw new Error('Cannot create a collection from browser library'); diff --git a/lib/drivers/browser/objectid.js b/lib/drivers/browser/objectid.js index d9444ba84b..b1e603d714 100644 --- a/lib/drivers/browser/objectid.js +++ b/lib/drivers/browser/objectid.js @@ -5,6 +5,8 @@ * @see ObjectId */ +'use strict'; + const ObjectId = require('bson').ObjectID; /*! diff --git a/lib/drivers/node-mongodb-native/ReadPreference.js b/lib/drivers/node-mongodb-native/ReadPreference.js index 3d16825cd8..024ee181a5 100644 --- a/lib/drivers/node-mongodb-native/ReadPreference.js +++ b/lib/drivers/node-mongodb-native/ReadPreference.js @@ -2,6 +2,8 @@ * Module dependencies. */ +'use strict'; + const mongodb = require('mongodb'); const ReadPref = mongodb.ReadPreference; diff --git a/lib/drivers/node-mongodb-native/binary.js b/lib/drivers/node-mongodb-native/binary.js index 8b1003762f..4e3c86f78c 100644 --- a/lib/drivers/node-mongodb-native/binary.js +++ b/lib/drivers/node-mongodb-native/binary.js @@ -3,6 +3,8 @@ * Module dependencies. */ +'use strict'; + const Binary = require('mongodb').Binary; module.exports = exports = Binary; diff --git a/lib/drivers/node-mongodb-native/connection.js b/lib/drivers/node-mongodb-native/connection.js index 2489e05dbd..91affff2f1 100644 --- a/lib/drivers/node-mongodb-native/connection.js +++ b/lib/drivers/node-mongodb-native/connection.js @@ -2,6 +2,8 @@ * Module dependencies. */ +'use strict'; + const MongooseConnection = require('../../connection'); const STATES = require('../../connectionstate'); diff --git a/lib/drivers/node-mongodb-native/decimal128.js b/lib/drivers/node-mongodb-native/decimal128.js index d1f04de965..c895f17fd2 100644 --- a/lib/drivers/node-mongodb-native/decimal128.js +++ b/lib/drivers/node-mongodb-native/decimal128.js @@ -2,4 +2,6 @@ * ignore */ +'use strict'; + module.exports = require('mongodb').Decimal128; diff --git a/lib/drivers/node-mongodb-native/index.js b/lib/drivers/node-mongodb-native/index.js index b9fa17a43f..648207d712 100644 --- a/lib/drivers/node-mongodb-native/index.js +++ b/lib/drivers/node-mongodb-native/index.js @@ -2,6 +2,8 @@ * Module exports. */ +'use strict'; + exports.Binary = require('./binary'); exports.Collection = require('./collection'); exports.Decimal128 = require('./decimal128'); diff --git a/lib/drivers/node-mongodb-native/objectid.js b/lib/drivers/node-mongodb-native/objectid.js index cc2b560027..6f432b7968 100644 --- a/lib/drivers/node-mongodb-native/objectid.js +++ b/lib/drivers/node-mongodb-native/objectid.js @@ -5,6 +5,8 @@ * @see ObjectId */ +'use strict'; + const ObjectId = require('mongodb').ObjectId; /*! diff --git a/lib/error/browserMissingSchema.js b/lib/error/browserMissingSchema.js index 93813f9168..852f8739bc 100644 --- a/lib/error/browserMissingSchema.js +++ b/lib/error/browserMissingSchema.js @@ -2,6 +2,8 @@ * Module dependencies. */ +'use strict'; + const MongooseError = require('./'); /*! diff --git a/lib/error/disconnected.js b/lib/error/disconnected.js index 9f2857f316..f542459e6a 100644 --- a/lib/error/disconnected.js +++ b/lib/error/disconnected.js @@ -2,6 +2,8 @@ * Module dependencies. */ +'use strict'; + const MongooseError = require('./'); /** diff --git a/lib/error/divergentArray.js b/lib/error/divergentArray.js index 37c631c75f..872fd2bfac 100644 --- a/lib/error/divergentArray.js +++ b/lib/error/divergentArray.js @@ -3,6 +3,8 @@ * Module dependencies. */ +'use strict'; + const MongooseError = require('./'); /*! diff --git a/lib/error/messages.js b/lib/error/messages.js index e6ffa3f99a..4483a86d7a 100644 --- a/lib/error/messages.js +++ b/lib/error/messages.js @@ -21,6 +21,8 @@ * @api public */ +'use strict'; + const msg = module.exports = exports = {}; msg.DocumentNotFoundError = null; diff --git a/lib/error/missingSchema.js b/lib/error/missingSchema.js index a6a970be20..319515820f 100644 --- a/lib/error/missingSchema.js +++ b/lib/error/missingSchema.js @@ -3,6 +3,8 @@ * Module dependencies. */ +'use strict'; + const MongooseError = require('./'); /*! diff --git a/lib/error/mongooseError.js b/lib/error/mongooseError.js index 322c4bcc38..398c31b7df 100644 --- a/lib/error/mongooseError.js +++ b/lib/error/mongooseError.js @@ -5,6 +5,8 @@ * @inherits Error https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error */ +'use strict'; + function MongooseError(msg) { Error.call(this); if (Error.captureStackTrace) { diff --git a/lib/error/objectExpected.js b/lib/error/objectExpected.js index 03ed57bd62..de54f4f3fd 100644 --- a/lib/error/objectExpected.js +++ b/lib/error/objectExpected.js @@ -2,6 +2,8 @@ * Module dependencies. */ +'use strict'; + const MongooseError = require('./'); /** diff --git a/lib/error/objectParameter.js b/lib/error/objectParameter.js index 5f5a456d18..3a7f2849cb 100644 --- a/lib/error/objectParameter.js +++ b/lib/error/objectParameter.js @@ -2,6 +2,8 @@ * Module dependencies. */ +'use strict'; + const MongooseError = require('./'); /** diff --git a/lib/error/overwriteModel.js b/lib/error/overwriteModel.js index 4d028f99e4..21013b65ec 100644 --- a/lib/error/overwriteModel.js +++ b/lib/error/overwriteModel.js @@ -3,6 +3,8 @@ * Module dependencies. */ +'use strict'; + const MongooseError = require('./'); /*! diff --git a/lib/error/strict.js b/lib/error/strict.js index 1167f98c19..2678174768 100644 --- a/lib/error/strict.js +++ b/lib/error/strict.js @@ -2,6 +2,8 @@ * Module dependencies. */ +'use strict'; + const MongooseError = require('./'); /** diff --git a/lib/error/validation.js b/lib/error/validation.js index 7d26bc84de..85b733c48b 100644 --- a/lib/error/validation.js +++ b/lib/error/validation.js @@ -2,6 +2,8 @@ * Module requirements */ +'use strict'; + const MongooseError = require('./'); const util = require('util'); diff --git a/lib/error/validator.js b/lib/error/validator.js index 5b6d1c1402..d07100c418 100644 --- a/lib/error/validator.js +++ b/lib/error/validator.js @@ -2,6 +2,8 @@ * Module dependencies. */ +'use strict'; + const MongooseError = require('./'); /** diff --git a/lib/helpers/immediate.js b/lib/helpers/immediate.js index e244b67c2e..ddb70607a1 100644 --- a/lib/helpers/immediate.js +++ b/lib/helpers/immediate.js @@ -5,6 +5,8 @@ * See gh-6074 */ +'use strict'; + module.exports = function immediate(cb) { return process.nextTick(cb); }; diff --git a/lib/internal.js b/lib/internal.js index 0ec3dfed59..3205e8b4d3 100644 --- a/lib/internal.js +++ b/lib/internal.js @@ -2,6 +2,8 @@ * Dependencies */ +'use strict'; + const StateMachine = require('./statemachine'); const ActiveRoster = StateMachine.ctor('require', 'modify', 'init', 'default', 'ignore'); diff --git a/lib/promise_provider.js b/lib/promise_provider.js index e6e9e27955..3febf36878 100644 --- a/lib/promise_provider.js +++ b/lib/promise_provider.js @@ -2,6 +2,8 @@ * ignore */ +'use strict'; + const assert = require('assert'); const mquery = require('mquery'); diff --git a/lib/schema/buffer.js b/lib/schema/buffer.js index 57f44cbfe7..c0697392c9 100644 --- a/lib/schema/buffer.js +++ b/lib/schema/buffer.js @@ -2,6 +2,8 @@ * Module dependencies. */ +'use strict'; + const handleBitwiseOperator = require('./operators/bitwise'); const utils = require('../utils'); diff --git a/lib/schema/date.js b/lib/schema/date.js index 1743bb7f71..d81cc79f1a 100644 --- a/lib/schema/date.js +++ b/lib/schema/date.js @@ -2,6 +2,8 @@ * Module requirements. */ +'use strict'; + const MongooseError = require('../error'); const utils = require('../utils'); diff --git a/lib/schema/decimal128.js b/lib/schema/decimal128.js index 3aa5cd5b02..1139f77b69 100644 --- a/lib/schema/decimal128.js +++ b/lib/schema/decimal128.js @@ -4,6 +4,8 @@ * Module dependencies. */ +'use strict'; + const SchemaType = require('../schematype'); const CastError = SchemaType.CastError; const Decimal128Type = require('../types/decimal128'); diff --git a/lib/schema/index.js b/lib/schema/index.js index a34a3ad2b8..183a6e9846 100644 --- a/lib/schema/index.js +++ b/lib/schema/index.js @@ -3,6 +3,8 @@ * Module exports. */ +'use strict'; + exports.String = require('./string'); exports.Number = require('./number'); diff --git a/lib/schema/mixed.js b/lib/schema/mixed.js index c86434c99e..2a8d703bd1 100644 --- a/lib/schema/mixed.js +++ b/lib/schema/mixed.js @@ -2,6 +2,8 @@ * Module dependencies. */ +'use strict'; + const SchemaType = require('../schematype'); const utils = require('../utils'); diff --git a/lib/schema/objectid.js b/lib/schema/objectid.js index 91950aed2a..cb3c63117d 100644 --- a/lib/schema/objectid.js +++ b/lib/schema/objectid.js @@ -4,11 +4,9 @@ * Module dependencies. */ -let SchemaType = require('../schematype'), - CastError = SchemaType.CastError, - oid = require('../types/objectid'), - utils = require('../utils'), - Document; +'use strict'; + +let SchemaType = require('../schematype'), CastError = SchemaType.CastError, oid = require('../types/objectid'), utils = require('../utils'), Document; /** * ObjectId SchemaType constructor. diff --git a/lib/schema/operators/bitwise.js b/lib/schema/operators/bitwise.js index 06b6d73290..07e18cd0cb 100644 --- a/lib/schema/operators/bitwise.js +++ b/lib/schema/operators/bitwise.js @@ -2,6 +2,8 @@ * Module requirements. */ +'use strict'; + const CastError = require('../../error/cast'); /*! diff --git a/lib/schema/operators/geospatial.js b/lib/schema/operators/geospatial.js index cd221f016d..1934561354 100644 --- a/lib/schema/operators/geospatial.js +++ b/lib/schema/operators/geospatial.js @@ -2,6 +2,8 @@ * Module requirements. */ +'use strict'; + const castArraysOfNumbers = require('./helpers').castArraysOfNumbers; const castToNumber = require('./helpers').castToNumber; diff --git a/lib/statemachine.js b/lib/statemachine.js index 8ca9b6fb05..8036f5898f 100644 --- a/lib/statemachine.js +++ b/lib/statemachine.js @@ -3,6 +3,8 @@ * Module dependencies. */ +'use strict'; + const utils = require('./utils'); /*! diff --git a/lib/types/array.js b/lib/types/array.js index c8be418cd4..74a1f55b48 100644 --- a/lib/types/array.js +++ b/lib/types/array.js @@ -2,6 +2,8 @@ * Module dependencies. */ +'use strict'; + const EmbeddedDocument = require('./embedded'); const Document = require('../document'); const ObjectId = require('./objectid'); diff --git a/lib/types/buffer.js b/lib/types/buffer.js index 51e564d6d9..d0a938b8f0 100644 --- a/lib/types/buffer.js +++ b/lib/types/buffer.js @@ -2,6 +2,8 @@ * Module dependencies. */ +'use strict'; + const Binary = require('../driver').get().Binary; const utils = require('../utils'); const Buffer = require('safe-buffer').Buffer; @@ -169,14 +171,13 @@ MongooseBuffer.mixin = { ( // node < 0.5 - 'writeUInt8 writeUInt16 writeUInt32 writeInt8 writeInt16 writeInt32 ' + + ('writeUInt8 writeUInt16 writeUInt32 writeInt8 writeInt16 writeInt32 ' + 'writeFloat writeDouble fill ' + 'utf8Write binaryWrite asciiWrite set ' + // node >= 0.5 'writeUInt16LE writeUInt16BE writeUInt32LE writeUInt32BE ' + - 'writeInt16LE writeInt16BE writeInt32LE writeInt32BE ' + - 'writeFloatLE writeFloatBE writeDoubleLE writeDoubleBE' + 'writeInt16LE writeInt16BE writeInt32LE writeInt32BE ' + 'writeFloatLE writeFloatBE writeDoubleLE writeDoubleBE') ).split(' ').forEach(function(method) { if (!Buffer.prototype[method]) { return; diff --git a/lib/types/decimal128.js b/lib/types/decimal128.js index 7b4bbd2115..f0bae2a131 100644 --- a/lib/types/decimal128.js +++ b/lib/types/decimal128.js @@ -8,4 +8,6 @@ * @constructor ObjectId */ +'use strict'; + module.exports = require('../driver').get().Decimal128; diff --git a/lib/types/embedded.js b/lib/types/embedded.js index 5b151ceb00..961d045d6d 100644 --- a/lib/types/embedded.js +++ b/lib/types/embedded.js @@ -4,6 +4,8 @@ * Module dependencies. */ +'use strict'; + const Document = require('../document_provider')(); const EventEmitter = require('events').EventEmitter; const immediate = require('../helpers/immediate'); diff --git a/lib/types/index.js b/lib/types/index.js index f340ddb1d5..a1945a03d1 100644 --- a/lib/types/index.js +++ b/lib/types/index.js @@ -3,6 +3,8 @@ * Module exports. */ +'use strict'; + exports.Array = require('./array'); exports.Buffer = require('./buffer'); diff --git a/lib/types/objectid.js b/lib/types/objectid.js index 0b01eb1aa9..cbe9bd8b06 100644 --- a/lib/types/objectid.js +++ b/lib/types/objectid.js @@ -8,6 +8,8 @@ * @constructor ObjectId */ +'use strict'; + const ObjectId = require('../driver').get().ObjectId; /*! diff --git a/lib/virtualtype.js b/lib/virtualtype.js index 3924261e22..36b519556c 100644 --- a/lib/virtualtype.js +++ b/lib/virtualtype.js @@ -17,6 +17,8 @@ * @api public */ +'use strict'; + function VirtualType(options, name) { this.path = name; this.getters = []; diff --git a/package.json b/package.json index cdc1f50103..d1fad368b0 100644 --- a/package.json +++ b/package.json @@ -130,7 +130,11 @@ "space-infix-ops": "error", "space-unary-ops": "error", "no-var": "warn", - "prefer-const": "warn" + "prefer-const": "warn", + "strict": [ + "error", + "global" + ] } } } diff --git a/static.js b/static.js index cf1129fe63..940170b2c0 100644 --- a/static.js +++ b/static.js @@ -1,5 +1,7 @@ -const static = require('node-static'); -const server = new static.Server('.', {cache: 0}); +'use strict'; + +const nodeStatic = require('node-static'); +const server = new nodeStatic.Server('.', {cache: 0}); require('http').createServer(function(req, res) { if (req.url === '/favicon.ico') { diff --git a/test/cast.test.js b/test/cast.test.js index 9326362680..836dd4f36a 100644 --- a/test/cast.test.js +++ b/test/cast.test.js @@ -2,6 +2,8 @@ * Module dependencies. */ +'use strict'; + const Schema = require('../lib/schema'); const assert = require('power-assert'); const cast = require('../lib/cast'); diff --git a/test/collection.capped.test.js b/test/collection.capped.test.js index dc1158af1a..961440ea6c 100644 --- a/test/collection.capped.test.js +++ b/test/collection.capped.test.js @@ -2,11 +2,9 @@ * Module dependencies. */ -let start = require('./common'), - mongoose = start.mongoose, - assert = require('power-assert'), - Schema = mongoose.Schema, - random = require('../lib/utils').random; +'use strict'; + +let start = require('./common'), mongoose = start.mongoose, assert = require('power-assert'), Schema = mongoose.Schema, random = require('../lib/utils').random; /** * setup diff --git a/test/colors.js b/test/colors.js index 7673aeed92..dc4a295de5 100644 --- a/test/colors.js +++ b/test/colors.js @@ -2,13 +2,9 @@ * Module dependencies. */ -let start = require('./common'), - mongoose = start.mongoose, - assert = require('power-assert'), - Schema = mongoose.Schema, - MongooseDocumentArray = mongoose.Types.DocumentArray, - EmbeddedDocument = require('../lib/types/embedded'), - DocumentArray = require('../lib/types/documentarray'); +'use strict'; + +let start = require('./common'), mongoose = start.mongoose, assert = require('power-assert'), Schema = mongoose.Schema, MongooseDocumentArray = mongoose.Types.DocumentArray, EmbeddedDocument = require('../lib/types/embedded'), DocumentArray = require('../lib/types/documentarray'); /** * setup diff --git a/test/docs/promises.test.js b/test/docs/promises.test.js index a41894ba15..cc69caf4b8 100644 --- a/test/docs/promises.test.js +++ b/test/docs/promises.test.js @@ -1,3 +1,4 @@ +'use strict'; var PromiseProvider = require('../../lib/promise_provider'); var assert = require('power-assert'); var mongoose = require('../../'); diff --git a/test/docs/schematypes.test.js b/test/docs/schematypes.test.js index 28834d9d31..92a4fe0a9c 100644 --- a/test/docs/schematypes.test.js +++ b/test/docs/schematypes.test.js @@ -1,3 +1,4 @@ +'use strict'; var assert = require('assert'); var mongoose = require('../../'); diff --git a/test/docs/validation.test.js b/test/docs/validation.test.js index 3c0dde4bcc..55e5ad51db 100644 --- a/test/docs/validation.test.js +++ b/test/docs/validation.test.js @@ -1,3 +1,4 @@ +'use strict'; var assert = require('assert'); var mongoose = require('../../'); diff --git a/test/document.isselected.test.js b/test/document.isselected.test.js index 6ad79cac82..5a92e3cc68 100644 --- a/test/document.isselected.test.js +++ b/test/document.isselected.test.js @@ -2,6 +2,8 @@ * Module dependencies. */ +'use strict'; + const start = require('./common'); const mongoose = start.mongoose; const assert = require('power-assert'); diff --git a/test/document.modified.test.js b/test/document.modified.test.js index 8ae9b79e87..6c2e0fe48b 100644 --- a/test/document.modified.test.js +++ b/test/document.modified.test.js @@ -2,13 +2,9 @@ * Test dependencies. */ -let start = require('./common'), - assert = require('power-assert'), - mongoose = start.mongoose, - random = require('../lib/utils').random, - Schema = mongoose.Schema, - ObjectId = Schema.ObjectId, - DocumentObjectId = mongoose.Types.ObjectId; +'use strict'; + +let start = require('./common'), assert = require('power-assert'), mongoose = start.mongoose, random = require('../lib/utils').random, Schema = mongoose.Schema, ObjectId = Schema.ObjectId, DocumentObjectId = mongoose.Types.ObjectId; /** * Setup. diff --git a/test/document.populate.test.js b/test/document.populate.test.js index 19ffb0cec9..ffb30c89fd 100644 --- a/test/document.populate.test.js +++ b/test/document.populate.test.js @@ -3,14 +3,9 @@ * Test dependencies. */ -let start = require('./common'), - assert = require('power-assert'), - mongoose = start.mongoose, - utils = require('../lib/utils'), - random = utils.random, - Schema = mongoose.Schema, - ObjectId = Schema.ObjectId, - Document = require('../lib/document'); +'use strict'; + +let start = require('./common'), assert = require('power-assert'), mongoose = start.mongoose, utils = require('../lib/utils'), random = utils.random, Schema = mongoose.Schema, ObjectId = Schema.ObjectId, Document = require('../lib/document'); /** * Setup. diff --git a/test/document.strict.test.js b/test/document.strict.test.js index 1e35759d8b..22e4502dda 100644 --- a/test/document.strict.test.js +++ b/test/document.strict.test.js @@ -2,11 +2,9 @@ * Test dependencies. */ -let start = require('./common'), - mongoose = start.mongoose, - assert = require('power-assert'), - random = require('../lib/utils').random, - Schema = mongoose.Schema; +'use strict'; + +let start = require('./common'), mongoose = start.mongoose, assert = require('power-assert'), random = require('../lib/utils').random, Schema = mongoose.Schema; describe('document: strict mode:', function() { let db; diff --git a/test/document.unit.test.js b/test/document.unit.test.js index c70b638ea6..484d2c59a9 100644 --- a/test/document.unit.test.js +++ b/test/document.unit.test.js @@ -2,6 +2,8 @@ * Module dependencies. */ +'use strict'; + const assert = require('power-assert'); const start = require('./common'); const storeShard = require('../lib/plugins/sharding').storeShard; diff --git a/test/errors.validation.test.js b/test/errors.validation.test.js index 6f2ee74afb..bc6e867165 100644 --- a/test/errors.validation.test.js +++ b/test/errors.validation.test.js @@ -3,6 +3,8 @@ * Module dependencies. */ +'use strict'; + const assert = require('power-assert'); const start = require('./common'); const mongoose = start.mongoose; diff --git a/test/files/sample.js b/test/files/sample.js index 174fd1d820..c6394c6ebc 100644 --- a/test/files/sample.js +++ b/test/files/sample.js @@ -1,3 +1,4 @@ +'use strict'; import mongoose from '../../browser.js'; const doc = new mongoose.Document({}, new mongoose.Schema({ diff --git a/test/gh-1408.test.js b/test/gh-1408.test.js index f1d3d1bde6..c042cb2fe5 100644 --- a/test/gh-1408.test.js +++ b/test/gh-1408.test.js @@ -3,10 +3,9 @@ * Test dependencies. */ -let start = require('./common'), - assert = require('power-assert'), - mongoose = start.mongoose, - Schema = mongoose.Schema; +'use strict'; + +let start = require('./common'), assert = require('power-assert'), mongoose = start.mongoose, Schema = mongoose.Schema; describe('documents should not be converted to _id (gh-1408)', function() { it('if an embedded doc', function(done) { diff --git a/test/model.aggregate.test.js b/test/model.aggregate.test.js index f1830bf66b..b740c40b49 100644 --- a/test/model.aggregate.test.js +++ b/test/model.aggregate.test.js @@ -3,6 +3,8 @@ * Test dependencies. */ +'use strict'; + const Aggregate = require('../lib/aggregate'); const assert = require('assert'); const random = require('../lib/utils').random; diff --git a/test/model.discriminator.querying.test.js b/test/model.discriminator.querying.test.js index 97e553aeff..7b9d6cfa48 100644 --- a/test/model.discriminator.querying.test.js +++ b/test/model.discriminator.querying.test.js @@ -2,6 +2,8 @@ * Test dependencies. */ +'use strict'; + const start = require('./common'); const mongoose = start.mongoose; const Schema = mongoose.Schema; diff --git a/test/model.field.selection.test.js b/test/model.field.selection.test.js index 87bd765ca9..9acb6d547e 100644 --- a/test/model.field.selection.test.js +++ b/test/model.field.selection.test.js @@ -2,13 +2,9 @@ * Test dependencies. */ -let start = require('./common'), - assert = require('power-assert'), - mongoose = start.mongoose, - random = require('../lib/utils').random, - Schema = mongoose.Schema, - ObjectId = Schema.Types.ObjectId, - DocumentObjectId = mongoose.Types.ObjectId; +'use strict'; + +let start = require('./common'), assert = require('power-assert'), mongoose = start.mongoose, random = require('../lib/utils').random, Schema = mongoose.Schema, ObjectId = Schema.Types.ObjectId, DocumentObjectId = mongoose.Types.ObjectId; describe('model field selection', function() { let Comments; diff --git a/test/model.geosearch.test.js b/test/model.geosearch.test.js index 0af5ae5f2d..ebe3857022 100644 --- a/test/model.geosearch.test.js +++ b/test/model.geosearch.test.js @@ -1,4 +1,5 @@ +'use strict'; let start = require('./common'), assert = require('power-assert'), mongoose = start.mongoose, diff --git a/test/model.hydrate.test.js b/test/model.hydrate.test.js index f1c32a8fcd..19041d329c 100644 --- a/test/model.hydrate.test.js +++ b/test/model.hydrate.test.js @@ -2,11 +2,9 @@ * Test dependencies. */ -let start = require('./common'), - assert = require('power-assert'), - mongoose = start.mongoose, - Schema = mongoose.Schema, - DocumentObjectId = mongoose.Types.ObjectId; +'use strict'; + +let start = require('./common'), assert = require('power-assert'), mongoose = start.mongoose, Schema = mongoose.Schema, DocumentObjectId = mongoose.Types.ObjectId; describe('model', function() { let schemaB; diff --git a/test/model.mapreduce.test.js b/test/model.mapreduce.test.js index 1b8e567fb5..2c481dc775 100644 --- a/test/model.mapreduce.test.js +++ b/test/model.mapreduce.test.js @@ -3,12 +3,9 @@ * Test dependencies. */ -let start = require('./common'), - mongoose = start.mongoose, - assert = require('power-assert'), - random = require('../lib/utils').random, - Schema = mongoose.Schema, - ObjectId = Schema.Types.ObjectId; +'use strict'; + +let start = require('./common'), mongoose = start.mongoose, assert = require('power-assert'), random = require('../lib/utils').random, Schema = mongoose.Schema, ObjectId = Schema.Types.ObjectId; describe('model: mapreduce:', function() { let Comments; diff --git a/test/model.populate.divergent.test.js b/test/model.populate.divergent.test.js index 1bba2e0db9..a0b3ca7387 100644 --- a/test/model.populate.divergent.test.js +++ b/test/model.populate.divergent.test.js @@ -3,12 +3,9 @@ * Test dependencies. */ -let start = require('./common'), - assert = require('power-assert'), - mongoose = start.mongoose, - DivergentArrayError = mongoose.Error.DivergentArrayError, - utils = require('../lib/utils'), - random = utils.random; +'use strict'; + +let start = require('./common'), assert = require('power-assert'), mongoose = start.mongoose, DivergentArrayError = mongoose.Error.DivergentArrayError, utils = require('../lib/utils'), random = utils.random; /** * Tests. diff --git a/test/model.populate.setting.test.js b/test/model.populate.setting.test.js index 349c30dcf8..7cb63b72d3 100644 --- a/test/model.populate.setting.test.js +++ b/test/model.populate.setting.test.js @@ -4,14 +4,9 @@ * Test dependencies. */ -let start = require('./common'), - assert = require('power-assert'), - mongoose = start.mongoose, - utils = require('../lib/utils'), - random = utils.random, - Schema = mongoose.Schema, - DocObjectId = mongoose.Types.ObjectId, - Buffer = require('safe-buffer').Buffer; +'use strict'; + +let start = require('./common'), assert = require('power-assert'), mongoose = start.mongoose, utils = require('../lib/utils'), random = utils.random, Schema = mongoose.Schema, DocObjectId = mongoose.Types.ObjectId, Buffer = require('safe-buffer').Buffer; /** * Setup. diff --git a/test/model.translateAliases.test.js b/test/model.translateAliases.test.js index 83a5ca414e..8056e95b4a 100644 --- a/test/model.translateAliases.test.js +++ b/test/model.translateAliases.test.js @@ -2,9 +2,9 @@ * Test dependencies. */ -let start = require('./common'), - assert = require('power-assert'), - mongoose = start.mongoose; +'use strict'; + +let start = require('./common'), assert = require('power-assert'), mongoose = start.mongoose; describe('model translate aliases', function() { it('should translate correctly', function() { diff --git a/test/object.create.null.test.js b/test/object.create.null.test.js index 0c3328bab2..35ebcbf0d7 100644 --- a/test/object.create.null.test.js +++ b/test/object.create.null.test.js @@ -2,10 +2,9 @@ * Test dependencies. */ -let start = require('./common'), - assert = require('power-assert'), - mongoose = start.mongoose, - Schema = mongoose.Schema; +'use strict'; + +let start = require('./common'), assert = require('power-assert'), mongoose = start.mongoose, Schema = mongoose.Schema; let schema; diff --git a/test/query.cursor.test.js b/test/query.cursor.test.js index 71d4023b87..a1c4752aec 100644 --- a/test/query.cursor.test.js +++ b/test/query.cursor.test.js @@ -2,6 +2,8 @@ * Module dependencies. */ +'use strict'; + const assert = require('assert'); const start = require('./common'); diff --git a/test/query.middleware.test.js b/test/query.middleware.test.js index 274d5c2650..472c388f58 100644 --- a/test/query.middleware.test.js +++ b/test/query.middleware.test.js @@ -1,3 +1,4 @@ +'use strict'; const start = require('./common'); const assert = require('power-assert'); const mongoose = start.mongoose; diff --git a/test/schema.boolean.test.js b/test/schema.boolean.test.js index 862b451d07..358eb4a4e0 100644 --- a/test/schema.boolean.test.js +++ b/test/schema.boolean.test.js @@ -3,10 +3,9 @@ * Module dependencies. */ -let start = require('./common'), - mongoose = start.mongoose, - assert = require('power-assert'), - Schema = mongoose.Schema; +'use strict'; + +let start = require('./common'), mongoose = start.mongoose, assert = require('power-assert'), Schema = mongoose.Schema; describe('schematype', function() { let db; diff --git a/test/schema.date.test.js b/test/schema.date.test.js index dc62afedb9..0c2fb1a034 100644 --- a/test/schema.date.test.js +++ b/test/schema.date.test.js @@ -1,3 +1,4 @@ +'use strict'; let start = require('./common'), mongoose = start.mongoose, assert = require('power-assert'), diff --git a/test/schema.documentarray.test.js b/test/schema.documentarray.test.js index 5612726d14..978b5bc4e2 100644 --- a/test/schema.documentarray.test.js +++ b/test/schema.documentarray.test.js @@ -2,10 +2,9 @@ * Module dependencies. */ -let start = require('./common'), - mongoose = start.mongoose, - assert = require('power-assert'), - Schema = mongoose.Schema; +'use strict'; + +let start = require('./common'), mongoose = start.mongoose, assert = require('power-assert'), Schema = mongoose.Schema; /** * Test. diff --git a/test/schema.mixed.test.js b/test/schema.mixed.test.js index 9fb2de9b72..f762809c1f 100644 --- a/test/schema.mixed.test.js +++ b/test/schema.mixed.test.js @@ -3,10 +3,9 @@ * Module dependencies. */ -let start = require('./common'), - mongoose = new start.mongoose.Mongoose, - assert = require('power-assert'), - Schema = mongoose.Schema; +'use strict'; + +let start = require('./common'), mongoose = new start.mongoose.Mongoose, assert = require('power-assert'), Schema = mongoose.Schema; describe('schematype mixed', function() { describe('empty object defaults (gh-1380)', function() { diff --git a/test/schema.onthefly.test.js b/test/schema.onthefly.test.js index 30e6f81544..b3f455febc 100644 --- a/test/schema.onthefly.test.js +++ b/test/schema.onthefly.test.js @@ -1,3 +1,4 @@ +'use strict'; let start = require('./common'), assert = require('power-assert'), mongoose = start.mongoose, diff --git a/test/schema.type.test.js b/test/schema.type.test.js index f357b8d1ad..8d3611abca 100644 --- a/test/schema.type.test.js +++ b/test/schema.type.test.js @@ -3,9 +3,9 @@ * Module dependencies. */ -let mongoose = require('./common').mongoose, - assert = require('power-assert'), - Schema = mongoose.Schema; +'use strict'; + +let mongoose = require('./common').mongoose, assert = require('power-assert'), Schema = mongoose.Schema; describe('schematype', function() { it('honors the selected option', function(done) { diff --git a/test/shard.test.js b/test/shard.test.js index f29d71dac9..f9c3525b36 100644 --- a/test/shard.test.js +++ b/test/shard.test.js @@ -1,3 +1,5 @@ +/* eslint strict: 0 */ + let start = require('./common'), assert = require('power-assert'), random = require('../lib/utils').random, diff --git a/test/types.array.test.js b/test/types.array.test.js index 972d3c6683..0f0135e219 100644 --- a/test/types.array.test.js +++ b/test/types.array.test.js @@ -2,6 +2,8 @@ * Module dependencies. */ +'use strict'; + const start = require('./common'); const assert = require('power-assert'); const mongoose = require('./common').mongoose; diff --git a/test/types.buffer.test.js b/test/types.buffer.test.js index e311f69596..a7a15028a4 100644 --- a/test/types.buffer.test.js +++ b/test/types.buffer.test.js @@ -2,13 +2,9 @@ * Module dependencies. */ -let start = require('./common'), - assert = require('power-assert'), - mongoose = require('./common').mongoose, - Schema = mongoose.Schema, - random = require('../lib/utils').random, - MongooseBuffer = mongoose.Types.Buffer, - Buffer = require('safe-buffer').Buffer; +'use strict'; + +let start = require('./common'), assert = require('power-assert'), mongoose = require('./common').mongoose, Schema = mongoose.Schema, random = require('../lib/utils').random, MongooseBuffer = mongoose.Types.Buffer, Buffer = require('safe-buffer').Buffer; function valid(v) { return !v || v.length > 10; diff --git a/test/types.document.test.js b/test/types.document.test.js index f13615694c..1beeba5da6 100644 --- a/test/types.document.test.js +++ b/test/types.document.test.js @@ -3,6 +3,8 @@ * Module dependencies. */ +'use strict'; + const assert = require('power-assert'); const start = require('./common'); const mongoose = start.mongoose; diff --git a/test/types.embeddeddocument.test.js b/test/types.embeddeddocument.test.js index 2934087d22..0ac0569865 100644 --- a/test/types.embeddeddocument.test.js +++ b/test/types.embeddeddocument.test.js @@ -3,10 +3,9 @@ * Module dependencies. */ -let assert = require('power-assert'), - start = require('./common'), - mongoose = start.mongoose, - Schema = mongoose.Schema; +'use strict'; + +let assert = require('power-assert'), start = require('./common'), mongoose = start.mongoose, Schema = mongoose.Schema; /** * Test. diff --git a/test/types.number.test.js b/test/types.number.test.js index 547ec334ab..bc00c8f51d 100644 --- a/test/types.number.test.js +++ b/test/types.number.test.js @@ -3,9 +3,9 @@ * Module dependencies. */ -let mongoose = require('./common').mongoose, - SchemaNumber = mongoose.Schema.Types.Number, - assert = require('power-assert'); +'use strict'; + +let mongoose = require('./common').mongoose, SchemaNumber = mongoose.Schema.Types.Number, assert = require('power-assert'); /** * Test. diff --git a/test/types.subdocument.test.js b/test/types.subdocument.test.js index 592a354b26..27055d64c2 100644 --- a/test/types.subdocument.test.js +++ b/test/types.subdocument.test.js @@ -3,10 +3,9 @@ * Module dependencies. */ -let assert = require('power-assert'), - start = require('./common'), - mongoose = start.mongoose, - Schema = mongoose.Schema; +'use strict'; + +let assert = require('power-assert'), start = require('./common'), mongoose = start.mongoose, Schema = mongoose.Schema; /** * Test. diff --git a/test/updateValidators.unit.test.js b/test/updateValidators.unit.test.js index eeefee3c40..a7187ff2b0 100644 --- a/test/updateValidators.unit.test.js +++ b/test/updateValidators.unit.test.js @@ -1,3 +1,4 @@ +'use strict'; const assert = require('power-assert'); const updateValidators = require('../lib/helpers/updateValidators'); const emitter = require('events').EventEmitter; diff --git a/test/utils.test.js b/test/utils.test.js index 0390ebaf85..c8907f0107 100644 --- a/test/utils.test.js +++ b/test/utils.test.js @@ -3,15 +3,9 @@ * Module dependencies. */ -let start = require('./common'), - mongoose = start.mongoose, - Schema = mongoose.Schema, - utils = require('../lib/utils'), - StateMachine = require('../lib/statemachine'), - ObjectId = require('../lib/types/objectid'), - MongooseBuffer = require('../lib/types/buffer'), - Buffer = require('safe-buffer').Buffer, - assert = require('power-assert'); +'use strict'; + +let start = require('./common'), mongoose = start.mongoose, Schema = mongoose.Schema, utils = require('../lib/utils'), StateMachine = require('../lib/statemachine'), ObjectId = require('../lib/types/objectid'), MongooseBuffer = require('../lib/types/buffer'), Buffer = require('safe-buffer').Buffer, assert = require('power-assert'); /** * Setup.