diff --git a/lib/gollum/app.rb b/lib/gollum/app.rb index 641a49d2..cd7b21a3 100644 --- a/lib/gollum/app.rb +++ b/lib/gollum/app.rb @@ -462,7 +462,17 @@ module Precious post '/compare/*' do @file = clean_url(encodeURIComponent(params[:splat].first)) @versions = params[:versions] || [] - if @versions.size < 2 + if @versions.size == 1 + wikip = wiki_page(params[:splat].first) + commit = wikip.wiki.repo.commit(@versions.first) + parent = commit.parent + if parent.nil? + redirect to("#{@file}/#{@commit.id}") + else + @versions.push(parent.id) + end + end + if @versions.empty? redirect to("gollum/history/#{@file}") else redirect to("gollum/compare/%s/%s...%s" % [ diff --git a/lib/gollum/public/assets/.sprockets-manifest-f5508481ff1053b96697e658adfe765b.json b/lib/gollum/public/assets/.sprockets-manifest-f5508481ff1053b96697e658adfe765b.json new file mode 100644 index 00000000..7b6f0c0a --- /dev/null +++ b/lib/gollum/public/assets/.sprockets-manifest-f5508481ff1053b96697e658adfe765b.json @@ -0,0 +1 @@ +{"files":{"app-3360f8faf2f9cd3020463278cdb5512b0109241647bbf55407e64ea11759572d.js":{"logical_path":"app.js","mtime":"2020-04-04T20:59:05+09:00","size":136035,"digest":"3360f8faf2f9cd3020463278cdb5512b0109241647bbf55407e64ea11759572d","integrity":"sha256-M2D4+vL5zTAgRjJ4zbVRKwEJJBZHu/VUB+ZOoRdZVy0="},"editor-0dbae28c53db5a73d666d30504946671eb09948ffdaf1fdd9d1c8d856d4c0ba1.js":{"logical_path":"editor.js","mtime":"2020-03-28T01:31:47+09:00","size":746117,"digest":"0dbae28c53db5a73d666d30504946671eb09948ffdaf1fdd9d1c8d856d4c0ba1","integrity":"sha256-DbrijFPbWnPWZtMFBJRmcesJlI/9rx/dnRyNhW1MC6E="},"app-b205e593a30f1cc0054e2e9ed9fc8af3658d8ef4a62b9708c20f204560deefb7.css":{"logical_path":"app.css","mtime":"2020-03-31T00:56:04+09:00","size":298111,"digest":"b205e593a30f1cc0054e2e9ed9fc8af3658d8ef4a62b9708c20f204560deefb7","integrity":"sha256-sgXlk6MPHMAFTi6e2fyK82WNjvSmK5cIwg8gRWDe77c="},"criticmarkup-31ae5d3282bbb8e7b7c3c9917e9fb68e3315a6b4a75da6cec48d21b8846905c4.css":{"logical_path":"criticmarkup.css","mtime":"2020-03-27T20:02:13+09:00","size":646,"digest":"31ae5d3282bbb8e7b7c3c9917e9fb68e3315a6b4a75da6cec48d21b8846905c4","integrity":"sha256-Ma5dMoK7uOe3w8mRfp+2jjMVprSnXabOxI0huIRpBcQ="},"print-512498c368be0d3fb1ba105dfa84289ae48380ec9fcbef948bd4e23b0b095bfb.css":{"logical_path":"print.css","mtime":"2020-03-31T00:56:04+09:00","size":75,"digest":"512498c368be0d3fb1ba105dfa84289ae48380ec9fcbef948bd4e23b0b095bfb","integrity":"sha256-USSYw2i+DT+xuhBd+oQomuSDgOyfy++Ui9TiOwsJW/s="}},"assets":{"app.js":"app-3360f8faf2f9cd3020463278cdb5512b0109241647bbf55407e64ea11759572d.js","editor.js":"editor-0dbae28c53db5a73d666d30504946671eb09948ffdaf1fdd9d1c8d856d4c0ba1.js","app.css":"app-b205e593a30f1cc0054e2e9ed9fc8af3658d8ef4a62b9708c20f204560deefb7.css","criticmarkup.css":"criticmarkup-31ae5d3282bbb8e7b7c3c9917e9fb68e3315a6b4a75da6cec48d21b8846905c4.css","print.css":"print-512498c368be0d3fb1ba105dfa84289ae48380ec9fcbef948bd4e23b0b095bfb.css"}} \ No newline at end of file diff --git a/lib/gollum/public/assets/app-3360f8faf2f9cd3020463278cdb5512b0109241647bbf55407e64ea11759572d.js b/lib/gollum/public/assets/app-3360f8faf2f9cd3020463278cdb5512b0109241647bbf55407e64ea11759572d.js new file mode 100644 index 00000000..9151c918 --- /dev/null +++ b/lib/gollum/public/assets/app-3360f8faf2f9cd3020463278cdb5512b0109241647bbf55407e64ea11759572d.js @@ -0,0 +1,5 @@ +function brokenAvatarImage(e){return e.onerror="",e.src='data:image/svg+xml;utf8,',!0}function routePath(e){return path=gollumRoutes[e],prefixBaseUrl(path)}function prefixBaseUrl(e){if(baseUrl==undefined)console.log("Gollum error: baseUrl undefined");else{if(e!=undefined)return""==baseUrl?e:("/"==baseUrl.charAt(baseUrl.length-1)?result=baseUrl+e:result=baseUrl+"/"+e,result.replace(/\/{2}/g,"/"));console.log("Could not find route with name: "+name)}}function cleanPath(e){return("/"+e.replace(/\/$/,"")).replace(/\/{2}/g,"/")}function pageName(){return"undefined"==typeof pageFullPath?undefined:(name=pageFullPath.split("/").pop(),name.substring(0,name.lastIndexOf(".")))}function pagePath(){return"undefined"==typeof pageFullPath?undefined:pageFullPath.split("/").slice(0,-1).join("/")}function htmlEscape(e){return String(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function abspath(e,t){"/"!=t[0]&&(t="/"+t,e&&(t="/"+e+t));var n=t.split("/");return[n.slice(0,-1).join("/"),n.pop()]}function setTextDirection(){$(".markdown-body p, .markdown-body span, .markdown-body pre, .markdown-body table").attr("dir","auto")}function preparePage(){setTextDirection(),"true"==criticMarkup&&($("#wiki-content").addClass("criticmarkup"),$("ins.break").unwrap(),$("span.critic.comment").wrap(''),$("span.critic.comment").filter(function(){return""!=$(this).text()}).before("‡"))}function flashNotice(e,t,n,i,r){nested_button_html="",void 0!==n&&void 0!==i&&(r=void 0!==r&&"danger"==r?" btn-danger":"",nested_button_html='"),html='

'+t+nested_button_html+"

",$("#gollum-flash").remove(),$("#wiki-content h1").before(html),"success"==e&&setTimeout(function(){$("#gollum-flash").fadeOut()},5e3)}!function(e,t){function n(e){return M.isWindow(e)?e:9===e.nodeType&&(e.defaultView||e.parentWindow)}function i(e){if(!yt[e]){var t=j.body,n=M("<"+e+">").appendTo(t),i=n.css("display");n.remove(),"none"!==i&&""!==i||(pt||(pt=j.createElement("iframe"),pt.frameBorder=pt.width=pt.height=0),t.appendChild(pt),ht&&pt.createElement||(ht=(pt.contentWindow||pt.contentDocument).document,ht.write((M.support.boxModel?"":"")+""),ht.close()),n=ht.createElement(e),ht.body.appendChild(n),i=M.css(n,"display"),t.removeChild(pt)),yt[e]=i}return yt[e]}function r(e,t){var n={};return M.each(wt.concat.apply([],wt.slice(0,t)),function(){n[this]=e}),n}function o(){mt=t}function a(){return setTimeout(o,0),mt=M.now()}function s(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}function l(){try{return new e.XMLHttpRequest}catch(e){}}function u(e,n){e.dataFilter&&(n=e.dataFilter(n,e.dataType));var i,r,o,a,s,l,u,c,d=e.dataTypes,f={},p=d.length,h=d[0];for(i=1;i0){if("border"!==n)for(;r=0===n})}function E(e){return!e||!e.parentNode||11===e.parentNode.nodeType}function N(){return!0}function _(){return!1}function S(e,t,n){var i=t+"defer",r=t+"queue",o=t+"mark",a=M._data(e,i);a&&("queue"===n||!M._data(e,r))&&("mark"===n||!M._data(e,o))&&setTimeout(function(){!M._data(e,r)&&!M._data(e,o)&&(M.removeData(e,i,!0),a.fire())},0)}function A(e){for(var t in e)if(("data"!==t||!M.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function $(e,n,i){if(i===t&&1===e.nodeType){var r="data-"+n.replace(z,"-$1").toLowerCase();if("string"==typeof(i=e.getAttribute(r))){try{i="true"===i||"false"!==i&&("null"===i?null:M.isNumeric(i)?+i:H.test(i)?M.parseJSON(i):i)}catch(e){}M.data(e,n,i)}else i=t}return i}function L(e){var t,n,i=O[e]={};for(e=e.split(/\s+/),t=0,n=e.length;t)[^>]*$|#([\w\-]*)$)/,d=/\S/,f=/^\s+/,p=/\s+$/,h=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,g=/^[\],:{}\s]*$/,m=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,y=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,v=/(?:^|:|,)(?:\s*\[)+/g,b=/(webkit)[ \/]([\w.]+)/,w=/(opera)(?:.*version)?[ \/]([\w.]+)/,x=/(msie) ([\w.]+)/,k=/(mozilla)(?:.*? rv:([\w.]+))?/,T=/-([a-z]|[0-9])/gi,C=/^-ms-/,E=function(e,t){return(t+"").toUpperCase()},N=D.userAgent,_=Object.prototype.toString,S=Object.prototype.hasOwnProperty,A=Array.prototype.push,$=Array.prototype.slice,L=String.prototype.trim,F=Array.prototype.indexOf,M={};return s.fn=s.prototype={constructor:s,init:function(e,n,i){var r,o,a,l;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if("body"===e&&!n&&j.body)return this.context=j,this[0]=j.body,this.selector=e,this.length=1,this;if("string"==typeof e){if((r="<"!==e.charAt(0)||">"!==e.charAt(e.length-1)||e.length<3?c.exec(e):[null,e,null])&&(r[1]||!n)){if(r[1])return n=n instanceof s?n[0]:n,l=n?n.ownerDocument||n:j,a=h.exec(e),a?s.isPlainObject(n)?(e=[j.createElement(a[1])],s.fn.attr.call(e,n,!0)):e=[l.createElement(a[1])]:(a=s.buildFragment([r[1]],[l]),e=(a.cacheable?s.clone(a.fragment):a.fragment).childNodes),s.merge(this,e);if((o=j.getElementById(r[2]))&&o.parentNode){if(o.id!==r[2])return i.find(e);this.length=1,this[0]=o}return this.context=j,this.selector=e,this}return!n||n.jquery?(n||i).find(e):this.constructor(n).find(e)}return s.isFunction(e)?i.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),s.makeArray(e,this))},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return $.call(this,0)},get:function(e){return null==e?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var i=this.constructor();return s.isArray(e)?A.apply(i,e):s.merge(i,e),i.prevObject=this,i.context=this.context,"find"===t?i.selector=this.selector+(this.selector?" ":"")+n:t&&(i.selector=this.selector+"."+t+"("+n+")"),i},each:function(e,t){return s.each(this,e,t)},ready:function(e){return s.bindReady(),o.add(e),this},eq:function(e){return e=+e,-1===e?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack($.apply(this,arguments),"slice",$.call(arguments).join(","))},map:function(e){return this.pushStack(s.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:A,sort:[].sort,splice:[].splice},s.fn.init.prototype=s.fn,s.extend=s.fn.extend=function(){var e,n,i,r,o,a,l=arguments[0]||{},u=1,c=arguments.length,d=!1;for("boolean"==typeof l&&(d=l,l=arguments[1]||{},u=2),"object"!=typeof l&&!s.isFunction(l)&&(l={}),c===u&&(l=this,--u);u0)return;o.fireWith(j,[s]),s.fn.trigger&&s(j).trigger("ready").off("ready")}},bindReady:function(){if(!o){if(o=s.Callbacks("once memory"),"complete"===j.readyState)return setTimeout(s.ready,1);if(j.addEventListener)j.addEventListener("DOMContentLoaded",a,!1),e.addEventListener("load",s.ready,!1);else if(j.attachEvent){j.attachEvent("onreadystatechange",a),e.attachEvent("onload",s.ready);var t=!1;try{t=null==e.frameElement}catch(e){}j.documentElement.doScroll&&t&&n()}}},isFunction:function(e){return"function"===s.type(e)},isArray:Array.isArray||function(e){return"array"===s.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?String(e):M[_.call(e)]||"object"},isPlainObject:function(e){if(!e||"object"!==s.type(e)||e.nodeType||s.isWindow(e))return!1;try{if(e.constructor&&!S.call(e,"constructor")&&!S.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}var n;for(n in e);return n===t||S.call(e,n)},isEmptyObject:function(e){for(var t in e)return!1;return!0},error:function(e){throw new Error(e)},parseJSON:function(t){return"string"==typeof t&&t?(t=s.trim(t),e.JSON&&e.JSON.parse?e.JSON.parse(t):g.test(t.replace(m,"@").replace(y,"]").replace(v,""))?new Function("return "+t)():void s.error("Invalid JSON: "+t)):null},parseXML:function(n){if("string"!=typeof n||!n)return null;var i,r;try{e.DOMParser?(r=new DOMParser,i=r.parseFromString(n,"text/xml")):(i=new ActiveXObject("Microsoft.XMLDOM"),i.async="false",i.loadXML(n))}catch(e){i=t}return(!i||!i.documentElement||i.getElementsByTagName("parsererror").length)&&s.error("Invalid XML: "+n),i},noop:function(){},globalEval:function(t){t&&d.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(T,E)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toUpperCase()===t.toUpperCase()},each:function(e,n,i){var r,o=0,a=e.length,l=a===t||s.isFunction(e);if(i)if(l){for(r in e)if(!1===n.apply(e[r],i))break}else for(;o0&&e[0]&&e[u-1]||0===u||s.isArray(e)))for(;l1?P.call(arguments,0):t,l.notifyWith(u,a)}}function n(e){return function(t){i[e]=arguments.length>1?P.call(arguments,0):t,--s||l.resolveWith(l,i)}}var i=P.call(arguments,0),r=0,o=i.length,a=Array(o),s=o,l=o<=1&&e&&M.isFunction(e.promise)?e:M.Deferred(),u=l.promise();if(o>1){for(;r
a",n=f.getElementsByTagName("*"),i=f.getElementsByTagName("a")[0],!n||!n.length||!i)return{};r=j.createElement("select"),o=r.appendChild(j.createElement("option")),a=f.getElementsByTagName("input")[0],t={leadingWhitespace:3===f.firstChild.nodeType,tbody:!f.getElementsByTagName("tbody").length,htmlSerialize:!!f.getElementsByTagName("link").length,style:/top/.test(i.getAttribute("style")),hrefNormalized:"/a"===i.getAttribute("href"),opacity:/^0.55/.test(i.style.opacity),cssFloat:!!i.style.cssFloat,checkOn:"on"===a.value,optSelected:o.selected,getSetAttribute:"t"!==f.className,enctype:!!j.createElement("form").enctype,html5Clone:"<:nav>"!==j.createElement("nav").cloneNode(!0).outerHTML,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},M.boxModel=t.boxModel="CSS1Compat"===j.compatMode,a.checked=!0,t.noCloneChecked=a.cloneNode(!0).checked,r.disabled=!0,t.optDisabled=!o.disabled;try{delete f.test}catch(e){t.deleteExpando=!1}if(!f.addEventListener&&f.attachEvent&&f.fireEvent&&(f.attachEvent("onclick",function(){t.noCloneEvent=!1}),f.cloneNode(!0).fireEvent("onclick")),a=j.createElement("input"),a.value="t",a.setAttribute("type","radio"),t.radioValue="t"===a.value,a.setAttribute("checked","checked"),a.setAttribute("name","t"),f.appendChild(a),s=j.createDocumentFragment(),s.appendChild(f.lastChild),t.checkClone=s.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=a.checked,s.removeChild(a),s.appendChild(f),f.attachEvent)for(c in{submit:1,change:1,focusin:1})u="on"+c,d=u in f,d||(f.setAttribute(u,"return;"),d="function"==typeof f[u]),t[c+"Bubbles"]=d;return s.removeChild(f),s=r=o=f=a=null,M(function(){var n,i,r,o,a,s,u,c,p,h,g,m,y=j.getElementsByTagName("body")[0];!y||(u=1,m="padding:0;margin:0;border:",h="position:absolute;top:0;left:0;width:1px;height:1px;",g=m+"0;visibility:hidden;",c="style='"+h+m+"5px solid #000;",p="
",n=j.createElement("div"),n.style.cssText=g+"width:0;height:0;position:static;top:0;margin-top:"+u+"px",y.insertBefore(n,y.firstChild),f=j.createElement("div"),n.appendChild(f),f.innerHTML="
t
",l=f.getElementsByTagName("td"),d=0===l[0].offsetHeight,l[0].style.display="",l[1].style.display="none",t.reliableHiddenOffsets=d&&0===l[0].offsetHeight,e.getComputedStyle&&(f.innerHTML="",s=j.createElement("div"),s.style.width="0",s.style.marginRight="0",f.style.width="2px",f.appendChild(s),t.reliableMarginRight=0===(parseInt((e.getComputedStyle(s,null)||{marginRight:0}).marginRight,10)||0)),"undefined"!=typeof f.style.zoom&&(f.innerHTML="",f.style.width=f.style.padding="1px",f.style.border=0,f.style.overflow="hidden",f.style.display="inline",f.style.zoom=1,t.inlineBlockNeedsLayout=3===f.offsetWidth,f.style.display="block",f.style.overflow="visible",f.innerHTML="
",t.shrinkWrapBlocks=3!==f.offsetWidth),f.style.cssText=h+g,f.innerHTML=p,i=f.firstChild,r=i.firstChild,o=i.nextSibling.firstChild.firstChild,a={doesNotAddBorder:5!==r.offsetTop,doesAddBorderForTableAndCells:5===o.offsetTop},r.style.position="fixed",r.style.top="20px",a.fixedPosition=20===r.offsetTop||15===r.offsetTop,r.style.position=r.style.top="",i.style.overflow="hidden",i.style.position="relative",a.subtractsBorderForOverflowNotVisible=-5===r.offsetTop,a.doesNotIncludeMarginInBodyOffset=y.offsetTop!==u,e.getComputedStyle&&(f.style.marginTop="1%",t.pixelMargin="1%"!==(e.getComputedStyle(f,null)||{marginTop:0}).marginTop),"undefined"!=typeof n.style.zoom&&(n.style.zoom=1),y.removeChild(n),s=f=n=null,M.extend(t,a))}),t}();var H=/^(?:\{.*\}|\[.*\])$/,z=/([A-Z])/g;M.extend({cache:{},uuid:0,expando:"jQuery"+(M.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return!!(e=e.nodeType?M.cache[e[M.expando]]:e[M.expando])&&!A(e)},data:function(e,n,i,r){if(M.acceptData(e)){var o,a,s,l=M.expando,u="string"==typeof n,c=e.nodeType,d=c?M.cache:e,f=c?e[l]:e[l]&&l,p="events"===n;if((!f||!d[f]||!p&&!r&&!d[f].data)&&u&&i===t)return;return f||(c?e[l]=f=++M.uuid:f=l),d[f]||(d[f]={},c||(d[f].toJSON=M.noop)),("object"!=typeof n&&"function"!=typeof n||(r?d[f]=M.extend(d[f],n):d[f].data=M.extend(d[f].data,n)),o=a=d[f],r||(a.data||(a.data={}),a=a.data),i!==t&&(a[M.camelCase(n)]=i),p&&!a[n])?o.events:(u?null==(s=a[n])&&(s=a[M.camelCase(n)]):s=a,s)}},removeData:function(e,t,n){if(M.acceptData(e)){var i,r,o,a=M.expando,s=e.nodeType,l=s?M.cache:e,u=s?e[a]:a;if(!l[u])return;if(t&&(i=n?l[u]:l[u].data)){M.isArray(t)||(t in i?t=[t]:(t=M.camelCase(t),t=t in i?[t]:t.split(" ")));for(r=0,o=t.length;r1,null,!1))},removeData:function(e){return this.each(function(){M.removeData(this,e)})}}),M.extend({_mark:function(e,t){e&&(t=(t||"fx")+"mark",M._data(e,t,(M._data(e,t)||0)+1))},_unmark:function(e,t,n){if(!0!==e&&(n=t,t=e,e=!1),t){n=n||"fx";var i=n+"mark",r=e?0:(M._data(t,i)||1)-1;r?M._data(t,i,r):(M.removeData(t,i,!0),S(t,n,"mark"))}},queue:function(e,t,n){var i;if(e)return t=(t||"fx")+"queue",i=M._data(e,t),n&&(!i||M.isArray(n)?i=M._data(e,t,M.makeArray(n)):i.push(n)),i||[]},dequeue:function(e,t){t=t||"fx";var n=M.queue(e,t),i=n.shift(),r={};"inprogress"===i&&(i=n.shift()),i&&("fx"===t&&n.unshift("inprogress"),M._data(e,t+".run",r),i.call(e,function(){M.dequeue(e,t)},r)),n.length||(M.removeData(e,t+"queue "+t+".run",!0),S(e,t,"queue"))}}),M.fn.extend({queue:function(e,n){var i=2;return"string"!=typeof e&&(n=e,e="fx",i--),arguments.length1)},removeAttr:function(e){return this.each(function(){M.removeAttr(this,e)})},prop:function(e,t){return M.access(this,M.prop,e,t,arguments.length>1)},removeProp:function(e){return e=M.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(e){}})},addClass:function(e){var t,n,i,r,o,a,s;if(M.isFunction(e))return this.each(function(t){M(this).addClass(e.call(this,t,this.className))});if(e&&"string"==typeof e)for(t=e.split(W),n=0,i=this.length;n-1)return!0;return!1},val:function(e){var n,i,r,o=this[0];return arguments.length?(r=M.isFunction(e),this.each(function(i){var o,a=M(this);1===this.nodeType&&(o=r?e.call(this,i,a.val()):e,null==o?o="":"number"==typeof o?o+="":M.isArray(o)&&(o=M.map(o,function(e){return null==e?"":e+""})),n=M.valHooks[this.type]||M.valHooks[this.nodeName.toLowerCase()],n&&"set"in n&&n.set(this,o,"value")!==t||(this.value=o))})):o?(n=M.valHooks[o.type]||M.valHooks[o.nodeName.toLowerCase()])&&"get"in n&&(i=n.get(o,"value"))!==t?i:(i=o.value,"string"==typeof i?i.replace(X,""):null==i?"":i):void 0}}),M.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,i,r,o=e.selectedIndex,a=[],s=e.options,l="select-one"===e.type;if(o<0)return null;for(n=l?o:0,i=l?o+1:s.length;n=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(e,n,i,r){var o,a,s,l=e.nodeType;if(e&&3!==l&&8!==l&&2!==l)return r&&n in M.attrFn?M(e)[n](i):"undefined"==typeof e.getAttribute?M.prop(e,n,i):((s=1!==l||!M.isXMLDoc(e))&&(n=n.toLowerCase(),a=M.attrHooks[n]||(G.test(n)?B:q)),i!==t?null===i?void M.removeAttr(e,n):a&&"set"in a&&s&&(o=a.set(e,i,n))!==t?o:(e.setAttribute(n,""+i),i):a&&"get"in a&&s&&null!==(o=a.get(e,n))?o:(o=e.getAttribute(n),null===o?t:o))},removeAttr:function(e,t){var n,i,r,o,a,s=0;if(t&&1===e.nodeType)for(i=t.toLowerCase().split(W),o=i.length;s=0}})});var Y=/^(?:textarea|input|select)$/i,Q=/^([^\.]*)?(?:\.(.+))?$/,Z=/(?:^|\s)hover(\.\S+)?\b/,ee=/^key/,te=/^(?:mouse|contextmenu)|click/,ne=/^(?:focusinfocus|focusoutblur)$/,ie=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,re=function(e){var t=ie.exec(e);return t&&(t[1]=(t[1]||"").toLowerCase(),t[3]=t[3]&&new RegExp("(?:^|\\s)"+t[3]+"(?:\\s|$)")),t},oe=function(e,t){var n=e.attributes||{};return(!t[1]||e.nodeName.toLowerCase()===t[1])&&(!t[2]||(n.id||{}).value===t[2])&&(!t[3]||t[3].test((n["class"]||{}).value))},ae=function(e){return M.event.special.hover?e:e.replace(Z,"mouseenter$1 mouseleave$1")};M.event={add:function(e,n,i,r,o){var a,s,l,u,c,d,f,p,h,g,m;if(3!==e.nodeType&&8!==e.nodeType&&n&&i&&(a=M._data(e))){for(i.handler&&(h=i,i=h.handler,o=h.selector),i.guid||(i.guid=M.guid++),l=a.events,l||(a.events=l={}),s=a.handle,s||(a.handle=s=function(e){return void 0===M||e&&M.event.triggered===e.type?t:M.event.dispatch.apply(s.elem,arguments)},s.elem=e),n=M.trim(ae(n)).split(" "),u=0;u=0&&(m=m.slice(0,-1),s=!0),m.indexOf(".")>=0&&(y=m.split("."),m=y.shift(),y.sort()),(!r||M.event.customEvent[m])&&!M.event.global[m])return;if(n="object"==typeof n?n[M.expando]?n:new M.Event(m,n):new M.Event(m),n.type=m,n.isTrigger=!0,n.exclusive=s,n.namespace=y.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+y.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,d=m.indexOf(":")<0?"on"+m:"",!r){a=M.cache;for(l in a)a[l].events&&a[l].events[m]&&M.event.trigger(n,i,a[l].handle.elem,!0);return}if(n.result=t,n.target||(n.target=r),i=null!=i?M.makeArray(i):[],i.unshift(n),f=M.event.special[m]||{},f.trigger&&!1===f.trigger.apply(r,i))return;if(h=[[r,f.bindType||m]],!o&&!f.noBubble&&!M.isWindow(r)){for(g=f.delegateType||m,u=ne.test(g+m)?r:r.parentNode,c=null;u;u=u.parentNode)h.push([u,g]),c=u;c&&c===r.ownerDocument&&h.push([c.defaultView||c.parentWindow||e,g])}for(l=0;lh&&v.push({elem:this,matches:p.slice(h)}),i=0;i0?this.on(t,null,e,n):this.trigger(t)},M.attrFn&&(M.attrFn[t]=!0),ee.test(t)&&(M.event.fixHooks[t]=M.event.keyHooks),te.test(t)&&(M.event.fixHooks[t]=M.event.mouseHooks)}),function(){function e(e,t,n,i,o,a){for(var s=0,l=i.length;s0){c=u;break}u=u[e]}i[s]=c}}}function n(e,t,n,i,o,a){for(var s=0,l=i.length;s+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,r="sizcache"+(Math.random()+"").replace(".",""),o=0,a=Object.prototype.toString,s=!1,l=!0,u=/\\/g,c=/\r\n/g,d=/\W/;[0,0].sort(function(){return l=!1,0});var f=function(e,t,n,r){n=n||[],t=t||j;var o=t;if(1!==t.nodeType&&9!==t.nodeType)return[];if(!e||"string"!=typeof e)return n;var s,l,u,c,d,p,m,y,b=!0,w=f.isXML(t),k=[],T=e;do{if(i.exec(""),(s=i.exec(T))&&(T=s[3],k.push(s[1]),s[2])){c=s[3];break}}while(s);if(k.length>1&&g.exec(e))if(2===k.length&&h.relative[k[0]])l=x(k[0]+k[1],t,r);else for(l=h.relative[k[0]]?[t]:f(k.shift(),t);k.length;)e=k.shift(),h.relative[e]&&(e+=k.shift()),l=x(e,l,r);else if(!r&&k.length>1&&9===t.nodeType&&!w&&h.match.ID.test(k[0])&&!h.match.ID.test(k[k.length-1])&&(d=f.find(k.shift(),t,w),t=d.expr?f.filter(d.expr,d.set)[0]:d.set[0]),t)for(d=r?{expr:k.pop(),set:v(r)}:f.find(k.pop(),1!==k.length||"~"!==k[0]&&"+"!==k[0]||!t.parentNode?t:t.parentNode,w),l=d.expr?f.filter(d.expr,d.set):d.set,k.length>0?u=v(l):b=!1;k.length;)p=k.pop(),m=p,h.relative[p]?m=k.pop():p="",null==m&&(m=t),h.relative[p](u,m,w);else u=k=[];if(u||(u=l),u||f.error(p||e),"[object Array]"===a.call(u))if(b)if(t&&1===t.nodeType)for(y=0;null!=u[y];y++)u[y]&&(!0===u[y]||1===u[y].nodeType&&f.contains(t,u[y]))&&n.push(l[y]);else for(y=0;null!=u[y];y++)u[y]&&1===u[y].nodeType&&n.push(l[y]);else n.push.apply(n,u);else v(u,n);return c&&(f(c,o,n,r),f.uniqueSort(n)),n};f.uniqueSort=function(e){if(b&&(s=l,e.sort(b),s))for(var t=1;t0},f.find=function(e,t,n){var i,r,o,a,s,l;if(!e)return[];for(r=0,o=h.order.length;r":function(e,t){var n,i="string"==typeof t,r=0,o=e.length;if(i&&!d.test(t)){for(t=t.toLowerCase();r=0)?n||i.push(a):n&&(t[s]=!1));return!1},ID:function(e){return e[1].replace(u,"")},TAG:function(e){return e[1].replace(u,"").toLowerCase()},CHILD:function(e){if("nth"===e[1]){e[2]||f.error(e[0]),e[2]=e[2].replace(/^\+|\s*/g,"");var t=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec("even"===e[2]&&"2n"||"odd"===e[2]&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=t[1]+(t[2]||1)-0,e[3]=t[3]-0}else e[2]&&f.error(e[0]);return e[0]=o++,e},ATTR:function(e,t,n,i,r,o){var a=e[1]=e[1].replace(u,"");return!o&&h.attrMap[a]&&(e[1]=h.attrMap[a]),e[4]=(e[4]||e[5]||"").replace(u,""),"~="===e[2]&&(e[4]=" "+e[4]+" "),e},PSEUDO:function(e,t,n,r,o){if("not"===e[1]){if(!((i.exec(e[3])||"").length>1||/^\w/.test(e[3]))){var a=f.filter(e[3],t,n,!0^o);return n||r.push.apply(r,a),!1}e[3]=f(e[3],null,null,t)}else if(h.match.POS.test(e[0])||h.match.CHILD.test(e[0]))return!0;return e},POS:function(e){return e.unshift(!0),e}},filters:{enabled:function(e){return!1===e.disabled&&"hidden"!==e.type},disabled:function(e){return!0===e.disabled},checked:function(e){return!0===e.checked},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},parent:function(e){return!!e.firstChild},empty:function(e){return!e.firstChild},has:function(e,t,n){return!!f(n[3],e).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){var t=e.getAttribute("type"),n=e.type;return"input"===e.nodeName.toLowerCase()&&"text"===n&&(t===n||null===t)},radio:function(e){return"input"===e.nodeName.toLowerCase()&&"radio"===e.type},checkbox:function(e){return"input"===e.nodeName.toLowerCase()&&"checkbox"===e.type},file:function(e){return"input"===e.nodeName.toLowerCase()&&"file"===e.type},password:function(e){return"input"===e.nodeName.toLowerCase()&&"password"===e.type},submit:function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&"submit"===e.type},image:function(e){return"input"===e.nodeName.toLowerCase()&&"image"===e.type},reset:function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&"reset"===e.type},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(e,t){return 0===t},last:function(e,t,n,i){return t===i.length-1},even:function(e,t){return t%2==0},odd:function(e,t){return t%2==1},lt:function(e,t,n){return tn[3]-0},nth:function(e,t,n){return n[3]-0===t},eq:function(e,t,n){return n[3]-0===t}},filter:{PSEUDO:function(e,t,n,i){var r=t[1],o=h.filters[r];if(o)return o(e,n,t,i);if("contains"===r)return(e.textContent||e.innerText||p([e])||"").indexOf(t[3])>=0;if("not"===r){for(var a=t[3],s=0,l=a.length;s=0}},ID:function(e,t){return 1===e.nodeType&&e.getAttribute("id")===t},TAG:function(e,t){return"*"===t&&1===e.nodeType||!!e.nodeName&&e.nodeName.toLowerCase()===t},CLASS:function(e,t){return(" "+(e.className||e.getAttribute("class"))+" ").indexOf(t)>-1},ATTR:function(e,t){var n=t[1],i=f.attr?f.attr(e,n):h.attrHandle[n]?h.attrHandle[n](e):null!=e[n]?e[n]:e.getAttribute(n),r=i+"",o=t[2],a=t[4];return null==i?"!="===o:!o&&f.attr?null!=i:"="===o?r===a:"*="===o?r.indexOf(a)>=0:"~="===o?(" "+r+" ").indexOf(a)>=0:a?"!="===o?r!==a:"^="===o?0===r.indexOf(a):"$="===o?r.substr(r.length-a.length)===a:"|="===o&&(r===a||r.substr(0,a.length+1)===a+"-"):r&&!1!==i},POS:function(e,t,n,i){var r=t[2],o=h.setFilters[r];if(o)return o(e,n,t,i)}}},g=h.match.POS,m=function(e,t){return"\\"+(t-0+1)};for(var y in h.match)h.match[y]=new RegExp(h.match[y].source+/(?![^\[]*\])(?![^\(]*\))/.source),h.leftMatch[y]=new RegExp(/(^(?:.|\r|\n)*?)/.source+h.match[y].source.replace(/\\(\d+)/g,m));h.match.globalPOS=g;var v=function(e,t){return e=Array.prototype.slice.call(e,0),t?(t.push.apply(t,e),t):e};try{Array.prototype.slice.call(j.documentElement.childNodes,0)[0].nodeType}catch(e){v=function(e,t){var n=0,i=t||[];if("[object Array]"===a.call(e))Array.prototype.push.apply(i,e);else if("number"==typeof e.length)for(var r=e.length;n",i.insertBefore(e,i.firstChild),j.getElementById(n)&&(h.find.ID=function(e,n,i){if("undefined"!=typeof n.getElementById&&!i){var r=n.getElementById(e[1]);return r?r.id===e[1]||"undefined"!=typeof r.getAttributeNode&&r.getAttributeNode("id").nodeValue===e[1]?[r]:t:[]}},h.filter.ID=function(e,t){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return 1===e.nodeType&&n&&n.nodeValue===t}),i.removeChild(e),i=e=null}(),function(){var e=j.createElement("div");e.appendChild(j.createComment("")),e.getElementsByTagName("*").length>0&&(h.find.TAG=function(e,t){var n=t.getElementsByTagName(e[1]);if("*"===e[1]){for(var i=[],r=0;n[r];r++)1===n[r].nodeType&&i.push(n[r]);n=i}return n}),e.innerHTML="",e.firstChild&&"undefined"!=typeof e.firstChild.getAttribute&&"#"!==e.firstChild.getAttribute("href")&&(h.attrHandle.href=function(e){return e.getAttribute("href",2)}),e=null}(),j.querySelectorAll&&function(){var e=f,t=j.createElement("div");if(t.innerHTML="

",!t.querySelectorAll||0!==t.querySelectorAll(".TEST").length){f=function(t,n,i,r){if(n=n||j,!r&&!f.isXML(n)){var o=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(t);if(o&&(1===n.nodeType||9===n.nodeType)){if(o[1])return v(n.getElementsByTagName(t),i);if(o[2]&&h.find.CLASS&&n.getElementsByClassName)return v(n.getElementsByClassName(o[2]),i)}if(9===n.nodeType){if("body"===t&&n.body)return v([n.body],i);if(o&&o[3]){var a=n.getElementById(o[3]);if(!a||!a.parentNode)return v([],i);if(a.id===o[3])return v([a],i)}try{return v(n.querySelectorAll(t),i)}catch(e){}}else if(1===n.nodeType&&"object"!==n.nodeName.toLowerCase()){var s=n,l=n.getAttribute("id"),u=l||"__sizzle__",c=n.parentNode,d=/^\s*[+~]/.test(t);l?u=u.replace(/'/g,"\\$&"):n.setAttribute("id",u),d&&c&&(n=n.parentNode);try{if(!d||c)return v(n.querySelectorAll("[id='"+u+"'] "+t),i)}catch(e){}finally{l||s.removeAttribute("id")}}}return e(t,n,i,r)};for(var n in e)f[n]=e[n];t=null}}(),function(){var e=j.documentElement,t=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(t){var n=!t.call(j.createElement("div"),"div"),i=!1;try{t.call(j.documentElement,"[test!='']:sizzle")}catch(e){i=!0}f.matchesSelector=function(e,r){if(r=r.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']"),!f.isXML(e))try{if(i||!h.match.PSEUDO.test(r)&&!/!=/.test(r)){var o=t.call(e,r);if(o||!n||e.document&&11!==e.document.nodeType)return o}}catch(e){}return f(r,null,null,[e]).length>0}}}(),function(){var e=j.createElement("div");if(e.innerHTML="
",e.getElementsByClassName&&0!==e.getElementsByClassName("e").length){if(e.lastChild.className="e",1===e.getElementsByClassName("e").length)return;h.order.splice(1,0,"CLASS"),h.find.CLASS=function(e,t,n){if("undefined"!=typeof t.getElementsByClassName&&!n)return t.getElementsByClassName(e[1])},e=null}}(),j.documentElement.contains?f.contains=function(e,t){return e!==t&&(!e.contains||e.contains(t))}:j.documentElement.compareDocumentPosition?f.contains=function(e,t){return!!(16&e.compareDocumentPosition(t))}:f.contains=function(){return!1},f.isXML=function(e){var t=(e?e.ownerDocument||e:0).documentElement;return!!t&&"HTML"!==t.nodeName};var x=function(e,t,n){for(var i,r=[],o="",a=t.nodeType?[t]:t;i=h.match.PSEUDO.exec(e);)o+=i[0],e=e.replace(h.match.PSEUDO,"");e=h.relative[e]?e+"*":e;for(var s=0,l=a.length;s0)for(o=r;o=0:M.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,i,r=[],o=this[0];if(M.isArray(e)){for(var a=1;o&&o.ownerDocument&&o!==t;){for(n=0;n-1:M.find.matchesSelector(o,e)){r.push(o);break}if(!(o=o.parentNode)||!o.ownerDocument||o===t||11===o.nodeType)break}return r=r.length>1?M.unique(r):r,this.pushStack(r,"closest",e)},index:function(e){return e?"string"==typeof e?M.inArray(this[0],M(e)):M.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n="string"==typeof e?M(e,t):M.makeArray(e&&e.nodeType?[e]:e),i=M.merge(this.get(),n);return this.pushStack(E(n[0])||E(i[0])?i:M.unique(i))},andSelf:function(){return this.add(this.prevObject)}}),M.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return M.dir(e,"parentNode")},parentsUntil:function(e,t,n){return M.dir(e,"parentNode",n)},next:function(e){return M.nth(e,2,"nextSibling")},prev:function(e){return M.nth(e,2,"previousSibling")},nextAll:function(e){return M.dir(e,"nextSibling")},prevAll:function(e){return M.dir(e,"previousSibling")},nextUntil:function(e,t,n){return M.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return M.dir(e,"previousSibling",n)},siblings:function(e){return M.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return M.sibling(e.firstChild)},contents:function(e){return M.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:M.makeArray(e.childNodes)}},function(e,t){M.fn[e]=function(n,i){var r=M.map(this,t,n);return se.test(e)||(i=n),i&&"string"==typeof i&&(r=M.filter(i,r)),r=this.length>1&&!pe[e]?M.unique(r):r,(this.length>1||ue.test(i))&&le.test(e)&&(r=r.reverse()),this.pushStack(r,e,de.call(arguments).join(","))}}),M.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?M.find.matchesSelector(t[0],e)?[t[0]]:[]:M.find.matches(e,t)},dir:function(e,n,i){for(var r=[],o=e[n];o&&9!==o.nodeType&&(i===t||1!==o.nodeType||!M(o).is(i));)1===o.nodeType&&r.push(o),o=o[n];return r},nth:function(e,t,n){t=t||1;for(var i=0;e&&(1!==e.nodeType||++i!==t);e=e[n]);return e},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});var he="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ge=/ jQuery\d+="(?:\d+|null)"/g,me=/^\s+/,ye=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ve=/<([\w:]+)/,be=/]","i"),Ce=/checked\s*(?:[^=]|=\s*.checked.)/i,Ee=/\/(java|ecma)script/i,Ne=/^\s*",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},Se=T(j);_e.optgroup=_e.option,_e.tbody=_e.tfoot=_e.colgroup=_e.caption=_e.thead,_e.th=_e.td,M.support.htmlSerialize||(_e._default=[1,"div
","
"]),M.fn.extend({text:function(e){return M.access(this,function(e){return e===t?M.text(this):this.empty().append((this[0]&&this[0].ownerDocument||j).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(M.isFunction(e))return this.each(function(t){M(this).wrapAll(e.call(this,t))});if(this[0]){var t=M(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return M.isFunction(e)?this.each(function(t){M(this).wrapInner(e.call(this,t))}):this.each(function(){var t=M(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=M.isFunction(e);return this.each(function(n){M(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){M.nodeName(this,"body")||M(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){1===this.nodeType&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){1===this.nodeType&&this.insertBefore(e,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=M.clean(arguments);return e.push.apply(e,this.toArray()),this.pushStack(e,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=this.pushStack(this,"after",arguments);return e.push.apply(e,M.clean(arguments)),e}},remove:function(e,t){for(var n,i=0;null!=(n=this[i]);i++)e&&!M.filter(e,[n]).length||(!t&&1===n.nodeType&&(M.cleanData(n.getElementsByTagName("*")),M.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)for(1===e.nodeType&&M.cleanData(e.getElementsByTagName("*"));e.firstChild;)e.removeChild(e.firstChild);return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return M.clone(this,e,t)})},html:function(e){return M.access(this,function(e){var n=this[0]||{},i=0,r=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(ge,""):null;if("string"==typeof e&&!xe.test(e)&&(M.support.leadingWhitespace||!me.test(e))&&!_e[(ve.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(ye,"<$1>");try{for(;i1&&c0?this.clone(!0):this).get();M(r[a])[t](l),i=i.concat(l)}return this.pushStack(i,e,r.selector)}}),M.extend({clone:function(e,t,n){var i,r,o,a=M.support.html5Clone||M.isXMLDoc(e)||!Te.test("<"+e.nodeName+">")?e.cloneNode(!0):m(e);if(!(M.support.noCloneEvent&&M.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||M.isXMLDoc(e)))for(w(e,a),i=b(e),r=b(a),o=0;i[o];++o)r[o]&&w(i[o],r[o]);if(t&&(x(e,a),n))for(i=b(e),r=b(a),o=0;i[o];++o)x(i[o],r[o]);return i=r=null,a},clean:function(e,t,n,i){var r,o,a,s=[];t=t||j,"undefined"==typeof t.createElement&&(t=t.ownerDocument||t[0]&&t[0].ownerDocument||j);for(var l,u=0;null!=(l=e[u]);u++)if("number"==typeof l&&(l+=""),l){if("string"==typeof l)if(we.test(l)){l=l.replace(ye,"<$1>");var c,d=(ve.exec(l)||["",""])[1].toLowerCase(),f=_e[d]||_e._default,p=f[0],h=t.createElement("div"),g=Se.childNodes;for(t===j?Se.appendChild(h):T(t).appendChild(h),h.innerHTML=f[1]+l+f[2];p--;)h=h.lastChild;if(!M.support.tbody){var m=be.test(l),v="table"!==d||m?""!==f[1]||m?[]:h.childNodes:h.firstChild&&h.firstChild.childNodes;for(a=v.length-1;a>=0;--a)M.nodeName(v[a],"tbody")&&!v[a].childNodes.length&&v[a].parentNode.removeChild(v[a])}!M.support.leadingWhitespace&&me.test(l)&&h.insertBefore(t.createTextNode(me.exec(l)[0]),h.firstChild),l=h.childNodes,h&&(h.parentNode.removeChild(h),g.length>0&&(c=g[g.length-1])&&c.parentNode&&c.parentNode.removeChild(c))}else l=t.createTextNode(l);var b;if(!M.support.appendChecked)if(l[0]&&"number"==typeof(b=l.length))for(a=0;a1)},M.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Ae(e,"opacity");return""===n?"1":n}return e.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":M.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,i,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s=M.camelCase(n),l=e.style,u=M.cssHooks[s];if(n=M.cssProps[s]||s,i===t)return u&&"get"in u&&(o=u.get(e,!1,r))!==t?o:l[n];if("string"===(a=typeof i)&&(o=Pe.exec(i))&&(i=+(o[1]+1)*+o[2]+parseFloat(M.css(e,n)),a="number"),null==i||"number"===a&&isNaN(i))return;if("number"===a&&!M.cssNumber[s]&&(i+="px"),!(u&&"set"in u&&(i=u.set(e,i))===t))try{l[n]=i}catch(e){}}},css:function(e,n,i){var r,o;return n=M.camelCase(n),o=M.cssHooks[n],"cssFloat"===(n=M.cssProps[n]||n)&&(n="float"),o&&"get"in o&&(r=o.get(e,!0,i))!==t?r:Ae?Ae(e,n):void 0},swap:function(e,t,n){var i,r,o={};for(r in t)o[r]=e.style[r],e.style[r]=t[r];i=n.call(e);for(r in t)e.style[r]=o[r];return i}}),M.curCSS=M.css,j.defaultView&&j.defaultView.getComputedStyle&&($e=function(e,t){var n,i,r,o,a=e.style;return t=t.replace(Fe,"-$1").toLowerCase(),(i=e.ownerDocument.defaultView)&&(r=i.getComputedStyle(e,null))&&""===(n=r.getPropertyValue(t))&&!M.contains(e.ownerDocument.documentElement,e)&&(n=M.style(e,t)),!M.support.pixelMargin&&r&&He.test(t)&&Oe.test(n)&&(o=a.width,a.width=n,n=r.width,a.width=o),n}),j.documentElement.currentStyle&&(Le=function(e,t){var n,i,r,o=e.currentStyle&&e.currentStyle[t],a=e.style;return null==o&&a&&(r=a[t])&&(o=r),Oe.test(o)&&(n=a.left,i=e.runtimeStyle&&e.runtimeStyle.left,i&&(e.runtimeStyle.left=e.currentStyle.left),a.left="fontSize"===t?"1em":o,o=a.pixelLeft+"px",a.left=n,i&&(e.runtimeStyle.left=i)),""===o?"auto":o}),Ae=$e||Le,M.each(["height","width"],function(e,t){M.cssHooks[t]={get:function(e,n,i){if(n)return 0!==e.offsetWidth?g(e,t,i):M.swap(e,ze,function(){return g(e,t,i)})},set:function(e,t){return Me.test(t)?t+"px":t}}}),M.support.opacity||(M.cssHooks.opacity={get:function(e,t){return De.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?parseFloat(RegExp.$1)/100+"":t?"1":""},set:function(e,t){var n=e.style,i=e.currentStyle,r=M.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=i&&i.filter||n.filter||"";n.zoom=1,t>=1&&""===M.trim(o.replace(je,""))&&(n.removeAttribute("filter"),i&&!i.filter)||(n.filter=je.test(o)?o.replace(je,r):o+" "+r)}}),M(function(){M.support.reliableMarginRight||(M.cssHooks.marginRight={get:function(e,t){return M.swap(e,{display:"inline-block"},function(){return t?Ae(e,"margin-right"):e.style.marginRight})}})}),M.expr&&M.expr.filters&&(M.expr.filters.hidden=function(e){var t=e.offsetWidth,n=e.offsetHeight;return 0===t&&0===n||!M.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||M.css(e,"display"))},M.expr.filters.visible=function(e){return!M.expr.filters.hidden(e)}),M.each({margin:"",padding:"",border:"Width"},function(e,t){M.cssHooks[e+t]={expand:function(n){var i,r="string"==typeof n?n.split(" "):[n],o={};for(i=0;i<4;i++)o[e+qe[i]+t]=r[i]||r[i-2]||r[0];return o}}});var Be,Re,Ie=/%20/g,We=/\[\]$/,Xe=/\r?\n/g,Ue=/#.*$/,Ve=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Ke=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,Ge=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,Je=/^(?:GET|HEAD)$/,Ye=/^\/\//,Qe=/\?/,Ze=/)<[^<]*)*<\/script>/gi,et=/^(?:select|textarea)/i,tt=/\s+/,nt=/([?&])_=[^&]*/,it=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,rt=M.fn.load,ot={},at={},st=["*/"]+["*"];try{Be=F.href}catch(e){Be=j.createElement("a"),Be.href="",Be=Be.href}Re=it.exec(Be.toLowerCase())||[],M.fn.extend({load:function(e,n,i){if("string"!=typeof e&&rt)return rt.apply(this,arguments);if(!this.length)return this;var r=e.indexOf(" ");if(r>=0){var o=e.slice(r,e.length);e=e.slice(0,r)}var a="GET";n&&(M.isFunction(n)?(i=n,n=t):"object"==typeof n&&(n=M.param(n,M.ajaxSettings.traditional),a="POST"));var s=this;return M.ajax({url:e,type:a,dataType:"html",data:n,complete:function(e,t,n){n=e.responseText,e.isResolved()&&(e.done(function(e){n=e}),s.html(o?M("
").append(n.replace(Ze,"")).find(o):n)),i&&s.each(i,[n,t,e])}}),this},serialize:function(){return M.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?M.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||et.test(this.nodeName)||Ke.test(this.type))}).map(function(e,t){var n=M(this).val();return null==n?null:M.isArray(n)?M.map(n,function(e){return{name:t.name,value:e.replace(Xe,"\r\n")}}):{name:t.name,value:n.replace(Xe,"\r\n")}}).get()}}),M.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){M.fn[t]=function(e){return this.on(t,e)}}),M.each(["get","post"],function(e,n){M[n]=function(e,i,r,o){return M.isFunction(i)&&(o=o||r,r=i,i=t),M.ajax({type:n,url:e,data:i,success:r,dataType:o})}}),M.extend({getScript:function(e,n){return M.get(e,t,n,"script")},getJSON:function(e,t,n){return M.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?f(e,M.ajaxSettings):(t=e,e=M.ajaxSettings),f(e,t),e},ajaxSettings:{url:Be,isLocal:Ge.test(Re[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":st},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":M.parseJSON,"text xml":M.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:h(ot),ajaxTransport:h(at),ajax:function(e,n){function i(e,n,i,a){if(2!==T){T=2,l&&clearTimeout(l),s=t,o=a||"",C.readyState=e>0?4:0;var d,p,h,x,k,E=n,N=i?c(g,C,i):t;if(e>=200&&e<300||304===e)if(g.ifModified&&((x=C.getResponseHeader("Last-Modified"))&&(M.lastModified[r]=x),(k=C.getResponseHeader("Etag"))&&(M.etag[r]=k)),304===e)E="notmodified",d=!0;else try{p=u(g,N),E="success",d=!0}catch(e){E="parsererror",h=e}else h=E,E&&!e||(E="error",e<0&&(e=0));C.status=e,C.statusText=""+(n||E),d?v.resolveWith(m,[p,E,C]):v.rejectWith(m,[C,E,h]),C.statusCode(w),w=t,f&&y.trigger("ajax"+(d?"Success":"Error"),[C,g,d?p:h]),b.fireWith(m,[C,E]),f&&(y.trigger("ajaxComplete",[C,g]),--M.active||M.event.trigger("ajaxStop"))}}"object"==typeof e&&(n=e,e=t),n=n||{};var r,o,a,s,l,d,f,h,g=M.ajaxSetup({},n),m=g.context||g,y=m!==g&&(m.nodeType||m instanceof M)?M(m):M.event,v=M.Deferred(),b=M.Callbacks("once memory"),w=g.statusCode||{},x={},k={},T=0,C={readyState:0,setRequestHeader:function(e,t){if(!T){var n=e.toLowerCase();e=k[n]=k[n]||e,x[e]=t}return this},getAllResponseHeaders:function(){return 2===T?o:null},getResponseHeader:function(e){var n;if(2===T){if(!a)for(a={};n=Ve.exec(o);)a[n[1].toLowerCase()]=n[2];n=a[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return T||(g.mimeType=e),this},abort:function(e){return e=e||"abort",s&&s.abort(e),i(0,e),this}};if(v.promise(C),C.success=C.done,C.error=C.fail,C.complete=b.add,C.statusCode=function(e){if(e){var t;if(T<2)for(t in e)w[t]=[w[t],e[t]];else t=e[C.status],C.then(t,t)}return this},g.url=((e||g.url)+"").replace(Ue,"").replace(Ye,Re[1]+"//"),g.dataTypes=M.trim(g.dataType||"*").toLowerCase().split(tt),null==g.crossDomain&&(d=it.exec(g.url.toLowerCase()),g.crossDomain=!(!d||d[1]==Re[1]&&d[2]==Re[2]&&(d[3]||("http:"===d[1]?80:443))==(Re[3]||("http:"===Re[1]?80:443)))),g.data&&g.processData&&"string"!=typeof g.data&&(g.data=M.param(g.data,g.traditional)),p(ot,g,n,C),2===T)return!1;if(f=g.global,g.type=g.type.toUpperCase(),g.hasContent=!Je.test(g.type),f&&0==M.active++&&M.event.trigger("ajaxStart"),!g.hasContent&&(g.data&&(g.url+=(Qe.test(g.url)?"&":"?")+g.data,delete g.data),r=g.url,!1===g.cache)){var E=M.now(),N=g.url.replace(nt,"$1_="+E);g.url=N+(N===g.url?(Qe.test(g.url)?"&":"?")+"_="+E:"")}(g.data&&g.hasContent&&!1!==g.contentType||n.contentType)&&C.setRequestHeader("Content-Type",g.contentType),g.ifModified&&(r=r||g.url,M.lastModified[r]&&C.setRequestHeader("If-Modified-Since",M.lastModified[r]),M.etag[r]&&C.setRequestHeader("If-None-Match",M.etag[r])),C.setRequestHeader("Accept",g.dataTypes[0]&&g.accepts[g.dataTypes[0]]?g.accepts[g.dataTypes[0]]+("*"!==g.dataTypes[0]?", "+st+"; q=0.01":""):g.accepts["*"]);for(h in g.headers)C.setRequestHeader(h,g.headers[h]);if(g.beforeSend&&(!1===g.beforeSend.call(m,C,g)||2===T))return C.abort(),!1;for(h in{success:1,error:1,complete:1})C[h](g[h]);if(s=p(at,g,n,C)){C.readyState=1,f&&y.trigger("ajaxSend",[C,g]),g.async&&g.timeout>0&&(l=setTimeout(function(){C.abort("timeout")},g.timeout));try{T=1,s.send(x,i)}catch(e){if(!(T<2))throw e;i(-1,e)}}else i(-1,"No Transport");return C},param:function(e,n){var i=[],r=function(e,t){t=M.isFunction(t)?t():t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=M.ajaxSettings.traditional),M.isArray(e)||e.jquery&&!M.isPlainObject(e))M.each(e,function(){r(this.name,this.value)});else for(var o in e)d(o,e[o],n,r);return i.join("&").replace(Ie,"+")}}),M.extend({active:0,lastModified:{},etag:{}});var lt=M.now(),ut=/(\=)\?(&|$)|\?\?/i;M.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return M.expando+"_"+lt++}}),M.ajaxPrefilter("json jsonp",function(t,n,i){var r="string"==typeof t.data&&/^application\/x\-www\-form\-urlencoded/.test(t.contentType);if("jsonp"===t.dataTypes[0]||!1!==t.jsonp&&(ut.test(t.url)||r&&ut.test(t.data))){var o,a=t.jsonpCallback=M.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s=e[a],l=t.url,u=t.data,c="$1"+a+"$2";return!1!==t.jsonp&&(l=l.replace(ut,c),t.url===l&&(r&&(u=u.replace(ut,c)),t.data===u&&(l+=(/\?/.test(l)?"&":"?")+t.jsonp+"="+a))),t.url=l,t.data=u,e[a]=function(e){o=[e]},i.always(function(){e[a]=s,o&&M.isFunction(s)&&e[a](o[0])}),t.converters["script json"]=function(){return o||M.error(a+" was not called"),o[0]},t.dataTypes[0]="json","script"}}),M.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return M.globalEval(e),e}}}),M.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),M.ajaxTransport("script",function(e){if(e.crossDomain){var n,i=j.head||j.getElementsByTagName("head")[0]||j.documentElement;return{send:function(r,o){n=j.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,r){(r||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,i&&n.parentNode&&i.removeChild(n),n=t,r||o(200,"success"))},i.insertBefore(n,i.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var ct,dt=!!e.ActiveXObject&&function(){for(var e in ct)ct[e](0,1)},ft=0;M.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&l()||s()}:l,function(e){M.extend(M.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(M.ajaxSettings.xhr()),M.support.ajax&&M.ajaxTransport(function(n){if(!n.crossDomain||M.support.cors){var i;return{send:function(r,o){var a,s,l=n.xhr();if(n.username?l.open(n.type,n.url,n.async,n.username,n.password):l.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)l[s]=n.xhrFields[s];n.mimeType&&l.overrideMimeType&&l.overrideMimeType(n.mimeType),!n.crossDomain&&!r["X-Requested-With"]&&(r["X-Requested-With"]="XMLHttpRequest");try{for(s in r)l.setRequestHeader(s,r[s])}catch(e){}l.send(n.hasContent&&n.data||null),i=function(e,r){var s,u,c,d,f;try{if(i&&(r||4===l.readyState))if(i=t,a&&(l.onreadystatechange=M.noop,dt&&delete ct[a]),r)4!==l.readyState&&l.abort();else{s=l.status,c=l.getAllResponseHeaders(),d={},(f=l.responseXML)&&f.documentElement&&(d.xml=f);try{d.text=l.responseText}catch(e){}try{u=l.statusText}catch(e){u=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=d.text?200:404}}catch(e){r||o(-1,e)}d&&o(s,u,d,c)},n.async&&4!==l.readyState?(a=++ft,dt&&(ct||(ct={},M(e).unload(dt)),ct[a]=i),l.onreadystatechange=i):i()},abort:function(){i&&i(0,1)}}}});var pt,ht,gt,mt,yt={},vt=/^(?:toggle|show|hide)$/,bt=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,wt=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];M.fn.extend({show:function(e,t,n){var o,a;if(e||0===e)return this.animate(r("show",3),e,t,n);for(var s=0,l=this.length;s=l.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),l.animatedProperties[this.prop]=!0;for(t in l.animatedProperties)!0!==l.animatedProperties[t]&&(o=!1);if(o){if(null!=l.overflow&&!M.support.shrinkWrapBlocks&&M.each(["","X","Y"],function(e,t){s.style["overflow"+t]=l.overflow[e]}),l.hide&&M(s).hide(),l.hide||l.show)for(t in l.animatedProperties)M.style(s,t,l.orig[t]),M.removeData(s,"fxshow"+t,!0),M.removeData(s,"toggle"+t,!0);(i=l.complete)&&(l.complete=!1,i.call(s))}return!1}return l.duration==Infinity?this.now=r:(n=r-this.startTime,this.state=n/l.duration,this.pos=M.easing[l.animatedProperties[this.prop]](this.state,n,0,1,l.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update(),!0}},M.extend(M.fx,{tick:function(){for(var e,t=M.timers,n=0;n-1,d={},f={};c?(f=a.position(),r=f.top,o=f.left):(r=parseFloat(l)||0,o=parseFloat(u)||0),M.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(d.top=t.top-s.top+r),null!=t.left&&(d.left=t.left-s.left+o),"using"in t?t.using.call(e,d):a.css(d)}},M.fn.extend({position:function(){if(!this[0])return null;var e=this[0],t=this.offsetParent(),n=this.offset(),i=Tt.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(M.css(e,"marginTop"))||0,n.left-=parseFloat(M.css(e,"marginLeft"))||0,i.top+=parseFloat(M.css(t[0],"borderTopWidth"))||0,i.left+=parseFloat(M.css(t[0],"borderLeftWidth"))||0,{top:n.top-i.top,left:n.left-i.left}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||j.body;e&&!Tt.test(e.nodeName)&&"static"===M.css(e,"position");)e=e.offsetParent;return e})}}),M.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,i){var r=/Y/.test(i);M.fn[e]=function(o){return M.access(this,function(e,o,a){var s=n(e);if(a===t)return s?i in s?s[i]:M.support.boxModel&&s.document.documentElement[o]||s.document.body[o]:e[o];s?s.scrollTo(r?M(s).scrollLeft():a,r?a:M(s).scrollTop()):e[o]=a},e,o,arguments.length,null)}}),M.each({Height:"height",Width:"width"},function(e,n){var i="client"+e,r="scroll"+e,o="offset"+e;M.fn["inner"+e]=function(){var e=this[0];return e?e.style?parseFloat(M.css(e,n,"padding")):this[n]():null},M.fn["outer"+e]=function(e){var t=this[0];return t?t.style?parseFloat(M.css(t,n,e?"margin":"border")):this[n]():null},M.fn[n]=function(e){return M.access(this,function(e,n,a){var s,l,u,c;return M.isWindow(e)?(s=e.document,l=s.documentElement[i],M.support.boxModel&&l||s.body&&s.body[i]||l):9===e.nodeType?(s=e.documentElement,s[i]>=s[r]?s[i]:Math.max(e.body[r],s[r],e.body[o],s[o])):a===t?(u=M.css(e,n),c=parseFloat(u),M.isNumeric(c)?c:u):void M(e).css(n,a)},n,e,arguments.length,null)}}),e.jQuery=e.$=M,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return M})}(window),function(){var e;e="undefined"!=typeof module&&"undefined"!=typeof module.exports?require("./pnglib"):window.PNGlib;var t=function(e,t){if("string"!=typeof e||e.length<15)throw"A hash of at least 15 characters is required.";this.defaults={background:[240,240,240,255],margin:.08,size:64,saturation:.7,brightness:.5,format:"png"},this.options="object"==typeof t?t:this.defaults,"number"==typeof arguments[1]&&(this.options.size=arguments[1]),arguments[2]&&(this.options.margin=arguments[2]),this.hash=e,this.background=this.options.background||this.defaults.background,this.size=this.options.size||this.defaults.size,this.format=this.options.format||this.defaults.format,this.margin=this.options.margin!==undefined?this.options.margin:this.defaults.margin;var n=parseInt(this.hash.substr(-7),16)/268435455,i=this.options.saturation||this.defaults.saturation,r=this.options.brightness||this.defaults.brightness;this.foreground=this.options.foreground||this.hsl2rgb(n,i,r)};t.prototype={background:null,foreground:null,hash:null,margin:null,size:null,format:null,image:function(){return this.isSvg()?new n(this.size,this.foreground,this.background):new e(this.size,this.size,256)},render:function(){var e,t,n=this.image(),i=this.size,r=Math.floor(i*this.margin),o=Math.floor((i-2*r)/5),a=Math.floor((i-5*o)/2),s=n.color.apply(n,this.background),l=n.color.apply(n,this.foreground);for(e=0;e<15;e++)t=parseInt(this.hash.charAt(e),16)%2?s:l,e<5?this.rectangle(2*o+a,e*o+a,o,o,t,n):e<10?(this.rectangle(1*o+a,(e-5)*o+a,o,o,t,n), +this.rectangle(3*o+a,(e-5)*o+a,o,o,t,n)):e<15&&(this.rectangle(0*o+a,(e-10)*o+a,o,o,t,n),this.rectangle(4*o+a,(e-10)*o+a,o,o,t,n));return n},rectangle:function(e,t,n,i,r,o){if(this.isSvg())o.rectangles.push({x:e,y:t,w:n,h:i,color:r});else{var a,s;for(a=e;a=0&&i<=255?i/255:1),"rgba("+r.join(",")+")"},getDump:function(){var e,t,n,i=this.foreground,r=this.background,o=.005*this.size;for(t="",e=0;e");return t+=""},getBase64:function(){if("function"==typeof btoa)return btoa(this.getDump());if(Buffer)return new Buffer(this.getDump(),"binary").toString("base64");throw"Cannot generate base64 output"}},"undefined"!=typeof module&&"undefined"!=typeof module.exports?module.exports=t:window.Identicon=t}(),function(e,t,n){function i(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function r(e){if("keypress"==e.type){var t=String.fromCharCode(e.which);return e.shiftKey||(t=t.toLowerCase()),t}return d[e.which]?d[e.which]:f[e.which]?f[e.which]:String.fromCharCode(e.which).toLowerCase()}function o(e){var t=[];return e.shiftKey&&t.push("shift"),e.altKey&&t.push("alt"),e.ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),t}function a(e){return"shift"==e||"ctrl"==e||"alt"==e||"meta"==e}function s(e,t){var n,i,r,o=[];for(n=e,"+"===n?n=["+"]:(n=n.replace(/\+{2}/g,"+plus"),n=n.split("+")),r=0;rs||d.hasOwnProperty(s)&&(c[d[s]]=s)}r=c[n]?"keydown":"keypress"}return"keypress"==r&&o.length&&(r="keydown"),{key:i,modifiers:o,action:r}}function l(e,n){return null!==e&&e!==t&&(e===n||l(e.parentNode,n))}function u(e){function n(e){e=e||{};var t,n=!1;for(t in m)e[t]?n=!0:m[t]=0;n||(b=!1)}function l(e,t,n,i,r,o){var s,l,u=[],c=n.type;if(!h._callbacks[e])return[];for("keyup"==c&&a(e)&&(t=[e]),s=0;s":".","?":"/","|":"\\"},h={option:"alt",command:"meta","return":"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"};for(n=1;20>n;++n)d[111+n]="f"+n;for(n=0;9>=n;++n)d[n+96]=n.toString();u.prototype.bind=function(e,t,n){return e=e instanceof Array?e:[e],this._bindMultiple.call(this,e,t,n),this},u.prototype.unbind=function(e,t){return this.bind.call(this,e,function(){},t)},u.prototype.trigger=function(e,t){return this._directMap[e+":"+t]&&this._directMap[e+":"+t]({},e),this},u.prototype.reset=function(){return this._callbacks={},this._directMap={},this},u.prototype.stopCallback=function(e,t){return!(-1<(" "+t.className+" ").indexOf(" mousetrap ")||l(t,this.target))&&("INPUT"==t.tagName||"SELECT"==t.tagName||"TEXTAREA"==t.tagName||t.isContentEditable)},u.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)},u.addKeycodes=function(e){for(var t in e)e.hasOwnProperty(t)&&(d[t]=e[t]);c=null},u.init=function(){var e,n=u(t);for(e in n)"_"!==e.charAt(0)&&(u[e]=function(e){return function(){return n[e].apply(n,arguments)}}(e))},u.init(),e.Mousetrap=u,"undefined"!=typeof module&&module.exports&&(module.exports=u),"function"==typeof define&&define.amd&&define(function(){return u})}}("undefined"!=typeof window?window:null,"undefined"!=typeof window?document:null),function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ClipboardJS=t():e.ClipboardJS=t()}(this,function(){return function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:i})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var r in e)t.d(i,r,function(t){return e[t]}.bind(null,r));return i},t.n=function(e){var n=e&&e.__esModule?function(){return e["default"]}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){var n="data-clipboard-"+e;if(t.hasAttribute(n))return t.getAttribute(n)}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=function(){function e(e,t){for(var n=0;n/"+uploadDest+"/[filename]",action:routePath("upload_file")}],OK:function(){$("#wiki-content").addClass("uploading");var e=new FormData($("#upload").get(0)),t=$("#upload").attr("action");$.ajax({url:t,type:"POST",data:e,processData:!1,contentType:!1,success:function(){$("#wiki-content").removeClass("uploading"),flashNotice("success","Your file was successfully uploaded.")},error:function(e,t,n){$("#wiki-content").removeClass("uploading"),409==e.status?flashNotice("error","The file you tried to upload already exists. Please rename the file and try again."):flashNotice("error","Error uploading file: "+t+" "+n)}})}}),$("#gollum-dialog-action-ok").attr("disabled",!0),$("input:file").on("change",function(){$(this).val()&&(filename=$("input[type=file]").val().split("\\").pop(),upload_path="/"+uploadDest+"/"+filename,clipboard_button='',news="Your uploaded file will be accessible at
"+clipboard_button+" "+upload_path,$(".context").html(news),$("#gollum-dialog-action-ok").attr("disabled",!1))})})),$("#minibutton-rename-page").length&&($("#minibutton-rename-page").parent().removeClass("jaws"),$("#minibutton-rename-page").click(function(e){e.preventDefault();var t=decodeURI(pagePath()),n=decodeURI(pageName()),i="Renamed page will be under "+htmlEscape(cleanPath(t))+" unless an absolute path is given.";$.GollumDialog.init({title:"Rename Page",fields:[{id:"name",name:"Rename to",type:"text",defaultValue:n||"",context:i}],OK:function(e){var i="Rename Page";e.name&&(i=e.name);var r=abspath(t,i),o=r[0],a="/"+t==o?"Renamed "+n+" to "+i:"Renamed "+n+" to "+r.join("/"),s=$("form[name=rename]");s.children("input[name=rename]").val(r.join("/")),s.children("input[name=message]").val(a),s.submit()}})})),$("#minibutton-new-page").length&&($("#minibutton-new-page").parent().removeClass("jaws"),$("#minibutton-new-page").click(function(e){e.preventDefault();var t=pagePath();t===undefined&&0!=$("#file-browser").length&&(t=window.location.pathname.replace(routePath("overview"),""));var n="Page will be created under "+htmlEscape(cleanPath(t))+" unless an absolute path is given.";$.GollumDialog.init({title:"Create New Page",fields:[{id:"name",name:"Page Name",type:"text",defaultValue:"",context:n}],OK:function(e){var n="New Page";e.name&&(n=e.name);for(var i=[],r=abspath(t,n).join("/").split("/"),o=0;o").attr({type:"hidden",id:$(e).val(),name:"versions[]",value:$(e).val()}).appendTo($("#selection-form")),a()},l=function(e){$("#selection-form #"+$(e).val()).remove(),$(e).closest("li").removeClass(o.join(" ")),a()},u=function(){$("#version-form input").on("change",function(){this.checked?s(this):l(this)})};u(),a();var c=function(e){e.preventDefault(),$(this).hasClass("disabled")||$.ajax({url:$(this).attr("href"),type:"GET",success:function(e){var t=$("#page-history-list",e),n=$("#pagination",e);["#next","#prev"].forEach(function(e){old_btn=$("#pagination "+e),new_btn=n.find(e),old_btn.attr("href",new_btn.attr("href")),new_btn.hasClass("disabled")?old_btn.addClass("disabled"):old_btn.removeClass("disabled")}),$("#page-history-list").replaceWith(t),u(),a()},error:function(e,t,n){console.log("something went wrong: "+t+n)}}),this.blur()};$("#pagination #next, #pagination #prev").each(function(e,t){$(t).on("click",c)})}if($("#last-edit").length&&$("#page-info-toggle").click(function(){$.ajax({url:routePath("last_commit_info"),data:{path:$("#page-info-toggle").data("pagepath")},success:function(e){$("#last-edit").next(".dotted-spinner").toggleClass("hidden"),$("#last-edit-in-progress").html("Last edited by "+e.author+", "+e.date)}}),$("#last-edit").next(".dotted-spinner").toggleClass("hidden"),$("#page-info-toggle").before(' Getting commit info...').remove()}),$("#wiki-wrapper.create").length&&($("#gollum-editor-submit").click(function(){window.onbeforeunload=null}),$("#gollum-editor-body").one("change",function(){window.onbeforeunload=function(){return"Leaving will not create a new page!"}}),$.GollumEditor({NewFile:!0,MarkupType:default_markup,commands:i})),$("#search-results").length){$(".toggle-context").each(function(){var e=$(this).parent().next("div.search-context").find("li:hidden");e.length?$(this).click(function(){e.toggle(),$(this).toggle()}):$(this).toggle()});var d=new RegExp(searchTerms.join("|"),"gi");$("div.search-context li span").each(function(){var e=$(this).html().replace(/"/g,""").replace(/'/g,"'"),t=e.replace(d,function(e){return''+e+""});$(this).html(t)})}if($(".markdown-body").length&&(preparePage(),(match=new RegExp(/[?&]redirected\_from=([^?]*)/).exec(window.location.href))&&(notice="The page you requested was renamed or moved. You've been successfully redirected to its new location.",flashNotice("success",notice)),Mousetrap.bind(["e"],function(e){return e.preventDefault(),window.location=routePath("edit")+"/"+pageFullPath,!1}),$.markupSupportsEditableSections(pageFormat)&&$("a.anchor").each(function(e,t){if(header=$(t).closest(":header"),header.hasClass("editable")){var n=routePath("edit")+"/"+pageFullPath+$(t).attr("href");$(t).clone().addClass("edit").attr("href",n).appendTo(header)}})),$("#wiki-history").length||$("#page-history").length){var f={format:"svg",background:[255,255,255,255]};$("img.identicon").each(function(e,t){var n=$(t),i=n.data("identicon"),r=new Identicon(i,f).toString();r="data:image/svg+xml;base64,"+r,n.attr("src",r)})}}),function(e){var t={debugOn:!1,markupCreated:!1,markup:"",currentAspect:function(){return window.innerWidth<480?"small-mobile":"fixed"==e("#gollum-dialog-dialog").css("position")?"large-mobile":"desktop"},attachEvents:function(n){e("#gollum-dialog-action-ok").click(function(e){t.eventOK(e,n)}),e("#gollum-dialog-action-cancel").click(t.eventCancel),e('#gollum-dialog-dialog input[type="text"]').keydown(function(e){13==e.keyCode&&t.eventOK(e,n)})},detachEvents:function(){e("#gollum-dialog-action-ok").unbind("click"),e("#gollum-dialog-action-cancel").unbind("click")},createFieldMarkup:function(e){for(var n="
",i=0;i"}return n+="
"},createFieldText:function(e){var t="";return e.name&&(t+=""),t+=''),e.context&&(t+=''+e.context+""),t},createFieldFile:function(e){var t="",n=e.id||"upload",i=e.name||"file";return t+='
',t+='',t+="",e.context&&(t+=''+e.context+""),t},createMarkup:function(e,n){return t.markupCreated=!0,'

'+e+'

'+n+'
'},eventCancel:function(e){e.preventDefault(),n("Cancelled dialog."),t.hide()},eventOK:function(n,i){n.preventDefault();var r=[];e("#gollum-dialog-dialog-body input").each(function(){r[e(this).attr("name")]=e(this).val()}),i&&"function"==typeof i&&i(r),t.hide()},hide:function(){e.browser.msie?(e("#gollum-dialog-dialog").hide().removeClass("active"),e("select").css("visibility","visible")):(e("#gollum-dialog-dialog").animate({opacity:0},{duration:200,complete:function(){e("#gollum-dialog-dialog").removeClass("active"),e("#gollum-dialog-dialog").css("display","none")}}),e(window).unbind("resize",t.resize))},init:function(i){var r="",o="";if(!i||"object"!=typeof i)return void n("Editor Dialog: Cannot init; invalid init object");i.body&&"string"==typeof i.body&&(o="

"+i.body+"

"),i.fields&&"object"==typeof i.fields&&(o+=t.createFieldMarkup(i.fields)),i.title&&"string"==typeof i.title&&(r=i.title),t.markupCreated&&e("#gollum-dialog-dialog").remove(),t.markup=t.createMarkup(r,o),e("body").append(t.markup),i.OK&&"function"==typeof i.OK&&t.attachEvents(i.OK),t.show()},show:function(){t.markupCreated?(n("Showing dialog"),e.browser.msie?(e("#gollum-dialog.dialog").addClass("active"),t.position(),e("select").css("visibility","hidden")):(e("#gollum-dialog.dialog").css("display","none"),e("#gollum-dialog-dialog").animate({opacity:0},{duration:0,complete:function(){e("#gollum-dialog-dialog").css("display","block"),t.position(),e("#gollum-dialog-dialog").animate({opacity:1},{duration:500}),e(e('#gollum-dialog-dialog input[type="text"]').get(0)).focus()}})),e(window).bind("resize",t.resize)):n("Dialog: No markup to show. Please use init first.")},resize:function(){t.position()},position:function(){if("small-mobile"==t.currentAspect())e("#gollum-dialog-dialog-inner").css("height","100%").css("margin-top","auto");else if("large-mobile"==t.currentAspect())e("#gollum-dialog-dialog-inner").css("height","auto").css("margin-top","auto");else if("desktop"==t.currentAspect()){ +var n=e("#gollum-dialog-dialog-inner").height();e("#gollum-dialog-dialog-inner").css("height",n+"px").css("margin-top",-1*parseInt(n/2))}}},n=function(e){t.debugOn&&"undefined"!=typeof console&&console.log(e)};e.GollumDialog=t}(jQuery),function(e){var t={_PLACEHOLDERS:[],_p:function(t){this.fieldObject=t,this.placeholderText=t.val();var n=t.val();t.addClass("ph"),t.blur(function(){""==e(this).val()&&(e(this).val(n),e(this).addClass("ph"))}),t.focus(function(){e(this).removeClass("ph"),e(this).val()==n?e(this).val(""):e(this)[0].select()})},add:function(e){t._PLACEHOLDERS.push(new t._p(e))},clearAll:function(){for(var e=0;e div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e)),t.appendChild(n),a=!0}}var o=document.attachEvent,a=!1,s=e.fn.resize;if(e.fn.resize=function(e){return this.each(function(){this==window?s.call(jQuery(this),e):addResizeListener(this,e)})},e.fn.removeResize=function(e){return this.each(function(){removeResizeListener(this,e)})},!o){var l=function(){var e=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(e){return window.setTimeout(e,20)};return function(t){return e(t)}}(),u=function(){var e=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.clearTimeout;return function(t){return e(t)}}(),c=!1,d="",f="animationstart",p="Webkit Moz O ms".split(" "),h="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),g="",m=document.createElement("fakeelement");if(m.style.animationName!==undefined&&(c=!0),!1===c)for(var y=0;y
',e.appendChild(e.__resizeTriggers__),t(e),e.addEventListener("scroll",i,!0),f&&e.__resizeTriggers__.addEventListener(f,function(n){n.animationName==v&&t(e)})),e.__resizeListeners__.push(n))},window.removeResizeListener=function(e,t){o?e.detachEvent("onresize",t):(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),e.__resizeListeners__.length||(e.removeEventListener("scroll",i),e.__resizeTriggers__=!e.removeChild(e.__resizeTriggers__)))}}(jQuery); \ No newline at end of file diff --git a/lib/gollum/public/assets/app-3360f8faf2f9cd3020463278cdb5512b0109241647bbf55407e64ea11759572d.js.gz b/lib/gollum/public/assets/app-3360f8faf2f9cd3020463278cdb5512b0109241647bbf55407e64ea11759572d.js.gz new file mode 100644 index 00000000..b25b27ca Binary files /dev/null and b/lib/gollum/public/assets/app-3360f8faf2f9cd3020463278cdb5512b0109241647bbf55407e64ea11759572d.js.gz differ diff --git a/lib/gollum/public/gollum/javascript/gollum.js.erb b/lib/gollum/public/gollum/javascript/gollum.js.erb index 96722b90..f61b5d11 100755 --- a/lib/gollum/public/gollum/javascript/gollum.js.erb +++ b/lib/gollum/public/gollum/javascript/gollum.js.erb @@ -486,12 +486,13 @@ $(document).ready(function() { } numSelected = numSelected + 1; }); - if (numSelected == maxSelected) { - $('#version-form input:not(:checked)').prop('disabled', true); - $('.history button.action-compare-revision').prop('disabled', false); - } else if (numSelected < maxSelected) { - $('#version-form input').prop('disabled', false); + if (numSelected < 1) { $('.history button.action-compare-revision').prop('disabled', true); + } else if (numSelected < maxSelected) { + $('.history button.action-compare-revision').prop('disabled', false); + $('#version-form input').prop('disabled', false); + } else { + $('#version-form input:not(:checked)').prop('disabled', true); } }; diff --git a/test/test_app.rb b/test/test_app.rb index 077d5021..b10ee6e8 100644 --- a/test/test_app.rb +++ b/test/test_app.rb @@ -965,10 +965,15 @@ context 'Frontend with base path' do post '/wiki/gollum/compare/Bilbo-Baggins.md', :versions => ['f25eccd98e9b667f9e22946f3e2f945378b8a72d'] follow_redirect! assert last_response.ok? + assert_equal '/wiki/gollum/compare/Bilbo-Baggins.md/b0d108328459e44fff4a76cd19b10ddc34adce4b...f25eccd98e9b667f9e22946f3e2f945378b8a72d', last_request.fullpath + + post '/wiki/gollum/compare/Bilbo-Baggins.md', :versions => [] + follow_redirect! + assert last_response.ok? assert_equal '/wiki/gollum/history/Bilbo-Baggins.md', last_request.fullpath end def app Precious::MapGollum.new(@base_path) end -end \ No newline at end of file +end