no more anytime (because of licence, calendar is back

This commit is contained in:
Massimo Di Pierro committed 2011-11-25 16:19:09 -06:00
1 parent dd537c1e2b
commit 485e451115
5 files changed
+50 -11

No files matched your search

+1 -1
View File
@@ -1 +1 @@
Version 1.99.3 (2011-11-24 11:32:22) dev Version 1.99.3 (2011-11-25 16:18:57) dev
@@ -0,0 +1 @@
.calendar{z-index:99;position:relative;display:none;border-top:2px solid #fff;border-right:2px solid #000;border-bottom:2px solid #000;border-left:2px solid #fff;font-size:11px;color:#000;cursor:default;background:#d4d0c8;font-family:tahoma,verdana,sans-serif;}.calendar table{border-top:1px solid #000;border-right:1px solid #fff;border-bottom:1px solid #fff;border-left:1px solid #000;font-size:11px;color:#000;cursor:default;background:#d4d0c8;font-family:tahoma,verdana,sans-serif;}.calendar .button{text-align:center;padding:1px;border-top:1px solid #fff;border-right:1px solid #000;border-bottom:1px solid #000;border-left:1px solid #fff;}.calendar .nav{background:transparent}.calendar thead .title{font-weight:bold;padding:1px;border:1px solid #000;background:#848078;color:#fff;text-align:center;}.calendar thead .name{border-bottom:1px solid #000;padding:2px;text-align:center;background:#f4f0e8;}.calendar thead .weekend{color:#f00;}.calendar thead .hilite{border-top:2px solid #fff;border-right:2px solid #000;border-bottom:2px solid #000;border-left:2px solid #fff;padding:0;background-color:#e4e0d8;}.calendar thead .active{padding:2px 0 0 2px;border-top:1px solid #000;border-right:1px solid #fff;border-bottom:1px solid #fff;border-left:1px solid #000;background-color:#c4c0b8;}.calendar tbody .day{width:2em;text-align:right;padding:2px 4px 2px 2px;}.calendar tbody .day.othermonth{font-size:80%;color:#aaa;}.calendar tbody .day.othermonth.oweekend{color:#faa;}.calendar table .wn{padding:2px 3px 2px 2px;border-right:1px solid #000;background:#f4f0e8;}.calendar tbody .rowhilite td{background:#e4e0d8;}.calendar tbody .rowhilite td.wn{background:#d4d0c8;}.calendar tbody td.hilite{padding:1px 3px 1px 1px;border-top:1px solid #fff;border-right:1px solid #000;border-bottom:1px solid #000;border-left:1px solid #fff;}.calendar tbody td.active{padding:2px 2px 0 2px;border-top:1px solid #000;border-right:1px solid #fff;border-bottom:1px solid #fff;border-left:1px solid #000;}.calendar tbody td.selected{font-weight:bold;border-top:1px solid #000;border-right:1px solid #fff;border-bottom:1px solid #fff;border-left:1px solid #000;padding:2px 2px 0 2px;background:#e4e0d8;}.calendar tbody td.weekend{color:#f00;}.calendar tbody td.today{font-weight:bold;color:#00f;}.calendar tbody .disabled{color:#999;}.calendar tbody .emptycell{visibility:hidden;}.calendar tbody .emptyrow{display:none;}.calendar tfoot .ttip{background:#f4f0e8;padding:1px;border:1px solid #000;background:#848078;color:#fff;text-align:center;}.calendar tfoot .hilite{border-top:1px solid #fff;border-right:1px solid #000;border-bottom:1px solid #000;border-left:1px solid #fff;padding:1px;background:#e4e0d8;}.calendar tfoot .active{padding:2px 0 0 2px;border-top:1px solid #000;border-right:1px solid #fff;border-bottom:1px solid #fff;border-left:1px solid #000;}.calendar .combo{position:absolute;display:none;width:4em;top:0;left:0;cursor:default;border-top:1px solid #fff;border-right:1px solid #000;border-bottom:1px solid #000;border-left:1px solid #fff;background:#e4e0d8;font-size:90%;padding:1px;z-index:100;}.calendar .combo .label,.calendar .combo .label-IEfix{text-align:center;padding:1px;}.calendar .combo .label-IEfix{width:4em;}.calendar .combo .active{background:#c4c0b8;padding:0;border-top:1px solid #000;border-right:1px solid #fff;border-bottom:1px solid #fff;border-left:1px solid #000;}.calendar .combo .hilite{background:#048;color:#fea;}.calendar td.time{border-top:1px solid #000;padding:1px 0;text-align:center;background-color:#f4f0e8;}.calendar td.time .hour,.calendar td.time .minute,.calendar td.time .ampm{padding:0 3px 0 4px;border:1px solid #889;font-weight:bold;background-color:#fff;}.calendar td.time .ampm{text-align:center;}.calendar td.time .colon{padding:0 2px 0 3px;font-weight:bold;}.calendar td.time span.hilite{border-color:#000;background-color:#766;color:#fff;}.calendar td.time span.active{border-color:#f00;background-color:#000;color:#0f0;}#CP_hourcont{z-index:99;padding:0;position:absolute;border:1px dashed #666;background-color:#eee;display:none;}#CP_minutecont{z-index:99;background-color:#ddd;padding:1px;position:absolute;width:45px;display:none;}.floatleft{float:left;}.CP_hour{z-index:99;padding:1px;font-family:Arial,Helvetica,sans-serif;font-size:9px;white-space:nowrap;cursor:pointer;width:35px;}.CP_minute{z-index:99;padding:1px;font-family:Arial,Helvetica,sans-serif;font-size:9px;white-space:nowrap;cursor:pointer;width:auto;}.CP_over{background-color:#fff;z-index:99}
@@ -0,0 +1,42 @@
/* Copyright Notice for Dynarch Date Time Picker */
/* Copyright Mihai Bazon, 2002-2005 | www.bazon.net/mishoo
* -----------------------------------------------------------
*
* The DHTML Calendar, version 1.0 "It is happening again"
*
* Details and latest version at:
* www.dynarch.com/projects/calendar
*
* This script is developed by Dynarch.com. Visit us at www.dynarch.com.
*
* This script is distributed under the GNU Lesser General Public License.
* Read the entire license text here: http://www.gnu.org/licenses/lgpl.html
*/
// Calendar EN language
// Author: Mihai Bazon, <mihai_bazon@yahoo.com>
// Encoding: any
// Distributed under the same terms as the calendar itself.
/* End Copyright Notice for Dynarch Date Time Picker */
Calendar=function(J,K,H,G){this.activeDiv=null;this.currentDateEl=null;this.getDateStatus=null;this.getDateToolTip=null;this.getDateText=null;this.timeout=null;this.onSelected=H||null;this.onClose=G||null;this.dragging=false;this.hidden=false;this.minYear=1970;this.maxYear=2050;this.dateFormat=Calendar._TT.DEF_DATE_FORMAT;this.ttDateFormat=Calendar._TT.TT_DATE_FORMAT;this.isPopup=true;this.weekNumbers=true;this.firstDayOfWeek=typeof J=="number"?J:Calendar._FD;this.showsOtherMonths=false;this.dateStr=K;this.ar_days=null;this.showsTime=false;this.time24=true;this.yearStep=2;this.hiliteToday=true;this.multiple=null;this.table=null;this.element=null;this.tbody=null;this.firstdayname=null;this.monthsCombo=null;this.yearsCombo=null;this.hilitedMonth=null;this.activeMonth=null;this.hilitedYear=null;this.activeYear=null;this.dateClicked=false;if(typeof Calendar._SDN=="undefined"){if(typeof Calendar._SDN_len=="undefined"){Calendar._SDN_len=3}var L=new Array();for(var I=8;I>0;){L[--I]=Calendar._DN[I].substr(0,Calendar._SDN_len)}Calendar._SDN=L;if(typeof Calendar._SMN_len=="undefined"){Calendar._SMN_len=3}L=new Array();for(var I=12;I>0;){L[--I]=Calendar._MN[I].substr(0,Calendar._SMN_len)}Calendar._SMN=L}};Calendar._C=null;Calendar.is_ie=(/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent));Calendar.is_ie5=(Calendar.is_ie&&/msie 5\.0/i.test(navigator.userAgent));Calendar.is_opera=/opera/i.test(navigator.userAgent);Calendar.is_khtml=/Konqueror|Safari|KHTML/i.test(navigator.userAgent);Calendar.getAbsolutePos=function(I){var G=0,J=0;var K=/^div$/i.test(I.tagName);if(K&&I.scrollLeft){G=I.scrollLeft}if(K&&I.scrollTop){J=I.scrollTop}var H={x:I.offsetLeft-G,y:I.offsetTop-J};if(I.offsetParent){var L=this.getAbsolutePos(I.offsetParent);H.x+=L.x;H.y+=L.y}return H};Calendar.isRelated=function(G,E){var F=E.relatedTarget;if(!F){var H=E.type;if(H=="mouseover"){F=E.fromElement}else{if(H=="mouseout"){F=E.toElement}}}while(F){if(F==G){return true}F=F.parentNode}return false};Calendar.removeClass=function(G,H){if(!(G&&G.className)){return }var F=G.className.split(" ");var J=new Array();for(var I=F.length;I>0;){if(F[--I]!=H){J[J.length]=F[I]}}G.className=J.join(" ")};Calendar.addClass=function(D,C){Calendar.removeClass(D,C);D.className+=" "+C};Calendar.getElement=function(C){var D=Calendar.is_ie?window.event.srcElement:C.currentTarget;while(D.nodeType!=1||/^div$/i.test(D.tagName)){D=D.parentNode}return D};Calendar.getTargetElement=function(C){var D=Calendar.is_ie?window.event.srcElement:C.target;while(D.nodeType!=1){D=D.parentNode}return D};Calendar.stopEvent=function(B){B||(B=window.event);if(Calendar.is_ie){B.cancelBubble=true;B.returnValue=false}else{B.preventDefault();B.stopPropagation()}return false};Calendar.addEvent=function(D,E,F){if(D.attachEvent){D.attachEvent("on"+E,F)}else{if(D.addEventListener){D.addEventListener(E,F,true)}else{D["on"+E]=F}}};Calendar.removeEvent=function(D,E,F){if(D.detachEvent){D.detachEvent("on"+E,F)}else{if(D.removeEventListener){D.removeEventListener(E,F,true)}else{D["on"+E]=null}}};Calendar.createElement=function(E,F){var D=null;if(document.createElementNS){D=document.createElementNS("http://www.w3.org/1999/xhtml",E)}else{D=document.createElement(E)}if(typeof F!="undefined"){F.appendChild(D)}return D};Calendar._add_evs=function(el){with(Calendar){addEvent(el,"mouseover",dayMouseOver);addEvent(el,"mousedown",dayMouseDown);addEvent(el,"mouseout",dayMouseOut);if(is_ie){addEvent(el,"dblclick",dayMouseDblClick);el.setAttribute("unselectable",true)}}};Calendar.findMonth=function(B){if(typeof B.month!="undefined"){return B}else{if(typeof B.parentNode.month!="undefined"){return B.parentNode}}return null};Calendar.findYear=function(B){if(typeof B.year!="undefined"){return B}else{if(typeof B.parentNode.year!="undefined"){return B.parentNode}}return null};Calendar.showMonthsCombo=function(){var I=Calendar._C;if(!I){return false}var I=I;var H=I.activeDiv;var J=I.monthsCombo;if(I.hilitedMonth){Calendar.removeClass(I.hilitedMonth,"hilite")}if(I.activeMonth){Calendar.removeClass(I.activeMonth,"active")}var K=I.monthsCombo.getElementsByTagName("div")[I.date.getMonth()];Calendar.addClass(K,"active");I.activeMonth=K;var L=J.style;L.display="block";if(H.navtype<0){L.left=H.offsetLeft+"px"}else{var G=J.offsetWidth;if(typeof G=="undefined"){G=50}L.left=(H.offsetLeft+H.offsetWidth-G)+"px"}L.top=(H.offsetTop+H.offsetHeight)+"px"};Calendar.showYearsCombo=function(K){var N=Calendar._C;if(!N){return false}var N=N;var L=N.activeDiv;var S=N.yearsCombo;if(N.hilitedYear){Calendar.removeClass(N.hilitedYear,"hilite")}if(N.activeYear){Calendar.removeClass(N.activeYear,"active")}N.activeYear=null;var M=N.date.getFullYear()+(K?1:-1);var P=S.firstChild;var Q=false;for(var T=12;T>0;--T){if(M>=N.minYear&&M<=N.maxYear){P.innerHTML=M;P.year=M;P.style.display="block";Q=true}else{P.style.display="none"}P=P.nextSibling;M+=K?N.yearStep:-N.yearStep}if(Q){var O=S.style;O.display="block";if(L.navtype<0){O.left=L.offsetLeft+"px"}Line truncated
/*
http://keith-wood.name/timeEntry.html
Time entry for jQuery v1.4.8.
Written by Keith Wood (kbwood{at}iinet.com.au) June 2007.
Minor changes by Massimo Di Pierro Nov 2010 (simplified and changed behavior)
Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
Please attribute the author if you use it.
Turn an input field into an entry point for a time value.
The time can be entered via directly typing the value,
via the arrow keys.
It is configurable to show 12 or 24-hour time, to show or hide seconds,
to enforce a minimum and/or maximum time, to change the spinner image.
Example: jQuery('input.time').timeEntry();
*/
(function(a){var d=12,k="ampmNames",i="show24Hours",m="showSeconds",l="character",b=10,f=false,j="string",e=-1,c=null,h=true,g="timeEntry";function o(){this._disabledInputs=[];this._defaults={showSeconds:h,defaultTime:c,minTime:c,maxTime:c,show24Hours:h,ampmNames:["am","pm"]};a.extend(this._defaults)}a.extend(o.prototype,{markerClassName:"hasTimeEntry",setDefaults:function(a){n(this._defaults,a||{});return this},_connectTimeEntry:function(e,f){var c=this,d=a(e);if(d.hasClass(c.markerClassName))return;var b={};b.options=a.extend({},f);b._selectedHour=0;b._selectedMinute=0;b._selectedSecond=0;b._field=0;b.input=a(e);a.data(e,g,b);d.addClass(c.markerClassName).bind("focus.timeEntry",c._doFocus).bind("blur.timeEntry",c._doBlur).bind("click.timeEntry",c._doClick).bind("keydown.timeEntry",c._doKeyDown).bind("keypress.timeEntry",c._doKeyPress);a.browser.mozilla&&d.bind("input.timeEntry",function(){a.timeEntry._parseTime(b)});a.browser.msie&&d.bind("paste.timeEntry",function(){setTimeout(function(){a.timeEntry._parseTime(b)},1)})},_isDisabledTimeEntry:function(b){return a.inArray(b,this._disabledInputs)>e},_changeTimeEntry:function(e,b,f){var c=a.data(e,g);if(c){if(typeof b==j){var h=b;b={};b[h]=f}var d=this._extractTime(c);n(c.options,b||{});d&&this._setTime(c,new Date(0,0,0,d[0],d[1],d[2]))}a.data(e,g,c)},_destroyTimeEntry:function(d){var b=this;jQueryinput=a(d);if(!jQueryinput.hasClass(b.markerClassName))return;jQueryinput.removeClass(b.markerClassName).unbind(".timeEntry");b._disabledInputs=a.map(b._disabledInputs,function(a){return a==d?c:a});jQueryinput.parent().replaceWith(jQueryinput);a.removeData(d,g)},_setTimeTimeEntry:function(e,b){var d=a.data(e,g);d&&this._setTime(d,b?typeof b=="object"?new Date(b.getTime()):b:c)},_getTimeTimeEntry:function(e){var d=a.data(e,g),b=d?this._extractTime(d):c;return !b?c:new Date(0,0,0,b[0],b[1],b[2])},_getOffsetTimeEntry:function(e){var d=a.data(e,g),b=d?this._extractTime(d):c;return !b?0:(b[0]*3600+b[1]*60+b[2])*1e3},_doFocus:function(e){var d=e.nodeName&&e.nodeName.toLowerCase()=="input"?e:this;if(a.timeEntry._lastInput==d||a.timeEntry._isDisabledTimeEntry(d)){a.timeEntry._focussed=f;return}var i=a.data(d,g);a.timeEntry._focussed=h;a.timeEntry._lastInput=d;a.timeEntry._blurredInput=c;a.data(d,g,i);a.timeEntry._parseTime(i);setTimeout(function(){a.timeEntry._showField(i)},b)},_doBlur:function(){a.timeEntry._blurredInput=a.timeEntry._lastInput;a.timeEntry._lastInput=c},_doClick:function(k){var h=k.target,d=a.data(h,g);if(!a.timeEntry._focussed){var i=3;d._field=0;if(h.selectionStart!=c)for(var e=0;e<=Math.max(1,d._secondField,d._ampmField);e++){var m=e!=d._ampmField?e*i+2:d._ampmField*i+2;d._field=e;if(h.selectionStart<m)break}else if(h.createTextRange)for(var n=a(k.srcElement),j=h.createTextRange(),o=function(a){return ({thin:2,medium:4,thick:6})[a]||a},p=k.clientX+document.documentElement.scrollLeft-(n.offset().left+parseInt(o(n.css("border-left-width")),b))-j.offsetLeft,e=0;e<=Math.max(1,d._secondField,d._ampmField);e++){var m=e!=d._ampmField?e*i+2:d._ampmField*i+2;j.collapse();j.moveEnd(l,m);d._field=e;if(p<j.boundingWidth)break}}a.data(h,g,d);a.timeEntry._showField(d);a.timeEntry._focussed=f},_doKeyDown:function(c){if(c.keyCode>=48)return h;var b=a.data(c.target,g);switch(c.keyCode){case 9:var d=a(":input");d.eq(d.index(this)+(c.shiftKey?e:+1)).focus();break;case 37:a.timeEntry._changeField(b,e,f);break;case 38:a.timeEntry._adjustField(b,e);break;case 16:!c.shiftKey&&a.timeEntry._changeField(b,+1,f);break;case 39:a.timeEntry._changeField(b,+1,f);break;case 40:a.timeEntry._adjustField(b,+1);break;case 32:case 46:a.timeEntry._setValue(b,"")}return f},_doKeyPress:function(b){var c=String.fromCharCode(b.charCode==undefined?b.keyCode:b.charCode);if(c<" ")return h;var d=a.data(b.target,g);a.timeEntry._handleKeyPress(d,c);return f},_get:function(d,b){return d.options[b]!=c?d.options[b]:a.timeEntry._defaults[b]},_parseTime:function(a){var b=this,c=b._extractTime(a),d=b._get(a,m);if(c){a._selectedHour=c[0];a._selectedMinute=c[1];a._selectedSecond=c[2]}else{var f=b._constrainTime(a);a._selectedHour=f[0];a._selectedMinute=f[1];a._selectedSecond=d?f[2]:0}a._secondField=d?2:e;a._ampmField=b._get(a,i)?e:d?3:2;a._lastChr="";a._field=Math.max(0,Math.min(Math.max(1,a._secondField,a._ampmField),0));a.input.val()!=""&&b._showTime(a)},_extractTime:function(h,g){var n=this;g=g||h.input.val();var f=g.split(":"),p=n._get(h,k),o=n._get(h,i);if(f.length>=2){var r=!o&&g.indexOf(p[0])>e,q=!o&&g.indexOf(p[1])>e,a=parseInt(f[0],b);a=isNaN(a)?0:a;a=((r||q)&&a==d?0:a)+(q?d:0);var j=parseInt(f[1],b);j=isNaN(j)?0:j;var l=f.length>=3?parseInt(f[2],b):0;l=isNaN(l)||!n._get(h,m)?0:l;return n._constrainTime(h,[a,j,l])}return c},_constrainTime:function(d,a){var e=a!=c;if(!e){var b=this._determineTime(d,this._get(d,"defaultTime"))||new Date;a=[b.getHours(),b.getMinutes(),b.getSeconds()]}return a},_showTime:function(a){var b=this,c=b._get(a,i),e=b._formatNumber(c?a._selectedHour:(a._selectedHour+11)%d+1)+"Line truncated
+4 -8
View File
@@ -29,15 +29,11 @@ function web2py_ajax_fields(target) {
jQuery("input[type='checkbox'].delete", target).click(function(){ if(this.checked) if(!confirm(confirm_message)) this.checked=false; }); jQuery("input[type='checkbox'].delete", target).click(function(){ if(this.checked) if(!confirm(confirm_message)) this.checked=false; });
var date_format = (typeof w2p_ajax_date_format != 'undefined') ? w2p_ajax_date_format : "%Y-%m-%d"; var date_format = (typeof w2p_ajax_date_format != 'undefined') ? w2p_ajax_date_format : "%Y-%m-%d";
var datetime_format = (typeof w2p_ajax_datetime_format != 'undefined') ? w2p_ajax_datetime_format : "%Y-%m-%d %H:%M:%S"; var datetime_format = (typeof w2p_ajax_datetime_format != 'undefined') ? w2p_ajax_datetime_format : "%Y-%m-%d %H:%M:%S";
try { jQuery("input.date").live('focus',function() { Calendar.setup({inputField:this, ifFormat:date_format, showsTime:false });});
jQuery("input.datetime", target).AnyTime_noPicker().AnyTime_picker({ jQuery("input.datetime").live('focus', function() {Calendar.setup({inputField:this, ifFormat:datetime_format, showsTime: true, timeFormat: "24" });});
format: datetime_format.replace('%M','%i')}); jQuery("input.time").live('focus', function() { var el = jQuery(this);if (!el.hasClass('hasTimeEntry')) try { el.timeEntry();} catch(e) {};});
jQuery("input.date", target).AnyTime_noPicker().AnyTime_picker({
format: date_format.replace('%M','%i')});
jQuery("input.time", target).AnyTime_noPicker().AnyTime_picker({
format: "%H:%i:%S"});
} catch(e) {};
}; };
function web2py_ajax_init(target) { function web2py_ajax_init(target) {
jQuery('.hidden', target).hide(); jQuery('.hidden', target).hide();
jQuery('.error', target).hide().slideDown('slow'); jQuery('.error', target).hide().slideDown('slow');
+2 -2
View File
@@ -6,8 +6,8 @@
//--></script> //--></script>
{{ {{
response.files.insert(0,URL('static','js/jquery.js')) response.files.insert(0,URL('static','js/jquery.js'))
response.files.insert(1,URL('static','css/anytime.css')) response.files.insert(1,URL('static','css/calendar.css'))
response.files.insert(2,URL('static','js/anytime.js')) response.files.insert(2,URL('static','js/calendar.js'))
response.files.insert(3,URL('static','js/web2py.js')) response.files.insert(3,URL('static','js/web2py.js'))
response.include_meta() response.include_meta()
response.include_files() response.include_files()