From 6d0648222e9d47e0aac77b77ed5b6ee39e87108c Mon Sep 17 00:00:00 2001 From: Kriti Godey Date: Mon, 26 Jul 2010 01:02:47 +0530 Subject: [PATCH] moved media to media folder in app --- media/calendar.gif | Bin 0 -> 1683 bytes media/date.js | 502 +++++++++++++++ media/datePicker.css | 136 ++++ media/jquery-1.4.2.min.js | 154 +++++ media/jquery.datePicker.js | 1201 ++++++++++++++++++++++++++++++++++++ media/jquery.tokeninput.js | 594 ++++++++++++++++++ media/style.css | 232 +++++++ media/token-input.css | 113 ++++ 8 files changed, 2932 insertions(+) create mode 100644 media/calendar.gif create mode 100644 media/date.js create mode 100644 media/datePicker.css create mode 100644 media/jquery-1.4.2.min.js create mode 100644 media/jquery.datePicker.js create mode 100755 media/jquery.tokeninput.js create mode 100644 media/style.css create mode 100755 media/token-input.css diff --git a/media/calendar.gif b/media/calendar.gif new file mode 100644 index 0000000000000000000000000000000000000000..0f57ec6a8c6c718963e39fab6ee4e6d913b6c380 GIT binary patch literal 1683 zcmcK32Uip30><$-5-3wE)K#Jl0U?A@kT6=cCn7^u4^?gng7+pN+^SfDhz!Hf5Gr8^ z2(l_eMw9{(NkCZ=b^-~6Fv3O{73=Tx#6e97Ehj_>%Ja|NaJR~SlydhCUNHh^d`y7fSBB;NqN8LOd zbyGL?wo0t8D)qMhV_%)P-;c!m9Zm2%8cRCy#Q#{L%-!R0{(4CPCzAtCJ-Mf!9HgBR z^j&H&{Aq~E(-6~Vp*m>~bW_RSr;shv!;l$Y=x2nZGQ&~n;pp^m^UMf?j0lsgNTaMs z*X?kdY1p`m7SfPlas^D`;D1*tMY{pEB`htpHx|Jr>e;B zUC|vnonHNtRP)lm`c+_YadFLGJ#$U0q#$ef|6Q?|BVr4Gj%^b_ScxZftC9YHI3k&S`FL zZfR-hY0YhIZ56iVx3#qi+Y8&<+c_K#m&@(w=;-Y1!GBPqcIyyEsHa5zWlZNM=Q|v$KnH!;AAH^Yim!v3Ox&K_ZcSTAW;5TwGdOT3%jWU7nRL z&#bJheERfhb#--pRVs;yt%o#wY9aqy}h%uv%9;yx4W~qx4XBu zx4*xCaBv_yy)Canl*h6%07L-6J*5AzQa%7jqYHt8Vy{ zD;E0#+Ucf(s`>vI>erHfLu}4*w0<-<;lz)HtZ>a>W3Otz<>4{|Tcb-USK<}V7+RS; zZGNnxXT9aOs*?xmF3EDq; ztC3=>vT7t|C41A4oc_TIYhxMOq^agT?zplov^}AuPIs-~Mry_2@)Y3@arQ7@33#k& z7ACm#v+sSuBTHEM1Yf}&S>Sx^+ncy(OKT#IAdjSPwrPZfBvZc9c7{WuBVFJHP<5NH zA<(Zce4I)=Y$aePseDt+PQHRl0`f{a7;hgJI~qIH4dKs*C=hR9AYR8Y>~uNmDLNo3 zuS{c#^8z~b3zN=uAoHn*l##h%lMZ^%{qvP{)38^$I!~eBa3d!>-Wj`|4>*r%|N<5qDOxpQ2{DKNh0BP&yXatY$fc zyT>;laJ#H#o@l3`R`d*UE#9OEj_x!s?-EOx0=tETGLe^ClHmYRql7i;IO1Y4z@fMr z_T3y=tnQ9*axsj(8pW@g%O6p*=wnj^2EBEfq&n%((vEuJT}4g2%2&7OJH`L}g-8K`QVi7GXwSXYz$`nTcWT8#g-mWcQk{184|ty=nl~U`>vgr?W0}M|3u#E&nHER0KCdXg2=~}% zV{ni-rHn`k3y4Lfz*9R+`8LgSqk*CuZwsm}5UyO)&Q5JoHq3_GIGXa%Q@n{7J%-gJ zUv)}Ji;5(0ktLh}6{O-N#@5X9;PEZ3XdMJiub{BP(fU>)V_RJMc4=FDQXaJ this.getDate()) + this.addDays(-this.getDate()); + + return this; + }); + + /** + * Add a number of days to the date object. + * + * @example var dtm = new Date("01/12/2008"); + * dtm.addDays(1); + * dtm.toString(); + * @result 'Sun Jan 13 2008 00:00:00' + * + * @name addDays + * @type Date + * @cat Plugins/Methods/Date + */ + add("addDays", function(num) { + //this.setDate(this.getDate() + num); + this.setTime(this.getTime() + (num*86400000) ); + return this; + }); + + /** + * Add a number of hours to the date object. + * + * @example var dtm = new Date("01/12/2008"); + * dtm.addHours(24); + * dtm.toString(); + * @result 'Sun Jan 13 2008 00:00:00' + * + * @name addHours + * @type Date + * @cat Plugins/Methods/Date + */ + add("addHours", function(num) { + this.setHours(this.getHours() + num); + return this; + }); + + /** + * Add a number of minutes to the date object. + * + * @example var dtm = new Date("01/12/2008"); + * dtm.addMinutes(60); + * dtm.toString(); + * @result 'Sat Jan 12 2008 01:00:00' + * + * @name addMinutes + * @type Date + * @cat Plugins/Methods/Date + */ + add("addMinutes", function(num) { + this.setMinutes(this.getMinutes() + num); + return this; + }); + + /** + * Add a number of seconds to the date object. + * + * @example var dtm = new Date("01/12/2008"); + * dtm.addSeconds(60); + * dtm.toString(); + * @result 'Sat Jan 12 2008 00:01:00' + * + * @name addSeconds + * @type Date + * @cat Plugins/Methods/Date + */ + add("addSeconds", function(num) { + this.setSeconds(this.getSeconds() + num); + return this; + }); + + /** + * Sets the time component of this Date to zero for cleaner, easier comparison of dates where time is not relevant. + * + * @example var dtm = new Date(); + * dtm.zeroTime(); + * dtm.toString(); + * @result 'Sat Jan 12 2008 00:01:00' + * + * @name zeroTime + * @type Date + * @cat Plugins/Methods/Date + * @author Kelvin Luck + */ + add("zeroTime", function() { + this.setMilliseconds(0); + this.setSeconds(0); + this.setMinutes(0); + this.setHours(0); + return this; + }); + + /** + * Returns a string representation of the date object according to Date.format. + * (Date.toString may be used in other places so I purposefully didn't overwrite it) + * + * @example var dtm = new Date("01/12/2008"); + * dtm.asString(); + * @result '12/01/2008' // (where Date.format == 'dd/mm/yyyy' + * + * @name asString + * @type Date + * @cat Plugins/Methods/Date + * @author Kelvin Luck + */ + add("asString", function(format) { + var r = format || Date.format; + return r + .split('yyyy').join(this.getFullYear()) + .split('yy').join((this.getFullYear() + '').substring(2)) + .split('mmmm').join(this.getMonthName(false)) + .split('mmm').join(this.getMonthName(true)) + .split('mm').join(_zeroPad(this.getMonth()+1)) + .split('dd').join(_zeroPad(this.getDate())) + .split('hh').join(_zeroPad(this.getHours())) + .split('min').join(_zeroPad(this.getMinutes())) + .split('ss').join(_zeroPad(this.getSeconds())); + }); + + /** + * Returns a new date object created from the passed String according to Date.format or false if the attempt to do this results in an invalid date object + * (We can't simple use Date.parse as it's not aware of locale and I chose not to overwrite it incase it's functionality is being relied on elsewhere) + * + * @example var dtm = Date.fromString("12/01/2008"); + * dtm.toString(); + * @result 'Sat Jan 12 2008 00:00:00' // (where Date.format == 'dd/mm/yyyy' + * + * @name fromString + * @type Date + * @cat Plugins/Methods/Date + * @author Kelvin Luck + */ + Date.fromString = function(s, format) + { + var f = format || Date.format; + var d = new Date('01/01/1977'); + + var mLength = 0; + + var iM = f.indexOf('mmmm'); + if (iM > -1) { + for (var i=0; i -1) { + var mStr = s.substr(iM, 3); + for (var i=0; i -1) { + if (iM < iY) + { + iY += mLength; + } + d.setFullYear(Number(s.substr(iY, 4))); + } else { + if (iM < iY) + { + iY += mLength; + } + // TODO - this doesn't work very well - are there any rules for what is meant by a two digit year? + d.setFullYear(Number(Date.fullYearStart + s.substr(f.indexOf('yy'), 2))); + } + var iD = f.indexOf('dd'); + if (iM < iD) + { + iD += mLength; + } + d.setDate(Number(s.substr(iD, 2))); + if (isNaN(d.getTime())) { + return false; + } + return d; + }; + + // utility method + var _zeroPad = function(num) { + var s = '0'+num; + return s.substring(s.length-2) + //return ('0'+num).substring(-2); // doesn't work on IE :( + }; + +})(); \ No newline at end of file diff --git a/media/datePicker.css b/media/datePicker.css new file mode 100644 index 0000000..fcc574a --- /dev/null +++ b/media/datePicker.css @@ -0,0 +1,136 @@ +table.jCalendar { + border: 1px solid #000; + background: #532029; + border-collapse: separate; + border-spacing: 2px; +} +table.jCalendar th { + background: #C9C79E; + color: #000; + font-weight: bold; + padding: 3px 5px; +} + +table.jCalendar td { + background: #FBFEF3; + color: #000; + padding: 3px 5px; + text-align: center; +} +table.jCalendar td.other-month { + background: #CDA464; + color: #eee; +} +table.jCalendar td.today { + background: #CDA464; + color: #fff; +} +table.jCalendar td.selected { + background: #532029; + color: #fff; +} +table.jCalendar td.selected.dp-hover { + background: #CDA464; + color: #000; +} +table.jCalendar td.dp-hover, +table.jCalendar tr.activeWeekHover td { + background: #C9C79E; + color: #000; +} +table.jCalendar tr.selectedWeek td { + background: #f66; + color: #fff; +} +table.jCalendar td.disabled, table.jCalendar td.disabled.dp-hover { + background: #bbb; + color: #888; +} +table.jCalendar td.unselectable, +table.jCalendar td.unselectable:hover, +table.jCalendar td.unselectable.dp-hover { + background: #bbb; + color: #888; +} + +/* For the popup */ + +/* NOTE - you will probably want to style a.dp-choose-date - see how I did it in demo.css */ + +a.dp-choose-date { + padding-top: 5px; + display: block; + overflow: hidden; + font-size: 12px; +} + + +div.dp-popup { + position: relative; + background: #CDA464; + border-top: 2px solid #532029; + font-size: 10px; + font-family: 'Adobe Caslon Pro', Georgia, sans-serif; + padding: 2px; + width: 180px; + line-height: 1.2em; +} +div#dp-popup { + position: absolute; + z-index: 199; +} +div.dp-popup h2 { + font-size: 11px; + text-align: center; + margin: 2px 0; + padding: 0; +} +a#dp-close { + font-size: 11px; + padding: 4px 0; + text-align: center; + display: block; +} +a#dp-close:hover { + text-decoration: underline; +} +div.dp-popup a { + color: #000; + text-decoration: none; + padding: 3px 2px 0; +} +div.dp-popup div.dp-nav-prev { + position: absolute; + top: 2px; + left: 4px; + width: 100px; +} +div.dp-popup div.dp-nav-prev a { + float: left; +} +/* Opera needs the rules to be this specific otherwise it doesn't change the cursor back to pointer after you have disabled and re-enabled a link */ +div.dp-popup div.dp-nav-prev a, div.dp-popup div.dp-nav-next a { + cursor: pointer; +} +div.dp-popup div.dp-nav-prev a.disabled, div.dp-popup div.dp-nav-next a.disabled { + cursor: default; +} +div.dp-popup div.dp-nav-next { + position: absolute; + top: 2px; + right: 4px; + width: 100px; +} +div.dp-popup div.dp-nav-next a { + float: right; +} +div.dp-popup a.disabled { + cursor: default; + color: #aaa; +} +div.dp-popup td { + cursor: pointer; +} +div.dp-popup td.disabled { + cursor: default; +} \ No newline at end of file diff --git a/media/jquery-1.4.2.min.js b/media/jquery-1.4.2.min.js new file mode 100644 index 0000000..7c24308 --- /dev/null +++ b/media/jquery-1.4.2.min.js @@ -0,0 +1,154 @@ +/*! + * jQuery JavaScript Library v1.4.2 + * http://jquery.com/ + * + * Copyright 2010, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2010, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Sat Feb 13 22:33:48 2010 -0500 + */ +(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/, +Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&& +(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this, +a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b=== +"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this, +function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b
a"; +var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected, +parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent= +false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n= +s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true, +applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando]; +else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this, +a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b=== +w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i, +cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected= +c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed"); +a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g, +function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split("."); +k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a), +C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B=0){a.type= +e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&& +f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive; +if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data", +e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a, +"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a, +d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, +e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift(); +t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D|| +g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()}, +CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m, +g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)}, +text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}}, +setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return hl[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h= +h[3];l=0;for(m=h.length;l=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m=== +"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g, +h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&& +q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML=""; +if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="

";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}(); +(function(){var g=s.createElement("div");g.innerHTML="
";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}: +function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f0)for(var j=d;j0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j= +{},i;if(f&&a.length){e=0;for(var o=a.length;e-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a=== +"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode", +d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")? +a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType=== +1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/"},F={option:[1,""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div
","
"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= +c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, +wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, +prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, +this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); +return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja, +""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]); +return this}else{e=0;for(var j=d.length;e0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["", +""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]===""&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e= +c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]? +c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja= +function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter= +Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a, +"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f= +a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b= +a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=//gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!== +"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("
").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this}, +serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), +function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href, +global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&& +e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)? +"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache=== +false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B= +false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since", +c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E|| +d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x); +g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status=== +1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b=== +"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional; +if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration=== +"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]|| +c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start; +this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now= +this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem, +e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b
"; +a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b); +c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a, +d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top- +f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset": +"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in +e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window); diff --git a/media/jquery.datePicker.js b/media/jquery.datePicker.js new file mode 100644 index 0000000..553200b --- /dev/null +++ b/media/jquery.datePicker.js @@ -0,0 +1,1201 @@ +/** + * Copyright (c) 2008 Kelvin Luck (http://www.kelvinluck.com/) + * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) + * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. + * . + * $Id: jquery.datePicker.js 94 2010-01-25 02:25:27Z kelvin.luck $ + **/ + +(function($){ + + $.fn.extend({ +/** + * Render a calendar table into any matched elements. + * + * @param Object s (optional) Customize your calendars. + * @option Number month The month to render (NOTE that months are zero based). Default is today's month. + * @option Number year The year to render. Default is today's year. + * @option Function renderCallback A reference to a function that is called as each cell is rendered and which can add classes and event listeners to the created nodes. Default is no callback. + * @option Number showHeader Whether or not to show the header row, possible values are: $.dpConst.SHOW_HEADER_NONE (no header), $.dpConst.SHOW_HEADER_SHORT (first letter of each day) and $.dpConst.SHOW_HEADER_LONG (full name of each day). Default is $.dpConst.SHOW_HEADER_SHORT. + * @option String hoverClass The class to attach to each cell when you hover over it (to allow you to use hover effects in IE6 which doesn't support the :hover pseudo-class on elements other than links). Default is dp-hover. Pass false if you don't want a hover class. + * @type jQuery + * @name renderCalendar + * @cat plugins/datePicker + * @author Kelvin Luck (http://www.kelvinluck.com/) + * + * @example $('#calendar-me').renderCalendar({month:0, year:2007}); + * @desc Renders a calendar displaying January 2007 into the element with an id of calendar-me. + * + * @example + * var testCallback = function($td, thisDate, month, year) + * { + * if ($td.is('.current-month') && thisDate.getDay() == 4) { + * var d = thisDate.getDate(); + * $td.bind( + * 'click', + * function() + * { + * alert('You clicked on ' + d + '/' + (Number(month)+1) + '/' + year); + * } + * ).addClass('thursday'); + * } else if (thisDate.getDay() == 5) { + * $td.html('Friday the ' + $td.html() + 'th'); + * } + * } + * $('#calendar-me').renderCalendar({month:0, year:2007, renderCallback:testCallback}); + * + * @desc Renders a calendar displaying January 2007 into the element with an id of calendar-me. Every Thursday in the current month has a class of "thursday" applied to it, is clickable and shows an alert when clicked. Every Friday on the calendar has the number inside replaced with text. + **/ + renderCalendar : function(s) + { + var dc = function(a) + { + return document.createElement(a); + }; + + s = $.extend({}, $.fn.datePicker.defaults, s); + + if (s.showHeader != $.dpConst.SHOW_HEADER_NONE) { + var headRow = $(dc('tr')); + for (var i=Date.firstDayOfWeek; i 1) firstDayOffset -= 7; + var weeksToDraw = Math.ceil(( (-1*firstDayOffset+1) + currentDate.getDaysInMonth() ) /7); + currentDate.addDays(firstDayOffset-1); + + var doHover = function(firstDayInBounds) + { + return function() + { + if (s.hoverClass) { + var $this = $(this); + if (!s.selectWeek) { + $this.addClass(s.hoverClass); + } else if (firstDayInBounds && !$this.is('.disabled')) { + $this.parent().addClass('activeWeekHover'); + } + } + } + }; + var unHover = function() + { + if (s.hoverClass) { + var $this = $(this); + $this.removeClass(s.hoverClass); + $this.parent().removeClass('activeWeekHover'); + } + }; + + var w = 0; + while (w++ s.dpController.startDate : false; + for (var i=0; i<7; i++) { + var thisMonth = currentDate.getMonth() == month; + var d = $(dc('td')) + .text(currentDate.getDate() + '') + .addClass((thisMonth ? 'current-month ' : 'other-month ') + + (currentDate.isWeekend() ? 'weekend ' : 'weekday ') + + (thisMonth && currentDate.getTime() == today.getTime() ? 'today ' : '') + ) + .data('datePickerDate', currentDate.asString()) + .hover(doHover(firstDayInBounds), unHover) + ; + r.append(d); + if (s.renderCallback) { + s.renderCallback(d, currentDate, month, year); + } + // addDays(1) fails in some locales due to daylight savings. See issue 39. + //currentDate.addDays(1); + // set the time to midday to avoid any weird timezone issues?? + currentDate = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate()+1, 12, 0, 0); + } + tbody.append(r); + } + calendarTable.append(tbody); + + return this.each( + function() + { + $(this).empty().append(calendarTable); + } + ); + }, +/** + * Create a datePicker associated with each of the matched elements. + * + * The matched element will receive a few custom events with the following signatures: + * + * dateSelected(event, date, $td, status) + * Triggered when a date is selected. event is a reference to the event, date is the Date selected, $td is a jquery object wrapped around the TD that was clicked on and status is whether the date was selected (true) or deselected (false) + * + * dpClosed(event, selected) + * Triggered when the date picker is closed. event is a reference to the event and selected is an Array containing Date objects. + * + * dpMonthChanged(event, displayedMonth, displayedYear) + * Triggered when the month of the popped up calendar is changed. event is a reference to the event, displayedMonth is the number of the month now displayed (zero based) and displayedYear is the year of the month. + * + * dpDisplayed(event, $datePickerDiv) + * Triggered when the date picker is created. $datePickerDiv is the div containing the date picker. Use this event to add custom content/ listeners to the popped up date picker. + * + * @param Object s (optional) Customize your date pickers. + * @option Number month The month to render when the date picker is opened (NOTE that months are zero based). Default is today's month. + * @option Number year The year to render when the date picker is opened. Default is today's year. + * @option String startDate The first date date can be selected. + * @option String endDate The last date that can be selected. + * @option Boolean inline Whether to create the datePicker as inline (e.g. always on the page) or as a model popup. Default is false (== modal popup) + * @option Boolean createButton Whether to create a .dp-choose-date anchor directly after the matched element which when clicked will trigger the showing of the date picker. Default is true. + * @option Boolean showYearNavigation Whether to display buttons which allow the user to navigate through the months a year at a time. Default is true. + * @option Boolean closeOnSelect Whether to close the date picker when a date is selected. Default is true. + * @option Boolean displayClose Whether to create a "Close" button within the date picker popup. Default is false. + * @option Boolean selectMultiple Whether a user should be able to select multiple dates with this date picker. Default is false. + * @option Number numSelectable The maximum number of dates that can be selected where selectMultiple is true. Default is a very high number. + * @option Boolean clickInput If the matched element is an input type="text" and this option is true then clicking on the input will cause the date picker to appear. + * @option Boolean rememberViewedMonth Whether the datePicker should remember the last viewed month and open on it. If false then the date picker will always open with the month for the first selected date visible. + * @option Boolean selectWeek Whether to select a complete week at a time... + * @option Number verticalPosition The vertical alignment of the popped up date picker to the matched element. One of $.dpConst.POS_TOP and $.dpConst.POS_BOTTOM. Default is $.dpConst.POS_TOP. + * @option Number horizontalPosition The horizontal alignment of the popped up date picker to the matched element. One of $.dpConst.POS_LEFT and $.dpConst.POS_RIGHT. + * @option Number verticalOffset The number of pixels offset from the defined verticalPosition of this date picker that it should pop up in. Default in 0. + * @option Number horizontalOffset The number of pixels offset from the defined horizontalPosition of this date picker that it should pop up in. Default in 0. + * @option (Function|Array) renderCallback A reference to a function (or an array of seperate functions) that is called as each cell is rendered and which can add classes and event listeners to the created nodes. Each callback function will receive four arguments; a jquery object wrapping the created TD, a Date object containing the date this TD represents, a number giving the currently rendered month and a number giving the currently rendered year. Default is no callback. + * @option String hoverClass The class to attach to each cell when you hover over it (to allow you to use hover effects in IE6 which doesn't support the :hover pseudo-class on elements other than links). Default is dp-hover. Pass false if you don't want a hover class. + * @type jQuery + * @name datePicker + * @cat plugins/datePicker + * @author Kelvin Luck (http://www.kelvinluck.com/) + * + * @example $('input.date-picker').datePicker(); + * @desc Creates a date picker button next to all matched input elements. When the button is clicked on the value of the selected date will be placed in the corresponding input (formatted according to Date.format). + * + * @example demo/index.html + * @desc See the projects homepage for many more complex examples... + **/ + datePicker : function(s) + { + if (!$.event._dpCache) $.event._dpCache = []; + + // initialise the date picker controller with the relevant settings... + s = $.extend({}, $.fn.datePicker.defaults, s); + + return this.each( + function() + { + var $this = $(this); + var alreadyExists = true; + + if (!this._dpId) { + this._dpId = $.event.guid++; + $.event._dpCache[this._dpId] = new DatePicker(this); + alreadyExists = false; + } + + if (s.inline) { + s.createButton = false; + s.displayClose = false; + s.closeOnSelect = false; + $this.empty(); + } + + var controller = $.event._dpCache[this._dpId]; + + controller.init(s); + + if (!alreadyExists && s.createButton) { + // create it! + controller.button = $('' + $.dpText.TEXT_CHOOSE_DATE + '') + .bind( + 'click', + function() + { + $this.dpDisplay(this); + this.blur(); + return false; + } + ); + $this.after(controller.button); + } + + if (!alreadyExists && $this.is(':text')) { + $this + .bind( + 'dateSelected', + function(e, selectedDate, $td) + { + this.value = selectedDate.asString(); + } + ).bind( + 'change', + function() + { + if (this.value == '') { + controller.clearSelected(); + } else { + var d = Date.fromString(this.value); + if (d) { + controller.setSelected(d, true, true); + } + } + } + ); + if (s.clickInput) { + $this.bind( + 'click', + function() + { + // The change event doesn't happen until the input loses focus so we need to manually trigger it... + $this.trigger('change'); + $this.dpDisplay(); + } + ); + } + var d = Date.fromString(this.value); + if (this.value != '' && d) { + controller.setSelected(d, true, true); + } + } + + $this.addClass('dp-applied'); + + } + ) + }, +/** + * Disables or enables this date picker + * + * @param Boolean s Whether to disable (true) or enable (false) this datePicker + * @type jQuery + * @name dpSetDisabled + * @cat plugins/datePicker + * @author Kelvin Luck (http://www.kelvinluck.com/) + * + * @example $('.date-picker').datePicker(); + * $('.date-picker').dpSetDisabled(true); + * @desc Prevents this date picker from displaying and adds a class of dp-disabled to it (and it's associated button if it has one) for styling purposes. If the matched element is an input field then it will also set the disabled attribute to stop people directly editing the field. + **/ + dpSetDisabled : function(s) + { + return _w.call(this, 'setDisabled', s); + }, +/** + * Updates the first selectable date for any date pickers on any matched elements. + * + * @param String d A string representing the first selectable date (formatted according to Date.format). + * @type jQuery + * @name dpSetStartDate + * @cat plugins/datePicker + * @author Kelvin Luck (http://www.kelvinluck.com/) + * + * @example $('.date-picker').datePicker(); + * $('.date-picker').dpSetStartDate('01/01/2000'); + * @desc Creates a date picker associated with all elements with a class of "date-picker" then sets the first selectable date for each of these to the first day of the millenium. + **/ + dpSetStartDate : function(d) + { + return _w.call(this, 'setStartDate', d); + }, +/** + * Updates the last selectable date for any date pickers on any matched elements. + * + * @param String d A string representing the last selectable date (formatted according to Date.format). + * @type jQuery + * @name dpSetEndDate + * @cat plugins/datePicker + * @author Kelvin Luck (http://www.kelvinluck.com/) + * + * @example $('.date-picker').datePicker(); + * $('.date-picker').dpSetEndDate('01/01/2010'); + * @desc Creates a date picker associated with all elements with a class of "date-picker" then sets the last selectable date for each of these to the first Janurary 2010. + **/ + dpSetEndDate : function(d) + { + return _w.call(this, 'setEndDate', d); + }, +/** + * Gets a list of Dates currently selected by this datePicker. This will be an empty array if no dates are currently selected or NULL if there is no datePicker associated with the matched element. + * + * @type Array + * @name dpGetSelected + * @cat plugins/datePicker + * @author Kelvin Luck (http://www.kelvinluck.com/) + * + * @example $('.date-picker').datePicker(); + * alert($('.date-picker').dpGetSelected()); + * @desc Will alert an empty array (as nothing is selected yet) + **/ + dpGetSelected : function() + { + var c = _getController(this[0]); + if (c) { + return c.getSelected(); + } + return null; + }, +/** + * Selects or deselects a date on any matched element's date pickers. Deselcting is only useful on date pickers where selectMultiple==true. Selecting will only work if the passed date is within the startDate and endDate boundries for a given date picker. + * + * @param String d A string representing the date you want to select (formatted according to Date.format). + * @param Boolean v Whether you want to select (true) or deselect (false) this date. Optional - default = true. + * @param Boolean m Whether you want the date picker to open up on the month of this date when it is next opened. Optional - default = true. + * @param Boolean e Whether you want the date picker to dispatch events related to this change of selection. Optional - default = true. + * @type jQuery + * @name dpSetSelected + * @cat plugins/datePicker + * @author Kelvin Luck (http://www.kelvinluck.com/) + * + * @example $('.date-picker').datePicker(); + * $('.date-picker').dpSetSelected('01/01/2010'); + * @desc Creates a date picker associated with all elements with a class of "date-picker" then sets the selected date on these date pickers to the first Janurary 2010. When the date picker is next opened it will display Janurary 2010. + **/ + dpSetSelected : function(d, v, m, e) + { + if (v == undefined) v=true; + if (m == undefined) m=true; + if (e == undefined) e=true; + return _w.call(this, 'setSelected', Date.fromString(d), v, m, e); + }, +/** + * Sets the month that will be displayed when the date picker is next opened. If the passed month is before startDate then the month containing startDate will be displayed instead. If the passed month is after endDate then the month containing the endDate will be displayed instead. + * + * @param Number m The month you want the date picker to display. Optional - defaults to the currently displayed month. + * @param Number y The year you want the date picker to display. Optional - defaults to the currently displayed year. + * @type jQuery + * @name dpSetDisplayedMonth + * @cat plugins/datePicker + * @author Kelvin Luck (http://www.kelvinluck.com/) + * + * @example $('.date-picker').datePicker(); + * $('.date-picker').dpSetDisplayedMonth(10, 2008); + * @desc Creates a date picker associated with all elements with a class of "date-picker" then sets the selected date on these date pickers to the first Janurary 2010. When the date picker is next opened it will display Janurary 2010. + **/ + dpSetDisplayedMonth : function(m, y) + { + return _w.call(this, 'setDisplayedMonth', Number(m), Number(y), true); + }, +/** + * Displays the date picker associated with the matched elements. Since only one date picker can be displayed at once then the date picker associated with the last matched element will be the one that is displayed. + * + * @param HTMLElement e An element that you want the date picker to pop up relative in position to. Optional - default behaviour is to pop up next to the element associated with this date picker. + * @type jQuery + * @name dpDisplay + * @cat plugins/datePicker + * @author Kelvin Luck (http://www.kelvinluck.com/) + * + * @example $('#date-picker').datePicker(); + * $('#date-picker').dpDisplay(); + * @desc Creates a date picker associated with the element with an id of date-picker and then causes it to pop up. + **/ + dpDisplay : function(e) + { + return _w.call(this, 'display', e); + }, +/** + * Sets a function or array of functions that is called when each TD of the date picker popup is rendered to the page + * + * @param (Function|Array) a A function or an array of functions that are called when each td is rendered. Each function will receive four arguments; a jquery object wrapping the created TD, a Date object containing the date this TD represents, a number giving the currently rendered month and a number giving the currently rendered year. + * @type jQuery + * @name dpSetRenderCallback + * @cat plugins/datePicker + * @author Kelvin Luck (http://www.kelvinluck.com/) + * + * @example $('#date-picker').datePicker(); + * $('#date-picker').dpSetRenderCallback(function($td, thisDate, month, year) + * { + * // do stuff as each td is rendered dependant on the date in the td and the displayed month and year + * }); + * @desc Creates a date picker associated with the element with an id of date-picker and then creates a function which is called as each td is rendered when this date picker is displayed. + **/ + dpSetRenderCallback : function(a) + { + return _w.call(this, 'setRenderCallback', a); + }, +/** + * Sets the position that the datePicker will pop up (relative to it's associated element) + * + * @param Number v The vertical alignment of the created date picker to it's associated element. Possible values are $.dpConst.POS_TOP and $.dpConst.POS_BOTTOM + * @param Number h The horizontal alignment of the created date picker to it's associated element. Possible values are $.dpConst.POS_LEFT and $.dpConst.POS_RIGHT + * @type jQuery + * @name dpSetPosition + * @cat plugins/datePicker + * @author Kelvin Luck (http://www.kelvinluck.com/) + * + * @example $('#date-picker').datePicker(); + * $('#date-picker').dpSetPosition($.dpConst.POS_BOTTOM, $.dpConst.POS_RIGHT); + * @desc Creates a date picker associated with the element with an id of date-picker and makes it so that when this date picker pops up it will be bottom and right aligned to the #date-picker element. + **/ + dpSetPosition : function(v, h) + { + return _w.call(this, 'setPosition', v, h); + }, +/** + * Sets the offset that the popped up date picker will have from it's default position relative to it's associated element (as set by dpSetPosition) + * + * @param Number v The vertical offset of the created date picker. + * @param Number h The horizontal offset of the created date picker. + * @type jQuery + * @name dpSetOffset + * @cat plugins/datePicker + * @author Kelvin Luck (http://www.kelvinluck.com/) + * + * @example $('#date-picker').datePicker(); + * $('#date-picker').dpSetOffset(-20, 200); + * @desc Creates a date picker associated with the element with an id of date-picker and makes it so that when this date picker pops up it will be 20 pixels above and 200 pixels to the right of it's default position. + **/ + dpSetOffset : function(v, h) + { + return _w.call(this, 'setOffset', v, h); + }, +/** + * Closes the open date picker associated with this element. + * + * @type jQuery + * @name dpClose + * @cat plugins/datePicker + * @author Kelvin Luck (http://www.kelvinluck.com/) + * + * @example $('.date-pick') + * .datePicker() + * .bind( + * 'focus', + * function() + * { + * $(this).dpDisplay(); + * } + * ).bind( + * 'blur', + * function() + * { + * $(this).dpClose(); + * } + * ); + **/ + dpClose : function() + { + return _w.call(this, '_closeCalendar', false, this[0]); + }, +/** + * Rerenders the date picker's current month (for use with inline calendars and renderCallbacks). + * + * @type jQuery + * @name dpRerenderCalendar + * @cat plugins/datePicker + * @author Kelvin Luck (http://www.kelvinluck.com/) + * + **/ + dpRerenderCalendar : function() + { + return _w.call(this, '_rerenderCalendar'); + }, + // private function called on unload to clean up any expandos etc and prevent memory links... + _dpDestroy : function() + { + // TODO - implement this? + } + }); + + // private internal function to cut down on the amount of code needed where we forward + // dp* methods on the jQuery object on to the relevant DatePicker controllers... + var _w = function(f, a1, a2, a3, a4) + { + return this.each( + function() + { + var c = _getController(this); + if (c) { + c[f](a1, a2, a3, a4); + } + } + ); + }; + + function DatePicker(ele) + { + this.ele = ele; + + // initial values... + this.displayedMonth = null; + this.displayedYear = null; + this.startDate = null; + this.endDate = null; + this.showYearNavigation = null; + this.closeOnSelect = null; + this.displayClose = null; + this.rememberViewedMonth= null; + this.selectMultiple = null; + this.numSelectable = null; + this.numSelected = null; + this.verticalPosition = null; + this.horizontalPosition = null; + this.verticalOffset = null; + this.horizontalOffset = null; + this.button = null; + this.renderCallback = []; + this.selectedDates = {}; + this.inline = null; + this.context = '#dp-popup'; + this.settings = {}; + }; + $.extend( + DatePicker.prototype, + { + init : function(s) + { + this.setStartDate(s.startDate); + this.setEndDate(s.endDate); + this.setDisplayedMonth(Number(s.month), Number(s.year)); + this.setRenderCallback(s.renderCallback); + this.showYearNavigation = s.showYearNavigation; + this.closeOnSelect = s.closeOnSelect; + this.displayClose = s.displayClose; + this.rememberViewedMonth = s.rememberViewedMonth; + this.selectMultiple = s.selectMultiple; + this.numSelectable = s.selectMultiple ? s.numSelectable : 1; + this.numSelected = 0; + this.verticalPosition = s.verticalPosition; + this.horizontalPosition = s.horizontalPosition; + this.hoverClass = s.hoverClass; + this.setOffset(s.verticalOffset, s.horizontalOffset); + this.inline = s.inline; + this.settings = s; + if (this.inline) { + this.context = this.ele; + this.display(); + } + }, + setStartDate : function(d) + { + if (d) { + this.startDate = Date.fromString(d); + } + if (!this.startDate) { + this.startDate = (new Date()).zeroTime(); + } + this.setDisplayedMonth(this.displayedMonth, this.displayedYear); + }, + setEndDate : function(d) + { + if (d) { + this.endDate = Date.fromString(d); + } + if (!this.endDate) { + this.endDate = (new Date('12/31/2999')); // using the JS Date.parse function which expects mm/dd/yyyy + } + if (this.endDate.getTime() < this.startDate.getTime()) { + this.endDate = this.startDate; + } + this.setDisplayedMonth(this.displayedMonth, this.displayedYear); + }, + setPosition : function(v, h) + { + this.verticalPosition = v; + this.horizontalPosition = h; + }, + setOffset : function(v, h) + { + this.verticalOffset = parseInt(v) || 0; + this.horizontalOffset = parseInt(h) || 0; + }, + setDisabled : function(s) + { + $e = $(this.ele); + $e[s ? 'addClass' : 'removeClass']('dp-disabled'); + if (this.button) { + $but = $(this.button); + $but[s ? 'addClass' : 'removeClass']('dp-disabled'); + $but.attr('title', s ? '' : $.dpText.TEXT_CHOOSE_DATE); + } + if ($e.is(':text')) { + $e.attr('disabled', s ? 'disabled' : ''); + } + }, + setDisplayedMonth : function(m, y, rerender) + { + if (this.startDate == undefined || this.endDate == undefined) { + return; + } + var s = new Date(this.startDate.getTime()); + s.setDate(1); + var e = new Date(this.endDate.getTime()); + e.setDate(1); + + var t; + if ((!m && !y) || (isNaN(m) && isNaN(y))) { + // no month or year passed - default to current month + t = new Date().zeroTime(); + t.setDate(1); + } else if (isNaN(m)) { + // just year passed in - presume we want the displayedMonth + t = new Date(y, this.displayedMonth, 1); + } else if (isNaN(y)) { + // just month passed in - presume we want the displayedYear + t = new Date(this.displayedYear, m, 1); + } else { + // year and month passed in - that's the date we want! + t = new Date(y, m, 1) + } + // check if the desired date is within the range of our defined startDate and endDate + if (t.getTime() < s.getTime()) { + t = s; + } else if (t.getTime() > e.getTime()) { + t = e; + } + var oldMonth = this.displayedMonth; + var oldYear = this.displayedYear; + this.displayedMonth = t.getMonth(); + this.displayedYear = t.getFullYear(); + + if (rerender && (this.displayedMonth != oldMonth || this.displayedYear != oldYear)) + { + this._rerenderCalendar(); + $(this.ele).trigger('dpMonthChanged', [this.displayedMonth, this.displayedYear]); + } + }, + setSelected : function(d, v, moveToMonth, dispatchEvents) + { + if (d < this.startDate || d > this.endDate) { + // Don't allow people to select dates outside range... + return; + } + var s = this.settings; + if (s.selectWeek) + { + d = d.addDays(- (d.getDay() - Date.firstDayOfWeek + 7) % 7); + if (d < this.startDate) // The first day of this week is before the start date so is unselectable... + { + return; + } + } + if (v == this.isSelected(d)) // this date is already un/selected + { + return; + } + if (this.selectMultiple == false) { + this.clearSelected(); + } else if (v && this.numSelected == this.numSelectable) { + // can't select any more dates... + return; + } + if (moveToMonth && (this.displayedMonth != d.getMonth() || this.displayedYear != d.getFullYear())) { + this.setDisplayedMonth(d.getMonth(), d.getFullYear(), true); + } + this.selectedDates[d.asString()] = v; + this.numSelected += v ? 1 : -1; + var selectorString = 'td.' + (d.getMonth() == this.displayedMonth ? 'current-month' : 'other-month'); + var $td; + $(selectorString, this.context).each( + function() + { + if ($(this).data('datePickerDate') == d.asString()) { + $td = $(this); + if (s.selectWeek) + { + $td.parent()[v ? 'addClass' : 'removeClass']('selectedWeek'); + } + $td[v ? 'addClass' : 'removeClass']('selected'); + } + } + ); + $('td', this.context).not('.selected')[this.selectMultiple && this.numSelected == this.numSelectable ? 'addClass' : 'removeClass']('unselectable'); + + if (dispatchEvents) + { + var s = this.isSelected(d); + $e = $(this.ele); + var dClone = Date.fromString(d.asString()); + $e.trigger('dateSelected', [dClone, $td, s]); + $e.trigger('change'); + } + }, + isSelected : function(d) + { + return this.selectedDates[d.asString()]; + }, + getSelected : function() + { + var r = []; + for(s in this.selectedDates) { + if (this.selectedDates[s] == true) { + r.push(Date.fromString(s)); + } + } + return r; + }, + clearSelected : function() + { + this.selectedDates = {}; + this.numSelected = 0; + $('td.selected', this.context).removeClass('selected').parent().removeClass('selectedWeek'); + }, + display : function(eleAlignTo) + { + if ($(this.ele).is('.dp-disabled')) return; + + eleAlignTo = eleAlignTo || this.ele; + var c = this; + var $ele = $(eleAlignTo); + var eleOffset = $ele.offset(); + + var $createIn; + var attrs; + var attrsCalendarHolder; + var cssRules; + + if (c.inline) { + $createIn = $(this.ele); + attrs = { + 'id' : 'calendar-' + this.ele._dpId, + 'class' : 'dp-popup dp-popup-inline' + }; + + $('.dp-popup', $createIn).remove(); + cssRules = { + }; + } else { + $createIn = $('body'); + attrs = { + 'id' : 'dp-popup', + 'class' : 'dp-popup' + }; + cssRules = { + 'top' : eleOffset.top + c.verticalOffset, + 'left' : eleOffset.left + c.horizontalOffset + }; + + var _checkMouse = function(e) + { + var el = e.target; + var cal = $('#dp-popup')[0]; + + while (true){ + if (el == cal) { + return true; + } else if (el == document) { + c._closeCalendar(); + return false; + } else { + el = $(el).parent()[0]; + } + } + }; + this._checkMouse = _checkMouse; + + c._closeCalendar(true); + $(document).bind( + 'keydown.datepicker', + function(event) + { + if (event.keyCode == 27) { + c._closeCalendar(); + } + } + ); + } + + if (!c.rememberViewedMonth) + { + var selectedDate = this.getSelected()[0]; + if (selectedDate) { + selectedDate = new Date(selectedDate); + this.setDisplayedMonth(selectedDate.getMonth(), selectedDate.getFullYear(), false); + } + } + + $createIn + .append( + $('
') + .attr(attrs) + .css(cssRules) + .append( +// $('aaa'), + $('

'), + $('
') + .append( + $('<<') + .bind( + 'click', + function() + { + return c._displayNewMonth.call(c, this, 0, -1); + } + ), + $('<') + .bind( + 'click', + function() + { + return c._displayNewMonth.call(c, this, -1, 0); + } + ) + ), + $('
') + .append( + $('>>') + .bind( + 'click', + function() + { + return c._displayNewMonth.call(c, this, 0, 1); + } + ), + $('>') + .bind( + 'click', + function() + { + return c._displayNewMonth.call(c, this, 1, 0); + } + ) + ), + $('
') + ) + .bgIframe() + ); + + var $pop = this.inline ? $('.dp-popup', this.context) : $('#dp-popup'); + + if (this.showYearNavigation == false) { + $('.dp-nav-prev-year, .dp-nav-next-year', c.context).css('display', 'none'); + } + if (this.displayClose) { + $pop.append( + $('' + $.dpText.TEXT_CLOSE + '') + .bind( + 'click', + function() + { + c._closeCalendar(); + return false; + } + ) + ); + } + c._renderCalendar(); + + $(this.ele).trigger('dpDisplayed', $pop); + + if (!c.inline) { + if (this.verticalPosition == $.dpConst.POS_BOTTOM) { + $pop.css('top', eleOffset.top + $ele.height() - $pop.height() + c.verticalOffset); + } + if (this.horizontalPosition == $.dpConst.POS_RIGHT) { + $pop.css('left', eleOffset.left + $ele.width() - $pop.width() + c.horizontalOffset); + } +// $('.selectee', this.context).focus(); + $(document).bind('mousedown.datepicker', this._checkMouse); + } + + }, + setRenderCallback : function(a) + { + if (a == null) return; + if (a && typeof(a) == 'function') { + a = [a]; + } + this.renderCallback = this.renderCallback.concat(a); + }, + cellRender : function ($td, thisDate, month, year) { + var c = this.dpController; + var d = new Date(thisDate.getTime()); + + // add our click handlers to deal with it when the days are clicked... + + $td.bind( + 'click', + function() + { + var $this = $(this); + if (!$this.is('.disabled')) { + c.setSelected(d, !$this.is('.selected') || !c.selectMultiple, false, true); + if (c.closeOnSelect) { + c._closeCalendar(); + } + // TODO: Instead of this which doesn't work in IE anyway we should find the next focusable element in the document + // and pass the focus onto that. That would allow the user to continue on the form as expected... + if (!$.browser.msie) + { + $(c.ele).trigger('focus', [$.dpConst.DP_INTERNAL_FOCUS]); + } + } + } + ); + if (c.isSelected(d)) { + $td.addClass('selected'); + if (c.settings.selectWeek) + { + $td.parent().addClass('selectedWeek'); + } + } else if (c.selectMultiple && c.numSelected == c.numSelectable) { + $td.addClass('unselectable'); + } + + }, + _applyRenderCallbacks : function() + { + var c = this; + $('td', this.context).each( + function() + { + for (var i=0; i 20) { + $this.addClass('disabled'); + } + } + ); + var d = this.startDate.getDate(); + $('.dp-calendar td.current-month', this.context).each( + function() + { + var $this = $(this); + if (Number($this.text()) < d) { + $this.addClass('disabled'); + } + } + ); + } else { + $('.dp-nav-prev-year', this.context).removeClass('disabled'); + $('.dp-nav-prev-month', this.context).removeClass('disabled'); + var d = this.startDate.getDate(); + if (d > 20) { + // check if the startDate is last month as we might need to add some disabled classes... + var st = this.startDate.getTime(); + var sd = new Date(st); + sd.addMonths(1); + if (this.displayedYear == sd.getFullYear() && this.displayedMonth == sd.getMonth()) { + $('.dp-calendar td.other-month', this.context).each( + function() + { + var $this = $(this); + if (Date.fromString($this.data('datePickerDate')).getTime() < st) { + $this.addClass('disabled'); + } + } + ); + } + } + } + if (this.displayedYear == this.endDate.getFullYear() && this.displayedMonth == this.endDate.getMonth()) { + $('.dp-nav-next-year', this.context).addClass('disabled'); + $('.dp-nav-next-month', this.context).addClass('disabled'); + $('.dp-calendar td.other-month', this.context).each( + function() + { + var $this = $(this); + if (Number($this.text()) < 14) { + $this.addClass('disabled'); + } + } + ); + var d = this.endDate.getDate(); + $('.dp-calendar td.current-month', this.context).each( + function() + { + var $this = $(this); + if (Number($this.text()) > d) { + $this.addClass('disabled'); + } + } + ); + } else { + $('.dp-nav-next-year', this.context).removeClass('disabled'); + $('.dp-nav-next-month', this.context).removeClass('disabled'); + var d = this.endDate.getDate(); + if (d < 13) { + // check if the endDate is next month as we might need to add some disabled classes... + var ed = new Date(this.endDate.getTime()); + ed.addMonths(-1); + if (this.displayedYear == ed.getFullYear() && this.displayedMonth == ed.getMonth()) { + $('.dp-calendar td.other-month', this.context).each( + function() + { + var $this = $(this); + var cellDay = Number($this.text()); + if (cellDay < 13 && cellDay > d) { + $this.addClass('disabled'); + } + } + ); + } + } + } + this._applyRenderCallbacks(); + }, + _closeCalendar : function(programatic, ele) + { + if (!ele || ele == this.ele) + { + $(document).unbind('mousedown.datepicker'); + $(document).unbind('keydown.datepicker'); + this._clearCalendar(); + $('#dp-popup a').unbind(); + $('#dp-popup').empty().remove(); + if (!programatic) { + $(this.ele).trigger('dpClosed', [this.getSelected()]); + } + } + }, + // empties the current dp-calendar div and makes sure that all events are unbound + // and expandos removed to avoid memory leaks... + _clearCalendar : function() + { + // TODO. + $('.dp-calendar td', this.context).unbind(); + $('.dp-calendar', this.context).empty(); + } + } + ); + + // static constants + $.dpConst = { + SHOW_HEADER_NONE : 0, + SHOW_HEADER_SHORT : 1, + SHOW_HEADER_LONG : 2, + POS_TOP : 0, + POS_BOTTOM : 1, + POS_LEFT : 0, + POS_RIGHT : 1, + DP_INTERNAL_FOCUS : 'dpInternalFocusTrigger' + }; + // localisable text + $.dpText = { + TEXT_PREV_YEAR : 'Previous year', + TEXT_PREV_MONTH : 'Previous month', + TEXT_NEXT_YEAR : 'Next year', + TEXT_NEXT_MONTH : 'Next month', + TEXT_CLOSE : 'Close', + TEXT_CHOOSE_DATE : 'Choose date', + HEADER_FORMAT : 'mmmm yyyy' + }; + // version + $.dpVersion = '$Id: jquery.datePicker.js 94 2010-01-25 02:25:27Z kelvin.luck $'; + + $.fn.datePicker.defaults = { + month : undefined, + year : undefined, + showHeader : $.dpConst.SHOW_HEADER_SHORT, + startDate : undefined, + endDate : undefined, + inline : false, + renderCallback : null, + createButton : true, + showYearNavigation : true, + closeOnSelect : true, + displayClose : false, + selectMultiple : false, + numSelectable : Number.MAX_VALUE, + clickInput : false, + rememberViewedMonth : true, + selectWeek : false, + verticalPosition : $.dpConst.POS_TOP, + horizontalPosition : $.dpConst.POS_LEFT, + verticalOffset : 0, + horizontalOffset : 0, + hoverClass : 'dp-hover' + }; + + function _getController(ele) + { + if (ele._dpId) return $.event._dpCache[ele._dpId]; + return false; + }; + + // make it so that no error is thrown if bgIframe plugin isn't included (allows you to use conditional + // comments to only include bgIframe where it is needed in IE without breaking this plugin). + if ($.fn.bgIframe == undefined) { + $.fn.bgIframe = function() {return this; }; + }; + + + // clean-up + $(window) + .bind('unload', function() { + var els = $.event._dpCache || []; + for (var i in els) { + $(els[i].ele)._dpDestroy(); + } + }); + + +})(jQuery); diff --git a/media/jquery.tokeninput.js b/media/jquery.tokeninput.js new file mode 100755 index 0000000..c804e49 --- /dev/null +++ b/media/jquery.tokeninput.js @@ -0,0 +1,594 @@ +/* + * jQuery Plugin: Tokenizing Autocomplete Text Entry + * Version 1.1 + * + * Copyright (c) 2009 James Smith (http://loopj.com) + * Licensed jointly under the GPL and MIT licenses, + * choose which one suits your project best! + * + */ + +(function($) { + +$.fn.tokenInput = function (url, options) { + var settings = $.extend({ + url: url, + hintText: "Type in a search term", + noResultsText: "No results", + searchingText: "Searching...", + searchDelay: 300, + minChars: 1, + tokenLimit: null, + jsonContainer: null, + method: "GET", + contentType: "json", + queryParam: "q", + onResult: null + }, options); + + settings.classes = $.extend({ + tokenList: "token-input-list", + token: "token-input-token", + tokenDelete: "token-input-delete-token", + selectedToken: "token-input-selected-token", + highlightedToken: "token-input-highlighted-token", + dropdown: "token-input-dropdown", + dropdownItem: "token-input-dropdown-item", + dropdownItem2: "token-input-dropdown-item2", + selectedDropdownItem: "token-input-selected-dropdown-item", + inputToken: "token-input-input-token" + }, options.classes); + + return this.each(function () { + var list = new $.TokenList(this, settings); + }); +}; + +$.TokenList = function (input, settings) { + // + // Variables + // + + // Input box position "enum" + var POSITION = { + BEFORE: 0, + AFTER: 1, + END: 2 + }; + + // Keys "enum" + var KEY = { + BACKSPACE: 8, + TAB: 9, + RETURN: 13, + ESC: 27, + LEFT: 37, + UP: 38, + RIGHT: 39, + DOWN: 40, + COMMA: 188 + }; + + // Save the tokens + var saved_tokens = []; + + // Keep track of the number of tokens in the list + var token_count = 0; + + // Basic cache to save on db hits + var cache = new $.TokenList.Cache(); + + // Keep track of the timeout + var timeout; + + // Create a new text input an attach keyup events + var input_box = $("") + .css({ + outline: "none" + }) + .focus(function () { + if (settings.tokenLimit == null || settings.tokenLimit != token_count) { + show_dropdown_hint(); + } + }) + .blur(function () { + hide_dropdown(); + }) + .keydown(function (event) { + var previous_token; + var next_token; + + switch(event.keyCode) { + case KEY.LEFT: + case KEY.RIGHT: + case KEY.UP: + case KEY.DOWN: + if(!$(this).val()) { + previous_token = input_token.prev(); + next_token = input_token.next(); + + if((previous_token.length && previous_token.get(0) === selected_token) || (next_token.length && next_token.get(0) === selected_token)) { + // Check if there is a previous/next token and it is selected + if(event.keyCode == KEY.LEFT || event.keyCode == KEY.UP) { + deselect_token($(selected_token), POSITION.BEFORE); + } else { + deselect_token($(selected_token), POSITION.AFTER); + } + } else if((event.keyCode == KEY.LEFT || event.keyCode == KEY.UP) && previous_token.length) { + // We are moving left, select the previous token if it exists + select_token($(previous_token.get(0))); + } else if((event.keyCode == KEY.RIGHT || event.keyCode == KEY.DOWN) && next_token.length) { + // We are moving right, select the next token if it exists + select_token($(next_token.get(0))); + } + } else { + var dropdown_item = null; + + if(event.keyCode == KEY.DOWN || event.keyCode == KEY.RIGHT) { + dropdown_item = $(selected_dropdown_item).next(); + } else { + dropdown_item = $(selected_dropdown_item).prev(); + } + + if(dropdown_item.length) { + select_dropdown_item(dropdown_item); + } + return false; + } + break; + + case KEY.BACKSPACE: + previous_token = input_token.prev(); + + if(!$(this).val().length) { + if(selected_token) { + delete_token($(selected_token)); + } else if(previous_token.length) { + select_token($(previous_token.get(0))); + } + + return false; + } else if($(this).val().length == 1) { + hide_dropdown(); + } else { + // set a timeout just long enough to let this function finish. + setTimeout(function(){do_search(false);}, 5); + } + break; + + case KEY.TAB: + case KEY.RETURN: + case KEY.COMMA: + if(selected_dropdown_item) { + add_token($(selected_dropdown_item)); + return false; + } + break; + + case KEY.ESC: + hide_dropdown(); + return true; + + default: + if(is_printable_character(event.keyCode)) { + // set a timeout just long enough to let this function finish. + setTimeout(function(){do_search(false);}, 5); + } + break; + } + }); + + // Keep a reference to the original input box + var hidden_input = $(input) + .hide() + .focus(function () { + input_box.focus(); + }) + .blur(function () { + input_box.blur(); + }); + + // Keep a reference to the selected token and dropdown item + var selected_token = null; + var selected_dropdown_item = null; + + // The list to store the token items in + var token_list = $("
    ") + .addClass(settings.classes.tokenList) + .insertAfter(hidden_input) + .click(function (event) { + var li = get_element_from_event(event, "li"); + if(li && li.get(0) != input_token.get(0)) { + toggle_select_token(li); + return false; + } else { + input_box.focus(); + + if(selected_token) { + deselect_token($(selected_token), POSITION.END); + } + } + }) + .mouseover(function (event) { + var li = get_element_from_event(event, "li"); + if(li && selected_token !== this) { + li.addClass(settings.classes.highlightedToken); + } + }) + .mouseout(function (event) { + var li = get_element_from_event(event, "li"); + if(li && selected_token !== this) { + li.removeClass(settings.classes.highlightedToken); + } + }) + .mousedown(function (event) { + // Stop user selecting text on tokens + var li = get_element_from_event(event, "li"); + if(li){ + return false; + } + }); + + + // The list to store the dropdown items in + var dropdown = $("
    ") + .addClass(settings.classes.dropdown) + .insertAfter(token_list) + .hide(); + + // The token holding the input box + var input_token = $("
  • ") + .addClass(settings.classes.inputToken) + .appendTo(token_list) + .append(input_box); + + init_list(); + + // + // Functions + // + + + // Pre-populate list if items exist + function init_list () { + li_data = settings.prePopulate; + if(li_data && li_data.length) { + for(var i in li_data) { + var this_token = $("
  • "+li_data[i].name+"

  • ") + .addClass(settings.classes.token) + .insertBefore(input_token); + + $("x") + .addClass(settings.classes.tokenDelete) + .appendTo(this_token) + .click(function () { + delete_token($(this).parent()); + return false; + }); + + $.data(this_token.get(0), "tokeninput", {"id": li_data[i].id, "name": li_data[i].name}); + + // Clear input box and make sure it keeps focus + input_box + .val("") + .focus(); + + // Don't show the help dropdown, they've got the idea + hide_dropdown(); + + // Save this token id + var id_string = li_data[i].id + "," + hidden_input.val(hidden_input.val() + id_string); + } + } + } + + function is_printable_character(keycode) { + if((keycode >= 48 && keycode <= 90) || // 0-1a-z + (keycode >= 96 && keycode <= 111) || // numpad 0-9 + - / * . + (keycode >= 186 && keycode <= 192) || // ; = , - . / ^ + (keycode >= 219 && keycode <= 222) // ( \ ) ' + ) { + return true; + } else { + return false; + } + } + + // Get an element of a particular type from an event (click/mouseover etc) + function get_element_from_event (event, element_type) { + var target = $(event.target); + var element = null; + + if(target.is(element_type)) { + element = target; + } else if(target.parent(element_type).length) { + element = target.parent(element_type+":first"); + } + + return element; + } + + // Inner function to a token to the list + function insert_token(id, value) { + var this_token = $("
  • "+ value +"

  • ") + .addClass(settings.classes.token) + .insertBefore(input_token); + + // The 'delete token' button + $("x") + .addClass(settings.classes.tokenDelete) + .appendTo(this_token) + .click(function () { + delete_token($(this).parent()); + return false; + }); + + $.data(this_token.get(0), "tokeninput", {"id": id, "name": value}); + + return this_token; + } + + // Add a token to the token list based on user input + function add_token (item) { + var li_data = $.data(item.get(0), "tokeninput"); + var this_token = insert_token(li_data.id, li_data.name); + + // Clear input box and make sure it keeps focus + input_box + .val("") + .focus(); + + // Don't show the help dropdown, they've got the idea + hide_dropdown(); + + // Save this token id + var id_string = li_data.id + "," + hidden_input.val(hidden_input.val() + id_string); + + token_count++; + + if(settings.tokenLimit != null && settings.tokenLimit >= token_count) { + input_box.hide(); + hide_dropdown(); + } + } + + // Select a token in the token list + function select_token (token) { + token.addClass(settings.classes.selectedToken); + selected_token = token.get(0); + + // Hide input box + input_box.val(""); + + // Hide dropdown if it is visible (eg if we clicked to select token) + hide_dropdown(); + } + + // Deselect a token in the token list + function deselect_token (token, position) { + token.removeClass(settings.classes.selectedToken); + selected_token = null; + + if(position == POSITION.BEFORE) { + input_token.insertBefore(token); + } else if(position == POSITION.AFTER) { + input_token.insertAfter(token); + } else { + input_token.appendTo(token_list); + } + + // Show the input box and give it focus again + input_box.focus(); + } + + // Toggle selection of a token in the token list + function toggle_select_token (token) { + if(selected_token == token.get(0)) { + deselect_token(token, POSITION.END); + } else { + if(selected_token) { + deselect_token($(selected_token), POSITION.END); + } + select_token(token); + } + } + + // Delete a token from the token list + function delete_token (token) { + // Remove the id from the saved list + var token_data = $.data(token.get(0), "tokeninput"); + + // Delete the token + token.remove(); + selected_token = null; + + // Show the input box and give it focus again + input_box.focus(); + + // Delete this token's id from hidden input + var str = hidden_input.val() + var start = str.indexOf(token_data.id+","); + var end = str.indexOf(",", start) + 1; + + if(end >= str.length) { + hidden_input.val(str.slice(0, start)); + } else { + hidden_input.val(str.slice(0, start) + str.slice(end, str.length)); + } + + token_count--; + + if (settings.tokenLimit != null) { + input_box + .show() + .val("") + .focus(); + } + } + + // Hide and clear the results dropdown + function hide_dropdown () { + dropdown.hide().empty(); + selected_dropdown_item = null; + } + + function show_dropdown_searching () { + dropdown + .html("

    "+settings.searchingText+"

    ") + .show(); + } + + function show_dropdown_hint () { + dropdown + .html("

    "+settings.hintText+"

    ") + .show(); + } + + // Highlight the query part of the search term + function highlight_term(value, term) { + return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "$1"); + } + + // Populate the results dropdown with some results + function populate_dropdown (query, results) { + if(results.length) { + dropdown.empty(); + var dropdown_ul = $("
      ") + .appendTo(dropdown) + .mouseover(function (event) { + select_dropdown_item(get_element_from_event(event, "li")); + }) + .mousedown(function (event) { + add_token(get_element_from_event(event, "li")); + return false; + }) + .hide(); + + for(var i in results) { + if (results.hasOwnProperty(i)) { + var this_li = $("
    • "+highlight_term(results[i].name, query)+"
    • ") + .appendTo(dropdown_ul); + + if(i%2) { + this_li.addClass(settings.classes.dropdownItem); + } else { + this_li.addClass(settings.classes.dropdownItem2); + } + + if(i == 0) { + select_dropdown_item(this_li); + } + + $.data(this_li.get(0), "tokeninput", {"id": results[i].id, "name": results[i].name}); + } + } + + dropdown.show(); + dropdown_ul.slideDown("fast"); + + } else { + dropdown + .html("

      "+settings.noResultsText+"

      ") + .show(); + } + } + + // Highlight an item in the results dropdown + function select_dropdown_item (item) { + if(item) { + if(selected_dropdown_item) { + deselect_dropdown_item($(selected_dropdown_item)); + } + + item.addClass(settings.classes.selectedDropdownItem); + selected_dropdown_item = item.get(0); + } + } + + // Remove highlighting from an item in the results dropdown + function deselect_dropdown_item (item) { + item.removeClass(settings.classes.selectedDropdownItem); + selected_dropdown_item = null; + } + + // Do a search and show the "searching" dropdown if the input is longer + // than settings.minChars + function do_search(immediate) { + var query = input_box.val().toLowerCase(); + + if (query && query.length) { + if(selected_token) { + deselect_token($(selected_token), POSITION.AFTER); + } + if (query.length >= settings.minChars) { + show_dropdown_searching(); + if (immediate) { + run_search(query); + } else { + clearTimeout(timeout); + timeout = setTimeout(function(){run_search(query);}, settings.searchDelay); + } + } else { + hide_dropdown(); + } + } + } + + // Do the actual search + function run_search(query) { + var cached_results = cache.get(query); + if(cached_results) { + populate_dropdown(query, cached_results); + } else { + var queryStringDelimiter = settings.url.indexOf("?") < 0 ? "?" : "&"; + var callback = function(results) { + if($.isFunction(settings.onResult)) { + results = settings.onResult.call(this, results); + } + cache.add(query, settings.jsonContainer ? results[settings.jsonContainer] : results); + populate_dropdown(query, settings.jsonContainer ? results[settings.jsonContainer] : results); + }; + + if(settings.method == "POST") { + $.post(settings.url + queryStringDelimiter + settings.queryParam + "=" + query, {}, callback, settings.contentType); + } else { + $.get(settings.url + queryStringDelimiter + settings.queryParam + "=" + query, {}, callback, settings.contentType); + } + } + } +}; + +// Really basic cache for the results +$.TokenList.Cache = function (options) { + var settings = $.extend({ + max_size: 50 + }, options); + + var data = {}; + var size = 0; + + var flush = function () { + data = {}; + size = 0; + }; + + this.add = function (query, results) { + if(size > settings.max_size) { + flush(); + } + + if(!data[query]) { + size++; + } + + data[query] = results; + }; + + this.get = function (query) { + return data[query]; + }; +}; + +})(jQuery); \ No newline at end of file diff --git a/media/style.css b/media/style.css new file mode 100644 index 0000000..cd52a1f --- /dev/null +++ b/media/style.css @@ -0,0 +1,232 @@ +body{ + font-family: 'Adobe Caslon Pro', Georgia, sans-serif; + background-color: #532029; + color: #000000; +} + +#wrapper{ + width:900px; + position:absolute; + left:50%; + margin-left:-450px; +} + +#header { + position: absolute; + width:900px; + height: 70px; + text-align: center; + background-color: #C9C79E; + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + border-radius: 15px; +} + +#content { + position: absolute; + text-align: center; + width: 695px; + top:75px; + background-color: #FBFEF3; + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + border-radius: 15px; + padding-bottom: 30px; +} + +#sidebar { + position: absolute; + text-align: center; + top:0px; + width: 200px; + margin-left: 700px; + top:75px; + background-color: #FBFEF3; + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + border-radius: 15px; +} + +h1.header{ + font-size:30px; + color: #532029; + font-style: italic; +} + +h3.navtitle{ + margin-bottom: 3px; + color: #532029; + font-style: italic; +} + +h3.error{ + padding: 3px; + color: #C9C79E; + background-color:#532029; + font-style: italic; + display: block; +} + +ul { + list-style-type: none; + list-style-image: none; + margin-left: 0; + padding: 0; +} + +h3.sandwichtitle{ + font-size:25px; + margin-bottom: 3px; + color: #532029; +} + +p.metadata{ + font-size: 12px; +} + +h4.sandwichsub{ + font-size: 20px ; + font-weight: 500; + color: #532029; +} + +h4.addcomment{ + font-size: 20px ; + font-weight: 500; + margin-bottom: 15px; + color: #532029; +} + +img.sandwichimg { +} + +h1.pagetitle { + font-size: 30px; + color: #532029; +} + +p.sandnotes { + font-size: 16px; + padding-left: 50px; + padding-right: 50px; +} + +p.comment_user { + font-size: 13px; + padding-left: 50px; + padding-right: 50px; + font-style: italic; +} + +a { + text-decoration: none; + color: #4D515C; +} + +a:hover{ + color: #532029; +} + +/*Credits: Dynamic Drive CSS Library */ +/*URL: http://www.dynamicdrive.com/style/ */ +/* Modified */ + +form p{ + text-align: left; + width: 500px; + margin: 0; + padding: 5px 0 8px 0; + margin-left: 150px; /*width of left column containing the label elements*/ + height: 1%; +} + +.cssform p{ + text-align: left; + width: 500px; + margin: 0; + padding: 5px 0 8px 0; + margin-left: 150px; /*width of left column containing the label elements*/ + height: 1%; +} + +label{ + font-weight: bold; + float: left; + width: 150px; /*width of labels. Should be smaller than left column (155px) to create some right margin*/ +} + +input[type="text"]{ /*width of text boxes. IE6 does not understand this attribute*/ + width: 180px; + background-color: #C9C79E; + border: 1px solid #532029; +} + +input[type="password"]{ /*width of text boxes. IE6 does not understand this attribute*/ + width: 180px; + background-color: #C9C79E; + border: 1px solid #532029; +} + +input[type="file"]{ + background-color: #C9C79E; + border: none; + border: 1px solid #532029; +} + +textarea{ + width: 250px; + height: 150px; + background-color: #C9C79E; + border: 1px solid #532029; +} + +select{ + background-color: #C9C79E; + border: 1px solid #532029; + font-family: 'Adobe Caslon Pro', Georgia, sans-serif; + font-size: 12; + width:250px; +} + +option::selection { + background-color: #532029; +} + +option::-moz-selection { + background-color: #532029; +} + +select::selection { + background-color: #532029; +} + +select::-moz-selection { + background-color: #532029; +} + +input[type="submit"] { + background-color: #C9C79E; + color: #532029; + font-size: 14; + font-family: 'Adobe Caslon Pro', Georgia, sans-serif; + font-weight: bold; + width: 135px; + height: 30px; + border: 1px solid #532029; + margin-top: 20px; + padding: 0; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; +} + +p.submit{ + padding-left: 70px; +} + +ul.errorlist{ + margin-bottom: 0px; + font-size: 14; + color: #000; + font-weight: bold; +} \ No newline at end of file diff --git a/media/token-input.css b/media/token-input.css new file mode 100755 index 0000000..f950805 --- /dev/null +++ b/media/token-input.css @@ -0,0 +1,113 @@ +/* Example tokeninput style #1: Token vertical list*/ +ul.token-input-list { + overflow: hidden; + height: auto !important; + height: 30px; + width: 180px; + border: 1px solid #532029; + cursor: text; + font-size: 14px; + font-family: 'Adobe Caslon Pro', Georgia, sans-serif; + z-index: 999; + margin: 0; + padding: 0; + background-color: #C9C79E; +} + +ul.token-input-list li { + list-style-type: none; +} + +ul.token-input-list li input { + border: 0; + width: 180px; + padding: 3px 8px; + background-color: #C9C79E; +} + +li.token-input-token { + overflow: hidden; + height: 18px; + margin: 3px; + padding: 3px 5px; + background-color: #FBFEF3; + color: #000; + border: 1px solid #532029; + font-weight: bold; + cursor: default; + display: block; +} + +li.token-input-token p { + float: left; + padding: 0; + margin: 0; +} + +li.token-input-token span { + float: right; + color: #532029; + cursor: pointer; +} + +li.token-input-selected-token { + background-color: #FCB49E; + color: #000; +} + +li.token-input-selected-token span { + color: #532029; +} + +div.token-input-dropdown { + position: absolute; + margin-left:150px; + width: 176px; + background-color: #C9C79E; + overflow: hidden; + border-left: 2px solid #532029; + border-right: 2px solid #532029; + border-bottom: 2px solid #532029; + cursor: default; + font-size: 14px; + font-family: 'Adobe Caslon Pro', Georgia, sans-serif; + z-index: 1; +} + +div.token-input-dropdown p { + margin: 0; + padding: 5px; + font-weight: bold; + color: #000; +} + +div.token-input-dropdown ul { + margin: 0; + padding: 0; +} + +div.token-input-dropdown ul li { + background-color: #C9C79E; + padding: 3px; + list-style-type: none; +} + +div.token-input-dropdown ul li.token-input-dropdown-item { + background-color: #C9C79E; +} + +div.token-input-dropdown ul li.token-input-dropdown-item2 { + background-color: #C9C79E; +} + +div.token-input-dropdown ul li em { + font-weight: bold; + font-style: normal; +} + +div.token-input-dropdown ul li.token-input-selected-dropdown-item { + background-color: #532029; + border: 2px solid #FBFEF3; + color: #fff; +} + -- 2.20.1