(function(){ var _1=false; if(typeof wptheme==="undefined"||!wptheme){ wptheme={}; } i$.mash(wptheme,{togglePageMode:function(_2,_3,_4,_5){ var _6=i$.byId("wpthemeModeToggle"); i$.addClass(_6,"wpthemeEditControlLoading"); return i$.modules.loadDeferred().then(function(){ var _7=i$.fromPath("com.ibm.mashups"),_8=_7?com.ibm.mashups.builder.model.Factory.getRuntimeModel():null,_9=_7?com.ibm.mashups.enabler.user.Factory.getUserModel():null,_6=i$.byId("wpthemeModeToggle"),_a=i$.byId("wpthemeModeToggleImg"),_b=i$.byId("wpthemeModeToggleAccess"),_c=i$.byId("wpthemeModeToggleAltText"),_d=document.getElementsByTagName("body")[0],_e=function(_f){ if(_7){ com.ibm.mashups.services.ServiceManager.getService("eventService").broadcastEvent("com.ibm.mashups.builder.changePageMode",_f); _8.getCurrentPage().setPageMode(_f); } i$.fireEvent("wptheme/contextMenu/invalidate/all"); i$.removeClass(_6,"wpthemeEditControlLoading"); }; if((!_7&&!i$.hasClass(_d,"edit-mode"))||(_7&&_9.getAnonymousMode()!=com.ibm.mashups.enabler.user.AnonymousMode.ANONYMOUS&&_8.getCurrentPage().getPageMode()!="edit")){ _6.title=_a.alt=_3; _b.innerHTML=_4; _c.innerHTML=_3; if(!_1){ dojo.publish("/com/ibm/mashups/livetext/livetextchanged",[i$.byId("wpthemeComplementaryContent"),true]); if(!i$.isIE&&!i$.isOpera&&_7){ window.onbeforeunload=function(){ if(com.ibm.mashups.builder.model.Factory.getRuntimeModel().getCurrentPage().isDirty()){ return com.ibm.mm.builder.coreWidgetsStrings.I_PAGE_SAVE_WARNING; } }; } _1=true; } _e("edit"); i$.addClass(_d,"edit-mode"); }else{ _6.title=_a.alt=_2; _b.innerHTML=_5; _c.innerHTML=_2; _e("view"); i$.removeClass(_d,"edit-mode"); } },function(err){ console.log("Error: "+err); }); }}); })(); //To resolve INC307705 - open the Login box with the cursor placed in the username field function show_login() { $('li.login').addClass('show'); $('#username').focus(); } //Added to resolve INC307705 - close the Login box function hide_login() { $('li.login').removeClass('show'); } // Show search box when clicking on the search icon function show_search() { $('#secondary li.search_hover .secondary_sub').addClass('show'); $('#searchText').focus(); } function hide_search() { $('#secondary li.search_hover .secondary_sub').removeClass('show') } $(document).ready(function () { //To resolve INC307705 - open Login if the "Log In" link is clicked $('li.login > a').click(function() { show_login(); }); $('li.search_hover').click(function() { show_search(); }); //To resolve INC307705 - close Login if a user clicks anywhere outside of Login box $(document).on('click', function (e) { if ($(e.target).closest('li.login').length === 0) { hide_login(); } if ($(e.target).closest('li.search_hover').length === 0) { hide_search(); } }); //preload constituents image. if ($(".const .people").length) { $('').src = $(".const .people").css("background-image").replace('url(','').replace(')','').replace('"','').replace('"',''); } // Make form submit when pressing enter $('#loginform input[type=text], #loginform input[type=password]').keypress(function (e) { if(e.which === 13) { $("#loginform").submit(); } }); if ($("#searchlbl").length) { $("#searchlbl").inFieldLabels(); $(".infieldLabel > label").inFieldLabels(); } }); /* Javascript to display wait message pop-up for long running operations. - To use for a clickable element such as an anchor tag, just add class attribute with a value of "progress" Example: Click Here - To add a custom message call the displayWaitMessage() function from the onclick event with your own text. Example: Click Here - To call from a form where validation needs to happens first, call the showProgress() function from the onsubmit event. Example: