wiselinks 0.6.3 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,71 @@
1
+ /*
2
+ 2012-2013 Igor Alexandrov, Alexey Solilin, Julia Egorova, Alexandr Borisov
3
+ @preserve https://github.com/igor-alexandrov/wiselinks
4
+ 2010-2011 Benjamin Arthur Lupton <contact@balupton.com>
5
+ @license New BSD License <http://creativecommons.org/licenses/BSD/>
6
+ 2010-2011 Benjamin Arthur Lupton <contact@balupton.com>
7
+ @license New BSD License <http://creativecommons.org/licenses/BSD/>
8
+ Public Domain
9
+ @author Benjamin Arthur Lupton <contact@balupton.com>
10
+ @author James Padolsey <https://gist.github.com/527683>
11
+ Public Domain
12
+ @author Benjamin Arthur Lupton <contact@balupton.com>
13
+ 2010-2011 Benjamin Arthur Lupton <contact@balupton.com>
14
+ @license New BSD License <http://creativecommons.org/licenses/BSD/>
15
+ */
16
+ (function(){var c;c=function(){function c(d,e){this.page=d;this.$form=e}c.prototype.process=function(){var d,e;d=this.$form.find("select:not(:disabled),input:not(:disabled)").filter(function(){return!$(this).val()});d.attr("disabled",!0);e=this._url();d.attr("disabled",!1);return this.page.load(e,this.$form.attr("data-target"),this._type())};c.prototype._params=function(){var d,e,b,f,c,q;d={};q=this.$form.serializeArray();f=0;for(c=q.length;f<c;f++)e=q[f],"utf8"!==e.name&&(b=-1!==e.name.indexOf("[]",
17
+ e.name.length-2)?e.name.substr(0,e.name.length-2):e.name,d[b]=null!=d[b]?d[b]+(","+e.value):e.value);return d};c.prototype._type=function(){return"partial"===this.$form.attr("data-push")?"partial":"template"};c.prototype._url=function(){var d,e,b,f;e=[];f=this._params();for(d in f)b=f[d],e.push(""+d+"="+encodeURIComponent(b));e=e.join("&");d=this.$form.attr("action");0<e.length&&(d+="?"+e);return d};return c}();void 0===window._Wiselinks&&(window._Wiselinks={});window._Wiselinks.Form=c;c=function(){function c(d,
18
+ e){this.page=d;this.$link=e}c.prototype.allows_process=function(d){return!(this._cross_origin_link(d.currentTarget)||this._non_standard_click(d))};c.prototype.process=function(){var d;d="partial"===this.$link.attr("data-push")?"partial":"template";return this.page.load(this.$link.attr("href"),this.$link.attr("data-target"),d)};c.prototype._cross_origin_link=function(d){return location.protocol!==d.protocol||location.host.split(":")[0]!==d.host.split(":")[0]};c.prototype._non_standard_click=function(d){return d.metaKey||
19
+ d.ctrlKey||d.shiftKey||d.altKey};return c}();void 0===window._Wiselinks&&(window._Wiselinks={});window._Wiselinks.Link=c;c=function(){function c(d,e){var b;this.$target=d;this.options=e;b=this;this.template_id=(new Date).getTime();this.request_manager=new _Wiselinks.RequestManager(this.options);b._try_target(this.$target);History.emulated.pushState&&!0===this.options.html4&&(-1===window.location.href.indexOf("#!")&&(!0===this.options.html4_normalize_path&&window.location.pathname!==this.options.html4_root_path)&&
20
+ (window.location.href=""+window.location.protocol+"// "+window.location.host+" "+this.options.html4_root_path+"#! "+window.location.pathname),-1!==window.location.hash.indexOf("#!")&&b._call(b._make_state(window.location.hash.substring(2))));History.Adapter.bind(window,"statechange",function(d,e){var c;c=History.getState();return b._template_id_changed(c)?b._call(b._reset_state(c)):b._call(c)});$(document).on("click","a[data-push], a[data-replace]",function(d){var e;if((e=
21
+ new _Wiselinks.Link(b,$(this))).allows_process(d))return d.preventDefault(),e.process(),!1});$(document).on("submit","form[data-push], form[data-replace]",function(d){var e;if(e=new _Wiselinks.Form(b,$(this)))return d.preventDefault(),e.process(),!1})}c.prototype.load=function(d,e,b){null==b&&(b="template");"partial"!==b&&(this.template_id=(new Date).getTime());null!=e&&this._try_target($(e));return History.pushState({timestamp:(new Date).getTime(),template_id:this.template_id,render:b,target:e,referer:window.location.href},
22
+ document.title,d)};c.prototype.reload=function(){return History.replaceState({timestamp:(new Date).getTime(),template_id:this.template_id,render:"template",referer:window.location.href},document.title,History.getState().url)};c.prototype._call=function(d){var e;e=null!=d.data.target?$(d.data.target):this.$target;return this.request_manager.call(e,d)};c.prototype._template_id_changed=function(d){return null==d.data.template_id||d.data.template_id!==this.template_id};c.prototype._make_state=function(d,
23
+ e,b,f){null==b&&(b="template");return{url:d,data:{target:e,render:b,referer:f}}};c.prototype._reset_state=function(d){null==d.data&&(d.data={});d.data.target=null;d.data.render="template";return d};c.prototype._try_target=function(d){if(0===d.length&&"exception"===this.options.target_missing)throw Error("[Wiselinks] Target missing: `"+d.selector+"`");};return c}();void 0===window._Wiselinks&&(window._Wiselinks={});window._Wiselinks.Page=c;c=function(){function c(d){this.options=null!=d?d:{}}c.prototype.call=
24
+ function(d,c){var b;b=this;if(null!=this.redirected)this.redirected=null;else return b._loading(d,c),$.ajax({url:c.url,headers:{"X-Wiselinks":c.data.render,"X-Wiselinks-Referer":c.data.referer},dataType:"html"}).done(function(f,g,k){var l,h;h=k.getResponseHeader("X-Wiselinks-Url");l=k.getResponseHeader("X-Wiselinks-Assets-Digest");if(b._assets_changed(l))return window.location.reload(!0);c=History.getState();null!=h&&h!==c.url&&b._redirect_to(h,d,c,k);d.html(f);b._title(k.getResponseHeader("X-Wiselinks-Title"));
25
+ return b._done(d,g,c.url,f)}).fail(function(f,g,k){return b._fail(d,g,c.url,k)}).always(function(f,g,k){return b._always(d,g,c.url)})};c.prototype._assets_changed=function(d){return null!=this.options.assets_digest&&this.options.assets_digest!==d};c.prototype._redirect_to=function(d,c,b,f){f&&4>f.readyState&&(f.onreadystatechange=$.noop,f.abort());this.redirected=!0;$(document).trigger("page:redirected",[c,b.data.render,d]);return History.replaceState(b.data,document.title,d)};c.prototype._loading=
26
+ function(d,c){return $(document).trigger("page:loading",[d,c.data.render,c.url])};c.prototype._done=function(d,c,b,f){return $(document).trigger("page:done",[d,c,b.url,f])};c.prototype._fail=function(c,e,b,f){return $(document).trigger("page:fail",[c,e,b.url,f])};c.prototype._always=function(c,e,b){return $(document).trigger("page:always",[c,e,b.url])};c.prototype._title=function(c){if(null!=c)return $(document).trigger("page:title",decodeURI(c)),document.title=decodeURI(c)};return c}();void 0===
27
+ window._Wiselinks&&(window._Wiselinks={});window._Wiselinks.RequestManager=c;c=function(){function c(d,e){null==d&&(d=$("body"));this.options=null!=e?e:{};this._try_jquery();this.options=$.extend(this._defaults(),this.options);this.enabled()&&(this.page=new _Wiselinks.Page(d,this.options))}c.prototype.enabled=function(){return!History.emulated.pushState||!0===this.options.html4};c.prototype.load=function(c,e,b){null==b&&(b="template");return this.page.load(c,e,b)};c.prototype.reload=function(){return this.page.reload()};
28
+ c.prototype._defaults=function(){return{html4:!0,html4_root_path:"/",html4_normalize_path:!0,target_missing:null,assets_digest:$("meta[name='assets-digest']").attr("content")}};c.prototype._try_jquery=function(){if(null==window.jQuery)throw Error("[Wiselinks] jQuery is not loaded");};return c}();window.Wiselinks=c}).call(this);
29
+ (function(c,q){var d=c.History=c.History||{},e=c.jQuery;if("undefined"!==typeof d.Adapter)throw Error("History.js Adapter has already been loaded...");d.Adapter={bind:function(b,c,d){e(b).bind(c,d)},trigger:function(b,c,d){e(b).trigger(c,d)},extractEventData:function(b,c,d){return c&&c.originalEvent&&c.originalEvent[b]||d&&d[b]||q},onDomLoad:function(b){e(b)}};"undefined"!==typeof d.init&&d.init()})(window);
30
+ (function(c,q){var d=c.document,e=c.setInterval||e,b=c.History=c.History||{};if("undefined"!==typeof b.initHtml4)throw Error("History.js HTML4 Support has already been loaded...");b.initHtml4=function(){if("undefined"!==typeof b.initHtml4.initialized)return!1;b.initHtml4.initialized=!0;b.enabled=!0;b.savedHashes=[];b.isLastHash=function(c){var d=b.getHashByIndex();return c===d};b.saveHash=function(c){if(b.isLastHash(c))return!1;b.savedHashes.push(c);return!0};b.getHashByIndex=function(c){var d=null;
31
+ return d="undefined"===typeof c?b.savedHashes[b.savedHashes.length-1]:0>c?b.savedHashes[b.savedHashes.length+c]:b.savedHashes[c]};b.discardedHashes={};b.discardedStates={};b.discardState=function(c,d,e){var l=b.getHashByState(c);b.discardedStates[l]={discardedState:c,backState:e,forwardState:d};return!0};b.discardHash=function(c,d,e){b.discardedHashes[c]={discardedHash:c,backState:e,forwardState:d};return!0};b.discardedState=function(c){c=b.getHashByState(c);return b.discardedStates[c]||!1};b.discardedHash=
32
+ function(c){return b.discardedHashes[c]||!1};b.recycleState=function(c){var d=b.getHashByState(c);b.discardedState(c)&&delete b.discardedStates[d];return!0};b.emulated.hashChange&&(b.hashChangeInit=function(){b.checkerFunction=null;var f="",g,k,l;b.isInternetExplorer()?(g=d.createElement("iframe"),g.setAttribute("id","historyjs-iframe"),g.style.display="none",d.body.appendChild(g),g.contentWindow.document.open(),g.contentWindow.document.close(),k="",l=!1,b.checkerFunction=function(){if(l)return!1;
33
+ l=!0;var d=b.getHash()||"",e=b.unescapeHash(g.contentWindow.document.location.hash)||"";d!==f?(f=d,e!==d&&(k=d,g.contentWindow.document.open(),g.contentWindow.document.close(),g.contentWindow.document.location.hash=b.escapeHash(d)),b.Adapter.trigger(c,"hashchange")):e!==k&&(k=e,b.setHash(e,!1));l=!1;return!0}):b.checkerFunction=function(){var d=b.getHash();d!==f&&(f=d,b.Adapter.trigger(c,"hashchange"));return!0};b.intervalList.push(e(b.checkerFunction,b.options.hashChangeInterval));return!0},b.Adapter.onDomLoad(b.hashChangeInit));
34
+ b.emulated.pushState&&(b.onHashChange=function(e){var g=b.getHashByUrl(e&&e.newURL||d.location.href);e=null;if(b.isLastHash(g))return b.busy(!1),!1;b.doubleCheckComplete();b.saveHash(g);if(g&&b.isTraditionalAnchor(g))return b.Adapter.trigger(c,"anchorchange"),b.busy(!1),!1;e=b.extractState(b.getFullUrl(g||d.location.href,!1),!0);if(b.isLastSavedState(e))return b.busy(!1),!1;b.getHashByState(e);if(g=b.discardedState(e))return b.getHashByIndex(-2)===b.getHashByState(g.forwardState)?b.back(!1):b.forward(!1),
35
+ !1;b.pushState(e.data,e.title,e.url,!1);return!0},b.Adapter.bind(c,"hashchange",b.onHashChange),b.pushState=function(e,g,k,l){if(b.getHashByUrl(k))throw Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(!1!==l&&b.busy())return b.pushQueue({scope:b,callback:b.pushState,args:arguments,queue:l}),!1;b.busy(!0);var h=b.createStateObject(e,g,k),m=b.getHashByState(h),r=b.getState(!1),r=b.getHashByState(r),a=b.getHash();b.storeState(h);b.expectedStateId=h.id;b.recycleState(h);
36
+ if(m===r)return b.busy(!1),!1;if(m!==a&&m!==b.getShortUrl(d.location.href))return b.setHash(m,!1),!1;b.saveState(h);b.Adapter.trigger(c,"statechange");b.busy(!1);return!0},b.replaceState=function(c,d,e,l){if(b.getHashByUrl(e))throw Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(!1!==l&&b.busy())return b.pushQueue({scope:b,callback:b.replaceState,args:arguments,queue:l}),!1;b.busy(!0);var h=b.createStateObject(c,d,e),m=b.getState(!1),r=b.getStateByIndex(-2);
37
+ b.discardState(m,h,r);b.pushState(h.data,h.title,h.url,!1);return!0});if(b.emulated.pushState&&b.getHash()&&!b.emulated.hashChange)b.Adapter.onDomLoad(function(){b.Adapter.trigger(c,"hashchange")})};"undefined"!==typeof b.init&&b.init()})(window);
38
+ (function(c,q){var d=c.console||q,e=c.document,b=c.navigator,f=c.sessionStorage||!1,g=c.setTimeout,k=c.clearTimeout,l=c.setInterval,h=c.clearInterval,m=c.JSON,r=c.alert,a=c.History=c.History||{},u=c.history;m.stringify=m.stringify||m.encode;m.parse=m.parse||m.decode;if("undefined"!==typeof a.init)throw Error("History.js Core has already been loaded...");a.init=function(){if("undefined"===typeof a.Adapter)return!1;"undefined"!==typeof a.initCore&&a.initCore();"undefined"!==typeof a.initHtml4&&a.initHtml4();
39
+ return!0};a.initCore=function(){if("undefined"!==typeof a.initCore.initialized)return!1;a.initCore.initialized=!0;a.options=a.options||{};a.options.hashChangeInterval=a.options.hashChangeInterval||100;a.options.safariPollInterval=a.options.safariPollInterval||500;a.options.doubleCheckInterval=a.options.doubleCheckInterval||500;a.options.storeInterval=a.options.storeInterval||1E3;a.options.busyDelay=a.options.busyDelay||250;a.options.debug=a.options.debug||!1;a.options.initialTitle=a.options.initialTitle||
40
+ e.title;a.intervalList=[];a.clearAllIntervals=function(){var p,b=a.intervalList;if("undefined"!==typeof b&&null!==b){for(p=0;p<b.length;p++)h(b[p]);a.intervalList=null}};a.debug=function(){a.options.debug&&a.log.apply(a,arguments)};a.log=function(){var a=!("undefined"===typeof d||"undefined"===typeof d.log||"undefined"===typeof d.log.apply),b=e.getElementById("log"),c,f,h,g;a?(f=Array.prototype.slice.call(arguments),c=f.shift(),"undefined"!==typeof d.debug?d.debug.apply(d,[c,f]):d.log.apply(d,[c,
41
+ f])):c="\n"+arguments[0]+"\n";f=1;for(h=arguments.length;f<h;++f){g=arguments[f];if("object"===typeof g&&"undefined"!==typeof m)try{g=m.stringify(g)}catch(l){}c+="\n"+g+"\n"}b?(b.value+=c+"\n-----\n",b.scrollTop=b.scrollHeight-b.clientHeight):a||r(c);return!0};a.getInternetExplorerMajorVersion=function(){var p=a.getInternetExplorerMajorVersion,b;if("undefined"!==typeof a.getInternetExplorerMajorVersion.cached)b=a.getInternetExplorerMajorVersion.cached;else{b=3;for(var c=e.createElement("div"),d=c.getElementsByTagName("i");(c.innerHTML=
42
+ "\x3c!--[if gt IE "+ ++b+"]><i></i><![endif]--\x3e")&&d[0];);b=4<b?b:!1}return p.cached=b};a.isInternetExplorer=function(){return a.isInternetExplorer.cached="undefined"!==typeof a.isInternetExplorer.cached?a.isInternetExplorer.cached:Boolean(a.getInternetExplorerMajorVersion())};a.emulated={pushState:!Boolean(c.history&&c.history.pushState&&c.history.replaceState&&!(/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(b.userAgent)||/AppleWebKit\/5([0-2]|3[0-2])/i.test(b.userAgent))),hashChange:Boolean(!("onhashchange"in
43
+ c||"onhashchange"in e)||a.isInternetExplorer()&&8>a.getInternetExplorerMajorVersion())};a.enabled=!a.emulated.pushState;a.bugs={setHash:Boolean(!a.emulated.pushState&&"Apple Computer, Inc."===b.vendor&&/AppleWebKit\/5([0-2]|3[0-3])/.test(b.userAgent)),safariPoll:Boolean(!a.emulated.pushState&&"Apple Computer, Inc."===b.vendor&&/AppleWebKit\/5([0-2]|3[0-3])/.test(b.userAgent)),ieDoubleCheck:Boolean(a.isInternetExplorer()&&8>a.getInternetExplorerMajorVersion()),hashEscape:Boolean(a.isInternetExplorer()&&
44
+ 7>a.getInternetExplorerMajorVersion())};a.isEmptyObject=function(a){for(var b in a)return!1;return!0};a.cloneObject=function(a){a?(a=m.stringify(a),a=m.parse(a)):a={};return a};a.getRootUrl=function(){var a=e.location.protocol+"//"+(e.location.hostname||e.location.host);e.location.port&&(a+=":"+e.location.port);return a+"/"};a.getBaseHref=function(){var a=e.getElementsByTagName("base"),b=null,b="";1===a.length&&(b=a[0],b=b.href.replace(/[^\/]+$/,""));(b=b.replace(/\/+$/,""))&&(b+="/");return b};a.getBaseUrl=
45
+ function(){return a.getBaseHref()||a.getBasePageUrl()||a.getRootUrl()};a.getPageUrl=function(){return((a.getState(!1,!1)||{}).url||e.location.href).replace(/\/+$/,"").replace(/[^\/]+$/,function(a,b,c){return/\!/.test(a)?a:a+"/"})};a.getBasePageUrl=function(){return e.location.href.replace(/[#\?].*/,"").replace(/[^\/]+$/,function(a,b,c){return/[^\/]$/.test(a)?"":a}).replace(/\/+$/,"")+"/"};a.getFullUrl=function(b,c){var d=b,e=b.substring(0,1);c="undefined"===typeof c?!0:c;/[a-z]+\:\/\//.test(b)||(d=
46
+ "/"===e?a.getRootUrl()+b.replace(/^\/+/,""):"#"===e?a.getPageUrl().replace(/#!*/,"")+b:"?"===e?a.getPageUrl().replace(/[\?#]!*/,"")+b:c?a.getBaseUrl()+b.replace(/^(\!\/)+/,""):a.getBasePageUrl()+b.replace(/^(\!\/)+/,""));return d.replace(/\#$/,"")};a.getShortUrl=function(b){var c=a.getBaseUrl(),d=a.getRootUrl();a.emulated.pushState&&(b=b.replace(c,""));b=b.replace(d,"/");return b=("!/"+b).replace(/^(\!\/)+/g,"!/").replace(/\#$/,"")};a.store={};a.idToState=a.idToState||{};a.stateToId=a.stateToId||
47
+ {};a.urlToId=a.urlToId||{};a.storedStates=a.storedStates||[];a.savedStates=a.savedStates||[];a.normalizeStore=function(){a.store.idToState=a.store.idToState||{};a.store.urlToId=a.store.urlToId||{};a.store.stateToId=a.store.stateToId||{}};a.getState=function(b,c){"undefined"===typeof b&&(b=!0);"undefined"===typeof c&&(c=!0);var d=a.getLastSavedState();!d&&c&&(d=a.createStateObject());b&&(d=a.cloneObject(d),d.url=d.cleanUrl||d.url);return d};a.getIdByState=function(b){var c=a.extractId(b.url),d;if(!c)if(d=
48
+ a.getStateString(b),"undefined"!==typeof a.stateToId[d])c=a.stateToId[d];else if("undefined"!==typeof a.store.stateToId[d])c=a.store.stateToId[d];else{for(;c=(new Date).getTime()+String(Math.random()).replace(/\D/g,""),"undefined"!==typeof a.idToState[c]||"undefined"!==typeof a.store.idToState[c];);a.stateToId[d]=c;a.idToState[c]=b}return c};a.normalizeState=function(b){var c;b&&"object"===typeof b||(b={});if("undefined"!==typeof b.normalized)return b;b.data&&"object"===typeof b.data||(b.data={});
49
+ c={normalized:!0};c.title=b.title||"";c.url=a.getFullUrl(a.unescapeString(b.url||e.location.href));c.hash=a.getShortUrl(c.url);c.data=a.cloneObject(b.data);c.id=a.getIdByState(c);c.cleanUrl=c.url.replace(/\??\&_suid.*/,"");c.url=c.cleanUrl;b=!a.isEmptyObject(c.data);if(c.title||b)c.hash=a.getShortUrl(c.url).replace(/\??\&_suid.*/,""),/\?/.test(c.hash)||(c.hash+="?"),c.hash+="&_suid="+c.id;c.hashedUrl=a.getFullUrl(c.hash);(a.emulated.pushState||a.bugs.safariPoll)&&a.hasUrlDuplicate(c)&&(c.url=c.hashedUrl);
50
+ return c};a.createStateObject=function(b,c,d){b={data:b,title:c,url:d};return b=a.normalizeState(b)};a.getStateById=function(b){b=String(b);return a.idToState[b]||a.store.idToState[b]||q};a.getStateString=function(b){b={data:a.normalizeState(b).data,title:b.title,url:b.url};return m.stringify(b)};a.getStateId=function(b){return a.normalizeState(b).id};a.getHashByState=function(b){return a.normalizeState(b).hash};a.extractId=function(a){return((a=/(.*)\&_suid=([0-9]+)$/.exec(a))?String(a[2]||""):"")||
51
+ !1};a.isTraditionalAnchor=function(a){return!/[\/\?\.]/.test(a)};a.extractState=function(b,c){var d=null,e,f;c=c||!1;(e=a.extractId(b))&&(d=a.getStateById(e));d||(f=a.getFullUrl(b),(e=a.getIdByUrl(f)||!1)&&(d=a.getStateById(e)),d||(!c||a.isTraditionalAnchor(b))||(d=a.createStateObject(null,null,f)));return d};a.getIdByUrl=function(b){return a.urlToId[b]||a.store.urlToId[b]||q};a.getLastSavedState=function(){return a.savedStates[a.savedStates.length-1]||q};a.getLastStoredState=function(){return a.storedStates[a.storedStates.length-
52
+ 1]||q};a.hasUrlDuplicate=function(b){var c=!1;return c=(c=a.extractState(b.url))&&c.id!==b.id};a.storeState=function(b){a.urlToId[b.url]=b.id;a.storedStates.push(a.cloneObject(b));return b};a.isLastSavedState=function(b){var c=!1;a.savedStates.length&&(b=b.id,c=a.getLastSavedState(),c=c.id,c=b===c);return c};a.saveState=function(b){if(a.isLastSavedState(b))return!1;a.savedStates.push(a.cloneObject(b));return!0};a.getStateByIndex=function(b){var c=null;return c="undefined"===typeof b?a.savedStates[a.savedStates.length-
53
+ 1]:0>b?a.savedStates[a.savedStates.length+b]:a.savedStates[b]};a.getHash=function(){return a.unescapeHash(e.location.hash)};a.unescapeString=function(a){for(var b;;){b=c.decodeURI(a);if(b===a)break;a=b}return a};a.unescapeHash=function(b){b=a.normalizeHash(b);return b=a.unescapeString(b)};a.normalizeHash=function(a){return a.replace(/[^#]*#/,"").replace(/#!*/,"")};a.setHash=function(b,c){var d,f;if(!1!==c&&a.busy())return a.pushQueue({scope:a,callback:a.setHash,args:arguments,queue:c}),!1;d=a.escapeHash(b);
54
+ a.busy(!0);(f=a.extractState(b,!0))&&!a.emulated.pushState?a.pushState(f.data,f.title,f.url,!1):e.location.hash!==d&&(a.bugs.setHash?(f=a.getPageUrl(),a.pushState(null,null,f+"#"+d,!1)):e.location.hash=d);return a};a.escapeHash=function(b){b=a.normalizeHash(b);b=c.encodeURI(b);a.bugs.hashEscape||(b=b.replace(/\%21/g,"!").replace(/\%26/g,"&").replace(/\%3D/g,"=").replace(/\%3F/g,"?"));return b};a.getHashByUrl=function(b){b=String(b).replace(/([^#]*)#?([^#]*)#?(.*)/,"$2");return b=a.unescapeHash(b)};
55
+ a.setTitle=function(b){var c=b.title,d;c||(d=a.getStateByIndex(0))&&d.url===b.url&&(c=d.title||a.options.initialTitle);try{e.getElementsByTagName("title")[0].innerHTML=c.replace("<","&lt;").replace(">","&gt;").replace(" & "," &amp; ")}catch(f){}e.title=c;return a};a.queues=[];a.busy=function(b){"undefined"!==typeof b?a.busy.flag=b:"undefined"===typeof a.busy.flag&&(a.busy.flag=!1);if(!a.busy.flag){k(a.busy.timeout);var c=function(){var b,d;if(!a.busy.flag)for(b=a.queues.length-1;0<=b;--b)d=a.queues[b],
56
+ 0!==d.length&&(d=d.shift(),a.fireQueueItem(d),a.busy.timeout=g(c,a.options.busyDelay))};a.busy.timeout=g(c,a.options.busyDelay)}return a.busy.flag};a.busy.flag=!1;a.fireQueueItem=function(b){return b.callback.apply(b.scope||a,b.args||[])};a.pushQueue=function(b){a.queues[b.queue||0]=a.queues[b.queue||0]||[];a.queues[b.queue||0].push(b);return a};a.queue=function(b,c){"function"===typeof b&&(b={callback:b});"undefined"!==typeof c&&(b.queue=c);a.busy()?a.pushQueue(b):a.fireQueueItem(b);return a};a.clearQueue=
57
+ function(){a.busy.flag=!1;a.queues=[];return a};a.stateChanged=!1;a.doubleChecker=!1;a.doubleCheckComplete=function(){a.stateChanged=!0;a.doubleCheckClear();return a};a.doubleCheckClear=function(){a.doubleChecker&&(k(a.doubleChecker),a.doubleChecker=!1);return a};a.doubleCheck=function(b){a.stateChanged=!1;a.doubleCheckClear();a.bugs.ieDoubleCheck&&(a.doubleChecker=g(function(){a.doubleCheckClear();a.stateChanged||b();return!0},a.options.doubleCheckInterval));return a};a.safariStatePoll=function(){var b=
58
+ a.extractState(e.location.href);if(!a.isLastSavedState(b))return b||a.createStateObject(),a.Adapter.trigger(c,"popstate"),a};a.back=function(b){if(!1!==b&&a.busy())return a.pushQueue({scope:a,callback:a.back,args:arguments,queue:b}),!1;a.busy(!0);a.doubleCheck(function(){a.back(!1)});u.go(-1);return!0};a.forward=function(b){if(!1!==b&&a.busy())return a.pushQueue({scope:a,callback:a.forward,args:arguments,queue:b}),!1;a.busy(!0);a.doubleCheck(function(){a.forward(!1)});u.go(1);return!0};a.go=function(b,
59
+ c){var d;if(0<b)for(d=1;d<=b;++d)a.forward(c);else if(0>b)for(d=-1;d>=b;--d)a.back(c);else throw Error("History.go: History.go requires a positive or negative integer passed.");return a};if(a.emulated.pushState){var s=function(){};a.pushState=a.pushState||s;a.replaceState=a.replaceState||s}else a.onPopState=function(b,d){var f=!1,f=!1;a.doubleCheckComplete();if(f=a.getHash())return(f=a.extractState(f||e.location.href,!0))?a.replaceState(f.data,f.title,f.url,!1):(a.Adapter.trigger(c,"anchorchange"),
60
+ a.busy(!1)),a.expectedStateId=!1;(f=(f=a.Adapter.extractEventData("state",b,d)||!1)?a.getStateById(f):a.expectedStateId?a.getStateById(a.expectedStateId):a.extractState(e.location.href))||(f=a.createStateObject(null,null,e.location.href));a.expectedStateId=!1;if(a.isLastSavedState(f))return a.busy(!1),!1;a.storeState(f);a.saveState(f);a.setTitle(f);a.Adapter.trigger(c,"statechange");a.busy(!1);return!0},a.Adapter.bind(c,"popstate",a.onPopState),a.pushState=function(b,d,e,f){if(a.getHashByUrl(e)&&
61
+ a.emulated.pushState)throw Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(!1!==f&&a.busy())return a.pushQueue({scope:a,callback:a.pushState,args:arguments,queue:f}),!1;a.busy(!0);var h=a.createStateObject(b,d,e);a.isLastSavedState(h)?a.busy(!1):(a.storeState(h),a.expectedStateId=h.id,u.pushState(h.id,h.title,h.url),a.Adapter.trigger(c,"popstate"));return!0},a.replaceState=function(b,d,e,f){if(a.getHashByUrl(e)&&a.emulated.pushState)throw Error("History.js does not support states with fragement-identifiers (hashes/anchors).");
62
+ if(!1!==f&&a.busy())return a.pushQueue({scope:a,callback:a.replaceState,args:arguments,queue:f}),!1;a.busy(!0);var h=a.createStateObject(b,d,e);a.isLastSavedState(h)?a.busy(!1):(a.storeState(h),a.expectedStateId=h.id,u.replaceState(h.id,h.title,h.url),a.Adapter.trigger(c,"popstate"));return!0};if(f)try{a.store=m.parse(f.getItem("History.store"))||{}}catch(t){a.store={}}else a.store={};a.normalizeStore();a.Adapter.bind(c,"beforeunload",a.clearAllIntervals);a.Adapter.bind(c,"unload",a.clearAllIntervals);
63
+ a.saveState(a.storeState(a.extractState(e.location.href,!0)));f&&(a.onUnload=function(){var b,c;try{b=m.parse(f.getItem("History.store"))||{}}catch(d){b={}}b.idToState=b.idToState||{};b.urlToId=b.urlToId||{};b.stateToId=b.stateToId||{};for(c in a.idToState)a.idToState.hasOwnProperty(c)&&(b.idToState[c]=a.idToState[c]);for(c in a.urlToId)a.urlToId.hasOwnProperty(c)&&(b.urlToId[c]=a.urlToId[c]);for(c in a.stateToId)a.stateToId.hasOwnProperty(c)&&(b.stateToId[c]=a.stateToId[c]);a.store=b;a.normalizeStore();
64
+ f.setItem("History.store",m.stringify(b))},a.intervalList.push(l(a.onUnload,a.options.storeInterval)),a.Adapter.bind(c,"beforeunload",a.onUnload),a.Adapter.bind(c,"unload",a.onUnload));if(!a.emulated.pushState&&(a.bugs.safariPoll&&a.intervalList.push(l(a.safariStatePoll,a.options.safariPollInterval)),"Apple Computer, Inc."===b.vendor||"Mozilla"===(b.appCodeName||""))&&(a.Adapter.bind(c,"hashchange",function(){a.Adapter.trigger(c,"popstate")}),a.getHash()))a.Adapter.onDomLoad(function(){a.Adapter.trigger(c,
65
+ "hashchange")})};a.init()})(window);"object"!==typeof JSON&&(JSON={});
66
+ (function(){function c(b){return 10>b?"0"+b:b}function q(c){b.lastIndex=0;return b.test(c)?'"'+c.replace(b,function(b){var c=k[b];return"string"===typeof c?c:"\\u"+("0000"+b.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+c+'"'}function d(b,c){var e,a,k,s,t=f,p,n=c[b];n&&("object"===typeof n&&"function"===typeof n.toJSON)&&(n=n.toJSON(b));"function"===typeof l&&(n=l.call(c,b,n));switch(typeof n){case "string":return q(n);case "number":return isFinite(n)?String(n):"null";case "boolean":case "null":return String(n);
67
+ case "object":if(!n)return"null";f+=g;p=[];if("[object Array]"===Object.prototype.toString.apply(n)){s=n.length;for(e=0;e<s;e+=1)p[e]=d(e,n)||"null";k=0===p.length?"[]":f?"[\n"+f+p.join(",\n"+f)+"\n"+t+"]":"["+p.join(",")+"]";f=t;return k}if(l&&"object"===typeof l)for(s=l.length,e=0;e<s;e+=1)"string"===typeof l[e]&&(a=l[e],(k=d(a,n))&&p.push(q(a)+(f?": ":":")+k));else for(a in n)Object.prototype.hasOwnProperty.call(n,a)&&(k=d(a,n))&&p.push(q(a)+(f?": ":":")+k);k=0===p.length?"{}":f?"{\n"+f+p.join(",\n"+
68
+ f)+"\n"+t+"}":"{"+p.join(",")+"}";f=t;return k}}"function"!==typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(b){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+c(this.getUTCMonth()+1)+"-"+c(this.getUTCDate())+"T"+c(this.getUTCHours())+":"+c(this.getUTCMinutes())+":"+c(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(b){return this.valueOf()});var e=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
69
+ b=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f,g,k={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},l;"function"!==typeof JSON.stringify&&(JSON.stringify=function(b,c,e){var a;g=f="";if("number"===typeof e)for(a=0;a<e;a+=1)g+=" ";else"string"===typeof e&&(g=e);if((l=c)&&"function"!==typeof c&&("object"!==typeof c||"number"!==typeof c.length))throw Error("JSON.stringify");return d("",{"":b})});
70
+ "function"!==typeof JSON.parse&&(JSON.parse=function(b,c){function d(a,b){var e,f,g=a[b];if(g&&"object"===typeof g)for(e in g)Object.prototype.hasOwnProperty.call(g,e)&&(f=d(g,e),void 0!==f?g[e]=f:delete g[e]);return c.call(a,b,g)}var a;b=String(b);e.lastIndex=0;e.test(b)&&(b=b.replace(e,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(b.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
71
+ "]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return a=eval("("+b+")"),"function"===typeof c?d({"":a},""):a;throw new SyntaxError("JSON.parse");})})();
Binary file
data/compiler.jar ADDED
Binary file
@@ -1,11 +1,12 @@
1
1
  class Form
2
- constructor: (@page, @$form) ->
2
+ constructor: (@page, @$form) ->
3
3
 
4
4
  process: ->
5
- $disable = @$form.find('select:not(:disabled),input:not(:disabled)').filter(-> !$(this).val())
5
+ selector = 'select:not(:disabled),input:not(:disabled)'
6
+ $disable = @$form.find(selector).filter(-> !$(this).val())
6
7
 
7
8
  $disable.attr('disabled', true)
8
- url = this._url()
9
+ url = this._url()
9
10
  $disable.attr('disabled', false)
10
11
 
11
12
  @page.load(url, @$form.attr("data-target"), this._type())
@@ -24,12 +25,12 @@ class Form
24
25
  if hash[name]?
25
26
  hash[name] = hash[name] + ",#{item.value}"
26
27
  else
27
- hash[name] = item.value
28
+ hash[name] = item.value
28
29
 
29
- hash
30
+ hash
30
31
 
31
- _type: ->
32
- if (@$form.attr("data-push") == 'partial') then 'partial' else 'template'
32
+ _type: ->
33
+ if (@$form.attr("data-push") == 'partial') then 'partial' else 'template'
33
34
 
34
35
  _url: ->
35
36
  serialized = []
@@ -43,8 +44,8 @@ class Form
43
44
  serialized = serialized.join('&')
44
45
 
45
46
  url = @$form.attr("action")
46
- url += "?#{serialized}" if serialized.length > 0
47
+ url += "?#{serialized}" if serialized.length > 0
47
48
  url
48
49
 
49
50
  window._Wiselinks = {} if window._Wiselinks == undefined
50
- window._Wiselinks.Form = Form
51
+ window._Wiselinks.Form = Form
@@ -1,20 +1,26 @@
1
1
  class Link
2
- constructor: (@page, @$link) ->
2
+ constructor: (@page, @$link) ->
3
3
 
4
4
  allows_process: (event) ->
5
- !(this._cross_origin_link(event.currentTarget) || this._non_standard_click(event))
5
+ !(this._cross_origin_link(event.currentTarget) ||
6
+ this._non_standard_click(event))
7
+
8
+ process: ->
9
+ type = if (@$link.attr("data-push") == 'partial')
10
+ 'partial'
11
+ else
12
+ 'template'
6
13
 
7
- process: ->
8
- type = if (@$link.attr("data-push") == 'partial') then 'partial' else 'template'
9
14
  @page.load(@$link.attr("href"), @$link.attr("data-target"), type)
10
15
 
11
16
  # We split host because IE returns host with port and other browsers not
12
- #
13
- _cross_origin_link: (link) ->
14
- (location.protocol != link.protocol) || (location.host.split(':')[0] != link.host.split(':')[0])
17
+ #
18
+ _cross_origin_link: (link) ->
19
+ (location.protocol != link.protocol) ||
20
+ (location.host.split(':')[0] != link.host.split(':')[0])
15
21
 
16
22
  _non_standard_click: (event) ->
17
23
  event.metaKey || event.ctrlKey || event.shiftKey || event.altKey
18
24
 
19
25
  window._Wiselinks = {} if window._Wiselinks == undefined
20
- window._Wiselinks.Link = Link
26
+ window._Wiselinks.Link = Link
@@ -10,21 +10,27 @@ class Page
10
10
  self._try_target(@$target)
11
11
 
12
12
  if History.emulated.pushState && @options.html4 == true
13
- if window.location.href.indexOf('#!') == -1 && @options.html4_normalize_path == true && window.location.pathname != @options.html4_root_path
14
- window.location.href = "#{window.location.protocol}//#{window.location.host}#{@options.html4_root_path}#!#{window.location.pathname}"
13
+ if window.location.href.indexOf('#!') == -1 &&
14
+ @options.html4_normalize_path == true &&
15
+ window.location.pathname != @options.html4_root_path
16
+
17
+ window.location.href = "#{window.location.protocol}//
18
+ #{window.location.host}
19
+ #{@options.html4_root_path}#!
20
+ #{window.location.pathname}"
15
21
 
16
- if window.location.hash.indexOf('#!') != -1
17
- self._call(self._make_state(window.location.hash.substring(2)))
22
+ if window.location.hash.indexOf('#!') != -1
23
+ self._call(self._make_state(window.location.hash.substring(2)))
18
24
 
19
25
  History.Adapter.bind(
20
26
  window,
21
27
  "statechange"
22
- (event, data) ->
28
+ (event, data) ->
23
29
  state = History.getState()
24
30
 
25
- if self._template_id_changed(state)
31
+ if self._template_id_changed(state)
26
32
  self._call(self._reset_state(state))
27
- else
33
+ else
28
34
  self._call(state)
29
35
  )
30
36
 
@@ -54,20 +60,30 @@ class Page
54
60
  if target?
55
61
  this._try_target($(target))
56
62
 
57
- History.pushState({ timestamp: (new Date().getTime()), template_id: @template_id, render: render, target: target, referer: window.location.href }, document.title, url )
58
-
59
- reload: () ->
60
- History.replaceState({ timestamp: (new Date().getTime()), template_id: @template_id, render: 'template', referer: window.location.href }, document.title, History.getState().url )
63
+ History.pushState({
64
+ timestamp: (new Date().getTime()),
65
+ template_id: @template_id,
66
+ render: render, target: target,
67
+ referer: window.location.href
68
+ }, document.title, url )
69
+
70
+ reload: () ->
71
+ History.replaceState({
72
+ timestamp: (new Date().getTime()),
73
+ template_id: @template_id,
74
+ render: 'template',
75
+ referer: window.location.href
76
+ }, document.title, History.getState().url )
61
77
 
62
78
  _call: (state) ->
63
79
  $target = if state.data.target? then $(state.data.target) else @$target
64
80
  this.request_manager.call($target, state)
65
81
 
66
- _template_id_changed: (state) ->
82
+ _template_id_changed: (state) ->
67
83
  !state.data.template_id? || state.data.template_id != @template_id
68
84
 
69
85
  _make_state: (url, target, render = 'template', referer) ->
70
- {
86
+ {
71
87
  url: url
72
88
  data:
73
89
  target: target
@@ -82,7 +98,8 @@ class Page
82
98
  state
83
99
 
84
100
  _try_target: ($target) ->
85
- throw "[Wiselinks] Target missing: `#{$target.selector}`" if $target.length == 0 && @options.target_missing == 'exception'
101
+ if $target.length == 0 && @options.target_missing == 'exception'
102
+ throw new Error("[Wiselinks] Target missing: `#{$target.selector}`")
86
103
 
87
104
  window._Wiselinks = {} if window._Wiselinks == undefined
88
105
  window._Wiselinks.Page = Page
@@ -5,17 +5,17 @@ class RequestManager
5
5
  self = this
6
6
 
7
7
  # If been redirected, just trigger event and exit
8
- #
8
+ #
9
9
  if @redirected?
10
10
  @redirected = null
11
- return
11
+ return
12
12
 
13
13
  # Trigger loading event
14
- #
14
+ #
15
15
  self._loading($target, state)
16
16
 
17
17
  # Perform XHtmlHttpRequest
18
- #
18
+ #
19
19
  $.ajax(
20
20
  url: state.url
21
21
  headers:
@@ -24,13 +24,14 @@ class RequestManager
24
24
 
25
25
  dataType: "html"
26
26
  ).done(
27
- (data, status, xhr) ->
27
+ (data, status, xhr) ->
28
28
  url = xhr.getResponseHeader('X-Wiselinks-Url')
29
+ assets_digest = xhr.getResponseHeader('X-Wiselinks-Assets-Digest')
29
30
 
30
- if self._assets_changed(xhr.getResponseHeader('X-Wiselinks-Assets-Digest'))
31
- window.location.reload(true)
31
+ if self._assets_changed(assets_digest)
32
+ window.location.reload(true)
32
33
  else
33
- state = History.getState()
34
+ state = History.getState()
34
35
  if url? && url != state.url
35
36
  self._redirect_to(url, $target, state, xhr)
36
37
 
@@ -44,10 +45,10 @@ class RequestManager
44
45
  ).always(
45
46
  (data_or_xhr, status, xhr_or_error)->
46
47
  self._always($target, status, state.url)
47
- )
48
+ )
48
49
 
49
- _assets_changed: (digest) ->
50
- @options.assets_digest? && @options.assets_digest != digest
50
+ _assets_changed: (assets_digest) ->
51
+ @options.assets_digest? && @options.assets_digest != assets_digest
51
52
 
52
53
  _redirect_to: (url, $target, state, xhr) ->
53
54
  if ( xhr && xhr.readyState < 4)
@@ -71,7 +72,7 @@ class RequestManager
71
72
  $(document).trigger('page:always', [$target, status, state.url])
72
73
 
73
74
  _title: (value) ->
74
- if value?
75
+ if value?
75
76
  $(document).trigger('page:title', decodeURI(value))
76
77
  document.title = decodeURI(value)
77
78
 
@@ -9,11 +9,11 @@ class Wiselinks
9
9
  this._try_jquery()
10
10
 
11
11
  @options = $.extend(this._defaults(), @options)
12
- if this.enabled()
12
+ if this.enabled()
13
13
  @page = new _Wiselinks.Page($target, @options)
14
14
 
15
15
  enabled: ->
16
- !History.emulated.pushState || @options.html4 == true
16
+ !History.emulated.pushState || @options.html4 == true
17
17
 
18
18
  load: (url, target, render = 'template') ->
19
19
  @page.load(url, target, render)
@@ -26,9 +26,9 @@ class Wiselinks
26
26
  html4_root_path: '/'
27
27
  html4_normalize_path: true
28
28
  target_missing: null
29
- assets_digest: $("meta[name='assets-digest']").attr("content")
29
+ assets_digest: $("meta[name='assets-digest']").attr("content")
30
30
 
31
31
  _try_jquery: ->
32
- throw "[Wiselinks] jQuery is not loaded" unless window.jQuery?
32
+ throw new Error("[Wiselinks] jQuery is not loaded") unless window.jQuery?
33
33
 
34
34
  window.Wiselinks = Wiselinks
@@ -0,0 +1,104 @@
1
+ # encoding: utf-8
2
+
3
+ require 'closure-compiler'
4
+ require 'coffeelint'
5
+
6
+ require 'wiselinks/version'
7
+
8
+ module Wiselinks
9
+ class Builder
10
+ include Rake::DSL if defined? Rake::DSL
11
+
12
+ class << self
13
+ attr_accessor :instance
14
+
15
+ def install
16
+ self.new.install
17
+ end
18
+ end
19
+
20
+
21
+ def install
22
+ # desc "Build #{self.name}-#{self.version} CoffeeScript sources."
23
+ # task 'build' do
24
+ # Rake::Task["coffee:lint"].invoke
25
+ # Rake::Task["coffee:build"].invoke
26
+ # end
27
+
28
+ namespace :coffee do
29
+ desc "Run CoffeeLint over #{self.name}-#{self.version} sources."
30
+ task 'lint' do
31
+ Coffeelint.lint_dir(self.sources) do |filename, lint_report|
32
+ Coffeelint.display_test_results(filename, lint_report)
33
+ end
34
+ end
35
+
36
+ desc "Build #{self.name}-#{self.version} CoffeeScript sources."
37
+ task 'build' do
38
+ system("rm ./build/*")
39
+
40
+ system("echo '#{self.declaration}' > ./build/#{self.name_with_version}.js")
41
+ system("coffee -o ./build -j temp.js -c #{self.coffee_sources.join(' ')}")
42
+ system("cat ./build/temp.js >> ./build/#{self.name_with_version}.js")
43
+
44
+ self.js_sources.each do |file|
45
+ system("cat #{file} >> ./build/#{self.name_with_version}.js")
46
+ end
47
+
48
+ # Minimize
49
+ #
50
+ system("java -jar ./compiler.jar --charset UTF-8 --js ./build/#{self.name_with_version}.js --js_output_file=./build/#{self.name_with_version}.min.js")
51
+
52
+ # Gzip
53
+ #
54
+ system("gzip -c ./build/#{self.name_with_version}.min.js > ./build/#{self.name_with_version}.min.js.gz")
55
+
56
+ system("rm ./build/temp.js")
57
+ end
58
+ end
59
+
60
+ end
61
+
62
+ protected
63
+
64
+ def sources
65
+ File.expand_path('../../assets/javascripts', __FILE__)
66
+ end
67
+
68
+ def js_sources
69
+ Dir.glob(File.join(self.sources, "**/*.js"))
70
+ end
71
+
72
+ def coffee_sources
73
+ Dir.glob(File.join(self.sources, "**/*.js.coffee"))
74
+ end
75
+
76
+ def version
77
+ self.specification.version
78
+ end
79
+
80
+ def declaration
81
+ <<-EOS
82
+ /**
83
+ * #{self.name.capitalize}-#{self.version}
84
+ * @copyright 2012-#{Date.today.year} #{self.specification.authors.join(', ')}
85
+ * @preserve https://github.com/igor-alexandrov/wiselinks
86
+ */
87
+ EOS
88
+ end
89
+
90
+ def name
91
+ self.specification.name
92
+ end
93
+
94
+ def name_with_version
95
+ [self.name, self.version].join('-')
96
+ end
97
+
98
+ def specification
99
+ @specification ||= Gem.loaded_specs['wiselinks']
100
+ end
101
+ end
102
+ end
103
+
104
+ Wiselinks::Builder.install
@@ -4,7 +4,7 @@ module Wiselinks
4
4
  module Version
5
5
  MAJOR = 0
6
6
  MINOR = 6
7
- PATCH = 3
7
+ PATCH = 4
8
8
  BUILD = nil
9
9
 
10
10
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
data/wiselinks.gemspec CHANGED
@@ -35,4 +35,7 @@ Gem::Specification.new do |gem|
35
35
 
36
36
  gem.add_development_dependency 'rails', '>= 3.2.0'
37
37
  gem.add_development_dependency 'coffee-rails'
38
+
39
+ gem.add_development_dependency 'closure-compiler'
40
+ gem.add_development_dependency 'coffeelint'
38
41
  end