Files
deployd/dashboard/js/lib/jquery.plugins.js
2012-03-30 13:11:55 -07:00

9 lines
2.5 KiB
JavaScript

/*!
* jQuery Cookie Plugin
* https://github.com/carhartl/jquery-cookie
*
* Copyright 2011, Klaus Hartl
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://www.opensource.org/licenses/mit-license.php
* http://www.opensource.org/licenses/GPL-2.0
*/(function(a){a.cookie=function(b,c,d){if(arguments.length>1&&(!/Object/.test(Object.prototype.toString.call(c))||c===null||c===undefined)){d=a.extend({},d);if(c===null||c===undefined)d.expires=-1;if(typeof d.expires=="number"){var e=d.expires,f=d.expires=new Date;f.setDate(f.getDate()+e)}return c=String(c),document.cookie=[encodeURIComponent(b),"=",d.raw?c:encodeURIComponent(c),d.expires?"; expires="+d.expires.toUTCString():"",d.path?"; path="+d.path:"",d.domain?"; domain="+d.domain:"",d.secure?"; secure":""].join("")}d=c||{};var g=d.raw?function(a){return a}:decodeURIComponent,h=document.cookie.split("; ");for(var i=0,j;j=h[i]&&h[i].split("=");i++)if(g(j[0])===b)return g(j[1]||"");return null}})(jQuery),function(a){var b=function(a){return parseInt(a,10)||0};a.each(["min","max"],function(c,d){a.fn[d+"Size"]=function(a){var c,e;return a?(a.width!==undefined&&this.css(d+"-width",a.width),a.height!==undefined&&this.css(d+"-height",a.height),this):(c=this.css(d+"-width"),e=this.css(d+"-height"),{width:d==="max"&&(c===undefined||c==="none"||b(c)===-1)&&Number.MAX_VALUE||b(c),height:d==="max"&&(e===undefined||e==="none"||b(e)===-1)&&Number.MAX_VALUE||b(e)})}}),a.fn.isVisible=function(){return this.is(":visible")},a.each(["border","margin","padding"],function(c,d){a.fn[d]=function(a){return a?(a.top!==undefined&&this.css(d+"-top"+(d==="border"?"-width":""),a.top),a.bottom!==undefined&&this.css(d+"-bottom"+(d==="border"?"-width":""),a.bottom),a.left!==undefined&&this.css(d+"-left"+(d==="border"?"-width":""),a.left),a.right!==undefined&&this.css(d+"-right"+(d==="border"?"-width":""),a.right),this):{top:b(this.css(d+"-top"+(d==="border"?"-width":""))),bottom:b(this.css(d+"-bottom"+(d==="border"?"-width":""))),left:b(this.css(d+"-left"+(d==="border"?"-width":""))),right:b(this.css(d+"-right"+(d==="border"?"-width":"")))}}})}(jQuery),function(a){if(a){var b=a.fn.outerWidth,c=a.fn.outerHeight,d=function(a,b){var c=this.border(),d=this.padding(),e;return a?(e=b-c.top-d.top-d.bottom-c.bottom,this.height(e)):(e=b-c.left-d.left-d.right-c.right,this.width(e))};a.fn.extend({outerWidth:function(a){return typeof a!="undefined"&&a===a*1?d.apply(this,[!1,a]):b.apply(this,arguments)},outerHeight:function(a){return typeof a!="undefined"&&a===a*1?d.apply(this,[!0,a]):c.apply(this,arguments)}})}}(jQuery);