Files
leanote/public/album/js/main.all.js

7 lines
155 KiB
JavaScript
Raw Normal View History

2015-10-30 14:41:01 +08:00
!function(e,t){"use strict";function n(e){var t=e.length,n=se.type(e);return se.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}function r(e){var t=Te[e]={};return se.each(e.match(le)||[],function(e,n){t[n]=!0}),t}function i(e,n,r,i){if(se.acceptData(e)){var o,a,s=se.expando,u="string"==typeof n,l=e.nodeType,c=l?se.cache:e,f=l?e[s]:e[s]&&s;if(f&&c[f]&&(i||c[f].data)||!u||r!==t)return f||(l?e[s]=f=K.pop()||se.guid++:f=s),c[f]||(c[f]={},l||(c[f].toJSON=se.noop)),("object"==typeof n||"function"==typeof n)&&(i?c[f]=se.extend(c[f],n):c[f].data=se.extend(c[f].data,n)),o=c[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[se.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[se.camelCase(n)])):a=o,a}}function o(e,t,n){if(se.acceptData(e)){var r,i,o,a=e.nodeType,u=a?se.cache:e,l=a?e[se.expando]:se.expando;if(u[l]){if(t&&(r=n?u[l]:u[l].data)){se.isArray(t)?t=t.concat(se.map(t,se.camelCase)):t in r?t=[t]:(t=se.camelCase(t),t=t in r?[t]:t.split(" "));for(i=0,o=t.length;o>i;i++)delete r[t[i]];if(!(n?s:se.isEmptyObject)(r))return}(n||(delete u[l].data,s(u[l])))&&(a?se.cleanData([e],!0):se.support.deleteExpando||u!=u.window?delete u[l]:u[l]=null)}}}function a(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(Ne,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:we.test(r)?se.parseJSON(r):r}catch(o){}se.data(e,n,r)}else r=t}return r}function s(e){var t;for(t in e)if(("data"!==t||!se.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function u(){return!0}function l(){return!1}function c(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function f(e,t,n){if(t=t||0,se.isFunction(t))return se.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return se.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=se.grep(e,function(e){return 1===e.nodeType});if(We.test(t))return se.filter(t,r,!n);t=se.filter(t,r)}return se.grep(e,function(e){return se.inArray(e,t)>=0===n})}function p(e){var t=ze.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function d(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function h(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function g(e){var t=nt.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function m(e,t){for(var n,r=0;null!=(n=e[r]);r++)se._data(n,"globalEval",!t||se._data(t[r],"globalEval"))}function y(e,t){if(1===t.nodeType&&se.hasData(e)){var n,r,i,o=se._data(e),a=se._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)se.event.add(t,n,s[n][r])}a.data&&(a.data=se.extend({},a.data))}}function v(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!se.support.noCloneEvent&&t[se.expando]){r=se._data(t);for(i in r.events)se.removeEvent(t,i,r.handle);t.removeAttribute(se.expando)}"script"===n&&t.text!==e.text?(h(t).text=e.text,g(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),se.support.html5Clone&&e.innerHTML&&!se.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Ze.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}function b(e,n){var r,i,o=0,a=e.getElementsByTagName!==t?e.getElementsByTagName(n||"*"):e.querySelectorAll!==t?e.querySelectorAll(n||"*"):t;if(!a)for(a=[],r=e.childNodes||e;null!=(i=r[o]);o++)!n||se.nodeName(i,n)?a.push(i):se.merge(a,b(i,n));return n===t||n&&se.nodeName(e,n)?se.merge([e],a):a}function x(e){Ze.test(e.type)&&(e.defaultChecked=e.checked)}function T(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=wt.length;i--;)if(t=wt[i]+n,t in e)return t;return r}function w(e,t){return e=t||e,"none"===se.css(e,"display")||!se.contains(e.ownerDocument,e)}function N(e,t){for(var n,r=[],i=0,o=e.length;o>i;i++)n=e[i],n.style&&(r[i]=s
},set:function(e,n,r){return se.nodeName(e,"input")?(e.defaultValue=n,t):Ce&&Ce.set(e,n,r)}}),He||(Ce=se.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&("id"===n||"name"===n||"coords"===n?""!==r.value:r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},se.attrHooks.contenteditable={get:Ce.get,set:function(e,t,n){Ce.set(e,""===t?!1:t,n)}},se.each(["width","height"],function(e,n){se.attrHooks[n]=se.extend(se.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})})),se.support.hrefNormalized||(se.each(["href","src","width","height"],function(e,n){se.attrHooks[n]=se.extend(se.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null==r?t:r}})}),se.each(["href","src"],function(e,t){se.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),se.support.style||(se.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),se.support.optSelected||(se.propHooks.selected=se.extend(se.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),se.support.enctype||(se.propFix.enctype="encoding"),se.support.checkOn||se.each(["radio","checkbox"],function(){se.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),se.each(["radio","checkbox"],function(){se.valHooks[this]=se.extend(se.valHooks[this],{set:function(e,n){return se.isArray(n)?e.checked=se.inArray(se(e).val(),n)>=0:t}})});var qe=/^(?:input|select|textarea)$/i,_e=/^key/,Fe=/^(?:mouse|contextmenu)|click/,Oe=/^(?:focusinfocus|focusoutblur)$/,Be=/^([^.]*)(?:\.(.+)|)$/;se.event={global:{},add:function(e,n,r,i,o){var a,s,u,l,c,f,p,d,h,g,m,y=3!==e.nodeType&&8!==e.nodeType&&se._data(e);if(y){for(r.handler&&(a=r,r=a.handler,o=a.selector),r.guid||(r.guid=se.guid++),(l=y.events)||(l=y.events={}),(s=y.handle)||(s=y.handle=function(e){return se===t||e&&se.event.triggered===e.type?t:se.event.dispatch.apply(s.elem,arguments)},s.elem=e),n=(n||"").match(le)||[""],c=n.length;c--;)u=Be.exec(n[c])||[],h=m=u[1],g=(u[2]||"").split(".").sort(),p=se.event.special[h]||{},h=(o?p.delegateType:p.bindType)||h,p=se.event.special[h]||{},f=se.extend({type:h,origType:m,data:i,handler:r,guid:r.guid,selector:o,needsContext:o&&se.expr.match.needsContext.test(o),namespace:g.join(".")},a),(d=l[h])||(d=l[h]=[],d.delegateCount=0,p.setup&&p.setup.call(e,i,g,s)!==!1||(e.addEventListener?e.addEventListener(h,s,!1):e.attachEvent&&e.attachEvent("on"+h,s))),p.add&&(p.add.call(e,f),f.handler.guid||(f.handler.guid=r.guid)),o?d.splice(d.delegateCount++,0,f):d.push(f),se.event.global[h]=!0;e=null}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,m=se.hasData(e)&&se._data(e);if(m&&(u=m.events)){for(t=(t||"").match(le)||[""],l=t.length;l--;)if(s=Be.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){for(f=se.event.special[d]||{},d=(r?f.delegateType:f.bindType)||d,p=u[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;o--;)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&f.teardown.call(e,h,m.handle)!==!1||se.removeEvent(e,d,m.handle),delete u[d])}else for(d in u)se.event.remove(e,d+t[l],n,r,!0);se.isEmptyObject(u)&&(delete m.handle,se._removeData(e,"events"))}},trigger:function(n,r,i,o){var a,s,u,l,c,f,p,d=[i||V],h=n.type||n,g=n.namespace?n.namespace.split("."):[];if(s=u=i=i||V,3!==i.nodeType&&8!==i.nodeType&&!Oe.test(h+se.event.triggered)&&(h.indexOf(".")>=0&&(g=h.split("."),h=g.shift(),g.sort()),c=0>h.indexOf(":")&&"on"+h,n=n[se.expando]?n:new se.Event(h,"object"==typeof n&&n),n.isTrigger=!0,n.namespace=g.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:se.makeArray(r,[n]
return c(e,"previousSibling")},nextAll:function(e){return se.dir(e,"nextSibling")},prevAll:function(e){return se.dir(e,"previousSibling")},nextUntil:function(e,t,n){return se.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return se.dir(e,"previousSibling",n)},siblings:function(e){return se.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return se.sibling(e.firstChild)},contents:function(e){return se.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:se.merge([],e.childNodes)}},function(e,t){se.fn[e]=function(n,r){var i=se.map(this,t,n);return Pe.test(e)||(r=n),r&&"string"==typeof r&&(i=se.filter(r,i)),i=this.length>1&&!Ie[e]?se.unique(i):i,this.length>1&&Re.test(e)&&(i=i.reverse()),this.pushStack(i)}}),se.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?se.find.matchesSelector(t[0],e)?[t[0]]:[]:se.find.matches(e,t)},dir:function(e,n,r){for(var i=[],o=e[n];o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!se(o).is(r));)1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});var ze="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",Xe=/ jQuery\d+="(?:null|\d+)"/g,Ue=RegExp("<(?:"+ze+")[\\s/>]","i"),Ve=/^\s+/,Ye=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Je=/<([\w:]+)/,Ge=/<tbody/i,Qe=/<|&#?\w+;/,Ke=/<(?:script|style|link)/i,Ze=/^(?:checkbox|radio)$/i,et=/checked\s*(?:[^=]|=\s*.checked.)/i,tt=/^$|\/(?:java|ecma)script/i,nt=/^true\/(.*)/,rt=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,it={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:se.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},ot=p(V),at=ot.appendChild(V.createElement("div"));it.optgroup=it.option,it.tbody=it.tfoot=it.colgroup=it.caption=it.thead,it.th=it.td,se.fn.extend({text:function(e){return se.access(this,function(e){return e===t?se.text(this):this.empty().append((this[0]&&this[0].ownerDocument||V).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(se.isFunction(e))return this.each(function(t){se(this).wrapAll(e.call(this,t))});if(this[0]){var t=se(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 se.isFunction(e)?this.each(function(t){se(this).wrapInner(e.call(this,t))}):this.each(function(){var t=se(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=se.isFunction(e);return this.each(function(n){se(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){se.nodeName(this,"body")||se(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var n,r=0;null!=(n=this[r]);r++)(!e||se.filter(e,[n]).length>0)&&(t||1!==n.nodeType||se.cleanData(b(n)),n.parentNode&&(t&&se.contains(n.ownerDocument,n)&&m(b(n,"script")),n.parentNode.removeChild(n)));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&se.cleanData(b(e,!1));e.firstChild;)e.
if("undefined"==typeof jQuery)throw new Error("Bootstrap requires jQuery");+function(t){"use strict";function e(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(void 0!==t.style[i])return{end:e[i]}}t.fn.emulateTransitionEnd=function(e){var i=!1,o=this;t(this).one(t.support.transition.end,function(){i=!0});var n=function(){i||t(o).trigger(t.support.transition.end)};return setTimeout(n,e),this},t(function(){t.support.transition=e()})}(jQuery),+function(t){"use strict";var e='[data-dismiss="alert"]',i=function(i){t(i).on("click",e,this.close)};i.prototype.close=function(e){function i(){s.trigger("closed.bs.alert").remove()}var o=t(this),n=o.attr("data-target");n||(n=o.attr("href"),n=n&&n.replace(/.*(?=#[^\s]*$)/,""));var s=t(n);e&&e.preventDefault(),s.length||(s=o.hasClass("alert")?o:o.parent()),s.trigger(e=t.Event("close.bs.alert")),e.isDefaultPrevented()||(s.removeClass("in"),t.support.transition&&s.hasClass("fade")?s.one(t.support.transition.end,i).emulateTransitionEnd(150):i())};var o=t.fn.alert;t.fn.alert=function(e){return this.each(function(){var o=t(this),n=o.data("bs.alert");n||o.data("bs.alert",n=new i(this)),"string"==typeof e&&n[e].call(o)})},t.fn.alert.Constructor=i,t.fn.alert.noConflict=function(){return t.fn.alert=o,this},t(document).on("click.bs.alert.data-api",e,i.prototype.close)}(jQuery),+function(t){"use strict";var e=function(i,o){this.$element=t(i),this.options=t.extend({},e.DEFAULTS,o)};e.DEFAULTS={loadingText:"loading..."},e.prototype.setState=function(t){var e="disabled",i=this.$element,o=i.is("input")?"val":"html",n=i.data();t+="Text",n.resetText||i.data("resetText",i[o]()),i[o](n[t]||this.options[t]),setTimeout(function(){"loadingText"==t?i.addClass(e).attr(e,e):i.removeClass(e).removeAttr(e)},0)},e.prototype.toggle=function(){var t=this.$element.closest('[data-toggle="buttons"]');if(t.length){var e=this.$element.find("input").prop("checked",!this.$element.hasClass("active")).trigger("change");"radio"===e.prop("type")&&t.find(".active").removeClass("active")}this.$element.toggleClass("active")};var i=t.fn.button;t.fn.button=function(i){return this.each(function(){var o=t(this),n=o.data("bs.button"),s="object"==typeof i&&i;n||o.data("bs.button",n=new e(this,s)),"toggle"==i?n.toggle():i&&n.setState(i)})},t.fn.button.Constructor=e,t.fn.button.noConflict=function(){return t.fn.button=i,this},t(document).on("click.bs.button.data-api","[data-toggle^=button]",function(e){var i=t(e.target);i.hasClass("btn")||(i=i.closest(".btn")),i.button("toggle"),e.preventDefault()})}(jQuery),+function(t){"use strict";var e=function(e,i){this.$element=t(e),this.$indicators=this.$element.find(".carousel-indicators"),this.options=i,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",t.proxy(this.pause,this)).on("mouseleave",t.proxy(this.cycle,this))};e.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},e.prototype.cycle=function(e){return e||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(t.proxy(this.next,this),this.options.interval)),this},e.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},e.prototype.to=function(e){var i=this,o=this.getActiveIndex();return e>this.$items.length-1||0>e?void 0:this.sliding?this.$element.one("slid",function(){i.to(e)}):o==e?this.pause().cycle():this.slide(e>o?"next":"prev",t(this.$items[e]))},e.prototype.pause=function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&t.support.transition.end&&(this.$element.trigger(t.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},e.prototype.next=function(){return this.sliding?void 0:this.slide("next")},e.prototype.prev=function(){return this.sliding?void 0:this.slide("prev
2015-11-22 23:26:59 +08:00
!function(e){"use strict";e(window.jQuery)}(function(e){"use strict";var t=0;e.ajaxTransport("iframe",function(i){if(i.async){var n,r,o;return{send:function(s,a){n=e('<form style="display:none;"></form>'),n.attr("accept-charset",i.formAcceptCharset),o=/\?/.test(i.url)?"&":"?","DELETE"===i.type?(i.url=i.url+o+"_method=DELETE",i.type="POST"):"PUT"===i.type?(i.url=i.url+o+"_method=PUT",i.type="POST"):"PATCH"===i.type&&(i.url=i.url+o+"_method=PATCH",i.type="POST"),r=e('<iframe src="javascript:false;" name="iframe-transport-'+(t+=1)+'"></iframe>').bind("load",function(){var t,o=e.isArray(i.paramName)?i.paramName:[i.paramName];r.unbind("load").bind("load",function(){var t;try{if(t=r.contents(),!t.length||!t[0].firstChild)throw new Error}catch(i){t=void 0}a(200,"success",{iframe:t}),e('<iframe src="javascript:false;"></iframe>').appendTo(n),n.remove()}),n.prop("target",r.prop("name")).prop("action",i.url).prop("method",i.type),i.formData&&e.each(i.formData,function(t,i){e('<input type="hidden"/>').prop("name",i.name).val(i.value).appendTo(n)}),i.fileInput&&i.fileInput.length&&"POST"===i.type&&(t=i.fileInput.clone(),i.fileInput.after(function(e){return t[e]}),i.paramName&&i.fileInput.each(function(t){e(this).prop("name",o[t]||i.paramName)}),n.append(i.fileInput).prop("enctype","multipart/form-data").prop("encoding","multipart/form-data")),n.submit(),t&&t.length&&i.fileInput.each(function(i,n){var r=e(t[i]);e(n).prop("name",r.prop("name")),r.replaceWith(n)})}),n.append(r).appendTo(document.body)},abort:function(){r&&r.unbind("load").prop("src","javascript".concat(":false;")),n&&n.remove()}}}}),e.ajaxSetup({converters:{"iframe text":function(t){return t&&e(t[0].body).text()},"iframe json":function(t){return t&&e.parseJSON(e(t[0].body).text())},"iframe html":function(t){return t&&e(t[0].body).html()},"iframe script":function(t){return t&&e.globalEval(e(t[0].body).text())}}})}),!function(e){e(jQuery)}(function(e,t){var i=0,n=Array.prototype.slice,r=e.cleanData;e.cleanData=function(t){for(var i,n=0;null!=(i=t[n]);n++)try{e(i).triggerHandler("remove")}catch(o){}r(t)},e.widget=function(t,i,n){var r,o,s,a,l={},p=t.split(".")[0];t=t.split(".")[1],r=p+"-"+t,n||(n=i,i=e.Widget),e.expr[":"][r.toLowerCase()]=function(t){return!!e.data(t,r)},e[p]=e[p]||{},o=e[p][t],s=e[p][t]=function(e,t){return this._createWidget?void(arguments.length&&this._createWidget(e,t)):new s(e,t)},e.extend(s,o,{version:n.version,_proto:e.extend({},n),_childConstructors:[]}),a=new i,a.options=e.widget.extend({},a.options),e.each(n,function(t,n){return e.isFunction(n)?void(l[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},r=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,o=this._superApply;return this._super=e,this._superApply=r,t=n.apply(this,arguments),this._super=i,this._superApply=o,t}}()):void(l[t]=n)}),s.prototype=e.widget.extend(a,{widgetEventPrefix:o?a.widgetEventPrefix:t},l,{constructor:s,namespace:p,widgetName:t,widgetFullName:r}),o?(e.each(o._childConstructors,function(t,i){var n=i.prototype;e.widget(n.namespace+"."+n.widgetName,s,i._proto)}),delete o._childConstructors):i._childConstructors.push(s),e.widget.bridge(t,s)},e.widget.extend=function(i){for(var r,o,s=n.call(arguments,1),a=0,l=s.length;l>a;a++)for(r in s[a])o=s[a][r],s[a].hasOwnProperty(r)&&o!==t&&(e.isPlainObject(o)?i[r]=e.isPlainObject(i[r])?e.widget.extend({},i[r],o):e.widget.extend({},o):i[r]=o);return i},e.widget.bridge=function(i,r){var o=r.prototype.widgetFullName||i;e.fn[i]=function(s){var a="string"==typeof s,l=n.call(arguments,1),p=this;return s=!a&&l.length?e.widget.extend.apply(null,[s].concat(l)):s,a?this.each(function(){var n,r=e.data(this,o);return r?e.isFunction(r[s])&&"_"!==s.charAt(0)?(n=r[s].apply(r,l),n!==r&&n!==t?(p=n&&n.jquery?p.pushStack(n.get()):n,!1):void 0):e.error("no such method '"+s+"' for "+i+" widget instance"):e.error("cannot call methods on "+i+" prior to initialization; attempted to call method '"+s+"'")}):this.each(function(){var t=e.data(this,o);t?t.option(s||{})._init():e.data(this,o,new r(s,th
2015-10-14 18:47:01 +08:00
jQuery.fn.pagination=function(e,t){return t=jQuery.extend({items_per_page:10,num_display_entries:10,current_page:0,num_edge_entries:2,link_to:"#",prev_text:"Prev",next_text:"Next",ellipse_text:"...",prev_show_always:!0,next_show_always:!0,callback:function(){return!1}},t||{}),this.each(function(){function n(){return Math.ceil(e/t.items_per_page)}function a(){var e=Math.ceil(t.num_display_entries/2),a=n(),r=a-t.num_display_entries,s=i>e?Math.max(Math.min(i-e,r),0):0,_=i>e?Math.min(i+e,a):Math.min(t.num_display_entries,a);return[s,_]}function r(e,n){n.preventDefault(),i=e,s();var a=t.callback(e,_);return a||(n.stopPropagation?n.stopPropagation():n.cancelBubble=!0),a}function s(){_.empty();var e=a(),s=n(),p=function(e){return function(t){return r(e,t)}},l=function(e,n){e=0>e?0:s>e?e:s-1,n=jQuery.extend({text:e+1,classes:""},n||{});var a="";if(e==i){var r=jQuery("<span class='current'>"+n.text+"</span>");n.text!=t.prev_text&&n.text!=t.next_text&&(a='class="active"')}else var r=jQuery("<a>"+n.text+"</a>").bind("click",p(e)).attr("href",t.link_to.replace(/__id__/,e));n.classes&&r.addClass(n.classes);var l=$("<li "+a+"></li>").append(r);_.append(l)};if(t.prev_text&&(i>0||t.prev_show_always)&&l(i-1,{text:t.prev_text,classes:"prev"}),e[0]>0&&t.num_edge_entries>0){for(var u=Math.min(t.num_edge_entries,e[0]),c=0;u>c;c++)l(c);t.num_edge_entries<e[0]&&t.ellipse_text&&jQuery("<li><span>"+t.ellipse_text+"</span></li>").appendTo(_)}for(var c=e[0];c<e[1];c++)l(c);if(e[1]<s&&t.num_edge_entries>0){s-t.num_edge_entries>e[1]&&t.ellipse_text&&jQuery("<li><span>"+t.ellipse_text+"</span></li>").appendTo(_);for(var x=Math.max(s-t.num_edge_entries,e[1]),c=x;s>c;c++)l(c)}t.next_text&&(s-1>i||t.next_show_always)&&l(i+1,{text:t.next_text,classes:"next"})}var i=t.current_page;e=!e||0>e?1:e,t.items_per_page=!t.items_per_page||t.items_per_page<0?1:t.items_per_page;var _=jQuery(this);this.selectPage=function(e){r(e)},this.prevPage=function(){return i>0?(r(i-1),!0):!1},this.nextPage=function(){return i<n()-1?(r(i+1),!0):!1},s()})};
2015-10-30 14:41:01 +08:00
function log(e){}function retIsOk(e){return e&&"object"==typeof e&&1==e.Ok?!0:!1}function getImageSize(e,t){function a(e,a){i.parentNode.removeChild(i),t({width:e,height:a})}var i=document.createElement("img");i.onload=function(){a(i.clientWidth,i.clientHeight)},i.onerror=function(){a()},i.src=e;var s=i.style;s.visibility="hidden",s.position="fixed",s.bottom=s.left=0,s.width=s.height="auto",document.body.appendChild(i)}function mdGetImgSrc(){return o.selectedImages&&o.selectedImages.length?o.selectedImages[0]:""}var urlPrefix=UrlPrefix,getMsg=parent.getMsg;getMsg||(getMsg=function(e){return e});var o={maxSelected:G.maxSelected,selectedZoneO:$("#preview"),previewO:$("#preview"),selectedImages:[],imageAttrs:{},pageNum:1,pagination:function(e){var t=this;$(".pagination").pagination(e,{items_per_page:G.perPageItems,prev_text:getMsg("Prev"),next_text:getMsg("Next"),callback:function(e){t.pageNum=e+1,t.renderImages($("#albumsForList").val(),t.pageNum,!1)}})},showMsg:function(e){$("#msg").html(e).css("display","inline"),setTimeout(function(){$("#msg").fadeOut()},2e3)},pageAddAlbum:function(e){var t='<option value="'+e.AlbumId+'">'+e.Name+"</option>";$("#albumsForUpload").append(t).val(e.AlbumId),$("#albumsForList").append(t)},pageUpdateAlbum:function(e,t){$('option[value="'+e+'"]').html(t)},processAlbum:function(){function e(){$("#addOrUpdateAlbumForm").is(":hidden")?($("#addOrUpdateAlbumForm").show(),$("#albumSelect").hide()):($("#addOrUpdateAlbumForm").hide(),$("#albumSelect").show())}var t=this,a=!0,i="";$("#renameAlbumBtn").click(function(){return(i=$("#albumsForUpload").val())?(e(),$("#addOrUpdateAlbumBtn").html(getMsg("Rename Album")),$("#albumName").val($("#albumsForUpload option:selected").html()).focus(),void(a=!1)):void alert(getMsg("Cannot rename default album"))}),$("#addAlbumBtn").click(function(){e(),$("#addOrUpdateAlbumBtn").html(getMsg("Add Album")),$("#albumName").val("").focus(),a=!0}),$("#cancelAlbumBtn").click(function(){e()}),$("#addOrUpdateAlbumBtn").click(function(){var s=$("#albumName").val();return s?void(a?$.get("/album/addAlbum",{name:s},function(a){"object"==typeof a&&""!=a.AlbumId?($("#albumName").val(""),t.showMsg(getMsg("Add Success!")),t.pageAddAlbum(a),setTimeout(function(){e()},200)):alert(getMsg("error"))}):$.get("/album/updateAlbum",{albumId:i,name:s},function(a){"boolean"==typeof a&&a?($("#albumName").val(""),t.showMsg(getMsg("Rename Success!")),t.pageUpdateAlbum(i,s),setTimeout(function(){e()},200)):alert(getMsg("error!"))})):void $("#albumName").focus()}),$("#deleteAlbumBtn").click(function(){var e=$("#albumsForUpload").val();return e?void $.get("/album/deleteAlbum",{albumId:e},function(a){"object"==typeof a&&1==a.Ok?(t.showMsg(getMsg("Delete Success!")),$("#albumsForUpload option[value='"+e+"']").remove(),$("#albumsForList").val()==e&&(t.needRefresh=!0),$("#albumsForList option[value='"+e+"']").remove()):alert(getMsg("This album has images, please delete it's images at first."))}):void alert(getMsg("Cannot delete default album"))})},renderAlbums:function(){var e=this;$.get("/album/getAlbums",function(t){if(t){var a="";for(var i in t){var s=t[i],r='<option value="'+s.AlbumId+'">'+s.Name+"</option>";a+=r}$("#albumsForUpload").append(a),$("#albumsForList").append(a);var l=$("#albumsForList").val();e.renderImages(l,1,!0)}})},imageMaskO:$("#imageMask"),noImagesO:$("#noImages"),loadingO:$("#loading"),loadingStart:function(){this.imageMaskO.is(":hidden")&&this.imageMaskO.css("opacity",.8).show(),this.noImagesO.hide(),this.loadingO.show()},loadingEnd:function(){this.imageMaskO.hide()},noImages:function(){this.imageMaskO.show().css("opacity",1),this.noImagesO.show(),this.loadingO.hide()},search:function(){var e=this,t=1;$("#key").on("keyup",function(){var a=++t,i=$(this).val(),s=$("#albumsForList").val();e.renderImages(s,1,!0,i,function(){return t==a})})},renderImages:function(e,t,a,i,s){var r=this;t||(t=1),r.loadingStart(),$.get("/file/getImages",{albumId:e,page:t,key:i},function(e){if(!e||!e.Count)return void r.noImages();r.loadingEnd();var t=e.List,i={};for(var s in r.selectedImages){var l=r.s