From 370b9e473ef2c3ed8bc9f99cc23ea17de4afa387 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 2 Mar 2012 14:56:32 +0530 Subject: [PATCH 01/54] cleanup of handler.js --- js/core.min.js | 24 +-- js/legacy/app.js | 6 +- js/legacy/jquery/jquery-ui.min.js | 60 +++----- js/legacy/utils/dom.js | 66 +------- js/legacy/utils/handler.js | 192 +++++------------------- js/legacy/webpage/freeze_page.js | 48 ------ js/legacy/webpage/spinner.js | 21 +++ js/legacy/widgets/dialog.js | 2 +- js/legacy/widgets/form/form_comments.js | 2 +- js/legacy/widgets/tabbedpage.js | 2 +- js/legacy/widgets/tags.js | 6 +- js/wn/assets.js | 18 ++- js/wn/dom.js | 14 +- js/wn/request.js | 111 ++++++++++++++ js/wn/ui/button.js | 4 +- js/wn/xmlhttp.js | 66 -------- py/webnotes/auth.py | 67 ++------- py/webnotes/boot.py | 1 + 18 files changed, 247 insertions(+), 463 deletions(-) delete mode 100644 js/legacy/webpage/freeze_page.js create mode 100644 js/wn/request.js delete mode 100644 js/wn/xmlhttp.js diff --git a/js/core.min.js b/js/core.min.js index 168ae5a691..10a5fbae68 100644 --- a/js/core.min.js +++ b/js/core.min.js @@ -12,13 +12,6 @@ if(!window.wn)wn={} wn.provide=function(namespace){var nsl=namespace.split('.');var l=nsl.length;var parent=window;for(var i=0;i0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(j,k){return this.each(function(){if(!k){if(!j||c.filter(j,[this]).length){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")})}}return i.call(c(this),j,k)})},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);;/* - * jQuery UI Draggable 1.7.3 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Draggables - * - * Depends: - * ui.core.js - */ (function(a){a.widget("ui.draggable",a.extend({},a.ui.mouse,{_init:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.addClasses&&this.element.addClass("ui-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return}this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy()},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(b);if(!this.handle){return false}return true},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b);this._cacheHelperProportions();if(a.ui.ddmanager){a.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(b);this.originalPageX=b.pageX;this.originalPageY=b.pageY;if(c.cursorAt){this._adjustOffsetFromHelper(c.cursorAt)}if(c.containment){this._setContainment()}this._trigger("start",b);this._cacheHelperProportions();if(a.ui.ddmanager&&!c.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,b)}this.helper.addClass("ui-draggable-dragging");this._mouseDrag(b,true);return true},_mouseDrag:function(b,d){this.position=this._generatePosition(b);this.positionAbs=this._convertPositionTo("absolute");if(!d){var c=this._uiHash();this._trigger("drag",b,c);this.position=c.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(a.ui.ddmanager){a.ui.ddmanager.drag(this,b)}return false},_mouseStop:function(c){var d=false;if(a.ui.ddmanager&&!this.options.dropBehaviour){d=a.ui.ddmanager.drop(this,c)}if(this.dropped){d=this.dropped;this.dropped=false}if((this.options.revert=="invalid"&&!d)||(this.options.revert=="valid"&&d)||this.options.revert===true||(a.isFunction(this.options.revert)&&this.options.revert.call(this.element,d))){var b=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){b._trigger("stop",c);b._clear()})}else{this._trigger("stop",c);this._clear()}return false},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==b.target){c=true}});return c},_createHelper:function(c){var d=this.options;var b=a.isFunction(d.helper)?a(d.helper.apply(this.element[0],[c])):(d.helper=="clone"?this.element.clone():this.element);if(!b.parents("body").length){b.appendTo((d.appendTo=="parent"?this.element[0].parentNode:d.appendTo))}if(b[0]!=this.element[0]&&!(/(fixed|absolute)/).test(b.css("position"))){b.css("position","absolute")}return b},_adjustOffsetFromHelper:function(b){if(b.left!=undefined){this.offset.click.left=b.left+this.margins.left}if(b.right!=undefined){this.offset.click.left=this.helperProportions.width-b.right+this.margins.left}if(b.top!=undefined){this.offset.click.top=b.top+this.margins.top}if(b.bottom!=undefined){this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){b={top:0,left:0}}return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.element.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if(e.containment=="parent"){e.containment=this.helper[0].parentNode}if(e.containment=="document"||e.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(e.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(e.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(e.containment)&&e.containment.constructor!=Array){var c=a(e.containment)[0];if(!c){return}var d=a(e.containment).offset();var b=(a(c).css("overflow")!="hidden");this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(b?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(b?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}else{if(e.containment.constructor==Array){this.containment=e.containment}}},_convertPositionTo:function(f,h){if(!h){h=this.position}var c=f=="absolute"?1:-1;var e=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=(/(html|body)/i).test(b[0].tagName);return{top:(h.top+this.offset.relative.top*c+this.offset.parent.top*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(g?0:b.scrollTop()))*c)),left:(h.left+this.offset.relative.left*c+this.offset.parent.left*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:b.scrollLeft())*c))}},_generatePosition:function(e){var h=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,i=(/(html|body)/i).test(b[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var d=e.pageX;var c=e.pageY;if(this.originalPosition){if(this.containment){if(e.pageX-this.offset.click.leftthis.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.topthis.containment[3])?g:(!(g-this.offset.click.topthis.containment[2])?f:(!(f-this.offset.click.left').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(a(this).offset()).appendTo("body")})},stop:function(b,c){a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});a.ui.plugin.add("draggable","opacity",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("opacity")){e._opacity=b.css("opacity")}b.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._opacity){a(c.helper).css("opacity",d._opacity)}}});a.ui.plugin.add("draggable","scroll",{start:function(c,d){var b=a(this).data("draggable");if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){b.overflowOffset=b.scrollParent.offset()}},drag:function(d,e){var c=a(this).data("draggable"),f=c.options,b=false;if(c.scrollParent[0]!=document&&c.scrollParent[0].tagName!="HTML"){if(!f.axis||f.axis!="x"){if((c.overflowOffset.top+c.scrollParent[0].offsetHeight)-d.pageY=0;v--){var s=g.snapElements[v].left,n=s+g.snapElements[v].width,m=g.snapElements[v].top,A=m+g.snapElements[v].height;if(!((s-y=p&&n<=k)||(m>=p&&m<=k)||(nk))&&((e>=g&&e<=c)||(d>=g&&d<=c)||(ec));break;default:return false;break}};a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,g){var b=a.ui.ddmanager.droppables[e.options.scope];var f=g?g.type:null;var h=(e.currentItem||e.element).find(":data(droppable)").andSelf();droppablesLoop:for(var d=0;d0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(j,k){return this.each(function(){if(!k){if(!j||c.filter(j,[this]).length){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")})}}return i.call(c(this),j,k)})},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);;/* * jQuery UI Selectable 1.7.3 * * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) @@ -40,7 +18,8 @@ * * Depends: * ui.core.js - */ (function(a){a.widget("ui.selectable",a.extend({},a.ui.mouse,{_init:function(){var b=this;this.element.addClass("ui-selectable");this.dragged=false;var c;this.refresh=function(){c=a(b.options.filter,b.element[0]);c.each(function(){var d=a(this);var e=d.offset();a.data(this,"selectable-item",{element:this,$element:d,left:e.left,top:e.top,right:e.left+d.outerWidth(),bottom:e.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"),selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=c.addClass("ui-selectee");this._mouseInit();this.helper=a(document.createElement("div")).css({border:"1px dotted black"}).addClass("ui-selectable-helper")},destroy:function(){this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy()},_mouseStart:function(d){var b=this;this.opos=[d.pageX,d.pageY];if(this.options.disabled){return}var c=this.options;this.selectees=a(c.filter,this.element[0]);this._trigger("start",d);a(c.appendTo).append(this.helper);this.helper.css({"z-index":100,position:"absolute",left:d.clientX,top:d.clientY,width:0,height:0});if(c.autoRefresh){this.refresh()}this.selectees.filter(".ui-selected").each(function(){var e=a.data(this,"selectable-item");e.startselected=true;if(!d.metaKey){e.$element.removeClass("ui-selected");e.selected=false;e.$element.addClass("ui-unselecting");e.unselecting=true;b._trigger("unselecting",d,{unselecting:e.element})}});a(d.target).parents().andSelf().each(function(){var e=a.data(this,"selectable-item");if(e){e.$element.removeClass("ui-unselecting").addClass("ui-selecting");e.unselecting=false;e.selecting=true;e.selected=true;b._trigger("selecting",d,{selecting:e.element});return false}})},_mouseDrag:function(i){var c=this;this.dragged=true;if(this.options.disabled){return}var e=this.options;var d=this.opos[0],h=this.opos[1],b=i.pageX,g=i.pageY;if(d>b){var f=b;b=d;d=f}if(h>g){var f=g;g=h;h=f}this.helper.css({left:d,top:h,width:b-d,height:g-h});this.selectees.each(function(){var j=a.data(this,"selectable-item");if(!j||j.element==c.element[0]){return}var k=false;if(e.tolerance=="touch"){k=(!(j.left>b||j.rightg||j.bottomd&&j.righth&&j.bottomb){var f=b;b=d;d=f}if(h>g){var f=g;g=h;h=f}this.helper.css({left:d,top:h,width:b-d,height:g-h});this.selectees.each(function(){var j=a.data(this,"selectable-item");if(!j||j.element==c.element[0]){return}var k=false;if(e.tolerance=="touch"){k=(!(j.left>b||j.rightg||j.bottomd&&j.righth&&j.bottom')}$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",log:function(){if(this.debug){console.log.apply("",arguments)}},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase();var inline=(nodeName=="div"||nodeName=="span");if(!target.id){target.id="dp"+(++this.uuid)}var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{});if(nodeName=="input"){this._connectDatepicker(target,inst)}else{if(inline){this._inlineDatepicker(target,inst)}}},_newInst:function(target,inline){var id=target[0].id.replace(/([:\[\]\.])/g,"\\\\$1");return{id:id,input:target,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:inline,dpDiv:(!inline?this.dpDiv:$('
'))}},_connectDatepicker:function(target,inst){var input=$(target);inst.append=$([]);inst.trigger=$([]);if(input.hasClass(this.markerClassName)){return}var appendText=this._get(inst,"appendText");var isRTL=this._get(inst,"isRTL");if(appendText){inst.append=$(''+appendText+"");input[isRTL?"before":"after"](inst.append)}var showOn=this._get(inst,"showOn");if(showOn=="focus"||showOn=="both"){input.focus(this._showDatepicker)}if(showOn=="button"||showOn=="both"){var buttonText=this._get(inst,"buttonText");var buttonImage=this._get(inst,"buttonImage");inst.trigger=$(this._get(inst,"buttonImageOnly")?$("").addClass(this._triggerClass).attr({src:buttonImage,alt:buttonText,title:buttonText}):$('').addClass(this._triggerClass).html(buttonImage==""?buttonText:$("").attr({src:buttonImage,alt:buttonText,title:buttonText})));input[isRTL?"before":"after"](inst.trigger);inst.trigger.click(function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput==target){$.datepicker._hideDatepicker()}else{$.datepicker._showDatepicker(target)}return false})}input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst)},_inlineDatepicker:function(target,inst){var divSpan=$(target);if(divSpan.hasClass(this.markerClassName)){return}divSpan.addClass(this.markerClassName).append(inst.dpDiv).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst);this._setDate(inst,this._getDefaultDate(inst));this._updateDatepicker(inst);this._updateAlternate(inst)},_dialogDatepicker:function(input,dateText,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){var id="dp"+(++this.uuid);this._dialogInput=$('');this._dialogInput.keydown(this._doKeyDown);$("body").append(this._dialogInput);inst=this._dialogInst=this._newInst(this._dialogInput,false);inst.settings={};$.data(this._dialogInput[0],PROP_NAME,inst)}extendRemove(inst.settings,settings||{});this._dialogInput.val(dateText);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){var browserWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(browserWidth/2)-100+scrollX,(browserHeight/2)-150+scrollY]}this._dialogInput.css("left",this._pos[0]+"px").css("top",this._pos[1]+"px");inst.settings.onSelect=onSelect;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if($.blockUI){$.blockUI(this.dpDiv)}$.data(this._dialogInput[0],PROP_NAME,inst);return this},_destroyDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();$.removeData(target,PROP_NAME);if(nodeName=="input"){inst.append.remove();inst.trigger.remove();$target.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress)}else{if(nodeName=="div"||nodeName=="span"){$target.removeClass(this.markerClassName).empty()}}},_enableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=false;inst.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().removeClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)})},_disableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=true;inst.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().addClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)});this._disabledInputs[this._disabledInputs.length]=target},_isDisabledDatepicker:function(target){if(!target){return false}for(var i=0;i-1)}},_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!="input"){input=$("input",input.parentNode)[0]}if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput==input){return}var inst=$.datepicker._getInst(input);var beforeShow=$.datepicker._get(inst,"beforeShow");extendRemove(inst.settings,(beforeShow?beforeShow.apply(input,[input,inst]):{}));$.datepicker._hideDatepicker(null,"");$.datepicker._lastInput=input;$.datepicker._setDateFromField(inst);if($.datepicker._inDialog){input.value=""}if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight}var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css("position")=="fixed";return !isFixed});if(isFixed&&$.browser.opera){$.datepicker._pos[0]-=document.documentElement.scrollLeft;$.datepicker._pos[1]-=document.documentElement.scrollTop}var offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null;inst.rangeStart=null;inst.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});$.datepicker._updateDatepicker(inst);offset=$.datepicker._checkOffset(inst,offset,isFixed);inst.dpDiv.css({position:($.datepicker._inDialog&&$.blockUI?"static":(isFixed?"fixed":"absolute")),display:"none",left:offset.left+"px",top:offset.top+"px"});if(!inst.inline){var showAnim=$.datepicker._get(inst,"showAnim")||"show";var duration=$.datepicker._get(inst,"duration");var postProcess=function(){$.datepicker._datepickerShowing=true;if($.browser.msie&&parseInt($.browser.version,10)<7){$("iframe.ui-datepicker-cover").css({width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4})}};if($.effects&&$.effects[showAnim]){inst.dpDiv.show(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[showAnim](duration,postProcess)}if(duration==""){postProcess()}if(inst.input[0].type!="hidden"){inst.input[0].focus()}$.datepicker._curInst=inst}},_updateDatepicker:function(inst){var dims={width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4};var self=this;inst.dpDiv.empty().append(this._generateHTML(inst)).find("iframe.ui-datepicker-cover").css({width:dims.width,height:dims.height}).end().find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){$(this).removeClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).removeClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).removeClass("ui-datepicker-next-hover")}}).bind("mouseover",function(){if(!self._isDisabledDatepicker(inst.inline?inst.dpDiv.parent()[0]:inst.input[0])){$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");$(this).addClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).addClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).addClass("ui-datepicker-next-hover")}}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();var numMonths=this._getNumberOfMonths(inst);var cols=numMonths[1];var width=17;if(cols>1){inst.dpDiv.addClass("ui-datepicker-multi-"+cols).css("width",(width*cols)+"em")}else{inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("")}inst.dpDiv[(numMonths[0]!=1||numMonths[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");inst.dpDiv[(this._get(inst,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(inst.input&&inst.input[0].type!="hidden"&&inst==$.datepicker._curInst){$(inst.input[0]).focus()}},_checkOffset:function(inst,offset,isFixed){var dpWidth=inst.dpDiv.outerWidth();var dpHeight=inst.dpDiv.outerHeight();var inputWidth=inst.input?inst.input.outerWidth():0;var inputHeight=inst.input?inst.input.outerHeight():0;var viewWidth=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)+$(document).scrollLeft();var viewHeight=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)+$(document).scrollTop();offset.left-=(this._get(inst,"isRTL")?(dpWidth-inputWidth):0);offset.left-=(isFixed&&offset.left==inst.input.offset().left)?$(document).scrollLeft():0;offset.top-=(isFixed&&offset.top==(inst.input.offset().top+inputHeight))?$(document).scrollTop():0;offset.left-=(offset.left+dpWidth>viewWidth&&viewWidth>dpWidth)?Math.abs(offset.left+dpWidth-viewWidth):0;offset.top-=(offset.top+dpHeight>viewHeight&&viewHeight>dpHeight)?Math.abs(offset.top+dpHeight+inputHeight*2-viewHeight):0;return offset},_findPos:function(obj){while(obj&&(obj.type=="hidden"||obj.nodeType!=1)){obj=obj.nextSibling}var position=$(obj).offset();return[position.left,position.top]},_hideDatepicker:function(input,duration){var inst=this._curInst;if(!inst||(input&&inst!=$.data(input,PROP_NAME))){return}if(inst.stayOpen){this._selectDate("#"+inst.id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear))}inst.stayOpen=false;if(this._datepickerShowing){duration=(duration!=null?duration:this._get(inst,"duration"));var showAnim=this._get(inst,"showAnim");var postProcess=function(){$.datepicker._tidyDialog(inst)};if(duration!=""&&$.effects&&$.effects[showAnim]){inst.dpDiv.hide(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[(duration==""?"hide":(showAnim=="slideDown"?"slideUp":(showAnim=="fadeIn"?"fadeOut":"hide")))](duration,postProcess)}if(duration==""){this._tidyDialog(inst)}var onClose=this._get(inst,"onClose");if(onClose){onClose.apply((inst.input?inst.input[0]:null),[(inst.input?inst.input.val():""),inst])}this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if($.blockUI){$.unblockUI();$("body").append(this.dpDiv)}}this._inDialog=false}this._curInst=null},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(event){if(!$.datepicker._curInst){return}var $target=$(event.target);if(($target.parents("#"+$.datepicker._mainDivId).length==0)&&!$target.hasClass($.datepicker.markerClassName)&&!$target.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)){$.datepicker._hideDatepicker(null,"")}},_adjustDate:function(id,offset,period){var target=$(id);var inst=this._getInst(target[0]);if(this._isDisabledDatepicker(target[0])){return}this._adjustInstDate(inst,offset+(period=="M"?this._get(inst,"showCurrentAtPos"):0),period);this._updateDatepicker(inst)},_gotoToday:function(id){var target=$(id);var inst=this._getInst(target[0]);if(this._get(inst,"gotoCurrent")&&inst.currentDay){inst.selectedDay=inst.currentDay;inst.drawMonth=inst.selectedMonth=inst.currentMonth;inst.drawYear=inst.selectedYear=inst.currentYear}else{var date=new Date();inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear()}this._notifyChange(inst);this._adjustDate(target)},_selectMonthYear:function(id,select,period){var target=$(id);var inst=this._getInst(target[0]);inst._selectingMonthYear=false;inst["selected"+(period=="M"?"Month":"Year")]=inst["draw"+(period=="M"?"Month":"Year")]=parseInt(select.options[select.selectedIndex].value,10);this._notifyChange(inst);this._adjustDate(target)},_clickMonthYear:function(id){var target=$(id);var inst=this._getInst(target[0]);if(inst.input&&inst._selectingMonthYear&&!$.browser.msie){inst.input[0].focus()}inst._selectingMonthYear=!inst._selectingMonthYear},_selectDay:function(id,month,year,td){var target=$(id);if($(td).hasClass(this._unselectableClass)||this._isDisabledDatepicker(target[0])){return}var inst=this._getInst(target[0]);inst.selectedDay=inst.currentDay=$("a",td).html();inst.selectedMonth=inst.currentMonth=month;inst.selectedYear=inst.currentYear=year;if(inst.stayOpen){inst.endDay=inst.endMonth=inst.endYear=null}this._selectDate(id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear));if(inst.stayOpen){inst.rangeStart=this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay));this._updateDatepicker(inst)}},_clearDate:function(id){var target=$(id);var inst=this._getInst(target[0]);inst.stayOpen=false;inst.endDay=inst.endMonth=inst.endYear=inst.rangeStart=null;this._selectDate(target,"")},_selectDate:function(id,dateStr){var target=$(id);var inst=this._getInst(target[0]);dateStr=(dateStr!=null?dateStr:this._formatDate(inst));if(inst.input){inst.input.val(dateStr)}this._updateAlternate(inst);var onSelect=this._get(inst,"onSelect");if(onSelect){onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst])}else{if(inst.input){inst.input.trigger("change")}}if(inst.inline){this._updateDatepicker(inst)}else{if(!inst.stayOpen){this._hideDatepicker(null,this._get(inst,"duration"));this._lastInput=inst.input[0];if(typeof(inst.input[0])!="object"){inst.input[0].focus()}this._lastInput=null}}},_updateAlternate:function(inst){var altField=this._get(inst,"altField");if(altField){var altFormat=this._get(inst,"altFormat")||this._get(inst,"dateFormat");var date=this._getDate(inst);dateStr=this.formatDate(altFormat,date,this._getFormatConfig(inst));$(altField).each(function(){$(this).val(dateStr)})}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),""]},iso8601Week:function(date){var checkDate=new Date(date.getFullYear(),date.getMonth(),date.getDate());var firstMon=new Date(checkDate.getFullYear(),1-1,4);var firstDay=firstMon.getDay()||7;firstMon.setDate(firstMon.getDate()+1-firstDay);if(firstDay<4&&checkDatenew Date(checkDate.getFullYear(),12-1,28)){firstDay=new Date(checkDate.getFullYear()+1,1-1,4).getDay()||7;if(firstDay>4&&(checkDate.getDay()||7)0&&iValue="0"&&value.charAt(iValue)<="9"){num=num*10+parseInt(value.charAt(iValue++),10);size--}if(size==origSize){throw"Missing number at position "+iValue}return num};var getName=function(match,shortNames,longNames){var names=(lookAhead(match)?longNames:shortNames);var size=0;for(var j=0;j0&&iValue-1){month=1;day=doy;do{var dim=this._getDaysInMonth(year,month-1);if(day<=dim){break}month++;day-=dim}while(true)}var date=this._daylightSavingAdjust(new Date(year,month-1,day));if(date.getFullYear()!=year||date.getMonth()+1!=month||date.getDate()!=day){throw"Invalid date"}return date},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TIMESTAMP:"@",W3C:"yy-mm-dd",formatDate:function(format,date,settings){if(!date){return""}var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var lookAhead=function(match){var matches=(iFormat+1=0;m--){doy+=this._getDaysInMonth(date.getFullYear(),m)}output+=formatNumber("o",doy,3);break;case"m":output+=formatNumber("m",date.getMonth()+1,2);break;case"M":output+=formatName("M",date.getMonth(),monthNamesShort,monthNames);break;case"y":output+=(lookAhead("y")?date.getFullYear():(date.getYear()%100<10?"0":"")+date.getYear()%100);break;case"@":output+=date.getTime();break;case"'":if(lookAhead("'")){output+="'"}else{literal=true}break;default:output+=format.charAt(iFormat)}}}}return output},_possibleChars:function(format){var chars="";var literal=false;for(var iFormat=0;iFormatmaxDate?maxDate:date);return date},_determineDate:function(date,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date};var offsetString=function(offset,getDaysInMonth){var date=new Date();var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();var pattern=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;var matches=pattern.exec(offset);while(matches){switch(matches[2]||"d"){case"d":case"D":day+=parseInt(matches[1],10);break;case"w":case"W":day+=parseInt(matches[1],10)*7;break;case"m":case"M":month+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break;case"y":case"Y":year+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break}matches=pattern.exec(offset)}return new Date(year,month,day)};date=(date==null?defaultDate:(typeof date=="string"?offsetString(date,this._getDaysInMonth):(typeof date=="number"?(isNaN(date)?defaultDate:offsetNumeric(date)):date)));date=(date&&date.toString()=="Invalid Date"?defaultDate:date);if(date){date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0)}return this._daylightSavingAdjust(date)},_daylightSavingAdjust:function(date){if(!date){return null}date.setHours(date.getHours()>12?date.getHours()+2:0);return date},_setDate:function(inst,date,endDate){var clear=!(date);var origMonth=inst.selectedMonth;var origYear=inst.selectedYear;date=this._determineDate(date,new Date());inst.selectedDay=inst.currentDay=date.getDate();inst.drawMonth=inst.selectedMonth=inst.currentMonth=date.getMonth();inst.drawYear=inst.selectedYear=inst.currentYear=date.getFullYear();if(origMonth!=inst.selectedMonth||origYear!=inst.selectedYear){this._notifyChange(inst)}this._adjustInstDate(inst);if(inst.input){inst.input.val(clear?"":this._formatDate(inst))}},_getDate:function(inst){var startDate=(!inst.currentYear||(inst.input&&inst.input.val()=="")?null:this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return startDate},_generateHTML:function(inst){var today=new Date();today=this._daylightSavingAdjust(new Date(today.getFullYear(),today.getMonth(),today.getDate()));var isRTL=this._get(inst,"isRTL");var showButtonPanel=this._get(inst,"showButtonPanel");var hideIfNoPrevNext=this._get(inst,"hideIfNoPrevNext");var navigationAsDateFormat=this._get(inst,"navigationAsDateFormat");var numMonths=this._getNumberOfMonths(inst);var showCurrentAtPos=this._get(inst,"showCurrentAtPos");var stepMonths=this._get(inst,"stepMonths");var stepBigMonths=this._get(inst,"stepBigMonths");var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);var currentDate=this._daylightSavingAdjust((!inst.currentDay?new Date(9999,9,9):new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");var drawMonth=inst.drawMonth-showCurrentAtPos;var drawYear=inst.drawYear;if(drawMonth<0){drawMonth+=12;drawYear--}if(maxDate){var maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),maxDate.getMonth()-numMonths[1]+1,maxDate.getDate()));maxDraw=(minDate&&maxDrawmaxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--}}}inst.drawMonth=drawMonth;inst.drawYear=drawYear;var prevText=this._get(inst,"prevText");prevText=(!navigationAsDateFormat?prevText:this.formatDate(prevText,this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepMonths,1)),this._getFormatConfig(inst)));var prev=(this._canAdjustMonth(inst,-1,drawYear,drawMonth)?''+prevText+"":(hideIfNoPrevNext?"":''+prevText+""));var nextText=this._get(inst,"nextText");nextText=(!navigationAsDateFormat?nextText:this.formatDate(nextText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)),this._getFormatConfig(inst)));var next=(this._canAdjustMonth(inst,+1,drawYear,drawMonth)?''+nextText+"":(hideIfNoPrevNext?"":''+nextText+""));var currentText=this._get(inst,"currentText");var gotoDate=(this._get(inst,"gotoCurrent")&&inst.currentDay?currentDate:today);currentText=(!navigationAsDateFormat?currentText:this.formatDate(currentText,gotoDate,this._getFormatConfig(inst)));var controls=(!inst.inline?'":"");var buttonPanel=(showButtonPanel)?'
'+(isRTL?controls:"")+(this._isInRange(inst,gotoDate)?'":"")+(isRTL?"":controls)+"
":"";var firstDay=parseInt(this._get(inst,"firstDay"),10);firstDay=(isNaN(firstDay)?0:firstDay);var dayNames=this._get(inst,"dayNames");var dayNamesShort=this._get(inst,"dayNamesShort");var dayNamesMin=this._get(inst,"dayNamesMin");var monthNames=this._get(inst,"monthNames");var monthNamesShort=this._get(inst,"monthNamesShort");var beforeShowDay=this._get(inst,"beforeShowDay");var showOtherMonths=this._get(inst,"showOtherMonths");var calculateWeek=this._get(inst,"calculateWeek")||this.iso8601Week;var endDate=inst.endDay?this._daylightSavingAdjust(new Date(inst.endYear,inst.endMonth,inst.endDay)):currentDate;var defaultDate=this._getDefaultDate(inst);var html="";for(var row=0;row'+(/all|left/.test(cornerClass)&&row==0?(isRTL?next:prev):"")+(/all|right/.test(cornerClass)&&row==0?(isRTL?prev:next):"")+this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,row>0||col>0,monthNames,monthNamesShort)+'';var thead="";for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;thead+="=5?' class="ui-datepicker-week-end"':"")+'>'+dayNamesMin[day]+""}calender+=thead+"";var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==inst.selectedYear&&drawMonth==inst.selectedMonth){inst.selectedDay=Math.min(inst.selectedDay,daysInMonth)}var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var numRows=(isMultiMonth?6:Math.ceil((leadDays+daysInMonth)/7));var printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays));for(var dRow=0;dRow";var tbody="";for(var dow=0;dow<7;dow++){var daySettings=(beforeShowDay?beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,""]);var otherMonth=(printDate.getMonth()!=drawMonth);var unselectable=otherMonth||!daySettings[0]||(minDate&&printDatemaxDate);tbody+='";printDate.setDate(printDate.getDate()+1);printDate=this._daylightSavingAdjust(printDate)}calender+=tbody+""}drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++}calender+="
=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" "+this._currentClass:"")+(printDate.getTime()==today.getTime()?" ui-datepicker-today":""))+'"'+((!otherMonth||showOtherMonths)&&daySettings[2]?' title="'+daySettings[2]+'"':"")+(unselectable?"":" onclick=\"DP_jQuery.datepicker._selectDay('#"+inst.id+"',"+drawMonth+","+drawYear+', this);return false;"')+">"+(otherMonth?(showOtherMonths?printDate.getDate():" "):(unselectable?''+printDate.getDate()+"":'=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" ui-state-active":"")+'" href="#">'+printDate.getDate()+""))+"
"+(isMultiMonth?""+((numMonths[0]>0&&col==numMonths[1]-1)?'
':""):"");group+=calender}html+=group}html+=buttonPanel+($.browser.msie&&parseInt($.browser.version,10)<7&&!inst.inline?'':"");inst._keyEvent=false;return html},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,secondary,monthNames,monthNamesShort){minDate=(inst.rangeStart&&minDate&&selectedDate "}else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);monthHtml+='"}if(!showMonthAfterYear){html+=monthHtml+((secondary||changeMonth||changeYear)&&(!(changeMonth&&changeYear))?" ":"")}if(secondary||!changeYear){html+=''+drawYear+""}else{var years=this._get(inst,"yearRange").split(":");var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;endYear=drawYear+10}else{if(years[0].charAt(0)=="+"||years[0].charAt(0)=="-"){year=drawYear+parseInt(years[0],10);endYear=drawYear+parseInt(years[1],10)}else{year=parseInt(years[0],10);endYear=parseInt(years[1],10)}}year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+='"}if(showMonthAfterYear){html+=(secondary||changeMonth||changeYear?" ":"")+monthHtml}html+="";return html},_adjustInstDate:function(inst,offset,period){var year=inst.drawYear+(period=="Y"?offset:0);var month=inst.drawMonth+(period=="M"?offset:0);var day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+(period=="D"?offset:0);var date=this._daylightSavingAdjust(new Date(year,month,day));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&datemaxDate?maxDate:date);inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();if(period=="M"||period=="Y"){this._notifyChange(inst)}},_notifyChange:function(inst){var onChange=this._get(inst,"onChangeMonthYear");if(onChange){onChange.apply((inst.input?inst.input[0]:null),[inst.selectedYear,inst.selectedMonth+1,inst])}},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,"numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths=="number"?[1,numMonths]:numMonths))},_getMinMaxDate:function(inst,minMax,checkRange){var date=this._determineDate(this._get(inst,minMax+"Date"),null);return(!checkRange||!inst.rangeStart?date:(!date||inst.rangeStart>date?inst.rangeStart:date))},_getDaysInMonth:function(year,month){return 32-new Date(year,month,32).getDate()},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst);var date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:numMonths[1]),1));if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()))}return this._isInRange(inst,date)},_isInRange:function(inst,date){var newMinDate=(!inst.rangeStart?null:this._daylightSavingAdjust(new Date(inst.selectedYear,inst.selectedMonth,inst.selectedDay)));newMinDate=(newMinDate&&inst.rangeStart=minDate)&&(!maxDate||date<=maxDate))},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,"dayNamesShort"),dayNames:this._get(inst,"dayNames"),monthNamesShort:this._get(inst,"monthNamesShort"),monthNames:this._get(inst,"monthNames")}},_formatDate:function(inst,day,month,year){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear}var date=(day?(typeof day=="object"?day:this._daylightSavingAdjust(new Date(year,month,day))):this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return this.formatDate(this._get(inst,"dateFormat"),date,this._getFormatConfig(inst))}});function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null||props[name]==undefined){target[name]=props[name]}}return target}function isArray(a){return(a&&(($.browser.safari&&typeof a=="object"&&a.length)||(a.constructor&&a.constructor.toString().match(/\Array\(\)/))))}$.fn.datepicker=function(options){if(!$.datepicker.initialized){$(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv);$.datepicker.initialized=true}var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=="string"&&(options=="isDisabled"||options=="getDate")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}if(options=="option"&&arguments.length==2&&typeof arguments[1]=="string"){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}return this.each(function(){typeof options=="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)})};$.datepicker=new Datepicker();$.datepicker.initialized=false;$.datepicker.uuid=new Date().getTime();$.datepicker.version="1.7.3";window.DP_jQuery=$})(jQuery);; -/* - * jquery.qtip. The jQuery tooltip plugin - * - * Copyright (c) 2009 Craig Thompson - * http://craigsworks.com - * - * Licensed under MIT - * http://www.opensource.org/licenses/mit-license.php - * - * Launch : February 2009 - * Version : 1.0.0-rc3 - * Released: Tuesday 12th May, 2009 - 00:00 - * Debug: jquery.qtip.debug.js - */ + */ +(function($){$.extend($.ui,{datepicker:{version:"1.7.3"}});var PROP_NAME="datepicker";function Datepicker(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass="ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],dateFormat:"mm/dd/yy",firstDay:0,isRTL:false};this._defaults={showOn:"focus",showAnim:"show",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,showMonthAfterYear:false,yearRange:"-10:+10",showOtherMonths:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"normal",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false};$.extend(this._defaults,this.regional[""]);this.dpDiv=$('
')}$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",log:function(){if(this.debug){console.log.apply("",arguments)}},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase();var inline=(nodeName=="div"||nodeName=="span");if(!target.id){target.id="dp"+(++this.uuid)}var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{});if(nodeName=="input"){this._connectDatepicker(target,inst)}else{if(inline){this._inlineDatepicker(target,inst)}}},_newInst:function(target,inline){var id=target[0].id.replace(/([:\[\]\.])/g,"\\\\$1");return{id:id,input:target,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:inline,dpDiv:(!inline?this.dpDiv:$('
'))}},_connectDatepicker:function(target,inst){var input=$(target);inst.append=$([]);inst.trigger=$([]);if(input.hasClass(this.markerClassName)){return}var appendText=this._get(inst,"appendText");var isRTL=this._get(inst,"isRTL");if(appendText){inst.append=$(''+appendText+"");input[isRTL?"before":"after"](inst.append)}var showOn=this._get(inst,"showOn");if(showOn=="focus"||showOn=="both"){input.focus(this._showDatepicker)}if(showOn=="button"||showOn=="both"){var buttonText=this._get(inst,"buttonText");var buttonImage=this._get(inst,"buttonImage");inst.trigger=$(this._get(inst,"buttonImageOnly")?$("").addClass(this._triggerClass).attr({src:buttonImage,alt:buttonText,title:buttonText}):$('').addClass(this._triggerClass).html(buttonImage==""?buttonText:$("").attr({src:buttonImage,alt:buttonText,title:buttonText})));input[isRTL?"before":"after"](inst.trigger);inst.trigger.click(function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput==target){$.datepicker._hideDatepicker()}else{$.datepicker._showDatepicker(target)}return false})}input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst)},_inlineDatepicker:function(target,inst){var divSpan=$(target);if(divSpan.hasClass(this.markerClassName)){return}divSpan.addClass(this.markerClassName).append(inst.dpDiv).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst);this._setDate(inst,this._getDefaultDate(inst));this._updateDatepicker(inst);this._updateAlternate(inst)},_dialogDatepicker:function(input,dateText,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){var id="dp"+(++this.uuid);this._dialogInput=$('');this._dialogInput.keydown(this._doKeyDown);$("body").append(this._dialogInput);inst=this._dialogInst=this._newInst(this._dialogInput,false);inst.settings={};$.data(this._dialogInput[0],PROP_NAME,inst)}extendRemove(inst.settings,settings||{});this._dialogInput.val(dateText);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){var browserWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(browserWidth/2)-100+scrollX,(browserHeight/2)-150+scrollY]}this._dialogInput.css("left",this._pos[0]+"px").css("top",this._pos[1]+"px");inst.settings.onSelect=onSelect;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if($.blockUI){$.blockUI(this.dpDiv)}$.data(this._dialogInput[0],PROP_NAME,inst);return this},_destroyDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();$.removeData(target,PROP_NAME);if(nodeName=="input"){inst.append.remove();inst.trigger.remove();$target.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress)}else{if(nodeName=="div"||nodeName=="span"){$target.removeClass(this.markerClassName).empty()}}},_enableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=false;inst.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().removeClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)})},_disableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=true;inst.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().addClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)});this._disabledInputs[this._disabledInputs.length]=target},_isDisabledDatepicker:function(target){if(!target){return false}for(var i=0;i-1)}},_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!="input"){input=$("input",input.parentNode)[0]}if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput==input){return}var inst=$.datepicker._getInst(input);var beforeShow=$.datepicker._get(inst,"beforeShow");extendRemove(inst.settings,(beforeShow?beforeShow.apply(input,[input,inst]):{}));$.datepicker._hideDatepicker(null,"");$.datepicker._lastInput=input;$.datepicker._setDateFromField(inst);if($.datepicker._inDialog){input.value=""}if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight}var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css("position")=="fixed";return !isFixed});if(isFixed&&$.browser.opera){$.datepicker._pos[0]-=document.documentElement.scrollLeft;$.datepicker._pos[1]-=document.documentElement.scrollTop}var offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null;inst.rangeStart=null;inst.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});$.datepicker._updateDatepicker(inst);offset=$.datepicker._checkOffset(inst,offset,isFixed);inst.dpDiv.css({position:($.datepicker._inDialog&&$.blockUI?"static":(isFixed?"fixed":"absolute")),display:"none",left:offset.left+"px",top:offset.top+"px"});if(!inst.inline){var showAnim=$.datepicker._get(inst,"showAnim")||"show";var duration=$.datepicker._get(inst,"duration");var postProcess=function(){$.datepicker._datepickerShowing=true;if($.browser.msie&&parseInt($.browser.version,10)<7){$("iframe.ui-datepicker-cover").css({width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4})}};if($.effects&&$.effects[showAnim]){inst.dpDiv.show(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[showAnim](duration,postProcess)}if(duration==""){postProcess()}if(inst.input[0].type!="hidden"){inst.input[0].focus()}$.datepicker._curInst=inst}},_updateDatepicker:function(inst){var dims={width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4};var self=this;inst.dpDiv.empty().append(this._generateHTML(inst)).find("iframe.ui-datepicker-cover").css({width:dims.width,height:dims.height}).end().find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){$(this).removeClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).removeClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).removeClass("ui-datepicker-next-hover")}}).bind("mouseover",function(){if(!self._isDisabledDatepicker(inst.inline?inst.dpDiv.parent()[0]:inst.input[0])){$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");$(this).addClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).addClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).addClass("ui-datepicker-next-hover")}}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();var numMonths=this._getNumberOfMonths(inst);var cols=numMonths[1];var width=17;if(cols>1){inst.dpDiv.addClass("ui-datepicker-multi-"+cols).css("width",(width*cols)+"em")}else{inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("")}inst.dpDiv[(numMonths[0]!=1||numMonths[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");inst.dpDiv[(this._get(inst,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(inst.input&&inst.input[0].type!="hidden"&&inst==$.datepicker._curInst){$(inst.input[0]).focus()}},_checkOffset:function(inst,offset,isFixed){var dpWidth=inst.dpDiv.outerWidth();var dpHeight=inst.dpDiv.outerHeight();var inputWidth=inst.input?inst.input.outerWidth():0;var inputHeight=inst.input?inst.input.outerHeight():0;var viewWidth=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)+$(document).scrollLeft();var viewHeight=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)+$(document).scrollTop();offset.left-=(this._get(inst,"isRTL")?(dpWidth-inputWidth):0);offset.left-=(isFixed&&offset.left==inst.input.offset().left)?$(document).scrollLeft():0;offset.top-=(isFixed&&offset.top==(inst.input.offset().top+inputHeight))?$(document).scrollTop():0;offset.left-=(offset.left+dpWidth>viewWidth&&viewWidth>dpWidth)?Math.abs(offset.left+dpWidth-viewWidth):0;offset.top-=(offset.top+dpHeight>viewHeight&&viewHeight>dpHeight)?Math.abs(offset.top+dpHeight+inputHeight*2-viewHeight):0;return offset},_findPos:function(obj){while(obj&&(obj.type=="hidden"||obj.nodeType!=1)){obj=obj.nextSibling}var position=$(obj).offset();return[position.left,position.top]},_hideDatepicker:function(input,duration){var inst=this._curInst;if(!inst||(input&&inst!=$.data(input,PROP_NAME))){return}if(inst.stayOpen){this._selectDate("#"+inst.id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear))}inst.stayOpen=false;if(this._datepickerShowing){duration=(duration!=null?duration:this._get(inst,"duration"));var showAnim=this._get(inst,"showAnim");var postProcess=function(){$.datepicker._tidyDialog(inst)};if(duration!=""&&$.effects&&$.effects[showAnim]){inst.dpDiv.hide(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[(duration==""?"hide":(showAnim=="slideDown"?"slideUp":(showAnim=="fadeIn"?"fadeOut":"hide")))](duration,postProcess)}if(duration==""){this._tidyDialog(inst)}var onClose=this._get(inst,"onClose");if(onClose){onClose.apply((inst.input?inst.input[0]:null),[(inst.input?inst.input.val():""),inst])}this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if($.blockUI){$.unblockUI();$("body").append(this.dpDiv)}}this._inDialog=false}this._curInst=null},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(event){if(!$.datepicker._curInst){return}var $target=$(event.target);if(($target.parents("#"+$.datepicker._mainDivId).length==0)&&!$target.hasClass($.datepicker.markerClassName)&&!$target.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)){$.datepicker._hideDatepicker(null,"")}},_adjustDate:function(id,offset,period){var target=$(id);var inst=this._getInst(target[0]);if(this._isDisabledDatepicker(target[0])){return}this._adjustInstDate(inst,offset+(period=="M"?this._get(inst,"showCurrentAtPos"):0),period);this._updateDatepicker(inst)},_gotoToday:function(id){var target=$(id);var inst=this._getInst(target[0]);if(this._get(inst,"gotoCurrent")&&inst.currentDay){inst.selectedDay=inst.currentDay;inst.drawMonth=inst.selectedMonth=inst.currentMonth;inst.drawYear=inst.selectedYear=inst.currentYear}else{var date=new Date();inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear()}this._notifyChange(inst);this._adjustDate(target)},_selectMonthYear:function(id,select,period){var target=$(id);var inst=this._getInst(target[0]);inst._selectingMonthYear=false;inst["selected"+(period=="M"?"Month":"Year")]=inst["draw"+(period=="M"?"Month":"Year")]=parseInt(select.options[select.selectedIndex].value,10);this._notifyChange(inst);this._adjustDate(target)},_clickMonthYear:function(id){var target=$(id);var inst=this._getInst(target[0]);if(inst.input&&inst._selectingMonthYear&&!$.browser.msie){inst.input[0].focus()}inst._selectingMonthYear=!inst._selectingMonthYear},_selectDay:function(id,month,year,td){var target=$(id);if($(td).hasClass(this._unselectableClass)||this._isDisabledDatepicker(target[0])){return}var inst=this._getInst(target[0]);inst.selectedDay=inst.currentDay=$("a",td).html();inst.selectedMonth=inst.currentMonth=month;inst.selectedYear=inst.currentYear=year;if(inst.stayOpen){inst.endDay=inst.endMonth=inst.endYear=null}this._selectDate(id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear));if(inst.stayOpen){inst.rangeStart=this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay));this._updateDatepicker(inst)}},_clearDate:function(id){var target=$(id);var inst=this._getInst(target[0]);inst.stayOpen=false;inst.endDay=inst.endMonth=inst.endYear=inst.rangeStart=null;this._selectDate(target,"")},_selectDate:function(id,dateStr){var target=$(id);var inst=this._getInst(target[0]);dateStr=(dateStr!=null?dateStr:this._formatDate(inst));if(inst.input){inst.input.val(dateStr)}this._updateAlternate(inst);var onSelect=this._get(inst,"onSelect");if(onSelect){onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst])}else{if(inst.input){inst.input.trigger("change")}}if(inst.inline){this._updateDatepicker(inst)}else{if(!inst.stayOpen){this._hideDatepicker(null,this._get(inst,"duration"));this._lastInput=inst.input[0];if(typeof(inst.input[0])!="object"){inst.input[0].focus()}this._lastInput=null}}},_updateAlternate:function(inst){var altField=this._get(inst,"altField");if(altField){var altFormat=this._get(inst,"altFormat")||this._get(inst,"dateFormat");var date=this._getDate(inst);dateStr=this.formatDate(altFormat,date,this._getFormatConfig(inst));$(altField).each(function(){$(this).val(dateStr)})}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),""]},iso8601Week:function(date){var checkDate=new Date(date.getFullYear(),date.getMonth(),date.getDate());var firstMon=new Date(checkDate.getFullYear(),1-1,4);var firstDay=firstMon.getDay()||7;firstMon.setDate(firstMon.getDate()+1-firstDay);if(firstDay<4&&checkDatenew Date(checkDate.getFullYear(),12-1,28)){firstDay=new Date(checkDate.getFullYear()+1,1-1,4).getDay()||7;if(firstDay>4&&(checkDate.getDay()||7)0&&iValue="0"&&value.charAt(iValue)<="9"){num=num*10+parseInt(value.charAt(iValue++),10);size--}if(size==origSize){throw"Missing number at position "+iValue}return num};var getName=function(match,shortNames,longNames){var names=(lookAhead(match)?longNames:shortNames);var size=0;for(var j=0;j0&&iValue-1){month=1;day=doy;do{var dim=this._getDaysInMonth(year,month-1);if(day<=dim){break}month++;day-=dim}while(true)}var date=this._daylightSavingAdjust(new Date(year,month-1,day));if(date.getFullYear()!=year||date.getMonth()+1!=month||date.getDate()!=day){throw"Invalid date"}return date},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TIMESTAMP:"@",W3C:"yy-mm-dd",formatDate:function(format,date,settings){if(!date){return""}var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var lookAhead=function(match){var matches=(iFormat+1=0;m--){doy+=this._getDaysInMonth(date.getFullYear(),m)}output+=formatNumber("o",doy,3);break;case"m":output+=formatNumber("m",date.getMonth()+1,2);break;case"M":output+=formatName("M",date.getMonth(),monthNamesShort,monthNames);break;case"y":output+=(lookAhead("y")?date.getFullYear():(date.getYear()%100<10?"0":"")+date.getYear()%100);break;case"@":output+=date.getTime();break;case"'":if(lookAhead("'")){output+="'"}else{literal=true}break;default:output+=format.charAt(iFormat)}}}}return output},_possibleChars:function(format){var chars="";var literal=false;for(var iFormat=0;iFormatmaxDate?maxDate:date);return date},_determineDate:function(date,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date};var offsetString=function(offset,getDaysInMonth){var date=new Date();var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();var pattern=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;var matches=pattern.exec(offset);while(matches){switch(matches[2]||"d"){case"d":case"D":day+=parseInt(matches[1],10);break;case"w":case"W":day+=parseInt(matches[1],10)*7;break;case"m":case"M":month+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break;case"y":case"Y":year+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break}matches=pattern.exec(offset)}return new Date(year,month,day)};date=(date==null?defaultDate:(typeof date=="string"?offsetString(date,this._getDaysInMonth):(typeof date=="number"?(isNaN(date)?defaultDate:offsetNumeric(date)):date)));date=(date&&date.toString()=="Invalid Date"?defaultDate:date);if(date){date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0)}return this._daylightSavingAdjust(date)},_daylightSavingAdjust:function(date){if(!date){return null}date.setHours(date.getHours()>12?date.getHours()+2:0);return date},_setDate:function(inst,date,endDate){var clear=!(date);var origMonth=inst.selectedMonth;var origYear=inst.selectedYear;date=this._determineDate(date,new Date());inst.selectedDay=inst.currentDay=date.getDate();inst.drawMonth=inst.selectedMonth=inst.currentMonth=date.getMonth();inst.drawYear=inst.selectedYear=inst.currentYear=date.getFullYear();if(origMonth!=inst.selectedMonth||origYear!=inst.selectedYear){this._notifyChange(inst)}this._adjustInstDate(inst);if(inst.input){inst.input.val(clear?"":this._formatDate(inst))}},_getDate:function(inst){var startDate=(!inst.currentYear||(inst.input&&inst.input.val()=="")?null:this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return startDate},_generateHTML:function(inst){var today=new Date();today=this._daylightSavingAdjust(new Date(today.getFullYear(),today.getMonth(),today.getDate()));var isRTL=this._get(inst,"isRTL");var showButtonPanel=this._get(inst,"showButtonPanel");var hideIfNoPrevNext=this._get(inst,"hideIfNoPrevNext");var navigationAsDateFormat=this._get(inst,"navigationAsDateFormat");var numMonths=this._getNumberOfMonths(inst);var showCurrentAtPos=this._get(inst,"showCurrentAtPos");var stepMonths=this._get(inst,"stepMonths");var stepBigMonths=this._get(inst,"stepBigMonths");var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);var currentDate=this._daylightSavingAdjust((!inst.currentDay?new Date(9999,9,9):new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");var drawMonth=inst.drawMonth-showCurrentAtPos;var drawYear=inst.drawYear;if(drawMonth<0){drawMonth+=12;drawYear--}if(maxDate){var maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),maxDate.getMonth()-numMonths[1]+1,maxDate.getDate()));maxDraw=(minDate&&maxDrawmaxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--}}}inst.drawMonth=drawMonth;inst.drawYear=drawYear;var prevText=this._get(inst,"prevText");prevText=(!navigationAsDateFormat?prevText:this.formatDate(prevText,this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepMonths,1)),this._getFormatConfig(inst)));var prev=(this._canAdjustMonth(inst,-1,drawYear,drawMonth)?''+prevText+"":(hideIfNoPrevNext?"":''+prevText+""));var nextText=this._get(inst,"nextText");nextText=(!navigationAsDateFormat?nextText:this.formatDate(nextText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)),this._getFormatConfig(inst)));var next=(this._canAdjustMonth(inst,+1,drawYear,drawMonth)?''+nextText+"":(hideIfNoPrevNext?"":''+nextText+""));var currentText=this._get(inst,"currentText");var gotoDate=(this._get(inst,"gotoCurrent")&&inst.currentDay?currentDate:today);currentText=(!navigationAsDateFormat?currentText:this.formatDate(currentText,gotoDate,this._getFormatConfig(inst)));var controls=(!inst.inline?'":"");var buttonPanel=(showButtonPanel)?'
'+(isRTL?controls:"")+(this._isInRange(inst,gotoDate)?'":"")+(isRTL?"":controls)+"
":"";var firstDay=parseInt(this._get(inst,"firstDay"),10);firstDay=(isNaN(firstDay)?0:firstDay);var dayNames=this._get(inst,"dayNames");var dayNamesShort=this._get(inst,"dayNamesShort");var dayNamesMin=this._get(inst,"dayNamesMin");var monthNames=this._get(inst,"monthNames");var monthNamesShort=this._get(inst,"monthNamesShort");var beforeShowDay=this._get(inst,"beforeShowDay");var showOtherMonths=this._get(inst,"showOtherMonths");var calculateWeek=this._get(inst,"calculateWeek")||this.iso8601Week;var endDate=inst.endDay?this._daylightSavingAdjust(new Date(inst.endYear,inst.endMonth,inst.endDay)):currentDate;var defaultDate=this._getDefaultDate(inst);var html="";for(var row=0;row'+(/all|left/.test(cornerClass)&&row==0?(isRTL?next:prev):"")+(/all|right/.test(cornerClass)&&row==0?(isRTL?prev:next):"")+this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,row>0||col>0,monthNames,monthNamesShort)+'';var thead="";for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;thead+="=5?' class="ui-datepicker-week-end"':"")+'>'+dayNamesMin[day]+""}calender+=thead+"";var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==inst.selectedYear&&drawMonth==inst.selectedMonth){inst.selectedDay=Math.min(inst.selectedDay,daysInMonth)}var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var numRows=(isMultiMonth?6:Math.ceil((leadDays+daysInMonth)/7));var printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays));for(var dRow=0;dRow";var tbody="";for(var dow=0;dow<7;dow++){var daySettings=(beforeShowDay?beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,""]);var otherMonth=(printDate.getMonth()!=drawMonth);var unselectable=otherMonth||!daySettings[0]||(minDate&&printDatemaxDate);tbody+='";printDate.setDate(printDate.getDate()+1);printDate=this._daylightSavingAdjust(printDate)}calender+=tbody+""}drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++}calender+="
=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" "+this._currentClass:"")+(printDate.getTime()==today.getTime()?" ui-datepicker-today":""))+'"'+((!otherMonth||showOtherMonths)&&daySettings[2]?' title="'+daySettings[2]+'"':"")+(unselectable?"":" onclick=\"DP_jQuery.datepicker._selectDay('#"+inst.id+"',"+drawMonth+","+drawYear+', this);return false;"')+">"+(otherMonth?(showOtherMonths?printDate.getDate():" "):(unselectable?''+printDate.getDate()+"":'=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" ui-state-active":"")+'" href="#">'+printDate.getDate()+""))+"
"+(isMultiMonth?""+((numMonths[0]>0&&col==numMonths[1]-1)?'
':""):"");group+=calender}html+=group}html+=buttonPanel+($.browser.msie&&parseInt($.browser.version,10)<7&&!inst.inline?'':"");inst._keyEvent=false;return html},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,secondary,monthNames,monthNamesShort){minDate=(inst.rangeStart&&minDate&&selectedDate "}else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);monthHtml+='"}if(!showMonthAfterYear){html+=monthHtml+((secondary||changeMonth||changeYear)&&(!(changeMonth&&changeYear))?" ":"")}if(secondary||!changeYear){html+=''+drawYear+""}else{var years=this._get(inst,"yearRange").split(":");var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;endYear=drawYear+10}else{if(years[0].charAt(0)=="+"||years[0].charAt(0)=="-"){year=drawYear+parseInt(years[0],10);endYear=drawYear+parseInt(years[1],10)}else{year=parseInt(years[0],10);endYear=parseInt(years[1],10)}}year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+='"}if(showMonthAfterYear){html+=(secondary||changeMonth||changeYear?" ":"")+monthHtml}html+="";return html},_adjustInstDate:function(inst,offset,period){var year=inst.drawYear+(period=="Y"?offset:0);var month=inst.drawMonth+(period=="M"?offset:0);var day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+(period=="D"?offset:0);var date=this._daylightSavingAdjust(new Date(year,month,day));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&datemaxDate?maxDate:date);inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();if(period=="M"||period=="Y"){this._notifyChange(inst)}},_notifyChange:function(inst){var onChange=this._get(inst,"onChangeMonthYear");if(onChange){onChange.apply((inst.input?inst.input[0]:null),[inst.selectedYear,inst.selectedMonth+1,inst])}},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,"numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths=="number"?[1,numMonths]:numMonths))},_getMinMaxDate:function(inst,minMax,checkRange){var date=this._determineDate(this._get(inst,minMax+"Date"),null);return(!checkRange||!inst.rangeStart?date:(!date||inst.rangeStart>date?inst.rangeStart:date))},_getDaysInMonth:function(year,month){return 32-new Date(year,month,32).getDate()},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst);var date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:numMonths[1]),1));if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()))}return this._isInRange(inst,date)},_isInRange:function(inst,date){var newMinDate=(!inst.rangeStart?null:this._daylightSavingAdjust(new Date(inst.selectedYear,inst.selectedMonth,inst.selectedDay)));newMinDate=(newMinDate&&inst.rangeStart=minDate)&&(!maxDate||date<=maxDate))},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,"dayNamesShort"),dayNames:this._get(inst,"dayNames"),monthNamesShort:this._get(inst,"monthNamesShort"),monthNames:this._get(inst,"monthNames")}},_formatDate:function(inst,day,month,year){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear}var date=(day?(typeof day=="object"?day:this._daylightSavingAdjust(new Date(year,month,day))):this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return this.formatDate(this._get(inst,"dateFormat"),date,this._getFormatConfig(inst))}});function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null||props[name]==undefined){target[name]=props[name]}}return target}function isArray(a){return(a&&(($.browser.safari&&typeof a=="object"&&a.length)||(a.constructor&&a.constructor.toString().match(/\Array\(\)/))))}$.fn.datepicker=function(options){if(!$.datepicker.initialized){$(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv);$.datepicker.initialized=true}var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=="string"&&(options=="isDisabled"||options=="getDate")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}if(options=="option"&&arguments.length==2&&typeof arguments[1]=="string"){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}return this.each(function(){typeof options=="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)})};$.datepicker=new Datepicker();$.datepicker.initialized=false;$.datepicker.uuid=new Date().getTime();$.datepicker.version="1.7.3";window.DP_jQuery=$})(jQuery);; +/* + * jquery.qtip. The jQuery tooltip plugin + * + * Copyright (c) 2009 Craig Thompson + * http://craigsworks.com + * + * Licensed under MIT + * http://www.opensource.org/licenses/mit-license.php + * + * Launch : February 2009 + * Version : 1.0.0-rc3 + * Released: Tuesday 12th May, 2009 - 00:00 + * Debug: jquery.qtip.debug.js + */ (function(f){f.fn.qtip=function(B,u){var y,t,A,s,x,w,v,z;if(typeof B=="string"){if(typeof f(this).data("qtip")!=="object"){f.fn.qtip.log.error.call(self,1,f.fn.qtip.constants.NO_TOOLTIP_PRESENT,false)}if(B=="api"){return f(this).data("qtip").interfaces[f(this).data("qtip").current]}else{if(B=="interfaces"){return f(this).data("qtip").interfaces}}}else{if(!B){B={}}if(typeof B.content!=="object"||(B.content.jquery&&B.content.length>0)){B.content={text:B.content}}if(typeof B.content.title!=="object"){B.content.title={text:B.content.title}}if(typeof B.position!=="object"){B.position={corner:B.position}}if(typeof B.position.corner!=="object"){B.position.corner={target:B.position.corner,tooltip:B.position.corner}}if(typeof B.show!=="object"){B.show={when:B.show}}if(typeof B.show.when!=="object"){B.show.when={event:B.show.when}}if(typeof B.show.effect!=="object"){B.show.effect={type:B.show.effect}}if(typeof B.hide!=="object"){B.hide={when:B.hide}}if(typeof B.hide.when!=="object"){B.hide.when={event:B.hide.when}}if(typeof B.hide.effect!=="object"){B.hide.effect={type:B.hide.effect}}if(typeof B.style!=="object"){B.style={name:B.style}}B.style=c(B.style);s=f.extend(true,{},f.fn.qtip.defaults,B);s.style=a.call({options:s},s.style);s.user=f.extend(true,{},B)}return f(this).each(function(){if(typeof B=="string"){w=B.toLowerCase();A=f(this).qtip("interfaces");if(typeof A=="object"){if(u===true&&w=="destroy"){while(A.length>0){A[A.length-1].destroy()}}else{if(u!==true){A=[f(this).qtip("api")]}for(y=0;y0))}if(typeof s.options.show.solo=="object"){z=f(s.options.show.solo)}else{if(s.options.show.solo===true){z=f("div.qtip").not(s.elements.tooltip)}}if(z){z.each(function(){if(f(this).qtip("api").status.rendered===true){f(this).qtip("api").hide()}})}if(typeof s.options.show.effect.type=="function"){s.options.show.effect.type.call(s.elements.tooltip,s.options.show.effect.length);s.elements.tooltip.queue(function(){w();f(this).dequeue()})}else{switch(s.options.show.effect.type.toLowerCase()){case"fade":s.elements.tooltip.fadeIn(s.options.show.effect.length,w);break;case"slide":s.elements.tooltip.slideDown(s.options.show.effect.length,function(){w();if(s.options.position.type!=="static"){s.updatePosition(y,true)}});break;case"grow":s.elements.tooltip.show(s.options.show.effect.length,w);break;default:s.elements.tooltip.show(null,w);break}s.elements.tooltip.addClass(s.options.style.classes.active)}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_SHOWN,"show")},hide:function(y){var x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"hide")}else{if(s.elements.tooltip.css("display")==="none"){return s}}clearTimeout(s.timers.show);s.elements.tooltip.stop(true,false);x=s.beforeHide.call(s,y);if(x===false){return s}function w(){s.onHide.call(s,y)}s.cache.toggle=0;if(typeof s.options.hide.effect.type=="function"){s.options.hide.effect.type.call(s.elements.tooltip,s.options.hide.effect.length);s.elements.tooltip.queue(function(){w();f(this).dequeue()})}else{switch(s.options.hide.effect.type.toLowerCase()){case"fade":s.elements.tooltip.fadeOut(s.options.hide.effect.length,w);break;case"slide":s.elements.tooltip.slideUp(s.options.hide.effect.length,w);break;case"grow":s.elements.tooltip.hide(s.options.hide.effect.length,w);break;default:s.elements.tooltip.hide(null,w);break}s.elements.tooltip.removeClass(s.options.style.classes.active)}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_HIDDEN,"hide")},updatePosition:function(w,x){var C,G,L,J,H,E,y,I,B,D,K,A,F,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updatePosition")}else{if(s.options.position.type=="static"){return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.CANNOT_POSITION_STATIC,"updatePosition")}}G={position:{left:0,top:0},dimensions:{height:0,width:0},corner:s.options.position.corner.target};L={position:s.getPosition(),dimensions:s.getDimensions(),corner:s.options.position.corner.tooltip};if(s.options.position.target!=="mouse"){if(s.options.position.target.get(0).nodeName.toLowerCase()=="area"){J=s.options.position.target.attr("coords").split(",");for(C=0;CG.dimensions.width){G.dimensions.width=J[C]}if(J[C]G.dimensions.height){G.dimensions.height=J[C]}if(J[C]0){if(L.corner.search(/Left/)!==-1){y.left-=s.options.style.border.radius}else{if(L.corner.search(/Right/)!==-1){y.left+=s.options.style.border.radius}}if(L.corner.search(/Top/)!==-1){y.top-=s.options.style.border.radius}else{if(L.corner.search(/Bottom/)!==-1){y.top+=s.options.style.border.radius}}}if(I){if(L.corner.search(/top/)!==-1){y.top-=I}else{if(L.corner.search(/bottom/)!==-1){y.top+=I}}if(L.corner.search(/left/)!==-1){y.left-=I}else{if(L.corner.search(/right/)!==-1){y.left+=I}}if(L.corner.search(/leftMiddle|rightMiddle/)!==-1){y.top-=1}}if(s.options.position.adjust.screen===true){y=o.call(s,y,G,L)}if(s.options.position.target==="mouse"&&s.options.position.adjust.mouse===true){if(s.options.position.adjust.screen===true&&s.elements.tip){K=s.elements.tip.attr("rel")}else{K=s.options.position.corner.tooltip}y.left+=(K.search(/right/i)!==-1)?-6:6;y.top+=(K.search(/bottom/i)!==-1)?-6:6}if(!s.elements.bgiframe&&f.browser.msie&&parseInt(f.browser.version.charAt(0))==6){f("select, object").each(function(){A=f(this).offset();A.bottom=A.top+f(this).height();A.right=A.left+f(this).width();if(y.top+L.dimensions.height>=A.top&&y.left+L.dimensions.width>=A.left){k.call(s)}})}y.left+=s.options.position.adjust.x;y.top+=s.options.position.adjust.y;F=s.getPosition();if(y.left!=F.left||y.top!=F.top){z=s.beforePositionUpdate.call(s,w);if(z===false){return s}s.cache.position=y;if(x===true){s.status.animated=true;s.elements.tooltip.animate(y,200,"swing",function(){s.status.animated=false})}else{s.elements.tooltip.css(y)}s.onPositionUpdate.call(s,w);if(typeof w!=="undefined"&&w.type&&w.type!=="mousemove"){f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_POSITION_UPDATED,"updatePosition")}}return s},updateWidth:function(w){var x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateWidth")}else{if(w&&typeof w!=="number"){return f.fn.qtip.log.error.call(s,2,"newWidth must be of type number","updateWidth")}}x=s.elements.contentWrapper.siblings().add(s.elements.tip).add(s.elements.button);if(!w){if(typeof s.options.style.width.value=="number"){w=s.options.style.width.value}else{s.elements.tooltip.css({width:"auto"});x.hide();if(f.browser.msie){s.elements.wrapper.add(s.elements.contentWrapper.children()).css({zoom:"normal"})}w=s.getDimensions().width+1;if(!s.options.style.width.value){if(w>s.options.style.width.max){w=s.options.style.width.max}if(w").get(0).getContext){z=s.elements.tooltip.find(".qtip-tip canvas:first");x=z.get(0).getContext("2d");x.clearRect(0,0,300,300);y=z.parent("div[rel]:first").attr("rel");B=b(y,s.options.style.tip.size.width,s.options.style.tip.size.height);h.call(s,z,B,s.options.style.tip.color||s.options.style.border.color)}else{if(f.browser.msie){z=s.elements.tooltip.find('.qtip-tip [nodeName="shape"]');z.attr("fillcolor",s.options.style.tip.color||s.options.style.border.color)}}}if(s.options.style.border.radius>0){s.elements.tooltip.find(".qtip-betweenCorners").css({backgroundColor:s.options.style.border.color});if(f("").get(0).getContext){A=g(s.options.style.border.radius);s.elements.tooltip.find(".qtip-wrapper canvas").each(function(){x=f(this).get(0).getContext("2d");x.clearRect(0,0,300,300);y=f(this).parent("div[rel]:first").attr("rel");r.call(s,f(this),A[y],s.options.style.border.radius,s.options.style.border.color)})}else{if(f.browser.msie){s.elements.tooltip.find('.qtip-wrapper [nodeName="arc"]').each(function(){f(this).attr("fillcolor",s.options.style.border.color)})}}}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_STYLE_UPDATED,"updateStyle")},updateContent:function(A,y){var z,x,w;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateContent")}else{if(!A){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateContent")}}z=s.beforeContentUpdate.call(s,A);if(typeof z=="string"){A=z}else{if(z===false){return}}if(f.browser.msie){s.elements.contentWrapper.children().css({zoom:"normal"})}if(A.jquery&&A.length>0){A.clone(true).appendTo(s.elements.content).show()}else{s.elements.content.html(A)}x=s.elements.content.find("img[complete=false]");if(x.length>0){w=0;x.each(function(C){f('').load(function(){if(++w==x.length){B()}})})}else{B()}function B(){s.updateWidth();if(y!==false){if(s.options.position.type!=="static"){s.updatePosition(s.elements.tooltip.is(":visible"),true)}if(s.options.style.tip.corner!==false){n.call(s)}}}s.onContentUpdate.call(s);return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_CONTENT_UPDATED,"loadContent")},loadContent:function(w,z,A){var y;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"loadContent")}y=s.beforeContentLoad.call(s);if(y===false){return s}if(A=="post"){f.post(w,z,x)}else{f.get(w,z,x)}function x(B){s.onContentLoad.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_CONTENT_LOADED,"loadContent");s.updateContent(B)}return s},updateTitle:function(w){if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateTitle")}else{if(!w){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateTitle")}}returned=s.beforeTitleUpdate.call(s);if(returned===false){return s}if(s.elements.button){s.elements.button=s.elements.button.clone(true)}s.elements.title.html(w);if(s.elements.button){s.elements.title.prepend(s.elements.button)}s.onTitleUpdate.call(s);return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_TITLE_UPDATED,"updateTitle")},focus:function(A){var y,x,w,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"focus")}else{if(s.options.position.type=="static"){return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.CANNOT_FOCUS_STATIC,"focus")}}y=parseInt(s.elements.tooltip.css("z-index"));x=6000+f("div.qtip[qtip]").length-1;if(!s.status.focused&&y!==x){z=s.beforeFocus.call(s,A);if(z===false){return s}f("div.qtip[qtip]").not(s.elements.tooltip).each(function(){if(f(this).qtip("api").status.rendered===true){w=parseInt(f(this).css("z-index"));if(typeof w=="number"&&w>-1){f(this).css({zIndex:parseInt(f(this).css("z-index"))-1})}f(this).qtip("api").status.focused=false}});s.elements.tooltip.css({zIndex:x});s.status.focused=true;s.onFocus.call(s,A);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_FOCUSED,"focus")}return s},disable:function(w){if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"disable")}if(w){if(!s.status.disabled){s.status.disabled=true;f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_DISABLED,"disable")}else{f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.TOOLTIP_ALREADY_DISABLED,"disable")}}else{if(s.status.disabled){s.status.disabled=false;f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_ENABLED,"disable")}else{f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.TOOLTIP_ALREADY_ENABLED,"disable")}}return s},destroy:function(){var w,x,y;x=s.beforeDestroy.call(s);if(x===false){return s}if(s.status.rendered){s.options.show.when.target.unbind("mousemove.qtip",s.updatePosition);s.options.show.when.target.unbind("mouseout.qtip",s.hide);s.options.show.when.target.unbind(s.options.show.when.event+".qtip");s.options.hide.when.target.unbind(s.options.hide.when.event+".qtip");s.elements.tooltip.unbind(s.options.hide.when.event+".qtip");s.elements.tooltip.unbind("mouseover.qtip",s.focus);s.elements.tooltip.remove()}else{s.options.show.when.target.unbind(s.options.show.when.event+".qtip-create")}if(typeof s.elements.target.data("qtip")=="object"){y=s.elements.target.data("qtip").interfaces;if(typeof y=="object"&&y.length>0){for(w=0;w0){s.elements.target.data("qtip").current=y.length-1}else{s.elements.target.removeData("qtip")}s.onDestroy.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_DESTROYED,"destroy");return s.elements.target},getPosition:function(){var w,x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getPosition")}w=(s.elements.tooltip.css("display")!=="none")?false:true;if(w){s.elements.tooltip.css({visiblity:"hidden"}).show()}x=s.elements.tooltip.offset();if(w){s.elements.tooltip.css({visiblity:"visible"}).hide()}return x},getDimensions:function(){var w,x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getDimensions")}w=(!s.elements.tooltip.is(":visible"))?true:false;if(w){s.elements.tooltip.css({visiblity:"hidden"}).show()}x={height:s.elements.tooltip.outerHeight(),width:s.elements.tooltip.outerWidth()};if(w){s.elements.tooltip.css({visiblity:"visible"}).hide()}return x}})}function p(){var s,w,u,t,v,y,x;s=this;s.beforeRender.call(s);s.status.rendered=true;s.elements.tooltip='';s.elements.tooltip=f(s.elements.tooltip);s.elements.tooltip.appendTo(s.options.position.container);s.elements.tooltip.data("qtip",{current:0,interfaces:[s]});s.elements.wrapper=s.elements.tooltip.children("div:first");s.elements.contentWrapper=s.elements.wrapper.children("div:first").css({background:s.options.style.background});s.elements.content=s.elements.contentWrapper.children("div:first").css(q(s.options.style));if(f.browser.msie){s.elements.wrapper.add(s.elements.content).css({zoom:1})}if(s.options.hide.when.event=="unfocus"){s.elements.tooltip.attr("unfocus",true)}if(typeof s.options.style.width.value=="number"){s.updateWidth()}if(f("").get(0).getContext||f.browser.msie){if(s.options.style.border.radius>0){m.call(s)}else{s.elements.contentWrapper.css({border:s.options.style.border.width+"px solid "+s.options.style.border.color})}if(s.options.style.tip.corner!==false){e.call(s)}}else{s.elements.contentWrapper.css({border:s.options.style.border.width+"px solid "+s.options.style.border.color});s.options.style.border.radius=0;s.options.style.tip.corner=false;f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.CANVAS_VML_NOT_SUPPORTED,"render")}if((typeof s.options.content.text=="string"&&s.options.content.text.length>0)||(s.options.content.text.jquery&&s.options.content.text.length>0)){u=s.options.content.text}else{if(typeof s.elements.target.attr("title")=="string"&&s.elements.target.attr("title").length>0){u=s.elements.target.attr("title").replace("\\n","
");s.elements.target.attr("title","")}else{if(typeof s.elements.target.attr("alt")=="string"&&s.elements.target.attr("alt").length>0){u=s.elements.target.attr("alt").replace("\\n","
");s.elements.target.attr("alt","")}else{u=" ";f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.NO_VALID_CONTENT,"render")}}}if(s.options.content.title.text!==false){j.call(s)}s.updateContent(u);l.call(s);if(s.options.show.ready===true){s.show()}if(s.options.content.url!==false){t=s.options.content.url;v=s.options.content.data;y=s.options.content.method||"get";s.loadContent(t,v,y)}s.onRender.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_RENDERED,"render")}function m(){var F,z,t,B,x,E,u,G,D,y,w,C,A,s,v;F=this;F.elements.wrapper.find(".qtip-borderBottom, .qtip-borderTop").remove();t=F.options.style.border.width;B=F.options.style.border.radius;x=F.options.style.border.color||F.options.style.tip.color;E=g(B);u={};for(z in E){u[z]='
';if(f("").get(0).getContext){u[z]+=''}else{if(f.browser.msie){G=B*2+3;u[z]+=''}}u[z]+="
"}D=F.getDimensions().width-(Math.max(t,B)*2);y='
';w='
'+u.topLeft+u.topRight+y;F.elements.wrapper.prepend(w);C='
'+u.bottomLeft+u.bottomRight+y;F.elements.wrapper.append(C);if(f("").get(0).getContext){F.elements.wrapper.find("canvas").each(function(){A=E[f(this).parent("[rel]:first").attr("rel")];r.call(F,f(this),A,B,x)})}else{if(f.browser.msie){F.elements.tooltip.append('')}}s=Math.max(B,(B+(t-B)));v=Math.max(t-B,0);F.elements.contentWrapper.css({border:"0px solid "+x,borderWidth:v+"px "+s+"px"})}function r(u,w,s,t){var v=u.get(0).getContext("2d");v.fillStyle=t;v.beginPath();v.arc(w[0],w[1],s,0,Math.PI*2,false);v.fill()}function e(v){var t,s,x,u,w;t=this;if(t.elements.tip!==null){t.elements.tip.remove()}s=t.options.style.tip.color||t.options.style.border.color;if(t.options.style.tip.corner===false){return}else{if(!v){v=t.options.style.tip.corner}}x=b(v,t.options.style.tip.size.width,t.options.style.tip.size.height);t.elements.tip='
';if(f("").get(0).getContext){t.elements.tip+=''}else{if(f.browser.msie){u=t.options.style.tip.size.width+","+t.options.style.tip.size.height;w="m"+x[0][0]+","+x[0][1];w+=" l"+x[1][0]+","+x[1][1];w+=" "+x[2][0]+","+x[2][1];w+=" xe";t.elements.tip+='';t.elements.tip+='';t.elements.contentWrapper.css("position","relative")}}t.elements.tooltip.prepend(t.elements.tip+"
");t.elements.tip=t.elements.tooltip.find("."+t.options.style.classes.tip).eq(0);if(f("").get(0).getContext){h.call(t,t.elements.tip.find("canvas:first"),x,s)}if(v.search(/top/)!==-1&&f.browser.msie&&parseInt(f.browser.version.charAt(0))===6){t.elements.tip.css({marginTop:-4})}n.call(t,v)}function h(t,v,s){var u=t.get(0).getContext("2d");u.fillStyle=s;u.beginPath();u.moveTo(v[0][0],v[0][1]);u.lineTo(v[1][0],v[1][1]);u.lineTo(v[2][0],v[2][1]);u.fill()}function n(u){var t,w,s,x,v;t=this;if(t.options.style.tip.corner===false||!t.elements.tip){return}if(!u){u=t.elements.tip.attr("rel")}w=positionAdjust=(f.browser.msie)?1:0;t.elements.tip.css(u.match(/left|right|top|bottom/)[0],0);if(u.search(/top|bottom/)!==-1){if(f.browser.msie){if(parseInt(f.browser.version.charAt(0))===6){positionAdjust=(u.search(/top/)!==-1)?-3:1}else{positionAdjust=(u.search(/top/)!==-1)?1:2}}if(u.search(/Middle/)!==-1){t.elements.tip.css({left:"50%",marginLeft:-(t.options.style.tip.size.width/2)})}else{if(u.search(/Left/)!==-1){t.elements.tip.css({left:t.options.style.border.radius-w})}else{if(u.search(/Right/)!==-1){t.elements.tip.css({right:t.options.style.border.radius+w})}}}if(u.search(/top/)!==-1){t.elements.tip.css({top:-positionAdjust})}else{t.elements.tip.css({bottom:positionAdjust})}}else{if(u.search(/left|right/)!==-1){if(f.browser.msie){positionAdjust=(parseInt(f.browser.version.charAt(0))===6)?1:((u.search(/left/)!==-1)?1:2)}if(u.search(/Middle/)!==-1){t.elements.tip.css({top:"50%",marginTop:-(t.options.style.tip.size.height/2)})}else{if(u.search(/Top/)!==-1){t.elements.tip.css({top:t.options.style.border.radius-w})}else{if(u.search(/Bottom/)!==-1){t.elements.tip.css({bottom:t.options.style.border.radius+w})}}}if(u.search(/left/)!==-1){t.elements.tip.css({left:-positionAdjust})}else{t.elements.tip.css({right:positionAdjust})}}}s="padding-"+u.match(/left|right|top|bottom/)[0];x=t.options.style.tip.size[(s.search(/left|right/)!==-1)?"width":"height"];t.elements.tooltip.css("padding",0);t.elements.tooltip.css(s,x);if(f.browser.msie&&parseInt(f.browser.version.charAt(0))==6){v=parseInt(t.elements.tip.css("margin-top"))||0;v+=parseInt(t.elements.content.css("margin-top"))||0;t.elements.tip.css({marginTop:v})}}function j(){var s=this;if(s.elements.title!==null){s.elements.title.remove()}s.elements.title=f('
').css(q(s.options.style.title,true)).css({zoom:(f.browser.msie)?1:0}).prependTo(s.elements.contentWrapper);if(s.options.content.title.text){s.updateTitle.call(s,s.options.content.title.text)}if(s.options.content.title.button!==false&&typeof s.options.content.title.button=="string"){s.elements.button=f('').css(q(s.options.style.button,true)).html(s.options.content.title.button).prependTo(s.elements.title).click(function(t){if(!s.status.disabled){s.hide(t)}})}}function l(){var t,v,u,s;t=this;v=t.options.show.when.target;u=t.options.hide.when.target;if(t.options.hide.fixed){u=u.add(t.elements.tooltip)}if(t.options.hide.when.event=="inactive"){s=["click","dblclick","mousedown","mouseup","mousemove","mouseout","mouseenter","mouseleave","mouseover"];function y(z){if(t.status.disabled===true){return}clearTimeout(t.timers.inactive);t.timers.inactive=setTimeout(function(){f(s).each(function(){u.unbind(this+".qtip-inactive");t.elements.content.unbind(this+".qtip-inactive")});t.hide(z)},t.options.hide.delay)}}else{if(t.options.hide.fixed===true){t.elements.tooltip.bind("mouseover.qtip",function(){if(t.status.disabled===true){return}clearTimeout(t.timers.hide)})}}function x(z){if(t.status.disabled===true){return}if(t.options.hide.when.event=="inactive"){f(s).each(function(){u.bind(this+".qtip-inactive",y);t.elements.content.bind(this+".qtip-inactive",y)});y()}clearTimeout(t.timers.show);clearTimeout(t.timers.hide);t.timers.show=setTimeout(function(){t.show(z)},t.options.show.delay)}function w(z){if(t.status.disabled===true){return}if(t.options.hide.fixed===true&&t.options.hide.when.event.search(/mouse(out|leave)/i)!==-1&&f(z.relatedTarget).parents("div.qtip[qtip]").length>0){z.stopPropagation();z.preventDefault();clearTimeout(t.timers.hide);return false}clearTimeout(t.timers.show);clearTimeout(t.timers.hide);t.elements.tooltip.stop(true,true);t.timers.hide=setTimeout(function(){t.hide(z)},t.options.hide.delay)}if((t.options.show.when.target.add(t.options.hide.when.target).length===1&&t.options.show.when.event==t.options.hide.when.event&&t.options.hide.when.event!=="inactive")||t.options.hide.when.event=="unfocus"){t.cache.toggle=0;v.bind(t.options.show.when.event+".qtip",function(z){if(t.cache.toggle==0){x(z)}else{w(z)}})}else{v.bind(t.options.show.when.event+".qtip",x);if(t.options.hide.when.event!=="inactive"){u.bind(t.options.hide.when.event+".qtip",w)}}if(t.options.position.type.search(/(fixed|absolute)/)!==-1){t.elements.tooltip.bind("mouseover.qtip",t.focus)}if(t.options.position.target==="mouse"&&t.options.position.type!=="static"){v.bind("mousemove.qtip",function(z){t.cache.mouse={x:z.pageX,y:z.pageY};if(t.status.disabled===false&&t.options.position.adjust.mouse===true&&t.options.position.type!=="static"&&t.elements.tooltip.css("display")!=="none"){t.updatePosition(z)}})}}function o(u,v,A){var z,s,x,y,t,w;z=this;if(A.corner=="center"){return v.position}s=f.extend({},u);y={x:false,y:false};t={left:(s.left=f.fn.qtip.cache.screen.width+f.fn.qtip.cache.screen.scroll.left),top:(s.top=f.fn.qtip.cache.screen.height+f.fn.qtip.cache.screen.scroll.top)};x={left:(t.left&&(A.corner.search(/right/i)!=-1||(A.corner.search(/right/i)==-1&&!t.right))),right:(t.right&&(A.corner.search(/left/i)!=-1||(A.corner.search(/left/i)==-1&&!t.left))),top:(t.top&&A.corner.search(/top/i)==-1),bottom:(t.bottom&&A.corner.search(/bottom/i)==-1)};if(x.left){if(z.options.position.target!=="mouse"){s.left=v.position.left+v.dimensions.width}else{s.left=z.cache.mouse.x}y.x="Left"}else{if(x.right){if(z.options.position.target!=="mouse"){s.left=v.position.left-A.dimensions.width}else{s.left=z.cache.mouse.x-A.dimensions.width}y.x="Right"}}if(x.top){if(z.options.position.target!=="mouse"){s.top=v.position.top+v.dimensions.height}else{s.top=z.cache.mouse.y}y.y="top"}else{if(x.bottom){if(z.options.position.target!=="mouse"){s.top=v.position.top-A.dimensions.height}else{s.top=z.cache.mouse.y-A.dimensions.height}y.y="bottom"}}if(s.left<0){s.left=u.left;y.x=false}if(s.top<0){s.top=u.top;y.y=false}if(z.options.style.tip.corner!==false){s.corner=new String(A.corner);if(y.x!==false){s.corner=s.corner.replace(/Left|Right|Middle/,y.x)}if(y.y!==false){s.corner=s.corner.replace(/top|bottom/,y.y)}if(s.corner!==z.elements.tip.attr("rel")){e.call(z,s.corner)}}return s}function q(u,t){var v,s;v=f.extend(true,{},u);for(s in v){if(t===true&&s.search(/(tip|classes)/i)!==-1){delete v[s]}else{if(!t&&s.search(/(width|border|tip|title|classes|user)/i)!==-1){delete v[s]}}}return v}function c(s){if(typeof s.tip!=="object"){s.tip={corner:s.tip}}if(typeof s.tip.size!=="object"){s.tip.size={width:s.tip.size,height:s.tip.size}}if(typeof s.border!=="object"){s.border={width:s.border}}if(typeof s.width!=="object"){s.width={value:s.width}}if(typeof s.width.max=="string"){s.width.max=parseInt(s.width.max.replace(/([0-9]+)/i,"$1"))}if(typeof s.width.min=="string"){s.width.min=parseInt(s.width.min.replace(/([0-9]+)/i,"$1"))}if(typeof s.tip.size.x=="number"){s.tip.size.width=s.tip.size.x;delete s.tip.size.x}if(typeof s.tip.size.y=="number"){s.tip.size.height=s.tip.size.y;delete s.tip.size.y}return s}function a(){var s,t,u,x,v,w;s=this;u=[true,{}];for(t=0;t0){v.tip.size.width+=1}if(v.tip.size.height%2>0){v.tip.size.height+=1}if(v.tip.corner===true){v.tip.corner=(s.options.position.corner.tooltip==="center")?false:s.options.position.corner.tooltip}return v}function b(v,u,t){var s={bottomRight:[[0,0],[u,t],[u,0]],bottomLeft:[[0,0],[u,0],[0,t]],topRight:[[0,t],[u,0],[u,t]],topLeft:[[0,0],[0,t],[u,t]],topMiddle:[[0,t],[u/2,0],[u,t]],bottomMiddle:[[0,0],[u,0],[u/2,t]],rightMiddle:[[0,0],[u,t/2],[0,t]],leftMiddle:[[u,0],[u,t],[0,t/2]]};s.leftTop=s.bottomRight;s.rightTop=s.bottomLeft;s.leftBottom=s.topRight;s.rightBottom=s.topLeft;return s[v]}function g(s){var t;if(f("").get(0).getContext){t={topLeft:[s,s],topRight:[0,s],bottomLeft:[s,0],bottomRight:[0,0]}}else{if(f.browser.msie){t={topLeft:[-90,90,0],topRight:[-90,90,-s],bottomLeft:[90,270,0],bottomRight:[90,270,-s]}}}return t}function k(){var s,t,u;s=this;u=s.getDimensions();t='':"");inst._keyEvent=false;return html},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,secondary,monthNames,monthNamesShort){minDate=(inst.rangeStart&&minDate&&selectedDate "}else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);monthHtml+='"}if(!showMonthAfterYear){html+=monthHtml+((secondary||changeMonth||changeYear)&&(!(changeMonth&&changeYear))?" ":"")}if(secondary||!changeYear){html+=''+drawYear+""}else{var years=this._get(inst,"yearRange").split(":");var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;endYear=drawYear+10}else{if(years[0].charAt(0)=="+"||years[0].charAt(0)=="-"){year=drawYear+parseInt(years[0],10);endYear=drawYear+parseInt(years[1],10)}else{year=parseInt(years[0],10);endYear=parseInt(years[1],10)}}year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+='"}if(showMonthAfterYear){html+=(secondary||changeMonth||changeYear?" ":"")+monthHtml}html+="
";return html},_adjustInstDate:function(inst,offset,period){var year=inst.drawYear+(period=="Y"?offset:0);var month=inst.drawMonth+(period=="M"?offset:0);var day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+(period=="D"?offset:0);var date=this._daylightSavingAdjust(new Date(year,month,day));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&datemaxDate?maxDate:date);inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();if(period=="M"||period=="Y"){this._notifyChange(inst)}},_notifyChange:function(inst){var onChange=this._get(inst,"onChangeMonthYear");if(onChange){onChange.apply((inst.input?inst.input[0]:null),[inst.selectedYear,inst.selectedMonth+1,inst])}},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,"numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths=="number"?[1,numMonths]:numMonths))},_getMinMaxDate:function(inst,minMax,checkRange){var date=this._determineDate(this._get(inst,minMax+"Date"),null);return(!checkRange||!inst.rangeStart?date:(!date||inst.rangeStart>date?inst.rangeStart:date))},_getDaysInMonth:function(year,month){return 32-new Date(year,month,32).getDate()},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst);var date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:numMonths[1]),1));if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()))}return this._isInRange(inst,date)},_isInRange:function(inst,date){var newMinDate=(!inst.rangeStart?null:this._daylightSavingAdjust(new Date(inst.selectedYear,inst.selectedMonth,inst.selectedDay)));newMinDate=(newMinDate&&inst.rangeStart=minDate)&&(!maxDate||date<=maxDate))},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,"dayNamesShort"),dayNames:this._get(inst,"dayNames"),monthNamesShort:this._get(inst,"monthNamesShort"),monthNames:this._get(inst,"monthNames")}},_formatDate:function(inst,day,month,year){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear}var date=(day?(typeof day=="object"?day:this._daylightSavingAdjust(new Date(year,month,day))):this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return this.formatDate(this._get(inst,"dateFormat"),date,this._getFormatConfig(inst))}});function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null||props[name]==undefined){target[name]=props[name]}}return target}function isArray(a){return(a&&(($.browser.safari&&typeof a=="object"&&a.length)||(a.constructor&&a.constructor.toString().match(/\Array\(\)/))))}$.fn.datepicker=function(options){if(!$.datepicker.initialized){$(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv);$.datepicker.initialized=true}var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=="string"&&(options=="isDisabled"||options=="getDate")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}if(options=="option"&&arguments.length==2&&typeof arguments[1]=="string"){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}return this.each(function(){typeof options=="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)})};$.datepicker=new Datepicker();$.datepicker.initialized=false;$.datepicker.uuid=new Date().getTime();$.datepicker.version="1.7.3";window.DP_jQuery=$})(jQuery);; -/* - * jquery.qtip. The jQuery tooltip plugin - * - * Copyright (c) 2009 Craig Thompson - * http://craigsworks.com - * - * Licensed under MIT - * http://www.opensource.org/licenses/mit-license.php - * - * Launch : February 2009 - * Version : 1.0.0-rc3 - * Released: Tuesday 12th May, 2009 - 00:00 - * Debug: jquery.qtip.debug.js - */ -(function(f){f.fn.qtip=function(B,u){var y,t,A,s,x,w,v,z;if(typeof B=="string"){if(typeof f(this).data("qtip")!=="object"){f.fn.qtip.log.error.call(self,1,f.fn.qtip.constants.NO_TOOLTIP_PRESENT,false)}if(B=="api"){return f(this).data("qtip").interfaces[f(this).data("qtip").current]}else{if(B=="interfaces"){return f(this).data("qtip").interfaces}}}else{if(!B){B={}}if(typeof B.content!=="object"||(B.content.jquery&&B.content.length>0)){B.content={text:B.content}}if(typeof B.content.title!=="object"){B.content.title={text:B.content.title}}if(typeof B.position!=="object"){B.position={corner:B.position}}if(typeof B.position.corner!=="object"){B.position.corner={target:B.position.corner,tooltip:B.position.corner}}if(typeof B.show!=="object"){B.show={when:B.show}}if(typeof B.show.when!=="object"){B.show.when={event:B.show.when}}if(typeof B.show.effect!=="object"){B.show.effect={type:B.show.effect}}if(typeof B.hide!=="object"){B.hide={when:B.hide}}if(typeof B.hide.when!=="object"){B.hide.when={event:B.hide.when}}if(typeof B.hide.effect!=="object"){B.hide.effect={type:B.hide.effect}}if(typeof B.style!=="object"){B.style={name:B.style}}B.style=c(B.style);s=f.extend(true,{},f.fn.qtip.defaults,B);s.style=a.call({options:s},s.style);s.user=f.extend(true,{},B)}return f(this).each(function(){if(typeof B=="string"){w=B.toLowerCase();A=f(this).qtip("interfaces");if(typeof A=="object"){if(u===true&&w=="destroy"){while(A.length>0){A[A.length-1].destroy()}}else{if(u!==true){A=[f(this).qtip("api")]}for(y=0;y0))}if(typeof s.options.show.solo=="object"){z=f(s.options.show.solo)}else{if(s.options.show.solo===true){z=f("div.qtip").not(s.elements.tooltip)}}if(z){z.each(function(){if(f(this).qtip("api").status.rendered===true){f(this).qtip("api").hide()}})}if(typeof s.options.show.effect.type=="function"){s.options.show.effect.type.call(s.elements.tooltip,s.options.show.effect.length);s.elements.tooltip.queue(function(){w();f(this).dequeue()})}else{switch(s.options.show.effect.type.toLowerCase()){case"fade":s.elements.tooltip.fadeIn(s.options.show.effect.length,w);break;case"slide":s.elements.tooltip.slideDown(s.options.show.effect.length,function(){w();if(s.options.position.type!=="static"){s.updatePosition(y,true)}});break;case"grow":s.elements.tooltip.show(s.options.show.effect.length,w);break;default:s.elements.tooltip.show(null,w);break}s.elements.tooltip.addClass(s.options.style.classes.active)}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_SHOWN,"show")},hide:function(y){var x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"hide")}else{if(s.elements.tooltip.css("display")==="none"){return s}}clearTimeout(s.timers.show);s.elements.tooltip.stop(true,false);x=s.beforeHide.call(s,y);if(x===false){return s}function w(){s.onHide.call(s,y)}s.cache.toggle=0;if(typeof s.options.hide.effect.type=="function"){s.options.hide.effect.type.call(s.elements.tooltip,s.options.hide.effect.length);s.elements.tooltip.queue(function(){w();f(this).dequeue()})}else{switch(s.options.hide.effect.type.toLowerCase()){case"fade":s.elements.tooltip.fadeOut(s.options.hide.effect.length,w);break;case"slide":s.elements.tooltip.slideUp(s.options.hide.effect.length,w);break;case"grow":s.elements.tooltip.hide(s.options.hide.effect.length,w);break;default:s.elements.tooltip.hide(null,w);break}s.elements.tooltip.removeClass(s.options.style.classes.active)}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_HIDDEN,"hide")},updatePosition:function(w,x){var C,G,L,J,H,E,y,I,B,D,K,A,F,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updatePosition")}else{if(s.options.position.type=="static"){return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.CANNOT_POSITION_STATIC,"updatePosition")}}G={position:{left:0,top:0},dimensions:{height:0,width:0},corner:s.options.position.corner.target};L={position:s.getPosition(),dimensions:s.getDimensions(),corner:s.options.position.corner.tooltip};if(s.options.position.target!=="mouse"){if(s.options.position.target.get(0).nodeName.toLowerCase()=="area"){J=s.options.position.target.attr("coords").split(",");for(C=0;CG.dimensions.width){G.dimensions.width=J[C]}if(J[C]G.dimensions.height){G.dimensions.height=J[C]}if(J[C]0){if(L.corner.search(/Left/)!==-1){y.left-=s.options.style.border.radius}else{if(L.corner.search(/Right/)!==-1){y.left+=s.options.style.border.radius}}if(L.corner.search(/Top/)!==-1){y.top-=s.options.style.border.radius}else{if(L.corner.search(/Bottom/)!==-1){y.top+=s.options.style.border.radius}}}if(I){if(L.corner.search(/top/)!==-1){y.top-=I}else{if(L.corner.search(/bottom/)!==-1){y.top+=I}}if(L.corner.search(/left/)!==-1){y.left-=I}else{if(L.corner.search(/right/)!==-1){y.left+=I}}if(L.corner.search(/leftMiddle|rightMiddle/)!==-1){y.top-=1}}if(s.options.position.adjust.screen===true){y=o.call(s,y,G,L)}if(s.options.position.target==="mouse"&&s.options.position.adjust.mouse===true){if(s.options.position.adjust.screen===true&&s.elements.tip){K=s.elements.tip.attr("rel")}else{K=s.options.position.corner.tooltip}y.left+=(K.search(/right/i)!==-1)?-6:6;y.top+=(K.search(/bottom/i)!==-1)?-6:6}if(!s.elements.bgiframe&&f.browser.msie&&parseInt(f.browser.version.charAt(0))==6){f("select, object").each(function(){A=f(this).offset();A.bottom=A.top+f(this).height();A.right=A.left+f(this).width();if(y.top+L.dimensions.height>=A.top&&y.left+L.dimensions.width>=A.left){k.call(s)}})}y.left+=s.options.position.adjust.x;y.top+=s.options.position.adjust.y;F=s.getPosition();if(y.left!=F.left||y.top!=F.top){z=s.beforePositionUpdate.call(s,w);if(z===false){return s}s.cache.position=y;if(x===true){s.status.animated=true;s.elements.tooltip.animate(y,200,"swing",function(){s.status.animated=false})}else{s.elements.tooltip.css(y)}s.onPositionUpdate.call(s,w);if(typeof w!=="undefined"&&w.type&&w.type!=="mousemove"){f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_POSITION_UPDATED,"updatePosition")}}return s},updateWidth:function(w){var x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateWidth")}else{if(w&&typeof w!=="number"){return f.fn.qtip.log.error.call(s,2,"newWidth must be of type number","updateWidth")}}x=s.elements.contentWrapper.siblings().add(s.elements.tip).add(s.elements.button);if(!w){if(typeof s.options.style.width.value=="number"){w=s.options.style.width.value}else{s.elements.tooltip.css({width:"auto"});x.hide();if(f.browser.msie){s.elements.wrapper.add(s.elements.contentWrapper.children()).css({zoom:"normal"})}w=s.getDimensions().width+1;if(!s.options.style.width.value){if(w>s.options.style.width.max){w=s.options.style.width.max}if(w").get(0).getContext){z=s.elements.tooltip.find(".qtip-tip canvas:first");x=z.get(0).getContext("2d");x.clearRect(0,0,300,300);y=z.parent("div[rel]:first").attr("rel");B=b(y,s.options.style.tip.size.width,s.options.style.tip.size.height);h.call(s,z,B,s.options.style.tip.color||s.options.style.border.color)}else{if(f.browser.msie){z=s.elements.tooltip.find('.qtip-tip [nodeName="shape"]');z.attr("fillcolor",s.options.style.tip.color||s.options.style.border.color)}}}if(s.options.style.border.radius>0){s.elements.tooltip.find(".qtip-betweenCorners").css({backgroundColor:s.options.style.border.color});if(f("").get(0).getContext){A=g(s.options.style.border.radius);s.elements.tooltip.find(".qtip-wrapper canvas").each(function(){x=f(this).get(0).getContext("2d");x.clearRect(0,0,300,300);y=f(this).parent("div[rel]:first").attr("rel");r.call(s,f(this),A[y],s.options.style.border.radius,s.options.style.border.color)})}else{if(f.browser.msie){s.elements.tooltip.find('.qtip-wrapper [nodeName="arc"]').each(function(){f(this).attr("fillcolor",s.options.style.border.color)})}}}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_STYLE_UPDATED,"updateStyle")},updateContent:function(A,y){var z,x,w;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateContent")}else{if(!A){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateContent")}}z=s.beforeContentUpdate.call(s,A);if(typeof z=="string"){A=z}else{if(z===false){return}}if(f.browser.msie){s.elements.contentWrapper.children().css({zoom:"normal"})}if(A.jquery&&A.length>0){A.clone(true).appendTo(s.elements.content).show()}else{s.elements.content.html(A)}x=s.elements.content.find("img[complete=false]");if(x.length>0){w=0;x.each(function(C){f('').load(function(){if(++w==x.length){B()}})})}else{B()}function B(){s.updateWidth();if(y!==false){if(s.options.position.type!=="static"){s.updatePosition(s.elements.tooltip.is(":visible"),true)}if(s.options.style.tip.corner!==false){n.call(s)}}}s.onContentUpdate.call(s);return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_CONTENT_UPDATED,"loadContent")},loadContent:function(w,z,A){var y;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"loadContent")}y=s.beforeContentLoad.call(s);if(y===false){return s}if(A=="post"){f.post(w,z,x)}else{f.get(w,z,x)}function x(B){s.onContentLoad.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_CONTENT_LOADED,"loadContent");s.updateContent(B)}return s},updateTitle:function(w){if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateTitle")}else{if(!w){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateTitle")}}returned=s.beforeTitleUpdate.call(s);if(returned===false){return s}if(s.elements.button){s.elements.button=s.elements.button.clone(true)}s.elements.title.html(w);if(s.elements.button){s.elements.title.prepend(s.elements.button)}s.onTitleUpdate.call(s);return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_TITLE_UPDATED,"updateTitle")},focus:function(A){var y,x,w,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"focus")}else{if(s.options.position.type=="static"){return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.CANNOT_FOCUS_STATIC,"focus")}}y=parseInt(s.elements.tooltip.css("z-index"));x=6000+f("div.qtip[qtip]").length-1;if(!s.status.focused&&y!==x){z=s.beforeFocus.call(s,A);if(z===false){return s}f("div.qtip[qtip]").not(s.elements.tooltip).each(function(){if(f(this).qtip("api").status.rendered===true){w=parseInt(f(this).css("z-index"));if(typeof w=="number"&&w>-1){f(this).css({zIndex:parseInt(f(this).css("z-index"))-1})}f(this).qtip("api").status.focused=false}});s.elements.tooltip.css({zIndex:x});s.status.focused=true;s.onFocus.call(s,A);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_FOCUSED,"focus")}return s},disable:function(w){if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"disable")}if(w){if(!s.status.disabled){s.status.disabled=true;f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_DISABLED,"disable")}else{f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.TOOLTIP_ALREADY_DISABLED,"disable")}}else{if(s.status.disabled){s.status.disabled=false;f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_ENABLED,"disable")}else{f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.TOOLTIP_ALREADY_ENABLED,"disable")}}return s},destroy:function(){var w,x,y;x=s.beforeDestroy.call(s);if(x===false){return s}if(s.status.rendered){s.options.show.when.target.unbind("mousemove.qtip",s.updatePosition);s.options.show.when.target.unbind("mouseout.qtip",s.hide);s.options.show.when.target.unbind(s.options.show.when.event+".qtip");s.options.hide.when.target.unbind(s.options.hide.when.event+".qtip");s.elements.tooltip.unbind(s.options.hide.when.event+".qtip");s.elements.tooltip.unbind("mouseover.qtip",s.focus);s.elements.tooltip.remove()}else{s.options.show.when.target.unbind(s.options.show.when.event+".qtip-create")}if(typeof s.elements.target.data("qtip")=="object"){y=s.elements.target.data("qtip").interfaces;if(typeof y=="object"&&y.length>0){for(w=0;w0){s.elements.target.data("qtip").current=y.length-1}else{s.elements.target.removeData("qtip")}s.onDestroy.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_DESTROYED,"destroy");return s.elements.target},getPosition:function(){var w,x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getPosition")}w=(s.elements.tooltip.css("display")!=="none")?false:true;if(w){s.elements.tooltip.css({visiblity:"hidden"}).show()}x=s.elements.tooltip.offset();if(w){s.elements.tooltip.css({visiblity:"visible"}).hide()}return x},getDimensions:function(){var w,x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getDimensions")}w=(!s.elements.tooltip.is(":visible"))?true:false;if(w){s.elements.tooltip.css({visiblity:"hidden"}).show()}x={height:s.elements.tooltip.outerHeight(),width:s.elements.tooltip.outerWidth()};if(w){s.elements.tooltip.css({visiblity:"visible"}).hide()}return x}})}function p(){var s,w,u,t,v,y,x;s=this;s.beforeRender.call(s);s.status.rendered=true;s.elements.tooltip='';s.elements.tooltip=f(s.elements.tooltip);s.elements.tooltip.appendTo(s.options.position.container);s.elements.tooltip.data("qtip",{current:0,interfaces:[s]});s.elements.wrapper=s.elements.tooltip.children("div:first");s.elements.contentWrapper=s.elements.wrapper.children("div:first").css({background:s.options.style.background});s.elements.content=s.elements.contentWrapper.children("div:first").css(q(s.options.style));if(f.browser.msie){s.elements.wrapper.add(s.elements.content).css({zoom:1})}if(s.options.hide.when.event=="unfocus"){s.elements.tooltip.attr("unfocus",true)}if(typeof s.options.style.width.value=="number"){s.updateWidth()}if(f("").get(0).getContext||f.browser.msie){if(s.options.style.border.radius>0){m.call(s)}else{s.elements.contentWrapper.css({border:s.options.style.border.width+"px solid "+s.options.style.border.color})}if(s.options.style.tip.corner!==false){e.call(s)}}else{s.elements.contentWrapper.css({border:s.options.style.border.width+"px solid "+s.options.style.border.color});s.options.style.border.radius=0;s.options.style.tip.corner=false;f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.CANVAS_VML_NOT_SUPPORTED,"render")}if((typeof s.options.content.text=="string"&&s.options.content.text.length>0)||(s.options.content.text.jquery&&s.options.content.text.length>0)){u=s.options.content.text}else{if(typeof s.elements.target.attr("title")=="string"&&s.elements.target.attr("title").length>0){u=s.elements.target.attr("title").replace("\\n","
");s.elements.target.attr("title","")}else{if(typeof s.elements.target.attr("alt")=="string"&&s.elements.target.attr("alt").length>0){u=s.elements.target.attr("alt").replace("\\n","
");s.elements.target.attr("alt","")}else{u=" ";f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.NO_VALID_CONTENT,"render")}}}if(s.options.content.title.text!==false){j.call(s)}s.updateContent(u);l.call(s);if(s.options.show.ready===true){s.show()}if(s.options.content.url!==false){t=s.options.content.url;v=s.options.content.data;y=s.options.content.method||"get";s.loadContent(t,v,y)}s.onRender.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_RENDERED,"render")}function m(){var F,z,t,B,x,E,u,G,D,y,w,C,A,s,v;F=this;F.elements.wrapper.find(".qtip-borderBottom, .qtip-borderTop").remove();t=F.options.style.border.width;B=F.options.style.border.radius;x=F.options.style.border.color||F.options.style.tip.color;E=g(B);u={};for(z in E){u[z]='
';if(f("").get(0).getContext){u[z]+=''}else{if(f.browser.msie){G=B*2+3;u[z]+=''}}u[z]+="
"}D=F.getDimensions().width-(Math.max(t,B)*2);y='
';w='
'+u.topLeft+u.topRight+y;F.elements.wrapper.prepend(w);C='
'+u.bottomLeft+u.bottomRight+y;F.elements.wrapper.append(C);if(f("").get(0).getContext){F.elements.wrapper.find("canvas").each(function(){A=E[f(this).parent("[rel]:first").attr("rel")];r.call(F,f(this),A,B,x)})}else{if(f.browser.msie){F.elements.tooltip.append('')}}s=Math.max(B,(B+(t-B)));v=Math.max(t-B,0);F.elements.contentWrapper.css({border:"0px solid "+x,borderWidth:v+"px "+s+"px"})}function r(u,w,s,t){var v=u.get(0).getContext("2d");v.fillStyle=t;v.beginPath();v.arc(w[0],w[1],s,0,Math.PI*2,false);v.fill()}function e(v){var t,s,x,u,w;t=this;if(t.elements.tip!==null){t.elements.tip.remove()}s=t.options.style.tip.color||t.options.style.border.color;if(t.options.style.tip.corner===false){return}else{if(!v){v=t.options.style.tip.corner}}x=b(v,t.options.style.tip.size.width,t.options.style.tip.size.height);t.elements.tip='
';if(f("").get(0).getContext){t.elements.tip+=''}else{if(f.browser.msie){u=t.options.style.tip.size.width+","+t.options.style.tip.size.height;w="m"+x[0][0]+","+x[0][1];w+=" l"+x[1][0]+","+x[1][1];w+=" "+x[2][0]+","+x[2][1];w+=" xe";t.elements.tip+='';t.elements.tip+='';t.elements.contentWrapper.css("position","relative")}}t.elements.tooltip.prepend(t.elements.tip+"
");t.elements.tip=t.elements.tooltip.find("."+t.options.style.classes.tip).eq(0);if(f("").get(0).getContext){h.call(t,t.elements.tip.find("canvas:first"),x,s)}if(v.search(/top/)!==-1&&f.browser.msie&&parseInt(f.browser.version.charAt(0))===6){t.elements.tip.css({marginTop:-4})}n.call(t,v)}function h(t,v,s){var u=t.get(0).getContext("2d");u.fillStyle=s;u.beginPath();u.moveTo(v[0][0],v[0][1]);u.lineTo(v[1][0],v[1][1]);u.lineTo(v[2][0],v[2][1]);u.fill()}function n(u){var t,w,s,x,v;t=this;if(t.options.style.tip.corner===false||!t.elements.tip){return}if(!u){u=t.elements.tip.attr("rel")}w=positionAdjust=(f.browser.msie)?1:0;t.elements.tip.css(u.match(/left|right|top|bottom/)[0],0);if(u.search(/top|bottom/)!==-1){if(f.browser.msie){if(parseInt(f.browser.version.charAt(0))===6){positionAdjust=(u.search(/top/)!==-1)?-3:1}else{positionAdjust=(u.search(/top/)!==-1)?1:2}}if(u.search(/Middle/)!==-1){t.elements.tip.css({left:"50%",marginLeft:-(t.options.style.tip.size.width/2)})}else{if(u.search(/Left/)!==-1){t.elements.tip.css({left:t.options.style.border.radius-w})}else{if(u.search(/Right/)!==-1){t.elements.tip.css({right:t.options.style.border.radius+w})}}}if(u.search(/top/)!==-1){t.elements.tip.css({top:-positionAdjust})}else{t.elements.tip.css({bottom:positionAdjust})}}else{if(u.search(/left|right/)!==-1){if(f.browser.msie){positionAdjust=(parseInt(f.browser.version.charAt(0))===6)?1:((u.search(/left/)!==-1)?1:2)}if(u.search(/Middle/)!==-1){t.elements.tip.css({top:"50%",marginTop:-(t.options.style.tip.size.height/2)})}else{if(u.search(/Top/)!==-1){t.elements.tip.css({top:t.options.style.border.radius-w})}else{if(u.search(/Bottom/)!==-1){t.elements.tip.css({bottom:t.options.style.border.radius+w})}}}if(u.search(/left/)!==-1){t.elements.tip.css({left:-positionAdjust})}else{t.elements.tip.css({right:positionAdjust})}}}s="padding-"+u.match(/left|right|top|bottom/)[0];x=t.options.style.tip.size[(s.search(/left|right/)!==-1)?"width":"height"];t.elements.tooltip.css("padding",0);t.elements.tooltip.css(s,x);if(f.browser.msie&&parseInt(f.browser.version.charAt(0))==6){v=parseInt(t.elements.tip.css("margin-top"))||0;v+=parseInt(t.elements.content.css("margin-top"))||0;t.elements.tip.css({marginTop:v})}}function j(){var s=this;if(s.elements.title!==null){s.elements.title.remove()}s.elements.title=f('
').css(q(s.options.style.title,true)).css({zoom:(f.browser.msie)?1:0}).prependTo(s.elements.contentWrapper);if(s.options.content.title.text){s.updateTitle.call(s,s.options.content.title.text)}if(s.options.content.title.button!==false&&typeof s.options.content.title.button=="string"){s.elements.button=f('').css(q(s.options.style.button,true)).html(s.options.content.title.button).prependTo(s.elements.title).click(function(t){if(!s.status.disabled){s.hide(t)}})}}function l(){var t,v,u,s;t=this;v=t.options.show.when.target;u=t.options.hide.when.target;if(t.options.hide.fixed){u=u.add(t.elements.tooltip)}if(t.options.hide.when.event=="inactive"){s=["click","dblclick","mousedown","mouseup","mousemove","mouseout","mouseenter","mouseleave","mouseover"];function y(z){if(t.status.disabled===true){return}clearTimeout(t.timers.inactive);t.timers.inactive=setTimeout(function(){f(s).each(function(){u.unbind(this+".qtip-inactive");t.elements.content.unbind(this+".qtip-inactive")});t.hide(z)},t.options.hide.delay)}}else{if(t.options.hide.fixed===true){t.elements.tooltip.bind("mouseover.qtip",function(){if(t.status.disabled===true){return}clearTimeout(t.timers.hide)})}}function x(z){if(t.status.disabled===true){return}if(t.options.hide.when.event=="inactive"){f(s).each(function(){u.bind(this+".qtip-inactive",y);t.elements.content.bind(this+".qtip-inactive",y)});y()}clearTimeout(t.timers.show);clearTimeout(t.timers.hide);t.timers.show=setTimeout(function(){t.show(z)},t.options.show.delay)}function w(z){if(t.status.disabled===true){return}if(t.options.hide.fixed===true&&t.options.hide.when.event.search(/mouse(out|leave)/i)!==-1&&f(z.relatedTarget).parents("div.qtip[qtip]").length>0){z.stopPropagation();z.preventDefault();clearTimeout(t.timers.hide);return false}clearTimeout(t.timers.show);clearTimeout(t.timers.hide);t.elements.tooltip.stop(true,true);t.timers.hide=setTimeout(function(){t.hide(z)},t.options.hide.delay)}if((t.options.show.when.target.add(t.options.hide.when.target).length===1&&t.options.show.when.event==t.options.hide.when.event&&t.options.hide.when.event!=="inactive")||t.options.hide.when.event=="unfocus"){t.cache.toggle=0;v.bind(t.options.show.when.event+".qtip",function(z){if(t.cache.toggle==0){x(z)}else{w(z)}})}else{v.bind(t.options.show.when.event+".qtip",x);if(t.options.hide.when.event!=="inactive"){u.bind(t.options.hide.when.event+".qtip",w)}}if(t.options.position.type.search(/(fixed|absolute)/)!==-1){t.elements.tooltip.bind("mouseover.qtip",t.focus)}if(t.options.position.target==="mouse"&&t.options.position.type!=="static"){v.bind("mousemove.qtip",function(z){t.cache.mouse={x:z.pageX,y:z.pageY};if(t.status.disabled===false&&t.options.position.adjust.mouse===true&&t.options.position.type!=="static"&&t.elements.tooltip.css("display")!=="none"){t.updatePosition(z)}})}}function o(u,v,A){var z,s,x,y,t,w;z=this;if(A.corner=="center"){return v.position}s=f.extend({},u);y={x:false,y:false};t={left:(s.left=f.fn.qtip.cache.screen.width+f.fn.qtip.cache.screen.scroll.left),top:(s.top=f.fn.qtip.cache.screen.height+f.fn.qtip.cache.screen.scroll.top)};x={left:(t.left&&(A.corner.search(/right/i)!=-1||(A.corner.search(/right/i)==-1&&!t.right))),right:(t.right&&(A.corner.search(/left/i)!=-1||(A.corner.search(/left/i)==-1&&!t.left))),top:(t.top&&A.corner.search(/top/i)==-1),bottom:(t.bottom&&A.corner.search(/bottom/i)==-1)};if(x.left){if(z.options.position.target!=="mouse"){s.left=v.position.left+v.dimensions.width}else{s.left=z.cache.mouse.x}y.x="Left"}else{if(x.right){if(z.options.position.target!=="mouse"){s.left=v.position.left-A.dimensions.width}else{s.left=z.cache.mouse.x-A.dimensions.width}y.x="Right"}}if(x.top){if(z.options.position.target!=="mouse"){s.top=v.position.top+v.dimensions.height}else{s.top=z.cache.mouse.y}y.y="top"}else{if(x.bottom){if(z.options.position.target!=="mouse"){s.top=v.position.top-A.dimensions.height}else{s.top=z.cache.mouse.y-A.dimensions.height}y.y="bottom"}}if(s.left<0){s.left=u.left;y.x=false}if(s.top<0){s.top=u.top;y.y=false}if(z.options.style.tip.corner!==false){s.corner=new String(A.corner);if(y.x!==false){s.corner=s.corner.replace(/Left|Right|Middle/,y.x)}if(y.y!==false){s.corner=s.corner.replace(/top|bottom/,y.y)}if(s.corner!==z.elements.tip.attr("rel")){e.call(z,s.corner)}}return s}function q(u,t){var v,s;v=f.extend(true,{},u);for(s in v){if(t===true&&s.search(/(tip|classes)/i)!==-1){delete v[s]}else{if(!t&&s.search(/(width|border|tip|title|classes|user)/i)!==-1){delete v[s]}}}return v}function c(s){if(typeof s.tip!=="object"){s.tip={corner:s.tip}}if(typeof s.tip.size!=="object"){s.tip.size={width:s.tip.size,height:s.tip.size}}if(typeof s.border!=="object"){s.border={width:s.border}}if(typeof s.width!=="object"){s.width={value:s.width}}if(typeof s.width.max=="string"){s.width.max=parseInt(s.width.max.replace(/([0-9]+)/i,"$1"))}if(typeof s.width.min=="string"){s.width.min=parseInt(s.width.min.replace(/([0-9]+)/i,"$1"))}if(typeof s.tip.size.x=="number"){s.tip.size.width=s.tip.size.x;delete s.tip.size.x}if(typeof s.tip.size.y=="number"){s.tip.size.height=s.tip.size.y;delete s.tip.size.y}return s}function a(){var s,t,u,x,v,w;s=this;u=[true,{}];for(t=0;t0){v.tip.size.width+=1}if(v.tip.size.height%2>0){v.tip.size.height+=1}if(v.tip.corner===true){v.tip.corner=(s.options.position.corner.tooltip==="center")?false:s.options.position.corner.tooltip}return v}function b(v,u,t){var s={bottomRight:[[0,0],[u,t],[u,0]],bottomLeft:[[0,0],[u,0],[0,t]],topRight:[[0,t],[u,0],[u,t]],topLeft:[[0,0],[0,t],[u,t]],topMiddle:[[0,t],[u/2,0],[u,t]],bottomMiddle:[[0,0],[u,0],[u/2,t]],rightMiddle:[[0,0],[u,t/2],[0,t]],leftMiddle:[[u,0],[u,t],[0,t/2]]};s.leftTop=s.bottomRight;s.rightTop=s.bottomLeft;s.leftBottom=s.topRight;s.rightBottom=s.topLeft;return s[v]}function g(s){var t;if(f("").get(0).getContext){t={topLeft:[s,s],topRight:[0,s],bottomLeft:[s,0],bottomRight:[0,0]}}else{if(f.browser.msie){t={topLeft:[-90,90,0],topRight:[-90,90,-s],bottomLeft:[90,270,0],bottomRight:[90,270,-s]}}}return t}function k(){var s,t,u;s=this;u=s.getDimensions();t='':""), +a._keyEvent=!1;return K},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i=this._get(a,"changeMonth"),j=this._get(a,"changeYear"),k=this._get(a,"showMonthAfterYear"),l='
',m="";if(f||!i)m+=''+g[b]+"";else{var n=d&&d.getFullYear()==c,o=e&&e.getFullYear()==c;m+='"}k||(l+=m+(f||!i||!j?" ":""));if(!a.yearshtml){a.yearshtml="";if(f||!j)l+=''+c+"";else{var q=this._get(a,"yearRange").split(":"),r=(new Date).getFullYear(),s=function(a){var b=a.match(/c[+-].*/)?c+parseInt(a.substring(1),10):a.match(/[+-].*/)?r+parseInt(a,10):parseInt(a,10);return isNaN(b)?r:b},t=s(q[0]),u=Math.max(t,s(q[1]||""));t=d?Math.max(t,d.getFullYear()):t,u=e?Math.min(u,e.getFullYear()):u,a.yearshtml+='",l+=a.yearshtml,a.yearshtml=null}}l+=this._get(a,"yearSuffix"),k&&(l+=(f||!i||!j?" ":"")+m),l+="
";return l},_adjustInstDate:function(a,b,c){var d=a.drawYear+(c=="Y"?b:0),e=a.drawMonth+(c=="M"?b:0),f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+(c=="D"?b:0),g=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,f)));a.selectedDay=g.getDate(),a.drawMonth=a.selectedMonth=g.getMonth(),a.drawYear=a.selectedYear=g.getFullYear(),(c=="M"||c=="Y")&&this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),e=c&&bd?d:e;return e},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){var b=this._get(a,"numberOfMonths");return b==null?[1,1]:typeof b=="number"?[1,b]:b},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a),f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));b<0&&f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth()));return this._isInRange(a,f)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!d||b.getTime()<=d.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);var e=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}}),$.fn.datepicker=function(a){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv),$.datepicker.initialized=!0);var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));return this.each(function(){typeof a=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this].concat(b)):$.datepicker._attachDatepicker(this,a)})},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.8.18",window["DP_jQuery_"+dpuuid]=$})(jQuery); \ No newline at end of file diff --git a/js/lib/jquery-ui-sortable.min.js b/js/lib/jquery/jquery.ui.sortable.js similarity index 100% rename from js/lib/jquery-ui-sortable.min.js rename to js/lib/jquery/jquery.ui.sortable.js diff --git a/js/legacy/tiny_mce_33/.no_timpestamps b/js/lib/tiny_mce_33/.no_timpestamps similarity index 100% rename from js/legacy/tiny_mce_33/.no_timpestamps rename to js/lib/tiny_mce_33/.no_timpestamps diff --git a/js/legacy/tiny_mce_33/custom_content.css b/js/lib/tiny_mce_33/custom_content.css similarity index 100% rename from js/legacy/tiny_mce_33/custom_content.css rename to js/lib/tiny_mce_33/custom_content.css diff --git a/js/legacy/tiny_mce_33/jquery.tinymce.js b/js/lib/tiny_mce_33/jquery.tinymce.js similarity index 100% rename from js/legacy/tiny_mce_33/jquery.tinymce.js rename to js/lib/tiny_mce_33/jquery.tinymce.js diff --git a/js/legacy/tiny_mce_33/langs/en.js b/js/lib/tiny_mce_33/langs/en.js similarity index 100% rename from js/legacy/tiny_mce_33/langs/en.js rename to js/lib/tiny_mce_33/langs/en.js diff --git a/js/legacy/tiny_mce_33/license.txt b/js/lib/tiny_mce_33/license.txt similarity index 100% rename from js/legacy/tiny_mce_33/license.txt rename to js/lib/tiny_mce_33/license.txt diff --git a/js/legacy/tiny_mce_33/plugins/advhr/css/advhr.css b/js/lib/tiny_mce_33/plugins/advhr/css/advhr.css similarity index 100% rename from js/legacy/tiny_mce_33/plugins/advhr/css/advhr.css rename to js/lib/tiny_mce_33/plugins/advhr/css/advhr.css diff --git a/js/legacy/tiny_mce_33/plugins/advhr/editor_plugin.js b/js/lib/tiny_mce_33/plugins/advhr/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/advhr/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/advhr/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/advhr/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/advhr/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/advhr/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/advhr/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/advhr/js/rule.js b/js/lib/tiny_mce_33/plugins/advhr/js/rule.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/advhr/js/rule.js rename to js/lib/tiny_mce_33/plugins/advhr/js/rule.js diff --git a/js/legacy/tiny_mce_33/plugins/advhr/langs/en_dlg.js b/js/lib/tiny_mce_33/plugins/advhr/langs/en_dlg.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/advhr/langs/en_dlg.js rename to js/lib/tiny_mce_33/plugins/advhr/langs/en_dlg.js diff --git a/js/legacy/tiny_mce_33/plugins/advhr/rule.htm b/js/lib/tiny_mce_33/plugins/advhr/rule.htm similarity index 100% rename from js/legacy/tiny_mce_33/plugins/advhr/rule.htm rename to js/lib/tiny_mce_33/plugins/advhr/rule.htm diff --git a/js/legacy/tiny_mce_33/plugins/advimage/css/advimage.css b/js/lib/tiny_mce_33/plugins/advimage/css/advimage.css similarity index 100% rename from js/legacy/tiny_mce_33/plugins/advimage/css/advimage.css rename to js/lib/tiny_mce_33/plugins/advimage/css/advimage.css diff --git a/js/legacy/tiny_mce_33/plugins/advimage/editor_plugin.js b/js/lib/tiny_mce_33/plugins/advimage/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/advimage/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/advimage/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/advimage/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/advimage/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/advimage/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/advimage/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/advimage/image.htm b/js/lib/tiny_mce_33/plugins/advimage/image.htm similarity index 100% rename from js/legacy/tiny_mce_33/plugins/advimage/image.htm rename to js/lib/tiny_mce_33/plugins/advimage/image.htm diff --git a/js/legacy/tiny_mce_33/plugins/advimage/img/sample.gif b/js/lib/tiny_mce_33/plugins/advimage/img/sample.gif similarity index 100% rename from js/legacy/tiny_mce_33/plugins/advimage/img/sample.gif rename to js/lib/tiny_mce_33/plugins/advimage/img/sample.gif diff --git a/js/legacy/tiny_mce_33/plugins/advimage/js/image.js b/js/lib/tiny_mce_33/plugins/advimage/js/image.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/advimage/js/image.js rename to js/lib/tiny_mce_33/plugins/advimage/js/image.js diff --git a/js/legacy/tiny_mce_33/plugins/advimage/langs/en_dlg.js b/js/lib/tiny_mce_33/plugins/advimage/langs/en_dlg.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/advimage/langs/en_dlg.js rename to js/lib/tiny_mce_33/plugins/advimage/langs/en_dlg.js diff --git a/js/legacy/tiny_mce_33/plugins/advlink/css/advlink.css b/js/lib/tiny_mce_33/plugins/advlink/css/advlink.css similarity index 100% rename from js/legacy/tiny_mce_33/plugins/advlink/css/advlink.css rename to js/lib/tiny_mce_33/plugins/advlink/css/advlink.css diff --git a/js/legacy/tiny_mce_33/plugins/advlink/editor_plugin.js b/js/lib/tiny_mce_33/plugins/advlink/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/advlink/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/advlink/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/advlink/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/advlink/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/advlink/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/advlink/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/advlink/js/advlink.js b/js/lib/tiny_mce_33/plugins/advlink/js/advlink.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/advlink/js/advlink.js rename to js/lib/tiny_mce_33/plugins/advlink/js/advlink.js diff --git a/js/legacy/tiny_mce_33/plugins/advlink/langs/en_dlg.js b/js/lib/tiny_mce_33/plugins/advlink/langs/en_dlg.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/advlink/langs/en_dlg.js rename to js/lib/tiny_mce_33/plugins/advlink/langs/en_dlg.js diff --git a/js/legacy/tiny_mce_33/plugins/advlink/link.htm b/js/lib/tiny_mce_33/plugins/advlink/link.htm similarity index 100% rename from js/legacy/tiny_mce_33/plugins/advlink/link.htm rename to js/lib/tiny_mce_33/plugins/advlink/link.htm diff --git a/js/legacy/tiny_mce_33/plugins/advlist/editor_plugin.js b/js/lib/tiny_mce_33/plugins/advlist/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/advlist/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/advlist/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/advlist/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/advlist/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/advlist/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/advlist/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/autoresize/editor_plugin.js b/js/lib/tiny_mce_33/plugins/autoresize/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/autoresize/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/autoresize/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/autoresize/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/autoresize/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/autoresize/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/autoresize/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/autosave/editor_plugin.js b/js/lib/tiny_mce_33/plugins/autosave/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/autosave/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/autosave/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/autosave/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/autosave/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/autosave/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/autosave/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/autosave/langs/en.js b/js/lib/tiny_mce_33/plugins/autosave/langs/en.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/autosave/langs/en.js rename to js/lib/tiny_mce_33/plugins/autosave/langs/en.js diff --git a/js/legacy/tiny_mce_33/plugins/bbcode/editor_plugin.js b/js/lib/tiny_mce_33/plugins/bbcode/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/bbcode/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/bbcode/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/bbcode/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/bbcode/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/bbcode/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/bbcode/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/contextmenu/editor_plugin.js b/js/lib/tiny_mce_33/plugins/contextmenu/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/contextmenu/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/contextmenu/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/contextmenu/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/contextmenu/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/contextmenu/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/contextmenu/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/directionality/editor_plugin.js b/js/lib/tiny_mce_33/plugins/directionality/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/directionality/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/directionality/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/directionality/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/directionality/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/directionality/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/directionality/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/emotions/editor_plugin.js b/js/lib/tiny_mce_33/plugins/emotions/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/emotions/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/emotions/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/emotions/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/emotions/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/emotions/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/emotions/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/emotions/emotions.htm b/js/lib/tiny_mce_33/plugins/emotions/emotions.htm similarity index 100% rename from js/legacy/tiny_mce_33/plugins/emotions/emotions.htm rename to js/lib/tiny_mce_33/plugins/emotions/emotions.htm diff --git a/js/legacy/tiny_mce_33/plugins/emotions/img/smiley-cool.gif b/js/lib/tiny_mce_33/plugins/emotions/img/smiley-cool.gif similarity index 100% rename from js/legacy/tiny_mce_33/plugins/emotions/img/smiley-cool.gif rename to js/lib/tiny_mce_33/plugins/emotions/img/smiley-cool.gif diff --git a/js/legacy/tiny_mce_33/plugins/emotions/img/smiley-cry.gif b/js/lib/tiny_mce_33/plugins/emotions/img/smiley-cry.gif similarity index 100% rename from js/legacy/tiny_mce_33/plugins/emotions/img/smiley-cry.gif rename to js/lib/tiny_mce_33/plugins/emotions/img/smiley-cry.gif diff --git a/js/legacy/tiny_mce_33/plugins/emotions/img/smiley-embarassed.gif b/js/lib/tiny_mce_33/plugins/emotions/img/smiley-embarassed.gif similarity index 100% rename from js/legacy/tiny_mce_33/plugins/emotions/img/smiley-embarassed.gif rename to js/lib/tiny_mce_33/plugins/emotions/img/smiley-embarassed.gif diff --git a/js/legacy/tiny_mce_33/plugins/emotions/img/smiley-foot-in-mouth.gif b/js/lib/tiny_mce_33/plugins/emotions/img/smiley-foot-in-mouth.gif similarity index 100% rename from js/legacy/tiny_mce_33/plugins/emotions/img/smiley-foot-in-mouth.gif rename to js/lib/tiny_mce_33/plugins/emotions/img/smiley-foot-in-mouth.gif diff --git a/js/legacy/tiny_mce_33/plugins/emotions/img/smiley-frown.gif b/js/lib/tiny_mce_33/plugins/emotions/img/smiley-frown.gif similarity index 100% rename from js/legacy/tiny_mce_33/plugins/emotions/img/smiley-frown.gif rename to js/lib/tiny_mce_33/plugins/emotions/img/smiley-frown.gif diff --git a/js/legacy/tiny_mce_33/plugins/emotions/img/smiley-innocent.gif b/js/lib/tiny_mce_33/plugins/emotions/img/smiley-innocent.gif similarity index 100% rename from js/legacy/tiny_mce_33/plugins/emotions/img/smiley-innocent.gif rename to js/lib/tiny_mce_33/plugins/emotions/img/smiley-innocent.gif diff --git a/js/legacy/tiny_mce_33/plugins/emotions/img/smiley-kiss.gif b/js/lib/tiny_mce_33/plugins/emotions/img/smiley-kiss.gif similarity index 100% rename from js/legacy/tiny_mce_33/plugins/emotions/img/smiley-kiss.gif rename to js/lib/tiny_mce_33/plugins/emotions/img/smiley-kiss.gif diff --git a/js/legacy/tiny_mce_33/plugins/emotions/img/smiley-laughing.gif b/js/lib/tiny_mce_33/plugins/emotions/img/smiley-laughing.gif similarity index 100% rename from js/legacy/tiny_mce_33/plugins/emotions/img/smiley-laughing.gif rename to js/lib/tiny_mce_33/plugins/emotions/img/smiley-laughing.gif diff --git a/js/legacy/tiny_mce_33/plugins/emotions/img/smiley-money-mouth.gif b/js/lib/tiny_mce_33/plugins/emotions/img/smiley-money-mouth.gif similarity index 100% rename from js/legacy/tiny_mce_33/plugins/emotions/img/smiley-money-mouth.gif rename to js/lib/tiny_mce_33/plugins/emotions/img/smiley-money-mouth.gif diff --git a/js/legacy/tiny_mce_33/plugins/emotions/img/smiley-sealed.gif b/js/lib/tiny_mce_33/plugins/emotions/img/smiley-sealed.gif similarity index 100% rename from js/legacy/tiny_mce_33/plugins/emotions/img/smiley-sealed.gif rename to js/lib/tiny_mce_33/plugins/emotions/img/smiley-sealed.gif diff --git a/js/legacy/tiny_mce_33/plugins/emotions/img/smiley-smile.gif b/js/lib/tiny_mce_33/plugins/emotions/img/smiley-smile.gif similarity index 100% rename from js/legacy/tiny_mce_33/plugins/emotions/img/smiley-smile.gif rename to js/lib/tiny_mce_33/plugins/emotions/img/smiley-smile.gif diff --git a/js/legacy/tiny_mce_33/plugins/emotions/img/smiley-surprised.gif b/js/lib/tiny_mce_33/plugins/emotions/img/smiley-surprised.gif similarity index 100% rename from js/legacy/tiny_mce_33/plugins/emotions/img/smiley-surprised.gif rename to js/lib/tiny_mce_33/plugins/emotions/img/smiley-surprised.gif diff --git a/js/legacy/tiny_mce_33/plugins/emotions/img/smiley-tongue-out.gif b/js/lib/tiny_mce_33/plugins/emotions/img/smiley-tongue-out.gif similarity index 100% rename from js/legacy/tiny_mce_33/plugins/emotions/img/smiley-tongue-out.gif rename to js/lib/tiny_mce_33/plugins/emotions/img/smiley-tongue-out.gif diff --git a/js/legacy/tiny_mce_33/plugins/emotions/img/smiley-undecided.gif b/js/lib/tiny_mce_33/plugins/emotions/img/smiley-undecided.gif similarity index 100% rename from js/legacy/tiny_mce_33/plugins/emotions/img/smiley-undecided.gif rename to js/lib/tiny_mce_33/plugins/emotions/img/smiley-undecided.gif diff --git a/js/legacy/tiny_mce_33/plugins/emotions/img/smiley-wink.gif b/js/lib/tiny_mce_33/plugins/emotions/img/smiley-wink.gif similarity index 100% rename from js/legacy/tiny_mce_33/plugins/emotions/img/smiley-wink.gif rename to js/lib/tiny_mce_33/plugins/emotions/img/smiley-wink.gif diff --git a/js/legacy/tiny_mce_33/plugins/emotions/img/smiley-yell.gif b/js/lib/tiny_mce_33/plugins/emotions/img/smiley-yell.gif similarity index 100% rename from js/legacy/tiny_mce_33/plugins/emotions/img/smiley-yell.gif rename to js/lib/tiny_mce_33/plugins/emotions/img/smiley-yell.gif diff --git a/js/legacy/tiny_mce_33/plugins/emotions/js/emotions.js b/js/lib/tiny_mce_33/plugins/emotions/js/emotions.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/emotions/js/emotions.js rename to js/lib/tiny_mce_33/plugins/emotions/js/emotions.js diff --git a/js/legacy/tiny_mce_33/plugins/emotions/langs/en_dlg.js b/js/lib/tiny_mce_33/plugins/emotions/langs/en_dlg.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/emotions/langs/en_dlg.js rename to js/lib/tiny_mce_33/plugins/emotions/langs/en_dlg.js diff --git a/js/legacy/tiny_mce_33/plugins/example/dialog.htm b/js/lib/tiny_mce_33/plugins/example/dialog.htm similarity index 100% rename from js/legacy/tiny_mce_33/plugins/example/dialog.htm rename to js/lib/tiny_mce_33/plugins/example/dialog.htm diff --git a/js/legacy/tiny_mce_33/plugins/example/editor_plugin.js b/js/lib/tiny_mce_33/plugins/example/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/example/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/example/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/example/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/example/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/example/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/example/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/example/img/example.gif b/js/lib/tiny_mce_33/plugins/example/img/example.gif similarity index 100% rename from js/legacy/tiny_mce_33/plugins/example/img/example.gif rename to js/lib/tiny_mce_33/plugins/example/img/example.gif diff --git a/js/legacy/tiny_mce_33/plugins/example/js/dialog.js b/js/lib/tiny_mce_33/plugins/example/js/dialog.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/example/js/dialog.js rename to js/lib/tiny_mce_33/plugins/example/js/dialog.js diff --git a/js/legacy/tiny_mce_33/plugins/example/langs/en.js b/js/lib/tiny_mce_33/plugins/example/langs/en.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/example/langs/en.js rename to js/lib/tiny_mce_33/plugins/example/langs/en.js diff --git a/js/legacy/tiny_mce_33/plugins/example/langs/en_dlg.js b/js/lib/tiny_mce_33/plugins/example/langs/en_dlg.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/example/langs/en_dlg.js rename to js/lib/tiny_mce_33/plugins/example/langs/en_dlg.js diff --git a/js/legacy/tiny_mce_33/plugins/fullpage/css/fullpage.css b/js/lib/tiny_mce_33/plugins/fullpage/css/fullpage.css similarity index 100% rename from js/legacy/tiny_mce_33/plugins/fullpage/css/fullpage.css rename to js/lib/tiny_mce_33/plugins/fullpage/css/fullpage.css diff --git a/js/legacy/tiny_mce_33/plugins/fullpage/editor_plugin.js b/js/lib/tiny_mce_33/plugins/fullpage/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/fullpage/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/fullpage/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/fullpage/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/fullpage/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/fullpage/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/fullpage/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/fullpage/fullpage.htm b/js/lib/tiny_mce_33/plugins/fullpage/fullpage.htm similarity index 100% rename from js/legacy/tiny_mce_33/plugins/fullpage/fullpage.htm rename to js/lib/tiny_mce_33/plugins/fullpage/fullpage.htm diff --git a/js/legacy/tiny_mce_33/plugins/fullpage/js/fullpage.js b/js/lib/tiny_mce_33/plugins/fullpage/js/fullpage.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/fullpage/js/fullpage.js rename to js/lib/tiny_mce_33/plugins/fullpage/js/fullpage.js diff --git a/js/legacy/tiny_mce_33/plugins/fullpage/langs/en_dlg.js b/js/lib/tiny_mce_33/plugins/fullpage/langs/en_dlg.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/fullpage/langs/en_dlg.js rename to js/lib/tiny_mce_33/plugins/fullpage/langs/en_dlg.js diff --git a/js/legacy/tiny_mce_33/plugins/fullscreen/editor_plugin.js b/js/lib/tiny_mce_33/plugins/fullscreen/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/fullscreen/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/fullscreen/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/fullscreen/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/fullscreen/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/fullscreen/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/fullscreen/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/fullscreen/fullscreen.htm b/js/lib/tiny_mce_33/plugins/fullscreen/fullscreen.htm similarity index 100% rename from js/legacy/tiny_mce_33/plugins/fullscreen/fullscreen.htm rename to js/lib/tiny_mce_33/plugins/fullscreen/fullscreen.htm diff --git a/js/legacy/tiny_mce_33/plugins/iespell/editor_plugin.js b/js/lib/tiny_mce_33/plugins/iespell/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/iespell/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/iespell/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/iespell/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/iespell/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/iespell/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/iespell/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/inlinepopups/editor_plugin.js b/js/lib/tiny_mce_33/plugins/inlinepopups/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/inlinepopups/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/inlinepopups/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/inlinepopups/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/inlinepopups/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/inlinepopups/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/inlinepopups/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/inlinepopups/skins/clearlooks2/img/alert.gif b/js/lib/tiny_mce_33/plugins/inlinepopups/skins/clearlooks2/img/alert.gif similarity index 100% rename from js/legacy/tiny_mce_33/plugins/inlinepopups/skins/clearlooks2/img/alert.gif rename to js/lib/tiny_mce_33/plugins/inlinepopups/skins/clearlooks2/img/alert.gif diff --git a/js/legacy/tiny_mce_33/plugins/inlinepopups/skins/clearlooks2/img/button.gif b/js/lib/tiny_mce_33/plugins/inlinepopups/skins/clearlooks2/img/button.gif similarity index 100% rename from js/legacy/tiny_mce_33/plugins/inlinepopups/skins/clearlooks2/img/button.gif rename to js/lib/tiny_mce_33/plugins/inlinepopups/skins/clearlooks2/img/button.gif diff --git a/js/legacy/tiny_mce_33/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif b/js/lib/tiny_mce_33/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif similarity index 100% rename from js/legacy/tiny_mce_33/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif rename to js/lib/tiny_mce_33/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif diff --git a/js/legacy/tiny_mce_33/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif b/js/lib/tiny_mce_33/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif similarity index 100% rename from js/legacy/tiny_mce_33/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif rename to js/lib/tiny_mce_33/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif diff --git a/js/legacy/tiny_mce_33/plugins/inlinepopups/skins/clearlooks2/img/corners.gif b/js/lib/tiny_mce_33/plugins/inlinepopups/skins/clearlooks2/img/corners.gif similarity index 100% rename from js/legacy/tiny_mce_33/plugins/inlinepopups/skins/clearlooks2/img/corners.gif rename to js/lib/tiny_mce_33/plugins/inlinepopups/skins/clearlooks2/img/corners.gif diff --git a/js/legacy/tiny_mce_33/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif b/js/lib/tiny_mce_33/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif similarity index 100% rename from js/legacy/tiny_mce_33/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif rename to js/lib/tiny_mce_33/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif diff --git a/js/legacy/tiny_mce_33/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif b/js/lib/tiny_mce_33/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif similarity index 100% rename from js/legacy/tiny_mce_33/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif rename to js/lib/tiny_mce_33/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif diff --git a/js/legacy/tiny_mce_33/plugins/inlinepopups/skins/clearlooks2/window.css b/js/lib/tiny_mce_33/plugins/inlinepopups/skins/clearlooks2/window.css similarity index 100% rename from js/legacy/tiny_mce_33/plugins/inlinepopups/skins/clearlooks2/window.css rename to js/lib/tiny_mce_33/plugins/inlinepopups/skins/clearlooks2/window.css diff --git a/js/legacy/tiny_mce_33/plugins/inlinepopups/template.htm b/js/lib/tiny_mce_33/plugins/inlinepopups/template.htm similarity index 100% rename from js/legacy/tiny_mce_33/plugins/inlinepopups/template.htm rename to js/lib/tiny_mce_33/plugins/inlinepopups/template.htm diff --git a/js/legacy/tiny_mce_33/plugins/insertdatetime/editor_plugin.js b/js/lib/tiny_mce_33/plugins/insertdatetime/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/insertdatetime/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/insertdatetime/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/insertdatetime/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/insertdatetime/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/insertdatetime/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/insertdatetime/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/layer/editor_plugin.js b/js/lib/tiny_mce_33/plugins/layer/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/layer/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/layer/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/layer/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/layer/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/layer/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/layer/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/legacyoutput/editor_plugin.js b/js/lib/tiny_mce_33/plugins/legacyoutput/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/legacyoutput/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/legacyoutput/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/legacyoutput/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/legacyoutput/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/legacyoutput/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/legacyoutput/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/media/css/content.css b/js/lib/tiny_mce_33/plugins/media/css/content.css similarity index 100% rename from js/legacy/tiny_mce_33/plugins/media/css/content.css rename to js/lib/tiny_mce_33/plugins/media/css/content.css diff --git a/js/legacy/tiny_mce_33/plugins/media/css/media.css b/js/lib/tiny_mce_33/plugins/media/css/media.css similarity index 100% rename from js/legacy/tiny_mce_33/plugins/media/css/media.css rename to js/lib/tiny_mce_33/plugins/media/css/media.css diff --git a/js/legacy/tiny_mce_33/plugins/media/editor_plugin.js b/js/lib/tiny_mce_33/plugins/media/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/media/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/media/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/media/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/media/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/media/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/media/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/media/img/flash.gif b/js/lib/tiny_mce_33/plugins/media/img/flash.gif similarity index 100% rename from js/legacy/tiny_mce_33/plugins/media/img/flash.gif rename to js/lib/tiny_mce_33/plugins/media/img/flash.gif diff --git a/js/legacy/tiny_mce_33/plugins/media/img/flv_player.swf b/js/lib/tiny_mce_33/plugins/media/img/flv_player.swf similarity index 100% rename from js/legacy/tiny_mce_33/plugins/media/img/flv_player.swf rename to js/lib/tiny_mce_33/plugins/media/img/flv_player.swf diff --git a/js/legacy/tiny_mce_33/plugins/media/img/quicktime.gif b/js/lib/tiny_mce_33/plugins/media/img/quicktime.gif similarity index 100% rename from js/legacy/tiny_mce_33/plugins/media/img/quicktime.gif rename to js/lib/tiny_mce_33/plugins/media/img/quicktime.gif diff --git a/js/legacy/tiny_mce_33/plugins/media/img/realmedia.gif b/js/lib/tiny_mce_33/plugins/media/img/realmedia.gif similarity index 100% rename from js/legacy/tiny_mce_33/plugins/media/img/realmedia.gif rename to js/lib/tiny_mce_33/plugins/media/img/realmedia.gif diff --git a/js/legacy/tiny_mce_33/plugins/media/img/shockwave.gif b/js/lib/tiny_mce_33/plugins/media/img/shockwave.gif similarity index 100% rename from js/legacy/tiny_mce_33/plugins/media/img/shockwave.gif rename to js/lib/tiny_mce_33/plugins/media/img/shockwave.gif diff --git a/js/legacy/tiny_mce_33/plugins/media/img/trans.gif b/js/lib/tiny_mce_33/plugins/media/img/trans.gif similarity index 100% rename from js/legacy/tiny_mce_33/plugins/media/img/trans.gif rename to js/lib/tiny_mce_33/plugins/media/img/trans.gif diff --git a/js/legacy/tiny_mce_33/plugins/media/img/windowsmedia.gif b/js/lib/tiny_mce_33/plugins/media/img/windowsmedia.gif similarity index 100% rename from js/legacy/tiny_mce_33/plugins/media/img/windowsmedia.gif rename to js/lib/tiny_mce_33/plugins/media/img/windowsmedia.gif diff --git a/js/legacy/tiny_mce_33/plugins/media/js/embed.js b/js/lib/tiny_mce_33/plugins/media/js/embed.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/media/js/embed.js rename to js/lib/tiny_mce_33/plugins/media/js/embed.js diff --git a/js/legacy/tiny_mce_33/plugins/media/js/media.js b/js/lib/tiny_mce_33/plugins/media/js/media.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/media/js/media.js rename to js/lib/tiny_mce_33/plugins/media/js/media.js diff --git a/js/legacy/tiny_mce_33/plugins/media/langs/en_dlg.js b/js/lib/tiny_mce_33/plugins/media/langs/en_dlg.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/media/langs/en_dlg.js rename to js/lib/tiny_mce_33/plugins/media/langs/en_dlg.js diff --git a/js/legacy/tiny_mce_33/plugins/media/media.htm b/js/lib/tiny_mce_33/plugins/media/media.htm similarity index 100% rename from js/legacy/tiny_mce_33/plugins/media/media.htm rename to js/lib/tiny_mce_33/plugins/media/media.htm diff --git a/js/legacy/tiny_mce_33/plugins/nonbreaking/editor_plugin.js b/js/lib/tiny_mce_33/plugins/nonbreaking/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/nonbreaking/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/nonbreaking/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/nonbreaking/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/nonbreaking/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/nonbreaking/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/nonbreaking/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/noneditable/editor_plugin.js b/js/lib/tiny_mce_33/plugins/noneditable/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/noneditable/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/noneditable/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/noneditable/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/noneditable/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/noneditable/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/noneditable/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/pagebreak/css/content.css b/js/lib/tiny_mce_33/plugins/pagebreak/css/content.css similarity index 100% rename from js/legacy/tiny_mce_33/plugins/pagebreak/css/content.css rename to js/lib/tiny_mce_33/plugins/pagebreak/css/content.css diff --git a/js/legacy/tiny_mce_33/plugins/pagebreak/editor_plugin.js b/js/lib/tiny_mce_33/plugins/pagebreak/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/pagebreak/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/pagebreak/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/pagebreak/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/pagebreak/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/pagebreak/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/pagebreak/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/pagebreak/img/pagebreak.gif b/js/lib/tiny_mce_33/plugins/pagebreak/img/pagebreak.gif similarity index 100% rename from js/legacy/tiny_mce_33/plugins/pagebreak/img/pagebreak.gif rename to js/lib/tiny_mce_33/plugins/pagebreak/img/pagebreak.gif diff --git a/js/legacy/tiny_mce_33/plugins/pagebreak/img/trans.gif b/js/lib/tiny_mce_33/plugins/pagebreak/img/trans.gif similarity index 100% rename from js/legacy/tiny_mce_33/plugins/pagebreak/img/trans.gif rename to js/lib/tiny_mce_33/plugins/pagebreak/img/trans.gif diff --git a/js/legacy/tiny_mce_33/plugins/paste/editor_plugin.js b/js/lib/tiny_mce_33/plugins/paste/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/paste/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/paste/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/paste/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/paste/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/paste/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/paste/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/paste/js/pastetext.js b/js/lib/tiny_mce_33/plugins/paste/js/pastetext.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/paste/js/pastetext.js rename to js/lib/tiny_mce_33/plugins/paste/js/pastetext.js diff --git a/js/legacy/tiny_mce_33/plugins/paste/js/pasteword.js b/js/lib/tiny_mce_33/plugins/paste/js/pasteword.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/paste/js/pasteword.js rename to js/lib/tiny_mce_33/plugins/paste/js/pasteword.js diff --git a/js/legacy/tiny_mce_33/plugins/paste/langs/en_dlg.js b/js/lib/tiny_mce_33/plugins/paste/langs/en_dlg.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/paste/langs/en_dlg.js rename to js/lib/tiny_mce_33/plugins/paste/langs/en_dlg.js diff --git a/js/legacy/tiny_mce_33/plugins/paste/pastetext.htm b/js/lib/tiny_mce_33/plugins/paste/pastetext.htm similarity index 100% rename from js/legacy/tiny_mce_33/plugins/paste/pastetext.htm rename to js/lib/tiny_mce_33/plugins/paste/pastetext.htm diff --git a/js/legacy/tiny_mce_33/plugins/paste/pasteword.htm b/js/lib/tiny_mce_33/plugins/paste/pasteword.htm similarity index 100% rename from js/legacy/tiny_mce_33/plugins/paste/pasteword.htm rename to js/lib/tiny_mce_33/plugins/paste/pasteword.htm diff --git a/js/legacy/tiny_mce_33/plugins/preview/editor_plugin.js b/js/lib/tiny_mce_33/plugins/preview/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/preview/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/preview/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/preview/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/preview/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/preview/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/preview/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/preview/example.html b/js/lib/tiny_mce_33/plugins/preview/example.html similarity index 100% rename from js/legacy/tiny_mce_33/plugins/preview/example.html rename to js/lib/tiny_mce_33/plugins/preview/example.html diff --git a/js/legacy/tiny_mce_33/plugins/preview/jscripts/embed.js b/js/lib/tiny_mce_33/plugins/preview/jscripts/embed.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/preview/jscripts/embed.js rename to js/lib/tiny_mce_33/plugins/preview/jscripts/embed.js diff --git a/js/legacy/tiny_mce_33/plugins/preview/preview.html b/js/lib/tiny_mce_33/plugins/preview/preview.html similarity index 100% rename from js/legacy/tiny_mce_33/plugins/preview/preview.html rename to js/lib/tiny_mce_33/plugins/preview/preview.html diff --git a/js/legacy/tiny_mce_33/plugins/print/editor_plugin.js b/js/lib/tiny_mce_33/plugins/print/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/print/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/print/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/print/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/print/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/print/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/print/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/save/editor_plugin.js b/js/lib/tiny_mce_33/plugins/save/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/save/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/save/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/save/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/save/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/save/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/save/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/searchreplace/css/searchreplace.css b/js/lib/tiny_mce_33/plugins/searchreplace/css/searchreplace.css similarity index 100% rename from js/legacy/tiny_mce_33/plugins/searchreplace/css/searchreplace.css rename to js/lib/tiny_mce_33/plugins/searchreplace/css/searchreplace.css diff --git a/js/legacy/tiny_mce_33/plugins/searchreplace/editor_plugin.js b/js/lib/tiny_mce_33/plugins/searchreplace/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/searchreplace/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/searchreplace/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/searchreplace/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/searchreplace/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/searchreplace/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/searchreplace/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/searchreplace/js/searchreplace.js b/js/lib/tiny_mce_33/plugins/searchreplace/js/searchreplace.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/searchreplace/js/searchreplace.js rename to js/lib/tiny_mce_33/plugins/searchreplace/js/searchreplace.js diff --git a/js/legacy/tiny_mce_33/plugins/searchreplace/langs/en_dlg.js b/js/lib/tiny_mce_33/plugins/searchreplace/langs/en_dlg.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/searchreplace/langs/en_dlg.js rename to js/lib/tiny_mce_33/plugins/searchreplace/langs/en_dlg.js diff --git a/js/legacy/tiny_mce_33/plugins/searchreplace/searchreplace.htm b/js/lib/tiny_mce_33/plugins/searchreplace/searchreplace.htm similarity index 100% rename from js/legacy/tiny_mce_33/plugins/searchreplace/searchreplace.htm rename to js/lib/tiny_mce_33/plugins/searchreplace/searchreplace.htm diff --git a/js/legacy/tiny_mce_33/plugins/spellchecker/css/content.css b/js/lib/tiny_mce_33/plugins/spellchecker/css/content.css similarity index 100% rename from js/legacy/tiny_mce_33/plugins/spellchecker/css/content.css rename to js/lib/tiny_mce_33/plugins/spellchecker/css/content.css diff --git a/js/legacy/tiny_mce_33/plugins/spellchecker/editor_plugin.js b/js/lib/tiny_mce_33/plugins/spellchecker/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/spellchecker/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/spellchecker/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/spellchecker/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/spellchecker/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/spellchecker/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/spellchecker/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/spellchecker/img/wline.gif b/js/lib/tiny_mce_33/plugins/spellchecker/img/wline.gif similarity index 100% rename from js/legacy/tiny_mce_33/plugins/spellchecker/img/wline.gif rename to js/lib/tiny_mce_33/plugins/spellchecker/img/wline.gif diff --git a/js/legacy/tiny_mce_33/plugins/style/css/props.css b/js/lib/tiny_mce_33/plugins/style/css/props.css similarity index 100% rename from js/legacy/tiny_mce_33/plugins/style/css/props.css rename to js/lib/tiny_mce_33/plugins/style/css/props.css diff --git a/js/legacy/tiny_mce_33/plugins/style/editor_plugin.js b/js/lib/tiny_mce_33/plugins/style/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/style/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/style/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/style/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/style/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/style/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/style/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/style/js/props.js b/js/lib/tiny_mce_33/plugins/style/js/props.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/style/js/props.js rename to js/lib/tiny_mce_33/plugins/style/js/props.js diff --git a/js/legacy/tiny_mce_33/plugins/style/langs/en_dlg.js b/js/lib/tiny_mce_33/plugins/style/langs/en_dlg.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/style/langs/en_dlg.js rename to js/lib/tiny_mce_33/plugins/style/langs/en_dlg.js diff --git a/js/legacy/tiny_mce_33/plugins/style/props.htm b/js/lib/tiny_mce_33/plugins/style/props.htm similarity index 100% rename from js/legacy/tiny_mce_33/plugins/style/props.htm rename to js/lib/tiny_mce_33/plugins/style/props.htm diff --git a/js/legacy/tiny_mce_33/plugins/tabfocus/editor_plugin.js b/js/lib/tiny_mce_33/plugins/tabfocus/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/tabfocus/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/tabfocus/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/tabfocus/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/tabfocus/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/tabfocus/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/tabfocus/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/table/cell.htm b/js/lib/tiny_mce_33/plugins/table/cell.htm similarity index 100% rename from js/legacy/tiny_mce_33/plugins/table/cell.htm rename to js/lib/tiny_mce_33/plugins/table/cell.htm diff --git a/js/legacy/tiny_mce_33/plugins/table/css/cell.css b/js/lib/tiny_mce_33/plugins/table/css/cell.css similarity index 100% rename from js/legacy/tiny_mce_33/plugins/table/css/cell.css rename to js/lib/tiny_mce_33/plugins/table/css/cell.css diff --git a/js/legacy/tiny_mce_33/plugins/table/css/row.css b/js/lib/tiny_mce_33/plugins/table/css/row.css similarity index 100% rename from js/legacy/tiny_mce_33/plugins/table/css/row.css rename to js/lib/tiny_mce_33/plugins/table/css/row.css diff --git a/js/legacy/tiny_mce_33/plugins/table/css/table.css b/js/lib/tiny_mce_33/plugins/table/css/table.css similarity index 100% rename from js/legacy/tiny_mce_33/plugins/table/css/table.css rename to js/lib/tiny_mce_33/plugins/table/css/table.css diff --git a/js/legacy/tiny_mce_33/plugins/table/editor_plugin.js b/js/lib/tiny_mce_33/plugins/table/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/table/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/table/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/table/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/table/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/table/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/table/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/table/js/cell.js b/js/lib/tiny_mce_33/plugins/table/js/cell.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/table/js/cell.js rename to js/lib/tiny_mce_33/plugins/table/js/cell.js diff --git a/js/legacy/tiny_mce_33/plugins/table/js/merge_cells.js b/js/lib/tiny_mce_33/plugins/table/js/merge_cells.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/table/js/merge_cells.js rename to js/lib/tiny_mce_33/plugins/table/js/merge_cells.js diff --git a/js/legacy/tiny_mce_33/plugins/table/js/row.js b/js/lib/tiny_mce_33/plugins/table/js/row.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/table/js/row.js rename to js/lib/tiny_mce_33/plugins/table/js/row.js diff --git a/js/legacy/tiny_mce_33/plugins/table/js/table.js b/js/lib/tiny_mce_33/plugins/table/js/table.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/table/js/table.js rename to js/lib/tiny_mce_33/plugins/table/js/table.js diff --git a/js/legacy/tiny_mce_33/plugins/table/langs/en_dlg.js b/js/lib/tiny_mce_33/plugins/table/langs/en_dlg.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/table/langs/en_dlg.js rename to js/lib/tiny_mce_33/plugins/table/langs/en_dlg.js diff --git a/js/legacy/tiny_mce_33/plugins/table/merge_cells.htm b/js/lib/tiny_mce_33/plugins/table/merge_cells.htm similarity index 100% rename from js/legacy/tiny_mce_33/plugins/table/merge_cells.htm rename to js/lib/tiny_mce_33/plugins/table/merge_cells.htm diff --git a/js/legacy/tiny_mce_33/plugins/table/row.htm b/js/lib/tiny_mce_33/plugins/table/row.htm similarity index 100% rename from js/legacy/tiny_mce_33/plugins/table/row.htm rename to js/lib/tiny_mce_33/plugins/table/row.htm diff --git a/js/legacy/tiny_mce_33/plugins/table/table.htm b/js/lib/tiny_mce_33/plugins/table/table.htm similarity index 100% rename from js/legacy/tiny_mce_33/plugins/table/table.htm rename to js/lib/tiny_mce_33/plugins/table/table.htm diff --git a/js/legacy/tiny_mce_33/plugins/template/blank.htm b/js/lib/tiny_mce_33/plugins/template/blank.htm similarity index 100% rename from js/legacy/tiny_mce_33/plugins/template/blank.htm rename to js/lib/tiny_mce_33/plugins/template/blank.htm diff --git a/js/legacy/tiny_mce_33/plugins/template/css/template.css b/js/lib/tiny_mce_33/plugins/template/css/template.css similarity index 100% rename from js/legacy/tiny_mce_33/plugins/template/css/template.css rename to js/lib/tiny_mce_33/plugins/template/css/template.css diff --git a/js/legacy/tiny_mce_33/plugins/template/editor_plugin.js b/js/lib/tiny_mce_33/plugins/template/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/template/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/template/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/template/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/template/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/template/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/template/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/template/js/template.js b/js/lib/tiny_mce_33/plugins/template/js/template.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/template/js/template.js rename to js/lib/tiny_mce_33/plugins/template/js/template.js diff --git a/js/legacy/tiny_mce_33/plugins/template/langs/en_dlg.js b/js/lib/tiny_mce_33/plugins/template/langs/en_dlg.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/template/langs/en_dlg.js rename to js/lib/tiny_mce_33/plugins/template/langs/en_dlg.js diff --git a/js/legacy/tiny_mce_33/plugins/template/template.htm b/js/lib/tiny_mce_33/plugins/template/template.htm similarity index 100% rename from js/legacy/tiny_mce_33/plugins/template/template.htm rename to js/lib/tiny_mce_33/plugins/template/template.htm diff --git a/js/legacy/tiny_mce_33/plugins/visualchars/editor_plugin.js b/js/lib/tiny_mce_33/plugins/visualchars/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/visualchars/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/visualchars/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/visualchars/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/visualchars/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/visualchars/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/visualchars/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/wordcount/editor_plugin.js b/js/lib/tiny_mce_33/plugins/wordcount/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/wordcount/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/wordcount/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/wordcount/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/wordcount/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/wordcount/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/wordcount/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/xhtmlxtras/abbr.htm b/js/lib/tiny_mce_33/plugins/xhtmlxtras/abbr.htm similarity index 100% rename from js/legacy/tiny_mce_33/plugins/xhtmlxtras/abbr.htm rename to js/lib/tiny_mce_33/plugins/xhtmlxtras/abbr.htm diff --git a/js/legacy/tiny_mce_33/plugins/xhtmlxtras/acronym.htm b/js/lib/tiny_mce_33/plugins/xhtmlxtras/acronym.htm similarity index 100% rename from js/legacy/tiny_mce_33/plugins/xhtmlxtras/acronym.htm rename to js/lib/tiny_mce_33/plugins/xhtmlxtras/acronym.htm diff --git a/js/legacy/tiny_mce_33/plugins/xhtmlxtras/attributes.htm b/js/lib/tiny_mce_33/plugins/xhtmlxtras/attributes.htm similarity index 100% rename from js/legacy/tiny_mce_33/plugins/xhtmlxtras/attributes.htm rename to js/lib/tiny_mce_33/plugins/xhtmlxtras/attributes.htm diff --git a/js/legacy/tiny_mce_33/plugins/xhtmlxtras/cite.htm b/js/lib/tiny_mce_33/plugins/xhtmlxtras/cite.htm similarity index 100% rename from js/legacy/tiny_mce_33/plugins/xhtmlxtras/cite.htm rename to js/lib/tiny_mce_33/plugins/xhtmlxtras/cite.htm diff --git a/js/legacy/tiny_mce_33/plugins/xhtmlxtras/css/attributes.css b/js/lib/tiny_mce_33/plugins/xhtmlxtras/css/attributes.css similarity index 100% rename from js/legacy/tiny_mce_33/plugins/xhtmlxtras/css/attributes.css rename to js/lib/tiny_mce_33/plugins/xhtmlxtras/css/attributes.css diff --git a/js/legacy/tiny_mce_33/plugins/xhtmlxtras/css/popup.css b/js/lib/tiny_mce_33/plugins/xhtmlxtras/css/popup.css similarity index 100% rename from js/legacy/tiny_mce_33/plugins/xhtmlxtras/css/popup.css rename to js/lib/tiny_mce_33/plugins/xhtmlxtras/css/popup.css diff --git a/js/legacy/tiny_mce_33/plugins/xhtmlxtras/del.htm b/js/lib/tiny_mce_33/plugins/xhtmlxtras/del.htm similarity index 100% rename from js/legacy/tiny_mce_33/plugins/xhtmlxtras/del.htm rename to js/lib/tiny_mce_33/plugins/xhtmlxtras/del.htm diff --git a/js/legacy/tiny_mce_33/plugins/xhtmlxtras/editor_plugin.js b/js/lib/tiny_mce_33/plugins/xhtmlxtras/editor_plugin.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/xhtmlxtras/editor_plugin.js rename to js/lib/tiny_mce_33/plugins/xhtmlxtras/editor_plugin.js diff --git a/js/legacy/tiny_mce_33/plugins/xhtmlxtras/editor_plugin_src.js b/js/lib/tiny_mce_33/plugins/xhtmlxtras/editor_plugin_src.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/xhtmlxtras/editor_plugin_src.js rename to js/lib/tiny_mce_33/plugins/xhtmlxtras/editor_plugin_src.js diff --git a/js/legacy/tiny_mce_33/plugins/xhtmlxtras/ins.htm b/js/lib/tiny_mce_33/plugins/xhtmlxtras/ins.htm similarity index 100% rename from js/legacy/tiny_mce_33/plugins/xhtmlxtras/ins.htm rename to js/lib/tiny_mce_33/plugins/xhtmlxtras/ins.htm diff --git a/js/legacy/tiny_mce_33/plugins/xhtmlxtras/js/abbr.js b/js/lib/tiny_mce_33/plugins/xhtmlxtras/js/abbr.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/xhtmlxtras/js/abbr.js rename to js/lib/tiny_mce_33/plugins/xhtmlxtras/js/abbr.js diff --git a/js/legacy/tiny_mce_33/plugins/xhtmlxtras/js/acronym.js b/js/lib/tiny_mce_33/plugins/xhtmlxtras/js/acronym.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/xhtmlxtras/js/acronym.js rename to js/lib/tiny_mce_33/plugins/xhtmlxtras/js/acronym.js diff --git a/js/legacy/tiny_mce_33/plugins/xhtmlxtras/js/attributes.js b/js/lib/tiny_mce_33/plugins/xhtmlxtras/js/attributes.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/xhtmlxtras/js/attributes.js rename to js/lib/tiny_mce_33/plugins/xhtmlxtras/js/attributes.js diff --git a/js/legacy/tiny_mce_33/plugins/xhtmlxtras/js/cite.js b/js/lib/tiny_mce_33/plugins/xhtmlxtras/js/cite.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/xhtmlxtras/js/cite.js rename to js/lib/tiny_mce_33/plugins/xhtmlxtras/js/cite.js diff --git a/js/legacy/tiny_mce_33/plugins/xhtmlxtras/js/del.js b/js/lib/tiny_mce_33/plugins/xhtmlxtras/js/del.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/xhtmlxtras/js/del.js rename to js/lib/tiny_mce_33/plugins/xhtmlxtras/js/del.js diff --git a/js/legacy/tiny_mce_33/plugins/xhtmlxtras/js/element_common.js b/js/lib/tiny_mce_33/plugins/xhtmlxtras/js/element_common.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/xhtmlxtras/js/element_common.js rename to js/lib/tiny_mce_33/plugins/xhtmlxtras/js/element_common.js diff --git a/js/legacy/tiny_mce_33/plugins/xhtmlxtras/js/ins.js b/js/lib/tiny_mce_33/plugins/xhtmlxtras/js/ins.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/xhtmlxtras/js/ins.js rename to js/lib/tiny_mce_33/plugins/xhtmlxtras/js/ins.js diff --git a/js/legacy/tiny_mce_33/plugins/xhtmlxtras/langs/en_dlg.js b/js/lib/tiny_mce_33/plugins/xhtmlxtras/langs/en_dlg.js similarity index 100% rename from js/legacy/tiny_mce_33/plugins/xhtmlxtras/langs/en_dlg.js rename to js/lib/tiny_mce_33/plugins/xhtmlxtras/langs/en_dlg.js diff --git a/js/legacy/tiny_mce_33/themes/advanced/about.htm b/js/lib/tiny_mce_33/themes/advanced/about.htm similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/about.htm rename to js/lib/tiny_mce_33/themes/advanced/about.htm diff --git a/js/legacy/tiny_mce_33/themes/advanced/anchor.htm b/js/lib/tiny_mce_33/themes/advanced/anchor.htm similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/anchor.htm rename to js/lib/tiny_mce_33/themes/advanced/anchor.htm diff --git a/js/legacy/tiny_mce_33/themes/advanced/charmap.htm b/js/lib/tiny_mce_33/themes/advanced/charmap.htm similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/charmap.htm rename to js/lib/tiny_mce_33/themes/advanced/charmap.htm diff --git a/js/legacy/tiny_mce_33/themes/advanced/color_picker.htm b/js/lib/tiny_mce_33/themes/advanced/color_picker.htm similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/color_picker.htm rename to js/lib/tiny_mce_33/themes/advanced/color_picker.htm diff --git a/js/legacy/tiny_mce_33/themes/advanced/editor_template.js b/js/lib/tiny_mce_33/themes/advanced/editor_template.js similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/editor_template.js rename to js/lib/tiny_mce_33/themes/advanced/editor_template.js diff --git a/js/legacy/tiny_mce_33/themes/advanced/editor_template_src.js b/js/lib/tiny_mce_33/themes/advanced/editor_template_src.js similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/editor_template_src.js rename to js/lib/tiny_mce_33/themes/advanced/editor_template_src.js diff --git a/js/legacy/tiny_mce_33/themes/advanced/image.htm b/js/lib/tiny_mce_33/themes/advanced/image.htm similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/image.htm rename to js/lib/tiny_mce_33/themes/advanced/image.htm diff --git a/js/legacy/tiny_mce_33/themes/advanced/img/colorpicker.jpg b/js/lib/tiny_mce_33/themes/advanced/img/colorpicker.jpg similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/img/colorpicker.jpg rename to js/lib/tiny_mce_33/themes/advanced/img/colorpicker.jpg diff --git a/js/legacy/tiny_mce_33/themes/advanced/img/icons.gif b/js/lib/tiny_mce_33/themes/advanced/img/icons.gif similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/img/icons.gif rename to js/lib/tiny_mce_33/themes/advanced/img/icons.gif diff --git a/js/legacy/tiny_mce_33/themes/advanced/js/about.js b/js/lib/tiny_mce_33/themes/advanced/js/about.js similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/js/about.js rename to js/lib/tiny_mce_33/themes/advanced/js/about.js diff --git a/js/legacy/tiny_mce_33/themes/advanced/js/anchor.js b/js/lib/tiny_mce_33/themes/advanced/js/anchor.js similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/js/anchor.js rename to js/lib/tiny_mce_33/themes/advanced/js/anchor.js diff --git a/js/legacy/tiny_mce_33/themes/advanced/js/charmap.js b/js/lib/tiny_mce_33/themes/advanced/js/charmap.js similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/js/charmap.js rename to js/lib/tiny_mce_33/themes/advanced/js/charmap.js diff --git a/js/legacy/tiny_mce_33/themes/advanced/js/color_picker.js b/js/lib/tiny_mce_33/themes/advanced/js/color_picker.js similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/js/color_picker.js rename to js/lib/tiny_mce_33/themes/advanced/js/color_picker.js diff --git a/js/legacy/tiny_mce_33/themes/advanced/js/image.js b/js/lib/tiny_mce_33/themes/advanced/js/image.js similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/js/image.js rename to js/lib/tiny_mce_33/themes/advanced/js/image.js diff --git a/js/legacy/tiny_mce_33/themes/advanced/js/link.js b/js/lib/tiny_mce_33/themes/advanced/js/link.js similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/js/link.js rename to js/lib/tiny_mce_33/themes/advanced/js/link.js diff --git a/js/legacy/tiny_mce_33/themes/advanced/js/source_editor.js b/js/lib/tiny_mce_33/themes/advanced/js/source_editor.js similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/js/source_editor.js rename to js/lib/tiny_mce_33/themes/advanced/js/source_editor.js diff --git a/js/legacy/tiny_mce_33/themes/advanced/langs/en.js b/js/lib/tiny_mce_33/themes/advanced/langs/en.js similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/langs/en.js rename to js/lib/tiny_mce_33/themes/advanced/langs/en.js diff --git a/js/legacy/tiny_mce_33/themes/advanced/langs/en_dlg.js b/js/lib/tiny_mce_33/themes/advanced/langs/en_dlg.js similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/langs/en_dlg.js rename to js/lib/tiny_mce_33/themes/advanced/langs/en_dlg.js diff --git a/js/legacy/tiny_mce_33/themes/advanced/link.htm b/js/lib/tiny_mce_33/themes/advanced/link.htm similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/link.htm rename to js/lib/tiny_mce_33/themes/advanced/link.htm diff --git a/js/legacy/tiny_mce_33/themes/advanced/skins/default/content.css b/js/lib/tiny_mce_33/themes/advanced/skins/default/content.css similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/skins/default/content.css rename to js/lib/tiny_mce_33/themes/advanced/skins/default/content.css diff --git a/js/legacy/tiny_mce_33/themes/advanced/skins/default/dialog.css b/js/lib/tiny_mce_33/themes/advanced/skins/default/dialog.css similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/skins/default/dialog.css rename to js/lib/tiny_mce_33/themes/advanced/skins/default/dialog.css diff --git a/js/legacy/tiny_mce_33/themes/advanced/skins/default/img/buttons.png b/js/lib/tiny_mce_33/themes/advanced/skins/default/img/buttons.png similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/skins/default/img/buttons.png rename to js/lib/tiny_mce_33/themes/advanced/skins/default/img/buttons.png diff --git a/js/legacy/tiny_mce_33/themes/advanced/skins/default/img/items.gif b/js/lib/tiny_mce_33/themes/advanced/skins/default/img/items.gif similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/skins/default/img/items.gif rename to js/lib/tiny_mce_33/themes/advanced/skins/default/img/items.gif diff --git a/js/legacy/tiny_mce_33/themes/advanced/skins/default/img/menu_arrow.gif b/js/lib/tiny_mce_33/themes/advanced/skins/default/img/menu_arrow.gif similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/skins/default/img/menu_arrow.gif rename to js/lib/tiny_mce_33/themes/advanced/skins/default/img/menu_arrow.gif diff --git a/js/legacy/tiny_mce_33/themes/advanced/skins/default/img/menu_check.gif b/js/lib/tiny_mce_33/themes/advanced/skins/default/img/menu_check.gif similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/skins/default/img/menu_check.gif rename to js/lib/tiny_mce_33/themes/advanced/skins/default/img/menu_check.gif diff --git a/js/legacy/tiny_mce_33/themes/advanced/skins/default/img/progress.gif b/js/lib/tiny_mce_33/themes/advanced/skins/default/img/progress.gif similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/skins/default/img/progress.gif rename to js/lib/tiny_mce_33/themes/advanced/skins/default/img/progress.gif diff --git a/js/legacy/tiny_mce_33/themes/advanced/skins/default/img/tabs.gif b/js/lib/tiny_mce_33/themes/advanced/skins/default/img/tabs.gif similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/skins/default/img/tabs.gif rename to js/lib/tiny_mce_33/themes/advanced/skins/default/img/tabs.gif diff --git a/js/legacy/tiny_mce_33/themes/advanced/skins/default/ui.css b/js/lib/tiny_mce_33/themes/advanced/skins/default/ui.css similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/skins/default/ui.css rename to js/lib/tiny_mce_33/themes/advanced/skins/default/ui.css diff --git a/js/legacy/tiny_mce_33/themes/advanced/skins/o2k7/content.css b/js/lib/tiny_mce_33/themes/advanced/skins/o2k7/content.css similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/skins/o2k7/content.css rename to js/lib/tiny_mce_33/themes/advanced/skins/o2k7/content.css diff --git a/js/legacy/tiny_mce_33/themes/advanced/skins/o2k7/dialog.css b/js/lib/tiny_mce_33/themes/advanced/skins/o2k7/dialog.css similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/skins/o2k7/dialog.css rename to js/lib/tiny_mce_33/themes/advanced/skins/o2k7/dialog.css diff --git a/js/legacy/tiny_mce_33/themes/advanced/skins/o2k7/img/button_bg.png b/js/lib/tiny_mce_33/themes/advanced/skins/o2k7/img/button_bg.png similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/skins/o2k7/img/button_bg.png rename to js/lib/tiny_mce_33/themes/advanced/skins/o2k7/img/button_bg.png diff --git a/js/legacy/tiny_mce_33/themes/advanced/skins/o2k7/img/button_bg_black.png b/js/lib/tiny_mce_33/themes/advanced/skins/o2k7/img/button_bg_black.png similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/skins/o2k7/img/button_bg_black.png rename to js/lib/tiny_mce_33/themes/advanced/skins/o2k7/img/button_bg_black.png diff --git a/js/legacy/tiny_mce_33/themes/advanced/skins/o2k7/img/button_bg_silver.png b/js/lib/tiny_mce_33/themes/advanced/skins/o2k7/img/button_bg_silver.png similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/skins/o2k7/img/button_bg_silver.png rename to js/lib/tiny_mce_33/themes/advanced/skins/o2k7/img/button_bg_silver.png diff --git a/js/legacy/tiny_mce_33/themes/advanced/skins/o2k7/ui.css b/js/lib/tiny_mce_33/themes/advanced/skins/o2k7/ui.css similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/skins/o2k7/ui.css rename to js/lib/tiny_mce_33/themes/advanced/skins/o2k7/ui.css diff --git a/js/legacy/tiny_mce_33/themes/advanced/skins/o2k7/ui_black.css b/js/lib/tiny_mce_33/themes/advanced/skins/o2k7/ui_black.css similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/skins/o2k7/ui_black.css rename to js/lib/tiny_mce_33/themes/advanced/skins/o2k7/ui_black.css diff --git a/js/legacy/tiny_mce_33/themes/advanced/skins/o2k7/ui_silver.css b/js/lib/tiny_mce_33/themes/advanced/skins/o2k7/ui_silver.css similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/skins/o2k7/ui_silver.css rename to js/lib/tiny_mce_33/themes/advanced/skins/o2k7/ui_silver.css diff --git a/js/legacy/tiny_mce_33/themes/advanced/source_editor.htm b/js/lib/tiny_mce_33/themes/advanced/source_editor.htm similarity index 100% rename from js/legacy/tiny_mce_33/themes/advanced/source_editor.htm rename to js/lib/tiny_mce_33/themes/advanced/source_editor.htm diff --git a/js/legacy/tiny_mce_33/themes/simple/editor_template.js b/js/lib/tiny_mce_33/themes/simple/editor_template.js similarity index 100% rename from js/legacy/tiny_mce_33/themes/simple/editor_template.js rename to js/lib/tiny_mce_33/themes/simple/editor_template.js diff --git a/js/legacy/tiny_mce_33/themes/simple/editor_template_src.js b/js/lib/tiny_mce_33/themes/simple/editor_template_src.js similarity index 100% rename from js/legacy/tiny_mce_33/themes/simple/editor_template_src.js rename to js/lib/tiny_mce_33/themes/simple/editor_template_src.js diff --git a/js/legacy/tiny_mce_33/themes/simple/img/icons.gif b/js/lib/tiny_mce_33/themes/simple/img/icons.gif similarity index 100% rename from js/legacy/tiny_mce_33/themes/simple/img/icons.gif rename to js/lib/tiny_mce_33/themes/simple/img/icons.gif diff --git a/js/legacy/tiny_mce_33/themes/simple/langs/en.js b/js/lib/tiny_mce_33/themes/simple/langs/en.js similarity index 100% rename from js/legacy/tiny_mce_33/themes/simple/langs/en.js rename to js/lib/tiny_mce_33/themes/simple/langs/en.js diff --git a/js/legacy/tiny_mce_33/themes/simple/skins/default/content.css b/js/lib/tiny_mce_33/themes/simple/skins/default/content.css similarity index 100% rename from js/legacy/tiny_mce_33/themes/simple/skins/default/content.css rename to js/lib/tiny_mce_33/themes/simple/skins/default/content.css diff --git a/js/legacy/tiny_mce_33/themes/simple/skins/default/ui.css b/js/lib/tiny_mce_33/themes/simple/skins/default/ui.css similarity index 100% rename from js/legacy/tiny_mce_33/themes/simple/skins/default/ui.css rename to js/lib/tiny_mce_33/themes/simple/skins/default/ui.css diff --git a/js/legacy/tiny_mce_33/themes/simple/skins/o2k7/content.css b/js/lib/tiny_mce_33/themes/simple/skins/o2k7/content.css similarity index 100% rename from js/legacy/tiny_mce_33/themes/simple/skins/o2k7/content.css rename to js/lib/tiny_mce_33/themes/simple/skins/o2k7/content.css diff --git a/js/legacy/tiny_mce_33/themes/simple/skins/o2k7/img/button_bg.png b/js/lib/tiny_mce_33/themes/simple/skins/o2k7/img/button_bg.png similarity index 100% rename from js/legacy/tiny_mce_33/themes/simple/skins/o2k7/img/button_bg.png rename to js/lib/tiny_mce_33/themes/simple/skins/o2k7/img/button_bg.png diff --git a/js/legacy/tiny_mce_33/themes/simple/skins/o2k7/ui.css b/js/lib/tiny_mce_33/themes/simple/skins/o2k7/ui.css similarity index 100% rename from js/legacy/tiny_mce_33/themes/simple/skins/o2k7/ui.css rename to js/lib/tiny_mce_33/themes/simple/skins/o2k7/ui.css diff --git a/js/legacy/tiny_mce_33/tiny_mce.js b/js/lib/tiny_mce_33/tiny_mce.js similarity index 100% rename from js/legacy/tiny_mce_33/tiny_mce.js rename to js/lib/tiny_mce_33/tiny_mce.js diff --git a/js/legacy/tiny_mce_33/tiny_mce_popup.js b/js/lib/tiny_mce_33/tiny_mce_popup.js similarity index 100% rename from js/legacy/tiny_mce_33/tiny_mce_popup.js rename to js/lib/tiny_mce_33/tiny_mce_popup.js diff --git a/js/legacy/tiny_mce_33/tiny_mce_src.js b/js/lib/tiny_mce_33/tiny_mce_src.js similarity index 100% rename from js/legacy/tiny_mce_33/tiny_mce_src.js rename to js/lib/tiny_mce_33/tiny_mce_src.js diff --git a/js/legacy/tiny_mce_33/utils/editable_selects.js b/js/lib/tiny_mce_33/utils/editable_selects.js similarity index 100% rename from js/legacy/tiny_mce_33/utils/editable_selects.js rename to js/lib/tiny_mce_33/utils/editable_selects.js diff --git a/js/legacy/tiny_mce_33/utils/form_utils.js b/js/lib/tiny_mce_33/utils/form_utils.js similarity index 100% rename from js/legacy/tiny_mce_33/utils/form_utils.js rename to js/lib/tiny_mce_33/utils/form_utils.js diff --git a/js/legacy/tiny_mce_33/utils/mctabs.js b/js/lib/tiny_mce_33/utils/mctabs.js similarity index 100% rename from js/legacy/tiny_mce_33/utils/mctabs.js rename to js/lib/tiny_mce_33/utils/mctabs.js diff --git a/js/legacy/tiny_mce_33/utils/validate.js b/js/lib/tiny_mce_33/utils/validate.js similarity index 100% rename from js/legacy/tiny_mce_33/utils/validate.js rename to js/lib/tiny_mce_33/utils/validate.js diff --git a/js/wn/ui/listing.js b/js/wn/ui/listing.js index 468105f36a..f4ae547dfa 100644 --- a/js/wn/ui/listing.js +++ b/js/wn/ui/listing.js @@ -82,7 +82,7 @@ wn.ui.Listing = Class.extend({ \

%(title)s

\
\ -
\ +
\ \ Refresh\ \ @@ -168,23 +168,28 @@ wn.ui.Listing = Class.extend({ newdoc(me.new_doctype); }) } else { - this.$w.find('.btn-new').toggle(false); + this.$w.find('.btn-new').toggle(false).attr('hidden', 'true'); } // hide-filter if(!me.show_filters) { - this.$w.find('.btn-filter').toggle(false); + this.$w.find('.btn-filter').toggle(false).attr('hidden', 'true'); } // hide-refresh if(this.hide_refresh || this.no_refresh) { - this.$w.find('.btn-refresh').toggle(false); + this.$w.find('.btn-refresh').toggle(false).attr('hidden', 'true'); } // toggle-view if(this.show_grid) { this.$w.find('.select-view').toggle(true); } + + // btn group only if more than 1 button + if(this.$w.find('.list-toolbar [hidden!="true"]').length>1) { + this.$w.find('.list-toolbar').addClass('btn-group') + } }, make_filters: function() { this.filter_list = new wn.ui.FilterList({ diff --git a/py/build/bundle.py b/py/build/bundle.py index 16fa2e28aa..7c99216f5e 100644 --- a/py/build/bundle.py +++ b/py/build/bundle.py @@ -60,7 +60,7 @@ class Bundle: # append if suffix=='concat' or out_type != 'js': - outtxt += data + outtxt += '\n' + data + '\n' else: jsm = JavascriptMinify() tmpin = StringIO(data) diff --git a/py/webnotes/widgets/search.py b/py/webnotes/widgets/search.py index e24733a322..febdac6ece 100644 --- a/py/webnotes/widgets/search.py +++ b/py/webnotes/widgets/search.py @@ -84,7 +84,7 @@ def build_for_autosuggest(res): if len(info) > 30: info = info[:30] + '...' - results.append({'id':r[0], 'value':r[0], 'info':info}) + results.append({'label':r[0], 'value':r[0], 'info':info}) return results def scrub_custom_query(query, key, txt): From 3992715e0f16c54ff657db08f9d8df6c740fb677 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 9 Mar 2012 17:51:46 +0530 Subject: [PATCH 14/54] search selector fix for link --- css/ui/list.css | 5 +++++ js/legacy/webpage/search.js | 15 ++++++++++----- js/wn/ui/listing.js | 16 ++++++++-------- 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/css/ui/list.css b/css/ui/list.css index 243d40399b..c56d33a0f9 100644 --- a/css/ui/list.css +++ b/css/ui/list.css @@ -21,6 +21,11 @@ div.list-row:hover { background-color: #eef } +div.paging-button { + text-align: center; + padding: 11px 0px; +} + div.show_filters { display: none; } diff --git a/js/legacy/webpage/search.js b/js/legacy/webpage/search.js index 503c033463..2a7197a6d1 100644 --- a/js/legacy/webpage/search.js +++ b/js/legacy/webpage/search.js @@ -27,7 +27,7 @@ search_fields = {}; function setlinkvalue(name) { //selector.input.set(name);// in local - this will be set onchange - selector.input.set_input(name); // on screen + selector.input.set_input_value(name); // on screen selector.hide(); } @@ -130,8 +130,8 @@ function makeselector() { } } d.onhide = function() { - if(d.input && d.input.txt) // link, call onchange - d.input.txt.onchange() + //if(d.input && d.input.txt) // link, call onchange + // d.input.txt.set_input_value() } btn.onclick = function() { @@ -191,10 +191,15 @@ function makeselector() { var w = $a(d.rows['Result'],'div','',{height:'240px',overflow:'auto',margin:'4px'}); for(var i=0; i\
\ -
\ +
\
\ \ -
\ -
\ +
\ +
\
\
\ ', this.opts)); @@ -168,17 +168,17 @@ wn.ui.Listing = Class.extend({ newdoc(me.new_doctype); }) } else { - this.$w.find('.btn-new').toggle(false).attr('hidden', 'true'); + this.$w.find('.btn-new').toggle(false).attr('hidden', 'hidden'); } // hide-filter if(!me.show_filters) { - this.$w.find('.btn-filter').toggle(false).attr('hidden', 'true'); + this.$w.find('.btn-filter').toggle(false).attr('hidden', 'hidden'); } // hide-refresh if(this.hide_refresh || this.no_refresh) { - this.$w.find('.btn-refresh').toggle(false).attr('hidden', 'true'); + this.$w.find('.btn-refresh').toggle(false).attr('hidden', 'hidden'); } // toggle-view @@ -187,7 +187,7 @@ wn.ui.Listing = Class.extend({ } // btn group only if more than 1 button - if(this.$w.find('.list-toolbar [hidden!="true"]').length>1) { + if(this.$w.find('.list-toolbar a[hidden!="hidden"]').length>1) { this.$w.find('.list-toolbar').addClass('btn-group') } }, @@ -216,7 +216,7 @@ wn.ui.Listing = Class.extend({ this.onrun = a0; if(a0 && a0.callback) this.onrun = a0.callback; - if(!a1 || (a0 && a0.append)) + if(!a1 && !(a0 && a0.append)) this.start = 0; me.$w.find('.img-load').toggle(true); From 450d711362234ff05c86fc7005fece832edb153d Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 9 Mar 2012 18:16:01 +0530 Subject: [PATCH 15/54] datafield onupdate chain broken - fix --- js/legacy/widgets/form/fields.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/js/legacy/widgets/form/fields.js b/js/legacy/widgets/form/fields.js index 25eafad25f..47e45ad448 100644 --- a/js/legacy/widgets/form/fields.js +++ b/js/legacy/widgets/form/fields.js @@ -408,6 +408,11 @@ DataField.prototype.make_input = function() { } this.input.name = this.df.fieldname; + + $(this.input).change(function() { + me.set_value($(this).val()); + }); + this.set_value = function(val) { if(!me.last_value)me.last_value=''; @@ -457,7 +462,7 @@ DataField.prototype.make_input = function() { }); }, select: function(event, ui) { - me.set_value(ui.item.value); + me.set_input_value(ui.item.value); return false; } }); @@ -753,12 +758,6 @@ LinkField.prototype.set_input_value = function(val) { ); } -LinkField.prototype.set_onchange = function() { - var me = this; - $(me.txt).change(function(event) { - - }); -} LinkField.prototype.set_fetch_values = function(fetch_values) { var fl = cur_frm.fetch_dict[this.df.fieldname].fields; var changed_fields = []; From 40ecf115215dc6e87f15638020c89ca767a94c5f Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 12 Mar 2012 13:22:16 +0530 Subject: [PATCH 16/54] fixed autosuggest for non form fields, email removed moduledef in core, erpnext --- js/legacy/globals.js | 4 +- js/legacy/widgets/form/email.js | 96 ++++++++++---------- js/legacy/widgets/form/fields.js | 1 + js/legacy/widgets/form/form.js | 2 - js/legacy/widgets/form/grid.js | 2 +- js/legacy/widgets/tabbedpage.js | 2 - js/wn/ui/dialog.js | 3 - js/wn/ui/listing.js | 7 ++ py/core/Module Def/Core/Core.txt | 84 ----------------- py/core/Role/Administrator/Administrator.txt | 27 ------ py/core/Role/All/All.txt | 26 ------ py/core/Role/Guest/Guest.txt | 50 ---------- py/core/__init__.py | 59 ++---------- 13 files changed, 62 insertions(+), 301 deletions(-) delete mode 100644 py/core/Module Def/Core/Core.txt delete mode 100644 py/core/Role/Administrator/Administrator.txt delete mode 100644 py/core/Role/All/All.txt delete mode 100644 py/core/Role/Guest/Guest.txt diff --git a/js/legacy/globals.js b/js/legacy/globals.js index 57326a0947..b1ace0a897 100644 --- a/js/legacy/globals.js +++ b/js/legacy/globals.js @@ -30,7 +30,6 @@ var user_fullname=null; var user_email=null; var user_img = {}; var home_page=null; -var hide_autosuggest=null; var page_body=null; var pscript = {}; @@ -61,5 +60,4 @@ var cur_frm=null; var pscript = {}; var validated = true; var validation_message = ''; -var tinymce_loaded = null; -var cur_autosug = null; \ No newline at end of file +var tinymce_loaded = null; \ No newline at end of file diff --git a/js/legacy/widgets/form/email.js b/js/legacy/widgets/form/email.js index 6f012b8b50..d7be5ea68b 100644 --- a/js/legacy/widgets/form/email.js +++ b/js/legacy/widgets/form/email.js @@ -90,7 +90,7 @@ _e.make = function() { } d.onhide = function() { - hide_autosuggest(); + } d.make_body([ @@ -107,57 +107,53 @@ _e.make = function() { $td(d.rows['Format'].tab,0,1).cur_sel = d.widgets['Format']; - // ---- add auto suggest ---- - var opts = { script: '', json: true, maxresults: 10 }; + function split( val ) { + return val.split( /,\s*/ ); + } + function extractLast( term ) { + return split(term).pop(); + } - wn.require('lib/js/legacy/widgets/autosuggest.js'); - var as = new AutoSuggest(d.widgets['To'], opts); - as.custom_select = function(txt, sel) { - // ---- add to the last comma ---- - var r = ''; - var tl = txt.split(','); - for(var i=0;i Date: Mon, 12 Mar 2012 14:35:01 +0530 Subject: [PATCH 17/54] modules cleanup --- js/legacy/webpage/page.js | 11 +- py/core/doctype/module_def/module_def.py | 74 ---- py/core/doctype/page_template/__init__.py | 0 .../doctype/page_template/page_template.py | 42 --- .../doctype/page_template/page_template.txt | 160 --------- py/core/doctype/stylesheet/__init__.py | 0 py/core/doctype/stylesheet/stylesheet.py | 40 --- py/core/doctype/stylesheet/stylesheet.txt | 160 --------- py/webnotes/model/code.py | 29 +- py/webnotes/model/doctype.py | 53 --- py/webnotes/modules/__init__.py | 321 +++--------------- py/webnotes/modules/module_manager.py | 35 -- py/webnotes/modules/patch_handler.py | 4 +- py/webnotes/utils/transfer.py | 26 -- py/webnotes/widgets/page.py | 79 ++--- py/webnotes/widgets/tags.py | 2 +- 16 files changed, 85 insertions(+), 951 deletions(-) delete mode 100644 py/core/doctype/module_def/module_def.py delete mode 100644 py/core/doctype/page_template/__init__.py delete mode 100644 py/core/doctype/page_template/page_template.py delete mode 100644 py/core/doctype/page_template/page_template.txt delete mode 100644 py/core/doctype/stylesheet/__init__.py delete mode 100644 py/core/doctype/stylesheet/stylesheet.py delete mode 100644 py/core/doctype/stylesheet/stylesheet.txt delete mode 100644 py/webnotes/modules/module_manager.py diff --git a/js/legacy/webpage/page.js b/js/legacy/webpage/page.js index c9a33f64e6..d70ed79baa 100644 --- a/js/legacy/webpage/page.js +++ b/js/legacy/webpage/page.js @@ -22,8 +22,6 @@ // PAGE -var stylesheets = []; - function Page(page_name, content) { var me = this; this.name = page_name; @@ -76,12 +74,6 @@ function render_page(page_name, menuitem) { // style if(pdoc.style) set_style(pdoc.style) - // stylesheet - if(pdoc.stylesheet) { - set_style(locals.Stylesheet[pdoc.stylesheet].stylesheet); - stylesheets.push(pdoc.stylesheet); - } - // create page var p = new Page(page_name, pdoc._Page__content?pdoc._Page__content:pdoc.content); // script @@ -102,6 +94,5 @@ function refresh_page(page_name) { var fn = function(r, rt) { render_page(page_name) } - $c('webnotes.widgets.page.getpage', {'name':page_name, - stylesheets:JSON.stringify(stylesheets)}, fn); + $c('webnotes.widgets.page.getpage', {'name':page_name}, fn); } diff --git a/py/core/doctype/module_def/module_def.py b/py/core/doctype/module_def/module_def.py deleted file mode 100644 index a3c0b887fe..0000000000 --- a/py/core/doctype/module_def/module_def.py +++ /dev/null @@ -1,74 +0,0 @@ -# Copyright (c) 2012 Web Notes Technologies Pvt Ltd (http://erpnext.com) -# -# MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -# PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -# CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE -# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -# Please edit this list and import only required elements -import webnotes - -from webnotes.utils import add_days, add_months, add_years, cint, cstr, date_diff, default_fields, flt, fmt_money, formatdate, generate_hash, getTraceback, get_defaults, get_first_day, get_last_day, getdate, has_common, month_name, now, nowdate, replace_newlines, sendmail, set_default, str_esc_quote, user_format, validate_email_add -from webnotes.model import db_exists -from webnotes.model.doc import Document, addchild, removechild, getchildren, make_autoname, SuperDocType -from webnotes.model.doclist import getlist, copy_doclist -from webnotes.model.code import get_obj, get_server_obj, run_server_obj, updatedb, check_syntax -from webnotes import session, form, is_testing, msgprint, errprint - -set = webnotes.conn.set -sql = webnotes.conn.sql -get_value = webnotes.conn.get_value -in_transaction = webnotes.conn.in_transaction -convert_to_lists = webnotes.conn.convert_to_lists - -# ----------------------------------------------------------------------------------------- - - -class DocType: - def __init__(self,d,dl): - self.doc, self.doclist = d,dl - - def generate_children(self): - if not getlist(self.doclist,'items') and not self.doc.widget_code: - obj = Document(self.doc.doctype, self.doc.name) - - doc_type = [['DocType','name','name','Forms',"(istable is null or istable=0) and (issingle is null or issingle=0)"],['Page','name','page_name','Pages','(show_in_menu=1 or show_in_menu=0)'],['Search Criteria','doc_type','criteria_name','Reports',"(disabled is null or disabled=0)"]] - for dt in doc_type: - dn = [[d[0] or '', d[1] or ''] for d in sql("select %s,%s from `tab%s` where module = '%s' and %s" % (dt[1],dt[2],dt[0],self.doc.name,dt[4]))] - - if dn: - r = addchild(obj,'items','Module Def Item',1) - r.doc_type = 'Separator' - r.doc_name = dt[3] - r.save(1) - - for d in dn: - r = addchild(obj,'items','Module Def Item',1) - r.doc_type = dt[3] - r.doc_name = d[0] - r.display_name = d[1] - r.save(1) - - def on_update(self, from_update=0): - from webnotes import defs - from webnotes.utils.transfer import in_transfer - - if (not in_transfer) and getattr(defs,'developer_mode', 0): - from webnotes.modules.export_module import export_to_files - export_to_files(record_list=[[self.doc.doctype, self.doc.name]]) - \ No newline at end of file diff --git a/py/core/doctype/page_template/__init__.py b/py/core/doctype/page_template/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/py/core/doctype/page_template/page_template.py b/py/core/doctype/page_template/page_template.py deleted file mode 100644 index 3fb9e22106..0000000000 --- a/py/core/doctype/page_template/page_template.py +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (c) 2012 Web Notes Technologies Pvt Ltd (http://erpnext.com) -# -# MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -# PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -# CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE -# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -import webnotes - -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d,dl - - # export - def on_update(self): - import webnotes.defs - from webnotes.modules.export_module import export_to_files - from webnotes.modules import get_module_path, scrub - import os - - if hasattr(webnotes.defs, 'developer_mode') and webnotes.defs.developer_mode: - - export_to_files(record_list=[['Page Template', self.doc.name]]) - - file = open(os.path.join(get_module_path(self.doc.module), 'Page Template', self.doc.name, self.doc.name + '.html'), 'w') - file.write(self.doc.content) - file.close() \ No newline at end of file diff --git a/py/core/doctype/page_template/page_template.txt b/py/core/doctype/page_template/page_template.txt deleted file mode 100644 index a1b0bfc577..0000000000 --- a/py/core/doctype/page_template/page_template.txt +++ /dev/null @@ -1,160 +0,0 @@ -[ - { - 'allow_attach': None, - 'allow_copy': None, - 'allow_email': None, - 'allow_print': None, - 'allow_rename': None, - 'allow_trash': None, - 'autoname': 'field:template_name', - 'change_log': None, - 'client_script': None, - 'client_script_core': None, - 'client_string': None, - 'colour': 'White:FFF', - 'creation': '2011-04-05 10:01:43', - 'description': 'Page Template is used in the CMS. In Page, if you select a template, the page appears within the template.\n\nNote: The template must have a "%(content)s" for string replacement and all % must be %%!\n\nIn developer_mode, the template is saved to the file system. ', - 'docstatus': 0, - 'doctype': 'DocType', - 'document_type': None, - 'dt_template': None, - 'hide_heading': None, - 'hide_toolbar': None, - 'idx': None, - 'in_create': None, - 'in_dialog': None, - 'is_transaction_doc': None, - 'issingle': None, - 'istable': None, - 'max_attachments': None, - 'menu_index': None, - 'modified': '2011-02-21 17:10:06', - 'modified_by': 'Administrator', - 'module': 'Core', - 'name': 'Page Template', - 'name_case': None, - 'owner': 'Administrator', - 'parent': None, - 'parent_node': None, - 'parentfield': None, - 'parenttype': None, - 'print_outline': None, - 'read_only': None, - 'read_only_onload': None, - 'search_fields': None, - 'section_style': 'Simple', - 'server_code': None, - 'server_code_compiled': None, - 'server_code_core': None, - 'server_code_error': None, - 'show_in_menu': None, - 'smallicon': None, - 'use_template': None, - 'version': 6 - }, - { - 'allow_on_submit': None, - 'colour': None, - 'creation': '2011-04-05 10:01:43', - 'default': None, - 'depends_on': None, - 'description': None, - 'docstatus': 0, - 'doctype': 'DocField', - 'fieldname': 'template_name', - 'fieldtype': 'Data', - 'hidden': None, - 'icon': None, - 'idx': 1, - 'in_filter': None, - 'label': 'Template Name', - 'modified': '2011-04-05 10:01:43', - 'modified_by': 'Administrator', - 'name': '000000434', - 'no_copy': None, - 'oldfieldname': None, - 'oldfieldtype': None, - 'options': None, - 'owner': 'Administrator', - 'parent': 'Page Template', - 'parentfield': 'fields', - 'parenttype': 'DocType', - 'permlevel': 0, - 'print_hide': None, - 'report_hide': None, - 'reqd': 1, - 'search_index': None, - 'trigger': None, - 'width': None - }, - { - 'allow_on_submit': None, - 'colour': None, - 'creation': '2011-04-05 10:01:43', - 'default': None, - 'depends_on': None, - 'description': None, - 'docstatus': 0, - 'doctype': 'DocField', - 'fieldname': 'module', - 'fieldtype': 'Link', - 'hidden': None, - 'icon': None, - 'idx': 2, - 'in_filter': None, - 'label': 'Module', - 'modified': '2011-04-05 10:01:43', - 'modified_by': 'Administrator', - 'name': '000000435', - 'no_copy': None, - 'oldfieldname': None, - 'oldfieldtype': None, - 'options': 'Module Def', - 'owner': 'Administrator', - 'parent': 'Page Template', - 'parentfield': 'fields', - 'parenttype': 'DocType', - 'permlevel': 0, - 'print_hide': None, - 'report_hide': None, - 'reqd': None, - 'search_index': None, - 'trigger': None, - 'width': None - }, - { - 'allow_on_submit': None, - 'colour': None, - 'creation': '2011-04-05 10:01:43', - 'default': None, - 'depends_on': None, - 'description': None, - 'docstatus': 0, - 'doctype': 'DocField', - 'fieldname': 'template', - 'fieldtype': 'Code', - 'hidden': None, - 'icon': None, - 'idx': 3, - 'in_filter': None, - 'label': 'Template', - 'modified': '2011-04-05 10:01:43', - 'modified_by': 'Administrator', - 'name': '000000436', - 'no_copy': None, - 'oldfieldname': None, - 'oldfieldtype': None, - 'options': None, - 'owner': 'Administrator', - 'parent': 'Page Template', - 'parentfield': 'fields', - 'parenttype': 'DocType', - 'permlevel': 0, - 'print_hide': None, - 'report_hide': None, - 'reqd': None, - 'search_index': None, - 'trigger': None, - 'width': None - } -] \ No newline at end of file diff --git a/py/core/doctype/stylesheet/__init__.py b/py/core/doctype/stylesheet/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/py/core/doctype/stylesheet/stylesheet.py b/py/core/doctype/stylesheet/stylesheet.py deleted file mode 100644 index 7273e4cc4f..0000000000 --- a/py/core/doctype/stylesheet/stylesheet.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) 2012 Web Notes Technologies Pvt Ltd (http://erpnext.com) -# -# MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -# PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -# CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE -# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d,dl - - # export - def on_update(self): - import webnotes.defs - - if hasattr(webnotes.defs, 'developer_mode') and webnotes.defs.developer_mode: - from webnotes.modules.export_module import export_to_files - from webnotes.modules import get_module_path, scurb - import os - - export_to_files(record_list=[['Stylesheet', self.doc.name]]) - - file = open(os.path.join(get_module_path(self.doc.module), 'Stylesheet', scrub(self.doc.name), scrub(self.doc.name) + '.html'), 'w') - file.write(self.doc.content) - file.close() \ No newline at end of file diff --git a/py/core/doctype/stylesheet/stylesheet.txt b/py/core/doctype/stylesheet/stylesheet.txt deleted file mode 100644 index a067224731..0000000000 --- a/py/core/doctype/stylesheet/stylesheet.txt +++ /dev/null @@ -1,160 +0,0 @@ -[ - { - 'allow_attach': None, - 'allow_copy': None, - 'allow_email': None, - 'allow_print': None, - 'allow_rename': None, - 'allow_trash': None, - 'autoname': 'field:stylesheet_name', - 'change_log': None, - 'client_script': None, - 'client_script_core': None, - 'client_string': None, - 'colour': 'White:FFF', - 'creation': '2011-04-05 10:01:46', - 'description': None, - 'docstatus': 0, - 'doctype': 'DocType', - 'document_type': None, - 'dt_template': None, - 'hide_heading': None, - 'hide_toolbar': None, - 'idx': None, - 'in_create': None, - 'in_dialog': None, - 'is_transaction_doc': None, - 'issingle': None, - 'istable': None, - 'max_attachments': None, - 'menu_index': None, - 'modified': '2011-02-21 17:10:05', - 'modified_by': 'Administrator', - 'module': 'Core', - 'name': 'Stylesheet', - 'name_case': None, - 'owner': 'Administrator', - 'parent': None, - 'parent_node': None, - 'parentfield': None, - 'parenttype': None, - 'print_outline': None, - 'read_only': None, - 'read_only_onload': None, - 'search_fields': None, - 'section_style': 'Simple', - 'server_code': None, - 'server_code_compiled': None, - 'server_code_core': None, - 'server_code_error': None, - 'show_in_menu': None, - 'smallicon': None, - 'use_template': None, - 'version': 4 - }, - { - 'allow_on_submit': None, - 'colour': None, - 'creation': '2011-04-05 10:01:46', - 'default': None, - 'depends_on': None, - 'description': None, - 'docstatus': 0, - 'doctype': 'DocField', - 'fieldname': 'stylesheet_name', - 'fieldtype': 'Data', - 'hidden': None, - 'icon': None, - 'idx': 1, - 'in_filter': None, - 'label': 'Stylesheet Name', - 'modified': '2011-04-05 10:01:46', - 'modified_by': 'Administrator', - 'name': '000000459', - 'no_copy': None, - 'oldfieldname': None, - 'oldfieldtype': None, - 'options': None, - 'owner': 'Administrator', - 'parent': 'Stylesheet', - 'parentfield': 'fields', - 'parenttype': 'DocType', - 'permlevel': 0, - 'print_hide': None, - 'report_hide': None, - 'reqd': 1, - 'search_index': None, - 'trigger': None, - 'width': None - }, - { - 'allow_on_submit': None, - 'colour': None, - 'creation': '2011-04-05 10:01:46', - 'default': None, - 'depends_on': None, - 'description': None, - 'docstatus': 0, - 'doctype': 'DocField', - 'fieldname': 'module', - 'fieldtype': 'Link', - 'hidden': None, - 'icon': None, - 'idx': 2, - 'in_filter': None, - 'label': 'Module', - 'modified': '2011-04-05 10:01:46', - 'modified_by': 'Administrator', - 'name': '000000460', - 'no_copy': None, - 'oldfieldname': None, - 'oldfieldtype': None, - 'options': 'Module Def', - 'owner': 'Administrator', - 'parent': 'Stylesheet', - 'parentfield': 'fields', - 'parenttype': 'DocType', - 'permlevel': 0, - 'print_hide': None, - 'report_hide': None, - 'reqd': None, - 'search_index': None, - 'trigger': None, - 'width': None - }, - { - 'allow_on_submit': None, - 'colour': None, - 'creation': '2011-04-05 10:01:46', - 'default': None, - 'depends_on': None, - 'description': None, - 'docstatus': 0, - 'doctype': 'DocField', - 'fieldname': 'stylesheet', - 'fieldtype': 'Code', - 'hidden': None, - 'icon': None, - 'idx': 3, - 'in_filter': None, - 'label': 'Stylesheet', - 'modified': '2011-04-05 10:01:46', - 'modified_by': 'Administrator', - 'name': '000000461', - 'no_copy': None, - 'oldfieldname': None, - 'oldfieldtype': None, - 'options': None, - 'owner': 'Administrator', - 'parent': 'Stylesheet', - 'parentfield': 'fields', - 'parenttype': 'DocType', - 'permlevel': 0, - 'print_hide': None, - 'report_hide': None, - 'reqd': None, - 'search_index': None, - 'trigger': None, - 'width': None - } -] \ No newline at end of file diff --git a/py/webnotes/model/code.py b/py/webnotes/model/code.py index 354ff50b11..23db8d2337 100644 --- a/py/webnotes/model/code.py +++ b/py/webnotes/model/code.py @@ -105,13 +105,9 @@ def get_custom_script(doctype, script_type): Returns custom script if set in doctype `Custom Script` """ import webnotes - try: - custom_script = webnotes.conn.sql("select script from `tabCustom Script` where dt=%s and script_type=%s", (doctype, script_type)) - except Exception, e: - if e.args[0]==1146: - return None - else: raise e - + custom_script = webnotes.conn.sql("""select script from `tabCustom Script` + where dt=%s and script_type=%s""", (doctype, script_type)) + if custom_script and custom_script[0][0]: return custom_script[0][0] @@ -121,7 +117,7 @@ def get_server_obj(doc, doclist = [], basedoctype = ''): """ # for test import webnotes - + from webnotes.modules import scrub # get doctype details module = webnotes.conn.get_value('DocType', doc.doctype, 'module') @@ -130,14 +126,13 @@ def get_server_obj(doc, doclist = [], basedoctype = ''): if not module: return - module = module.replace(' ','_').lower() - dt = doc.doctype.replace(' ','_').replace('-', '_').lower() + module = scrub(module) + dt = scrub(doc.doctype) - # import try: - exec 'from %s.doctype.%s.%s import DocType' % (module, dt, dt) + module = __import__('%s.doctype.%s.%s' % (module, dt, dt), fromlist=['']) + DocType = getattr(module, 'DocType') except ImportError, e: - # declare it here class DocType: def __init__(self, d, dl): self.doc, self.doclist = d, dl @@ -145,7 +140,7 @@ def get_server_obj(doc, doclist = [], basedoctype = ''): # custom? custom_script = get_custom_script(doc.doctype, 'Server') if custom_script: - global custom_class + global custom_class exec custom_class + custom_script.replace('\t',' ') in locals() @@ -203,13 +198,13 @@ def check_syntax(code): return '' #=================================================================================== -def get_code(module, dt, dn, extn, is_static=None, fieldname=None): +def get_code(module, dt, dn, extn, fieldname=None): from webnotes.modules import scrub, get_module_path import os, webnotes # get module (if required) if not module: - module = webnotes.conn.sql("select module from `tab%s` where name=%s" % (dt,'%s'),dn)[0][0] + module = webnotes.conn.get_value(dt, dn, 'module') # no module, quit if not module: @@ -221,8 +216,6 @@ def get_code(module, dt, dn, extn, is_static=None, fieldname=None): # get file name fname = dn + '.' + extn - if is_static: - fname = dn + '_static.' + extn # code code = '' diff --git a/py/webnotes/model/doctype.py b/py/webnotes/model/doctype.py index 2e660cf940..dcaaa4a84b 100644 --- a/py/webnotes/model/doctype.py +++ b/py/webnotes/model/doctype.py @@ -166,56 +166,6 @@ class _DocType: fields[d.get('fieldname') or d.get('label')] = d return fields - def _update_field_properties(self, doclist): - """ - Updates properties like description, depends on from the database based on the timestamp - of the .txt file. Adds a column _last_updated if not exists in the database and uses - it to update the file.. - - This feature is built because description is changed / updated quite often and is tedious to - write a patch every time. Can be extended to cover more updates - """ - - update_fields = ('description', 'depends_on') - - from webnotes.modules import get_item_file - from webnotes.utils import get_file_timestamp - - doc = doclist[0] # main doc - file_name = get_item_file(doc.module, 'DocType', doc.name) - time_stamp = get_file_timestamp(file_name) - last_update = self._get_last_update(doc.name) - - # this is confusing because we are updating the fields of fields - - if last_update != time_stamp: - - # there are updates! - fields = self._get_fields(file_name) - if fields: - for d in doclist: - - # for each field in teh outgoing doclist - if d.doctype=='DocField': - key = d.fieldname or d.label - - # if it has a fieldname or label - if key and key in fields: - - # update the values - for field_to_update in update_fields: - if field_to_update in fields[key] and fields[key][field_to_update] != d.fields[field_to_update]: - new_value = fields[key][field_to_update] - - # in doclist - d.fields[field_to_update] = new_value - - # in database - webnotes.conn.sql("update tabDocField set `%s` = %s where parent=%s and `%s`=%s" % \ - (field_to_update, '%s', '%s', (d.fieldname and 'fieldname' or 'label'), '%s'), \ - (new_value, doc.name, key)) - - webnotes.conn.sql("update tabDocType set _last_update=%s where name=%s", (time_stamp, doc.name)) def _override_field_properties(self, doclist): """ @@ -370,7 +320,6 @@ class _DocType: # yes doclist = webnotes.model.doc.get('DocType', self.name, 1) - self._update_field_properties(doclist) self._override_field_properties(doclist) # table doctypes @@ -385,8 +334,6 @@ class _DocType: else: doclist = self._load_from_cache() - from webnotes.modules import Module - doc = doclist[0] # add custom script if present diff --git a/py/webnotes/modules/__init__.py b/py/webnotes/modules/__init__.py index 6c7f5e5b60..7329f8f296 100644 --- a/py/webnotes/modules/__init__.py +++ b/py/webnotes/modules/__init__.py @@ -31,61 +31,56 @@ def scrub(txt): return txt.replace(' ','_').replace('-', '_').replace('/', '_').lower() def scrub_dt_dn(dt, dn): - """ - Returns in lowercase and code friendly names of doctype and name for certain types - """ + """Returns in lowercase and code friendly names of doctype and name for certain types""" ndt, ndn = dt, dn if dt.lower() in ('doctype', 'search criteria', 'page'): ndt, ndn = scrub(dt), scrub(dn) return ndt, ndn - -def get_item_file(module, dt, dn): - """ - Returns the path of the item file - """ - import os - ndt, ndn = scrub_dt_dn(dt, dn) - - return os.path.join(get_module_path(module), ndt, ndn, ndn + '.txt') - -def get_item_timestamp(module, dt, dn): - """ - Return ths timestamp of the given item (if exists) - """ - from webnotes.utils import get_file_timestamp - return get_file_timestamp(get_item_file(module, dt, dn)) - def get_module_path(module): - """ - Returns path of the given module (imports it and reads it from __file__) - """ - return Module(module).get_path() - -def get_doc_path(dt, dn, module=None): - """ - Return the path to a particular doc folder - """ - import os + """Returns path of the given module""" + import os, webnotes.defs + m = scrub(module) + + if m in ('core'): + return os.path.join(webnotes.defs.modules_path, '..', 'lib', 'py', 'core') + else: + return os.path.join(webnotes.defs.modules_path, m) - if not module: - if dt=='Module Def': - module=dn - else: - module = webnotes.conn.get_value(dt, dn, 'module') - ndt, ndn = scrub_dt_dn(dt, dn) +def reload_doc(module, dt=None, dn=None): + """reload single / list of records""" + if type(module) is list: + for m in module: + reload_single_doc(m[0], m[1], m[2]) + else: + reload_single_doc(module, dt, dn) + +def reload_single_doc(module, dt, dn): + """Sync a file from txt""" + import os + dt, dn = scrub_dt_dn(dt, dn) - return os.path.join(get_module_path(module), ndt, ndn) + path = os.path.join(get_module_path(module), + os.path.join(dt, dn, dn + '.txt')) + + if os.path.exists(path): + from webnotes.model.utils import peval_doclist + + with open(path, 'r') as f: + doclist = peval_doclist(f.read()) + + if doclist: + from webnotes.utils.transfer import set_doc + set_doc(doclist, 1, 1, 1) + + # since there is a new timestamp on the file, update timestamp in + webnotes.conn.sql("update `tab%s` set modified=now() where name=%s" \ + % (doclist[0]['doctype'], '%s'), doclist[0]['name']) + else: + raise Exception, '%s missing' % path -def reload_doc(module, dt, dn): - """ - Sync a file from txt to module - Alias for:: - Module(module).reload(dt, dn) - """ - Module(module).reload(dt, dn) def export_doc(doctype, name): """write out a doc""" @@ -95,236 +90,12 @@ def export_doc(doctype, name): doclist = [d.fields for d in webnotes.model.doc.get(doctype, name)] write_document_file(doclist, module) +def get_all_modules(): + """Return list of all modules""" + import webnotes.defs + from webnotes.modules.utils import listfolders -class ModuleManager: - """ - Module manager class, used to run functions on all modules - """ - - def get_all_modules(self): - """ - Return list of all modules - """ - import webnotes.defs - from webnotes.modules.utils import listfolders - - if hasattr(webnotes.defs, 'modules_path'): - return listfolders(webnotes.defs.modules_path, 1) - - -class Module: - """ - Represents a module in the framework, has classes for syncing files - """ - def __init__(self, name): - self.name = name - self.path = None - self.sync_types = ['txt','sql'] - self.code_types = ['js','css','py','html','sql'] - - def get_path(self): - """ - Returns path of the module (imports it and reads it from __file__) - """ - if not self.path: - - import webnotes.defs, os - - try: - # by import - exec ('import ' + scrub(self.name)) in locals() - self.path = eval(scrub(self.name) + '.__file__') - self.path = os.path.sep.join(self.path.split(os.path.sep)[:-1]) - except ImportError, e: - # force - self.path = os.path.join(webnotes.defs.modules_path, scrub(self.name)) - - return self.path - - def get_doc_file(self, dt, dn, extn='.txt'): - """ - Return file of a doc - """ - dt, dn = scrub_dt_dn(dt, dn) - return self.get_file(dt, dn, dn + extn) - - def get_file(self, *path): - """ - Returns ModuleFile object, in path specifiy the package name and file name - For example:: - Module('accounts').get_file('doctype','account','account.txt') - """ - import os - path = os.path.join(self.get_path(), os.path.join(*path)) - if path.endswith('.txt'): - return TxtModuleFile(path) - if path.endswith('.sql'): - return SqlModuleFile(path) - if path.endswith('.js'): - return JsModuleFile(path) - else: - return ModuleFile(path) - - def reload(self, dt, dn): - """ - Sync the file to the db - """ - import os - dt, dn = scrub_dt_dn(dt, dn) - path = os.path.exists(os.path.join(self.get_path(), os.path.join(dt, dn, dn + '.txt'))) - if not path: - webnotes.msgprint("%s not found" % path) - else: - self.get_file(dt, dn, dn + '.txt').sync(force=1) - - def sync_all_of_type(self, extn, verbose=0): - """ - Walk through all the files in the modules and sync all files of - a particular type - """ - import os - ret = [] - for walk_tuple in os.walk(self.get_path()): - for f in walk_tuple[2]: - if f.split('.')[-1] == extn: - path = os.path.relpath(os.path.join(walk_tuple[0], f), self.get_path()) - self.get_file(path).sync() - if verbose: - print 'complete: ' + path - - def sync_all(self, verbose=0): - """ - Walk through all the files in the modules and sync all files - """ - import os - self.sync_all_of_type('txt', verbose) - self.sync_all_of_type('sql', verbose) - -class ModuleFile: - """ - Module file class. - - Module files can be dynamically generated by specifying first line is "#!python" - the output - """ - def __init__(self, path): - self.path = path - - def load_content(self): - """ - returns file contents - """ - import os - if os.path.exists(self.path): - f = open(self.path,'r') - self.content = f.read() - f.close() - else: - self.content = '' - - return self.content - - def read(self, do_execute = None): - """ - Return the file content, if dynamic, execute it - """ - self.load_content() - if do_execute and self.content.startswith('#!python'): - from webnotes.model.code import execute - self.content = execute(self.content) + if hasattr(webnotes.defs, 'modules_path'): + return listfolders(webnotes.defs.modules_path, 1) - return self.content - - -class TxtModuleFile(ModuleFile): - """ - Class for .txt files, sync the doclist in the txt file into the database - """ - def __init__(self, path): - ModuleFile.__init__(self, path) - - def sync(self, force=1): - """ - import the doclist if new - """ - from webnotes.model.utils import peval_doclist - doclist = peval_doclist(self.read()) - if doclist: - from webnotes.utils.transfer import set_doc - set_doc(doclist, 1, 1, 1) - - # since there is a new timestamp on the file, update timestamp in - # the record - webnotes.conn.sql("update `tab%s` set modified=now() where name=%s" \ - % (doclist[0]['doctype'], '%s'), doclist[0]['name']) - - -class SqlModuleFile(ModuleFile): - def __init__(self, path): - ModuleFile.__init__(self, path) - - def sync(self): - """ - execute the sql if new - The caller must either commit or rollback an open transaction - """ - - content = self.read() - - # execute everything but selects - # theses are ddl statements, should either earlier - # changes must be committed or rollbacked - # by the caller - if content.strip().split()[0].lower() in ('insert','update','delete','create','alter','drop'): - webnotes.conn.sql(self.read()) - - # start a new transaction, as we have to update - # the timestamp table - webnotes.conn.begin() - -class JsModuleFile(ModuleFile): - """ - JS File. read method will read file and replace all $import() with relevant code - Example:: - $import(accounts/common.js) - """ - def __init__(self, path): - ModuleFile.__init__(self, path) - - def get_js(self, match): - """ - New style will expect file path or doctype - - """ - name = match.group('name') - custom = '' - - import webnotes.defs, os - - if os.path.sep in name: - module = name.split(os.path.sep)[0] - path = os.path.join(Module(module).get_path(), os.path.sep.join(name.split(os.path.sep)[1:])) - else: - # its a doctype - path = os.path.join(get_doc_path('DocType', name), scrub(name) + '.js') - - # add custom script if present - from webnotes.model.code import get_custom_script - custom = get_custom_script(name, 'Client') or '' - - return JsModuleFile(path).read() + '\n' + custom - - def read(self): - """ - return js content (replace $imports if needed) - """ - self.load_content() - code = self.content - - if code and code.strip(): - import re - p = re.compile('\$import\( (?P [^)]*) \)', re.VERBOSE) - - code = p.sub(self.get_js, code) - - return code + \ No newline at end of file diff --git a/py/webnotes/modules/module_manager.py b/py/webnotes/modules/module_manager.py deleted file mode 100644 index 0b273f9da1..0000000000 --- a/py/webnotes/modules/module_manager.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2012 Web Notes Technologies Pvt Ltd (http://erpnext.com) -# -# MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -# PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -# CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE -# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -""" - Deprecated: Will be deleted -""" - -def reload_doc(module, dt, dn): - "alias for webnotes.modules.import_module.import_file" - from webnotes.modules import reload_doc - reload_doc(module, dt, dn) - - - - - diff --git a/py/webnotes/modules/patch_handler.py b/py/webnotes/modules/patch_handler.py index 65091d990e..badf5aaeba 100644 --- a/py/webnotes/modules/patch_handler.py +++ b/py/webnotes/modules/patch_handler.py @@ -45,8 +45,8 @@ def run_all(patch_list=None): def reload_doc(args): """relaod a doc args {module, doctype, docname}""" - import webnotes.modules.module_manager - run_single(method = webnotes.modules.module_manager.reload_doc, methodargs = args) + import webnotes.modules + run_single(method = webnotes.modules.reload_doc, methodargs = args) def run_single(patchmodule=None, method=None, methodargs=None, force=False): """run a single patch""" diff --git a/py/webnotes/utils/transfer.py b/py/webnotes/utils/transfer.py index bb9e879395..28c1c34424 100644 --- a/py/webnotes/utils/transfer.py +++ b/py/webnotes/utils/transfer.py @@ -52,8 +52,6 @@ def set_doc(doclist, ovr=0, ignore=1, onupdate=1): if dt=='DocType': ud = UpdateDocType(doclist) - elif dt == 'Module Def': - ud = UpdateModuleDef(doclist) elif dt == 'DocType Mapper': ud = UpdateDocTypeMapper(doclist) else: @@ -301,30 +299,6 @@ class UpdateDocType(UpdateDocumentMerge): so.on_update() -class UpdateModuleDef(UpdateDocumentMerge): - """ - Merge `Module Def` - """ - def __init__(self, in_doclist): - UpdateDocumentMerge.__init__(self, in_doclist) - self.to_update_doctype = ['Module Def', 'Module Def Item'] - - def get_id(self, d): - return webnotes.conn.sql("select name from `tabModule Def Item` where doc_type=%s and doc_name=%s and display_name=%s and parent=%s", (d.doc_type, d.doc_name, d.display_name, d.parent)) - - def to_update(self, d): - if d.doctype=='Module Def Item': return 1 - - def get_orignal_values(self, d): - if d.doctype=='Module Def Item': - return {'name': self.get_id(d)[0][0]} - if d.doctype=='Module Def': - return webnotes.conn.sql("select module_seq, disabled, is_hidden from `tabModule Def` where name=%s", d.name, as_dict = 1)[0] - - def run_on_update(self): - # no scripts for Module Def - pass - class UpdateDocTypeMapper(UpdateDocumentMerge): """ diff --git a/py/webnotes/widgets/page.py b/py/webnotes/widgets/page.py index 5d4e13ac1f..c680a69151 100644 --- a/py/webnotes/widgets/page.py +++ b/py/webnotes/widgets/page.py @@ -36,94 +36,63 @@ class Page: def __init__(self, name): self.name = name - def get_from_files(self, doc, module): + def get_from_files(self, doc): """ Loads page info from files in module """ - # load js - doc.fields['__script'] = module.get_doc_file('page',doc.name,'.js').read() or doc.script + from webnotes.modules import get_module_path, scrub + import os + + path = os.path.join(get_module_path(doc.module), 'page', scrub(doc.name)) + + # script + fpath = os.path.join(path, scrub(doc.name) + '.js') + if os.path.exists(fpath): + with open(fpath, 'r') as f: + doc.fields['__script'] = f.read() doc.script = None - # load css - css = module.get_doc_file('page',doc.name,'.css').read() - if css: doc.style = css + # css + fpath = os.path.join(path, scrub(doc.name) + '.css') + if os.path.exists(fpath): + with open(fpath, 'r') as f: + doc.style = f.read() # html - doc.content = module.get_doc_file('page',doc.name,'.html').read() or doc.content + fpath = os.path.join(path, scrub(doc.name) + '.html') + if os.path.exists(fpath): + with open(fpath, 'r') as f: + doc.content = f.read() - def get_template(self, template): - """ - Returns the page template content - """ - ret = '%(content)s' - # load code from template - if template: - from webnotes.modules import Module - ret = Module(webnotes.conn.get_value('Page Template', template, 'module'))\ - .get_doc_file('Page Template', template, '.html').read() - if not ret: - ret = webnotes.conn.get_value('Page Template', template, 'template') - - return ret - def process_content(self, doc): """ Put in template and generate dynamic if starts with #!python """ - template = self.get_template(doc.template) content = '' # eval content if doc.content and doc.content.startswith('#!python'): from webnotes.model.code import execute - content = template % {'content': execute(doc.content).get('content')} + doc.__content = execute(doc.content).get('content') else: - content = template % {'content': doc.content or ''} - - doc.__content = content + doc.__content = content def load(self): """ Returns :term:`doclist` of the `Page` - """ - from webnotes.modules import Module - + """ doclist = webnotes.model.doc.get('Page', self.name) doc = doclist[0] # load from module if doc.module: - module = Module(doc.module) - self.get_from_files(doc, module) + self.get_from_files(doc) # process self.process_content(doc) - - # add stylesheet - if doc.stylesheet: - doclist += self.load_stylesheet(doc.stylesheet) return doclist - def load_stylesheet(self, stylesheet): - import webnotes - # load stylesheet - loaded = eval(webnotes.form_dict.get('stylesheets') or '[]') - if not stylesheet in loaded: - import webnotes.model.doc - from webnotes.modules import Module - - # doclist - sslist = webnotes.model.doc.get('Stylesheet', stylesheet) - - # stylesheet from file - css = Module(sslist[0].module).get_doc_file('Stylesheet', stylesheet, '.css').read() - - if css: sslist[0].stylesheet = css - return sslist - else: - return [] - @webnotes.whitelist() def get(name): """ diff --git a/py/webnotes/widgets/tags.py b/py/webnotes/widgets/tags.py index 6116485281..59a227059b 100644 --- a/py/webnotes/widgets/tags.py +++ b/py/webnotes/widgets/tags.py @@ -152,7 +152,7 @@ class DocTags: def setup_tags(self): """creates the tabTag table if not exists""" webnotes.conn.commit() - from webnotes.modules.module_manager import reload_doc + from webnotes.modules import reload_doc reload_doc('core','doctype','tag') webnotes.conn.begin() From 198901be306578197193fe5c08deac80130e8202 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 12 Mar 2012 16:12:16 +0530 Subject: [PATCH 18/54] style fixes --- css/legacy/autosuggest.css | 91 ------------------ css/legacy/body.css | 7 +- css/legacy/forms.css | 16 +++- js/legacy/utils/handler.js | 2 +- js/legacy/webpage/uploader.js | 2 +- js/legacy/widgets/export_query.js | 2 +- js/legacy/widgets/form/fields.js | 6 +- js/legacy/widgets/form/form.js | 2 +- js/legacy/widgets/form/form_fields.js | 113 ++++------------------- js/legacy/widgets/layout.js | 2 +- js/legacy/wn/widgets/form/attachments.js | 3 +- js/wn/ui/listing.js | 11 ++- py/webnotes/model/doctype.py | 5 + 13 files changed, 62 insertions(+), 200 deletions(-) delete mode 100644 css/legacy/autosuggest.css diff --git a/css/legacy/autosuggest.css b/css/legacy/autosuggest.css deleted file mode 100644 index 991221b084..0000000000 --- a/css/legacy/autosuggest.css +++ /dev/null @@ -1,91 +0,0 @@ -/* -================================================ -autosuggest, inquisitor style -================================================ -*/ - -div.autosuggest -{ - position: absolute; - margin-top: 3px; - border: 1px solid #222; -} - -div.autosuggest ul -{ - list-style: none; - margin: 0px; - padding: 2px; - overflow: hidden; - background-color: #FFF; -} - -div.autosuggest ul li -{ - color: #444; - padding: 0; - margin: 0; - text-align: left; -} - -div.autosuggest ul li a -{ - color: #444; - display: block; - text-decoration: none; - position: relative; - padding: 0; - width: 100%; -} -div.autosuggest ul li a:hover -{ - -} -div.autosuggest ul li.as_highlight a:hover -{ - background-color: #45A; - color: #FFF; -} - -div.autosuggest ul li a span -{ - display: block; - padding: 3px 6px; - color: #444; - border-bottom:1px solid #DDD; -} - -div.autosuggest ul li a span small -{ - display: block; - font-weight: normal; - color: #444; -} - -div.autosuggest ul li.as_highlight a span small -{ - color: #FFF; -} - -div.autosuggest ul li.as_highlight a span { - color: #FFF; -} - -div.autosuggest ul li.as_highlight a -{ - color: #FFF; - background-color: #45A; - cursor: pointer; -} - -div.autosuggest ul li.as_warning -{ - font-weight: bold; - text-align: center; -} - -div.autosuggest ul em -{ - font-style: normal; - font-weight: bold; -} diff --git a/css/legacy/body.css b/css/legacy/body.css index df77e1fd41..594a3b97fe 100644 --- a/css/legacy/body.css +++ b/css/legacy/body.css @@ -22,12 +22,15 @@ label { } select, input, textarea { - border: 1px solid #AAA; + border: 1px solid #ccc; -moz-border-radius: 4px; -webkit-border-radius: 4px; font-size: 13px; padding: 4px; - color: #222; + color: #444; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } textarea { diff --git a/css/legacy/forms.css b/css/legacy/forms.css index 92baa8bf43..5fe43eb464 100644 --- a/css/legacy/forms.css +++ b/css/legacy/forms.css @@ -1,5 +1,17 @@ /* FORMS */ +div.form-section-break { + margin: 15px 0px 3px 0px; +} + +div.form-section-break h3 { + line-height: 20px; +} + +div.form-section-break hr { + margin: 9px 0px; +} + div.frm_print_wrapper { background-color:#FFF; @@ -143,9 +155,9 @@ div.time_field select{ .field_description, .help { - margin: 3px 0px 11px 0px; + margin: 3px 0px; + font-size: 11px; color: #888; - font-style: italic; } .field_description_top { diff --git a/js/legacy/utils/handler.js b/js/legacy/utils/handler.js index 4d92c4af7a..0e3c918573 100644 --- a/js/legacy/utils/handler.js +++ b/js/legacy/utils/handler.js @@ -87,7 +87,7 @@ function $c_obj_csv(doclist, method, arg) { args.docs = compress_doclist(doclist); // open - open_url_post(webnotes.request.url, args); + open_url_post(wn.request.url, args); } // call a url as POST diff --git a/js/legacy/webpage/uploader.js b/js/legacy/webpage/uploader.js index 41f309f390..eab84c1ced 100644 --- a/js/legacy/webpage/uploader.js +++ b/js/legacy/webpage/uploader.js @@ -38,7 +38,7 @@ Uploader = function(parent, args, callback) { // upload form var div = $a(parent,'div'); - div.innerHTML = '
'; + div.innerHTML = '
'; var ul_form = div.childNodes[0]; var f_list = []; diff --git a/js/legacy/widgets/export_query.js b/js/legacy/widgets/export_query.js index 427f7bfab4..a046b00d29 100644 --- a/js/legacy/widgets/export_query.js +++ b/js/legacy/widgets/export_query.js @@ -58,5 +58,5 @@ function export_csv(q, report_name, sc_id, is_simple, filter_values, colnames) { if(colnames) args.colnames = colnames.join(','); args.report_name = report_name ? report_name : ''; - open_url_post(webnotes.request.url, args); + open_url_post(wn.request.url, args); } diff --git a/js/legacy/widgets/form/fields.js b/js/legacy/widgets/form/fields.js index 60ce6b1d40..dfac6a9eb5 100644 --- a/js/legacy/widgets/form/fields.js +++ b/js/legacy/widgets/form/fields.js @@ -47,7 +47,7 @@ Field.prototype.make_body = function() { else this.wrapper = document.createElement((this.with_label ? 'div' : 'span')); - this.label_area = $a(this.wrapper, 'div', '', {margin:'8px 0px 2px 0px'}); + this.label_area = $a(this.wrapper, 'div', '', {margin:'0px 0px 2px 0px'}); if(ischk && !this.in_grid) { this.input_area = $a(this.label_area, 'span', '', {marginRight:'4px'}); @@ -84,10 +84,10 @@ Field.prototype.make_body = function() { if(this.label_area) $dh(this.label_area); } else { this.input_area.className = 'input_area'; - $y(this.wrapper,{marginBottom:'4px'}); + $y(this.wrapper,{marginBottom:'9px'}); // set description - this.set_description(); + this.set_description(); } // bind label refresh diff --git a/js/legacy/widgets/form/form.js b/js/legacy/widgets/form/form.js index 8103c825c5..48f6d19fd6 100644 --- a/js/legacy/widgets/form/form.js +++ b/js/legacy/widgets/form/form.js @@ -199,7 +199,7 @@ _f.Frm.prototype.add_description = function() { } this.description_wrapper = $a(this.page_layout.footer.help_area, 'div', - 'info-box', {marginTop:'10px'}, + 'well', {marginTop:'11px'}, wn.md2html.makeHtml('#### Help\n\n' + this.meta.description)); } diff --git a/js/legacy/widgets/form/form_fields.js b/js/legacy/widgets/form/form_fields.js index 6bb28eef18..a0b2bb0da3 100644 --- a/js/legacy/widgets/form/form_fields.js +++ b/js/legacy/widgets/form/form_fields.js @@ -29,7 +29,8 @@ _f.ColumnBreak = function() { } _f.ColumnBreak.prototype.make_body = function() { - if((!this.perm[this.df.permlevel]) || (!this.perm[this.df.permlevel][READ]) || this.df.hidden) { + if((!this.perm[this.df.permlevel]) || (!this.perm[this.df.permlevel][READ]) || + this.df.hidden) { // no display return; } @@ -74,90 +75,6 @@ _f.SectionBreak.prototype.make_row = function() { this.row = this.df.label ? this.frm.layout.addrow() : this.frm.layout.addsubrow(); } -_f.SectionBreak.prototype.make_collapsible = function(head) { - var me = this; - - var div = $a(head,'div','',{paddingBottom: '3px', borderBottom:'1px solid #AAA'}); - if(cur_frm.meta.in_dialog) $y(div, {marginLeft:'8px'}); - - // checkbox - this.chk = $a_input(div, 'checkbox',null,{marginRight:'8px'}) - - // label - if(this.df.label) { - this.label = $a(div, 'h3', '', {display:'inline'}, this.df.label); - } - - - // description - var d = this.df.description; - if(d) { - this.desc_area = $a(div, 'span', 'field_description', {marginLeft:'8px'}); - this.desc_area.innerHTML = d.substr(0,50) + (d.length > 50 ? '...' : ''); - } - - // back to top - var span = $a(div, 'i', 'icon-arrow-up', {cssFloat:'right', marginRight:'8px', - cursor:'pointer', verticalAlign:'middle', marginTop:'7px'}) - span.title = 'Go to top'; - span.onclick = function() { scroll(0, 0); } - - // exp / collapse - - this.chk.onclick = function() { - if(this.checked) me.expand(); - else me.collapse(); - } - - this.expand = function() { - $(me.row.main_body).slideDown(); - } - - this.collapse = function() { - $(me.row.main_body).slideUp(); - } - - // hide by default - if(me.frm.section_count) { - $dh(this.row.main_body); - } else { - this.chk.checked = true; - } -} - -// ====================================================================================== - -_f.SectionBreak.prototype.make_simple_section = function(with_header) { - this.wrapper = $a(this.row.main_head, 'div', '', {margin:'8px 8px 0px 0px'}); - var me = this; - - // colour - if(this.df.colour) { - var col = this.df.colour.split(':')[1]; - if(col!='FFF') { - $y(this.row.sub_wrapper, { margin:'8px', padding: '0px' ,backgroundColor: ('#' + col)} ); - } - } - - if(with_header) { - if(this.df.label && this.df.options!='Simple') { - this.make_collapsible(this.wrapper); - } else { - // divider - $y(this.wrapper, {paddingBottom:'4px'}); - if(this.df.label) { - $a(this.wrapper, 'h3', '', {}, this.df.label); - } - } - } - - // indent - $y(this.row.body, { marginLeft:'17px' }); - -} - -// ====================================================================================== - _f.SectionBreak.prototype.add_to_sections = function() { this.sec_id = this.frm.sections.length; this.frm.sections[this.sec_id] = this; @@ -170,17 +87,25 @@ _f.SectionBreak.prototype.make_body = function() { // no display return; } - var me = this; - if(this.df){ - this.make_row(); - this.make_simple_section(1, 1); - } + this.make_row(); + this.wrapper = $a(this.row.main_head, 'div'); + + if(this.df.label) { + if(!this.df.description) this.df.description = ''; + $(this.wrapper).html(repl('
\ +

%(label)s

\ +
%(description)s
\ +
', this.df)); + } else { + $(this.wrapper).html('
'); + } + + // indent + $y(this.row.body, { marginLeft:'17px' }); } -// ====================================================================================== - _f.SectionBreak.prototype.refresh = function(layout) { var fn = this.df.fieldname?this.df.fieldname:this.df.label; @@ -228,7 +153,7 @@ _f.ImageField.prototype.get_image_src = function(doc) { var img_extn_list = ['gif', 'jpg', 'bmp', 'jpeg', 'jp2', 'cgm', 'ief', 'jpm', 'jpx', 'png', 'tiff', 'jpe', 'tif']; if(in_list(img_extn_list, extn)) { - var src = webnotes.request.url + "?cmd=downloadfile&file_id="+file[1]; + var src = wn.request.url + "?cmd=downloadfile&file_id="+file[1]; } } else { var src = ""; @@ -248,7 +173,7 @@ _f.ImageField.prototype.onrefresh = function() { var doc = locals[this.frm.doctype][this.frm.docname]; if(!this.df.options) var src = this.get_image_src(doc); - else var src = webnotes.request.url + '?cmd=get_file&fname='+this.df.options+"&__account="+account_id + (__sid150 ? ("&sid150="+__sid150) : ''); + else var src = wn.request.url + '?cmd=get_file&fname='+this.df.options+"&__account="+account_id + (__sid150 ? ("&sid150="+__sid150) : ''); if(src) { diff --git a/js/legacy/widgets/layout.js b/js/legacy/widgets/layout.js index ed789ca705..77144fde11 100644 --- a/js/legacy/widgets/layout.js +++ b/js/legacy/widgets/layout.js @@ -122,7 +122,7 @@ function LayoutCell(layout, layoutRow, width) { var h = $a(this.cell, 'div','',{padding:(layout.with_border ? '0px 8px' : '0px')}); - this.wrapper = $a(this.cell, 'div','',{padding:(layout.with_border ? '8px' : '8px 0px')}); + this.wrapper = $a(this.cell, 'div','',{padding:(layout.with_border ? '8px' : '0px')}); layout.cur_cell = this.wrapper; layout.cur_cell.header = h; diff --git a/js/legacy/wn/widgets/form/attachments.js b/js/legacy/wn/widgets/form/attachments.js index bfb0603cdf..e3eda5dd52 100644 --- a/js/legacy/wn/widgets/form/attachments.js +++ b/js/legacy/wn/widgets/form/attachments.js @@ -33,7 +33,8 @@ wn.widgets.form.sidebar.Attachments = function(parent, sidebar, doctype, docname // no attachments if file is unsaved if(this.frm.doc.__islocal) { - this.attach_wrapper.innerHTML = 'Attachments can be uploaded after saving' + this.attach_wrapper.innerHTML = '
Attachments can be \ + uploaded after saving
'; return; } diff --git a/js/wn/ui/listing.js b/js/wn/ui/listing.js index 99f5c516da..fb8c1761ea 100644 --- a/js/wn/ui/listing.js +++ b/js/wn/ui/listing.js @@ -63,6 +63,9 @@ wn.ui.Listing = Class.extend({ prepare_opts: function() { if(this.opts.new_doctype) this.opts.new_doctype = get_doctype_label(this.opts.new_doctype); + if(!this.opts.no_result_message) { + this.opts.no_result_message = 'Nothing to show' + } }, make: function(opts) { if(opts) { @@ -81,7 +84,7 @@ wn.ui.Listing = Class.extend({
\ \

%(title)s

\ -
\ +
\
\ \ Refresh\ @@ -94,7 +97,6 @@ wn.ui.Listing = Class.extend({ class="img-load"/>\
\ \ -
\
\
\
\ @@ -190,6 +192,11 @@ wn.ui.Listing = Class.extend({ if(this.$w.find('.list-toolbar a[hidden!="hidden"]').length>1) { this.$w.find('.list-toolbar').addClass('btn-group') } + + // hide toolbar if nothing to show + if(this.$w.find('.list-toolbar a[hidden!="hidden"]').length==0) { + this.$w.find('.list-toolbar-wrapper').toggle(false); + } }, make_filters: function() { this.filter_list = new wn.ui.FilterList({ diff --git a/py/webnotes/model/doctype.py b/py/webnotes/model/doctype.py index dcaaa4a84b..bf094a862c 100644 --- a/py/webnotes/model/doctype.py +++ b/py/webnotes/model/doctype.py @@ -303,6 +303,11 @@ class _DocType: with open(fpath, 'r') as f: doc.fields['__listjs'] = f.read() + fpath = os.path.join(path, 'help.md') + if os.path.exists(fpath): + with open(fpath, 'r') as f: + doc.fields['description'] = f.read() + def make_doclist(self): """ From dc201588b6ece21268026ed713205ce41e2d3b20 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 13 Mar 2012 15:19:13 +0530 Subject: [PATCH 19/54] fixed list->new->onload hooks --- css/legacy/forms.css | 10 +- js/legacy/webpage/loaders.js | 26 +---- js/legacy/widgets/form/fields.js | 5 +- js/legacy/widgets/form/form.js | 81 +++----------- js/legacy/widgets/form/form_fields.js | 138 +++++++++++++++--------- js/legacy/widgets/form/form_grid.js | 6 +- js/legacy/widgets/layout.js | 2 +- js/legacy/wn/widgets/form/sidebar.js | 24 +++++ js/wn/ui/listing.js | 12 ++- py/core/doctype/docformat/__init__.py | 0 py/core/doctype/docformat/docformat.txt | 62 ----------- 11 files changed, 150 insertions(+), 216 deletions(-) delete mode 100644 py/core/doctype/docformat/__init__.py delete mode 100644 py/core/doctype/docformat/docformat.txt diff --git a/css/legacy/forms.css b/css/legacy/forms.css index 5fe43eb464..b60b360c0f 100644 --- a/css/legacy/forms.css +++ b/css/legacy/forms.css @@ -1,14 +1,14 @@ /* FORMS */ -div.form-section-break { +div.form-section-head { margin: 15px 0px 3px 0px; } -div.form-section-break h3 { +div.form-section-head h3 { line-height: 20px; } -div.form-section-break hr { +div.form-section-head hr { margin: 9px 0px; } @@ -160,6 +160,10 @@ div.time_field select{ color: #888; } +.help ol { + padding-left: 19px; +} + .field_description_top { margin-bottom: 3px; } diff --git a/js/legacy/webpage/loaders.js b/js/legacy/webpage/loaders.js index a91e0b5a0e..3a7cf6b771 100644 --- a/js/legacy/webpage/loaders.js +++ b/js/legacy/webpage/loaders.js @@ -265,35 +265,11 @@ pscript.update_page_history = function(page_name, no_history) { nav_obj.open_notify('Page', page_name, arg, no_history); } -// -// Load Script -// -function loadscript(src, call_back) { - set_loading(); - var script = $a('head','script'); - script.type = 'text/javascript'; - script.src = src; - script.onload = function() { - if(call_back)call_back(); hide_loading(); - } - // IE 6 & 7 - script.onreadystatechange = function() { - if (this.readyState == 'complete' || this.readyState == 'loaded') { - hide_loading(); - call_back(); - } - } -} - // Load DocBrowser // ------------------------------------------------------------------------------- var doc_browser_page; -function loaddocbrowser(dt, label, fields) { - //wn.require('lib/js/wn/pages/doclistview.js'); - //wn.pages.doclistview.show(dt); - //return; - +function loaddocbrowser(dt, label, fields) { wn.require('lib/js/legacy/webpage/docbrowser.js'); dt = get_label_doctype(dt); if(!doc_browser_page) diff --git a/js/legacy/widgets/form/fields.js b/js/legacy/widgets/form/fields.js index dfac6a9eb5..0948dd78f0 100644 --- a/js/legacy/widgets/form/fields.js +++ b/js/legacy/widgets/form/fields.js @@ -134,9 +134,6 @@ Field.prototype.get_status = function() { if(this.not_in_form) { return 'Write'; } - - var fn = this.df.fieldname?this.df.fieldname:this.df.label; - this.df = get_field(this.doctype, fn, this.docname); if(!this.df.permlevel) this.df.permlevel = 0; @@ -990,7 +987,7 @@ SelectField.prototype.make_input = function() { this.set_as_single = function() { var i = this.input; i.multiple = false; - i.style.height = null; // default + i.style.height = null; if(i.lab)$dh(i.lab) } diff --git a/js/legacy/widgets/form/form.js b/js/legacy/widgets/form/form.js index 48f6d19fd6..d74056a6dc 100644 --- a/js/legacy/widgets/form/form.js +++ b/js/legacy/widgets/form/form.js @@ -77,7 +77,6 @@ _f.Frm = function(doctype, parent) { var me = this; this.is_editable = {}; this.opendocs = {}; - this.cur_section = {}; this.sections = []; this.sections_by_label = {}; this.section_count; @@ -184,23 +183,6 @@ _f.Frm.prototype.setup_std_layout = function() { // create fields this.setup_fields_std(); - - // description - if(this.meta.description) - this.add_description(); -} - -// ====================================================================================== - -_f.Frm.prototype.add_description = function() { - if(!wn.md2html) { - wn.require('lib/js/lib/showdown.js'); - wn.md2html = new Showdown.converter(); - } - - this.description_wrapper = $a(this.page_layout.footer.help_area, 'div', - 'well', {marginTop:'11px'}, - wn.md2html.makeHtml('#### Help\n\n' + this.meta.description)); } _f.Frm.prototype.setup_print = function() { @@ -267,10 +249,6 @@ _f.Frm.prototype.email_doc = function() { _f.Frm.prototype.rename_notify = function(dt, old, name) { if(this.doctype != dt) return; - // sections - this.cur_section[name] = this.cur_section[old]; - delete this.cur_section[old]; - // editable this.is_editable[name] = this.is_editable[old]; delete this.is_editable[old]; @@ -298,19 +276,6 @@ _f.Frm.prototype.set_heading = function() { } -// PAGING -// ====================================================================================== - -_f.Frm.prototype.set_section = function(sec_id) { - if(!this.sections[sec_id] || !this.sections[sec_id].expand) - return; // Simple type - - if(this.sections[this.cur_section[this.docname]]) - this.sections[this.cur_section[this.docname]].collapse(); - this.sections[sec_id].expand(); - this.cur_section[this.docname] = sec_id; -} - // SETUP // ====================================================================================== @@ -337,7 +302,7 @@ _f.Frm.prototype.setup_footer = function() { var f = this.page_layout.footer; // save buttom - f.save_area = $a(this.page_layout.footer,'div','',{display:'none'}); + f.save_area = $a(this.page_layout.footer,'div','',{display:'none', marginTop:'11px'}); f.help_area = $a(this.page_layout.footer,'div'); var b = $btn(f.save_area, 'Save', @@ -371,23 +336,23 @@ _f.Frm.prototype.setup_fields_std = function() { var sec; for(var i=0;i
', {label: this.label})); @@ -70,7 +76,9 @@ wn.pages.DocListView = wn.ui.Listing.extend({ args: {doctype: me.doctype}, callback: function() { me.can_delete = wn.model.can_delete(me.doctype); + me.meta = locals.DocType[me.doctype]; me.$page.find('.wnlist-area').empty(), + me.setup_docstatus_filter(); me.setup_listview(); me.init_list(); me.init_stats(); @@ -78,12 +86,25 @@ wn.pages.DocListView = wn.ui.Listing.extend({ } }); }, + setup_docstatus_filter: function() { + var me = this; + this.can_submit = $.map(locals.DocPerm, function(d) { + if(d.parent==me.meta.name && d.submit) return 1 + else return null; + }).length; + if(this.can_submit) { + this.$page.find('.show-docstatus').removeClass('hide'); + this.$page.find('.show-docstatus input').click(function() { + me.run(); + }) + } + }, setup_listview: function() { - if(locals.DocType[this.doctype].__listjs) { - eval(locals.DocType[this.doctype].__listjs); - this.listview = new wn.doclistviews[this.doctype](this.doctype); + if(this.meta.__listjs) { + eval(this.meta.__listjs); + this.listview = new wn.doclistviews[this.doctype](this); } else { - this.listview = new wn.pages.ListView(this.doctype); + this.listview = new wn.pages.ListView(this); } this.listview.parent = this; }, @@ -113,25 +134,25 @@ wn.pages.DocListView = wn.ui.Listing.extend({ get_args: function() { return { doctype: this.doctype, - subject: locals.DocType[this.doctype].subject, - fields: JSON.stringify(this.get_query_fields()), - filters: JSON.stringify(this.filter_list.get_filters()) + fields: this.get_query_fields(), + filters: this.filter_list.get_filters(), + docstatus: this.can_submit ? $.map(this.$page.find('.show-docstatus :checked'), + function(inp) { return $(inp).attr('data-docstatus') }) : [] } }, add_delete_option: function() { var me = this; if(this.can_delete) { this.add_button('\ - Delete', function() { me.delete_items },'.btn-filter') + Delete', + function() { me.delete_items(); },'.btn-filter') } }, delete_items: function() { var me = this; - var dl = []; - me.$w.find('.list-check :checked').each(function() { - dl.push($(this).data('name')); + var dl = $.map(me.$page.find('.list-check :checked'), function(e) { + return $(e).data('name'); }); - if(!dl.length) return; if(!confirm('This is PERMANENT action and you cannot undo. Continue?')) { @@ -169,7 +190,17 @@ wn.pages.DocListView = wn.ui.Listing.extend({ render_stat: function(field, stat) { var me = this; - if(!stat || !stat.length) return; + if(!stat || !stat.length) { + if(field=='_user_tags') { + this.$page.find('.layout-side-section') + .append('

Tags

\ +
No records tagged.

\ + To add a tag, open the document and click on \ + "Add Tag" on the sidebar
'); + } + return; + } + var label = fields[this.doctype][field] ? fields[this.doctype][field].label : field; if(label=='_user_tags') label = 'Tags'; @@ -206,39 +237,81 @@ wn.pages.DocListView = wn.ui.Listing.extend({ \ %(label)s \ (%(count)s)
\ -
', args)) +
', args)); + this.setup_stat_item_click($item); + return $item; + }, + setup_stat_item_click: function($item) { + var me = this; $item.find('a').click(function() { var fieldname = $(this).attr('data-field'); var label = $(this).attr('data-label'); - - var filter = me.filter_list.get_filter(fieldname); - if(filter) { - var v = filter.field.get_value(); - if(v.indexOf(label)!=-1) { - // already set - return false; + me.set_filter(fieldname, label); + return false; + }); + }, + set_filter: function(fieldname, label) { + var filter = this.filter_list.get_filter(fieldname); + if(filter) { + var v = filter.field.get_value(); + if(v.indexOf(label)!=-1) { + // already set + return false; + } else { + // second filter set for this field + if(fieldname=='_user_tags') { + // and for tags + this.filter_list.add_filter(fieldname, 'like', '%' + label); } else { + // or for rest using "in" filter.set_values(fieldname, 'in', v + ', ' + label); } - } else { - me.filter_list.add_filter(fieldname, '=', label); } - me.run(); - return false; - }); - return $item; + } else { + // no filter for this item, + // setup one + if(fieldname=='_user_tags') { + this.filter_list.add_filter(fieldname, 'like', '%' + label); + } else { + this.filter_list.add_filter(fieldname, '=', label); + } + } + this.run(); } }); wn.pages.ListView = Class.extend({ - init: function(doctype) { - var t = "`tab"+doctype+"`."; + init: function(doclistview) { + this.doclistview = doclistview; + this.doctype = doclistview.doctype; + + var t = "`tab"+this.doctype+"`."; this.fields = [t + 'name', t + 'owner', t + 'docstatus', t + '_user_tags', t + 'modified']; this.stats = ['_user_tags'] }, render: function(row, data) { + this.prepare_data(data); + + $(row).html(repl( + ' \ + \ + \ + %(name)s\ + \ + %(when)s\ + \ + ', data)) + .addClass('list-row'); + + this.hide_delete(row, data); + this.add_user_tags(row, data); + this.$main = $(row).find('.main'); + }, + prepare_data: function(data) { data.fullname = wn.user_info(data.owner).fullname; data.avatar = wn.user_info(data.owner).image; data.when = dateutil.str_to_user(data.modified).split(' ')[0]; @@ -253,20 +326,9 @@ wn.pages.ListView = Class.extend({ } else if(data.docstatus==2) { data.docstatus_icon = 'icon-remove'; data.docstatus_title = 'Cancelled'; - } - - $(row).html(repl( - ' \ - \ - \ - %(name)s\ - %(when)s\ - \ - ', data)) - .addClass('list-row'); - + } + }, + hide_delete: function(row, data) { // hide delete if(this.parent.can_delete) { $(row).find('.list-check') @@ -274,7 +336,20 @@ wn.pages.ListView = Class.extend({ $(row).find('.list-check input') .data('name', data.name); } - - this.$main = $(row).find('.main'); + }, + add_user_tags: function(row, data) { + var me = this; + if(data._user_tags) { + $.each(data._user_tags.split(','), function(i, t) { + if(t) { + $('' + + strip(t) + '') + .click(function() { + me.doclistview.set_filter('_user_tags', $(this).text()) + }) + .appendTo($(row).find('.tags')); + } + }); + } } }) diff --git a/js/wn/request.js b/js/wn/request.js index 20a8c8c750..69de7e11d9 100644 --- a/js/wn/request.js +++ b/js/wn/request.js @@ -91,7 +91,7 @@ wn.request.call = function(opts) { // generic server call (call page, object) wn.call = function(opts) { - var args = opts.args || {}; + var args = $.extend({}, opts.args) // cmd if(opts.module && opts.page) { @@ -99,7 +99,7 @@ wn.call = function(opts) { } else if(opts.method) { args.cmd = opts.method; } - + // stringify args if required for(key in args) { if(args[key] && typeof args[key] != 'string') { diff --git a/js/wn/ui/listing.js b/js/wn/ui/listing.js index e7606297bf..deae534435 100644 --- a/js/wn/ui/listing.js +++ b/js/wn/ui/listing.js @@ -85,15 +85,15 @@ wn.ui.Listing = Class.extend({ \
\
\ -
\
\ \
\ +
\
\
\ \ -
\ +
\
\ \ Refresh\ @@ -513,16 +513,17 @@ wn.ui.Filter = Class.extend({ var me = this; // set in fieldname (again) - - var cur_fieldtype = me.field ? me.field.df.fieldtype : null; - var cur_fieldname = me.field ? me.field.df.fieldname : null; + var cur = me.field ? { + fieldname: me.field.df.fieldname, + fieldtype: me.field.df.fieldtype + } : {} var df = me.fields_by_name[fieldname]; this.set_fieldtype(df, fieldtype); // called when condition is changed, // don't change if all is well - if(me.field && cur_fieldname == fieldname && df.fieldtype == cur_fieldtype) { + if(me.field && cur.fieldname == fieldname && df.fieldtype == cur.fieldtype) { return; } diff --git a/py/webnotes/widgets/doclistview.py b/py/webnotes/widgets/doclistview.py index 397b2f33dd..8b7e4980e4 100644 --- a/py/webnotes/widgets/doclistview.py +++ b/py/webnotes/widgets/doclistview.py @@ -37,7 +37,11 @@ def get(arg=None): filters = json.loads(data['filters']) fields = json.loads(data['fields']) tables = ['`tab' + data['doctype'] + '`'] - conditions = [tables[0] + '.docstatus < 2'] + docstatus = json.loads(data['docstatus']) + if docstatus: + conditions = [tables[0] + '.docstatus in (' + ','.join(docstatus) + ')'] + else: + conditions = [tables[0] + '.docstatus < 2'] # add table explict to field joined = [tables[0]] From 5edda1dc2269ef871e65df2b2e2b26f76057dd4a Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 16 Mar 2012 18:28:13 +0530 Subject: [PATCH 24/54] major reworking of page navigation --- conf/index.html | 2 - css/ui/container.css | 14 + js/core.min.js | 202 ++++++++++- js/legacy/app.js | 54 +-- js/legacy/globals.js | 1 - js/legacy/report.compressed.js | 4 +- js/legacy/utils/datatype.js | 2 - js/legacy/utils/dom.js | 10 +- js/legacy/utils/rsh.compressed.js | 1 - js/legacy/webpage/body.js | 133 -------- js/legacy/webpage/docbrowser.js | 4 +- js/legacy/webpage/error_console.js | 6 +- js/legacy/webpage/history.js | 203 ----------- js/legacy/webpage/loaders.js | 259 +------------- js/legacy/webpage/page.js | 4 +- js/legacy/webpage/page_header.js | 2 +- js/legacy/widgets/form/form.js | 133 +++----- js/legacy/widgets/form/form_container.js | 93 +---- js/legacy/widgets/form/form_header.js | 2 +- .../widgets/report_builder/report_builder.js | 4 +- js/legacy/wn/widgets/form/sidebar.js | 2 +- js/lib/history/history.min.js | 16 - js/wn/assets.js | 9 +- js/wn/dom.js | 13 + js/wn/model.js | 50 ++- js/wn/page.js | 50 --- js/wn/pages/doclistview-tmp.js | 321 ------------------ js/wn/router.js | 49 +++ js/wn/views/container.js | 46 +++ js/wn/{pages => views}/doclistview.js | 58 ++-- js/wn/views/formview.js | 19 ++ js/wn/views/pageview.js | 63 ++++ js/wn/views/reportview.js | 32 ++ py/webnotes/model/doc.py | 2 +- 34 files changed, 615 insertions(+), 1248 deletions(-) create mode 100644 css/ui/container.css delete mode 100755 js/legacy/utils/rsh.compressed.js delete mode 100644 js/legacy/webpage/body.js delete mode 100644 js/legacy/webpage/history.js delete mode 100644 js/wn/page.js delete mode 100644 js/wn/pages/doclistview-tmp.js create mode 100644 js/wn/router.js create mode 100644 js/wn/views/container.js rename js/wn/{pages => views}/doclistview.js (90%) create mode 100644 js/wn/views/formview.js create mode 100644 js/wn/views/pageview.js create mode 100644 js/wn/views/reportview.js diff --git a/conf/index.html b/conf/index.html index cc9f30d8e6..b7e69a4f2b 100644 --- a/conf/index.html +++ b/conf/index.html @@ -26,8 +26,6 @@ } {% endif %} - - {{ body_html }} diff --git a/css/ui/container.css b/css/ui/container.css new file mode 100644 index 0000000000..d25a61931e --- /dev/null +++ b/css/ui/container.css @@ -0,0 +1,14 @@ +#body_div { + position: relative; +} + +.content { + width: 900px; + position: absolute; + left: 1000px; + -webkit-transition:all 0.5s ease-in-out; + -moz-transition:all 0.5s ease-in-out; + -o-transition:all 0.5s ease-in-out; + -ms-transition:all 0.5s ease-in-out; + transition:all 0.5s ease-in-out; +} \ No newline at end of file diff --git a/js/core.min.js b/js/core.min.js index f00dabb707..9bc2b38dfb 100644 --- a/js/core.min.js +++ b/js/core.min.js @@ -24,8 +24,7 @@ localStorage.setItem('_version_number',window._version_number);}}} wn.assets={executed_:{},exists:function(src){if('localStorage'in window&&localStorage.getItem(src)) return true},add:function(src,txt){if('localStorage'in window){localStorage.setItem(src,txt);}},get:function(src){return localStorage.getItem(src);},extn:function(src){if(src.indexOf('?')!=-1){src=src.split('?').slice(-1)[0];} return src.split('.').slice(-1)[0];},load:function(src){var t=src;$.ajax({url:t,data:{q:Math.floor(Math.random()*1000)},dataType:'text',success:function(txt){wn.assets.add(src,txt);},async:false})},execute:function(src){if(!wn.assets.exists(src)){wn.assets.load(src);} -var type=wn.assets.extn(src);if(wn.assets.handler[type]){wn.assets.handler[type](wn.assets.get(src),src);wn.assets.executed_[src]=1;}},handler:{js:function(txt,src){wn.dom.eval(txt);},css:function(txt,src){var se=document.createElement('style');se.type="text/css";if(se.styleSheet){se.styleSheet.cssText=txt;}else{se.appendChild(document.createTextNode(txt));} -document.getElementsByTagName('head')[0].appendChild(se);},cgi:function(txt,src){wn.dom.eval(txt)}}} +var type=wn.assets.extn(src);if(wn.assets.handler[type]){wn.assets.handler[type](wn.assets.get(src),src);wn.assets.executed_[src]=1;}},handler:{js:function(txt,src){wn.dom.eval(txt);},css:function(txt,src){wn.dom.set_style(txt);},cgi:function(txt,src){wn.dom.eval(txt)}}} /* * lib/js/wn/require.js */ @@ -35,7 +34,9 @@ var l=items.length;for(var i=0;i3){route[2]=route.splice(2).join('/');} +wn.views.formview.show(route[1],route[2]);break;case"Report":wn.views.reportview.show(route[1],route[2]);break;default:wn.views.pageview.show(route[0]);}} +wn.set_route=function(route){window.location.hash=route;} +wn._cur_route=null;$(window).bind('hashchange',function(){if(location.hash==wn._cur_route) +return;wn.route();if(wn.boot.analytics_code){try{eval(wn.boot.analytics_code);}catch(e){console.log(e);}}}); +/* + * lib/js/wn/ui/listing.js + */ +wn.provide('wn.ui');wn.ui.Listing=Class.extend({init:function(opts){this.opts=opts||{};this.page_length=20;this.start=0;this.data=[];if(opts){this.make();}},prepare_opts:function(){if(this.opts.new_doctype){if(wn.boot.profile.can_read.indexOf(this.opts.new_doctype)==-1){this.opts.new_doctype=null;}else{this.opts.new_doctype=get_doctype_label(this.opts.new_doctype);}} +if(!this.opts.no_result_message){this.opts.no_result_message='Nothing to show'}},make:function(opts){if(opts){this.opts=opts;} +this.prepare_opts();$.extend(this,this.opts);$(this.parent).html(repl('\ +
\ +

%(title)s

\ + \ +
\ +
\ +
\ + \ +
\ +
\ +
\ +
\ + \ +
\ + \ + \ +
\ + \ +
\ + %(no_result_message)s\ +
\ + \ +
\ +
\ +
\ +
\ + \ +
\ +
\ +
\ +
\ + ',this.opts));this.$w=$(this.parent).find('.wnlist');this.set_events();this.make_filters();},add_button:function(html,onclick,before){$(html).click(onclick).insertBefore(this.$w.find('.list-toolbar '+before));this.btn_groupify();},show_view:function($btn,$div,$btn_unsel,$div_unsel){$btn_unsel.removeClass('btn-info');$btn_unsel.find('i').removeClass('icon-white');$div_unsel.toggle(false);$btn.addClass('btn-info');$btn.find('i').addClass('icon-white');$div.toggle(true);},set_events:function(){var me=this;this.$w.find('.btn-refresh').click(function(){me.run();});this.$w.find('.btn-more').click(function(){me.run({append:true});});if(this.title){this.$w.find('h3').html(this.title).toggle(true);} +if(this.new_doctype){this.$w.find('.btn-new').toggle(true).click(function(){newdoc(me.new_doctype,me.new_doc_onload,true,me.new_doc_onsave);})}else{this.$w.find('.btn-new').remove();} +if(!me.show_filters){this.$w.find('.btn-filter').remove();} +if(this.hide_refresh||this.no_refresh){this.$w.find('.btn-refresh').remove();} +this.btn_groupify();},btn_groupify:function(){var nbtns=this.$w.find('.list-toolbar a').length;if(nbtns>1){this.$w.find('.list-toolbar').addClass('btn-group')} +if(nbtns==0){this.$w.find('.list-toolbar-wrapper').toggle(false);}},make_filters:function(){this.filter_list=new wn.ui.FilterList({listobj:this,$parent:this.$w.find('.list-filters').toggle(true),doctype:this.doctype,filter_fields:this.filter_fields});},clear:function(){this.data=[];this.$w.find('.result-list').empty();this.$w.find('.result').toggle(true);this.$w.find('.no-result').toggle(false);this.start=0;},run:function(){var me=this;var a0=arguments[0];var a1=arguments[1];if(a0&&typeof a0=='function') +this.onrun=a0;if(a0&&a0.callback) +this.onrun=a0.callback;if(!a1&&!(a0&&a0.append)) +this.start=0;me.set_working(true);wn.call({method:this.opts.method||'webnotes.widgets.query_builder.runquery',args:this.get_call_args(),callback:function(r){me.set_working(false);me.render_results(r)},no_spinner:this.opts.no_loading,btn:this.run_btn});},set_working:function(flag){this.$w.find('.img-load').toggle(flag);},get_call_args:function(){if(!this.method){this.query=this.get_query?this.get_query():this.query;this.add_limits();var args={query_max:this.query_max,as_dict:1} +args.simple_query=this.query;}else{var args={limit_start:this.start,limit_page_length:this.page_length}} +if(this.args) +$.extend(args,this.args) +if(this.get_args){$.extend(args,this.get_args());} +return args;},render_results:function(r){if(this.start==0)this.clear();this.$w.find('.btn-more').toggle(false);if(r.message)r.values=r.message;if(r.values&&r.values.length){this.data=this.data.concat(r.values);this.render_list(r.values);}else{if(this.start==0){this.$w.find('.result').toggle(false);this.$w.find('.no-result').toggle(true);}} +if(this.onrun)this.onrun();if(this.callback)this.callback(r);},render_list:function(values){var m=Math.min(values.length,this.page_length);for(var i=0;i=this.page_length) +this.$w.find('.btn-more').toggle(true);},add_row:function(){return this.$w.find('.result-list').append('
').find('.list-row:last').get(0);},refresh:function(){this.run();},add_limits:function(){this.query+=' LIMIT '+this.start+','+(this.page_length+1);}});wn.ui.FilterList=Class.extend({init:function(opts){wn.require('lib/js/legacy/widgets/form/fields.js');$.extend(this,opts);this.filters=[];this.$w=this.$parent;this.set_events();},set_events:function(){var me=this;this.listobj.$w.find('.btn-filter').bind('click',function(){me.$w.find('.show_filters').slideToggle();if(!me.filters.length) +me.add_filter();});this.$w.find('.add-filter-btn').bind('click',function(){me.add_filter();});},add_filter:function(fieldname,condition,value){this.filters.push(new wn.ui.Filter({flist:this,fieldname:fieldname,condition:condition,value:value}));if(fieldname){this.$w.find('.show_filters').slideDown();}},get_filters:function(){var values=[];$.each(this.filters,function(i,f){if(f.field) +values.push(f.get_value());}) +return values;},update_filters:function(){var fl=[];$.each(this.filters,function(i,f){if(f.field)fl.push(f);}) +this.filters=fl;},get_filter:function(fieldname){for(var i in this.filters){if(this.filters[i].field.df.fieldname==fieldname) +return this.filters[i];}}});wn.ui.Filter=Class.extend({init:function(opts){$.extend(this,opts);this.doctype=this.flist.doctype;this.fields_by_name={};this.make();this.make_options();this.set_events();},make:function(){this.flist.$w.find('.filter_area').append('
\ + \ + \ + \ + ×\ +
');this.$w=this.flist.$w.find('.list_filter:last-child');this.$select=this.$w.find('.fieldname_select');},make_options:function(){if(this.filter_fields){for(var i in this.filter_fields) +this.add_field_option(this.filter_fields[i])}else{this.render_field_select();}},set_events:function(){var me=this;this.$w.find('.fieldname_select').bind('change',function(){me.set_field(this.value);});this.$w.find('a.close').bind('click',function(){me.$w.css('display','none');var value=me.field.get_value();me.field=null;if(!me.flist.get_filters().length){me.flist.$w.find('.set_filters').toggle(true);me.flist.$w.find('.show_filters').toggle(false);} +if(value){me.flist.listobj.run();} +me.flist.update_filters();return false;});me.$w.find('.condition').change(function(){if($(this).val()=='in'){me.set_field(me.field.df.fieldname,'Data');if(!me.field.desc_area) +me.field.desc_area=$a(me.field.wrapper,'span','help',null,'values separated by comma');}else{me.set_field(me.field.df.fieldname);}});if(me.fieldname){this.set_values(me.fieldname,me.condition,me.value);}else{me.set_field('name');}},set_values:function(fieldname,condition,value){this.set_field(fieldname);if(condition)this.$w.find('.condition').val(condition).change();if(value)this.field.set_input(value)},render_field_select:function(){var me=this;me.table_fields=[];var std_filters=[{fieldname:'name',fieldtype:'Data',label:'ID',parent:me.doctype},{fieldname:'modified',fieldtype:'Date',label:'Last Modified',parent:me.doctype},{fieldname:'owner',fieldtype:'Data',label:'Created By',parent:me.doctype},{fieldname:'_user_tags',fieldtype:'Data',label:'Tags',parent:me.doctype}];$.each(std_filters.concat(fields_list[me.doctype]),function(i,df){me.add_field_option(df);});$.each(me.table_fields,function(i,table_df){if(table_df.options){$.each(fields_list[table_df.options],function(i,df){me.add_field_option(df);});}})},add_field_option:function(df){var me=this;if(me.doctype&&df.parent==me.doctype){var label=df.label;var table=get_label_doctype(me.doctype);if(df.fieldtype=='Table')me.table_fields.push(df);}else{var label=df.label+' ('+df.parent+')';var table=df.parent;} +if(wn.model.no_value_type.indexOf(df.fieldtype)==-1&&!me.fields_by_name[df.fieldname]){this.$select.append($('