Changeset 865

Show
Ignore:
Timestamp:
30-08-10 18:07:12 (4 years ago)
Author:
duh
Message:

Automated continuous integration commit of minified JS/CSS

Location:
trunk/web-app/js
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/web-app/js/timepicker-0.2.1.min.js

    r359 r865  
    1 /* 
    2  * jQuery UI Timepicker 0.2.1 
    3  * 
    4  * Copyright (c) 2009 Martin Milesich (http://milesich.com/) 
    5  * 
    6  * Some parts are 
    7  *   Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) 
    8  * 
    9  * $Id: timepicker.js 28 2009-08-11 20:31:23Z majlo $ 
    10  * 
    11  * Depends: 
    12  *  ui.core.js 
    13  *  ui.datepicker.js 
    14  *  ui.slider.js 
    15  */ 
    16 (function(b){b.extend(b.datepicker._defaults,{stepMinutes:1,stepHours:1,time24h:false,showTime:false,altTimeField:""});b.datepicker._connectDatepickerOverride=b.datepicker._connectDatepicker;b.datepicker._connectDatepicker=function(e,d){b.datepicker._connectDatepickerOverride(e,d);if(this._get(d,"showTime")){d.settings.showButtonPanel=true}var c=this._get(d,"showOn");if(c=="button"||c=="both"){d.trigger.unbind("click");d.trigger.click(function(){if(b.datepicker._datepickerShowing&&b.datepicker._lastInput==e){b.datepicker._hideDatepicker(null)}else{b.datepicker._showDatepicker(e)}return false})}};b.datepicker._showDatepickerOverride=b.datepicker._showDatepicker;b.datepicker._showDatepicker=function(d){b.datepicker._showDatepickerOverride(d);d=d.target||d;if(d.nodeName.toLowerCase()!="input"){d=b("input",d.parentNode)[0]}if(b.datepicker._isDisabledDatepicker(d)){return}var e=b.datepicker._getInst(d);var c=b.datepicker._get(e,"showTime");if(c){b.timepicker.show(d)}};b.datepicker._checkExternalClickOverride=b.datepicker._checkExternalClick;b.datepicker._checkExternalClick=function(d){if(!b.datepicker._curInst){return}var c=b(d.target);if((c.parents("#"+b.timepicker._mainDivId).length==0)){b.datepicker._checkExternalClickOverride(d)}};b.datepicker._hideDatepickerOverride=b.datepicker._hideDatepicker;b.datepicker._hideDatepicker=function(d,f){var e=this._curInst;if(!e||(d&&e!=b.data(d,PROP_NAME))){return}var c=this._get(e,"showTime");if(d===undefined&&c){if(e.input){e.input.val(this._formatDate(e));e.input.trigger("change")}this._updateAlternate(e);if(c){b.timepicker.update(this._formatDate(e))}}b.datepicker._hideDatepickerOverride(d,f);if(c){b.timepicker.hide()}};b.datepicker._selectDate=function(h,d){var g=b(h);var f=this._getInst(g[0]);var c=this._get(f,"showTime");d=(d!=null?d:this._formatDate(f));if(!c){if(f.input){f.input.val(d)}this._updateAlternate(f)}var e=this._get(f,"onSelect");if(e){e.apply((f.input?f.input[0]:null),[d,f])}else{if(f.input&&!c){f.input.trigger("change")}}if(f.inline){this._updateDatepicker(f)}else{if(!f.stayOpen){if(c){this._updateDatepicker(f)}else{this._hideDatepicker(null,this._get(f,"duration"));this._lastInput=f.input[0];if(typeof(f.input[0])!="object"){f.input[0].focus()}this._lastInput=null}}}};b.datepicker._updateDatepickerOverride=b.datepicker._updateDatepicker;b.datepicker._updateDatepicker=function(c){b.datepicker._updateDatepickerOverride(c);b.timepicker.resize()};function a(){}a.prototype={init:function(){this._mainDivId="ui-timepicker-div";this._inputId=null;this._orgValue=null;this._orgHour=null;this._orgMinute=null;this._colonPos=-1;this._visible=false;this.tpDiv=b('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible" style="width: 100px; display: none; position: absolute;"></div>');this._generateHtml()},show:function(j){var e=b.datepicker._getInst(j);this._time24h=b.datepicker._get(e,"time24h");this._altTimeField=b.datepicker._get(e,"altTimeField");var c=parseInt(b.datepicker._get(e,"stepMinutes"),10)||1;var i=parseInt(b.datepicker._get(e,"stepHours"),10)||1;if(60%c!=0){c=1}if(24%i!=0){i=1}b("#hourSlider").slider("option","max",24-i);b("#hourSlider").slider("option","step",i);b("#minuteSlider").slider("option","max",60-c);b("#minuteSlider").slider("option","step",c);this._inputId=j.id;if(!this._visible){this._parseTime();this._orgValue=b("#"+this._inputId).val()}var h=this;b("#"+this._mainDivId).show("slow",function(){h.resize()});this._visible=true;var d=b("#"+b.datepicker._mainDivId);var g=d.position();var f=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)+b(document).scrollLeft();var k=this.tpDiv.offset().left+this.tpDiv.outerWidth();if(k>f){d.css("left",g.left-(k-f)-5);this.tpDiv.css("left",d.offset().left+d.outerWidth()+"px")}},update:function(d){var e=b("#"+this._mainDivId+" span.fragHours").text()+":"+b("#"+this._mainDivId+" span.fragMinutes").text();if(!this._time24h){e+=" "+b("#"+this._mainDivId+" span.fragAmpm").text()}var c=b("#"+this._inputId).val();b("#"+this._inputId).val(d+" "+e);if(this._altTimeField){b(this._altTimeField).each(function(){b(this).val(e)})}},hide:function(){this._visible=false;b("#"+this._mainDivId).hide()},resize:function(){var d=b("#"+b.datepicker._mainDivId);var e=d.position();var c=b("#"+b.datepicker._mainDivId+" > div.ui-datepicker-header:first-child").height();b("#"+this._mainDivId+" > div.ui-datepicker-header:first-child").css("height",c);this.tpDiv.css({height:d.height(),top:e.top,left:e.left+d.outerWidth()+"px"});b("#hourSlider").css("height",this.tpDiv.height()-(3.5*c));b("#minuteSlider").css("height",this.tpDiv.height()-(3.5*c))},_generateHtml:function(){var d="";d+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix ui-corner-all">';d+='<div class="ui-datepicker-title" style="margin:0">';d+='<span class="fragHours">08</span><span class="delim">:</span><span class="fragMinutes">45</span> <span class="fragAmpm"></span></div></div><table>';d+="<tr><th>Hour</th><th>Minute</th></tr>";d+='<tr><td align="center"><div id="hourSlider" class="slider"></div></td><td align="center"><div id="minuteSlider" class="slider"></div></td></tr>';d+="</table>";this.tpDiv.empty().append(d);b("body").append(this.tpDiv);var c=this;b("#hourSlider").slider({orientation:"vertical",range:"min",min:0,max:23,step:1,slide:function(e,f){c._writeTime("hour",f.value)},stop:function(e,f){b("#"+c._inputId).focus()}});b("#minuteSlider").slider({orientation:"vertical",range:"min",min:0,max:59,step:1,slide:function(e,f){c._writeTime("minute",f.value)},stop:function(e,f){b("#"+c._inputId).focus()}});b("#hourSlider > a").css("padding",0);b("#minuteSlider > a").css("padding",0)},_writeTime:function(c,d){if(c=="hour"){if(!this._time24h){if(d<12){b("#"+this._mainDivId+" span.fragAmpm").text("am")}else{b("#"+this._mainDivId+" span.fragAmpm").text("pm");d-=12}if(d==0){d=12}}else{b("#"+this._mainDivId+" span.fragAmpm").text("")}if(d<10){d="0"+d}b("#"+this._mainDivId+" span.fragHours").text(d)}if(c=="minute"){if(d<10){d="0"+d}b("#"+this._mainDivId+" span.fragMinutes").text(d)}},_parseTime:function(){var f=b("#"+this._inputId).val();this._colonPos=f.search(":");var c=0,e=0,d="";if(this._colonPos!=-1){e=parseInt(f.substr(this._colonPos-2,2),10);c=parseInt(f.substr(this._colonPos+1,2),10);d=jQuery.trim(f.substr(this._colonPos+3,3))}d=d.toLowerCase();if(d!="am"&&d!="pm"){d=""}if(e<0){e=0}if(c<0){c=0}if(e>23){e=23}if(c>59){c=59}if(d=="pm"&&e<12){e+=12}if(d=="am"&&e==12){e=0}this._setTime("hour",e);this._setTime("minute",c);this._orgHour=e;this._orgMinute=c},_setTime:function(c,d){if(isNaN(d)){d=0}if(d<0){d=0}if(d>23&&c=="hour"){d=23}if(d>59&&c=="minute"){d=59}if(c=="hour"){b("#hourSlider").slider("value",d)}if(c=="minute"){b("#minuteSlider").slider("value",d)}this._writeTime(c,d)}};b.timepicker=new a();b("document").ready(function(){b.timepicker.init()})})(jQuery); 
  • trunk/web-app/js/wizard.min.js

    r709 r865  
    1 var warnOnRedirect=true;$(document).ready(function(){insertOnRedirectWarning();onWizardPage()});function onWizardPage(){attachHelpTooltips();attachDatePickers();attachDateTimePickers();attachTableEvents();handleWizardTable();new TableEditor().init("div.table","div.row","div.column");new OntologyChooser().init();new SelectAddMore().init({rel:"term",url:baseUrl+"/termEditor",vars:"ontologies",label:"add more...",style:"addMore",onClose:function(a){refreshWebFlow()}});new SelectAddMore().init({rel:"template",url:baseUrl+"/templateEditor",vars:"entity,ontologies",label:"add / modify..",style:"modify",onClose:function(a){refreshWebFlow()}});new SelectAddMore().init({rel:"person",url:baseUrl+"/person/list?dialog=true",vars:"person",label:"add / modify persons...",style:"modify",onClose:function(a){refreshWebFlow()}});new SelectAddMore().init({rel:"role",url:baseUrl+"/personRole/list?dialog=true",vars:"role",label:"add / modify roles...",style:"modify",onClose:function(a){refreshWebFlow()}});$("#accordion").accordion()}function insertOnRedirectWarning(){$("a").each(function(){var a=$(this);var b=/^#/gi;if(!a.attr("href").match(/^#/gi)&&!a.attr("href").match(/\/([^\/]+)\/wizard\/pages/gi)){a.bind("click",function(){if(warnOnRedirect){return onDirectWarning()}})}})}function onDirectWarning(){return confirm("Warning: navigating away from the wizard causes loss of work and unsaved data. Are you sure you want to continue?")}function attachHelpTooltips(){$("div#wizard").find("div.helpIcon").each(function(){helpIcon=$(this);helpContent=helpIcon.parent().find("div.helpContent");if(!helpContent.html()){helpContent=helpIcon.parent().parent().find("div.helpContent")}var html=(helpContent.html())?helpContent.html():"";if(html){var specialContent=html.match(/\[([^:]+)\:([^\]]+)\]/);if(specialContent){eval(specialContent[1]+"('"+specialContent[2]+"',helpContent)")}helpIcon.qtip({content:"leftMiddle",position:{corner:{tooltip:"leftMiddle",target:"rightMiddle"}},style:{border:{width:5,radius:10},padding:10,textAlign:"center",tip:true,name:"blue"},content:helpContent.html(),show:"mouseover",hide:"mouseout",api:{beforeShow:function(){}}});helpContent.remove()}})}function youtube(b,a){a.html("<div id='"+b+"'></div>");var c={allowScriptAccess:"always"};var d={id:"myytplayer_"+b};swfobject.embedSWF("http://www.youtube.com/v/"+b+"?enablejsapi=1&playerapiid=ytplayer_"+b,b,"200","150","8",null,null,c,d)}function onYouTubePlayerReady(a){ytplayer=document.getElementById("my"+a);ytplayer.playVideo()}function attachDatePickers(){$("div#wizard").find("input[type=text][rel$='date']").each(function(){$(this).datepicker({numberOfMonths:3,showButtonPanel:true,changeMonth:true,changeYear:true,dateFormat:"dd/mm/yy",altField:"#"+$(this).attr("name")+"Example",altFormat:"DD, d MM, yy"})})}function attachDateTimePickers(){$("div#wizard").find("input[type=text][rel$='datetime']").each(function(){$(this).datepicker({changeMonth:true,changeYear:true,dateFormat:"dd/mm/yy",altField:"#"+$(this).attr("name")+"Example",altTimeField:"#"+$(this).attr("name")+"Example2",altFormat:"DD, d MM, yy",showTime:true,time24h:true})})}function attachTableEvents(){$("div#wizard").find("div.row").each(function(){$(this).hover(function(){$(this).addClass("highlight")},function(){$(this).removeClass("highlight")})})}function handleWizardTable(){var b=this;var a=$("div#wizard").find("div.table");a.each(function(){var d=$(this);var g=(d.next().attr("class")=="sliderContainer")?d.next():null;var h=d.find("div.header");var f=20;var e=0;var c=[];h.children().each(function(){var m=$(this);var k=m.width();var i=parseInt(m.css("padding-left"),10)+parseInt(m.css("padding-right"),10);var l=parseInt(m.css("margin-left"),10)+parseInt(m.css("margin-right"),10);var j=parseInt(m.css("borderLeftWidth"),10)+parseInt(m.css("borderRightWidth"),10);if(i){k+=i}if(l){k+=l}if(j){k+=j}f+=k;c[e]=m.width();e++});h.css({width:f+"px"});d.find("div.row").each(function(){var j=$(this);var i=0;j.children().each(function(){$(this).css({width:c[i]+"px"});i++});j.css({width:f+"px"})});if(g){if(h.width()<d.width()){g.hide()}else{g.slider({value:1,min:1,max:h.width()-d.width(),step:1,slide:function(i,j){d.find("div.header, div.row").css({"margin-left":(1-j.value)+"px"})}})}}})}function showExampleReltime(a){var d=a.name;var b=function(f,g,e){if(e.status==200){document.getElementById(d+"Example").value=f}};var c=function(e,g,f){document.getElementById(d+"Example").value=""};$.ajax({url:baseUrl+"/wizard/ajaxParseRelTime?reltime="+a.value,success:b,error:c})}function fileUploadField(a){new AjaxUpload("#upload_button_"+a,{action:baseUrl+"/file/upload",data:{},name:a,autoSubmit:true,onChange:function(b,c){oldFile=$("#"+a).val();if(oldFile!=""){if(!confirm("The old file is deleted when uploading a new file. Do you want to continue?")){return false}}this.setData({field:a,oldFile:oldFile});$("#"+a+"Example").html("Uploading "+createFileHTML(b))},onComplete:function(c,b){if(b==""){$("#"+a).val("");$("#"+a+"Example").html('<span class="error">Error uploading '+createFileHTML(c)+"</span>")}else{$("#"+a).val(b);$("#"+a+"Example").html("Uploaded "+createFileHTML(c))}}})}function createFileHTML(a){return'<a target="_blank" href="'+baseUrl+"/file/get/"+a+'">'+a+"</a>"}function addPublication(a){jQuery.ajax({type:"GET",url:baseUrl+"/publication/getID?"+$("#"+a+"_form").serialize(),success:function(c,e){var d=parseInt(c);var b=getPublicationIds(a);if($.inArray(d,b)==-1){b[b.length]=d;$("#"+a+"_ids").val(b.join(","));showPublication(a,d,$("#"+a+"_form").find("[name=publication-title]").val(),$("#"+a+"_form").find("[name=publication-authorsList]").val(),b.length-1);$("#"+a+"_none").css("display","none")}},error:function(b,d,c){alert("Publication could not be added.")}});return false}function removePublication(b,d){var c=getPublicationIds(b);if($.inArray(d,c)!=-1){c.splice($.inArray(d,c),1);$("#"+b+"_ids").val(c.join(","));var a=$("#"+b+"_item_"+d);if(a){a.remove()}if(c.length==0){$("#"+b+"_none").css("display","inline")}}}function getPublicationIds(a){var c=$("#"+a+"_ids").val();if(c==""){return new Array()}else{ids_array=c.split(",");for(var b=0;b<ids_array.length;b++){ids_array[b]=parseInt(ids_array[b])}return ids_array}}function showPublication(c,a,g,f,h){var e=document.createElement("img");e.className="famfamfam delete_button";e.setAttribute("alt","remove this publication");e.setAttribute("src",baseUrl+"/images/icons/famfamfam/delete.png");e.onclick=function(){removePublication(c,a);return false};var b=document.createElement("div");b.className="title";b.appendChild(document.createTextNode(g));var d=document.createElement("div");d.className="authors";d.appendChild(document.createTextNode(f));var i=document.createElement("li");i.setAttribute("id",c+"_item_"+a);i.className=h%2==0?"even":"odd";i.appendChild(e);i.appendChild(b);i.appendChild(d);$("#"+c+"_list").append(i)}function createPublicationDialog(a){if($("."+a+"_publication_dialog").length==0){$("#"+a+"_dialog").dialog({title:"Add publication",autoOpen:false,width:800,height:400,modal:true,dialogClass:a+"_publication_dialog",position:"center",buttons:{Add:function(){addPublication(a);$(this).dialog("close")},Close:function(){$(this).dialog("close")}},close:function(){}}).width(790).height(400)}else{$("#"+a+"_dialog").remove()}}function openPublicationDialog(a){var b=$("#"+a);b.autocomplete("close");b.val("");$("#"+a+"_dialog").dialog("open");b.focus();enableButton("."+a+"_publication_dialog","Add",false)}function getDialogButton(b,a){var e=$(b+" .ui-dialog-buttonpane button");for(var d=0;d<e.length;++d){var c=$(e[d]);if(c.text()==a){return c}}return null}function enableButton(b,a,c){var d=getDialogButton(b,a);if(d){if(c){d.attr("disabled","");d.removeClass("ui-state-disabled")}else{d.attr("disabled","disabled");d.addClass("ui-state-disabled")}}}function addContact(b){var e=$("#"+b+"_person").val();var a=$("#"+b+"_role").val();var c=e+"-"+a;var d=getContactIds(b);if($.inArray(c,d)==-1){d[d.length]=c;$("#"+b+"_ids").val(d.join(","));showContact(b,c,$("#"+b+"_person  :selected").text(),$("#"+b+"_role :selected").text(),d.length-1);$("#"+b+"_none").css("display","none")}}function removeContact(b,c){var d=getContactIds(b);if($.inArray(c,d)!=-1){d.splice($.inArray(c,d),1);$("#"+b+"_ids").val(d.join(","));var a=$("#"+b+"_item_"+c);if(a){a.remove()}if(d.length==0){$("#"+b+"_none").css("display","inline")}}}function getContactIds(a){var b=$("#"+a+"_ids").val();if(b==""){return new Array()}else{ids_array=b.split(",");return ids_array}}function showContact(c,a,d,f,h){var g=document.createElement("img");g.className="famfamfam delete_button";g.setAttribute("alt","remove this person");g.setAttribute("src",baseUrl+"/images/icons/famfamfam/delete.png");g.onclick=function(){removeContact(c,a);return false};var b=document.createElement("div");b.className="person";b.appendChild(document.createTextNode(d));var e=document.createElement("div");e.className="role";e.appendChild(document.createTextNode(f));var i=document.createElement("li");i.setAttribute("id",c+"_item_"+a);i.className=h%2==0?"even":"odd";i.appendChild(g);i.appendChild(b);i.appendChild(e);$("#"+c+"_list").append(i)};