Changeset 401


Ignore:
Timestamp:
May 11, 2010, 10:25:11 AM (9 years ago)
Author:
duh
Message:

fixed (jslint) and minified javascript

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

Legend:

Unmodified
Added
Removed
  • trunk/web-app/js/wizard.js

    r399 r401  
    2020    if (navigator.userAgent.match(re)) {
    2121        // http://code.google.com/p/fbug/issues/detail?id=1899
    22         var wizard = $('div#wizard')
    23         if (wizard.find("#warning").length == 0) {
     22        var wizard = $('div#wizard');
     23        if (wizard.find("#warning").length === 0) {
    2424            wizard.html('<span id="warning" style="color:red;font-size:8px;">Firefox 3.6 contains <a href="http://code.google.com/p/fbug/issues/detail?id=2746" target="_new">a bug</a> in combination with Firebug\'s XMLHttpRequest spy which causes the wizard to not function anymore. Please make sure you have Firebug\'s XMLHttpRequest spy disabled or use Firefox 3.5.7 instead...</span>' + wizard.html())
    2525        }
     
    8080    // find all anchors that lie outside the wizard
    8181    $('a').each(function() {
    82         var element = $(this)
     82        var element = $(this);
    8383        var re = /^#/gi;
    8484
     
    9292            });
    9393        }
    94     })
     94    });
    9595}
    9696
     
    103103    // attach help action on all wizard help icons
    104104    $('div#wizard').find('div.helpIcon').each(function() {
    105         helpIcon = $(this)
    106         helpContent = helpIcon.parent().parent().find('div.helpContent')
     105        helpIcon = $(this);
     106        helpContent = helpIcon.parent().parent().find('div.helpContent');
    107107
    108108        // handle special content
    109109        var html = (helpContent.html()) ? helpContent.html() : '';
    110110        if (html) {
    111             var specialContent = html.match(/\[([^:]+)\:([^\]]+)\]/)
     111            var specialContent = html.match(/\[([^:]+)\:([^\]]+)\]/);
    112112            if (specialContent) {
    113113                // replace content by calling a helper function
     
    142142                    }
    143143                }
    144             })
     144            });
    145145
    146146            // remove helpcontent div as we don't need it anymore
     
    153153function youtube(video, element) {
    154154    // insert a div we will replace with a youtube player
    155     element.html("<div id='" + video + "'></div>")
     155    element.html("<div id='" + video + "'></div>");
    156156
    157157    // insert youtube player
     
    159159    var atts = { id: 'myytplayer_' + video };
    160160    swfobject.embedSWF("http://www.youtube.com/v/" + video + "?enablejsapi=1&playerapiid=ytplayer_" + video,
    161             video, "200", "150", "8", null, null, params, atts)
     161            video, "200", "150", "8", null, null, params, atts);
    162162}
    163163
     
    178178            altFormat   : 'DD, d MM, yy'
    179179        });
    180     })
     180    });
    181181}
    182182
     
    194194            time24h         : true
    195195        });
    196     })
     196    });
    197197}
    198198
     
    207207                    $(this).removeClass('highlight');
    208208                }
    209                 )
     209        );
    210210    });
    211211}
  • trunk/web-app/js/wizard.min.js

    r359 r401  
    1 var warnOnRedirect=true;$(document).ready(function(){re=/Firefox\/3\.6/gi;if(navigator.userAgent.match(re)){var a=$("div#wizard");if(a.find("#warning").length==0){a.html('<span id="warning" style="color:red;font-size:8px;">Firefox 3.6 contains <a href="http://code.google.com/p/fbug/issues/detail?id=2746" target="_new">a bug</a> in combination with Firebug\'s XMLHttpRequest spy which causes the wizard to not function anymore. Please make sure you have Firebug\'s XMLHttpRequest spy disabled or use Firefox 3.5.7 instead...</span>'+a.html())}}insertOnRedirectWarning();onWizardPage()});function onWizardPage(){attachHelpTooltips();attachDatePickers();attachDateTimePickers();attachTableEvents();handleWizardTable();new TableEditor().init("div.table","div.row","div.column");new OntologyChooser().init();new SelectAddMore().init("term","/gscf/termEditor","ontology",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().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({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 c=$(this);var e=(c.next().attr("class")=="sliderContainer")?c.next():null;var f=c.find("div.header");var d=20;f.children().each(function(){var h=$(this);var g=h.width();g+=parseInt(h.css("padding-left"),10)+parseInt(h.css("padding-right"),10);g+=parseInt(h.css("margin-left"),10)+parseInt(h.css("margin-right"),10);g+=parseInt(h.css("borderLeftWidth"),10)+parseInt(h.css("borderRightWidth"),10);d+=g});f.css({width:d+"px"});c.find("div.row").each(function(){$(this).css({width:d+"px"})});if(e){if(f.width()<c.width()){e.css({display:"none "})}else{e.slider({value:1,min:1,max:f.width()-c.width(),step:1,slide:function(g,h){c.find("div.header, div.row").css({"margin-left":(1-h.value)+"px"})}})}}})};
     1var warnOnRedirect=true;$(document).ready(function(){re=/Firefox\/3\.6/gi;if(navigator.userAgent.match(re)){var wizard=$('div#wizard');if(wizard.find("#warning").length===0){wizard.html('<span id="warning" style="color:red;font-size:8px;">Firefox 3.6 contains <a href="http://code.google.com/p/fbug/issues/detail?id=2746" target="_new">a bug</a> in combination with Firebug\'s XMLHttpRequest spy which causes the wizard to not function anymore. Please make sure you have Firebug\'s XMLHttpRequest spy disabled or use Firefox 3.5.7 instead...</span>'+wizard.html())}}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:'/gscf/termEditor',vars:'ontologies',label:'add more...',class:'addMore',onClose:function(scope){refreshWebFlow()}});new SelectAddMore().init({rel:'template',url:'/gscf/templateEditor',vars:'entity',label:'add / modify..',class:'modify',onClose:function(scope){refreshWebFlow()}});$("#accordion").accordion()}function insertOnRedirectWarning(){$('a').each(function(){var element=$(this);var re=/^#/gi;if(!element.attr('href').match(/^#/gi)&&!element.attr('href').match(/\/([^\/]+)\/wizard\/pages/gi)){element.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().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(video,element){element.html("<div id='"+video+"'></div>");var params={allowScriptAccess:"always"};var atts={id:'myytplayer_'+video};swfobject.embedSWF("http://www.youtube.com/v/"+video+"?enablejsapi=1&playerapiid=ytplayer_"+video,video,"200","150","8",null,null,params,atts)}function onYouTubePlayerReady(playerId){ytplayer=document.getElementById("my"+playerId);ytplayer.playVideo()}function attachDatePickers(){$('div#wizard').find("input[type=text][rel$='date']").each(function(){$(this).datepicker({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 that=this;var wizardTables=$("div#wizard").find('div.table');wizardTables.each(function(){var wizardTable=$(this);var sliderContainer=(wizardTable.next().attr('class')=='sliderContainer')?wizardTable.next():null;var header=wizardTable.find('div.header')var width=20;header.children().each(function(){var c=$(this);var columnWidth=c.width();columnWidth+=parseInt(c.css("padding-left"),10)+parseInt(c.css("padding-right"),10);columnWidth+=parseInt(c.css("margin-left"),10)+parseInt(c.css("margin-right"),10);columnWidth+=parseInt(c.css("borderLeftWidth"),10)+parseInt(c.css("borderRightWidth"),10);width+=columnWidth});header.css({width:width+'px'});wizardTable.find('div.row').each(function(){$(this).css({width:width+'px'})});if(sliderContainer){if(header.width()<wizardTable.width()){sliderContainer.css({'display':'none '})}else{sliderContainer.slider({value:1,min:1,max:header.width()-wizardTable.width(),step:1,slide:function(event,ui){wizardTable.find('div.header, div.row').css({'margin-left':(1-ui.value)+'px'})}})}}})}
Note: See TracChangeset for help on using the changeset viewer.