Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

d6

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d6 - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

3

chug/chug.js
var cwd = process.cwd();
var pkg = require('../package.json');
exports.version = require('../package.json').version;
exports.version = pkg.version;

@@ -5,0 +6,0 @@ require('figlet').text('D6 Client v' + exports.version, {font: 'Standard'}, function (err, figlet) {

/**
* ____ __ ____ _ _ _ ___ _ _ _
* | _ \ / /_ / ___| (_) ___ _ __ | |_ __ __/ _ \ / || || |
* | | | | '_ \ | | | | |/ _ \ '_ \| __| \ \ / / | | || || || |_
* | |_| | (_) | | |___| | | __/ | | | |_ \ V /| |_| || ||__ _|
* |____/ \___/ \____|_|_|\___|_| |_|\__| \_/ \___(_)_(_) |_|
* ____ __ ____ _ _ _ ___ _ __
* | _ \ / /_ / ___| (_) ___ _ __ | |_ __ __/ _ \ / | / /_
* | | | | '_ \ | | | | |/ _ \ '_ \| __| \ \ / / | | || || '_ \
* | |_| | (_) | | |___| | | __/ | | | |_ \ V /| |_| || || (_) |
* |____/ \___/ \____|_|_|\___|_| |_|\__| \_/ \___(_)_(_)___/
*

@@ -22,3 +22,3 @@ *

* https://github.com/lighterio/jymin/blob/master/scripts/types.js
* https://github.com/lighterio/lighter/blob/master/node_modules/d6/scripts/d6-jymin.js
* https://github.com/lighterio/d6/blob/master/scripts/d6-jymin.js
*/

@@ -46,2 +46,10 @@

/**
* Get an XHR upload object.
*/
var getUpload = function () {
var xhr = getXhr();
return xhr ? xhr.upload : false;
};
/**
* Make an AJAX request, and handle it with success or failure.

@@ -226,3 +234,3 @@ * @return boolean: True if AJAX is supported.

) {
return isInstance(array) ? array[0] : undefined;
return isArray(array) ? array[0] : undefined;
};

@@ -1012,3 +1020,3 @@

var found = false;
if ((part[0] == '#') && part == target.id) {
if ('#' + target.id == part) {
found = true;

@@ -1058,4 +1066,3 @@ }

}
customData = customData || {};
customData._TRIGGERED = true;
event._TRIGGERED = true;

@@ -1271,2 +1278,9 @@ var handlers = element._HANDLERS;

/**
* Get the type of a form element.
*/
var getType = function (input) {
return ensureString(input.type)[0];
};
/**
* Get the value of a form element.

@@ -1279,3 +1293,3 @@ */

if (input) {
var type = input.type[0];
var type = getType(input);
var value = input.value;

@@ -1296,3 +1310,3 @@ var checked = input.checked;

else if (options) {
value = options[input.selectedIndex].value;
value = getValue(options[input.selectedIndex]);
}

@@ -1312,3 +1326,3 @@ return value;

if (input) {
var type = input.type[0];
var type = getType(input);
var options = input.options;

@@ -1694,2 +1708,8 @@ if (type == 'c' || type == 'r') {

// If the browser doesn't work with D6, dont start D6
if (!history.pushState) {
window.D6 = {};
return;
}
/**

@@ -2068,2 +2088,1 @@ * The D6 function accepts new templates from /d6.js, etc.

})();

@@ -1,1 +0,1 @@

!function(n){var t=function(){},e=t,r=t,o=function(){var t=n.XMLHttpRequest,e=n.ActiveXObject;return t?new t:e?new e("Microsoft.XMLHTTP"):!1},i=function(n,t,u,c){tt(t)&&(c=u,u=t,t=0);var a=o();return a&&(c=c||r,u=u||e,a.onreadystatechange=function(){if(4==a.readyState){j('[Jymin] Received response from "'+n+'". ('+i._WAITING+" in progress)."),--i._WAITING;var t=a.status,o=200==t,f=o?u||e:c||r,s=parse(a.responseText);s._STATUS=t,s._REQUEST=a,f(s)}},a.open(t?"POST":"GET",n,!0),a.setRequestHeader("x-requested-with","XMLHttpRequest"),t&&a.setRequestHeader("content-type","application/x-www-form-urlencoded"),a._URL=n,t&&(a._BODY=t),a._TIME=getTime(),i._WAITING=(i._WAITING||0)+1,j('[Jymin] Sending request to "'+n+'". ('+i._WAITING+" in progress)."),a.send(t||null)),!0},u=function(n,t){if(n)for(var e=0,r=f(n);r>e;e++){var o=t(n[e],e,n);if(o===!1)break}},c=function(n,t){if(n)for(var e in n){var r=t(e,n[e],n);if(r===!1)break}},a=function(n,t){return n&&t&&c(t,function(t,e){n[t]=e}),n},f=function(n){return et(n)||nt(n)?n.length:0},s=function(n,t){return rt(n)&&n.push(t),t},l=function(n){for(var t=function(t){n.push(t)},e=1,r=arguments.length;r>e;e++)u(arguments[e],t)},p=function(n,t){return f(arguments)<2&&(t=n,n=document),nt(t)?n.getElementById(t):t},v=function(n,t){return f(arguments)<2&&(t=n,n=document),n.getElementsByTagName(t||"*")},d=function(n,t){f(arguments)<2&&(t=n,n=document),t=t.split(".");var e,r=(t[0]||"*").toUpperCase(),o=t[1],i="*"==r;return o?(e=[],n.getElementsByClassName?u(n.getElementsByClassName(o),function(n){(i||n.tagName==r)&&e.push(n)}):u(v(n,r),function(n){A(n,o)&&e.push(n)})):e=v(n,r),e},m=function(n,t){var e=(p(n)||{}).parentNode;return t&&e&&e.tagName!=t&&(e=m(e,t)),e},_=function(n){if(!nt(n))return n;n=n||"";var t=n.split("?"),e=t[0].split("."),r=e.slice(1).join(" "),o=e[0].split("#"),i=o[0]||"div",c=o[1],a=t[1],f=_[i]||(_[i]=document.createElement(i)),s=f.cloneNode(!0);return c&&(s.id=c),r&&(s.className=r),a&&(a=a.split("&"),u(a,function(n){var t=n.split("="),e=Y(t[0]),r=Y(t[1]);s[e]=r,s.setAttribute(e,r)})),s},g=function(n,t,e){var r=_(t);return n&&E(n,r,e),r},T=function(n){return p(n).childNodes},E=function(n,t,e){n=p(n),t=p(t),n&&t&&(Z(e)&&(e=T(n)[e]),n.insertBefore(t,e||null))},D=function(n,t){n=p(n),n&&(n.innerHTML=t)},h=function(n,t){return n=p(n),n?n.getAttribute(t):void 0},N=function(n,t){return h(n,"data-"+t)},R=function(n){return n=p(n),n?n.className:void 0},A=function(n,t){var e=new RegExp("(^|\\s)"+t+"(\\s|$)");return e.test(R(n))},L=function(n,t){n=p(n),n&&(n.className+=" "+t)},I=function(n,t){if(n=p(n)){var e=R(n).split(/\s/),r=[];u(e,function(n){n!=t&&r.push(n)}),n.className=r.join(" ")}},y=function(n,t){var e=v("head")[0],r=g(e,"script");t&&(r.onload=t,r.onreadystatechange=function(){w(r)&&t()}),r.src=n},C=function(n,t,e){(!t||tt(t))&&(e=t,t=n,n=document);var r;if(P(t,",")){r=[];var o=$(t);u(o,function(t){var e=C(n,t);f(e)&&l(r,e)})}else if(P(t," ")){var i=t.indexOf(" "),c=t.substr(0,i),a=t.substr(i+1);r=[],C(n,c,function(n){var t=C(n,a);l(r,t)})}else if("#"==t[0]){var s=t.substr(1),v=p(n.ownerDocument||document,s);if(v)for(var _=m(v);_;){if(_===n){r=[v];break}_=m(_)}}else r=d(n,t);return e&&u(r,e),r||[]},b=function(n,t,e){return C(n,t,e)[0]},O=function(t,e,r,o){var i=rt(c);if(i||P(e," ")){var c=i?e:F(e);return void u(c,function(n){O(t,n,r,o)})}if(t=p(t)){var a=function(i){i=i||n.event;var u=i.target||i.srcElement;3==u.nodeType&&(u=m(u));var c=i.relatedTarget||i.toElement;if("mouseout"==e)for(;c=m(c);)if(c==u)return;var a=r(t,i,u,o);a===!1&&G(i)};t.addEventListener?t.addEventListener(e,a,!0):t.attachEvent?t.attachEvent("on"+e,a):t["on"+e]=a;var f=t._HANDLERS=t._HANDLERS||{},l=f[e]=f[e]||[];s(l,r)}},S=function(n,t,e,r,o){tt(t)?(o=e,r=t,e=n,t="",n=document):tt(e)&&(o=r,r=e,e=t,t=n,n=document);var i=t.split(","),c=function(n,t,e,o){u(i,function(i){var u=!1;if("#"==i[0]&&i==e.id)u=!0;else{var c=i.split("."),a=c[0].toUpperCase(),f=c[1];a&&e.tagName!=a||(!f||A(e,f))&&(u=!0)}if(u){var s=r(e,t,n,o);s===!1&&G(t)}}),e=m(e),e&&c(n,t,e,o)};O(n,e,c,o)},G=function(n){n?n.preventDefault&&n.preventDefault():W("[Jymin] Called preventDefault on a non-event.",n)},w=function(n){var t=n.readyState;return"complete"==t||"script"==n.tagName&&"loaded"==t},H=function(n){if(n=p(n)){var t=n.type[0],e=n.value,r=n.checked,o=n.options;return"c"==t||"r"==t?e=r?e:null:n.multiple?(e=[],u(o,function(n){n.selected&&s(e,n.value)})):o&&(e=o[n.selectedIndex].value),e}},U=function(){var t=n.history||{};return u(["push","replace"],function(n){var e=t[n+"State"];t[n]=function(n){e&&e.apply(t,[null,null,n])}}),t},x=function(n){U().push(n)},k=function(n){U().replace(n)},B=function(t){O(n,"popstate",t)},W=function(){q("error",arguments)},j=function(){q("log",arguments)},q=function(t,e){var r=n.console;r&&r[t]&&r[t].apply(r,e)},M=function(n){return nt(n)?n:""+n},P=function(n,t){return M(n).indexOf(t)>-1},V=function(n,t){return 0==M(n).indexOf(t)},X=function(n){return M(n).replace(/^\s+|\s+$/g,"")},$=function(n){return M(n).split(",")},F=function(n){return M(n).split(" ")},J=function(n,t,e){var r=n.match(t);r&&e.apply(n,r)},K=function(n){return M(n).toLowerCase()},Q=function(n){return encodeURIComponent(n)},Y=function(n){return decodeURIComponent(n)},z=function(n,t){return typeof n==t},Z=function(n){return z(n,"number")},nt=function(n){return z(n,"string")},tt=function(n){return z(n,"function")},et=function(n,t){return n instanceof(t||Object)},rt=function(n){return et(n,Array)};!function(){var t=n.D6=function(n){a(e,n),o||c()},e=t._VIEWS={},r=t._CACHE={},o=(t._RENDER=function(n,r){return e[n].call(e,r||t._CONTEXT)},!1),c=function(){S("a","click",function(n,t){var e=l(n.href);if(e){var r=t.which,o=!r||1==r;f(e)&&o&&(G(t),_(e,0,n))}}),S("a","mouseover",function(n){if(!A(n,"_NOPREFETCH")){var t=l(n.href),e=t!=l(location);e&&f(t)&&m(t)}}),S("input,select,textarea","change",function(n){var t=n.form;t&&(t._LAST_CHANGED=getTime())}),S("input,button","click",function(n){if("submit"==n.type){var t=n.form;t&&t._CLICKED_BUTTON!=n&&(t._CLICKED_BUTTON=n,t._LAST_CHANGED=getTime())}}),S("form","submit",function(n,t){var e=l(n.action||location.href.replace(/\?.*$/,"")),r=h(n,"enctype"),o="get"==K(n.method);if(f(e)&&!/multipart/.test(r)){G(t);var i=n._VALIDATE?n._VALIDATE():!0;if(!i)return;var c=[];C(n,"input,select,textarea,button",function(t){var e=t.name,r=t.type,o=H(t),i=!e;i=i||"radio"==r&&!o,i=i||"submit"==r&&t!=n._CLICKED_BUTTON,i||(nt(o)?s(c,Q(e)+"="+Q(o)):u(o,function(n){s(c,Q(e)+"="+Q(n))}))}),o?(e+=(P(e,"?")?"&":"?")+c.join("&"),c=0):(e=v(e,n._LAST_CHANGED),c=c.join("&")),_(e,c,n)}});B(function(){_(location)}),o=!0},f=function(n){return V(n,location.protocol+"//"+location.host+"/")},l=function(n){return M(n).replace(/#.*$/,"")},p=function(n){return M(n).replace(/\?.*$/,"")},v=function(n,t){return n+(P(n,"?")?"&":"?")+"d6="+(t||1)},d=function(n){return M(n).replace(/[&\?]d6=[r\d]+/g,"")},m=function(n){r[n]||(j('[D6] Prefetching "'+n+'".'),r[n]=[function(t){j('[D6] Caching contents for prefetched URL "'+n+'".'),r[n]=t;var e=t.ttl||1e4;setTimeout(function(){rt(r[n])||(j('[D6] Removing "'+n+'" from prefetch cache.'),delete r[n])},e)}],g(n))},_=t._LOAD_URL=function(n,e,o){t._LOADING_URL=d(n),t._LOAD_STARTED=getTime();var i=N(o,"_D6_TARGET"),u=N(o,"_D6_VIEW");i&&C(i,function(n){L(n,"_D6_TARGET")}),j('[D6] Loading "'+n+'".'),C("._SPINNER",function(n){L(n,"_LOADING")});var c=function(n,t){T(n,t,i,u)},a=r[n];a?rt(a)?(j('[D6] Queueing callback for "'+n+'".'),s(a,c)):(j('[D6] Found precached response for "'+n+'".'),c(a,n)):(j('[D6] Creating callback queue for "'+n+'".'),r[n]=[c],g(n,e))},g=function(n,t){j('[D6] Fetching response for "'+n+'".');var e=v(n),o=function(t){var e=r[n];r[n]=t,j("[D6] Running "+e.length+' callback(s) for "'+n+'".'),u(e,function(e){e(t,n)})};i(e,t,o,o,1)},T=function(o,i,u,c){t._CONTEXT=o;var a,f=(o._ERROR,d(o.d6u||i)),s=c||o.d6||"error0",l=t._VIEW=e[s];if(i=d(i),i==t._LOADING_URL&&(C("._SPINNER,._D6_TARGET",function(n){I(n,"_LOADING")}),"<"==X(o)[0]?(a=o,j("[D6] Rendering HTML string")):l?(a=l.call(e,o),j('[D6] Rendering view "'+s+'".')):(W('[D6] View "'+s+'" not found. Changing location.'),n.location=f)),a){E(a,u);var v=p(f)==p(location.href),m=v?k:x;m(f),delete r[i]}},E=function(n,t){var e=document.body;J(n,/<title.*?>([\s\S]+)<\/title>/,function(n,t){document.title=t});var r=[];n=n.replace(/<script.*?>([\s\S]*?)<\/script>/g,function(n,t){return t&&(r.push(t),n=""),n}),t?(C(t,function(t){D(t,n)}),u(r,execute),C(t,function(n){onReady(n)})):(J(n,/<body.*?>([\s\S]+)<\/body>/,function(n,t){D(e,t),e.scrollTop=0}),u(r,execute),onReady(document))},R="";b("link,script",function(n){var t="?v=",e=M(n.src||n.href).split(t);e[1]&&(R=t+e[1])}),y("/d6.js"+R)}()}(window);
!function(n){var t=function(){},e=t,r=t,o=function(){var t=n.XMLHttpRequest,e=n.ActiveXObject;return t?new t:e?new e("Microsoft.XMLHTTP"):!1},i=function(n,t,u,c){et(t)&&(c=u,u=t,t=0);var a=o();return a&&(c=c||r,u=u||e,a.onreadystatechange=function(){if(4==a.readyState){q('[Jymin] Received response from "'+n+'". ('+i._WAITING+" in progress)."),--i._WAITING;var t=a.status,o=200==t,f=o?u||e:c||r,s=parse(a.responseText);s._STATUS=t,s._REQUEST=a,f(s)}},a.open(t?"POST":"GET",n,!0),a.setRequestHeader("x-requested-with","XMLHttpRequest"),t&&a.setRequestHeader("content-type","application/x-www-form-urlencoded"),a._URL=n,t&&(a._BODY=t),a._TIME=getTime(),i._WAITING=(i._WAITING||0)+1,q('[Jymin] Sending request to "'+n+'". ('+i._WAITING+" in progress)."),a.send(t||null)),!0},u=function(n,t){if(n)for(var e=0,r=f(n);r>e;e++){var o=t(n[e],e,n);if(o===!1)break}},c=function(n,t){if(n)for(var e in n){var r=t(e,n[e],n);if(r===!1)break}},a=function(n,t){return n&&t&&c(t,function(t,e){n[t]=e}),n},f=function(n){return rt(n)||tt(n)?n.length:0},s=function(n,t){return ot(n)&&n.push(t),t},l=function(n){for(var t=function(t){n.push(t)},e=1,r=arguments.length;r>e;e++)u(arguments[e],t)},p=function(n,t){return f(arguments)<2&&(t=n,n=document),tt(t)?n.getElementById(t):t},v=function(n,t){return f(arguments)<2&&(t=n,n=document),n.getElementsByTagName(t||"*")},d=function(n,t){f(arguments)<2&&(t=n,n=document),t=t.split(".");var e,r=(t[0]||"*").toUpperCase(),o=t[1],i="*"==r;return o?(e=[],n.getElementsByClassName?u(n.getElementsByClassName(o),function(n){(i||n.tagName==r)&&e.push(n)}):u(v(n,r),function(n){R(n,o)&&e.push(n)})):e=v(n,r),e},m=function(n,t){var e=(p(n)||{}).parentNode;return t&&e&&e.tagName!=t&&(e=m(e,t)),e},_=function(n){if(!tt(n))return n;n=n||"";var t=n.split("?"),e=t[0].split("."),r=e.slice(1).join(" "),o=e[0].split("#"),i=o[0]||"div",c=o[1],a=t[1],f=_[i]||(_[i]=document.createElement(i)),s=f.cloneNode(!0);return c&&(s.id=c),r&&(s.className=r),a&&(a=a.split("&"),u(a,function(n){var t=n.split("="),e=z(t[0]),r=z(t[1]);s[e]=r,s.setAttribute(e,r)})),s},g=function(n,t,e){var r=_(t);return n&&E(n,r,e),r},T=function(n){return p(n).childNodes},E=function(n,t,e){n=p(n),t=p(t),n&&t&&(nt(e)&&(e=T(n)[e]),n.insertBefore(t,e||null))},h=function(n,t){n=p(n),n&&(n.innerHTML=t)},D=function(n,t){return n=p(n),n?n.getAttribute(t):void 0},N=function(n,t){return D(n,"data-"+t)},A=function(n){return n=p(n),n?n.className:void 0},R=function(n,t){var e=new RegExp("(^|\\s)"+t+"(\\s|$)");return e.test(A(n))},L=function(n,t){n=p(n),n&&(n.className+=" "+t)},I=function(n,t){if(n=p(n)){var e=A(n).split(/\s/),r=[];u(e,function(n){n!=t&&r.push(n)}),n.className=r.join(" ")}},y=function(n,t){var e=v("head")[0],r=g(e,"script");t&&(r.onload=t,r.onreadystatechange=function(){w(r)&&t()}),r.src=n},C=function(n,t,e){(!t||et(t))&&(e=t,t=n,n=document);var r;if(V(t,",")){r=[];var o=F(t);u(o,function(t){var e=C(n,t);f(e)&&l(r,e)})}else if(V(t," ")){var i=t.indexOf(" "),c=t.substr(0,i),a=t.substr(i+1);r=[],C(n,c,function(n){var t=C(n,a);l(r,t)})}else if("#"==t[0]){var s=t.substr(1),v=p(n.ownerDocument||document,s);if(v)for(var _=m(v);_;){if(_===n){r=[v];break}_=m(_)}}else r=d(n,t);return e&&u(r,e),r||[]},b=function(n,t,e){return C(n,t,e)[0]},S=function(t,e,r,o){var i=ot(c);if(i||V(e," ")){var c=i?e:J(e);return void u(c,function(n){S(t,n,r,o)})}if(t=p(t)){var a=function(i){i=i||n.event;var u=i.target||i.srcElement;3==u.nodeType&&(u=m(u));var c=i.relatedTarget||i.toElement;if("mouseout"==e)for(;c=m(c);)if(c==u)return;var a=r(t,i,u,o);a===!1&&G(i)};t.addEventListener?t.addEventListener(e,a,!0):t.attachEvent?t.attachEvent("on"+e,a):t["on"+e]=a;var f=t._HANDLERS=t._HANDLERS||{},l=f[e]=f[e]||[];s(l,r)}},O=function(n,t,e,r,o){et(t)?(o=e,r=t,e=n,t="",n=document):et(e)&&(o=r,r=e,e=t,t=n,n=document);var i=t.split(","),c=function(n,t,e,o){u(i,function(i){var u=!1;if("#"+e.id==i)u=!0;else{var c=i.split("."),a=c[0].toUpperCase(),f=c[1];a&&e.tagName!=a||(!f||R(e,f))&&(u=!0)}if(u){var s=r(e,t,n,o);s===!1&&G(t)}}),e=m(e),e&&c(n,t,e,o)};S(n,e,c,o)},G=function(n){n?n.preventDefault&&n.preventDefault():j("[Jymin] Called preventDefault on a non-event.",n)},w=function(n){var t=n.readyState;return"complete"==t||"script"==n.tagName&&"loaded"==t},H=function(n){return P(n.type)[0]},U=function(n){if(n=p(n)){var t=H(n),e=n.value,r=n.checked,o=n.options;return"c"==t||"r"==t?e=r?e:null:n.multiple?(e=[],u(o,function(n){n.selected&&s(e,n.value)})):o&&(e=U(o[n.selectedIndex])),e}},x=function(){var t=n.history||{};return u(["push","replace"],function(n){var e=t[n+"State"];t[n]=function(n){e&&e.apply(t,[null,null,n])}}),t},k=function(n){x().push(n)},B=function(n){x().replace(n)},W=function(t){S(n,"popstate",t)},j=function(){M("error",arguments)},q=function(){M("log",arguments)},M=function(t,e){var r=n.console;r&&r[t]&&r[t].apply(r,e)},P=function(n){return tt(n)?n:""+n},V=function(n,t){return P(n).indexOf(t)>-1},X=function(n,t){return 0==P(n).indexOf(t)},$=function(n){return P(n).replace(/^\s+|\s+$/g,"")},F=function(n){return P(n).split(",")},J=function(n){return P(n).split(" ")},K=function(n,t,e){var r=n.match(t);r&&e.apply(n,r)},Q=function(n){return P(n).toLowerCase()},Y=function(n){return encodeURIComponent(n)},z=function(n){return decodeURIComponent(n)},Z=function(n,t){return typeof n==t},nt=function(n){return Z(n,"number")},tt=function(n){return Z(n,"string")},et=function(n){return Z(n,"function")},rt=function(n,t){return n instanceof(t||Object)},ot=function(n){return rt(n,Array)};!function(){if(!history.pushState)return void(n.D6={});var t=n.D6=function(n){a(e,n),o||c()},e=t._VIEWS={},r=t._CACHE={},o=(t._RENDER=function(n,r){return e[n].call(e,r||t._CONTEXT)},!1),c=function(){O("a","click",function(n,t){var e=l(n.href);if(e){var r=t.which,o=!r||1==r;f(e)&&o&&(G(t),_(e,0,n))}}),O("a","mouseover",function(n){if(!R(n,"_NOPREFETCH")){var t=l(n.href),e=t!=l(location);e&&f(t)&&m(t)}}),O("input,select,textarea","change",function(n){var t=n.form;t&&(t._LAST_CHANGED=getTime())}),O("input,button","click",function(n){if("submit"==n.type){var t=n.form;t&&t._CLICKED_BUTTON!=n&&(t._CLICKED_BUTTON=n,t._LAST_CHANGED=getTime())}}),O("form","submit",function(n,t){var e=l(n.action||location.href.replace(/\?.*$/,"")),r=D(n,"enctype"),o="get"==Q(n.method);if(f(e)&&!/multipart/.test(r)){G(t);var i=n._VALIDATE?n._VALIDATE():!0;if(!i)return;var c=[];C(n,"input,select,textarea,button",function(t){var e=t.name,r=t.type,o=U(t),i=!e;i=i||"radio"==r&&!o,i=i||"submit"==r&&t!=n._CLICKED_BUTTON,i||(tt(o)?s(c,Y(e)+"="+Y(o)):u(o,function(n){s(c,Y(e)+"="+Y(n))}))}),o?(e+=(V(e,"?")?"&":"?")+c.join("&"),c=0):(e=v(e,n._LAST_CHANGED),c=c.join("&")),_(e,c,n)}});W(function(){_(location)}),o=!0},f=function(n){return X(n,location.protocol+"//"+location.host+"/")},l=function(n){return P(n).replace(/#.*$/,"")},p=function(n){return P(n).replace(/\?.*$/,"")},v=function(n,t){return n+(V(n,"?")?"&":"?")+"d6="+(t||1)},d=function(n){return P(n).replace(/[&\?]d6=[r\d]+/g,"")},m=function(n){r[n]||(q('[D6] Prefetching "'+n+'".'),r[n]=[function(t){q('[D6] Caching contents for prefetched URL "'+n+'".'),r[n]=t;var e=t.ttl||1e4;setTimeout(function(){ot(r[n])||(q('[D6] Removing "'+n+'" from prefetch cache.'),delete r[n])},e)}],g(n))},_=t._LOAD_URL=function(n,e,o){t._LOADING_URL=d(n),t._LOAD_STARTED=getTime();var i=N(o,"_D6_TARGET"),u=N(o,"_D6_VIEW");i&&C(i,function(n){L(n,"_D6_TARGET")}),q('[D6] Loading "'+n+'".'),C("._SPINNER",function(n){L(n,"_LOADING")});var c=function(n,t){T(n,t,i,u)},a=r[n];a?ot(a)?(q('[D6] Queueing callback for "'+n+'".'),s(a,c)):(q('[D6] Found precached response for "'+n+'".'),c(a,n)):(q('[D6] Creating callback queue for "'+n+'".'),r[n]=[c],g(n,e))},g=function(n,t){q('[D6] Fetching response for "'+n+'".');var e=v(n),o=function(t){var e=r[n];r[n]=t,q("[D6] Running "+e.length+' callback(s) for "'+n+'".'),u(e,function(e){e(t,n)})};i(e,t,o,o,1)},T=function(o,i,u,c){t._CONTEXT=o;var a,f=(o._ERROR,d(o.d6u||i)),s=c||o.d6||"error0",l=t._VIEW=e[s];if(i=d(i),i==t._LOADING_URL&&(C("._SPINNER,._D6_TARGET",function(n){I(n,"_LOADING")}),"<"==$(o)[0]?(a=o,q("[D6] Rendering HTML string")):l?(a=l.call(e,o),q('[D6] Rendering view "'+s+'".')):(j('[D6] View "'+s+'" not found. Changing location.'),n.location=f)),a){E(a,u);var v=p(f)==p(location.href),m=v?B:k;m(f),delete r[i]}},E=function(n,t){var e=document.body;K(n,/<title.*?>([\s\S]+)<\/title>/,function(n,t){document.title=t});var r=[];n=n.replace(/<script.*?>([\s\S]*?)<\/script>/g,function(n,t){return t&&(r.push(t),n=""),n}),t?(C(t,function(t){h(t,n)}),u(r,execute),C(t,function(n){onReady(n)})):(K(n,/<body.*?>([\s\S]+)<\/body>/,function(n,t){h(e,t),e.scrollTop=0}),u(r,execute))},A="";b("link,script",function(n){var t="?v=",e=P(n.src||n.href).split(t);e[1]&&(A=t+e[1])}),y("/d6.js"+A)}()}(window);

@@ -7,3 +7,3 @@ {

],
"version": "0.1.5",
"version": "0.1.6",
"main": "d6.js",

@@ -31,10 +31,10 @@ "homepage": "http://lighter.io/d6",

"dependencies": {
"jymin": "0.3.0"
"jymin": "0.3.4"
},
"devDependencies": {
"zeriousify": "0.1.9",
"exam": "0.0.5",
"istanbul": "0.2.11",
"coveralls": "2.10.1",
"figlet": "1.0.9"
"exam": "0.0.7",
"istanbul": "0.3.0",
"coveralls": "2.11.1",
"figlet": "1.1.0"
},

@@ -41,0 +41,0 @@ "licenses": [

@@ -10,2 +10,8 @@ /**

// If the browser doesn't work with D6, dont start D6
if (!history.pushState) {
window.D6 = {};
return;
}
/**

@@ -12,0 +18,0 @@ * The D6 function accepts new templates from /d6.js, etc.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc