Squashed 'public/legacy/' content from commit 817a12dc0
git-subtree-dir: public/legacy git-subtree-split: 817a12dc0c30c189f56d5cb1f7dc37a9631bdbe3
49
include/javascript/EmailsComposeViewModal.js
Executable file
|
@ -0,0 +1,49 @@
|
|||
/**
|
||||
*
|
||||
* SugarCRM Community Edition is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
|
||||
*
|
||||
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
|
||||
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
|
||||
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
|
||||
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
|
||||
*/(function($){$.fn.EmailsComposeViewModal=function(options){"use strict";var self=this;var opts=$.extend({},$.fn.EmailsComposeViewModal.defaults,options);self.handleClick=function(e){"use strict";var self=this;self.emailComposeView=null;var opts=$.extend({},$.fn.EmailsComposeViewModal.defaults);var composeBox=$('<div></div>').appendTo(opts.contentSelector);composeBox.messageBox({"showHeader":false,"showFooter":false,"size":'lg'});composeBox.setBody('<div class="email-in-progress"><img src="themes/'+SUGAR.themes.theme_name+'/images/loading.gif"></div>');composeBox.show();$.ajax({type:"GET",cache:false,url:'index.php?module=Emails&action=ComposeView&in_popup=1'}).done(function(data){if(data.length===0){console.error("Unable to display ComposeView");composeBox.setBody(SUGAR.language.translate('','ERR_AJAX_LOAD'));return;}
|
||||
composeBox.setBody(data);self.emailComposeView=composeBox.controls.modal.body.find('.compose-view').EmailsComposeView();$(self.emailComposeView).on('sentEmail',function(event,composeView){composeBox.hide();composeBox.remove();});$(self.emailComposeView).on('disregardDraft',function(event,composeView){if(typeof messageBox!=="undefined"){var mb=messageBox({size:'lg'});mb.setTitle(SUGAR.language.translate('','LBL_CONFIRM_DISREGARD_DRAFT_TITLE'));mb.setBody(SUGAR.language.translate('','LBL_CONFIRM_DISREGARD_DRAFT_BODY'));mb.on('ok',function(){mb.remove();composeBox.hide();composeBox.remove();});mb.on('cancel',function(){mb.remove();});mb.show();}else{if(confirm(self.translatedErrorMessage)){composeBox.hide();composeBox.remove();}}});composeBox.on('cancel',function(){composeBox.remove();});composeBox.on('hide.bs.modal',function(){composeBox.remove();});}).fail(function(data){composeBox.controls.modal.content.html(SUGAR.language.translate('','LBL_EMAIL_ERROR_GENERAL_TITLE'));});return $(self);};self.construct=function(){"use strict";$(opts.buttonSelector).click(self.handleClick)};self.destruct=function(){};self.construct();return $(self);};$.fn.openComposeViewModal=function(source){"use strict";window.event.preventDefault();window.event.stopImmediatePropagation();var self=this;self.emailComposeView=null;var opts=$.extend({},$.fn.EmailsComposeViewModal.defaults);var composeBox=$('<div></div>').appendTo(opts.contentSelector);composeBox.messageBox({"showHeader":false,"showFooter":false,"size":'lg'});composeBox.setBody('<div class="email-in-progress"><img src="themes/'+SUGAR.themes.theme_name+'/images/loading.gif"></div>');composeBox.show();var relatedId=$('[name="record"]').val();var ids='&ids=';if($(source).attr('data-record-id')!==''){ids=ids+$(source).attr('data-record-id');relatedId=$(source).attr('data-record-id');}
|
||||
else{var inputs=document.MassUpdate.elements;for(var i=0;i<inputs.length;i++){if(inputs[i].name==='mass[]'&&inputs[i].checked){ids=ids+inputs[i].value+',';}}}
|
||||
var targetModule=currentModule;if($(source).attr('data-module')!==''){targetModule=$(source).attr('data-module');}
|
||||
var url='index.php?module=Emails&action=ComposeView&in_popup=1&targetModule='+targetModule+ids+'&relatedModule='+currentModule+'&relatedId='+relatedId;$.ajax({type:"GET",cache:false,url:url}).done(function(data){if(data.length===0){console.error("Unable to display ComposeView");composeBox.setBody(SUGAR.language.translate('','ERR_AJAX_LOAD'));return;}
|
||||
composeBox.setBody(data);self.emailComposeView=composeBox.controls.modal.body.find('.compose-view').EmailsComposeView();var targetCount=0;var targetList='';var populateModuleName='';var populateEmailAddress='';var populateModule='';var populateModuleRecord='';var dataEmailName=$(source).attr('data-module-name');var dataEmailAddress=$(source).attr('data-email-address');$('.email-compose-view-to-list').each(function(){if($('.email-relate-target'.length)){populateModule=$('.email-relate-target').attr('data-relate-module');populateModuleRecord=$('.email-relate-target').attr('data-relate-id');populateModuleName=$('.email-relate-target').attr('data-relate-name');}
|
||||
else{populateModuleName=$(this).attr('data-record-name');if(dataEmailName!==''){populateModuleName=dataEmailName;}
|
||||
populateModule=$(this).attr('data-record-module');populateModuleRecord=$(this).attr('data-record-id');if(populateModuleName===''){populateModuleName=populateEmailAddress;}}
|
||||
populateEmailAddress=$(this).attr('data-record-email');if(dataEmailAddress!==''){populateEmailAddress=dataEmailAddress;}
|
||||
if(populateEmailAddress!==''){if(targetCount>0){targetList=targetList+',';}
|
||||
targetList=targetList+dataEmailName+' <'+populateEmailAddress+'>';targetCount++;}});if(targetCount>0){$(self.emailComposeView).find('#to_addrs_names').val(targetList);}if(targetCount<2){$(self.emailComposeView).find('#parent_type').val(populateModule);$(self.emailComposeView).find('#parent_name').val(populateModuleName);$(self.emailComposeView).find('#parent_id').val(populateModuleRecord);}
|
||||
$(self.emailComposeView).on('sentEmail',function(event,composeView){composeBox.hide();composeBox.remove();});$(self.emailComposeView).on('disregardDraft',function(event,composeView){if(typeof messageBox!=="undefined"){var mb=messageBox({size:'lg'});mb.setTitle(SUGAR.language.translate('','LBL_CONFIRM_DISREGARD_DRAFT_TITLE'));mb.setBody(SUGAR.language.translate('','LBL_CONFIRM_DISREGARD_DRAFT_BODY'));mb.on('ok',function(){mb.remove();composeBox.hide();composeBox.remove();});mb.on('cancel',function(){mb.remove();});mb.show();}else{if(confirm(self.translatedErrorMessage)){composeBox.hide();composeBox.remove();}}});composeBox.on('cancel',function(){composeBox.remove();});composeBox.on('hide.bs.modal',function(e){e.preventDefault();var mb=messageBox({size:'lg'});mb.setTitle(SUGAR.language.translate('','LBL_CONFIRM_DISREGARD_EMAIL_TITLE'));mb.setBody(SUGAR.language.translate('','LBL_CONFIRM_DISREGARD_EMAIL_BODY'));mb.on('ok',function(){mb.remove();composeBox.hide();composeBox.remove();});mb.on('cancel',function(){mb.remove();});mb.show();});}).fail(function(data){composeBox.controls.modal.content.html(SUGAR.language.translate('','LBL_EMAIL_ERROR_GENERAL_TITLE'));});return $(self);};$.fn.EmailsComposeViewModal.defaults={'selected':'INBOX','buttonSelector':'[data-action=emails-show-compose-modal]','contentSelector':'#content'};}(jQuery));
|
74
include/javascript/ajaxUI.js
Executable file
|
@ -0,0 +1,74 @@
|
|||
/**
|
||||
*
|
||||
* SugarCRM Community Edition is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
|
||||
*
|
||||
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
|
||||
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
|
||||
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
|
||||
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
|
||||
*/SUGAR.ajaxUI={loadingWindow:false,callback:function(o){var cont;if(typeof window.onbeforeunload=="function")
|
||||
window.onbeforeunload=null;scroll(0,0);try{var r=YAHOO.lang.JSON.parse(o.responseText);cont=r.content;if(r.title){document.title=html_entity_decode(r.title);}
|
||||
if(r.action){action_sugar_grp1=r.action;}
|
||||
if(r.menu.module){module_sugar_grp1=r.menu.module;}
|
||||
if(r.favicon){SUGAR.ajaxUI.setFavicon(r.favicon);}
|
||||
var c=document.getElementById("content");c.style.visibility='hidden';c.innerHTML=cont;SUGAR.util.evalScript(cont);c.style.visibility='visible';if(r.moduleList){SUGAR.themes.setModuleTabs(r.moduleList);}
|
||||
if(typeof(r.responseTime)!='undefined'){var rt=$("#responseTime");if(rt.length>0){rt.html(rt.html().replace(/[\d]+\.[\d]+/,r.responseTime));}
|
||||
else if(typeof(logoStats)!="undefined"){$("#logo").attr("title",logoStats.replace(/[\d]+\.[\d]+/,r.responseTime)).tipTip({maxWidth:"auto",edgeOffset:10});}}
|
||||
SUGAR.ajaxUI.hideLoadingPanel();}catch(e){SUGAR.ajaxUI.hideLoadingPanel();SUGAR.ajaxUI.showErrorMessage(o.responseText);}
|
||||
SUGAR_callsInProgress--;},showErrorMessage:function(errorMessage){if(!SUGAR.ajaxUI.errorPanel){SUGAR.ajaxUI.errorPanel=new YAHOO.widget.Panel("ajaxUIErrorPanel",{modal:false,visible:true,width:"800px",height:"600px",close:true});}
|
||||
var panel=SUGAR.ajaxUI.errorPanel;panel.setHeader(SUGAR.language.get('app_strings','ERR_AJAX_LOAD'));panel.setBody('<iframe id="ajaxErrorFrame" style="width:780px;height:550px;border:none;marginheight="0" marginwidth="0" frameborder="0""></iframe>');panel.setFooter(SUGAR.language.get('app_strings','ERR_AJAX_LOAD_FOOTER'));panel.render(document.body);SUGAR.util.doWhen(function(){var f=document.getElementById("ajaxErrorFrame");return f!=null&&f.contentWindow!=null&&f.contentWindow.document!=null;},function(){document.getElementById("ajaxErrorFrame").contentWindow.document.body.innerHTML=errorMessage;window.setTimeout('throw "AjaxUI error parsing response"',300);});SUGAR.ajaxUI.errorMessage=errorMessage;window.setTimeout('if((typeof(document.getElementById("ajaxErrorFrame")) == "undefined" || typeof(document.getElementById("ajaxErrorFrame")) == null || document.getElementById("ajaxErrorFrame").contentWindow.document.body.innerHTML == "")){document.getElementById("ajaxErrorFrame").contentWindow.document.body.innerHTML=SUGAR.ajaxUI.errorMessage;}',3000);panel.show();panel.center();throw"AjaxUI error parsing response";},canAjaxLoadModule:function(module){var checkLS=/&LicState=check/.exec(window.location.search);if(checkLS||(typeof(SUGAR.config.disableAjaxUI)!='undefined'&&SUGAR.config.disableAjaxUI==true)){return false;}
|
||||
var bannedModules=SUGAR.config.stockAjaxBannedModules;if(typeof(bannedModules)=='undefined')
|
||||
return false;if(typeof(SUGAR.config.addAjaxBannedModules)!='undefined'){bannedModules.concat(SUGAR.config.addAjaxBannedModules);}
|
||||
if(typeof(SUGAR.config.overrideAjaxBannedModules)!='undefined'){bannedModules=SUGAR.config.overrideAjaxBannedModules;}
|
||||
return SUGAR.util.arrayIndexOf(bannedModules,module)==-1;},loadContent:function(url,params){if(YAHOO.lang.trim(url)!=""){var testUrl=decodeURIComponent(url);if(/^index.php?(([A-Z]|[a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+[%=+#&\[\]\.]*)+/i.test(testUrl)===false){throw"Invalid url";}
|
||||
var mRegex=/module=([^&]*)/.exec(url);var module=mRegex?mRegex[1]:false;if(module&&SUGAR.ajaxUI.canAjaxLoadModule(module)){YAHOO.util.History.navigate('ajaxUILoc',url);}else{window.location=url;}}},go:function(url){if(YAHOO.lang.trim(url)!=""){var con=YAHOO.util.Connect,ui=SUGAR.ajaxUI;if(ui.lastURL==url){return;}
|
||||
var testUrl=decodeURIComponent(url);if(/^index.php?(([A-Z]|[a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+[%=+#&\[\]\.]*)+/i.test(testUrl)===false){throw"Invalid url";}
|
||||
var inAjaxUI=/action=ajaxui/.exec(window.location);if(typeof(window.onbeforeunload)=="function"&&window.onbeforeunload()){if(!confirm(window.onbeforeunload())){if(!inAjaxUI){window.location.hash="";}
|
||||
else{YAHOO.util.History.navigate('ajaxUILoc',ui.lastURL);}
|
||||
return;}
|
||||
window.onbeforeunload=null;}
|
||||
if(ui.lastCall&&con.isCallInProgress(ui.lastCall)){con.abort(ui.lastCall);}
|
||||
var mRegex=/module=([^&]*)/.exec(url);var module=mRegex?mRegex[1]:false;if(!ui.canAjaxLoadModule(module)){window.location=url;}
|
||||
ui.lastURL=url;ui.cleanGlobals();var loadLanguageJS='';if(module&&typeof(SUGAR.language.languages[module])=='undefined'){loadLanguageJS='&loadLanguageJS=1';}
|
||||
if(!inAjaxUI){if(!SUGAR.isIE)
|
||||
window.location.replace("index.php?action=ajaxui#ajaxUILoc="+encodeURIComponent(url));else{window.location.hash="#";window.location.assign("index.php?action=ajaxui#ajaxUILoc="+encodeURIComponent(url));}}
|
||||
else{SUGAR_callsInProgress++;SUGAR.ajaxUI.showLoadingPanel();ui.lastCall=YAHOO.util.Connect.asyncRequest('GET',url+'&ajax_load=1'+loadLanguageJS,{success:SUGAR.ajaxUI.callback,failure:function(){SUGAR_callsInProgress--;SUGAR.ajaxUI.hideLoadingPanel();SUGAR.ajaxUI.showErrorMessage(SUGAR.language.get('app_strings','ERR_AJAX_LOAD_FAILURE'));}});}}},submitForm:function(formname,params){var con=YAHOO.util.Connect,SA=SUGAR.ajaxUI;if(SA.lastCall&&con.isCallInProgress(SA.lastCall)){con.abort(SA.lastCall);}
|
||||
SA.cleanGlobals();var form=YAHOO.util.Dom.get(formname)||document.forms[formname];if(SA.canAjaxLoadModule(form.module.value)&&typeof(YAHOO.util.Selector.query("input[type=file]",form)[0])=="undefined"&&/action=ajaxui/.exec(window.location)){var string=con.setForm(form);var baseUrl="index.php?action=ajaxui#ajaxUILoc=";SA.lastURL="";if(string.length>200){SUGAR.ajaxUI.showLoadingPanel();form.onsubmit=function(){return true;};form.submit();}else{con.resetFormState();window.location=baseUrl+encodeURIComponent("index.php?"+string);}
|
||||
return true;}else{if(typeof(YAHOO.util.Selector.query("input[type=submit]",form)[0])!="undefined"&&YAHOO.util.Selector.query("input[type=submit]",form)[0].value=="Save"){ajaxStatus.showStatus(SUGAR.language.get('app_strings','LBL_SAVING'));}
|
||||
form.submit();return false;}},cleanGlobals:function(){sqs_objects={};QSProcessedFieldsArray={};collection={};if(SUGAR.EmailAddressWidget){SUGAR.EmailAddressWidget.instances={};SUGAR.EmailAddressWidget.count={};}
|
||||
YAHOO.util.Event.removeListener(window,'resize');if(typeof(dialog)!='undefined'&&typeof(dialog.destroy)=='function'){dialog.destroy();delete dialog;}},firstLoad:function(){var url=YAHOO.util.History.getBookmarkedState('ajaxUILoc');var aRegex=/action=([^&#]*)/.exec(window.location);var action=aRegex?aRegex[1]:false;var mRegex=/module=([^&#]*)/.exec(window.location);var module=mRegex?mRegex[1]:false;if(module!="ModuleBuilder"){var go=url!=null||action=="ajaxui";url=url?url:'index.php?module=Home&action=index';YAHOO.util.History.register('ajaxUILoc',url,SUGAR.ajaxUI.go);YAHOO.util.History.initialize("ajaxUI-history-field","ajaxUI-history-iframe");SUGAR.ajaxUI.hist_loaded=true;if(go)
|
||||
SUGAR.ajaxUI.go(url);}
|
||||
SUGAR_callsInProgress--;},print:function(){var url=YAHOO.util.History.getBookmarkedState('ajaxUILoc');SUGAR.util.openWindow(url+'&print=true','printwin','menubar=1,status=0,resizable=1,scrollbars=1,toolbar=0,location=1');},showLoadingPanel:function(){if(!SUGAR.ajaxUI.loadingPanel){SUGAR.ajaxUI.loadingPanel=new YAHOO.widget.Panel("ajaxloading",{width:"240px",fixedcenter:true,close:false,draggable:false,constraintoviewport:false,modal:true,visible:false});SUGAR.ajaxUI.loadingPanel.setBody('<div id="loadingPage" align="center" style="vertical-align:middle;"><img src="'+SUGAR.themes.loading_image+'" align="absmiddle" /> <b>'+SUGAR.language.get('app_strings','LBL_LOADING_PAGE')+'</b></div>');SUGAR.ajaxUI.loadingPanel.render(document.body);}
|
||||
if(document.getElementById('ajaxloading_c'))
|
||||
document.getElementById('ajaxloading_c').style.display='';SUGAR.ajaxUI.loadingPanel.show();},hideLoadingPanel:function(){SUGAR.ajaxUI.loadingPanel.hide();if(document.getElementById('ajaxloading_c'))
|
||||
document.getElementById('ajaxloading_c').style.display='none';},setFavicon:function(data){var head=document.getElementsByTagName("head")[0];var links=head.getElementsByTagName("link");var re=/\bicon\b/i;for(var i=0;i<links.length;i++){if(re.test(links[i].rel)){head.removeChild(links[i]);}}
|
||||
var link=document.createElement("link");link.href=data.url;link.type=data.type;link.rel="icon";head.appendChild(link);}};
|
58
include/javascript/alerts.js
Executable file
|
@ -0,0 +1,58 @@
|
|||
/**
|
||||
*
|
||||
* SugarCRM Community Edition is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
|
||||
*
|
||||
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
|
||||
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
|
||||
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
|
||||
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
|
||||
*/var AlertObj=function(){this.title='Alert';this.options={};this.options.body=' ';this.options.url_redirect='';this.options.target_module='';this.options.type='info';};var Alerts=function(){};Alerts.prototype.replaceMessages=[];Alerts.prototype.enable=function(){var alert=new AlertObj();if(!("Notification"in window)){alert.title=SUGAR.language.translate('app_strings','MSG_BROWSER_NOTIFICATIONS_UNSUPPORTED');Alerts.prototype.show(alert);return;}
|
||||
Notification.requestPermission(function(permission){if(permission==="granted"){alert.title=SUGAR.language.translate('app_strings','MSG_BROWSER_NOTIFICATIONS_ENABLED');}
|
||||
else{alert.title=SUGAR.language.translate('app_strings','MSG_BROWSER_NOTIFICATIONS_DISABLED');}
|
||||
Alerts.prototype.show(alert);});};Alerts.prototype.requestPermission=function(){if(!("Notification"in window)){return;}
|
||||
Notification.requestPermission();};Alerts.prototype.show=function(AlertObj){Alerts.prototype.requestPermission();if(("Notification"in window)){if(Notification.permission==="granted"){if(typeof AlertObj.options!=="undefined"){if(typeof AlertObj.options.target_module!=="undefined"){SUGAR.themes.theme_name=undefined;AlertObj.options.icon='index.php?entryPoint=getImage&themeName='+
|
||||
SUGAR.themes.theme_name+'&imageName='+
|
||||
AlertObj.options.target_module+'s.gif';}
|
||||
if(typeof AlertObj.options.type==="undefined"){AlertObj.options.type='info';}}
|
||||
var notification=new Notification(AlertObj.title,AlertObj.options);if(typeof AlertObj.options!=="undefined"){if(typeof AlertObj.options.url_redirect!=="undefined"){notification.onclick=function(){window.open(AlertObj.options.url_redirect);}}}}
|
||||
else{var message=AlertObj.title;if(typeof AlertObj.options!=="undefined"){if(typeof AlertObj.options.body!=="undefined"){message+='\n'+AlertObj.options.body;}
|
||||
message+=SUGAR.language.translate('app_strings','MSG_JS_ALERT_MTG_REMINDER_CALL_MSG')+"\n\n";if(confirm(message)){if(typeof AlertObj.options!=="undefined"){if(typeof AlertObj.options.url_redirect!=="undefined"){window.location=AlertObj.options.url_redirect;}}}}}}};Alerts.prototype.addToManager=function(AlertObj){var url='index.php',name=AlertObj.title,description,url_redirect,is_read=0,target_module,type='info';if(typeof AlertObj.options!=="undefined"){if(typeof AlertObj.options.url_redirect!=="undefined"){url_redirect=AlertObj.options.url_redirect}
|
||||
if(typeof AlertObj.options.body!=="undefined"){description=AlertObj.options.body}
|
||||
if(typeof AlertObj.options.target_module!=="undefined"){target_module=AlertObj.options.target_module}
|
||||
if(typeof AlertObj.options.type!=="undefined"){type=AlertObj.options.type}
|
||||
if(typeof AlertObj.options.reminder_id!=="undefined"){reminder_id=AlertObj.options.reminder_id}}
|
||||
$.post(url,{module:'Alerts',action:'add',name:name,description:description,url_redirect:url_redirect,is_read:is_read,target_module:target_module,reminder_id:reminder_id,type:type}).done(function(jsonData){data=JSON.parse(jsonData);if(typeof data!=='undefined'&&typeof data.result!=='undefined'&&data.result===1){Alerts.prototype.show(AlertObj);}}).fail(function(data){console.error(data);}).always(function(){Alerts.prototype.updateManager();});};Alerts.prototype.redirectToLogin=function(){var getQueryParams=function(qs){qs=qs.split('+').join(' ');var params={},tokens,re=/[?&]?([^=]+)=([^&]*)/g;while(tokens=re.exec(qs)){params[decodeURIComponent(tokens[1])]=decodeURIComponent(tokens[2]);}
|
||||
return params;};var params=getQueryParams(document.location.search);params.entryPoint=undefined;if(params.entryPoint!=='Changenewpassword'&¶ms.module!=='Users'&¶ms.action!=='Login'){document.location.href='index.php?module=Users&action=Login&loginErrorMessage=LBL_SESSION_EXPIRED';return true;}
|
||||
return false;};Alerts.prototype.updateManager=function(){var url='index.php?module=Alerts&action=get&to_pdf=1';$.ajax(url).done(function(data){if(data==='lost session'){Alerts.prototype.redirectToLogin();return false;}
|
||||
for(var replaceMessage in Alerts.prototype.replaceMessages){data=data.replace(Alerts.prototype.replaceMessages[replaceMessage].search,Alerts.prototype.replaceMessages[replaceMessage].replace);}
|
||||
var alertsDiv=$('.desktop_notifications #alerts');alertsDiv.html(data);var alerts=$('<div></div>');$(data).appendTo(alerts);var alertCount=$(alerts).children('.alert').length;var alertCountDiv=$('.alert_count');var desktopNotificationsDiv=$('.desktop_notifications');var alertButtonDiv=$('.alertsButton');alertCountDiv.html(alertCount);if(alertCount>0){alertsDiv.addClass('has-alerts');desktopNotificationsDiv.addClass('has-alerts');alertButtonDiv.removeClass('btn-').addClass('btn-danger');alertCountDiv.removeClass('hidden');}
|
||||
else{desktopNotificationsDiv.removeClass('has-alerts');alertsDiv.removeClass('has-alerts');alertButtonDiv.removeClass('btn-danger').addClass('btn-success');alertCountDiv.addClass('hidden');}});};Alerts.prototype.markAsRead=function(id){var url='index.php?module=Alerts&action=markAsRead&record='+id+'&to_pdf=1';$.ajax(url).done(function(){Alerts.prototype.updateManager();});};$(document).ready(function(){Alerts.prototype.replaceMessages=[{search:SUGAR.language.translate("app","MSG_JS_ALERT_MTG_REMINDER_CALL_MSG"),replace:""},{search:SUGAR.language.translate("app","MSG_JS_ALERT_MTG_REMINDER_MEETING_MSG"),replace:""}];var updateMissed=function(){Alerts.prototype.updateManager();setTimeout(updateMissed,60000);};setTimeout(updateMissed,2000);});
|
42
include/javascript/bindWithDelay.js
Normal file
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
bindWithDelay jQuery plugin
|
||||
Author: Brian Grinstead
|
||||
MIT license: http://www.opensource.org/licenses/mit-license.php
|
||||
http://github.com/bgrins/bindWithDelay
|
||||
http://briangrinstead.com/files/bindWithDelay
|
||||
Usage:
|
||||
See http://api.jquery.com/bind/
|
||||
.bindWithDelay( eventType, [ eventData ], handler(eventObject), timeout, throttle )
|
||||
Examples:
|
||||
$("#foo").bindWithDelay("click", function(e) { }, 100);
|
||||
$(window).bindWithDelay("resize", { optional: "eventData" }, callback, 1000);
|
||||
$(window).bindWithDelay("resize", callback, 1000, true);
|
||||
*/
|
||||
(function($) {
|
||||
$.fn.bindWithDelay = function( type, data, fn, timeout, throttle ) {
|
||||
if ( $.isFunction( data ) ) {
|
||||
throttle = timeout;
|
||||
timeout = fn;
|
||||
fn = data;
|
||||
data = undefined;
|
||||
}
|
||||
// Allow delayed function to be removed with fn in unbind function
|
||||
fn.guid = fn.guid || ($.guid && $.guid++);
|
||||
// Bind each separately so that each element has its own delay
|
||||
return this.each(function() {
|
||||
var wait = null;
|
||||
function cb() {
|
||||
var e = $.extend(true, { }, arguments[0]);
|
||||
var ctx = this;
|
||||
var throttler = function() {
|
||||
wait = null;
|
||||
fn.apply(ctx, [e]);
|
||||
};
|
||||
if (!throttle) { clearTimeout(wait); wait = null; }
|
||||
if (!wait) { wait = setTimeout(throttler, timeout); }
|
||||
}
|
||||
cb.guid = fn.guid;
|
||||
$(this).bind(type, data, cb);
|
||||
});
|
||||
};
|
||||
})(jQuery);
|
1
include/javascript/c3/c3.min.css
vendored
Executable file
|
@ -0,0 +1 @@
|
|||
.c3 svg{font:10px sans-serif}.c3 line,.c3 path{fill:none;stroke:#000}.c3 text{-webkit-user-select:none;-moz-user-select:none;user-select:none}.c3-bars path,.c3-event-rect,.c3-legend-item-tile,.c3-xgrid-focus,.c3-ygrid{shape-rendering:crispEdges}.c3-chart-arc path{stroke:#fff}.c3-chart-arc text{fill:#fff;font-size:13px}.c3-grid line{stroke:#aaa}.c3-grid text{fill:#aaa}.c3-xgrid,.c3-ygrid{stroke-dasharray:3 3}.c3-text.c3-empty{fill:gray;font-size:2em}.c3-line{stroke-width:1px}.c3-circle._expanded_{stroke-width:1px;stroke:#fff}.c3-selected-circle{fill:#fff;stroke-width:2px}.c3-bar{stroke-width:0}.c3-bar._expanded_{fill-opacity:.75}.c3-target.c3-focused{opacity:1}.c3-target.c3-focused path.c3-line,.c3-target.c3-focused path.c3-step{stroke-width:2px}.c3-target.c3-defocused{opacity:.3!important}.c3-region{fill:#4682b4;fill-opacity:.1}.c3-brush .extent{fill-opacity:.1}.c3-legend-item{font-size:12px}.c3-legend-item-hidden{opacity:.15}.c3-legend-background{opacity:.75;fill:#fff;stroke:#d3d3d3;stroke-width:1}.c3-tooltip-container{z-index:10}.c3-tooltip{border-collapse:collapse;border-spacing:0;background-color:#fff;empty-cells:show;-webkit-box-shadow:7px 7px 12px -9px #777;-moz-box-shadow:7px 7px 12px -9px #777;box-shadow:7px 7px 12px -9px #777;opacity:.9}.c3-tooltip tr{border:1px solid #CCC}.c3-tooltip th{background-color:#aaa;font-size:14px;padding:2px 5px;text-align:left;color:#FFF}.c3-tooltip td{font-size:13px;padding:3px 6px;background-color:#fff;border-left:1px dotted #999}.c3-tooltip td>span{display:inline-block;width:10px;height:10px;margin-right:6px}.c3-tooltip td.value{text-align:right}.c3-area{stroke-width:0;opacity:.2}.c3-chart-arcs-title{dominant-baseline:middle;font-size:1.3em}.c3-chart-arcs .c3-chart-arcs-background{fill:#e0e0e0;stroke:none}.c3-chart-arcs .c3-chart-arcs-gauge-unit{fill:#000;font-size:16px}.c3-chart-arcs .c3-chart-arcs-gauge-max,.c3-chart-arcs .c3-chart-arcs-gauge-min{fill:#777}.c3-chart-arc .c3-gauge-value{fill:#000}
|
72
include/javascript/calendar.js
Executable file
|
@ -0,0 +1,72 @@
|
|||
/**
|
||||
*
|
||||
* SugarCRM Community Edition is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
|
||||
*
|
||||
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
|
||||
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
|
||||
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
|
||||
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
|
||||
*/Calendar=function(){};Calendar.getHighestZIndex=function(containerEl){var highestIndex=0;var currentIndex=0;var els=Array();els=containerEl?containerEl.getElementsByTagName('*'):document.getElementsByTagName('*');for(var i=0;i<els.length;i++){currentIndex=YAHOO.util.Dom.getStyle(els[i],"zIndex");if(!isNaN(currentIndex)&¤tIndex>highestIndex){highestIndex=parseInt(currentIndex);}}
|
||||
return(highestIndex==Number.MAX_VALUE)?Number.MAX_VALUE:highestIndex+1;};Calendar.getDateField=function(id,form){var input;if(form){var formElement=document.getElementById(form);if(formElement){for(var i=0;i<formElement.elements.length;i++){if(formElement.elements[i].id==id){input=formElement.elements[i];break;}}}}else{input=document.getElementById(id);}
|
||||
return input;};Calendar.setup=function(params){YAHOO.util.Event.onDOMReady(function(){var Event=YAHOO.util.Event;var Dom=YAHOO.util.Dom;var dialog;var calendar;var showButton=params.button?params.button:params.buttonObj;var userDateFormat=params.ifFormat?params.ifFormat:(params.daFormat?params.daFormat:"m/d/Y");var inputField=params.inputField?params.inputField:params.inputFieldObj.id;var form=params.form?params.form:'';var startWeekday=params.startWeekday?params.startWeekday:0;var dateFormat=userDateFormat.substr(0,10);var date_field_delimiter=/([-.\\/])/.exec(dateFormat)[0];dateFormat=dateFormat.replace(/[^a-zA-Z]/g,'');var monthPos=dateFormat.search(/m/);var dayPos=dateFormat.search(/d/);var yearPos=dateFormat.search(/Y/);var dateParams=new Object();dateParams.delim=date_field_delimiter;dateParams.monthPos=monthPos;dateParams.dayPos=dayPos;dateParams.yearPos=yearPos;var showButtonElement=Dom.get(showButton);Event.on(showButtonElement,"click",function(){if(!dialog){dialog=new YAHOO.widget.SimpleDialog("container_"+showButtonElement.id,{visible:false,context:[showButton,"tl","bl",["beforeShow"],[-175,5]],buttons:[],draggable:false,close:true,zIndex:Calendar.getHighestZIndex(document.body),constraintoviewport:true});dialog.setHeader(SUGAR.language.get('app_strings','LBL_MASSUPDATE_DATE'));var dialogBody='<p class="callnav_today"><a href="javascript:void(0)" id="callnav_today">'+SUGAR.language.get('app_strings','LBL_EMAIL_DATE_TODAY')+'</a></p><div id="'+showButtonElement.id+'_div"></div>';dialog.setBody(dialogBody);dialog.render(document.body);Dom.addClass("container_"+showButtonElement.id,"cal_panel");Event.addListener("callnav_today","click",function(){calendar.clear();var now=new Date();var input=Calendar.getDateField(inputField,form);input.value=formatSelectedDate(now);var cellIndex=calendar.getCellIndex(now);if(cellIndex>-1){var cell=calendar.cells[cellIndex];Dom.addClass(cell,calendar.Style.CSS_CELL_SELECTED);}
|
||||
if(input.onchange)
|
||||
input.onchange();SUGAR.util.callOnChangeListers(input);return false;});dialog.showEvent.subscribe(function(){if(YAHOO.env.ua.ie){dialog.fireEvent("changeContent");}});Event.on(document,"click",function(e){if(!dialog){return;}
|
||||
var el=Event.getTarget(e);var dialogEl=dialog.element;if(el!=dialogEl&&!Dom.isAncestor(dialogEl,el)&&el!=showButtonElement&&!Dom.isAncestor(showButtonElement,el)){dialog.hide();}});}
|
||||
if(!calendar){var navConfig={strings:{month:SUGAR.language.get('app_strings','LBL_CHOOSE_MONTH'),year:SUGAR.language.get('app_strings','LBL_ENTER_YEAR'),submit:SUGAR.language.get('app_strings','LBL_EMAIL_OK'),cancel:SUGAR.language.get('app_strings','LBL_CANCEL_BUTTON_LABEL'),invalidYear:SUGAR.language.get('app_strings','LBL_ENTER_VALID_YEAR')},monthFormat:YAHOO.widget.Calendar.SHORT,initialFocus:"year"};calendar=new YAHOO.widget.Calendar(showButtonElement.id+'_div',{iframe:false,hide_blank_weeks:true,navigator:navConfig});calendar.cfg.setProperty('DATE_FIELD_DELIMITER',date_field_delimiter);calendar.cfg.setProperty('MDY_DAY_POSITION',dayPos+1);calendar.cfg.setProperty('MDY_MONTH_POSITION',monthPos+1);calendar.cfg.setProperty('MDY_YEAR_POSITION',yearPos+1);calendar.cfg.setProperty('START_WEEKDAY',startWeekday);if(typeof SUGAR.language.languages['app_list_strings']!='undefined'&&SUGAR.language.languages['app_list_strings']['dom_cal_month_long']!='undefined'){if(SUGAR.language.languages['app_list_strings']['dom_cal_month_long'].length==13){SUGAR.language.languages['app_list_strings']['dom_cal_month_long'].shift();}
|
||||
calendar.cfg.setProperty('MONTHS_LONG',SUGAR.language.languages['app_list_strings']['dom_cal_month_long']);}
|
||||
if(typeof SUGAR.language.languages['app_list_strings']!='undefined'&&typeof SUGAR.language.languages['app_list_strings']['dom_cal_day_short']!='undefined'){if(SUGAR.language.languages['app_list_strings']['dom_cal_day_short'].length==8){SUGAR.language.languages['app_list_strings']['dom_cal_day_short'].shift();}
|
||||
calendar.cfg.setProperty('WEEKDAYS_SHORT',SUGAR.language.languages['app_list_strings']['dom_cal_day_short']);}
|
||||
var formatSelectedDate=function(selDate){var monthVal=selDate.getMonth()+1;if(monthVal<10){monthVal='0'+monthVal;}
|
||||
var dateVal=selDate.getDate();if(dateVal<10){dateVal='0'+dateVal;}
|
||||
var yearVal=selDate.getFullYear();selDate='';if(monthPos==0){selDate=monthVal;}
|
||||
else if(dayPos==0){selDate=dateVal;}
|
||||
else{selDate=yearVal;}
|
||||
if(monthPos==1){selDate+=date_field_delimiter+monthVal;}
|
||||
else if(dayPos==1){selDate+=date_field_delimiter+dateVal;}
|
||||
else{selDate+=date_field_delimiter+yearVal;}
|
||||
if(monthPos==2){selDate+=date_field_delimiter+monthVal;}
|
||||
else if(dayPos==2){selDate+=date_field_delimiter+dateVal;}
|
||||
else{selDate+=date_field_delimiter+yearVal;}
|
||||
return selDate;};calendar.selectEvent.subscribe(function(type,args,obj){var input=Calendar.getDateField(inputField,form);if(calendar.getSelectedDates().length>0){input.value=formatSelectedDate(calendar.getSelectedDates()[0]);if(params.comboObject){params.comboObject.update();}}else if(typeof args[0][0]=='object'){selDate=args[0][0];input.value=formatSelectedDate(new Date(selDate[0],selDate[1],selDate[2]));}else{input.value='';}
|
||||
if(input.onchange)
|
||||
input.onchange();dialog.hide();SUGAR.util.callOnChangeListers(input);});calendar.renderEvent.subscribe(function(){dialog.fireEvent("changeContent");});}
|
||||
var sanitizeDate=function(date,dateParams){var dateArray=Array();var returnArray=Array('','','');var delimArray=Array(".","/","-");var dateCheck=0;for(var delimCounter=0;delimCounter<delimArray.length;delimCounter++){dateArray=date.split(delimArray[delimCounter]);if(dateArray.length==3){break;}}
|
||||
if(dateArray.length!=3){var oDate=new Date();var dateArray=[0,0,0];dateArray[dateParams.dayPos]=oDate.getDate();dateArray[dateParams.monthPos]=oDate.getMonth()+1;dateArray[dateParams.yearPos]=oDate.getFullYear();}
|
||||
for(var i=0;i<dateArray.length;i++){if(dateArray[i]>32){returnArray[dateParams.yearPos]=dateArray[i];dateCheck+=1;}
|
||||
else if(dateArray[i]<=12){if((dateParams.monthPos<dateParams.dayPos)&&(returnArray[dateParams.monthPos]=='')){returnArray[dateParams.monthPos]=dateArray[i];dateCheck+=100;}
|
||||
else if((dateParams.monthPos>dateParams.dayPos)&&(returnArray[dateParams.dayPos]!='')){returnArray[dateParams.monthPos]=dateArray[i];dateCheck+=100;}
|
||||
else if((dateParams.dayPos<dateParams.monthPos)&&(returnArray[dateParams.dayPos]=='')){returnArray[dateParams.dayPos]=dateArray[i];dateCheck+=10;}
|
||||
else if((dateParams.dayPos>dateParams.monthPos)&&(returnArray[dateParams.monthPos]!='')){returnArray[dateParams.dayPos]=dateArray[i];dateCheck+=10;}}
|
||||
else if(dateArray[i]>12&&dateArray[i]<32){if(returnArray[dateParams.dayPos]!=''){returnArray[dateParams.monthPos]=returnArray[dateParams.dayPos];dateCheck-=10;dateCheck+=100;}
|
||||
returnArray[dateParams.dayPos]=dateArray[i];dateCheck+=10;}}
|
||||
if(dateCheck!=111){return sanitizeDate("",dateParams);}
|
||||
return returnArray.join(dateParams.delim);};var sanitizedDate=sanitizeDate(Calendar.getDateField(inputField,form).value,dateParams);var sanitizedDateArray=sanitizedDate.split(dateParams.delim);calendar.cfg.setProperty("selected",sanitizedDate);calendar.cfg.setProperty("pageDate",sanitizedDateArray[monthPos]+dateParams.delim+sanitizedDateArray[yearPos]);calendar.render();dialog.show();});});};
|
636
include/javascript/checkbox.js
Normal file
|
@ -0,0 +1,636 @@
|
|||
/**
|
||||
*
|
||||
* SugarCRM Community Edition is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
|
||||
*
|
||||
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
|
||||
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
|
||||
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
|
||||
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @param element
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function selectPageTop(element) {
|
||||
|
||||
var table = $(element).parents("div:eq(0)").children(".list");
|
||||
|
||||
table.find("input:checkbox").prop("checked", true);
|
||||
|
||||
$(element).parents(".subnav").hide().removeClass("ddopen");
|
||||
|
||||
Populate();
|
||||
|
||||
return false; //Prevent page from jumping back to the top on click
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param element
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function selectAllTop(element) {
|
||||
var table = $(element).parents("div:eq(0)").children(".list");
|
||||
|
||||
table.find("input:checkbox").prop({
|
||||
checked: true,
|
||||
disabled: true
|
||||
});
|
||||
|
||||
$("#select_entire_list").val(1);
|
||||
window.select_entire_list = 1;
|
||||
|
||||
$(element).parents(".subnav").hide().removeClass("ddopen");
|
||||
|
||||
Populate();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param element
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function deselectTop(element) {
|
||||
var table = $(element).parents("div:eq(0)").children(".list");
|
||||
|
||||
table.find("input:checkbox").prop({
|
||||
checked: false,
|
||||
disabled: false
|
||||
});
|
||||
|
||||
$("#select_entire_list").val(0);
|
||||
window.select_entire_list = 0;
|
||||
|
||||
$(element).parents(".subnav").hide().removeClass("ddopen");
|
||||
|
||||
//clear id's on deselect
|
||||
var vals = '';
|
||||
|
||||
$("#custom_hidden_1").val(vals);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
$(function () {
|
||||
//set variable to global window scope to compensate for lost value during subpanel pagination
|
||||
if (window.select_entire_list == 1) {
|
||||
$('#select_entire_list').val(1);
|
||||
var table = $('#list_subpanel_delegates .list');
|
||||
|
||||
table.find('input:checkbox').prop({
|
||||
checked: true,
|
||||
disabled: true
|
||||
});
|
||||
}
|
||||
|
||||
//checks all and unchecks all checkboxes based on checkbox in first row of the subpanel table.
|
||||
$('th input:checkbox').click(function (e) {
|
||||
var table = $(e.target).parents('table:first');
|
||||
$('td input:checkbox', table).attr('checked', e.target.checked);
|
||||
|
||||
});
|
||||
//Shows and hides the custom mass update button in subpanel
|
||||
$('.cust_select').unbind("click").click(function () { //unbined is used to prevent the click event from firing twice
|
||||
|
||||
if ($(this).siblings('.cust_list').is(':hidden')) {
|
||||
|
||||
$(this).siblings('.cust_list').show();
|
||||
}
|
||||
else {
|
||||
$(this).siblings('.cust_list').hide();
|
||||
}
|
||||
});
|
||||
|
||||
$('.button_select_this_page_top').click(function (e) {
|
||||
selectPageTop(this);
|
||||
});
|
||||
|
||||
$('.button_select_all_top').click(function (e) {
|
||||
selectAllTop(this);
|
||||
});
|
||||
|
||||
$('.button_deselect_top').click(function (e) {
|
||||
return deselectTop(this);
|
||||
});
|
||||
|
||||
$(".button_toggle_select_all").click(function (e) {
|
||||
if ($(this).is(":checked")) {
|
||||
deselectTop(this);
|
||||
return;
|
||||
}
|
||||
selectPageTop(this);
|
||||
});
|
||||
|
||||
$('input[type="checkbox"]').on('change', function () {
|
||||
Populate();
|
||||
}).change();
|
||||
});
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
function Populate() {
|
||||
vals = $('input[type="checkbox"]:checked').map(function () {
|
||||
|
||||
if (this.value != 'on') {
|
||||
|
||||
return this.value;
|
||||
}
|
||||
}).get().join(',');
|
||||
|
||||
$('#custom_hidden_1').val(vals);
|
||||
}
|
||||
|
||||
function set_return_and_save_background2(popup_reply_data) {
|
||||
var form_name = popup_reply_data.form_name;
|
||||
var name_to_value_array = popup_reply_data.name_to_value_array;
|
||||
var passthru_data = popup_reply_data.passthru_data;
|
||||
var select_entire_list = typeof( popup_reply_data.select_entire_list ) == 'undefined' ? 0 : popup_reply_data.select_entire_list;
|
||||
var current_query_by_page = popup_reply_data.current_query_by_page;
|
||||
|
||||
// construct the POST request
|
||||
var query_array = new Array();
|
||||
if (name_to_value_array != 'undefined') {
|
||||
for (var the_key in name_to_value_array) {
|
||||
if (the_key == 'toJSON') {
|
||||
/* just ignore */
|
||||
}
|
||||
else {
|
||||
query_array.push(the_key + "=" + name_to_value_array[the_key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
//construct the muulti select list
|
||||
var selection_list = popup_reply_data.selection_list;
|
||||
if (selection_list != 'undefined') {
|
||||
for (var the_key in selection_list) {
|
||||
query_array.push('subpanel_id[]=' + selection_list[the_key])
|
||||
}
|
||||
}
|
||||
var module = get_module_name();
|
||||
var id = get_record_id();
|
||||
|
||||
|
||||
query_array.push('value=DetailView');
|
||||
query_array.push('module=' + module);
|
||||
query_array.push('http_method=get');
|
||||
query_array.push('return_module=' + module);
|
||||
query_array.push('return_id=' + id);
|
||||
query_array.push('record=' + id);
|
||||
query_array.push('isDuplicate=false');
|
||||
query_array.push('action=add_to_list');
|
||||
query_array.push('inline=1');
|
||||
query_array.push('select_entire_list=' + select_entire_list);
|
||||
if (select_entire_list == 1) {
|
||||
query_array.push('current_query_by_page=' + current_query_by_page);
|
||||
}
|
||||
|
||||
var refresh_page = 1;
|
||||
for (prop in passthru_data) {
|
||||
if (prop == 'link_field_name') {
|
||||
query_array.push('subpanel_field_name=' + escape(passthru_data[prop]));
|
||||
} else {
|
||||
if (prop == 'module_name') {
|
||||
query_array.push('subpanel_module_name=' + escape(passthru_data[prop]));
|
||||
} else if (prop == 'prospect_ids') {
|
||||
for (var i = 0; i < passthru_data[prop].length; i++) {
|
||||
query_array.push(prop + '[]=' + escape(passthru_data[prop][i]));
|
||||
}
|
||||
} else {
|
||||
query_array.push(prop + '=' + escape(passthru_data[prop]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var query_string = query_array.join('&');
|
||||
request_map[request_id] = passthru_data['child_field'];
|
||||
|
||||
var returnstuff = http_fetch_sync('index.php', query_string);
|
||||
request_id++;
|
||||
|
||||
// Bug 52843
|
||||
// If returnstuff.responseText is empty, don't process, because it will blank the innerHTML
|
||||
if (typeof returnstuff != 'undefined' && typeof returnstuff.responseText != 'undefined' && returnstuff.responseText.length != 0) {
|
||||
got_data(returnstuff, true);
|
||||
}
|
||||
|
||||
if (refresh_page == 1) {
|
||||
document.location.reload(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Using Sugar native YUI Library dialog pop-up for button link groupings
|
||||
function select_targets() {
|
||||
$('#details_popup_div').remove();
|
||||
$('.modal-backdrop').remove();
|
||||
var selectDelegatesPopup = '';
|
||||
|
||||
selectDelegatesPopup += '<div id="details_popup_div" class="modal fade" style="display: none;">';
|
||||
selectDelegatesPopup += '<div class="modal-dialog modal-sm">';//
|
||||
selectDelegatesPopup += '<div class="modal-content">';
|
||||
selectDelegatesPopup += '<div class="modal-header">';
|
||||
selectDelegatesPopup += '<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>';
|
||||
selectDelegatesPopup += '<h4 class="modal-title">' + SUGAR.language.get('FP_events', 'LBL_SELECT_DELEGATES') + '</h4>';
|
||||
selectDelegatesPopup += '</div>';
|
||||
selectDelegatesPopup += '<div class="modal-body">';
|
||||
selectDelegatesPopup += '<div style="padding: 5px 5px; overflow: auto; height: auto;">';
|
||||
selectDelegatesPopup += '<table width="100%" class="list view table-responsive" cellspacing="0" cellpadding="0" border="0">';
|
||||
selectDelegatesPopup += '<tbody>';
|
||||
selectDelegatesPopup += "<tr class='oddListRowS1'><td style='padding: 2px;text-align:left;' width='17'><img src='themes/default/images/view-process-own.png'></td><td style='padding: 2px;font-size: 120%;text-align:left;'><b><a href='#' onclick='handle_targetlists();return false;'>" + SUGAR.language.get('FP_events', 'LBL_SELECT_DELEGATES_TARGET_LIST') + "</a></b></td></tr>";
|
||||
selectDelegatesPopup += "<tr class='evenListRowS1'><td style='padding: 2px;text-align:left;' width='17'><img src='themes/default/images/view-process-own.png'></td><td style='padding: 2px;font-size: 120%;text-align:left;'><strong><a href='#' onclick='handle_targets();return false;'>" + SUGAR.language.get('FP_events', 'LBL_SELECT_DELEGATES_TARGETS') + "</a></strong></td></tr>";
|
||||
selectDelegatesPopup += "<tr class='oddListRowS1'><td style='padding: 2px;text-align:left;' width='17'><img src='themes/default/images/view-process-own.png'></td><td style='padding: 2px;font-size: 120%;text-align:left;'><strong><a href='#' onclick='handle_contacts();return false;'>" + SUGAR.language.get('FP_events', 'LBL_SELECT_DELEGATES_CONTACTS') + "</a></strong></td></tr>";
|
||||
selectDelegatesPopup += "<tr class='evenListRowS1'><td style='padding: 2px;text-align:left;' width='17'><img src='themes/default/images/view-process-own.png'></td><td style='padding: 2px;font-size: 120%;text-align:left;'><strong><a href='#' onclick='handle_leads();return false;'>" + SUGAR.language.get('FP_events', 'LBL_SELECT_DELEGATES_LEADS') + "</a></strong></td></tr>";
|
||||
selectDelegatesPopup += '</tbody></table>';
|
||||
selectDelegatesPopup += '</div>';
|
||||
selectDelegatesPopup += '</div>';
|
||||
selectDelegatesPopup += '<div class="modal-footer"> <button type="button" class="btn btn-primary" data-dismiss="modal">' + SUGAR.language.get('app_strings', 'LBL_CANCEL_BUTTON_LABEL') + '</button></div>';
|
||||
selectDelegatesPopup += '</div>';
|
||||
selectDelegatesPopup += '</div>';
|
||||
selectDelegatesPopup += '</div>';
|
||||
$("body").append(selectDelegatesPopup);
|
||||
$('#details_popup_div').modal('show', {backdrop: 'static'});
|
||||
}
|
||||
|
||||
//open target list pop-up window
|
||||
function handle_targetlists() {
|
||||
$('#details_popup_div').remove();
|
||||
$('.modal-backdrop').remove();
|
||||
open_popup("ProspectLists", 600, 400, "", true, true, {
|
||||
"call_back_function": "set_return_and_save_background2",
|
||||
"form_name": "DetailView",
|
||||
"field_to_name_array": {"id": "subpanel_id"},
|
||||
"passthru_data": {
|
||||
"child_field": "delegates",
|
||||
"return_url": "index.php%3Fmodule%3DFP_events%26action%3DSubPanelViewer%26subpanel%3Ddelegates%26sugar_body_only%3D1",
|
||||
"link_field_name": null,
|
||||
"module_name": "delegates",
|
||||
"refresh_page": 0,
|
||||
"pop_up_type": "target_list"
|
||||
}
|
||||
}, "MultiSelect", true);
|
||||
}
|
||||
//open targets pop-up window
|
||||
function handle_targets() {
|
||||
$('#details_popup_div').remove();
|
||||
$('.modal-backdrop').remove();
|
||||
open_popup("Prospects", 600, 400, "", true, true, {
|
||||
"call_back_function": "set_return_and_save_background2",
|
||||
"form_name": "DetailView",
|
||||
"field_to_name_array": {"id": "subpanel_id"},
|
||||
"passthru_data": {
|
||||
"child_field": "delegates",
|
||||
"return_url": "index.php%3Fmodule%3DFP_events%26action%3DSubPanelViewer%26subpanel%3Ddelegates%26sugar_body_only%3D1",
|
||||
"link_field_name": null,
|
||||
"module_name": "delegates",
|
||||
"refresh_page": 0,
|
||||
"pop_up_type": "targets"
|
||||
}
|
||||
}, "MultiSelect", true);
|
||||
}
|
||||
//open contacts pop-up window
|
||||
function handle_contacts() {
|
||||
$('#details_popup_div').remove();
|
||||
$('.modal-backdrop').remove();
|
||||
open_popup("Contacts", 600, 400, "", true, true, {
|
||||
"call_back_function": "set_return_and_save_background2",
|
||||
"form_name": "DetailView",
|
||||
"field_to_name_array": {"id": "subpanel_id"},
|
||||
"passthru_data": {
|
||||
"child_field": "delegates",
|
||||
"return_url": "index.php%3Fmodule%3DFP_events%26action%3DSubPanelViewer%26subpanel%3Ddelegates%26sugar_body_only%3D1",
|
||||
"link_field_name": null,
|
||||
"module_name": "delegates",
|
||||
"refresh_page": 0,
|
||||
"pop_up_type": "contacts"
|
||||
}
|
||||
}, "MultiSelect", true);
|
||||
}
|
||||
//open leads pop-up window
|
||||
function handle_leads() {
|
||||
$('#details_popup_div').remove();
|
||||
$('.modal-backdrop').remove();
|
||||
open_popup("Leads", 600, 400, "", true, true, {
|
||||
"call_back_function": "set_return_and_save_background2",
|
||||
"form_name": "DetailView",
|
||||
"field_to_name_array": {"id": "subpanel_id"},
|
||||
"passthru_data": {
|
||||
"child_field": "delegates",
|
||||
"return_url": "index.php%3Fmodule%3DFP_events%26action%3DSubPanelViewer%26subpanel%3Ddelegates%26sugar_body_only%3D1",
|
||||
"link_field_name": null,
|
||||
"module_name": "delegates",
|
||||
"refresh_page": 0,
|
||||
"pop_up_type": "leads"
|
||||
}
|
||||
}, "MultiSelect", true);
|
||||
}
|
||||
|
||||
|
||||
function manage_delegates() {
|
||||
$('#details_popup_div').remove();
|
||||
$('.modal-backdrop').remove();
|
||||
var ids = $("#custom_hidden_1").val();
|
||||
var manageDelegatesPopup = '';
|
||||
var manageDelegatesPopupBody = '';
|
||||
|
||||
manageDelegatesPopup += '<div id="details_popup_div" class="modal fade" style="display: none;">';
|
||||
manageDelegatesPopup += '<div class="modal-dialog modal-sm">';//
|
||||
manageDelegatesPopup += '<div class="modal-content">';
|
||||
manageDelegatesPopup += '<div class="modal-header">';
|
||||
manageDelegatesPopup += '<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>';
|
||||
manageDelegatesPopup += '<h4 class="modal-title">' + SUGAR.language.get('FP_events', 'LBL_MANAGE_DELEGATES') + '</h4>';
|
||||
manageDelegatesPopup += '</div>';
|
||||
manageDelegatesPopup += '<div class="modal-body">';
|
||||
|
||||
if (ids != '') {
|
||||
manageDelegatesPopupBody += '<div style="padding: 5px 5px; overflow: auto; height: auto;">';
|
||||
manageDelegatesPopupBody += '<table width="100%" class="list view table-responsive" cellspacing="0" cellpadding="0" border="0">';
|
||||
manageDelegatesPopupBody += '<tbody>';
|
||||
manageDelegatesPopupBody += "<tr class='oddListRowS1'><td style='padding: 2px;text-align:right;' width='17'><img src='themes/default/images/view-process-own.png'></td><td style='padding: 2px;font-size: 120%;'><b><a href='#' onclick='handle_invited();return false;'>" + SUGAR.language.get('FP_events', 'LBL_MANAGE_DELEGATES_INVITED') + "</a></b></td></tr>";
|
||||
manageDelegatesPopupBody += "<tr class='evenListRowS1'><td style='padding: 2px;text-align:right;' width='17'><img src='themes/default/images/view-process-own.png'></td><td style='padding: 2px;font-size: 120%;'><strong><a href='#' onclick='handle_not_invited();return false;'>" + SUGAR.language.get('FP_events', 'LBL_MANAGE_DELEGATES_NOT_INVITED') + "</a></strong></td></tr>";
|
||||
manageDelegatesPopupBody += "<tr class='oddListRowS1'><td style='padding: 2px;text-align:right;' width='17'><img src='themes/default/images/view-process-own.png'></td><td style='padding: 2px;font-size: 120%;'><strong><a href='#' onclick='handle_attended();return false;'>" + SUGAR.language.get('FP_events', 'LBL_MANAGE_DELEGATES_ATTENDED') + "</a></strong></td></tr>";
|
||||
manageDelegatesPopupBody += "<tr class='evenListRowS1'><td style='padding: 2px;text-align:right;' width='17'><img src='themes/default/images/view-process-own.png'></td><td style='padding: 2px;font-size: 120%;'><strong><a href='#' onclick='handle_not_attended();return false;'>" + SUGAR.language.get('FP_events', 'LBL_MANAGE_DELEGATES_NOT_ATTENDED') + "</a></strong></td></tr>";
|
||||
manageDelegatesPopupBody += '</tbody></table>';
|
||||
manageDelegatesPopupBody += '</div>';
|
||||
} else { //if no delegates are checked show error message
|
||||
manageDelegatesPopupBody += '<div style="padding: 5px 5px; overflow: auto; height: auto;">';
|
||||
manageDelegatesPopupBody += '<table width="100%" class="list view table default" cellspacing="0" cellpadding="0" border="0">';
|
||||
manageDelegatesPopupBody += '<tbody>';
|
||||
manageDelegatesPopupBody += "<tr><td style='padding: 2px;text-align:center;color:#FF0000;' width='17'>" + SUGAR.language.get('FP_events', 'LBL_MANAGE_POPUP_ERROR') + "</td></tr>";
|
||||
manageDelegatesPopupBody += '</tbody></table>';
|
||||
manageDelegatesPopupBody += '</div>';
|
||||
}
|
||||
manageDelegatesPopup += '</div>';
|
||||
manageDelegatesPopup += '<div class="modal-footer"> <button type="button" class="btn btn-primary" data-dismiss="modal">' + SUGAR.language.get('app_strings', 'LBL_CANCEL_BUTTON_LABEL') + '</button></div>';
|
||||
manageDelegatesPopup += '</div>';
|
||||
manageDelegatesPopup += '</div>';
|
||||
manageDelegatesPopup += '</div>';
|
||||
$("body").append(manageDelegatesPopup);
|
||||
$('#details_popup_div .modal-body').html(manageDelegatesPopupBody);
|
||||
$('#details_popup_div').modal('show', {backdrop: 'static'});
|
||||
}
|
||||
|
||||
function showNoCheck() {
|
||||
$('#details_popup_div').remove();
|
||||
$("#no_check").remove();
|
||||
$('.modal-backdrop').remove();
|
||||
var manageDelegatesHandleErrorPopup = '';
|
||||
manageDelegatesHandleErrorPopup += '<div id="no_check" class="modal fade" style="display: none;">';
|
||||
manageDelegatesHandleErrorPopup += '<div class="modal-dialog modal-sm">';
|
||||
manageDelegatesHandleErrorPopup += '<div class="modal-content">';
|
||||
manageDelegatesHandleErrorPopup += '<div class="modal-header">';
|
||||
manageDelegatesHandleErrorPopup += '<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>';
|
||||
manageDelegatesHandleErrorPopup += '<h4 class="modal-title">' + SUGAR.language.get('FP_events', 'LBL_MANAGE_DELEGATES') + '</h4>';
|
||||
manageDelegatesHandleErrorPopup += '</div>';
|
||||
manageDelegatesHandleErrorPopup += '<div class="modal-body">';
|
||||
manageDelegatesHandleErrorPopup += '<div style="padding: 5px 5px; overflow: auto; height: auto;">';
|
||||
manageDelegatesHandleErrorPopup += '<table width="100%" class="list view table-responsive" cellspacing="0" cellpadding="0" border="0">';
|
||||
manageDelegatesHandleErrorPopup += '<tbody>';
|
||||
manageDelegatesHandleErrorPopup += "<tr><td style='padding: 2px;text-align:center;color:#FF0000;' width='17'>" + SUGAR.language.get('FP_events', 'LBL_MANAGE_POPUP_ERROR') + "</td></tr>";
|
||||
manageDelegatesHandleErrorPopup += '</tbody></table>';
|
||||
manageDelegatesHandleErrorPopup += '</div>';
|
||||
manageDelegatesHandleErrorPopup += '</div>';
|
||||
manageDelegatesHandleErrorPopup += '<div class="modal-footer"> <button type="button" class="btn btn-primary" data-dismiss="modal">' + SUGAR.language.get('app_strings', 'LBL_CANCEL_BUTTON_LABEL') + '</button></div>';
|
||||
manageDelegatesHandleErrorPopup += '</div>';
|
||||
manageDelegatesHandleErrorPopup += '</div>';
|
||||
manageDelegatesHandleErrorPopup += '</div>';
|
||||
$("body").append(manageDelegatesHandleErrorPopup);
|
||||
$('#no_check').modal('show', {backdrop: 'static'});
|
||||
}
|
||||
|
||||
function handle_invited() {
|
||||
$('#details_popup_div').remove();
|
||||
$('.modal-backdrop').remove();
|
||||
var ids = $("#custom_hidden_1").val();
|
||||
var list = $("#select_entire_list").val();
|
||||
var eventid = $("[name='record']").val();
|
||||
var data = 'id=' + ids;
|
||||
data += '&event_id=' + eventid;
|
||||
data += '&entire_list=' + list;
|
||||
|
||||
if (ids != '') {
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "index.php?module=FP_events&action=markasinvited",
|
||||
data: data,
|
||||
success: function () {
|
||||
showSubPanel('delegates', null, true, 'FP_events');
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
showNoCheck();
|
||||
}
|
||||
$("body").removeClass('modal-open');
|
||||
}
|
||||
|
||||
function handle_not_invited() {
|
||||
$('#details_popup_div').remove();
|
||||
$('.modal-backdrop').remove();
|
||||
var ids = $("#custom_hidden_1").val();
|
||||
var list = $("#select_entire_list").val();
|
||||
var eventid = $("[name='record']").val();
|
||||
var data = 'id=' + ids;
|
||||
data += '&event_id=' + eventid;
|
||||
data += '&entire_list=' + list;
|
||||
|
||||
if (ids != '') {
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "index.php?module=FP_events&action=markasnotinvited",
|
||||
data: data,
|
||||
success: function () {
|
||||
showSubPanel('delegates', null, true, 'FP_events');
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
showNoCheck();
|
||||
}
|
||||
$("body").removeClass('modal-open');
|
||||
}
|
||||
|
||||
function handle_attended() {
|
||||
$('#details_popup_div').remove();
|
||||
$('.modal-backdrop').remove();
|
||||
var ids = $("#custom_hidden_1").val();
|
||||
var list = $("#select_entire_list").val();
|
||||
var eventid = $("[name='record']").val();
|
||||
var data = 'id=' + ids;
|
||||
data += '&event_id=' + eventid;
|
||||
data += '&entire_list=' + list;
|
||||
|
||||
if (ids != '') {
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "index.php?module=FP_events&action=markasattended",
|
||||
data: data,
|
||||
success: function () {
|
||||
showSubPanel('delegates', null, true, 'FP_events');
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
showNoCheck();
|
||||
}
|
||||
$("body").removeClass('modal-open');
|
||||
|
||||
}
|
||||
|
||||
function handle_not_attended() {
|
||||
$('#details_popup_div').remove();
|
||||
$('.modal-backdrop').remove();
|
||||
var ids = $("#custom_hidden_1").val();
|
||||
var list = $("#select_entire_list").val();
|
||||
var eventid = $("[name='record']").val();
|
||||
var data = 'id=' + ids;
|
||||
data += '&event_id=' + eventid;
|
||||
data += '&entire_list=' + list;
|
||||
|
||||
if (ids != '') {
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "index.php?module=FP_events&action=markasnotattended",
|
||||
data: data,
|
||||
success: function () {
|
||||
showSubPanel('delegates', null, true, 'FP_events');
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
showNoCheck();
|
||||
}
|
||||
$("body").removeClass('modal-open');
|
||||
}
|
||||
|
||||
function manage_acceptances() {
|
||||
$('#details_popup_div').remove();
|
||||
$('.modal-backdrop').remove();
|
||||
var ids = $("#custom_hidden_1").val();
|
||||
|
||||
var manageAcceptancePopup = '';
|
||||
var manageAcceptancePopupBody = '';
|
||||
|
||||
manageAcceptancePopup += '<div id="details_popup_div" class="modal fade" style="display: none;">';
|
||||
manageAcceptancePopup += '<div class="modal-dialog modal-sm" style="width: 350px;">';//
|
||||
manageAcceptancePopup += '<div class="modal-content">';
|
||||
manageAcceptancePopup += '<div class="modal-header">';
|
||||
manageAcceptancePopup += '<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>';
|
||||
manageAcceptancePopup += '<h4 class="modal-title">' + SUGAR.language.get('FP_events', 'LBL_MANAGE_ACCEPTANCES') + '</h4>';
|
||||
manageAcceptancePopup += '</div>';
|
||||
manageAcceptancePopup += '<div class="modal-body">';
|
||||
|
||||
if (ids != '') {
|
||||
manageAcceptancePopupBody += '<div style="padding: 5px 5px; overflow: auto; height: auto;">';
|
||||
manageAcceptancePopupBody += '<table width="100%" class="list view table-responsive" cellspacing="0" cellpadding="0" border="0">';
|
||||
manageAcceptancePopupBody += '<tbody>';
|
||||
manageAcceptancePopupBody += "<tr class='oddListRowS1'><td style='padding: 2px;text-align:right;' width='17'><img src='themes/default/images/view-process-own.png'></td><td style='padding: 2px;font-size: 120%;'><b><a id='MarkAsAcceptedForm' onclick='handle_accepted();return false;' href='#'>" + SUGAR.language.get('FP_events', 'LBL_MANAGE_ACCEPTANCES_ACCEPTED') + "</a></b></td></tr>";
|
||||
manageAcceptancePopupBody += "<tr class='evenListRowS1'><td style='padding: 2px;text-align:right;' width='17'><img src='themes/default/images/view-process-own.png'></td><td style='padding: 2px;font-size: 120%;'><strong><a id='MarkAsDeclinedForm' onclick='handle_declined();return false;' href='#'>" + SUGAR.language.get('FP_events', 'LBL_MANAGE_ACCEPTANCES_DECLINED') + "</a></strong></td></tr>";
|
||||
manageAcceptancePopupBody += '</tbody></table>';
|
||||
manageAcceptancePopupBody += '</div>';
|
||||
} else { //if no delegates are check show error message
|
||||
manageAcceptancePopupBody += '<div style="padding: 5px 5px; overflow: auto; height: auto;">';
|
||||
manageAcceptancePopupBody += '<table width="100%" class="list view table default" cellspacing="0" cellpadding="0" border="0">';
|
||||
manageAcceptancePopupBody += '<tbody>';
|
||||
manageAcceptancePopupBody += "<tr><td style='padding: 2px;text-align:center;color:#FF0000;' width='17'>" + SUGAR.language.get('FP_events', 'LBL_MANAGE_POPUP_ERROR') + "</td></tr>";
|
||||
manageAcceptancePopupBody += '</tbody></table>';
|
||||
manageAcceptancePopupBody += '</div>';
|
||||
}
|
||||
manageAcceptancePopup += '</div>';
|
||||
manageAcceptancePopup += '<div class="modal-footer"> <button type="button" class="btn btn-primary" data-dismiss="modal">' + SUGAR.language.get('app_strings', 'LBL_CANCEL_BUTTON_LABEL') + '</button></div>';
|
||||
manageAcceptancePopup += '</div>';
|
||||
manageAcceptancePopup += '</div>';
|
||||
manageAcceptancePopup += '</div>';
|
||||
$("body").append(manageAcceptancePopup);
|
||||
$('#details_popup_div .modal-body').html(manageAcceptancePopupBody);
|
||||
$('#details_popup_div').modal('show', {backdrop: 'static'});
|
||||
}
|
||||
|
||||
function handle_accepted() {
|
||||
$('#details_popup_div').remove();
|
||||
$('.modal-backdrop').remove();
|
||||
var ids = $("#custom_hidden_1").val();
|
||||
var list = $("#select_entire_list").val();
|
||||
var eventid = $("[name='record']").val();
|
||||
var data = 'id=' + ids;
|
||||
data += '&event_id=' + eventid;
|
||||
data += '&entire_list=' + list;
|
||||
|
||||
if (ids != '') {
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "index.php?module=FP_events&action=markasaccepted",
|
||||
data: data,
|
||||
success: function () {
|
||||
showSubPanel('delegates', null, true, 'FP_events');
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
showNoCheck();
|
||||
}
|
||||
}
|
||||
|
||||
function handle_declined() {
|
||||
$('#details_popup_div').remove();
|
||||
$('.modal-backdrop').remove();
|
||||
var ids = $("#custom_hidden_1").val();
|
||||
var list = $("#select_entire_list").val();
|
||||
var eventid = $("[name='record']").val();
|
||||
var data = 'id=' + ids;
|
||||
data += '&event_id=' + eventid;
|
||||
data += '&entire_list=' + list;
|
||||
|
||||
if (ids != '') {
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "index.php?module=FP_events&action=markasdeclined",
|
||||
data: data,
|
||||
success: function () {
|
||||
showSubPanel('delegates', null, true, 'FP_events');
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
showNoCheck();
|
||||
}
|
||||
}
|
56
include/javascript/cookie.js
Executable file
|
@ -0,0 +1,56 @@
|
|||
/**
|
||||
*
|
||||
* SugarCRM Community Edition is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
|
||||
*
|
||||
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
|
||||
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
|
||||
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
|
||||
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
|
||||
*/function Get_Cookie(name){var start=document.cookie.indexOf(name+'=');var len=start+name.length+1;if((!start)&&(name!=document.cookie.substring(0,name.length)))
|
||||
return null;if(start==-1)
|
||||
return null;var end=document.cookie.indexOf(';',len);if(end==-1)end=document.cookie.length;if(end==start){return'';}
|
||||
return unescape(document.cookie.substring(len,end));}
|
||||
function Set_Cookie(name,value,expires,path,domain,secure){var today=new Date();today.setTime(today.getTime());if(expires){expires=expires*1000*60*60*24;}
|
||||
var expires_date=new Date(today.getTime()+(expires));document.cookie=name+"="+escape(value)+
|
||||
((expires)?";expires="+expires_date.toGMTString():"")+
|
||||
((path)?";path="+path:"")+
|
||||
((domain)?";domain="+domain:"")+
|
||||
((secure)?";secure":"");}
|
||||
function Delete_Cookie(name,path,domain){if(Get_Cookie(name))
|
||||
document.cookie=name+'='+
|
||||
((path)?';path='+path:'')+
|
||||
((domain)?';domain='+domain:'')+';expires=Thu, 01-Jan-1970 00:00:01 GMT';}
|
||||
function get_sub_cookies(cookie){var cookies=new Array();var end='';if(cookie&&cookie!=''){end=cookie.indexOf('#')
|
||||
while(end>-1){var cur=cookie.substring(0,end);cookie=cookie.substring(end+1,cookie.length);var name=cur.substring(0,cur.indexOf('='));var value=cur.substring(cur.indexOf('=')+1,cur.length);cookies[name]=value;end=cookie.indexOf('#')}}
|
||||
return cookies;}
|
||||
function subs_to_cookie(cookies){var cookie='';for(var i in cookies){if(typeof(cookies[i])!="function"){cookie+=i+'='+cookies[i]+'#';}}
|
||||
return cookie;}
|
40
include/javascript/dashlets.js
Executable file
|
@ -0,0 +1,40 @@
|
|||
/**
|
||||
*
|
||||
* SugarCRM Community Edition is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
|
||||
*
|
||||
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
|
||||
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
|
||||
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
|
||||
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
|
||||
*/SUGAR.dashlets=function(){return{postForm:function(theForm,callback){var success=function(data){if(data){callback(data.responseText);}}
|
||||
YAHOO.util.Connect.setForm(theForm);var cObj=YAHOO.util.Connect.asyncRequest('POST','index.php',{success:success,failure:success});return false;},callMethod:function(dashletId,methodName,postData,refreshAfter,callback){ajaxStatus.showStatus(SUGAR.language.get('app_strings','LBL_SAVING'));response=function(data){ajaxStatus.hideStatus();if(refreshAfter)SUGAR.mySugar.retrieveDashlet(dashletId);if(callback){callback(data.responseText);}}
|
||||
post='to_pdf=1&module=Home&action=CallMethodDashlet&method='+methodName+'&id='+dashletId+'&'+postData;var cObj=YAHOO.util.Connect.asyncRequest('POST','index.php',{success:response,failure:response},post);}};}();if(SUGAR.util.isTouchScreen()&&typeof iScroll=='undefined'){with(document.getElementsByTagName("head")[0].appendChild(document.createElement("script"))){setAttribute("id","newScript",0);setAttribute("type","text/javascript",0);setAttribute("src","include/javascript/iscroll.js",0);}}
|
107
include/javascript/getYUIComboFile.php
Executable file
|
@ -0,0 +1,107 @@
|
|||
<?php
|
||||
if (!defined('sugarEntry') || !sugarEntry) {
|
||||
die('Not A Valid Entry Point');
|
||||
}
|
||||
/**
|
||||
*
|
||||
* SugarCRM Community Edition is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
|
||||
*
|
||||
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
|
||||
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
|
||||
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
|
||||
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
|
||||
*/
|
||||
|
||||
if (empty($_REQUEST)) {
|
||||
die();
|
||||
}
|
||||
|
||||
$yui_path = array(
|
||||
"2.9.0" => "include/javascript/yui",
|
||||
"2_9_0" => "include/javascript/yui",
|
||||
"3.3.0" => "include/javascript/yui3",
|
||||
"3_3_0" => "include/javascript/yui3"
|
||||
);
|
||||
$types = array(
|
||||
"js" => "application/javascript",
|
||||
"css" => "text/css",
|
||||
);
|
||||
$out = "";
|
||||
|
||||
$contentType = "";
|
||||
$allpath = "";
|
||||
|
||||
foreach ($_REQUEST as $param => $val) {
|
||||
//No backtracking in the path
|
||||
if (strpos($param, "..") !== false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$version = explode("/", $param);
|
||||
$version = $version[0];
|
||||
if (empty($yui_path[$version])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$path = $yui_path[$version] . substr($param, strlen($version));
|
||||
|
||||
$extension = substr($path, strrpos($path, "_") + 1);
|
||||
|
||||
//Only allowed file extensions
|
||||
if (empty($types[$extension])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (empty($contentType)) {
|
||||
$contentType = $types[$extension];
|
||||
}
|
||||
//Put together the final filepath
|
||||
$path = substr($path, 0, strrpos($path, "_")) . "." . $extension;
|
||||
$contents = '';
|
||||
if (is_file($path)) {
|
||||
$out .= "/*" . $path . "*/\n";
|
||||
$contents = file_get_contents($path);
|
||||
$out .= $contents . "\n";
|
||||
}
|
||||
$path = empty($contents) ? $path : $contents;
|
||||
$allpath .= md5($path);
|
||||
}
|
||||
|
||||
$etag = '"'.md5($allpath).'"';
|
||||
|
||||
// try to use the content cached locally if it's the same as we have here.
|
||||
header("Cache-Control: private");
|
||||
header("Pragma: dummy=bogus");
|
||||
header("Etag: $etag");
|
||||
header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 2592000));
|
||||
header("Content-Type: $contentType");
|
||||
echo($out);
|
42
include/javascript/importWizard.js
Executable file
|
@ -0,0 +1,42 @@
|
|||
/**
|
||||
*
|
||||
* SugarCRM Community Edition is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
|
||||
*
|
||||
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
|
||||
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
|
||||
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
|
||||
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
|
||||
*/SUGAR.importWizard={};SUGAR.importWizard=function(){return{renderDialog:function(importModuleVAR,actionVar,sourceVar){var oBody=document.getElementsByTagName('BODY').item(0);if(!document.getElementById("importWizardDialog")){var importWizardDialogDiv=document.createElement("div");importWizardDialogDiv.id="importWizardDialog";importWizardDialogDiv.style.display="none";importWizardDialogDiv.className="dashletPanelMenu wizard import";importWizardDialogDiv.innerHTML='<div class="hd"><a href="javascript:void(0)" onClick="javascript:SUGAR.importWizard.closeDialog();"><div class="container-close"> </div></a><div class="title" id="importWizardDialogTitle"></div></div><div class="bd"><div class="screen" id="importWizardDialogDiv"></div><div id="submitDiv"></div></div>';oBody.appendChild(importWizardDialogDiv);}
|
||||
YAHOO.util.Event.onContentReady("importWizardDialog",function(){SUGAR.importWizard.dialog=new YAHOO.widget.Dialog("importWizardDialog",{width:"950px",height:"565px",fixedcenter:true,draggable:false,visible:false,modal:true,close:false});var oHead=document.getElementsByTagName('HEAD').item(0);if(!document.getElementById("sugar_grp_yui_widgets")){var oScript=document.createElement("script");oScript.type="text/javascript";oScript.id="sugar_grp_yui_widgets";oScript.src="cache/include/javascript/sugar_grp_yui_widgets.js";oHead.appendChild(oScript);}
|
||||
var success=function(data){var response=YAHOO.lang.JSON.parse(data.responseText);importWizardDialogDiv=document.getElementById('importWizardDialogDiv');var submitDiv=document.getElementById('submitDiv');var importWizardDialogTitle=document.getElementById('importWizardDialogTitle');importWizardDialogDiv.innerHTML=response['html'];importWizardDialogTitle.innerHTML=response['title'];submitDiv.innerHTML=response['submitContent'];document.getElementById('importWizardDialog').style.display='';SUGAR.importWizard.dialog.render();SUGAR.importWizard.dialog.show();SUGAR.util.globalEval(response['script']);}
|
||||
var cObj=YAHOO.util.Connect.asyncRequest('GET','index.php?module=Import&action='+actionVar+'&import_module='+importModuleVAR+'&source='+sourceVar,{success:success,failure:success});return false;});},closeDialog:function(){SUGAR.importWizard.dialog.hide();var importWizardDialogDiv=document.getElementById('importWizardDialogDiv');var submitDiv=document.getElementById('submitDiv');importWizardDialogDiv.innerHTML="";submitDiv.innerHTML="";SUGAR.importWizard.dialog.destroy();},renderLoadingDialog:function(){SUGAR.importWizard.loading=new YAHOO.widget.Panel("loading",{width:"240px",fixedcenter:true,close:false,draggable:false,constraintoviewport:false,modal:true,visible:false,effect:[{effect:YAHOO.widget.ContainerEffect.SLIDE,duration:0.5},{effect:YAHOO.widget.ContainerEffect.FADE,duration:.5}]});SUGAR.importWizard.loading.setBody('<div id="loadingPage" align="center" style="vertical-align:middle;"><img src="'+SUGAR.themes.image_server+'index.php?entryPoint=getImage&themeName='+SUGAR.themes.theme_name+'&imageName=img_loading.gif" align="absmiddle" /> <b>'+SUGAR.language.get('app_strings','LBL_LOADING_PAGE')+'</b></div>');SUGAR.importWizard.loading.render(document.body);if(document.getElementById('loading_c'))
|
||||
document.getElementById('loading_c').style.display='none';}};}();
|
376
include/javascript/include.js
Executable file
|
@ -0,0 +1,376 @@
|
|||
/*
|
||||
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.net/yui/license.txt
|
||||
version: 2.6.0
|
||||
*/(function(){YAHOO.util.Config=function(D){if(D){this.init(D);}};var B=YAHOO.lang,C=YAHOO.util.CustomEvent,A=YAHOO.util.Config;A.CONFIG_CHANGED_EVENT="configChanged";A.BOOLEAN_TYPE="boolean";A.prototype={owner:null,queueInProgress:false,config:null,initialConfig:null,eventQueue:null,configChangedEvent:null,init:function(D){this.owner=D;this.configChangedEvent=this.createEvent(A.CONFIG_CHANGED_EVENT);this.configChangedEvent.signature=C.LIST;this.queueInProgress=false;this.config={};this.initialConfig={};this.eventQueue=[];},checkBoolean:function(D){return(typeof D==A.BOOLEAN_TYPE);},checkNumber:function(D){return(!isNaN(D));},fireEvent:function(D,F){var E=this.config[D];if(E&&E.event){E.event.fire(F);}},addProperty:function(E,D){E=E.toLowerCase();this.config[E]=D;D.event=this.createEvent(E,{scope:this.owner});D.event.signature=C.LIST;D.key=E;if(D.handler){D.event.subscribe(D.handler,this.owner);}
|
||||
this.setProperty(E,D.value,true);if(!D.suppressEvent){this.queueProperty(E,D.value);}},getConfig:function(){var D={},F=this.config,G,E;for(G in F){if(B.hasOwnProperty(F,G)){E=F[G];if(E&&E.event){D[G]=E.value;}}}
|
||||
return D;},getProperty:function(D){var E=this.config[D.toLowerCase()];if(E&&E.event){return E.value;}else{return undefined;}},resetProperty:function(D){D=D.toLowerCase();var E=this.config[D];if(E&&E.event){if(this.initialConfig[D]&&!B.isUndefined(this.initialConfig[D])){this.setProperty(D,this.initialConfig[D]);return true;}}else{return false;}},setProperty:function(E,G,D){var F;E=E.toLowerCase();if(this.queueInProgress&&!D){this.queueProperty(E,G);return true;}else{F=this.config[E];if(F&&F.event){if(F.validator&&!F.validator(G)){return false;}else{F.value=G;if(!D){this.fireEvent(E,G);this.configChangedEvent.fire([E,G]);}
|
||||
return true;}}else{return false;}}},queueProperty:function(S,P){S=S.toLowerCase();var R=this.config[S],K=false,J,G,H,I,O,Q,F,M,N,D,L,T,E;if(R&&R.event){if(!B.isUndefined(P)&&R.validator&&!R.validator(P)){return false;}else{if(!B.isUndefined(P)){R.value=P;}else{P=R.value;}
|
||||
K=false;J=this.eventQueue.length;for(L=0;L<J;L++){G=this.eventQueue[L];if(G){H=G[0];I=G[1];if(H==S){this.eventQueue[L]=null;this.eventQueue.push([S,(!B.isUndefined(P)?P:I)]);K=true;break;}}}
|
||||
if(!K&&!B.isUndefined(P)){this.eventQueue.push([S,P]);}}
|
||||
if(R.supercedes){O=R.supercedes.length;for(T=0;T<O;T++){Q=R.supercedes[T];F=this.eventQueue.length;for(E=0;E<F;E++){M=this.eventQueue[E];if(M){N=M[0];D=M[1];if(N==Q.toLowerCase()){this.eventQueue.push([N,D]);this.eventQueue[E]=null;break;}}}}}
|
||||
return true;}else{return false;}},refireEvent:function(D){D=D.toLowerCase();var E=this.config[D];if(E&&E.event&&!B.isUndefined(E.value)){if(this.queueInProgress){this.queueProperty(D);}else{this.fireEvent(D,E.value);}}},applyConfig:function(D,G){var F,E;if(G){E={};for(F in D){if(B.hasOwnProperty(D,F)){E[F.toLowerCase()]=D[F];}}
|
||||
this.initialConfig=E;}
|
||||
for(F in D){if(B.hasOwnProperty(D,F)){this.queueProperty(F,D[F]);}}},refresh:function(){var D;for(D in this.config){if(B.hasOwnProperty(this.config,D)){this.refireEvent(D);}}},fireQueue:function(){var E,H,D,G,F;this.queueInProgress=true;for(E=0;E<this.eventQueue.length;E++){H=this.eventQueue[E];if(H){D=H[0];G=H[1];F=this.config[D];F.value=G;this.eventQueue[E]=null;this.fireEvent(D,G);}}
|
||||
this.queueInProgress=false;this.eventQueue=[];},subscribeToConfigEvent:function(E,F,H,D){var G=this.config[E.toLowerCase()];if(G&&G.event){if(!A.alreadySubscribed(G.event,F,H)){G.event.subscribe(F,H,D);}
|
||||
return true;}else{return false;}},unsubscribeFromConfigEvent:function(D,E,G){var F=this.config[D.toLowerCase()];if(F&&F.event){return F.event.unsubscribe(E,G);}else{return false;}},toString:function(){var D="Config";if(this.owner){D+=" ["+this.owner.toString()+"]";}
|
||||
return D;},outputEventQueue:function(){var D="",G,E,F=this.eventQueue.length;for(E=0;E<F;E++){G=this.eventQueue[E];if(G){D+=G[0]+"="+G[1]+", ";}}
|
||||
return D;},destroy:function(){var E=this.config,D,F;for(D in E){if(B.hasOwnProperty(E,D)){F=E[D];F.event.unsubscribeAll();F.event=null;}}
|
||||
this.configChangedEvent.unsubscribeAll();this.configChangedEvent=null;this.owner=null;this.config=null;this.initialConfig=null;this.eventQueue=null;}};A.alreadySubscribed=function(E,H,I){var F=E.subscribers.length,D,G;if(F>0){G=F-1;do{D=E.subscribers[G];if(D&&D.obj==I&&D.fn==H){return true;}}while(G--);}
|
||||
return false;};YAHOO.lang.augmentProto(A,YAHOO.util.EventProvider);}());(function(){YAHOO.widget.Module=function(Q,P){if(Q){this.init(Q,P);}else{}};var F=YAHOO.util.Dom,D=YAHOO.util.Config,M=YAHOO.util.Event,L=YAHOO.util.CustomEvent,G=YAHOO.widget.Module,H,O,N,E,A={"BEFORE_INIT":"beforeInit","INIT":"init","APPEND":"append","BEFORE_RENDER":"beforeRender","RENDER":"render","CHANGE_HEADER":"changeHeader","CHANGE_BODY":"changeBody","CHANGE_FOOTER":"changeFooter","CHANGE_CONTENT":"changeContent","DESTORY":"destroy","BEFORE_SHOW":"beforeShow","SHOW":"show","BEFORE_HIDE":"beforeHide","HIDE":"hide"},I={"VISIBLE":{key:"visible",value:true,validator:YAHOO.lang.isBoolean},"EFFECT":{key:"effect",suppressEvent:true,supercedes:["visible"]},"MONITOR_RESIZE":{key:"monitorresize",value:true},"APPEND_TO_DOCUMENT_BODY":{key:"appendtodocumentbody",value:false}};G.IMG_ROOT=null;G.IMG_ROOT_SSL=null;G.CSS_MODULE="yui-module";G.CSS_HEADER="hd";G.CSS_BODY="bd";G.CSS_FOOTER="ft";G.RESIZE_MONITOR_SECURE_URL="javascript:false;";G.textResizeEvent=new L("textResize");function K(){if(!H){H=document.createElement("div");H.innerHTML=('<div class="'+G.CSS_HEADER+'"></div>'+'<div class="'+G.CSS_BODY+'"></div><div class="'+G.CSS_FOOTER+'"></div>');O=H.firstChild;N=O.nextSibling;E=N.nextSibling;}
|
||||
return H;}
|
||||
function J(){if(!O){K();}
|
||||
return(O.cloneNode(false));}
|
||||
function B(){if(!N){K();}
|
||||
return(N.cloneNode(false));}
|
||||
function C(){if(!E){K();}
|
||||
return(E.cloneNode(false));}
|
||||
G.prototype={constructor:G,element:null,header:null,body:null,footer:null,id:null,imageRoot:G.IMG_ROOT,initEvents:function(){var P=L.LIST;this.beforeInitEvent=this.createEvent(A.BEFORE_INIT);this.beforeInitEvent.signature=P;this.initEvent=this.createEvent(A.INIT);this.initEvent.signature=P;this.appendEvent=this.createEvent(A.APPEND);this.appendEvent.signature=P;this.beforeRenderEvent=this.createEvent(A.BEFORE_RENDER);this.beforeRenderEvent.signature=P;this.renderEvent=this.createEvent(A.RENDER);this.renderEvent.signature=P;this.changeHeaderEvent=this.createEvent(A.CHANGE_HEADER);this.changeHeaderEvent.signature=P;this.changeBodyEvent=this.createEvent(A.CHANGE_BODY);this.changeBodyEvent.signature=P;this.changeFooterEvent=this.createEvent(A.CHANGE_FOOTER);this.changeFooterEvent.signature=P;this.changeContentEvent=this.createEvent(A.CHANGE_CONTENT);this.changeContentEvent.signature=P;this.destroyEvent=this.createEvent(A.DESTORY);this.destroyEvent.signature=P;this.beforeShowEvent=this.createEvent(A.BEFORE_SHOW);this.beforeShowEvent.signature=P;this.showEvent=this.createEvent(A.SHOW);this.showEvent.signature=P;this.beforeHideEvent=this.createEvent(A.BEFORE_HIDE);this.beforeHideEvent.signature=P;this.hideEvent=this.createEvent(A.HIDE);this.hideEvent.signature=P;},platform:function(){var P=navigator.userAgent.toLowerCase();if(P.indexOf("windows")!=-1||P.indexOf("win32")!=-1){return"windows";}else{if(P.indexOf("macintosh")!=-1){return"mac";}else{return false;}}}(),browser:function(){var P=navigator.userAgent.toLowerCase();if(P.indexOf("opera")!=-1){return"opera";}else{if(P.indexOf("msie 7")!=-1){return"ie7";}else{if(P.indexOf("msie")!=-1){return"ie";}else{if(P.indexOf("safari")!=-1){return"safari";}else{if(P.indexOf("gecko")!=-1){return"gecko";}else{return false;}}}}}}(),isSecure:function(){if(window.location.href.toLowerCase().indexOf("https")===0){return true;}else{return false;}}(),initDefaultConfig:function(){this.cfg.addProperty(I.VISIBLE.key,{handler:this.configVisible,value:I.VISIBLE.value,validator:I.VISIBLE.validator});this.cfg.addProperty(I.EFFECT.key,{suppressEvent:I.EFFECT.suppressEvent,supercedes:I.EFFECT.supercedes});this.cfg.addProperty(I.MONITOR_RESIZE.key,{handler:this.configMonitorResize,value:I.MONITOR_RESIZE.value});this.cfg.addProperty(I.APPEND_TO_DOCUMENT_BODY.key,{value:I.APPEND_TO_DOCUMENT_BODY.value});},init:function(U,T){var R,V;this.initEvents();this.beforeInitEvent.fire(G);this.cfg=new D(this);if(this.isSecure){this.imageRoot=G.IMG_ROOT_SSL;}
|
||||
if(typeof U=="string"){R=U;U=document.getElementById(U);if(!U){U=(K()).cloneNode(false);U.id=R;}}
|
||||
this.element=U;if(U.id){this.id=U.id;}
|
||||
V=this.element.firstChild;if(V){var Q=false,P=false,S=false;do{if(1==V.nodeType){if(!Q&&F.hasClass(V,G.CSS_HEADER)){this.header=V;Q=true;}else{if(!P&&F.hasClass(V,G.CSS_BODY)){this.body=V;P=true;}else{if(!S&&F.hasClass(V,G.CSS_FOOTER)){this.footer=V;S=true;}}}}}while((V=V.nextSibling));}
|
||||
this.initDefaultConfig();F.addClass(this.element,G.CSS_MODULE);if(T){this.cfg.applyConfig(T,true);}
|
||||
if(!D.alreadySubscribed(this.renderEvent,this.cfg.fireQueue,this.cfg)){this.renderEvent.subscribe(this.cfg.fireQueue,this.cfg,true);}
|
||||
this.initEvent.fire(G);},initResizeMonitor:function(){var Q=(YAHOO.env.ua.gecko&&this.platform=="windows");if(Q){var P=this;setTimeout(function(){P._initResizeMonitor();},0);}else{this._initResizeMonitor();}},_initResizeMonitor:function(){var P,R,T;function V(){G.textResizeEvent.fire();}
|
||||
if(!YAHOO.env.ua.opera){R=F.get("_yuiResizeMonitor");var U=this._supportsCWResize();if(!R){R=document.createElement("iframe");if(this.isSecure&&G.RESIZE_MONITOR_SECURE_URL&&YAHOO.env.ua.ie){R.src=G.RESIZE_MONITOR_SECURE_URL;}
|
||||
if(!U){T=["<html><head><script ",'type="text/javascript">',"window.onresize=function(){window.parent.","YAHOO.widget.Module.textResizeEvent.","fire();};<","/script></head>","<body></body></html>"].join("");R.src="data:text/html;charset=utf-8,"+encodeURIComponent(T);}
|
||||
R.id="_yuiResizeMonitor";R.title="Text Resize Monitor";R.style.position="absolute";R.style.visibility="hidden";var Q=document.body,S=Q.firstChild;if(S){Q.insertBefore(R,S);}else{Q.appendChild(R);}
|
||||
R.style.width="10em";R.style.height="10em";R.style.top=(-1*R.offsetHeight)+"px";R.style.left=(-1*R.offsetWidth)+"px";R.style.borderWidth="0";R.style.visibility="visible";if(YAHOO.env.ua.webkit){P=R.contentWindow.document;P.open();P.close();}}
|
||||
if(R&&R.contentWindow){G.textResizeEvent.subscribe(this.onDomResize,this,true);if(!G.textResizeInitialized){if(U){if(!M.on(R.contentWindow,"resize",V)){M.on(R,"resize",V);}}
|
||||
G.textResizeInitialized=true;}
|
||||
this.resizeMonitor=R;}}},_supportsCWResize:function(){var P=true;if(YAHOO.env.ua.gecko&&YAHOO.env.ua.gecko<=1.8){P=false;}
|
||||
return P;},onDomResize:function(S,R){var Q=-1*this.resizeMonitor.offsetWidth,P=-1*this.resizeMonitor.offsetHeight;this.resizeMonitor.style.top=P+"px";this.resizeMonitor.style.left=Q+"px";},setHeader:function(Q){var P=this.header||(this.header=J());if(Q.nodeName){P.innerHTML="";P.appendChild(Q);}else{P.innerHTML=Q;}
|
||||
this.changeHeaderEvent.fire(Q);this.changeContentEvent.fire();},appendToHeader:function(Q){var P=this.header||(this.header=J());P.appendChild(Q);this.changeHeaderEvent.fire(Q);this.changeContentEvent.fire();},setBody:function(Q){var P=this.body||(this.body=B());if(Q.nodeName){P.innerHTML="";P.appendChild(Q);}else{P.innerHTML=Q;}
|
||||
this.changeBodyEvent.fire(Q);this.changeContentEvent.fire();},appendToBody:function(Q){var P=this.body||(this.body=B());P.appendChild(Q);this.changeBodyEvent.fire(Q);this.changeContentEvent.fire();},setFooter:function(Q){var P=this.footer||(this.footer=C());if(Q.nodeName){P.innerHTML="";P.appendChild(Q);}else{P.innerHTML=Q;}
|
||||
this.changeFooterEvent.fire(Q);this.changeContentEvent.fire();},appendToFooter:function(Q){var P=this.footer||(this.footer=C());P.appendChild(Q);this.changeFooterEvent.fire(Q);this.changeContentEvent.fire();},render:function(R,P){var S=this,T;function Q(U){if(typeof U=="string"){U=document.getElementById(U);}
|
||||
if(U){S._addToParent(U,S.element);S.appendEvent.fire();}}
|
||||
this.beforeRenderEvent.fire();if(!P){P=this.element;}
|
||||
if(R){Q(R);}else{if(!F.inDocument(this.element)){return false;}}
|
||||
if(this.header&&!F.inDocument(this.header)){T=P.firstChild;if(T){P.insertBefore(this.header,T);}else{P.appendChild(this.header);}}
|
||||
if(this.body&&!F.inDocument(this.body)){if(this.footer&&F.isAncestor(this.moduleElement,this.footer)){P.insertBefore(this.body,this.footer);}else{P.appendChild(this.body);}}
|
||||
if(this.footer&&!F.inDocument(this.footer)){P.appendChild(this.footer);}
|
||||
this.renderEvent.fire();return true;},destroy:function(){var P,Q;if(this.element){M.purgeElement(this.element,true);P=this.element.parentNode;}
|
||||
if(P){P.removeChild(this.element);}
|
||||
this.element=null;this.header=null;this.body=null;this.footer=null;G.textResizeEvent.unsubscribe(this.onDomResize,this);this.cfg.destroy();this.cfg=null;this.destroyEvent.fire();},show:function(){this.cfg.setProperty("visible",true);},hide:function(){this.cfg.setProperty("visible",false);},configVisible:function(Q,P,R){var S=P[0];if(S){this.beforeShowEvent.fire();F.setStyle(this.element,"display","block");this.showEvent.fire();}else{this.beforeHideEvent.fire();F.setStyle(this.element,"display","none");this.hideEvent.fire();}},configMonitorResize:function(R,Q,S){var P=Q[0];if(P){this.initResizeMonitor();}else{G.textResizeEvent.unsubscribe(this.onDomResize,this,true);this.resizeMonitor=null;}},_addToParent:function(P,Q){if(!this.cfg.getProperty("appendtodocumentbody")&&P===document.body&&P.firstChild){P.insertBefore(Q,P.firstChild);}else{P.appendChild(Q);}},toString:function(){return"Module "+this.id;}};YAHOO.lang.augmentProto(G,YAHOO.util.EventProvider);}());(function(){YAHOO.widget.Overlay=function(O,N){YAHOO.widget.Overlay.superclass.constructor.call(this,O,N);};var H=YAHOO.lang,L=YAHOO.util.CustomEvent,F=YAHOO.widget.Module,M=YAHOO.util.Event,E=YAHOO.util.Dom,C=YAHOO.util.Config,J=YAHOO.env.ua,B=YAHOO.widget.Overlay,G="subscribe",D="unsubscribe",I,A={"BEFORE_MOVE":"beforeMove","MOVE":"move"},K={"X":{key:"x",validator:H.isNumber,suppressEvent:true,supercedes:["iframe"]},"Y":{key:"y",validator:H.isNumber,suppressEvent:true,supercedes:["iframe"]},"XY":{key:"xy",suppressEvent:true,supercedes:["iframe"]},"CONTEXT":{key:"context",suppressEvent:true,supercedes:["iframe"]},"FIXED_CENTER":{key:"fixedcenter",value:false,validator:H.isBoolean,supercedes:["iframe","visible"]},"WIDTH":{key:"width",suppressEvent:true,supercedes:["context","fixedcenter","iframe"]},"HEIGHT":{key:"height",suppressEvent:true,supercedes:["context","fixedcenter","iframe"]},"AUTO_FILL_HEIGHT":{key:"autofillheight",supressEvent:true,supercedes:["height"],value:"body"},"ZINDEX":{key:"zindex",value:null},"CONSTRAIN_TO_VIEWPORT":{key:"constraintoviewport",value:false,validator:H.isBoolean,supercedes:["iframe","x","y","xy"]},"IFRAME":{key:"iframe",value:(J.ie==6?true:false),validator:H.isBoolean,supercedes:["zindex"]},"PREVENT_CONTEXT_OVERLAP":{key:"preventcontextoverlap",value:false,validator:H.isBoolean,supercedes:["constraintoviewport"]}};B.IFRAME_SRC="javascript:false;";B.IFRAME_OFFSET=3;B.VIEWPORT_OFFSET=10;B.TOP_LEFT="tl";B.TOP_RIGHT="tr";B.BOTTOM_LEFT="bl";B.BOTTOM_RIGHT="br";B.CSS_OVERLAY="yui-overlay";B.STD_MOD_RE=/^\s*?(body|footer|header)\s*?$/i;B.windowScrollEvent=new L("windowScroll");B.windowResizeEvent=new L("windowResize");B.windowScrollHandler=function(O){var N=M.getTarget(O);if(!N||N===window||N===window.document){if(J.ie){if(!window.scrollEnd){window.scrollEnd=-1;}
|
||||
clearTimeout(window.scrollEnd);window.scrollEnd=setTimeout(function(){B.windowScrollEvent.fire();},1);}else{B.windowScrollEvent.fire();}}};B.windowResizeHandler=function(N){if(J.ie){if(!window.resizeEnd){window.resizeEnd=-1;}
|
||||
clearTimeout(window.resizeEnd);window.resizeEnd=setTimeout(function(){B.windowResizeEvent.fire();},100);}else{B.windowResizeEvent.fire();}};B._initialized=null;if(B._initialized===null){M.on(window,"scroll",B.windowScrollHandler);M.on(window,"resize",B.windowResizeHandler);B._initialized=true;}
|
||||
B._TRIGGER_MAP={"windowScroll":B.windowScrollEvent,"windowResize":B.windowResizeEvent,"textResize":F.textResizeEvent};YAHOO.extend(B,F,{CONTEXT_TRIGGERS:[],init:function(O,N){B.superclass.init.call(this,O);this.beforeInitEvent.fire(B);E.addClass(this.element,B.CSS_OVERLAY);if(N){this.cfg.applyConfig(N,true);}
|
||||
if(this.platform=="mac"&&J.gecko){if(!C.alreadySubscribed(this.showEvent,this.showMacGeckoScrollbars,this)){this.showEvent.subscribe(this.showMacGeckoScrollbars,this,true);}
|
||||
if(!C.alreadySubscribed(this.hideEvent,this.hideMacGeckoScrollbars,this)){this.hideEvent.subscribe(this.hideMacGeckoScrollbars,this,true);}}
|
||||
this.initEvent.fire(B);},initEvents:function(){B.superclass.initEvents.call(this);var N=L.LIST;this.beforeMoveEvent=this.createEvent(A.BEFORE_MOVE);this.beforeMoveEvent.signature=N;this.moveEvent=this.createEvent(A.MOVE);this.moveEvent.signature=N;},initDefaultConfig:function(){B.superclass.initDefaultConfig.call(this);var N=this.cfg;N.addProperty(K.X.key,{handler:this.configX,validator:K.X.validator,suppressEvent:K.X.suppressEvent,supercedes:K.X.supercedes});N.addProperty(K.Y.key,{handler:this.configY,validator:K.Y.validator,suppressEvent:K.Y.suppressEvent,supercedes:K.Y.supercedes});N.addProperty(K.XY.key,{handler:this.configXY,suppressEvent:K.XY.suppressEvent,supercedes:K.XY.supercedes});N.addProperty(K.CONTEXT.key,{handler:this.configContext,suppressEvent:K.CONTEXT.suppressEvent,supercedes:K.CONTEXT.supercedes});N.addProperty(K.FIXED_CENTER.key,{handler:this.configFixedCenter,value:K.FIXED_CENTER.value,validator:K.FIXED_CENTER.validator,supercedes:K.FIXED_CENTER.supercedes});N.addProperty(K.WIDTH.key,{handler:this.configWidth,suppressEvent:K.WIDTH.suppressEvent,supercedes:K.WIDTH.supercedes});N.addProperty(K.HEIGHT.key,{handler:this.configHeight,suppressEvent:K.HEIGHT.suppressEvent,supercedes:K.HEIGHT.supercedes});N.addProperty(K.AUTO_FILL_HEIGHT.key,{handler:this.configAutoFillHeight,value:K.AUTO_FILL_HEIGHT.value,validator:this._validateAutoFill,suppressEvent:K.AUTO_FILL_HEIGHT.suppressEvent,supercedes:K.AUTO_FILL_HEIGHT.supercedes});N.addProperty(K.ZINDEX.key,{handler:this.configzIndex,value:K.ZINDEX.value});N.addProperty(K.CONSTRAIN_TO_VIEWPORT.key,{handler:this.configConstrainToViewport,value:K.CONSTRAIN_TO_VIEWPORT.value,validator:K.CONSTRAIN_TO_VIEWPORT.validator,supercedes:K.CONSTRAIN_TO_VIEWPORT.supercedes});N.addProperty(K.IFRAME.key,{handler:this.configIframe,value:K.IFRAME.value,validator:K.IFRAME.validator,supercedes:K.IFRAME.supercedes});N.addProperty(K.PREVENT_CONTEXT_OVERLAP.key,{value:K.PREVENT_CONTEXT_OVERLAP.value,validator:K.PREVENT_CONTEXT_OVERLAP.validator,supercedes:K.PREVENT_CONTEXT_OVERLAP.supercedes});},moveTo:function(N,O){this.cfg.setProperty("xy",[N,O]);},hideMacGeckoScrollbars:function(){E.replaceClass(this.element,"show-scrollbars","hide-scrollbars");},showMacGeckoScrollbars:function(){E.replaceClass(this.element,"hide-scrollbars","show-scrollbars");},configVisible:function(Q,N,W){var P=N[0],R=E.getStyle(this.element,"visibility"),X=this.cfg.getProperty("effect"),U=[],T=(this.platform=="mac"&&J.gecko),f=C.alreadySubscribed,V,O,d,b,a,Z,c,Y,S;if(R=="inherit"){d=this.element.parentNode;while(d.nodeType!=9&&d.nodeType!=11){R=E.getStyle(d,"visibility");if(R!="inherit"){break;}
|
||||
d=d.parentNode;}
|
||||
if(R=="inherit"){R="visible";}}
|
||||
if(X){if(X instanceof Array){Y=X.length;for(b=0;b<Y;b++){V=X[b];U[U.length]=V.effect(this,V.duration);}}else{U[U.length]=X.effect(this,X.duration);}}
|
||||
if(P){if(T){this.showMacGeckoScrollbars();}
|
||||
if(X){if(P){if(R!="visible"||R===""){this.beforeShowEvent.fire();S=U.length;for(a=0;a<S;a++){O=U[a];if(a===0&&!f(O.animateInCompleteEvent,this.showEvent.fire,this.showEvent)){O.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true);}
|
||||
O.animateIn();}}}}else{if(R!="visible"||R===""){this.beforeShowEvent.fire();E.setStyle(this.element,"visibility","visible");this.cfg.refireEvent("iframe");this.showEvent.fire();}}}else{if(T){this.hideMacGeckoScrollbars();}
|
||||
if(X){if(R=="visible"){this.beforeHideEvent.fire();S=U.length;for(Z=0;Z<S;Z++){c=U[Z];if(Z===0&&!f(c.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)){c.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true);}
|
||||
c.animateOut();}}else{if(R===""){E.setStyle(this.element,"visibility","hidden");}}}else{if(R=="visible"||R===""){this.beforeHideEvent.fire();E.setStyle(this.element,"visibility","hidden");this.hideEvent.fire();}}}},doCenterOnDOMEvent:function(){if(this.cfg.getProperty("visible")){this.center();}},configFixedCenter:function(R,P,S){var T=P[0],O=C.alreadySubscribed,Q=B.windowResizeEvent,N=B.windowScrollEvent;if(T){this.center();if(!O(this.beforeShowEvent,this.center,this)){this.beforeShowEvent.subscribe(this.center);}
|
||||
if(!O(Q,this.doCenterOnDOMEvent,this)){Q.subscribe(this.doCenterOnDOMEvent,this,true);}
|
||||
if(!O(N,this.doCenterOnDOMEvent,this)){N.subscribe(this.doCenterOnDOMEvent,this,true);}}else{this.beforeShowEvent.unsubscribe(this.center);Q.unsubscribe(this.doCenterOnDOMEvent,this);N.unsubscribe(this.doCenterOnDOMEvent,this);}},configHeight:function(Q,O,R){var N=O[0],P=this.element;E.setStyle(P,"height",N);this.cfg.refireEvent("iframe");},configAutoFillHeight:function(Q,P,R){var O=P[0],N=this.cfg.getProperty("autofillheight");this.cfg.unsubscribeFromConfigEvent("height",this._autoFillOnHeightChange);F.textResizeEvent.unsubscribe("height",this._autoFillOnHeightChange);if(N&&O!==N&&this[N]){E.setStyle(this[N],"height","");}
|
||||
if(O){O=H.trim(O.toLowerCase());this.cfg.subscribeToConfigEvent("height",this._autoFillOnHeightChange,this[O],this);F.textResizeEvent.subscribe(this._autoFillOnHeightChange,this[O],this);this.cfg.setProperty("autofillheight",O,true);}},configWidth:function(Q,N,R){var P=N[0],O=this.element;E.setStyle(O,"width",P);this.cfg.refireEvent("iframe");},configzIndex:function(P,N,Q){var R=N[0],O=this.element;if(!R){R=E.getStyle(O,"zIndex");if(!R||isNaN(R)){R=0;}}
|
||||
if(this.iframe||this.cfg.getProperty("iframe")===true){if(R<=0){R=1;}}
|
||||
E.setStyle(O,"zIndex",R);this.cfg.setProperty("zIndex",R,true);if(this.iframe){this.stackIframe();}},configXY:function(P,O,Q){var S=O[0],N=S[0],R=S[1];this.cfg.setProperty("x",N);this.cfg.setProperty("y",R);this.beforeMoveEvent.fire([N,R]);N=this.cfg.getProperty("x");R=this.cfg.getProperty("y");this.cfg.refireEvent("iframe");this.moveEvent.fire([N,R]);},configX:function(P,O,Q){var N=O[0],R=this.cfg.getProperty("y");this.cfg.setProperty("x",N,true);this.cfg.setProperty("y",R,true);this.beforeMoveEvent.fire([N,R]);N=this.cfg.getProperty("x");R=this.cfg.getProperty("y");E.setX(this.element,N,true);this.cfg.setProperty("xy",[N,R],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([N,R]);},configY:function(P,O,Q){var N=this.cfg.getProperty("x"),R=O[0];this.cfg.setProperty("x",N,true);this.cfg.setProperty("y",R,true);this.beforeMoveEvent.fire([N,R]);N=this.cfg.getProperty("x");R=this.cfg.getProperty("y");E.setY(this.element,R,true);this.cfg.setProperty("xy",[N,R],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([N,R]);},showIframe:function(){var O=this.iframe,N;if(O){N=this.element.parentNode;if(N!=O.parentNode){this._addToParent(N,O);}
|
||||
O.style.display="block";}},hideIframe:function(){if(this.iframe){this.iframe.style.display="none";}},syncIframe:function(){var N=this.iframe,P=this.element,R=B.IFRAME_OFFSET,O=(R*2),Q;if(N){N.style.width=(P.offsetWidth+O+"px");N.style.height=(P.offsetHeight+O+"px");Q=this.cfg.getProperty("xy");if(!H.isArray(Q)||(isNaN(Q[0])||isNaN(Q[1]))){this.syncPosition();Q=this.cfg.getProperty("xy");}
|
||||
E.setXY(N,[(Q[0]-R),(Q[1]-R)]);}},stackIframe:function(){if(this.iframe){var N=E.getStyle(this.element,"zIndex");if(!YAHOO.lang.isUndefined(N)&&!isNaN(N)){E.setStyle(this.iframe,"zIndex",(N-1));}}},configIframe:function(Q,P,R){var N=P[0];function S(){var U=this.iframe,V=this.element,W;if(!U){if(!I){I=document.createElement("iframe");if(this.isSecure){I.src=B.IFRAME_SRC;}
|
||||
if(J.ie){I.style.filter="alpha(opacity=0)";I.frameBorder=0;}else{I.style.opacity="0";}
|
||||
I.style.position="absolute";I.style.border="none";I.style.margin="0";I.style.padding="0";I.style.display="none";}
|
||||
U=I.cloneNode(false);W=V.parentNode;var T=W||document.body;this._addToParent(T,U);this.iframe=U;}
|
||||
this.showIframe();this.syncIframe();this.stackIframe();if(!this._hasIframeEventListeners){this.showEvent.subscribe(this.showIframe);this.hideEvent.subscribe(this.hideIframe);this.changeContentEvent.subscribe(this.syncIframe);this._hasIframeEventListeners=true;}}
|
||||
function O(){S.call(this);this.beforeShowEvent.unsubscribe(O);this._iframeDeferred=false;}
|
||||
if(N){if(this.cfg.getProperty("visible")){S.call(this);}else{if(!this._iframeDeferred){this.beforeShowEvent.subscribe(O);this._iframeDeferred=true;}}}else{this.hideIframe();if(this._hasIframeEventListeners){this.showEvent.unsubscribe(this.showIframe);this.hideEvent.unsubscribe(this.hideIframe);this.changeContentEvent.unsubscribe(this.syncIframe);this._hasIframeEventListeners=false;}}},_primeXYFromDOM:function(){if(YAHOO.lang.isUndefined(this.cfg.getProperty("xy"))){this.syncPosition();this.cfg.refireEvent("xy");this.beforeShowEvent.unsubscribe(this._primeXYFromDOM);}},configConstrainToViewport:function(O,N,P){var Q=N[0];if(Q){if(!C.alreadySubscribed(this.beforeMoveEvent,this.enforceConstraints,this)){this.beforeMoveEvent.subscribe(this.enforceConstraints,this,true);}
|
||||
if(!C.alreadySubscribed(this.beforeShowEvent,this._primeXYFromDOM)){this.beforeShowEvent.subscribe(this._primeXYFromDOM);}}else{this.beforeShowEvent.unsubscribe(this._primeXYFromDOM);this.beforeMoveEvent.unsubscribe(this.enforceConstraints,this);}},configContext:function(S,R,O){var V=R[0],P,N,T,Q,U=this.CONTEXT_TRIGGERS;if(V){P=V[0];N=V[1];T=V[2];Q=V[3];if(U&&U.length>0){Q=(Q||[]).concat(U);}
|
||||
if(P){if(typeof P=="string"){this.cfg.setProperty("context",[document.getElementById(P),N,T,Q],true);}
|
||||
if(N&&T){this.align(N,T);}
|
||||
if(this._contextTriggers){this._processTriggers(this._contextTriggers,D,this._alignOnTrigger);}
|
||||
if(Q){this._processTriggers(Q,G,this._alignOnTrigger);this._contextTriggers=Q;}}}},_alignOnTrigger:function(O,N){this.align();},_findTriggerCE:function(N){var O=null;if(N instanceof L){O=N;}else{if(B._TRIGGER_MAP[N]){O=B._TRIGGER_MAP[N];}}
|
||||
return O;},_processTriggers:function(R,T,Q){var P,S;for(var O=0,N=R.length;O<N;++O){P=R[O];S=this._findTriggerCE(P);if(S){S[T](Q,this,true);}else{this[T](P,Q);}}},align:function(O,N){var T=this.cfg.getProperty("context"),S=this,R,Q,U;function P(V,W){switch(O){case B.TOP_LEFT:S.moveTo(W,V);break;case B.TOP_RIGHT:S.moveTo((W-Q.offsetWidth),V);break;case B.BOTTOM_LEFT:S.moveTo(W,(V-Q.offsetHeight));break;case B.BOTTOM_RIGHT:S.moveTo((W-Q.offsetWidth),(V-Q.offsetHeight));break;}}
|
||||
if(T){R=T[0];Q=this.element;S=this;if(!O){O=T[1];}
|
||||
if(!N){N=T[2];}
|
||||
if(Q&&R){U=E.getRegion(R);switch(N){case B.TOP_LEFT:P(U.top,U.left);break;case B.TOP_RIGHT:P(U.top,U.right);break;case B.BOTTOM_LEFT:P(U.bottom,U.left);break;case B.BOTTOM_RIGHT:P(U.bottom,U.right);break;}}}},enforceConstraints:function(O,N,P){var R=N[0];var Q=this.getConstrainedXY(R[0],R[1]);this.cfg.setProperty("x",Q[0],true);this.cfg.setProperty("y",Q[1],true);this.cfg.setProperty("xy",Q,true);},getConstrainedX:function(U){var R=this,N=R.element,d=N.offsetWidth,b=B.VIEWPORT_OFFSET,g=E.getViewportWidth(),c=E.getDocumentScrollLeft(),X=(d+b<g),a=this.cfg.getProperty("context"),P,W,i,S=false,e,V,f,O,h=U,T={"tltr":true,"blbr":true,"brbl":true,"trtl":true};var Y=function(){var j;if((R.cfg.getProperty("x")-c)>W){j=(W-d);}else{j=(W+i);}
|
||||
R.cfg.setProperty("x",(j+c),true);return j;};var Q=function(){if((R.cfg.getProperty("x")-c)>W){return(V-b);}else{return(e-b);}};var Z=function(){var j=Q(),k;if(d>j){if(S){Y();}else{Y();S=true;k=Z();}}
|
||||
return k;};if(this.cfg.getProperty("preventcontextoverlap")&&a&&T[(a[1]+a[2])]){if(X){P=a[0];W=E.getX(P)-c;i=P.offsetWidth;e=W;V=(g-(W+i));Z();}
|
||||
h=this.cfg.getProperty("x");}else{if(X){f=c+b;O=c+g-d-b;if(U<f){h=f;}else{if(U>O){h=O;}}}else{h=b+c;}}
|
||||
return h;},getConstrainedY:function(Y){var V=this,O=V.element,h=O.offsetHeight,g=B.VIEWPORT_OFFSET,c=E.getViewportHeight(),f=E.getDocumentScrollTop(),d=(h+g<c),e=this.cfg.getProperty("context"),T,Z,a,W=false,U,P,b,R,N=Y,X={"trbr":true,"tlbl":true,"bltl":true,"brtr":true};var S=function(){var j;if((V.cfg.getProperty("y")-f)>Z){j=(Z-h);}else{j=(Z+a);}
|
||||
V.cfg.setProperty("y",(j+f),true);return j;};var Q=function(){if((V.cfg.getProperty("y")-f)>Z){return(P-g);}else{return(U-g);}};var i=function(){var k=Q(),j;if(h>k){if(W){S();}else{S();W=true;j=i();}}
|
||||
return j;};if(this.cfg.getProperty("preventcontextoverlap")&&e&&X[(e[1]+e[2])]){if(d){T=e[0];a=T.offsetHeight;Z=(E.getY(T)-f);U=Z;P=(c-(Z+a));i();}
|
||||
N=V.cfg.getProperty("y");}else{if(d){b=f+g;R=f+c-h-g;if(Y<b){N=b;}else{if(Y>R){N=R;}}}else{N=g+f;}}
|
||||
return N;},getConstrainedXY:function(N,O){return[this.getConstrainedX(N),this.getConstrainedY(O)];},center:function(){var Q=B.VIEWPORT_OFFSET,R=this.element.offsetWidth,P=this.element.offsetHeight,O=E.getViewportWidth(),S=E.getViewportHeight(),N,T;if(R<O){N=(O / 2)-(R / 2)+E.getDocumentScrollLeft();}else{N=Q+E.getDocumentScrollLeft();}
|
||||
if(P<S){T=(S / 2)-(P / 2)+E.getDocumentScrollTop();}else{T=Q+E.getDocumentScrollTop();}
|
||||
this.cfg.setProperty("xy",[parseInt(N,10),parseInt(T,10)]);this.cfg.refireEvent("iframe");},syncPosition:function(){var N=E.getXY(this.element);this.cfg.setProperty("x",N[0],true);this.cfg.setProperty("y",N[1],true);this.cfg.setProperty("xy",N,true);},onDomResize:function(P,O){var N=this;B.superclass.onDomResize.call(this,P,O);setTimeout(function(){N.syncPosition();N.cfg.refireEvent("iframe");N.cfg.refireEvent("context");},0);},_getComputedHeight:(function(){if(document.defaultView&&document.defaultView.getComputedStyle){return function(O){var N=null;if(O.ownerDocument&&O.ownerDocument.defaultView){var P=O.ownerDocument.defaultView.getComputedStyle(O,"");if(P){N=parseInt(P.height,10);}}
|
||||
return(H.isNumber(N))?N:null;};}else{return function(O){var N=null;if(O.style.pixelHeight){N=O.style.pixelHeight;}
|
||||
return(H.isNumber(N))?N:null;};}})(),_validateAutoFillHeight:function(N){return(!N)||(H.isString(N)&&B.STD_MOD_RE.test(N));},_autoFillOnHeightChange:function(P,N,O){this.fillHeight(O);},_getPreciseHeight:function(O){var N=O.offsetHeight;if(O.getBoundingClientRect){var P=O.getBoundingClientRect();N=P.bottom-P.top;}
|
||||
return N;},fillHeight:function(Q){if(Q){var O=this.innerElement||this.element,N=[this.header,this.body,this.footer],U,V=0,W=0,S=0,P=false;for(var T=0,R=N.length;T<R;T++){U=N[T];if(U){if(Q!==U){W+=this._getPreciseHeight(U);}else{P=true;}}}
|
||||
if(P){if(J.ie||J.opera){E.setStyle(Q,"height",0+"px");}
|
||||
V=this._getComputedHeight(O);if(V===null){E.addClass(O,"yui-override-padding");V=O.clientHeight;E.removeClass(O,"yui-override-padding");}
|
||||
S=V-W;E.setStyle(Q,"height",S+"px");if(Q.offsetHeight!=S){S=S-(Q.offsetHeight-S);}
|
||||
E.setStyle(Q,"height",S+"px");}}},bringToTop:function(){var R=[],Q=this.element;function U(Y,X){var a=E.getStyle(Y,"zIndex"),Z=E.getStyle(X,"zIndex"),W=(!a||isNaN(a))?0:parseInt(a,10),V=(!Z||isNaN(Z))?0:parseInt(Z,10);if(W>V){return-1;}else{if(W<V){return 1;}else{return 0;}}}
|
||||
function P(X){var W=E.hasClass(X,B.CSS_OVERLAY),V=YAHOO.widget.Panel;if(W&&!E.isAncestor(Q,X)){if(V&&E.hasClass(X,V.CSS_PANEL)){R[R.length]=X.parentNode;}else{R[R.length]=X;}}}
|
||||
E.getElementsBy(P,"DIV",document.body);R.sort(U);var N=R[0],T;if(N){T=E.getStyle(N,"zIndex");if(!isNaN(T)){var S=false;if(N!=Q){S=true;}else{if(R.length>1){var O=E.getStyle(R[1],"zIndex");if(!isNaN(O)&&(T==O)){S=true;}}}
|
||||
if(S){this.cfg.setProperty("zindex",(parseInt(T,10)+2));}}}},destroy:function(){if(this.iframe){this.iframe.parentNode.removeChild(this.iframe);}
|
||||
this.iframe=null;B.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);B.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);F.textResizeEvent.unsubscribe(this._autoFillOnHeightChange);B.superclass.destroy.call(this);},toString:function(){return"Overlay "+this.id;}});}());(function(){YAHOO.widget.OverlayManager=function(G){this.init(G);};var D=YAHOO.widget.Overlay,C=YAHOO.util.Event,E=YAHOO.util.Dom,B=YAHOO.util.Config,F=YAHOO.util.CustomEvent,A=YAHOO.widget.OverlayManager;A.CSS_FOCUSED="focused";A.prototype={constructor:A,overlays:null,initDefaultConfig:function(){this.cfg.addProperty("overlays",{suppressEvent:true});this.cfg.addProperty("focusevent",{value:"mousedown"});},init:function(I){this.cfg=new B(this);this.initDefaultConfig();if(I){this.cfg.applyConfig(I,true);}
|
||||
this.cfg.fireQueue();var H=null;this.getActive=function(){return H;};this.focus=function(J){var K=this.find(J);if(K){K.focus();}};this.remove=function(K){var M=this.find(K),J;if(M){if(H==M){H=null;}
|
||||
var L=(M.element===null&&M.cfg===null)?true:false;if(!L){J=E.getStyle(M.element,"zIndex");M.cfg.setProperty("zIndex",-1000,true);}
|
||||
this.overlays.sort(this.compareZIndexDesc);this.overlays=this.overlays.slice(0,(this.overlays.length-1));M.hideEvent.unsubscribe(M.blur);M.destroyEvent.unsubscribe(this._onOverlayDestroy,M);M.focusEvent.unsubscribe(this._onOverlayFocusHandler,M);M.blurEvent.unsubscribe(this._onOverlayBlurHandler,M);if(!L){C.removeListener(M.element,this.cfg.getProperty("focusevent"),this._onOverlayElementFocus);M.cfg.setProperty("zIndex",J,true);M.cfg.setProperty("manager",null);}
|
||||
if(M.focusEvent._managed){M.focusEvent=null;}
|
||||
if(M.blurEvent._managed){M.blurEvent=null;}
|
||||
if(M.focus._managed){M.focus=null;}
|
||||
if(M.blur._managed){M.blur=null;}}};this.blurAll=function(){var K=this.overlays.length,J;if(K>0){J=K-1;do{this.overlays[J].blur();}while(J--);}};this._manageBlur=function(J){var K=false;if(H==J){E.removeClass(H.element,A.CSS_FOCUSED);H=null;K=true;}
|
||||
return K;};this._manageFocus=function(J){var K=false;if(H!=J){if(H){H.blur();}
|
||||
H=J;this.bringToTop(H);E.addClass(H.element,A.CSS_FOCUSED);K=true;}
|
||||
return K;};var G=this.cfg.getProperty("overlays");if(!this.overlays){this.overlays=[];}
|
||||
if(G){this.register(G);this.overlays.sort(this.compareZIndexDesc);}},_onOverlayElementFocus:function(I){var G=C.getTarget(I),H=this.close;if(H&&(G==H||E.isAncestor(H,G))){this.blur();}else{this.focus();}},_onOverlayDestroy:function(H,G,I){this.remove(I);},_onOverlayFocusHandler:function(H,G,I){this._manageFocus(I);},_onOverlayBlurHandler:function(H,G,I){this._manageBlur(I);},_bindFocus:function(G){var H=this;if(!G.focusEvent){G.focusEvent=G.createEvent("focus");G.focusEvent.signature=F.LIST;G.focusEvent._managed=true;}else{G.focusEvent.subscribe(H._onOverlayFocusHandler,G,H);}
|
||||
if(!G.focus){C.on(G.element,H.cfg.getProperty("focusevent"),H._onOverlayElementFocus,null,G);G.focus=function(){if(H._manageFocus(this)){if(this.cfg.getProperty("visible")&&this.focusFirst){this.focusFirst();}
|
||||
this.focusEvent.fire();}};G.focus._managed=true;}},_bindBlur:function(G){var H=this;if(!G.blurEvent){G.blurEvent=G.createEvent("blur");G.blurEvent.signature=F.LIST;G.focusEvent._managed=true;}else{G.blurEvent.subscribe(H._onOverlayBlurHandler,G,H);}
|
||||
if(!G.blur){G.blur=function(){if(H._manageBlur(this)){this.blurEvent.fire();}};G.blur._managed=true;}
|
||||
G.hideEvent.subscribe(G.blur);},_bindDestroy:function(G){var H=this;G.destroyEvent.subscribe(H._onOverlayDestroy,G,H);},_syncZIndex:function(G){var H=E.getStyle(G.element,"zIndex");if(!isNaN(H)){G.cfg.setProperty("zIndex",parseInt(H,10));}else{G.cfg.setProperty("zIndex",0);}},register:function(G){var K,J=false,H,I;if(G instanceof D){G.cfg.addProperty("manager",{value:this});this._bindFocus(G);this._bindBlur(G);this._bindDestroy(G);this._syncZIndex(G);this.overlays.push(G);this.bringToTop(G);J=true;}else{if(G instanceof Array){for(H=0,I=G.length;H<I;H++){J=this.register(G[H])||J;}}}
|
||||
return J;},bringToTop:function(M){var I=this.find(M),L,G,J;if(I){J=this.overlays;J.sort(this.compareZIndexDesc);G=J[0];if(G){L=E.getStyle(G.element,"zIndex");if(!isNaN(L)){var K=false;if(G!==I){K=true;}else{if(J.length>1){var H=E.getStyle(J[1].element,"zIndex");if(!isNaN(H)&&(L==H)){K=true;}}}
|
||||
if(K){I.cfg.setProperty("zindex",(parseInt(L,10)+2));}}
|
||||
J.sort(this.compareZIndexDesc);}}},find:function(G){var K=G instanceof D,I=this.overlays,M=I.length,J=null,L,H;if(K||typeof G=="string"){for(H=M-1;H>=0;H--){L=I[H];if((K&&(L===G))||(L.id==G)){J=L;break;}}}
|
||||
return J;},compareZIndexDesc:function(J,I){var H=(J.cfg)?J.cfg.getProperty("zIndex"):null,G=(I.cfg)?I.cfg.getProperty("zIndex"):null;if(H===null&&G===null){return 0;}else{if(H===null){return 1;}else{if(G===null){return-1;}else{if(H>G){return-1;}else{if(H<G){return 1;}else{return 0;}}}}}},showAll:function(){var H=this.overlays,I=H.length,G;for(G=I-1;G>=0;G--){H[G].show();}},hideAll:function(){var H=this.overlays,I=H.length,G;for(G=I-1;G>=0;G--){H[G].hide();}},toString:function(){return"OverlayManager";}};}());(function(){YAHOO.widget.Tooltip=function(N,M){YAHOO.widget.Tooltip.superclass.constructor.call(this,N,M);};var E=YAHOO.lang,L=YAHOO.util.Event,K=YAHOO.util.CustomEvent,C=YAHOO.util.Dom,G=YAHOO.widget.Tooltip,F,H={"PREVENT_OVERLAP":{key:"preventoverlap",value:true,validator:E.isBoolean,supercedes:["x","y","xy"]},"SHOW_DELAY":{key:"showdelay",value:200,validator:E.isNumber},"AUTO_DISMISS_DELAY":{key:"autodismissdelay",value:5000,validator:E.isNumber},"HIDE_DELAY":{key:"hidedelay",value:250,validator:E.isNumber},"TEXT":{key:"text",suppressEvent:true},"CONTAINER":{key:"container"},"DISABLED":{key:"disabled",value:false,suppressEvent:true}},A={"CONTEXT_MOUSE_OVER":"contextMouseOver","CONTEXT_MOUSE_OUT":"contextMouseOut","CONTEXT_TRIGGER":"contextTrigger"};G.CSS_TOOLTIP="yui-tt";function I(N,M,O){var R=O[0],P=O[1],Q=this.cfg,S=Q.getProperty("width");if(S==P){Q.setProperty("width",R);}}
|
||||
function D(N,M){var O=document.body,S=this.cfg,R=S.getProperty("width"),P,Q;if((!R||R=="auto")&&(S.getProperty("container")!=O||S.getProperty("x")>=C.getViewportWidth()||S.getProperty("y")>=C.getViewportHeight())){Q=this.element.cloneNode(true);Q.style.visibility="hidden";Q.style.top="0px";Q.style.left="0px";O.appendChild(Q);P=(Q.offsetWidth+"px");O.removeChild(Q);Q=null;S.setProperty("width",P);S.refireEvent("xy");this.subscribe("hide",I,[(R||""),P]);}}
|
||||
function B(N,M,O){this.render(O);}
|
||||
function J(){L.onDOMReady(B,this.cfg.getProperty("container"),this);}
|
||||
YAHOO.extend(G,YAHOO.widget.Overlay,{init:function(N,M){G.superclass.init.call(this,N);this.beforeInitEvent.fire(G);C.addClass(this.element,G.CSS_TOOLTIP);if(M){this.cfg.applyConfig(M,true);}
|
||||
this.cfg.queueProperty("visible",false);this.cfg.queueProperty("constraintoviewport",true);this.setBody("");this.subscribe("beforeShow",D);this.subscribe("init",J);this.subscribe("render",this.onRender);this.initEvent.fire(G);},initEvents:function(){G.superclass.initEvents.call(this);var M=K.LIST;this.contextMouseOverEvent=this.createEvent(A.CONTEXT_MOUSE_OVER);this.contextMouseOverEvent.signature=M;this.contextMouseOutEvent=this.createEvent(A.CONTEXT_MOUSE_OUT);this.contextMouseOutEvent.signature=M;this.contextTriggerEvent=this.createEvent(A.CONTEXT_TRIGGER);this.contextTriggerEvent.signature=M;},initDefaultConfig:function(){G.superclass.initDefaultConfig.call(this);this.cfg.addProperty(H.PREVENT_OVERLAP.key,{value:H.PREVENT_OVERLAP.value,validator:H.PREVENT_OVERLAP.validator,supercedes:H.PREVENT_OVERLAP.supercedes});this.cfg.addProperty(H.SHOW_DELAY.key,{handler:this.configShowDelay,value:200,validator:H.SHOW_DELAY.validator});this.cfg.addProperty(H.AUTO_DISMISS_DELAY.key,{handler:this.configAutoDismissDelay,value:H.AUTO_DISMISS_DELAY.value,validator:H.AUTO_DISMISS_DELAY.validator});this.cfg.addProperty(H.HIDE_DELAY.key,{handler:this.configHideDelay,value:H.HIDE_DELAY.value,validator:H.HIDE_DELAY.validator});this.cfg.addProperty(H.TEXT.key,{handler:this.configText,suppressEvent:H.TEXT.suppressEvent});this.cfg.addProperty(H.CONTAINER.key,{handler:this.configContainer,value:document.body});this.cfg.addProperty(H.DISABLED.key,{handler:this.configContainer,value:H.DISABLED.value,supressEvent:H.DISABLED.suppressEvent});},configText:function(N,M,O){var P=M[0];if(P){this.setBody(P);}},configContainer:function(O,N,P){var M=N[0];if(typeof M=="string"){this.cfg.setProperty("container",document.getElementById(M),true);}},_removeEventListeners:function(){var P=this._context,M,O,N;if(P){M=P.length;if(M>0){N=M-1;do{O=P[N];L.removeListener(O,"mouseover",this.onContextMouseOver);L.removeListener(O,"mousemove",this.onContextMouseMove);L.removeListener(O,"mouseout",this.onContextMouseOut);}while(N--);}}},configContext:function(R,N,S){var Q=N[0],T,M,P,O;if(Q){if(!(Q instanceof Array)){if(typeof Q=="string"){this.cfg.setProperty("context",[document.getElementById(Q)],true);}else{this.cfg.setProperty("context",[Q],true);}
|
||||
Q=this.cfg.getProperty("context");}
|
||||
this._removeEventListeners();this._context=Q;T=this._context;if(T){M=T.length;if(M>0){O=M-1;do{P=T[O];L.on(P,"mouseover",this.onContextMouseOver,this);L.on(P,"mousemove",this.onContextMouseMove,this);L.on(P,"mouseout",this.onContextMouseOut,this);}while(O--);}}}},onContextMouseMove:function(N,M){M.pageX=L.getPageX(N);M.pageY=L.getPageY(N);},onContextMouseOver:function(O,N){var M=this;if(M.title){N._tempTitle=M.title;M.title="";}
|
||||
if(N.fireEvent("contextMouseOver",M,O)!==false&&!N.cfg.getProperty("disabled")){if(N.hideProcId){clearTimeout(N.hideProcId);N.hideProcId=null;}
|
||||
L.on(M,"mousemove",N.onContextMouseMove,N);N.showProcId=N.doShow(O,M);}},onContextMouseOut:function(O,N){var M=this;if(N._tempTitle){M.title=N._tempTitle;N._tempTitle=null;}
|
||||
if(N.showProcId){clearTimeout(N.showProcId);N.showProcId=null;}
|
||||
if(N.hideProcId){clearTimeout(N.hideProcId);N.hideProcId=null;}
|
||||
N.fireEvent("contextMouseOut",M,O);N.hideProcId=setTimeout(function(){N.hide();},N.cfg.getProperty("hidedelay"));},doShow:function(O,M){var P=25,N=this;if(YAHOO.env.ua.opera&&M.tagName&&M.tagName.toUpperCase()=="A"){P+=12;}
|
||||
return setTimeout(function(){var Q=N.cfg.getProperty("text");if(N._tempTitle&&(Q===""||YAHOO.lang.isUndefined(Q)||YAHOO.lang.isNull(Q))){N.setBody(N._tempTitle);}else{N.cfg.refireEvent("text");}
|
||||
N.moveTo(N.pageX,N.pageY+P);if(N.cfg.getProperty("preventoverlap")){N.preventOverlap(N.pageX,N.pageY);}
|
||||
L.removeListener(M,"mousemove",N.onContextMouseMove);N.contextTriggerEvent.fire(M);N.show();N.hideProcId=N.doHide();},this.cfg.getProperty("showdelay"));},doHide:function(){var M=this;return setTimeout(function(){M.hide();},this.cfg.getProperty("autodismissdelay"));},preventOverlap:function(Q,P){var M=this.element.offsetHeight,O=new YAHOO.util.Point(Q,P),N=C.getRegion(this.element);N.top-=5;N.left-=5;N.right+=5;N.bottom+=5;if(N.contains(O)){this.cfg.setProperty("y",(P-M-5));}},onRender:function(Q,P){function R(){var U=this.element,T=this._shadow;if(T){T.style.width=(U.offsetWidth+6)+"px";T.style.height=(U.offsetHeight+1)+"px";}}
|
||||
function N(){C.addClass(this._shadow,"yui-tt-shadow-visible");}
|
||||
function M(){C.removeClass(this._shadow,"yui-tt-shadow-visible");}
|
||||
function S(){var V=this._shadow,U,T,X,W;if(!V){U=this.element;T=YAHOO.widget.Module;X=YAHOO.env.ua.ie;W=this;if(!F){F=document.createElement("div");F.className="yui-tt-shadow";}
|
||||
V=F.cloneNode(false);U.appendChild(V);this._shadow=V;N.call(this);this.subscribe("beforeShow",N);this.subscribe("beforeHide",M);if(X==6||(X==7&&document.compatMode=="BackCompat")){window.setTimeout(function(){R.call(W);},0);this.cfg.subscribeToConfigEvent("width",R);this.cfg.subscribeToConfigEvent("height",R);this.subscribe("changeContent",R);T.textResizeEvent.subscribe(R,this,true);this.subscribe("destroy",function(){T.textResizeEvent.unsubscribe(R,this);});}}}
|
||||
function O(){S.call(this);this.unsubscribe("beforeShow",O);}
|
||||
if(this.cfg.getProperty("visible")){S.call(this);}else{this.subscribe("beforeShow",O);}},destroy:function(){this._removeEventListeners();G.superclass.destroy.call(this);},toString:function(){return"Tooltip "+this.id;}});}());(function(){YAHOO.widget.Panel=function(V,U){YAHOO.widget.Panel.superclass.constructor.call(this,V,U);};var S=null;var E=YAHOO.lang,F=YAHOO.util,A=F.Dom,T=F.Event,M=F.CustomEvent,K=YAHOO.util.KeyListener,I=F.Config,H=YAHOO.widget.Overlay,O=YAHOO.widget.Panel,L=YAHOO.env.ua,P=(L.ie==6||(L.ie==7&&document.compatMode=="BackCompat")),G,Q,C,D={"SHOW_MASK":"showMask","HIDE_MASK":"hideMask","DRAG":"drag"},N={"CLOSE":{key:"close",value:true,validator:E.isBoolean,supercedes:["visible"]},"DRAGGABLE":{key:"draggable",value:(F.DD?true:false),validator:E.isBoolean,supercedes:["visible"]},"DRAG_ONLY":{key:"dragonly",value:false,validator:E.isBoolean,supercedes:["draggable"]},"UNDERLAY":{key:"underlay",value:"shadow",supercedes:["visible"]},"MODAL":{key:"modal",value:false,validator:E.isBoolean,supercedes:["visible","zindex"]},"KEY_LISTENERS":{key:"keylisteners",suppressEvent:true,supercedes:["visible"]},"STRINGS":{key:"strings",supercedes:["close"],validator:E.isObject,value:{close:"Close"}}};O.CSS_PANEL="yui-panel";O.CSS_PANEL_CONTAINER="yui-panel-container";O.FOCUSABLE=["a","button","select","textarea","input","iframe"];function J(V,U){if(!this.header&&this.cfg.getProperty("draggable")){this.setHeader(" ");}}
|
||||
function R(V,U,W){var Z=W[0],X=W[1],Y=this.cfg,a=Y.getProperty("width");if(a==X){Y.setProperty("width",Z);}
|
||||
this.unsubscribe("hide",R,W);}
|
||||
function B(V,U){var Z=YAHOO.env.ua.ie,Y,X,W;if(Z==6||(Z==7&&document.compatMode=="BackCompat")){Y=this.cfg;X=Y.getProperty("width");if(!X||X=="auto"){W=(this.element.offsetWidth+"px");Y.setProperty("width",W);this.subscribe("hide",R,[(X||""),W]);}}}
|
||||
YAHOO.extend(O,H,{init:function(V,U){O.superclass.init.call(this,V);this.beforeInitEvent.fire(O);A.addClass(this.element,O.CSS_PANEL);this.buildWrapper();if(U){this.cfg.applyConfig(U,true);}
|
||||
this.subscribe("showMask",this._addFocusHandlers);this.subscribe("hideMask",this._removeFocusHandlers);this.subscribe("beforeRender",J);this.subscribe("render",function(){this.setFirstLastFocusable();this.subscribe("changeContent",this.setFirstLastFocusable);});this.subscribe("show",this.focusFirst);this.initEvent.fire(O);},_onElementFocus:function(X){var W=T.getTarget(X);if(W!==this.element&&!A.isAncestor(this.element,W)&&S==this){try{if(this.firstElement){this.firstElement.focus();}else{if(this._modalFocus){this._modalFocus.focus();}else{this.innerElement.focus();}}}catch(V){try{if(W!==document&&W!==document.body&&W!==window){W.blur();}}catch(U){}}}},_addFocusHandlers:function(V,U){if(!this.firstElement){if(L.webkit||L.opera){if(!this._modalFocus){this._createHiddenFocusElement();}}else{this.innerElement.tabIndex=0;}}
|
||||
this.setTabLoop(this.firstElement,this.lastElement);T.onFocus(document.documentElement,this._onElementFocus,this,true);S=this;},_createHiddenFocusElement:function(){var U=document.createElement("button");U.style.height="1px";U.style.width="1px";U.style.position="absolute";U.style.left="-10000em";U.style.opacity=0;U.tabIndex="-1";this.innerElement.appendChild(U);this._modalFocus=U;},_removeFocusHandlers:function(V,U){T.removeFocusListener(document.documentElement,this._onElementFocus,this);if(S==this){S=null;}},focusFirst:function(W,U,Y){var V=this.firstElement;if(U&&U[1]){T.stopEvent(U[1]);}
|
||||
if(V){try{V.focus();}catch(X){}}},focusLast:function(W,U,Y){var V=this.lastElement;if(U&&U[1]){T.stopEvent(U[1]);}
|
||||
if(V){try{V.focus();}catch(X){}}},setTabLoop:function(X,Z){var V=this.preventBackTab,W=this.preventTabOut,U=this.showEvent,Y=this.hideEvent;if(V){V.disable();U.unsubscribe(V.enable,V);Y.unsubscribe(V.disable,V);V=this.preventBackTab=null;}
|
||||
if(W){W.disable();U.unsubscribe(W.enable,W);Y.unsubscribe(W.disable,W);W=this.preventTabOut=null;}
|
||||
if(X){this.preventBackTab=new K(X,{shift:true,keys:9},{fn:this.focusLast,scope:this,correctScope:true});V=this.preventBackTab;U.subscribe(V.enable,V,true);Y.subscribe(V.disable,V,true);}
|
||||
if(Z){this.preventTabOut=new K(Z,{shift:false,keys:9},{fn:this.focusFirst,scope:this,correctScope:true});W=this.preventTabOut;U.subscribe(W.enable,W,true);Y.subscribe(W.disable,W,true);}},getFocusableElements:function(U){U=U||this.innerElement;var X={};for(var W=0;W<O.FOCUSABLE.length;W++){X[O.FOCUSABLE[W]]=true;}
|
||||
function V(Y){if(Y.focus&&Y.type!=="hidden"&&!Y.disabled&&X[Y.tagName.toLowerCase()]){return true;}
|
||||
return false;}
|
||||
return A.getElementsBy(V,null,U);},setFirstLastFocusable:function(){this.firstElement=null;this.lastElement=null;var U=this.getFocusableElements();this.focusableElements=U;if(U.length>0){this.firstElement=U[0];this.lastElement=U[U.length-1];}
|
||||
if(this.cfg.getProperty("modal")){this.setTabLoop(this.firstElement,this.lastElement);}},initEvents:function(){O.superclass.initEvents.call(this);var U=M.LIST;this.showMaskEvent=this.createEvent(D.SHOW_MASK);this.showMaskEvent.signature=U;this.hideMaskEvent=this.createEvent(D.HIDE_MASK);this.hideMaskEvent.signature=U;this.dragEvent=this.createEvent(D.DRAG);this.dragEvent.signature=U;},initDefaultConfig:function(){O.superclass.initDefaultConfig.call(this);this.cfg.addProperty(N.CLOSE.key,{handler:this.configClose,value:N.CLOSE.value,validator:N.CLOSE.validator,supercedes:N.CLOSE.supercedes});this.cfg.addProperty(N.DRAGGABLE.key,{handler:this.configDraggable,value:(F.DD)?true:false,validator:N.DRAGGABLE.validator,supercedes:N.DRAGGABLE.supercedes});this.cfg.addProperty(N.DRAG_ONLY.key,{value:N.DRAG_ONLY.value,validator:N.DRAG_ONLY.validator,supercedes:N.DRAG_ONLY.supercedes});this.cfg.addProperty(N.UNDERLAY.key,{handler:this.configUnderlay,value:N.UNDERLAY.value,supercedes:N.UNDERLAY.supercedes});this.cfg.addProperty(N.MODAL.key,{handler:this.configModal,value:N.MODAL.value,validator:N.MODAL.validator,supercedes:N.MODAL.supercedes});this.cfg.addProperty(N.KEY_LISTENERS.key,{handler:this.configKeyListeners,suppressEvent:N.KEY_LISTENERS.suppressEvent,supercedes:N.KEY_LISTENERS.supercedes});this.cfg.addProperty(N.STRINGS.key,{value:N.STRINGS.value,handler:this.configStrings,validator:N.STRINGS.validator,supercedes:N.STRINGS.supercedes});},configClose:function(X,V,Y){var Z=V[0],W=this.close,U=this.cfg.getProperty("strings");if(Z){if(!W){if(!C){C=document.createElement("a");C.className="container-close";C.href="#";}
|
||||
W=C.cloneNode(true);this.innerElement.appendChild(W);W.innerHTML=(U&&U.close)?U.close:" ";T.on(W,"click",this._doClose,this,true);this.close=W;}else{W.style.display="block";}}else{if(W){W.style.display="none";}}},_doClose:function(U){T.preventDefault(U);this.hide();},configDraggable:function(V,U,W){var X=U[0];if(X){if(!F.DD){this.cfg.setProperty("draggable",false);return;}
|
||||
if(this.header){A.setStyle(this.header,"cursor","move");this.registerDragDrop();}
|
||||
this.subscribe("beforeShow",B);}else{if(this.dd){this.dd.unreg();}
|
||||
if(this.header){A.setStyle(this.header,"cursor","auto");}
|
||||
this.unsubscribe("beforeShow",B);}},configUnderlay:function(d,c,Z){var b=(this.platform=="mac"&&L.gecko),e=c[0].toLowerCase(),V=this.underlay,W=this.element;function f(){var g=this.underlay;A.addClass(g,"yui-force-redraw");window.setTimeout(function(){A.removeClass(g,"yui-force-redraw");},0);}
|
||||
function X(){var g=false;if(!V){if(!Q){Q=document.createElement("div");Q.className="underlay";}
|
||||
V=Q.cloneNode(false);this.element.appendChild(V);this.underlay=V;if(P){this.sizeUnderlay();this.cfg.subscribeToConfigEvent("width",this.sizeUnderlay);this.cfg.subscribeToConfigEvent("height",this.sizeUnderlay);this.changeContentEvent.subscribe(this.sizeUnderlay);YAHOO.widget.Module.textResizeEvent.subscribe(this.sizeUnderlay,this,true);}
|
||||
if(L.webkit&&L.webkit<420){this.changeContentEvent.subscribe(f);}
|
||||
g=true;}}
|
||||
function a(){var g=X.call(this);if(!g&&P){this.sizeUnderlay();}
|
||||
this._underlayDeferred=false;this.beforeShowEvent.unsubscribe(a);}
|
||||
function Y(){if(this._underlayDeferred){this.beforeShowEvent.unsubscribe(a);this._underlayDeferred=false;}
|
||||
if(V){this.cfg.unsubscribeFromConfigEvent("width",this.sizeUnderlay);this.cfg.unsubscribeFromConfigEvent("height",this.sizeUnderlay);this.changeContentEvent.unsubscribe(this.sizeUnderlay);this.changeContentEvent.unsubscribe(f);YAHOO.widget.Module.textResizeEvent.unsubscribe(this.sizeUnderlay,this,true);this.element.removeChild(V);this.underlay=null;}}
|
||||
switch(e){case"shadow":A.removeClass(W,"matte");A.addClass(W,"shadow");break;case"matte":if(!b){Y.call(this);}
|
||||
A.removeClass(W,"shadow");A.addClass(W,"matte");break;default:if(!b){Y.call(this);}
|
||||
A.removeClass(W,"shadow");A.removeClass(W,"matte");break;}
|
||||
if((e=="shadow")||(b&&!V)){if(this.cfg.getProperty("visible")){var U=X.call(this);if(!U&&P){this.sizeUnderlay();}}else{if(!this._underlayDeferred){this.beforeShowEvent.subscribe(a);this._underlayDeferred=true;}}}},configModal:function(V,U,X){var W=U[0];if(W){if(!this._hasModalityEventListeners){this.subscribe("beforeShow",this.buildMask);this.subscribe("beforeShow",this.bringToTop);this.subscribe("beforeShow",this.showMask);this.subscribe("hide",this.hideMask);H.windowResizeEvent.subscribe(this.sizeMask,this,true);this._hasModalityEventListeners=true;}}else{if(this._hasModalityEventListeners){if(this.cfg.getProperty("visible")){this.hideMask();this.removeMask();}
|
||||
this.unsubscribe("beforeShow",this.buildMask);this.unsubscribe("beforeShow",this.bringToTop);this.unsubscribe("beforeShow",this.showMask);this.unsubscribe("hide",this.hideMask);H.windowResizeEvent.unsubscribe(this.sizeMask,this);this._hasModalityEventListeners=false;}}},removeMask:function(){var V=this.mask,U;if(V){this.hideMask();U=V.parentNode;if(U){U.removeChild(V);}
|
||||
this.mask=null;}},configKeyListeners:function(X,U,a){var W=U[0],Z,Y,V;if(W){if(W instanceof Array){Y=W.length;for(V=0;V<Y;V++){Z=W[V];if(!I.alreadySubscribed(this.showEvent,Z.enable,Z)){this.showEvent.subscribe(Z.enable,Z,true);}
|
||||
if(!I.alreadySubscribed(this.hideEvent,Z.disable,Z)){this.hideEvent.subscribe(Z.disable,Z,true);this.destroyEvent.subscribe(Z.disable,Z,true);}}}else{if(!I.alreadySubscribed(this.showEvent,W.enable,W)){this.showEvent.subscribe(W.enable,W,true);}
|
||||
if(!I.alreadySubscribed(this.hideEvent,W.disable,W)){this.hideEvent.subscribe(W.disable,W,true);this.destroyEvent.subscribe(W.disable,W,true);}}}},configStrings:function(V,U,W){var X=E.merge(N.STRINGS.value,U[0]);this.cfg.setProperty(N.STRINGS.key,X,true);},configHeight:function(X,V,Y){var U=V[0],W=this.innerElement;A.setStyle(W,"height",U);this.cfg.refireEvent("iframe");},_autoFillOnHeightChange:function(W,U,V){O.superclass._autoFillOnHeightChange.apply(this,arguments);if(P){this.sizeUnderlay();}},configWidth:function(X,U,Y){var W=U[0],V=this.innerElement;A.setStyle(V,"width",W);this.cfg.refireEvent("iframe");},configzIndex:function(V,U,X){O.superclass.configzIndex.call(this,V,U,X);if(this.mask||this.cfg.getProperty("modal")===true){var W=A.getStyle(this.element,"zIndex");if(!W||isNaN(W)){W=0;}
|
||||
if(W===0){this.cfg.setProperty("zIndex",1);}else{this.stackMask();}}},buildWrapper:function(){var W=this.element.parentNode,U=this.element,V=document.createElement("div");V.className=O.CSS_PANEL_CONTAINER;V.id=U.id+"_c";if(W){W.insertBefore(V,U);}
|
||||
V.appendChild(U);this.element=V;this.innerElement=U;A.setStyle(this.innerElement,"visibility","inherit");},sizeUnderlay:function(){var V=this.underlay,U;if(V){U=this.element;V.style.width=U.offsetWidth+"px";V.style.height=U.offsetHeight+"px";}},registerDragDrop:function(){var V=this;if(this.header){if(!F.DD){return;}
|
||||
var U=(this.cfg.getProperty("dragonly")===true);this.dd=new F.DD(this.element.id,this.id,{dragOnly:U});if(!this.header.id){this.header.id=this.id+"_h";}
|
||||
this.dd.startDrag=function(){var X,Z,W,c,b,a;if(YAHOO.env.ua.ie==6){A.addClass(V.element,"drag");}
|
||||
if(V.cfg.getProperty("constraintoviewport")){var Y=H.VIEWPORT_OFFSET;X=V.element.offsetHeight;Z=V.element.offsetWidth;W=A.getViewportWidth();c=A.getViewportHeight();b=A.getDocumentScrollLeft();a=A.getDocumentScrollTop();if(X+Y<c){this.minY=a+Y;this.maxY=a+c-X-Y;}else{this.minY=a+Y;this.maxY=a+Y;}
|
||||
if(Z+Y<W){this.minX=b+Y;this.maxX=b+W-Z-Y;}else{this.minX=b+Y;this.maxX=b+Y;}
|
||||
this.constrainX=true;this.constrainY=true;}else{this.constrainX=false;this.constrainY=false;}
|
||||
V.dragEvent.fire("startDrag",arguments);};this.dd.onDrag=function(){V.syncPosition();V.cfg.refireEvent("iframe");if(this.platform=="mac"&&YAHOO.env.ua.gecko){this.showMacGeckoScrollbars();}
|
||||
V.dragEvent.fire("onDrag",arguments);};this.dd.endDrag=function(){if(YAHOO.env.ua.ie==6){A.removeClass(V.element,"drag");}
|
||||
V.dragEvent.fire("endDrag",arguments);V.moveEvent.fire(V.cfg.getProperty("xy"));};this.dd.setHandleElId(this.header.id);this.dd.addInvalidHandleType("INPUT");this.dd.addInvalidHandleType("SELECT");this.dd.addInvalidHandleType("TEXTAREA");}},buildMask:function(){var U=this.mask;if(!U){if(!G){G=document.createElement("div");G.className="mask";G.innerHTML=" ";}
|
||||
U=G.cloneNode(true);U.id=this.id+"_mask";document.body.insertBefore(U,document.body.firstChild);this.mask=U;if(YAHOO.env.ua.gecko&&this.platform=="mac"){A.addClass(this.mask,"block-scrollbars");}
|
||||
this.stackMask();}},hideMask:function(){if(this.cfg.getProperty("modal")&&this.mask){this.mask.style.display="none";A.removeClass(document.body,"masked");this.hideMaskEvent.fire();}},showMask:function(){if(this.cfg.getProperty("modal")&&this.mask){A.addClass(document.body,"masked");this.sizeMask();this.mask.style.display="block";this.showMaskEvent.fire();}},sizeMask:function(){if(this.mask){var V=this.mask,W=A.getViewportWidth(),U=A.getViewportHeight();if(this.mask.offsetHeight>U){this.mask.style.height=U+"px";}
|
||||
if(this.mask.offsetWidth>W){this.mask.style.width=W+"px";}
|
||||
this.mask.style.height=A.getDocumentHeight()+"px";this.mask.style.width=A.getDocumentWidth()+"px";}},stackMask:function(){if(this.mask){var U=A.getStyle(this.element,"zIndex");if(!YAHOO.lang.isUndefined(U)&&!isNaN(U)){A.setStyle(this.mask,"zIndex",U-1);}}},render:function(U){return O.superclass.render.call(this,U,this.innerElement);},destroy:function(){H.windowResizeEvent.unsubscribe(this.sizeMask,this);this.removeMask();if(this.close){T.purgeElement(this.close);}
|
||||
O.superclass.destroy.call(this);},toString:function(){return"Panel "+this.id;}});}());(function(){YAHOO.widget.Dialog=function(J,I){YAHOO.widget.Dialog.superclass.constructor.call(this,J,I);};var B=YAHOO.util.Event,G=YAHOO.util.CustomEvent,E=YAHOO.util.Dom,A=YAHOO.widget.Dialog,F=YAHOO.lang,H={"BEFORE_SUBMIT":"beforeSubmit","SUBMIT":"submit","MANUAL_SUBMIT":"manualSubmit","ASYNC_SUBMIT":"asyncSubmit","FORM_SUBMIT":"formSubmit","CANCEL":"cancel"},C={"POST_METHOD":{key:"postmethod",value:"async"},"BUTTONS":{key:"buttons",value:"none",supercedes:["visible"]},"HIDEAFTERSUBMIT":{key:"hideaftersubmit",value:true}};A.CSS_DIALOG="yui-dialog";function D(){var L=this._aButtons,J,K,I;if(F.isArray(L)){J=L.length;if(J>0){I=J-1;do{K=L[I];if(YAHOO.widget.Button&&K instanceof YAHOO.widget.Button){K.destroy();}else{if(K.tagName.toUpperCase()=="BUTTON"){B.purgeElement(K);B.purgeElement(K,false);}}}while(I--);}}}
|
||||
YAHOO.extend(A,YAHOO.widget.Panel,{form:null,initDefaultConfig:function(){A.superclass.initDefaultConfig.call(this);this.callback={success:null,failure:null,argument:null};this.cfg.addProperty(C.POST_METHOD.key,{handler:this.configPostMethod,value:C.POST_METHOD.value,validator:function(I){if(I!="form"&&I!="async"&&I!="none"&&I!="manual"){return false;}else{return true;}}});this.cfg.addProperty(C.HIDEAFTERSUBMIT.key,{value:C.HIDEAFTERSUBMIT.value});this.cfg.addProperty(C.BUTTONS.key,{handler:this.configButtons,value:C.BUTTONS.value,supercedes:C.BUTTONS.supercedes});},initEvents:function(){A.superclass.initEvents.call(this);var I=G.LIST;this.beforeSubmitEvent=this.createEvent(H.BEFORE_SUBMIT);this.beforeSubmitEvent.signature=I;this.submitEvent=this.createEvent(H.SUBMIT);this.submitEvent.signature=I;this.manualSubmitEvent=this.createEvent(H.MANUAL_SUBMIT);this.manualSubmitEvent.signature=I;this.asyncSubmitEvent=this.createEvent(H.ASYNC_SUBMIT);this.asyncSubmitEvent.signature=I;this.formSubmitEvent=this.createEvent(H.FORM_SUBMIT);this.formSubmitEvent.signature=I;this.cancelEvent=this.createEvent(H.CANCEL);this.cancelEvent.signature=I;},init:function(J,I){A.superclass.init.call(this,J);this.beforeInitEvent.fire(A);E.addClass(this.element,A.CSS_DIALOG);this.cfg.setProperty("visible",false);if(I){this.cfg.applyConfig(I,true);}
|
||||
this.showEvent.subscribe(this.focusFirst,this,true);this.beforeHideEvent.subscribe(this.blurButtons,this,true);this.subscribe("changeBody",this.registerForm);this.initEvent.fire(A);},doSubmit:function(){var J=YAHOO.util.Connect,P=this.form,N=false,M=false,O,I,L,K;switch(this.cfg.getProperty("postmethod")){case"async":O=P.elements;I=O.length;if(I>0){L=I-1;do{if(O[L].type=="file"){N=true;break;}}while(L--);}
|
||||
if(N&&YAHOO.env.ua.ie&&this.isSecure){M=true;}
|
||||
K=this._getFormAttributes(P);J.setForm(P,N,M);J.asyncRequest(K.method,K.action,this.callback);this.asyncSubmitEvent.fire();break;case"form":P.submit();this.formSubmitEvent.fire();break;case"none":case"manual":this.manualSubmitEvent.fire();break;}},_getFormAttributes:function(K){var I={method:null,action:null};if(K){if(K.getAttributeNode){var J=K.getAttributeNode("action");var L=K.getAttributeNode("method");if(J){I.action=J.value;}
|
||||
if(L){I.method=L.value;}}else{I.action=K.getAttribute("action");I.method=K.getAttribute("method");}}
|
||||
I.method=(F.isString(I.method)?I.method:"POST").toUpperCase();I.action=F.isString(I.action)?I.action:"";return I;},registerForm:function(){var I=this.element.getElementsByTagName("form")[0];if(this.form){if(this.form==I&&E.isAncestor(this.element,this.form)){return;}else{B.purgeElement(this.form);this.form=null;}}
|
||||
if(!I){I=document.createElement("form");I.name="frm_"+this.id;this.body.appendChild(I);}
|
||||
if(I){this.form=I;B.on(I,"submit",this._submitHandler,this,true);}},_submitHandler:function(I){B.stopEvent(I);this.submit();this.form.blur();},setTabLoop:function(I,J){I=I||this.firstButton;J=this.lastButton||J;A.superclass.setTabLoop.call(this,I,J);},setFirstLastFocusable:function(){A.superclass.setFirstLastFocusable.call(this);var J,I,K,L=this.focusableElements;this.firstFormElement=null;this.lastFormElement=null;if(this.form&&L&&L.length>0){I=L.length;for(J=0;J<I;++J){K=L[J];if(this.form===K.form){this.firstFormElement=K;break;}}
|
||||
for(J=I-1;J>=0;--J){K=L[J];if(this.form===K.form){this.lastFormElement=K;break;}}}},configClose:function(J,I,K){A.superclass.configClose.apply(this,arguments);},_doClose:function(I){B.preventDefault(I);this.cancel();},configButtons:function(S,R,M){var N=YAHOO.widget.Button,U=R[0],K=this.innerElement,T,P,J,Q,O,I,L;D.call(this);this._aButtons=null;if(F.isArray(U)){O=document.createElement("span");O.className="button-group";Q=U.length;this._aButtons=[];this.defaultHtmlButton=null;for(L=0;L<Q;L++){T=U[L];if(N){J=new N({label:T.text});J.appendTo(O);P=J.get("element");if(T.isDefault){J.addClass("default");this.defaultHtmlButton=P;}
|
||||
if(F.isFunction(T.handler)){J.set("onclick",{fn:T.handler,obj:this,scope:this});}else{if(F.isObject(T.handler)&&F.isFunction(T.handler.fn)){J.set("onclick",{fn:T.handler.fn,obj:((!F.isUndefined(T.handler.obj))?T.handler.obj:this),scope:(T.handler.scope||this)});}}
|
||||
this._aButtons[this._aButtons.length]=J;}else{P=document.createElement("button");P.setAttribute("type","button");if(T.isDefault){P.className="default";this.defaultHtmlButton=P;}
|
||||
P.innerHTML=T.text;if(F.isFunction(T.handler)){B.on(P,"click",T.handler,this,true);}else{if(F.isObject(T.handler)&&F.isFunction(T.handler.fn)){B.on(P,"click",T.handler.fn,((!F.isUndefined(T.handler.obj))?T.handler.obj:this),(T.handler.scope||this));}}
|
||||
O.appendChild(P);this._aButtons[this._aButtons.length]=P;}
|
||||
T.htmlButton=P;if(L===0){this.firstButton=P;}
|
||||
if(L==(Q-1)){this.lastButton=P;}}
|
||||
this.setFooter(O);I=this.footer;if(E.inDocument(this.element)&&!E.isAncestor(K,I)){K.appendChild(I);}
|
||||
this.buttonSpan=O;}else{O=this.buttonSpan;I=this.footer;if(O&&I){I.removeChild(O);this.buttonSpan=null;this.firstButton=null;this.lastButton=null;this.defaultHtmlButton=null;}}
|
||||
this.setFirstLastFocusable();this.cfg.refireEvent("iframe");this.cfg.refireEvent("underlay");},getButtons:function(){return this._aButtons||null;},focusFirst:function(K,I,M){var J=this.firstFormElement;if(I&&I[1]){B.stopEvent(I[1]);}
|
||||
if(J){try{J.focus();}catch(L){}}else{this.focusFirstButton();}},focusLast:function(K,I,M){var N=this.cfg.getProperty("buttons"),J=this.lastFormElement;if(I&&I[1]){B.stopEvent(I[1]);}
|
||||
if(N&&F.isArray(N)){this.focusLastButton();}else{if(J){try{J.focus();}catch(L){}}}},_getButton:function(J){var I=YAHOO.widget.Button;if(I&&J&&J.nodeName&&J.id){J=I.getButton(J.id)||J;}
|
||||
return J;},focusDefaultButton:function(){var I=this._getButton(this.defaultHtmlButton);if(I){try{I.focus();}catch(J){}}},blurButtons:function(){var N=this.cfg.getProperty("buttons"),K,M,J,I;if(N&&F.isArray(N)){K=N.length;if(K>0){I=(K-1);do{M=N[I];if(M){J=this._getButton(M.htmlButton);if(J){try{J.blur();}catch(L){}}}}while(I--);}}},focusFirstButton:function(){var L=this.cfg.getProperty("buttons"),K,I;if(L&&F.isArray(L)){K=L[0];if(K){I=this._getButton(K.htmlButton);if(I){try{I.focus();}catch(J){}}}}},focusLastButton:function(){var M=this.cfg.getProperty("buttons"),J,L,I;if(M&&F.isArray(M)){J=M.length;if(J>0){L=M[(J-1)];if(L){I=this._getButton(L.htmlButton);if(I){try{I.focus();}catch(K){}}}}}},configPostMethod:function(J,I,K){this.registerForm();},validate:function(){return true;},submit:function(){if(this.validate()){this.beforeSubmitEvent.fire();this.doSubmit();this.submitEvent.fire();if(this.cfg.getProperty("hideaftersubmit")){this.hide();}
|
||||
return true;}else{return false;}},cancel:function(){this.cancelEvent.fire();this.hide();},getData:function(){var Y=this.form,K,R,U,M,S,P,O,J,V,L,W,Z,I,N,a,X,T;function Q(c){var b=c.tagName.toUpperCase();return((b=="INPUT"||b=="TEXTAREA"||b=="SELECT")&&c.name==M);}
|
||||
if(Y){K=Y.elements;R=K.length;U={};for(X=0;X<R;X++){M=K[X].name;S=E.getElementsBy(Q,"*",Y);P=S.length;if(P>0){if(P==1){S=S[0];O=S.type;J=S.tagName.toUpperCase();switch(J){case"INPUT":if(O=="checkbox"){U[M]=S.checked;}else{if(O!="radio"){U[M]=S.value;}}
|
||||
break;case"TEXTAREA":U[M]=S.value;break;case"SELECT":V=S.options;L=V.length;W=[];for(T=0;T<L;T++){Z=V[T];if(Z.selected){I=Z.value;if(!I||I===""){I=Z.text;}
|
||||
W[W.length]=I;}}
|
||||
U[M]=W;break;}}else{O=S[0].type;switch(O){case"radio":for(T=0;T<P;T++){N=S[T];if(N.checked){U[M]=N.value;break;}}
|
||||
break;case"checkbox":W=[];for(T=0;T<P;T++){a=S[T];if(a.checked){W[W.length]=a.value;}}
|
||||
U[M]=W;break;}}}}}
|
||||
return U;},destroy:function(){D.call(this);this._aButtons=null;var I=this.element.getElementsByTagName("form"),J;if(I.length>0){J=I[0];if(J){B.purgeElement(J);if(J.parentNode){J.parentNode.removeChild(J);}
|
||||
this.form=null;}}
|
||||
A.superclass.destroy.call(this);},toString:function(){return"Dialog "+this.id;}});}());(function(){YAHOO.widget.SimpleDialog=function(E,D){YAHOO.widget.SimpleDialog.superclass.constructor.call(this,E,D);};var C=YAHOO.util.Dom,B=YAHOO.widget.SimpleDialog,A={"ICON":{key:"icon",value:"none",suppressEvent:true},"TEXT":{key:"text",value:"",suppressEvent:true,supercedes:["icon"]}};B.ICON_BLOCK="blckicon";B.ICON_ALARM="alrticon";B.ICON_HELP="hlpicon";B.ICON_INFO="infoicon";B.ICON_WARN="warnicon";B.ICON_TIP="tipicon";B.ICON_CSS_CLASSNAME="yui-icon";B.CSS_SIMPLEDIALOG="yui-simple-dialog";YAHOO.extend(B,YAHOO.widget.Dialog,{initDefaultConfig:function(){B.superclass.initDefaultConfig.call(this);this.cfg.addProperty(A.ICON.key,{handler:this.configIcon,value:A.ICON.value,suppressEvent:A.ICON.suppressEvent});this.cfg.addProperty(A.TEXT.key,{handler:this.configText,value:A.TEXT.value,suppressEvent:A.TEXT.suppressEvent,supercedes:A.TEXT.supercedes});},init:function(E,D){B.superclass.init.call(this,E);this.beforeInitEvent.fire(B);C.addClass(this.element,B.CSS_SIMPLEDIALOG);this.cfg.queueProperty("postmethod","manual");if(D){this.cfg.applyConfig(D,true);}
|
||||
this.beforeRenderEvent.subscribe(function(){if(!this.body){this.setBody("");}},this,true);this.initEvent.fire(B);},registerForm:function(){B.superclass.registerForm.call(this);this.form.innerHTML+='<input type="hidden" name="'+this.id+'" value=""/>';},configIcon:function(F,E,J){var K=E[0],D=this.body,I=B.ICON_CSS_CLASSNAME,H,G;if(K&&K!="none"){H=C.getElementsByClassName(I,"*",D);if(H){G=H.parentNode;if(G){G.removeChild(H);H=null;}}
|
||||
if(K.indexOf(".")==-1){H=document.createElement("span");H.className=(I+" "+K);H.innerHTML=" ";}else{H=document.createElement("img");H.src=(this.imageRoot+K);H.className=I;}
|
||||
if(H){D.insertBefore(H,D.firstChild);}}},configText:function(E,D,F){var G=D[0];if(G){this.setBody(G);this.cfg.refireEvent("icon");}},toString:function(){return"SimpleDialog "+this.id;}});}());(function(){YAHOO.widget.ContainerEffect=function(E,H,G,D,F){if(!F){F=YAHOO.util.Anim;}
|
||||
this.overlay=E;this.attrIn=H;this.attrOut=G;this.targetElement=D||E.element;this.animClass=F;};var B=YAHOO.util.Dom,C=YAHOO.util.CustomEvent,A=YAHOO.widget.ContainerEffect;A.FADE=function(D,F){var G=YAHOO.util.Easing,I={attributes:{opacity:{from:0,to:1}},duration:F,method:G.easeIn},E={attributes:{opacity:{to:0}},duration:F,method:G.easeOut},H=new A(D,I,E,D.element);H.handleUnderlayStart=function(){var K=this.overlay.underlay;if(K&&YAHOO.env.ua.ie){var J=(K.filters&&K.filters.length>0);if(J){B.addClass(D.element,"yui-effect-fade");}}};H.handleUnderlayComplete=function(){var J=this.overlay.underlay;if(J&&YAHOO.env.ua.ie){B.removeClass(D.element,"yui-effect-fade");}};H.handleStartAnimateIn=function(K,J,L){B.addClass(L.overlay.element,"hide-select");if(!L.overlay.underlay){L.overlay.cfg.refireEvent("underlay");}
|
||||
L.handleUnderlayStart();B.setStyle(L.overlay.element,"visibility","visible");B.setStyle(L.overlay.element,"opacity",0);};H.handleCompleteAnimateIn=function(K,J,L){B.removeClass(L.overlay.element,"hide-select");if(L.overlay.element.style.filter){L.overlay.element.style.filter=null;}
|
||||
L.handleUnderlayComplete();L.overlay.cfg.refireEvent("iframe");L.animateInCompleteEvent.fire();};H.handleStartAnimateOut=function(K,J,L){B.addClass(L.overlay.element,"hide-select");L.handleUnderlayStart();};H.handleCompleteAnimateOut=function(K,J,L){B.removeClass(L.overlay.element,"hide-select");if(L.overlay.element.style.filter){L.overlay.element.style.filter=null;}
|
||||
B.setStyle(L.overlay.element,"visibility","hidden");B.setStyle(L.overlay.element,"opacity",1);L.handleUnderlayComplete();L.overlay.cfg.refireEvent("iframe");L.animateOutCompleteEvent.fire();};H.init();return H;};A.SLIDE=function(F,D){var I=YAHOO.util.Easing,L=F.cfg.getProperty("x")||B.getX(F.element),K=F.cfg.getProperty("y")||B.getY(F.element),M=B.getClientWidth(),H=F.element.offsetWidth,J={attributes:{points:{to:[L,K]}},duration:D,method:I.easeIn},E={attributes:{points:{to:[(M+25),K]}},duration:D,method:I.easeOut},G=new A(F,J,E,F.element,YAHOO.util.Motion);G.handleStartAnimateIn=function(O,N,P){P.overlay.element.style.left=((-25)-H)+"px";P.overlay.element.style.top=K+"px";};G.handleTweenAnimateIn=function(Q,P,R){var S=B.getXY(R.overlay.element),O=S[0],N=S[1];if(B.getStyle(R.overlay.element,"visibility")=="hidden"&&O<L){B.setStyle(R.overlay.element,"visibility","visible");}
|
||||
R.overlay.cfg.setProperty("xy",[O,N],true);R.overlay.cfg.refireEvent("iframe");};G.handleCompleteAnimateIn=function(O,N,P){P.overlay.cfg.setProperty("xy",[L,K],true);P.startX=L;P.startY=K;P.overlay.cfg.refireEvent("iframe");P.animateInCompleteEvent.fire();};G.handleStartAnimateOut=function(O,N,R){var P=B.getViewportWidth(),S=B.getXY(R.overlay.element),Q=S[1];R.animOut.attributes.points.to=[(P+25),Q];};G.handleTweenAnimateOut=function(P,O,Q){var S=B.getXY(Q.overlay.element),N=S[0],R=S[1];Q.overlay.cfg.setProperty("xy",[N,R],true);Q.overlay.cfg.refireEvent("iframe");};G.handleCompleteAnimateOut=function(O,N,P){B.setStyle(P.overlay.element,"visibility","hidden");P.overlay.cfg.setProperty("xy",[L,K]);P.animateOutCompleteEvent.fire();};G.init();return G;};A.prototype={init:function(){this.beforeAnimateInEvent=this.createEvent("beforeAnimateIn");this.beforeAnimateInEvent.signature=C.LIST;this.beforeAnimateOutEvent=this.createEvent("beforeAnimateOut");this.beforeAnimateOutEvent.signature=C.LIST;this.animateInCompleteEvent=this.createEvent("animateInComplete");this.animateInCompleteEvent.signature=C.LIST;this.animateOutCompleteEvent=this.createEvent("animateOutComplete");this.animateOutCompleteEvent.signature=C.LIST;this.animIn=new this.animClass(this.targetElement,this.attrIn.attributes,this.attrIn.duration,this.attrIn.method);this.animIn.onStart.subscribe(this.handleStartAnimateIn,this);this.animIn.onTween.subscribe(this.handleTweenAnimateIn,this);this.animIn.onComplete.subscribe(this.handleCompleteAnimateIn,this);this.animOut=new this.animClass(this.targetElement,this.attrOut.attributes,this.attrOut.duration,this.attrOut.method);this.animOut.onStart.subscribe(this.handleStartAnimateOut,this);this.animOut.onTween.subscribe(this.handleTweenAnimateOut,this);this.animOut.onComplete.subscribe(this.handleCompleteAnimateOut,this);},animateIn:function(){this.beforeAnimateInEvent.fire();this.animIn.animate();},animateOut:function(){this.beforeAnimateOutEvent.fire();this.animOut.animate();},handleStartAnimateIn:function(E,D,F){},handleTweenAnimateIn:function(E,D,F){},handleCompleteAnimateIn:function(E,D,F){},handleStartAnimateOut:function(E,D,F){},handleTweenAnimateOut:function(E,D,F){},handleCompleteAnimateOut:function(E,D,F){},toString:function(){var D="ContainerEffect";if(this.overlay){D+=" ["+this.overlay.toString()+"]";}
|
||||
return D;}};YAHOO.lang.augmentProto(A,YAHOO.util.EventProvider);})();YAHOO.register("container",YAHOO.widget.Module,{version:"2.6.0",build:"1321"});(function(){var D=YAHOO.util.Dom,B=YAHOO.util.Event,F=YAHOO.lang,E=YAHOO.widget;YAHOO.widget.TreeView=function(H,G){if(H){this.init(H);}
|
||||
if(G){if(!F.isArray(G)){G=[G];}
|
||||
this.buildTreeFromObject(G);}else{if(F.trim(this._el.innerHTML)){this.buildTreeFromMarkup(H);}}};var C=E.TreeView;C.prototype={id:null,_el:null,_nodes:null,locked:false,_expandAnim:null,_collapseAnim:null,_animCount:0,maxAnim:2,_hasDblClickSubscriber:false,_dblClickTimer:null,setExpandAnim:function(G){this._expandAnim=(E.TVAnim.isValid(G))?G:null;},setCollapseAnim:function(G){this._collapseAnim=(E.TVAnim.isValid(G))?G:null;},animateExpand:function(I,J){if(this._expandAnim&&this._animCount<this.maxAnim){var G=this;var H=E.TVAnim.getAnim(this._expandAnim,I,function(){G.expandComplete(J);});if(H){++this._animCount;this.fireEvent("animStart",{"node":J,"type":"expand"});H.animate();}
|
||||
return true;}
|
||||
return false;},animateCollapse:function(I,J){if(this._collapseAnim&&this._animCount<this.maxAnim){var G=this;var H=E.TVAnim.getAnim(this._collapseAnim,I,function(){G.collapseComplete(J);});if(H){++this._animCount;this.fireEvent("animStart",{"node":J,"type":"collapse"});H.animate();}
|
||||
return true;}
|
||||
return false;},expandComplete:function(G){--this._animCount;this.fireEvent("animComplete",{"node":G,"type":"expand"});},collapseComplete:function(G){--this._animCount;this.fireEvent("animComplete",{"node":G,"type":"collapse"});},init:function(I){this._el=D.get(I);this.id=D.generateId(this._el,"yui-tv-auto-id-");this.createEvent("animStart",this);this.createEvent("animComplete",this);this.createEvent("collapse",this);this.createEvent("collapseComplete",this);this.createEvent("expand",this);this.createEvent("expandComplete",this);this.createEvent("enterKeyPressed",this);this.createEvent("clickEvent",this);var G=this;this.createEvent("dblClickEvent",{scope:this,onSubscribeCallback:function(){G._hasDblClickSubscriber=true;}});this.createEvent("labelClick",this);this._nodes=[];C.trees[this.id]=this;this.root=new E.RootNode(this);var H=E.LogWriter;},buildTreeFromObject:function(G){var H=function(P,M){var L,Q,K,J,O,I,N;for(L=0;L<M.length;L++){Q=M[L];if(F.isString(Q)){K=new E.TextNode(Q,P);}else{if(F.isObject(Q)){J=Q.children;delete Q.children;O=Q.type||"text";delete Q.type;switch(O.toLowerCase()){case"text":K=new E.TextNode(Q,P);break;case"menu":K=new E.MenuNode(Q,P);break;case"html":K=new E.HTMLNode(Q,P);break;default:I=E[O];if(F.isObject(I)){for(N=I;N&&N!==E.Node;N=N.superclass.constructor){}
|
||||
if(N){K=new I(Q,P);}else{}}else{}}
|
||||
if(J){H(K,J);}}else{}}}};H(this.root,G);},buildTreeFromMarkup:function(I){var H=function(L,J){var K,M,O,N;for(K=D.getFirstChild(J);K;K=D.getNextSibling(K)){if(K.nodeType==1){switch(K.tagName.toUpperCase()){case"LI":for(O=K.firstChild;O;O=O.nextSibling){if(O.nodeType==3){N=F.trim(O.nodeValue);if(N.length){M=new E.TextNode(N,L,false);}}else{switch(O.tagName.toUpperCase()){case"UL":case"OL":H(M,O);break;case"A":M=new E.TextNode({label:O.innerHTML,href:O.href,target:O.target,title:O.title||O.alt},L,false);break;default:M=new E.HTMLNode(O.parentNode.innerHTML,L,false,true);break;}}}
|
||||
break;case"UL":case"OL":H(M,K);break;}}}};var G=D.getChildrenBy(D.get(I),function(K){var J=K.tagName.toUpperCase();return J=="UL"||J=="OL";});if(G.length){H(this.root,G[0]);}else{}},render:function(){var G=this.root.getHtml();this.getEl().innerHTML=G;var H=function(I){var J=B.getTarget(I);if(J.tagName.toUpperCase()!="TD"){J=D.getAncestorByTagName(J,"td");}
|
||||
if(F.isNull(J)){return null;}
|
||||
if(J.className.length===0){J=J.previousSibling;if(F.isNull(J)){return null;}}
|
||||
return J;};if(!this._hasEvents){B.on(this.getEl(),"click",function(M){var J=this,K=B.getTarget(M),L=this.getNodeByElement(K);if(!L){return;}
|
||||
var I=function(){if(L.expanded){L.collapse();}else{L.expand();}
|
||||
L.focus();};if(D.hasClass(K,L.labelStyle)||D.getAncestorByClassName(K,L.labelStyle)){this.fireEvent("labelClick",L);}
|
||||
while(K&&!D.hasClass(K.parentNode,"ygtvrow")&&!/ygtv[tl][mp]h?h?/.test(K.className)){K=D.getAncestorByTagName(K,"td");}
|
||||
if(K){if(/ygtv(blank)?depthcell/.test(K.className)){return;}
|
||||
if(/ygtv[tl][mp]h?h?/.test(K.className)){I();}else{if(this._dblClickTimer){window.clearTimeout(this._dblClickTimer);this._dblClickTimer=null;}else{if(this._hasDblClickSubscriber){this._dblClickTimer=window.setTimeout(function(){J._dblClickTimer=null;if(J.fireEvent("clickEvent",{event:M,node:L})!==false){I();}},200);}else{if(J.fireEvent("clickEvent",{event:M,node:L})!==false){I();}}}}}},this,true);B.on(this.getEl(),"dblclick",function(J){if(!this._hasDblClickSubscriber){return;}
|
||||
var I=B.getTarget(J);while(!D.hasClass(I.parentNode,"ygtvrow")){I=D.getAncestorByTagName(I,"td");}
|
||||
if(/ygtv(blank)?depthcell/.test(I.className)){return;}
|
||||
if(!(/ygtv[tl][mp]h?h?/.test(I.className))){this.fireEvent("dblClickEvent",{event:J,node:this.getNodeByElement(I)});if(this._dblClickTimer){window.clearTimeout(this._dblClickTimer);this._dblClickTimer=null;}}},this,true);B.on(this.getEl(),"mouseover",function(I){var J=H(I);if(J){J.className=J.className.replace(/ygtv([lt])([mp])/gi,"ygtv$1$2h").replace(/h+/,"h");}});B.on(this.getEl(),"mouseout",function(I){var J=H(I);if(J){J.className=J.className.replace(/ygtv([lt])([mp])h/gi,"ygtv$1$2");}});B.on(this.getEl(),"keydown",function(L){var M=B.getTarget(L),K=this.getNodeByElement(M),J=K,I=YAHOO.util.KeyListener.KEY;switch(L.keyCode){case I.UP:do{if(J.previousSibling){J=J.previousSibling;}else{J=J.parent;}}while(J&&!J.focus());if(!J){K.focus();}
|
||||
B.preventDefault(L);break;case I.DOWN:do{if(J.nextSibling){J=J.nextSibling;}else{J.expand();J=(J.children.length||null)&&J.children[0];}}while(J&&!J.focus());if(!J){K.focus();}
|
||||
B.preventDefault(L);break;case I.LEFT:do{if(J.parent){J=J.parent;}else{J=J.previousSibling;}}while(J&&!J.focus());if(!J){K.focus();}
|
||||
B.preventDefault(L);break;case I.RIGHT:do{J.expand();if(J.children.length){J=J.children[0];}else{J=J.nextSibling;}}while(J&&!J.focus());if(!J){K.focus();}
|
||||
B.preventDefault(L);break;case I.ENTER:if(K.href){if(K.target){window.open(K.href,K.target);}else{window.location(K.href);}}else{K.toggle();}
|
||||
this.fireEvent("enterKeyPressed",K);B.preventDefault(L);break;case I.HOME:J=this.getRoot();if(J.children.length){J=J.children[0];}
|
||||
if(!J.focus()){K.focus();}
|
||||
B.preventDefault(L);break;case I.END:J=J.parent.children;J=J[J.length-1];if(!J.focus()){K.focus();}
|
||||
B.preventDefault(L);break;case 107:if(L.shiftKey){K.parent.expandAll();}else{K.expand();}
|
||||
break;case 109:if(L.shiftKey){K.parent.collapseAll();}else{K.collapse();}
|
||||
break;default:break;}},this,true);}
|
||||
this._hasEvents=true;},getEl:function(){if(!this._el){this._el=D.get(this.id);}
|
||||
return this._el;},regNode:function(G){this._nodes[G.index]=G;},getRoot:function(){return this.root;},setDynamicLoad:function(G,H){this.root.setDynamicLoad(G,H);},expandAll:function(){if(!this.locked){this.root.expandAll();}},collapseAll:function(){if(!this.locked){this.root.collapseAll();}},getNodeByIndex:function(H){var G=this._nodes[H];return(G)?G:null;},getNodeByProperty:function(I,H){for(var G in this._nodes){if(this._nodes.hasOwnProperty(G)){var J=this._nodes[G];if(J.data&&H==J.data[I]){return J;}}}
|
||||
return null;},getNodesByProperty:function(J,I){var G=[];for(var H in this._nodes){if(this._nodes.hasOwnProperty(H)){var K=this._nodes[H];if(K.data&&I==K.data[J]){G.push(K);}}}
|
||||
return(G.length)?G:null;},getNodeByElement:function(I){var J=I,G,H=/ygtv([^\d]*)(.*)/;do{if(J&&J.id){G=J.id.match(H);if(G&&G[2]){return this.getNodeByIndex(G[2]);}}
|
||||
J=J.parentNode;if(!J||!J.tagName){break;}}while(J.id!==this.id&&J.tagName.toLowerCase()!=="body");return null;},removeNode:function(H,G){if(H.isRoot()){return false;}
|
||||
var I=H.parent;if(I.parent){I=I.parent;}
|
||||
this._deleteNode(H);if(G&&I&&I.childrenRendered){I.refresh();}
|
||||
return true;},_removeChildren_animComplete:function(G){this.unsubscribe(this._removeChildren_animComplete);this.removeChildren(G.node);},removeChildren:function(G){if(G.expanded){if(this._collapseAnim){this.subscribe("animComplete",this._removeChildren_animComplete,this,true);E.Node.prototype.collapse.call(G);return;}
|
||||
G.collapse();}
|
||||
while(G.children.length){this._deleteNode(G.children[0]);}
|
||||
if(G.isRoot()){E.Node.prototype.expand.call(G);}
|
||||
G.childrenRendered=false;G.dynamicLoadComplete=false;G.updateIcon();},_deleteNode:function(G){this.removeChildren(G);this.popNode(G);},popNode:function(J){var K=J.parent;var H=[];for(var I=0,G=K.children.length;I<G;++I){if(K.children[I]!=J){H[H.length]=K.children[I];}}
|
||||
K.children=H;K.childrenRendered=false;if(J.previousSibling){J.previousSibling.nextSibling=J.nextSibling;}
|
||||
if(J.nextSibling){J.nextSibling.previousSibling=J.previousSibling;}
|
||||
J.parent=null;J.previousSibling=null;J.nextSibling=null;J.tree=null;delete this._nodes[J.index];},destroy:function(){if(this._destroyEditor){this._destroyEditor();}
|
||||
var H=this.getEl();B.removeListener(H,"click");B.removeListener(H,"dblclick");B.removeListener(H,"mouseover");B.removeListener(H,"mouseout");B.removeListener(H,"keydown");for(var G=0;G<this._nodes.length;G++){var I=this._nodes[G];if(I&&I.destroy){I.destroy();}}
|
||||
H.parentNode.removeChild(H);this._hasEvents=false;},toString:function(){return"TreeView "+this.id;},getNodeCount:function(){return this.getRoot().getNodeCount();},getTreeDefinition:function(){return this.getRoot().getNodeDefinition();},onExpand:function(G){},onCollapse:function(G){}};var A=C.prototype;A.draw=A.render;YAHOO.augment(C,YAHOO.util.EventProvider);C.nodeCount=0;C.trees=[];C.getTree=function(H){var G=C.trees[H];return(G)?G:null;};C.getNode=function(H,I){var G=C.getTree(H);return(G)?G.getNodeByIndex(I):null;};C.FOCUS_CLASS_NAME="ygtvfocus";C.preload=function(L,K){K=K||"ygtv";var I=["tn","tm","tmh","tp","tph","ln","lm","lmh","lp","lph","loading"];var M=[];for(var G=1;G<I.length;G=G+1){M[M.length]='<span class="'+K+I[G]+'"> </span>';}
|
||||
var J=document.createElement("div");var H=J.style;H.className=K+I[0];H.position="absolute";H.height="1px";H.width="1px";H.top="-1000px";H.left="-1000px";J.innerHTML=M.join("");document.body.appendChild(J);B.removeListener(window,"load",C.preload);};B.addListener(window,"load",C.preload);})();(function(){var B=YAHOO.util.Dom,C=YAHOO.lang,A=YAHOO.util.Event;YAHOO.widget.Node=function(F,E,D){if(F){this.init(F,E,D);}};YAHOO.widget.Node.prototype={index:0,children:null,tree:null,data:null,parent:null,depth:-1,href:null,target:"_self",expanded:false,multiExpand:true,renderHidden:false,childrenRendered:false,dynamicLoadComplete:false,previousSibling:null,nextSibling:null,_dynLoad:false,dataLoader:null,isLoading:false,hasIcon:true,iconMode:0,nowrap:false,isLeaf:false,contentStyle:"",contentElId:null,_type:"Node",init:function(G,F,D){this.data=G;this.children=[];this.index=YAHOO.widget.TreeView.nodeCount;++YAHOO.widget.TreeView.nodeCount;this.contentElId="ygtvcontentel"+this.index;if(C.isObject(G)){for(var E in G){if(E.charAt(0)!="_"&&G.hasOwnProperty(E)&&!C.isUndefined(this[E])&&!C.isFunction(this[E])){this[E]=G[E];}}}
|
||||
if(!C.isUndefined(D)){this.expanded=D;}
|
||||
this.createEvent("parentChange",this);if(F){F.appendChild(this);}},applyParent:function(E){if(!E){return false;}
|
||||
this.tree=E.tree;this.parent=E;this.depth=E.depth+1;this.tree.regNode(this);E.childrenRendered=false;for(var F=0,D=this.children.length;F<D;++F){this.children[F].applyParent(this);}
|
||||
this.fireEvent("parentChange");return true;},appendChild:function(E){if(this.hasChildren()){var D=this.children[this.children.length-1];D.nextSibling=E;E.previousSibling=D;}
|
||||
this.children[this.children.length]=E;E.applyParent(this);if(this.childrenRendered&&this.expanded){this.getChildrenEl().style.display="";}
|
||||
return E;},appendTo:function(D){return D.appendChild(this);},insertBefore:function(D){var F=D.parent;if(F){if(this.tree){this.tree.popNode(this);}
|
||||
var E=D.isChildOf(F);F.children.splice(E,0,this);if(D.previousSibling){D.previousSibling.nextSibling=this;}
|
||||
this.previousSibling=D.previousSibling;this.nextSibling=D;D.previousSibling=this;this.applyParent(F);}
|
||||
return this;},insertAfter:function(D){var F=D.parent;if(F){if(this.tree){this.tree.popNode(this);}
|
||||
var E=D.isChildOf(F);if(!D.nextSibling){this.nextSibling=null;return this.appendTo(F);}
|
||||
F.children.splice(E+1,0,this);D.nextSibling.previousSibling=this;this.previousSibling=D;this.nextSibling=D.nextSibling;D.nextSibling=this;this.applyParent(F);}
|
||||
return this;},isChildOf:function(E){if(E&&E.children){for(var F=0,D=E.children.length;F<D;++F){if(E.children[F]===this){return F;}}}
|
||||
return-1;},getSiblings:function(){var D=this.parent.children.slice(0);for(var E=0;E<D.length&&D[E]!=this;E++){}
|
||||
D.splice(E,1);if(D.length){return D;}
|
||||
return null;},showChildren:function(){if(!this.tree.animateExpand(this.getChildrenEl(),this)){if(this.hasChildren()){this.getChildrenEl().style.display="";}}},hideChildren:function(){if(!this.tree.animateCollapse(this.getChildrenEl(),this)){this.getChildrenEl().style.display="none";}},getElId:function(){return"ygtv"+this.index;},getChildrenElId:function(){return"ygtvc"+this.index;},getToggleElId:function(){return"ygtvt"+this.index;},getEl:function(){return B.get(this.getElId());},getChildrenEl:function(){return B.get(this.getChildrenElId());},getToggleEl:function(){return B.get(this.getToggleElId());},getContentEl:function(){return B.get(this.contentElId);},collapse:function(){if(!this.expanded){return;}
|
||||
var D=this.tree.onCollapse(this);if(false===D){return;}
|
||||
D=this.tree.fireEvent("collapse",this);if(false===D){return;}
|
||||
if(!this.getEl()){this.expanded=false;}else{this.hideChildren();this.expanded=false;this.updateIcon();}
|
||||
D=this.tree.fireEvent("collapseComplete",this);},expand:function(F){if(this.expanded&&!F){return;}
|
||||
var D=true;if(!F){D=this.tree.onExpand(this);if(false===D){return;}
|
||||
D=this.tree.fireEvent("expand",this);}
|
||||
if(false===D){return;}
|
||||
if(!this.getEl()){this.expanded=true;return;}
|
||||
if(!this.childrenRendered){this.getChildrenEl().innerHTML=this.renderChildren();}else{}
|
||||
this.expanded=true;this.updateIcon();if(this.isLoading){this.expanded=false;return;}
|
||||
if(!this.multiExpand){var G=this.getSiblings();for(var E=0;G&&E<G.length;++E){if(G[E]!=this&&G[E].expanded){G[E].collapse();}}}
|
||||
this.showChildren();D=this.tree.fireEvent("expandComplete",this);},updateIcon:function(){if(this.hasIcon){var D=this.getToggleEl();if(D){D.className=D.className.replace(/ygtv(([tl][pmn]h?)|(loading))/,this.getStyle());}}},getStyle:function(){if(this.isLoading){return"ygtvloading";}else{var E=(this.nextSibling)?"t":"l";var D="n";if(this.hasChildren(true)||(this.isDynamic()&&!this.getIconMode())){D=(this.expanded)?"m":"p";}
|
||||
return"ygtv"+E+D;}},getHoverStyle:function(){var D=this.getStyle();if(this.hasChildren(true)&&!this.isLoading){D+="h";}
|
||||
return D;},expandAll:function(){for(var D=0;D<this.children.length;++D){var E=this.children[D];if(E.isDynamic()){break;}else{if(!E.multiExpand){break;}else{E.expand();E.expandAll();}}}},collapseAll:function(){for(var D=0;D<this.children.length;++D){this.children[D].collapse();this.children[D].collapseAll();}},setDynamicLoad:function(D,E){if(D){this.dataLoader=D;this._dynLoad=true;}else{this.dataLoader=null;this._dynLoad=false;}
|
||||
if(E){this.iconMode=E;}},isRoot:function(){return(this==this.tree.root);},isDynamic:function(){if(this.isLeaf){return false;}else{return(!this.isRoot()&&(this._dynLoad||this.tree.root._dynLoad));}},getIconMode:function(){return(this.iconMode||this.tree.root.iconMode);},hasChildren:function(D){if(this.isLeaf){return false;}else{return(this.children.length>0||(D&&this.isDynamic()&&!this.dynamicLoadComplete));}},toggle:function(){if(!this.tree.locked&&(this.hasChildren(true)||this.isDynamic())){if(this.expanded){this.collapse();}else{this.expand();}}},getHtml:function(){this.childrenRendered=false;var D=[];D[D.length]='<div class="ygtvitem" id="'+this.getElId()+'">';D[D.length]=this.getNodeHtml();D[D.length]=this.getChildrenHtml();D[D.length]="</div>";return D.join("");},getChildrenHtml:function(){var D=[];D[D.length]='<div class="ygtvchildren"';D[D.length]=' id="'+this.getChildrenElId()+'"';if(!this.expanded||!this.hasChildren()){D[D.length]=' style="display:none;"';}
|
||||
D[D.length]=">";if((this.hasChildren(true)&&this.expanded)||(this.renderHidden&&!this.isDynamic())){D[D.length]=this.renderChildren();}
|
||||
D[D.length]="</div>";return D.join("");},renderChildren:function(){var D=this;if(this.isDynamic()&&!this.dynamicLoadComplete){this.isLoading=true;this.tree.locked=true;if(this.dataLoader){setTimeout(function(){D.dataLoader(D,function(){D.loadComplete();});},10);}else{if(this.tree.root.dataLoader){setTimeout(function(){D.tree.root.dataLoader(D,function(){D.loadComplete();});},10);}else{return"Error: data loader not found or not specified.";}}
|
||||
return"";}else{return this.completeRender();}},completeRender:function(){var E=[];for(var D=0;D<this.children.length;++D){E[E.length]=this.children[D].getHtml();}
|
||||
this.childrenRendered=true;return E.join("");},loadComplete:function(){this.getChildrenEl().innerHTML=this.completeRender();this.dynamicLoadComplete=true;this.isLoading=false;this.expand(true);this.tree.locked=false;},getAncestor:function(E){if(E>=this.depth||E<0){return null;}
|
||||
var D=this.parent;while(D.depth>E){D=D.parent;}
|
||||
return D;},getDepthStyle:function(D){return(this.getAncestor(D).nextSibling)?"ygtvdepthcell":"ygtvblankdepthcell";},getNodeHtml:function(){var E=[];E[E.length]='<table border="0" cellpadding="0" cellspacing="0" class="ygtvdepth'+this.depth+'">';E[E.length]='<tr class="ygtvrow">';for(var D=0;D<this.depth;++D){E[E.length]='<td class="'+this.getDepthStyle(D)+'"><div class="ygtvspacer"></div></td>';}
|
||||
if(this.hasIcon){E[E.length]="<td";E[E.length]=' id="'+this.getToggleElId()+'"';E[E.length]=' class="'+this.getStyle()+'"';E[E.length]='><a href="#" class="ygtvspacer"> </a></td>';}
|
||||
E[E.length]="<td";E[E.length]=' id="'+this.contentElId+'"';E[E.length]=' class="'+this.contentStyle+' ygtvcontent" ';E[E.length]=(this.nowrap)?' nowrap="nowrap" ':"";E[E.length]=" >";E[E.length]=this.getContentHtml();E[E.length]="</td>";E[E.length]="</tr>";E[E.length]="</table>";return E.join("");},getContentHtml:function(){return"";},refresh:function(){this.getChildrenEl().innerHTML=this.completeRender();if(this.hasIcon){var D=this.getToggleEl();if(D){D.className=this.getStyle();}}},toString:function(){return this._type+" ("+this.index+")";},_focusHighlightedItems:[],_focusedItem:null,focus:function(){var F=false,D=this;var E=function(){var G;if(D._focusedItem){A.removeListener(D._focusedItem,"blur");D._focusedItem=null;}
|
||||
while((G=D._focusHighlightedItems.shift())){B.removeClass(G,YAHOO.widget.TreeView.FOCUS_CLASS_NAME);}};E();B.getElementsBy(function(G){return /ygtv(([tl][pmn]h?)|(content))/.test(G.className);},"td",this.getEl().firstChild,function(H){B.addClass(H,YAHOO.widget.TreeView.FOCUS_CLASS_NAME);if(!F){var G=H.getElementsByTagName("a");if(G.length){G=G[0];G.focus();D._focusedItem=G;A.on(G,"blur",E);F=true;}}
|
||||
D._focusHighlightedItems.push(H);});if(!F){E();}
|
||||
return F;},getNodeCount:function(){for(var D=0,E=0;D<this.children.length;D++){E+=this.children[D].getNodeCount();}
|
||||
return E+1;},getNodeDefinition:function(){if(this.isDynamic()){return false;}
|
||||
var G,D=this.data,F=[];if(this.href){D.href=this.href;}
|
||||
if(this.target!="_self"){D.target=this.target;}
|
||||
if(this.expanded){D.expanded=this.expanded;}
|
||||
if(!this.multiExpand){D.multiExpand=this.multiExpand;}
|
||||
if(!this.hasIcon){D.hasIcon=this.hasIcon;}
|
||||
if(this.nowrap){D.nowrap=this.nowrap;}
|
||||
D.type=this._type;for(var E=0;E<this.children.length;E++){G=this.children[E].getNodeDefinition();if(G===false){return false;}
|
||||
F.push(G);}
|
||||
if(F.length){D.children=F;}
|
||||
return D;},getToggleLink:function(){return"return false;";}};YAHOO.augment(YAHOO.widget.Node,YAHOO.util.EventProvider);})();(function(){var B=YAHOO.util.Dom,C=YAHOO.lang,A=YAHOO.util.Event;YAHOO.widget.TextNode=function(F,E,D){if(F){if(C.isString(F)){F={label:F};}
|
||||
this.init(F,E,D);this.setUpLabel(F);}};YAHOO.extend(YAHOO.widget.TextNode,YAHOO.widget.Node,{labelStyle:"ygtvlabel",labelElId:null,label:null,title:null,_type:"TextNode",setUpLabel:function(D){if(C.isString(D)){D={label:D};}else{if(D.style){this.labelStyle=D.style;}}
|
||||
this.label=D.label;this.labelElId="ygtvlabelel"+this.index;},getLabelEl:function(){return B.get(this.labelElId);},getContentHtml:function(){var D=[];D[D.length]=this.href?"<a":"<span";D[D.length]=' id="'+this.labelElId+'"';if(this.title){D[D.length]=' title="'+this.title+'"';}
|
||||
D[D.length]=' class="'+this.labelStyle+'"';if(this.href){D[D.length]=' href="'+this.href+'"';D[D.length]=' target="'+this.target+'"';}
|
||||
D[D.length]=" >";D[D.length]=this.label;D[D.length]=this.href?"</a>":"</span>";return D.join("");},getNodeDefinition:function(){var D=YAHOO.widget.TextNode.superclass.getNodeDefinition.call(this);if(D===false){return false;}
|
||||
D.label=this.label;if(this.labelStyle!="ygtvlabel"){D.style=this.labelStyle;}
|
||||
if(this.title){D.title=this.title;}
|
||||
return D;},toString:function(){return YAHOO.widget.TextNode.superclass.toString.call(this)+": "+this.label;},onLabelClick:function(){return false;}});})();YAHOO.widget.RootNode=function(A){this.init(null,null,true);this.tree=A;};YAHOO.extend(YAHOO.widget.RootNode,YAHOO.widget.Node,{_type:"RootNode",getNodeHtml:function(){return"";},toString:function(){return this._type;},loadComplete:function(){this.tree.draw();},getNodeCount:function(){for(var A=0,B=0;A<this.children.length;A++){B+=this.children[A].getNodeCount();}
|
||||
return B;},getNodeDefinition:function(){for(var C,A=[],B=0;B<this.children.length;B++){C=this.children[B].getNodeDefinition();if(C===false){return false;}
|
||||
A.push(C);}
|
||||
return A;},collapse:function(){},expand:function(){},getSiblings:function(){return null;},focus:function(){}});(function(){var B=YAHOO.util.Dom,C=YAHOO.lang,A=YAHOO.util.Event;YAHOO.widget.HTMLNode=function(G,F,E,D){if(G){this.init(G,F,E);this.initContent(G,D);}};YAHOO.extend(YAHOO.widget.HTMLNode,YAHOO.widget.Node,{contentStyle:"ygtvhtml",html:null,_type:"HTMLNode",initContent:function(E,D){this.setHtml(E);this.contentElId="ygtvcontentel"+this.index;if(!C.isUndefined(D)){this.hasIcon=D;}},setHtml:function(E){this.data=E;this.html=(typeof E==="string")?E:E.html;var D=this.getContentEl();if(D){D.innerHTML=this.html;}},getContentHtml:function(){return this.html;},getNodeDefinition:function(){var D=YAHOO.widget.HTMLNode.superclass.getNodeDefinition.call(this);if(D===false){return false;}
|
||||
D.html=this.html;return D;}});})();YAHOO.widget.MenuNode=function(C,B,A){YAHOO.widget.MenuNode.superclass.constructor.call(this,C,B,A);this.multiExpand=false;};YAHOO.extend(YAHOO.widget.MenuNode,YAHOO.widget.TextNode,{_type:"MenuNode"});(function(){var B=YAHOO.util.Dom,C=YAHOO.lang,A=YAHOO.util.Event,D=YAHOO.widget.Calendar;YAHOO.widget.DateNode=function(G,F,E){YAHOO.widget.DateNode.superclass.constructor.call(this,G,F,E);};YAHOO.extend(YAHOO.widget.DateNode,YAHOO.widget.TextNode,{_type:"DateNode",calendarConfig:null,fillEditorContainer:function(G){var H,F=G.inputContainer;if(C.isUndefined(D)){B.replaceClass(G.editorPanel,"ygtv-edit-DateNode","ygtv-edit-TextNode");YAHOO.widget.DateNode.superclass.fillEditorContainer.call(this,G);return;}
|
||||
if(G.nodeType!=this._type){G.nodeType=this._type;G.saveOnEnter=false;G.node.destroyEditorContents(G);G.inputObject=H=new D(F.appendChild(document.createElement("div")));if(this.calendarConfig){H.cfg.applyConfig(this.calendarConfig,true);H.cfg.fireQueue();}
|
||||
H.selectEvent.subscribe(function(){this.tree._closeEditor(true);},this,true);}else{H=G.inputObject;}
|
||||
H.cfg.setProperty("selected",this.label,false);var I=H.cfg.getProperty("DATE_FIELD_DELIMITER");var E=this.label.split(I);H.cfg.setProperty("pagedate",E[H.cfg.getProperty("MDY_MONTH_POSITION")-1]+I+E[H.cfg.getProperty("MDY_YEAR_POSITION")-1]);H.cfg.fireQueue();H.render();H.oDomContainer.focus();},saveEditorValue:function(F){var H=F.node,I;if(C.isUndefined(D)){I=F.inputElement.value;}else{var J=F.inputObject,G=J.getSelectedDates()[0],E=[];E[J.cfg.getProperty("MDY_DAY_POSITION")-1]=G.getDate();E[J.cfg.getProperty("MDY_MONTH_POSITION")-1]=G.getMonth()+1;E[J.cfg.getProperty("MDY_YEAR_POSITION")-1]=G.getFullYear();I=E.join(J.cfg.getProperty("DATE_FIELD_DELIMITER"));}
|
||||
H.label=I;H.data.label=I;H.getLabelEl().innerHTML=I;}});})();(function(){var E=YAHOO.util.Dom,F=YAHOO.lang,B=YAHOO.util.Event,D=YAHOO.widget.TreeView,C=D.prototype;D.editorData={active:false,whoHasIt:null,nodeType:null,editorPanel:null,inputContainer:null,buttonsContainer:null,node:null,saveOnEnter:true};C._nodeEditing=function(M){if(M.fillEditorContainer&&M.editable){var I,K,L,J,H=D.editorData;H.active=true;H.whoHasIt=this;if(!H.nodeType){H.editorPanel=I=document.body.appendChild(document.createElement("div"));E.addClass(I,"ygtv-label-editor");L=H.buttonsContainer=I.appendChild(document.createElement("div"));E.addClass(L,"ygtv-button-container");J=L.appendChild(document.createElement("button"));E.addClass(J,"ygtvok");J.innerHTML=" ";J=L.appendChild(document.createElement("button"));E.addClass(J,"ygtvcancel");J.innerHTML=" ";B.on(L,"click",function(O){var P=B.getTarget(O);var N=D.editorData.node;if(E.hasClass(P,"ygtvok")){B.stopEvent(O);this._closeEditor(true);}
|
||||
if(E.hasClass(P,"ygtvcancel")){B.stopEvent(O);this._closeEditor(false);}},this,true);H.inputContainer=I.appendChild(document.createElement("div"));E.addClass(H.inputContainer,"ygtv-input");B.on(I,"keydown",function(P){var O=D.editorData,N=YAHOO.util.KeyListener.KEY;switch(P.keyCode){case N.ENTER:B.stopEvent(P);if(O.saveOnEnter){this._closeEditor(true);}
|
||||
break;case N.ESCAPE:B.stopEvent(P);this._closeEditor(false);break;}},this,true);}else{I=H.editorPanel;}
|
||||
H.node=M;if(H.nodeType){E.removeClass(I,"ygtv-edit-"+H.nodeType);}
|
||||
E.addClass(I," ygtv-edit-"+M._type);K=E.getXY(M.getContentEl());E.setStyle(I,"left",K[0]+"px");E.setStyle(I,"top",K[1]+"px");E.setStyle(I,"display","block");I.focus();M.fillEditorContainer(H);return true;}};C.onEventEditNode=function(H){if(H instanceof YAHOO.widget.Node){H.editNode();}else{if(H.node instanceof YAHOO.widget.Node){H.node.editNode();}}};C._closeEditor=function(J){var H=D.editorData,I=H.node;if(J){H.node.saveEditorValue(H);}
|
||||
E.setStyle(H.editorPanel,"display","none");H.active=false;I.focus();};C._destroyEditor=function(){var H=D.editorData;if(H&&H.nodeType&&(!H.active||H.whoHasIt===this)){B.removeListener(H.editorPanel,"keydown");B.removeListener(H.buttonContainer,"click");H.node.destroyEditorContents(H);document.body.removeChild(H.editorPanel);H.nodeType=H.editorPanel=H.inputContainer=H.buttonsContainer=H.whoHasIt=H.node=null;H.active=false;}};var G=YAHOO.widget.Node.prototype;G.editable=false;G.editNode=function(){this.tree._nodeEditing(this);};G.fillEditorContainer=null;G.destroyEditorContents=function(H){B.purgeElement(H.inputContainer,true);H.inputContainer.innerHTML="";};G.saveEditorValue=function(H){};var A=YAHOO.widget.TextNode.prototype;A.fillEditorContainer=function(I){var H;if(I.nodeType!=this._type){I.nodeType=this._type;I.saveOnEnter=true;I.node.destroyEditorContents(I);I.inputElement=H=I.inputContainer.appendChild(document.createElement("input"));}else{H=I.inputElement;}
|
||||
H.value=this.label;H.focus();H.select();};A.saveEditorValue=function(H){var I=H.node,J=H.inputElement.value;I.label=J;I.data.label=J;I.getLabelEl().innerHTML=J;};A.destroyEditorContents=function(H){H.inputContainer.innerHTML="";};})();YAHOO.widget.TVAnim=function(){return{FADE_IN:"TVFadeIn",FADE_OUT:"TVFadeOut",getAnim:function(B,A,C){if(YAHOO.widget[B]){return new YAHOO.widget[B](A,C);}else{return null;}},isValid:function(A){return(YAHOO.widget[A]);}};}();YAHOO.widget.TVFadeIn=function(A,B){this.el=A;this.callback=B;};YAHOO.widget.TVFadeIn.prototype={animate:function(){var D=this;var C=this.el.style;C.opacity=0.1;C.filter="alpha(opacity=10)";C.display="";var B=0.4;var A=new YAHOO.util.Anim(this.el,{opacity:{from:0.1,to:1,unit:""}},B);A.onComplete.subscribe(function(){D.onComplete();});A.animate();},onComplete:function(){this.callback();},toString:function(){return"TVFadeIn";}};YAHOO.widget.TVFadeOut=function(A,B){this.el=A;this.callback=B;};YAHOO.widget.TVFadeOut.prototype={animate:function(){var C=this;var B=0.4;var A=new YAHOO.util.Anim(this.el,{opacity:{from:1,to:0.1,unit:""}},B);A.onComplete.subscribe(function(){C.onComplete();});A.animate();},onComplete:function(){var A=this.el.style;A.display="none";A.filter="alpha(opacity=100)";this.callback();},toString:function(){return"TVFadeOut";}};YAHOO.register("treeview",YAHOO.widget.TreeView,{version:"2.6.0",build:"1321"});YAHOO.namespace("SUGAR");YAHOO.SUGAR.MessageBox={show:function(config){var defaultConfig={type:'alert',modal:true,width:240,id:'sugarMsgWindow',close:true,title:"Alert",msg:" "};for(var i in config){defaultConfig[i]=config[i];}
|
||||
if(YAHOO.SUGAR.MessageBox.panel){YAHOO.SUGAR.MessageBox.panel.destroy();}
|
||||
YAHOO.SUGAR.MessageBox.panel=new YAHOO.widget.SimpleDialog(defaultConfig.id,{width:defaultConfig.width+'px',close:defaultConfig.close,modal:defaultConfig.modal,visible:true,fixedcenter:true,constraintoviewport:true,draggable:true});YAHOO.SUGAR.MessageBox.panel.setHeader(defaultConfig.title);YAHOO.SUGAR.MessageBox.panel.setBody(defaultConfig.msg);YAHOO.SUGAR.MessageBox.panel.setBody(defaultConfig.msg);YAHOO.SUGAR.MessageBox.panel.render(document.body);YAHOO.SUGAR.MessageBox.panel.show();},hide:function(){if(YAHOO.SUGAR.MessageBox.panel)
|
||||
YAHOO.SUGAR.MessageBox.panel.hide();}}
|
||||
YAHOO.SUGAR.SelectionGrid=function(containerEl,columns,dataSource,config){YAHOO.SUGAR.SelectionGrid.superclass.constructor.call(this,containerEl,columns,dataSource,config);this.subscribe("rowMouseoverEvent",this.onEventHighlightRow);this.subscribe("rowMouseoutEvent",this.onEventUnhighlightRow);this.subscribe("rowClickEvent",this.onEventSelectRow);this.selectRow(this.getTrEl(0));this.focus();}
|
||||
YAHOO.extend(YAHOO.SUGAR.SelectionGrid,YAHOO.widget.DataTable,{sugarfunc:function(){console.log("at sugar func")}});YAHOO.SUGAR.DragDropTable=function(containerEl,columns,dataSource,config){var DDT=YAHOO.SUGAR.DragDropTable;DDT.superclass.constructor.call(this,containerEl,columns,dataSource,config);this.DDGroup=config.group?config.group:"defGroup";if(typeof DDT.groups[this.DDGroup]=="undefined")
|
||||
DDT.groups[this.DDGroup]=[];DDT.groups[this.DDGroup][DDT.groups[this.DDGroup].length]=this;}
|
||||
YAHOO.SUGAR.DragDropTable.groups={defGroup:[]}
|
||||
YAHOO.extend(YAHOO.SUGAR.DragDropTable,YAHOO.widget.ScrollingDataTable,{sugarfunc:function(){console.log("at sugar func")},addRowAt:function(record,index){if(typeof(console)!="undefined"&&typeof(console.log)=="function")
|
||||
console.log(record);},_addTrEl:function(oRecord){var elTr=YAHOO.SUGAR.DragDropTable.superclass._addTrEl.call(this,oRecord);var _rowDD=new YAHOO.SUGAR.RowDD(this,oRecord,elTr);return elTr;},getGroup:function(){return YAHOO.SUGAR.DragDropTable.groups[this.DDGroup];}});YAHOO.SUGAR.RowDD=function(oDataTable,oRecord,elTr){if(oDataTable&&oRecord&&elTr){this.ddtable=oDataTable;this.table=oDataTable.getTableEl();this.row=oRecord;this.rowEl=elTr;this.newIndex=null;this.init(elTr);this.initFrame();this.invalidHandleTypes={};}};YAHOO.extend(YAHOO.SUGAR.RowDD,YAHOO.util.DDProxy,{_resizeProxy:function(){this.constructor.superclass._resizeProxy.apply(this,arguments);var dragEl=this.getDragEl(),el=this.getEl();YAHOO.util.Dom.setStyle(this.pointer,'height',(this.rowEl.offsetHeight+5)+'px');YAHOO.util.Dom.setStyle(this.pointer,'display','block');var xy=YAHOO.util.Dom.getXY(el);YAHOO.util.Dom.setXY(this.pointer,[xy[0],(xy[1]-5)]);YAHOO.util.Dom.setStyle(dragEl,'height',this.rowEl.offsetHeight+"px");YAHOO.util.Dom.setStyle(dragEl,'width',(parseInt(YAHOO.util.Dom.getStyle(dragEl,'width'),10)+4)+'px');YAHOO.util.Dom.setXY(this.dragEl,xy);},startDrag:function(x,y){var Dom=YAHOO.util.Dom;var dragEl=this.getDragEl();var clickEl=this.getEl();Dom.setStyle(clickEl,"opacity","0.25");dragEl.innerHTML=clickEl.innerHTML;Dom.addClass(dragEl,"yui-dt-liner");Dom.setStyle(dragEl,"height",(clickEl.clientHeight-2)+"px");Dom.setStyle(dragEl,"backgroundColor",Dom.getStyle(clickEl,"backgroundColor"));Dom.setStyle(dragEl,"border","2px solid gray");},onMouseDown:function(){this.resetConstraints();},clickValidator:function(e){if(this.row.getData()[0]==" ")
|
||||
return false;var target=YAHOO.util.Event.getTarget(e);return(this.isValidHandleChild(target)&&(this.id==this.handleElId||this.DDM.handleWasClicked(target,this.id)));},onDragOver:function(ev,id){var groupTables=this.ddtable.getGroup();for(i in groupTables){var targetTable=groupTables[i];var targetRow=targetTable.getRecord(id);if(targetRow!=null){var destEl=YAHOO.util.Dom.get(id);destEl.parentNode.insertBefore(this.getEl(),destEl);this.newTable=targetTable;this.newIndex=targetTable.getRecordIndex(targetRow);}}},onDragDrop:function(){},endDrag:function(){if(this.newTable!=null&&this.newIndex!=null){this.getEl().style.display="none";this.table.appendChild(this.getEl());this.newTable.addRow(this.row.getData(),this.newIndex);this.ddtable.deleteRow(this.row);this.ddtable.render();}
|
||||
this.newTable=this.newIndex=null
|
||||
YAHOO.util.Dom.setStyle(this.pointer,'display','none');var clickEl=this.getEl();YAHOO.util.Dom.setStyle(clickEl,"opacity","");}});
|
65
include/javascript/iscroll.js
Executable file
|
@ -0,0 +1,65 @@
|
|||
/**
|
||||
*
|
||||
* Find more about the scrolling function at
|
||||
* http://cubiq.org/iscroll
|
||||
*
|
||||
* Copyright (c) 2010 Matteo Spinelli, http://cubiq.org/
|
||||
* Released under MIT license
|
||||
* http://cubiq.org/dropbox/mit-license.txt
|
||||
*
|
||||
* Version 3.7.1 - Last updated: 2010.10.08
|
||||
*
|
||||
*/(function(){function iScroll(el,options){var that=this,i;that.element=typeof el=='object'?el:document.getElementById(el);that.wrapper=that.element.parentNode;that.element.style.webkitTransitionProperty='-webkit-transform';that.element.style.webkitTransitionTimingFunction='cubic-bezier(0,0,0.25,1)';that.element.style.webkitTransitionDuration='0';that.element.style.webkitTransform=translateOpen+'0,0'+translateClose;that.options={bounce:has3d,momentum:has3d,checkDOMChanges:true,topOnDOMChanges:false,hScrollbar:has3d,vScrollbar:has3d,fadeScrollbar:isIthing||!isTouch,shrinkScrollbar:isIthing||!isTouch,desktopCompatibility:false,overflow:'auto',snap:false,bounceLock:false,scrollbarColor:'rgba(0,0,0,0.5)',onScrollEnd:function(){}};if(typeof options=='object'){for(i in options){that.options[i]=options[i];}}
|
||||
if(that.options.desktopCompatibility){that.options.overflow='hidden';}
|
||||
that.onScrollEnd=that.options.onScrollEnd;delete that.options.onScrollEnd;that.wrapper.style.overflow=that.options.overflow;that.refresh();window.addEventListener('onorientationchange'in window?'orientationchange':'resize',that,false);if(isTouch||that.options.desktopCompatibility){that.element.addEventListener(START_EVENT,that,false);that.element.addEventListener(MOVE_EVENT,that,false);that.element.addEventListener(END_EVENT,that,false);}
|
||||
if(that.options.checkDOMChanges){that.element.addEventListener('DOMSubtreeModified',that,false);}}
|
||||
iScroll.prototype={x:0,y:0,enabled:true,handleEvent:function(e){var that=this;switch(e.type){case START_EVENT:that.touchStart(e);break;case MOVE_EVENT:that.touchMove(e);break;case END_EVENT:that.touchEnd(e);break;case'webkitTransitionEnd':that.transitionEnd();break;case'orientationchange':case'resize':that.refresh();break;case'DOMSubtreeModified':that.onDOMModified(e);break;}},onDOMModified:function(e){var that=this;if(e.target.parentNode!=that.element){return;}
|
||||
setTimeout(function(){that.refresh();},0);if(that.options.topOnDOMChanges&&(that.x!=0||that.y!=0)){that.scrollTo(0,0,'0');}},refresh:function(){var that=this,resetX=that.x,resetY=that.y,snap;that.scrollWidth=that.wrapper.clientWidth;that.scrollHeight=that.wrapper.clientHeight;that.scrollerWidth=that.element.offsetWidth;that.scrollerHeight=that.element.offsetHeight;that.maxScrollX=that.scrollWidth-that.scrollerWidth;that.maxScrollY=that.scrollHeight-that.scrollerHeight;that.directionX=0;that.directionY=0;if(that.scrollX){if(that.maxScrollX>=0){resetX=0;}else if(that.x<that.maxScrollX){resetX=that.maxScrollX;}}
|
||||
if(that.scrollY){if(that.maxScrollY>=0){resetY=0;}else if(that.y<that.maxScrollY){resetY=that.maxScrollY;}}
|
||||
if(that.options.snap){that.maxPageX=-Math.floor(that.maxScrollX/that.scrollWidth);that.maxPageY=-Math.floor(that.maxScrollY/that.scrollHeight);snap=that.snap(resetX,resetY);resetX=snap.x;resetY=snap.y;}
|
||||
if(resetX!=that.x||resetY!=that.y){that.setTransitionTime('0');that.setPosition(resetX,resetY,true);}
|
||||
that.scrollX=that.scrollerWidth>that.scrollWidth;that.scrollY=!that.options.bounceLock&&!that.scrollX||that.scrollerHeight>that.scrollHeight;if(that.options.hScrollbar&&that.scrollX){that.scrollBarX=that.scrollBarX||new scrollbar('horizontal',that.wrapper,that.options.fadeScrollbar,that.options.shrinkScrollbar,that.options.scrollbarColor);that.scrollBarX.init(that.scrollWidth,that.scrollerWidth);}else if(that.scrollBarX){that.scrollBarX=that.scrollBarX.remove();}
|
||||
if(that.options.vScrollbar&&that.scrollY&&that.scrollerHeight>that.scrollHeight){that.scrollBarY=that.scrollBarY||new scrollbar('vertical',that.wrapper,that.options.fadeScrollbar,that.options.shrinkScrollbar,that.options.scrollbarColor);that.scrollBarY.init(that.scrollHeight,that.scrollerHeight);}else if(that.scrollBarY){that.scrollBarY=that.scrollBarY.remove();}},setPosition:function(x,y,hideScrollBars){var that=this;that.x=x;that.y=y;that.element.style.webkitTransform=translateOpen+that.x+'px,'+that.y+'px'+translateClose;if(!hideScrollBars){if(that.scrollBarX){that.scrollBarX.setPosition(that.x);}
|
||||
if(that.scrollBarY){that.scrollBarY.setPosition(that.y);}}},setTransitionTime:function(time){var that=this;time=time||'0';that.element.style.webkitTransitionDuration=time;if(that.scrollBarX){that.scrollBarX.bar.style.webkitTransitionDuration=time;that.scrollBarX.wrapper.style.webkitTransitionDuration=has3d&&that.options.fadeScrollbar?'300ms':'0';}
|
||||
if(that.scrollBarY){that.scrollBarY.bar.style.webkitTransitionDuration=time;that.scrollBarY.wrapper.style.webkitTransitionDuration=has3d&&that.options.fadeScrollbar?'300ms':'0';}},touchStart:function(e){var that=this,matrix;if(!that.enabled){return;}
|
||||
e.preventDefault();e.stopPropagation();that.scrolling=true;that.moved=false;that.distX=0;that.distY=0;that.setTransitionTime('0');if(that.options.momentum||that.options.snap){matrix=new WebKitCSSMatrix(window.getComputedStyle(that.element).webkitTransform);if(matrix.e!=that.x||matrix.f!=that.y){document.removeEventListener('webkitTransitionEnd',that,false);that.setPosition(matrix.e,matrix.f);that.moved=true;}}
|
||||
that.touchStartX=isTouch?e.changedTouches[0].pageX:e.pageX;that.scrollStartX=that.x;that.touchStartY=isTouch?e.changedTouches[0].pageY:e.pageY;that.scrollStartY=that.y;that.scrollStartTime=e.timeStamp;that.directionX=0;that.directionY=0;},touchMove:function(e){if(!this.scrolling){return;}
|
||||
var that=this,pageX=isTouch?e.changedTouches[0].pageX:e.pageX,pageY=isTouch?e.changedTouches[0].pageY:e.pageY,leftDelta=that.scrollX?pageX-that.touchStartX:0,topDelta=that.scrollY?pageY-that.touchStartY:0,newX=that.x+leftDelta,newY=that.y+topDelta;e.stopPropagation();that.touchStartX=pageX;that.touchStartY=pageY;if(newX>=0||newX<that.maxScrollX){newX=that.options.bounce?Math.round(that.x+leftDelta / 3):(newX>=0||that.maxScrollX>=0)?0:that.maxScrollX;}
|
||||
if(newY>=0||newY<that.maxScrollY){newY=that.options.bounce?Math.round(that.y+topDelta / 3):(newY>=0||that.maxScrollY>=0)?0:that.maxScrollY;}
|
||||
if(that.distX+that.distY>5){if(that.distX-3>that.distY){newY=that.y;topDelta=0;}else if(that.distY-3>that.distX){newX=that.x;leftDelta=0;}
|
||||
that.setPosition(newX,newY);that.moved=true;that.directionX=leftDelta>0?-1:1;that.directionY=topDelta>0?-1:1;}else{that.distX+=Math.abs(leftDelta);that.distY+=Math.abs(topDelta);}},touchEnd:function(e){if(!this.scrolling){return;}
|
||||
var that=this,time=e.timeStamp-that.scrollStartTime,point=isTouch?e.changedTouches[0]:e,target,ev,momentumX,momentumY,newDuration=0,newPositionX=that.x,newPositionY=that.y,snap;that.scrolling=false;if(!that.moved){that.resetPosition();if(isTouch){target=point.target;while(target.nodeType!=1){target=target.parentNode;}
|
||||
ev=document.createEvent('MouseEvents');ev.initMouseEvent('click',true,true,e.view,1,point.screenX,point.screenY,point.clientX,point.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,0,null);ev._fake=true;target.dispatchEvent(ev);}
|
||||
return;}
|
||||
if(!that.options.snap&&time>250){that.resetPosition();return;}
|
||||
if(that.options.momentum){momentumX=that.scrollX===true?that.momentum(that.x-that.scrollStartX,time,that.options.bounce?-that.x+that.scrollWidth/5:-that.x,that.options.bounce?that.x+that.scrollerWidth-that.scrollWidth+that.scrollWidth/5:that.x+that.scrollerWidth-that.scrollWidth):{dist:0,time:0};momentumY=that.scrollY===true?that.momentum(that.y-that.scrollStartY,time,that.options.bounce?-that.y+that.scrollHeight/5:-that.y,that.options.bounce?(that.maxScrollY<0?that.y+that.scrollerHeight-that.scrollHeight:0)+that.scrollHeight/5:that.y+that.scrollerHeight-that.scrollHeight):{dist:0,time:0};newDuration=Math.max(Math.max(momentumX.time,momentumY.time),1);newPositionX=that.x+momentumX.dist;newPositionY=that.y+momentumY.dist;}
|
||||
if(that.options.snap){snap=that.snap(newPositionX,newPositionY);newPositionX=snap.x;newPositionY=snap.y;newDuration=Math.max(snap.time,newDuration);}
|
||||
that.scrollTo(newPositionX,newPositionY,newDuration+'ms');},transitionEnd:function(){var that=this;document.removeEventListener('webkitTransitionEnd',that,false);that.resetPosition();},resetPosition:function(){var that=this,resetX=that.x,resetY=that.y;if(that.x>=0){resetX=0;}else if(that.x<that.maxScrollX){resetX=that.maxScrollX;}
|
||||
if(that.y>=0||that.maxScrollY>0){resetY=0;}else if(that.y<that.maxScrollY){resetY=that.maxScrollY;}
|
||||
if(resetX!=that.x||resetY!=that.y){that.scrollTo(resetX,resetY);}else{if(that.moved){that.onScrollEnd();that.moved=false;}
|
||||
if(that.scrollBarX){that.scrollBarX.hide();}
|
||||
if(that.scrollBarY){that.scrollBarY.hide();}}},snap:function(x,y){var that=this,time;if(that.directionX>0){x=Math.floor(x/that.scrollWidth);}else if(that.directionX<0){x=Math.ceil(x/that.scrollWidth);}else{x=Math.round(x/that.scrollWidth);}
|
||||
that.pageX=-x;x=x*that.scrollWidth;if(x>0){x=that.pageX=0;}else if(x<that.maxScrollX){that.pageX=that.maxPageX;x=that.maxScrollX;}
|
||||
if(that.directionY>0){y=Math.floor(y/that.scrollHeight);}else if(that.directionY<0){y=Math.ceil(y/that.scrollHeight);}else{y=Math.round(y/that.scrollHeight);}
|
||||
that.pageY=-y;y=y*that.scrollHeight;if(y>0){y=that.pageY=0;}else if(y<that.maxScrollY){that.pageY=that.maxPageY;y=that.maxScrollY;}
|
||||
time=Math.round(Math.max(Math.abs(that.x-x)/ that.scrollWidth*500,Math.abs(that.y-y)/ that.scrollHeight*500));return{x:x,y:y,time:time};},scrollTo:function(destX,destY,runtime){var that=this;if(that.x==destX&&that.y==destY){that.resetPosition();return;}
|
||||
that.moved=true;that.setTransitionTime(runtime||'350ms');that.setPosition(destX,destY);if(runtime==='0'||runtime=='0s'||runtime=='0ms'){that.resetPosition();}else{document.addEventListener('webkitTransitionEnd',that,false);}},scrollToPage:function(pageX,pageY,runtime){var that=this,snap;if(!that.options.snap){that.pageX=-Math.round(that.x / that.scrollWidth);that.pageY=-Math.round(that.y / that.scrollHeight);}
|
||||
if(pageX=='next'){pageX=++that.pageX;}else if(pageX=='prev'){pageX=--that.pageX;}
|
||||
if(pageY=='next'){pageY=++that.pageY;}else if(pageY=='prev'){pageY=--that.pageY;}
|
||||
pageX=-pageX*that.scrollWidth;pageY=-pageY*that.scrollHeight;snap=that.snap(pageX,pageY);pageX=snap.x;pageY=snap.y;that.scrollTo(pageX,pageY,runtime||'500ms');},scrollToElement:function(el,runtime){el=typeof el=='object'?el:this.element.querySelector(el);if(!el){return;}
|
||||
var that=this,x=that.scrollX?-el.offsetLeft:0,y=that.scrollY?-el.offsetTop:0;if(x>=0){x=0;}else if(x<that.maxScrollX){x=that.maxScrollX;}
|
||||
if(y>=0){y=0;}else if(y<that.maxScrollY){y=that.maxScrollY;}
|
||||
that.scrollTo(x,y,runtime);},momentum:function(dist,time,maxDistUpper,maxDistLower){var friction=2.5,deceleration=1.2,speed=Math.abs(dist)/ time*1000,newDist=speed*speed / friction / 1000,newTime=0;if(dist>0&&newDist>maxDistUpper){speed=speed*maxDistUpper / newDist / friction;newDist=maxDistUpper;}else if(dist<0&&newDist>maxDistLower){speed=speed*maxDistLower / newDist / friction;newDist=maxDistLower;}
|
||||
newDist=newDist*(dist<0?-1:1);newTime=speed / deceleration;return{dist:Math.round(newDist),time:Math.round(newTime)};},destroy:function(full){var that=this;window.removeEventListener('onorientationchange'in window?'orientationchange':'resize',that,false);that.element.removeEventListener(START_EVENT,that,false);that.element.removeEventListener(MOVE_EVENT,that,false);that.element.removeEventListener(END_EVENT,that,false);document.removeEventListener('webkitTransitionEnd',that,false);if(that.options.checkDOMChanges){that.element.removeEventListener('DOMSubtreeModified',that,false);}
|
||||
if(that.scrollBarX){that.scrollBarX=that.scrollBarX.remove();}
|
||||
if(that.scrollBarY){that.scrollBarY=that.scrollBarY.remove();}
|
||||
if(full){that.wrapper.parentNode.removeChild(that.wrapper);}
|
||||
return null;}};function scrollbar(dir,wrapper,fade,shrink,color){var that=this,doc=document;that.dir=dir;that.fade=fade;that.shrink=shrink;that.uid=++uid;that.bar=doc.createElement('div');that.bar.style.cssText='position:absolute;top:0;left:0;-webkit-transition-timing-function:cubic-bezier(0,0,0.25,1);pointer-events:none;-webkit-transition-duration:0;-webkit-transition-delay:0;-webkit-transition-property:-webkit-transform;z-index:10;background:'+color+';'+'-webkit-transform:'+translateOpen+'0,0'+translateClose+';'+
|
||||
(dir=='horizontal'?'-webkit-border-radius:3px 2px;min-width:6px;min-height:5px':'-webkit-border-radius:2px 3px;min-width:5px;min-height:6px');that.wrapper=doc.createElement('div');that.wrapper.style.cssText='-webkit-mask:-webkit-canvas(scrollbar'+that.uid+that.dir+');position:absolute;z-index:10;pointer-events:none;overflow:hidden;opacity:0;-webkit-transition-duration:'+(fade?'300ms':'0')+';-webkit-transition-delay:0;-webkit-transition-property:opacity;'+
|
||||
(that.dir=='horizontal'?'bottom:2px;left:2px;right:7px;height:5px':'top:2px;right:2px;bottom:7px;width:5px;');that.wrapper.appendChild(that.bar);wrapper.appendChild(that.wrapper);}
|
||||
scrollbar.prototype={init:function(scroll,size){var that=this,doc=document,pi=Math.PI,ctx;if(that.dir=='horizontal'){if(that.maxSize!=that.wrapper.offsetWidth){that.maxSize=that.wrapper.offsetWidth;ctx=doc.getCSSCanvasContext("2d","scrollbar"+that.uid+that.dir,that.maxSize,5);ctx.fillStyle="rgb(0,0,0)";ctx.beginPath();ctx.arc(2.5,2.5,2.5,pi/2,-pi/2,false);ctx.lineTo(that.maxSize-2.5,0);ctx.arc(that.maxSize-2.5,2.5,2.5,-pi/2,pi/2,false);ctx.closePath();ctx.fill();}}else{if(that.maxSize!=that.wrapper.offsetHeight){that.maxSize=that.wrapper.offsetHeight;ctx=doc.getCSSCanvasContext("2d","scrollbar"+that.uid+that.dir,5,that.maxSize);ctx.fillStyle="rgb(0,0,0)";ctx.beginPath();ctx.arc(2.5,2.5,2.5,pi,0,false);ctx.lineTo(5,that.maxSize-2.5);ctx.arc(2.5,that.maxSize-2.5,2.5,0,pi,false);ctx.closePath();ctx.fill();}}
|
||||
that.size=Math.max(Math.round(that.maxSize*that.maxSize / size),6);that.maxScroll=that.maxSize-that.size;that.toWrapperProp=that.maxScroll /(scroll-size);that.bar.style[that.dir=='horizontal'?'width':'height']=that.size+'px';},setPosition:function(pos){var that=this;if(that.wrapper.style.opacity!='1'){that.show();}
|
||||
pos=Math.round(that.toWrapperProp*pos);if(pos<0){pos=that.shrink?pos+pos*3:0;if(that.size+pos<7){pos=-that.size+6;}}else if(pos>that.maxScroll){pos=that.shrink?pos+(pos-that.maxScroll)*3:that.maxScroll;if(that.size+that.maxScroll-pos<7){pos=that.size+that.maxScroll-6;}}
|
||||
pos=that.dir=='horizontal'?translateOpen+pos+'px,0'+translateClose:translateOpen+'0,'+pos+'px'+translateClose;that.bar.style.webkitTransform=pos;},show:function(){if(has3d){this.wrapper.style.webkitTransitionDelay='0';}
|
||||
this.wrapper.style.opacity='1';},hide:function(){if(has3d){this.wrapper.style.webkitTransitionDelay='350ms';}
|
||||
this.wrapper.style.opacity='0';},remove:function(){this.wrapper.parentNode.removeChild(this.wrapper);return null;}};var has3d=('WebKitCSSMatrix'in window&&'m11'in new WebKitCSSMatrix()),isIthing=(/iphone|ipad/gi).test(navigator.appVersion),isTouch=('ontouchstart'in window),START_EVENT=isTouch?'touchstart':'mousedown',MOVE_EVENT=isTouch?'touchmove':'mousemove',END_EVENT=isTouch?'touchend':'mouseup',translateOpen='translate'+(has3d?'3d(':'('),translateClose=has3d?',0)':')',uid=0;window.iScroll=iScroll;})();
|
344
include/javascript/javascript.php
Executable file
|
@ -0,0 +1,344 @@
|
|||
<?php
|
||||
if (!defined('sugarEntry') || !sugarEntry) {
|
||||
die('Not A Valid Entry Point');
|
||||
}
|
||||
/**
|
||||
*
|
||||
* SugarCRM Community Edition is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
|
||||
*
|
||||
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
|
||||
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
|
||||
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
|
||||
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
* Description: Creates the runtime database connection.
|
||||
*/
|
||||
class javascript
|
||||
{
|
||||
public $formname = 'form';
|
||||
public $script = '';
|
||||
public $sugarbean = null;
|
||||
public function setFormName($name)
|
||||
{
|
||||
$this->formname = $name;
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
global $app_strings, $current_user, $sugar_config;
|
||||
|
||||
// Bug 24730 - default initialize the bean object in case we never set it to the current bean object
|
||||
$this->sugarbean = new stdClass;
|
||||
$this->sugarbean->field_name_map = array();
|
||||
$this->sugarbean->module_dir = '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function setSugarBean($sugar)
|
||||
{
|
||||
$this->sugarbean = $sugar;
|
||||
}
|
||||
|
||||
public function addRequiredFields($prefix='')
|
||||
{
|
||||
if (isset($this->sugarbean->required_fields)) {
|
||||
foreach ($this->sugarbean->required_fields as $field=>$value) {
|
||||
$this->addField($field, 'true', $prefix);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function addSpecialField($dispField, $realField, $type, $required, $prefix = '')
|
||||
{
|
||||
if (isset($this->sugarbean->field_name_map[$realField]['vname'])) {
|
||||
$this->addFieldGeneric($dispField, 'date', $this->sugarbean->field_name_map[$realField]['vname'], $required, $prefix);
|
||||
}
|
||||
}
|
||||
|
||||
public function addField($field, $required, $prefix='', $displayField='', $translate = false)
|
||||
{
|
||||
if ($field == "id") {
|
||||
return;
|
||||
}
|
||||
if (isset($this->sugarbean->field_name_map[$field]['vname'])) {
|
||||
$vname = $this->sugarbean->field_name_map[$field]['vname'];
|
||||
if ($translate) {
|
||||
$vname = $this->buildStringToTranslateInSmarty($this->sugarbean->field_name_map[$field]['vname']);
|
||||
}
|
||||
if (empty($required)) {
|
||||
if (isset($this->sugarbean->field_name_map[$field]['required']) && $this->sugarbean->field_name_map[$field]['required']) {
|
||||
$required = 'true';
|
||||
} else {
|
||||
$required = 'false';
|
||||
}
|
||||
if (isset($this->sugarbean->required_fields[$field]) && $this->sugarbean->required_fields[$field]) {
|
||||
$required = 'true';
|
||||
}
|
||||
if ($field == 'id') {
|
||||
$required = 'false';
|
||||
}
|
||||
}
|
||||
if (isset($this->sugarbean->field_name_map[$field]['validation'])) {
|
||||
switch ($this->sugarbean->field_name_map[$field]['validation']['type']) {
|
||||
case 'range':
|
||||
$min = false;
|
||||
$max = false;
|
||||
if (isset($this->sugarbean->field_name_map[$field]['validation']['min'])) {
|
||||
$min = filter_var($this->sugarbean->field_name_map[$field]['validation']['min'], FILTER_VALIDATE_INT);
|
||||
}
|
||||
if (isset($this->sugarbean->field_name_map[$field]['validation']['max'])) {
|
||||
$max = filter_var($this->sugarbean->field_name_map[$field]['validation']['max'], FILTER_VALIDATE_INT);
|
||||
}
|
||||
if ($min !== false && $max !== false && $min > $max) {
|
||||
$max = $min;
|
||||
}
|
||||
if (!empty($displayField)) {
|
||||
$dispField = $displayField;
|
||||
} else {
|
||||
$dispField = $field;
|
||||
}
|
||||
$this->addFieldRange($dispField, $this->sugarbean->field_name_map[$field]['type'], $vname, $required, $prefix, $min, $max);
|
||||
break;
|
||||
case 'isbefore':
|
||||
$compareTo = $this->sugarbean->field_name_map[$field]['validation']['compareto'];
|
||||
if (!empty($displayField)) {
|
||||
$dispField = $displayField;
|
||||
} else {
|
||||
$dispField = $field;
|
||||
}
|
||||
if (!empty($this->sugarbean->field_name_map[$field]['validation']['blank']) && $this->sugarbean->field_name_map[$field]['validation']['blank']) {
|
||||
$this->addFieldDateBeforeAllowBlank($dispField, $this->sugarbean->field_name_map[$field]['type'], $vname, $required, $prefix, $compareTo);
|
||||
} else {
|
||||
$this->addFieldDateBefore($dispField, $this->sugarbean->field_name_map[$field]['type'], $vname, $required, $prefix, $compareTo);
|
||||
}
|
||||
break;
|
||||
// Bug #47961 Adding new type of validation: through callback function
|
||||
case 'callback':
|
||||
$dispField = $displayField ? $displayField : $field;
|
||||
$this->addFieldCallback($dispField, $this->sugarbean->field_name_map[$field]['type'], $vname, $required, $prefix, $this->sugarbean->field_name_map[$field]['validation']['callback']);
|
||||
break;
|
||||
default:
|
||||
if (!empty($displayField)) {
|
||||
$dispField = $displayField;
|
||||
} else {
|
||||
$dispField = $field;
|
||||
}
|
||||
|
||||
$type = (!empty($this->sugarbean->field_name_map[$field]['custom_type']))?$this->sugarbean->field_name_map[$field]['custom_type']:$this->sugarbean->field_name_map[$field]['type'];
|
||||
|
||||
$this->addFieldGeneric($dispField, $type, $vname, $required, $prefix);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (!empty($displayField)) {
|
||||
$dispField = $displayField;
|
||||
} else {
|
||||
$dispField = $field;
|
||||
}
|
||||
$type = (!empty($this->sugarbean->field_name_map[$field]['custom_type']))?$this->sugarbean->field_name_map[$field]['custom_type']:$this->sugarbean->field_name_map[$field]['type'];
|
||||
if (!empty($this->sugarbean->field_name_map[$dispField]['isMultiSelect'])) {
|
||||
$dispField .='[]';
|
||||
}
|
||||
$this->addFieldGeneric($dispField, $type, $vname, $required, $prefix);
|
||||
}
|
||||
} else {
|
||||
$GLOBALS['log']->debug('No VarDef Label For ' . $field . ' in module ' . $this->sugarbean->module_dir);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function stripEndColon($modString)
|
||||
{
|
||||
if (substr($modString, -1, 1) == ":") {
|
||||
$modString = substr($modString, 0, (strlen($modString) - 1));
|
||||
}
|
||||
if (substr($modString, -2, 2) == ": ") {
|
||||
$modString = substr($modString, 0, (strlen($modString) - 2));
|
||||
}
|
||||
return $modString;
|
||||
}
|
||||
|
||||
public function addFieldGeneric($field, $type, $displayName, $required, $prefix='')
|
||||
{
|
||||
$this->script .= "addToValidate('".$this->formname."', '".$prefix.$field."', '".$type . "', {$this->getRequiredString($required)},'"
|
||||
. $this->stripEndColon(translate($displayName, $this->sugarbean->module_dir)) . "' );\n";
|
||||
}
|
||||
|
||||
// Bug #47961 Generator of callback validator
|
||||
public function addFieldCallback($field, $type, $displayName, $required, $prefix, $callback)
|
||||
{
|
||||
$this->script .= 'addToValidateCallback("'
|
||||
. $this->formname . '", "'
|
||||
. $prefix.$field . '", "'
|
||||
. $type . '", '
|
||||
. $this->getRequiredString($required) . ', "'
|
||||
. $this->stripEndColon(translate($displayName, $this->sugarbean->module_dir)).'", '
|
||||
.$callback
|
||||
.');'."\n";
|
||||
}
|
||||
|
||||
public function addFieldRange($field, $type, $displayName, $required, $prefix, $min, $max)
|
||||
{
|
||||
$this->script .= "addToValidateRange("
|
||||
. "'" . $this->formname . "', "
|
||||
. "'" . $prefix . $field . "', '"
|
||||
. $type . "', "
|
||||
. $this->getRequiredString($required) . ", '"
|
||||
. $this->stripEndColon(translate($displayName, $this->sugarbean->module_dir)) . "', "
|
||||
. ($min === false ? 'false' : $min) . ", "
|
||||
. ($max === false ? 'false' : $max)
|
||||
. ");\n";
|
||||
}
|
||||
|
||||
public function addFieldIsValidDate($field, $type, $displayName, $msg, $required, $prefix='')
|
||||
{
|
||||
$name = $prefix.$field;
|
||||
$req = $this->getRequiredString($required);
|
||||
$this->script .= "addToValidateIsValidDate('{$this->formname}', '{$name}', '{$type}', {$req}, '{$msg}');\n";
|
||||
}
|
||||
|
||||
public function addFieldIsValidTime($field, $type, $displayName, $msg, $required, $prefix='')
|
||||
{
|
||||
$name = $prefix.$field;
|
||||
$req = $this->getRequiredString($required);
|
||||
$this->script .= "addToValidateIsValidTime('{$this->formname}', '{$name}', '{$type}', {$req}, '{$msg}');\n";
|
||||
}
|
||||
|
||||
public function addFieldDateBefore($field, $type, $displayName, $required, $prefix, $compareTo)
|
||||
{
|
||||
$this->script .= "addToValidateDateBefore('".$this->formname."', '".$prefix.$field."', '".$type . "', {$this->getRequiredString($required)},'"
|
||||
. $this->stripEndColon(translate($displayName, $this->sugarbean->module_dir)) . "', '$compareTo' );\n";
|
||||
}
|
||||
|
||||
public function addFieldDateBeforeAllowBlank($field, $type, $displayName, $required, $prefix, $compareTo, $allowBlank='true')
|
||||
{
|
||||
$this->script .= "addToValidateDateBeforeAllowBlank('".$this->formname."', '".$prefix.$field."', '".$type . "', {$this->getRequiredString($required)},'"
|
||||
. $this->stripEndColon(translate($displayName, $this->sugarbean->module_dir)) . "', '$compareTo', '$allowBlank' );\n";
|
||||
}
|
||||
|
||||
public function addToValidateBinaryDependency($field, $type, $displayName, $required, $prefix, $compareTo)
|
||||
{
|
||||
$this->script .= "addToValidateBinaryDependency('".$this->formname."', '".$prefix.$field."', '".$type . "', {$this->getRequiredString($required)},'"
|
||||
. $this->stripEndColon(translate($displayName, $this->sugarbean->module_dir)) . "', '$compareTo' );\n";
|
||||
}
|
||||
|
||||
public function addToValidateComparison($field, $type, $displayName, $required, $prefix, $compareTo)
|
||||
{
|
||||
$this->script .= "addToValidateComparison('".$this->formname."', '".$prefix.$field."', '".$type . "', {$this->getRequiredString($required)},'"
|
||||
. $this->stripEndColon(translate($displayName, $this->sugarbean->module_dir)) . "', '$compareTo' );\n";
|
||||
}
|
||||
|
||||
public function addFieldIsInArray($field, $type, $displayName, $required, $prefix, $arr, $operator)
|
||||
{
|
||||
$name = $prefix.$field;
|
||||
$req = $this->getRequiredString($required);
|
||||
$json = getJSONobj();
|
||||
$arr = $json->encode($arr);
|
||||
$this->script .= "addToValidateIsInArray('{$this->formname}', '{$name}', '{$type}', {$req}, '".$this->stripEndColon(translate($displayName, $this->sugarbean->module_dir))."', '{$arr}', '{$operator}');\n";
|
||||
}
|
||||
|
||||
public function addAllFields($prefix, $skip_fields=null, $translate = false)
|
||||
{
|
||||
if (!isset($skip_fields)) {
|
||||
$skip_fields = array();
|
||||
}
|
||||
foreach ($this->sugarbean->field_name_map as $field=>$value) {
|
||||
if (!isset($skip_fields[$field])) {
|
||||
if (isset($value['type']) && ($value['type'] == 'datetimecombo' || $value['type'] == 'datetime')) {
|
||||
$isRequired = (isset($value['required']) && $value['required']) ? 'true' : 'false';
|
||||
$this->addSpecialField($value['name'] . '_date', $value['name'], 'datetime', $isRequired);
|
||||
if ($value['type'] != 'link' && isset($this->sugarbean->field_name_map[$field]['validation'])) {
|
||||
//datetime should also support the isbefore or other type of validate
|
||||
$this->addField($field, '', $prefix, '', $translate);
|
||||
}
|
||||
} else {
|
||||
if (isset($value['type'])) {
|
||||
if ($value['type'] != 'link') {
|
||||
$this->addField($field, '', $prefix, '', $translate);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function addActionMenu()
|
||||
{
|
||||
$this->script .= "$(document).ready(SUGAR.themes.actionMenu);";
|
||||
}
|
||||
|
||||
public function getScript($showScriptTag = true, $clearValidateFields = true)
|
||||
{
|
||||
$tempScript = $this->script;
|
||||
$this->script = "";
|
||||
if ($showScriptTag) {
|
||||
$this->script = "<script type=\"text/javascript\">\n";
|
||||
}
|
||||
|
||||
if ($clearValidateFields) {
|
||||
$this->script .= "addForm('{$this->formname}');";
|
||||
}
|
||||
|
||||
$this->script .= $tempScript;
|
||||
|
||||
if ($showScriptTag) {
|
||||
$this->script .= "</script>";
|
||||
}
|
||||
return $this->script;
|
||||
}
|
||||
|
||||
public function buildStringToTranslateInSmarty(
|
||||
$string
|
||||
) {
|
||||
if (is_array($string)) {
|
||||
$returnstring = '';
|
||||
foreach ($string as $astring) {
|
||||
$returnstring .= $this->buildStringToTranslateInSmarty($astring);
|
||||
}
|
||||
return $returnstring;
|
||||
}
|
||||
return "{/literal}{sugar_translate label='$string' module='{$this->sugarbean->module_dir}' for_js=true}{literal}";
|
||||
}
|
||||
|
||||
protected function getRequiredString($required)
|
||||
{
|
||||
if (is_string($required) && strtolower($required) == "false") {
|
||||
return "false";
|
||||
}
|
||||
return empty($required) ? "false" : "true";
|
||||
}
|
||||
}
|
4
include/javascript/jquery.js
vendored
Executable file
6
include/javascript/jquery/bootstrap.min.js
vendored
Executable file
6914
include/javascript/jquery/footable.js
vendored
Normal file
4
include/javascript/jquery/html5shiv.min.js
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
/**
|
||||
* @preserve HTML5 Shiv 3.7.2 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
|
||||
*/
|
||||
!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.2",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b)}(this,document);
|
2
include/javascript/jquery/jquery-migrate.min.js
vendored
Normal file
4
include/javascript/jquery/jquery-min.js
vendored
Executable file
13
include/javascript/jquery/jquery-ui-min.js
vendored
Executable file
5
include/javascript/jquery/jquery.browser.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
/*
|
||||
* backward compatible support for $.browser
|
||||
*/
|
||||
|
||||
var matched,browser;jQuery.uaMatch=function(e){e=e.toLowerCase();var r=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:r[1]||"",version:r[2]||"0"}},matched=jQuery.uaMatch(navigator.userAgent),browser={},matched.browser&&(browser[matched.browser]=!0,browser.version=matched.version),browser.chrome?browser.webkit=!0:browser.webkit&&(browser.safari=!0),jQuery.browser=browser;
|
117
include/javascript/jquery/jquery.cookie.js
Normal file
|
@ -0,0 +1,117 @@
|
|||
/*!
|
||||
* jQuery Cookie Plugin v1.4.1
|
||||
* https://github.com/carhartl/jquery-cookie
|
||||
*
|
||||
* Copyright 2006, 2014 Klaus Hartl
|
||||
* Released under the MIT license
|
||||
*/
|
||||
(function (factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD
|
||||
define(['jquery'], factory);
|
||||
} else if (typeof exports === 'object') {
|
||||
// CommonJS
|
||||
factory(require('jquery'));
|
||||
} else {
|
||||
// Browser globals
|
||||
factory(jQuery);
|
||||
}
|
||||
}(function ($) {
|
||||
|
||||
var pluses = /\+/g;
|
||||
|
||||
function encode(s) {
|
||||
return config.raw ? s : encodeURIComponent(s);
|
||||
}
|
||||
|
||||
function decode(s) {
|
||||
return config.raw ? s : decodeURIComponent(s);
|
||||
}
|
||||
|
||||
function stringifyCookieValue(value) {
|
||||
return encode(config.json ? JSON.stringify(value) : String(value));
|
||||
}
|
||||
|
||||
function parseCookieValue(s) {
|
||||
if (s.indexOf('"') === 0) {
|
||||
// This is a quoted cookie as according to RFC2068, unescape...
|
||||
s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
|
||||
}
|
||||
|
||||
try {
|
||||
// Replace server-side written pluses with spaces.
|
||||
// If we can't decode the cookie, ignore it, it's unusable.
|
||||
// If we can't parse the cookie, ignore it, it's unusable.
|
||||
s = decodeURIComponent(s.replace(pluses, ' '));
|
||||
return config.json ? JSON.parse(s) : s;
|
||||
} catch(e) {}
|
||||
}
|
||||
|
||||
function read(s, converter) {
|
||||
var value = config.raw ? s : parseCookieValue(s);
|
||||
return $.isFunction(converter) ? converter(value) : value;
|
||||
}
|
||||
|
||||
var config = $.cookie = function (key, value, options) {
|
||||
|
||||
// Write
|
||||
|
||||
if (arguments.length > 1 && !$.isFunction(value)) {
|
||||
options = $.extend({}, config.defaults, options);
|
||||
|
||||
if (typeof options.expires === 'number') {
|
||||
var days = options.expires, t = options.expires = new Date();
|
||||
t.setTime(+t + days * 864e+5);
|
||||
}
|
||||
|
||||
return (document.cookie = [
|
||||
encode(key), '=', stringifyCookieValue(value),
|
||||
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
|
||||
options.path ? '; path=' + options.path : '',
|
||||
options.domain ? '; domain=' + options.domain : '',
|
||||
options.secure ? '; secure' : ''
|
||||
].join(''));
|
||||
}
|
||||
|
||||
// Read
|
||||
|
||||
var result = key ? undefined : {};
|
||||
|
||||
// To prevent the for loop in the first place assign an empty array
|
||||
// in case there are no cookies at all. Also prevents odd result when
|
||||
// calling $.cookie().
|
||||
var cookies = document.cookie ? document.cookie.split('; ') : [];
|
||||
|
||||
for (var i = 0, l = cookies.length; i < l; i++) {
|
||||
var parts = cookies[i].split('=');
|
||||
var name = decode(parts.shift());
|
||||
var cookie = parts.join('=');
|
||||
|
||||
if (key && key === name) {
|
||||
// If second argument (value) is a function it's a converter...
|
||||
result = read(cookie, value);
|
||||
break;
|
||||
}
|
||||
|
||||
// Prevent storing a cookie that we couldn't decode.
|
||||
if (!key && (cookie = read(cookie)) !== undefined) {
|
||||
result[name] = cookie;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
config.defaults = {};
|
||||
|
||||
$.removeCookie = function (key, options) {
|
||||
if ($.cookie(key) === undefined) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Must not alter options, thus extending a fresh object...
|
||||
$.cookie(key, '', $.extend({}, options, { expires: -1 }));
|
||||
return !$.cookie(key);
|
||||
};
|
||||
|
||||
}));
|
5
include/javascript/jquery/jquery.dialogTitle.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
/*
|
||||
* backward compatible support for html dialog title
|
||||
*/
|
||||
|
||||
$.widget("ui.dialog",$.extend({},$.ui.dialog.prototype,{_title:function(e){if(!this.options.title){e.html(" ")}else{e.html(this.options.title)}}}))
|
123
include/javascript/jquery/jquery.effects.custombounce.js
vendored
Executable file
|
@ -0,0 +1,123 @@
|
|||
/*!
|
||||
* jQuery UI Effects Bounce 1.8.21
|
||||
*
|
||||
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Effects/Bounce
|
||||
*
|
||||
* Depends:
|
||||
* jquery.effects.core.js
|
||||
*/
|
||||
(function( $, undefined ) {
|
||||
|
||||
$.effects.custombounce = function(o) {
|
||||
|
||||
return this.queue(function() {
|
||||
|
||||
// Create element
|
||||
var el = $(this), props = ['position','top','bottom','left','right'];
|
||||
// Set options
|
||||
var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
|
||||
var direction = o.options.direction || 'up'; // Default direction
|
||||
var gravity = (o.options.gravity == "undefined") ? true : o.options.gravity ; // Default direction
|
||||
var distance = o.options.distance || 20; // Default distance
|
||||
var times = o.options.times || 5; // Default # of times
|
||||
var speed = o.duration || 250; // Default speed per bounce
|
||||
if (/show|hide/.test(mode)) props.push('opacity'); // Avoid touching opacity to prevent clearType and PNG issues in IE
|
||||
|
||||
// Adjust
|
||||
$.effects.save(el, props); el.show(); // Save & Show
|
||||
$.effects.createWrapper(el); // Create Wrapper
|
||||
var ref ,ref2, motion;
|
||||
|
||||
if(direction == 'up' || direction == 'down') {
|
||||
ref = 'top';
|
||||
} else if(direction == 'up right' || direction == 'down right' || direction == 'up left' || direction == 'down left') {
|
||||
ref = 'top';
|
||||
ref2 = 'left';
|
||||
} else {
|
||||
ref = 'left';
|
||||
}
|
||||
|
||||
var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
|
||||
|
||||
if (direction == "up" || direction == "left") {
|
||||
motion = "pos";
|
||||
} else {
|
||||
motion = "neg";
|
||||
}
|
||||
var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) / 3 : el.outerWidth({margin:true}) / 3);
|
||||
if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift
|
||||
if (mode == 'hide') distance = distance / (times * 2);
|
||||
if (mode != 'hide') times--;
|
||||
|
||||
// Animate
|
||||
if (mode == 'show') { // Show Bounce
|
||||
var animation = {opacity: 1};
|
||||
animation[ref] = (motion == 'pos' ? '+=' : '-=') + distance;
|
||||
el.animate(animation, speed / 2, o.options.easing);
|
||||
distance = distance / 2;
|
||||
times--;
|
||||
};
|
||||
for (var i = 0; i < times; i++) { // Bounces
|
||||
var animation1 = {}, animation2 = {};
|
||||
|
||||
animation1[ref] = (motion == 'pos' ? '-=' : '+=') + distance;
|
||||
animation2[ref] = (motion == 'pos' ? '+=' : '-=') + distance;
|
||||
if(ref2 != "undefined") {
|
||||
if(!rtl) {
|
||||
if(direction == "up right" || direction == "down left") {
|
||||
animation1[ref2] = (motion == 'pos' ? '-=' : '+=') + distance;
|
||||
animation2[ref2] = (motion == 'pos' ? '+=' : '-=') + distance;
|
||||
} else {
|
||||
animation1[ref2] = (motion == 'pos' ? '+=' : '-=') + distance;
|
||||
animation2[ref2] = (motion == 'pos' ? '-=' : '+=') + distance;
|
||||
}
|
||||
} else {
|
||||
if(direction == "down right" || direction == "up left") {
|
||||
animation1[ref2] = (motion == 'pos' ? '-=' : '+=') + distance;
|
||||
animation2[ref2] = (motion == 'pos' ? '+=' : '-=') + distance;
|
||||
} else {
|
||||
animation1[ref2] = (motion == 'pos' ? '+=' : '-=') + distance;
|
||||
animation2[ref2] = (motion == 'pos' ? '-=' : '+=') + distance;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
el.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing);
|
||||
if(gravity) {
|
||||
distance = (mode == 'hide') ? distance * 2 : distance / 2;
|
||||
}
|
||||
|
||||
// console.log(distance)
|
||||
};
|
||||
if (mode == 'hide') { // Last Bounce
|
||||
var animation = {opacity: 0};
|
||||
animation[ref] = (motion == 'pos' ? '-=' : '+=') + distance;
|
||||
el.animate(animation, speed / 2, o.options.easing, function(){
|
||||
el.hide(); // Hide
|
||||
$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
|
||||
if(o.callback) o.callback.apply(this, arguments); // Callback
|
||||
});
|
||||
} else {
|
||||
var animation1 = {}, animation2 = {};
|
||||
animation1[ref] = (motion == 'pos' ? '-=' : '+=') + distance;
|
||||
animation2[ref] = (motion == 'pos' ? '+=' : '-=') + distance;
|
||||
if(ref2 != "undefined") {
|
||||
animation1[ref2] = (motion == 'pos' ? '+=' : '-=') + distance;
|
||||
animation2[ref2] = (motion == 'pos' ? '-=' : '+=') + distance;
|
||||
}
|
||||
el.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing, function(){
|
||||
$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
|
||||
if(o.callback) o.callback.apply(this, arguments); // Callback
|
||||
});
|
||||
};
|
||||
el.queue('fx', function() { el.dequeue(); });
|
||||
el.dequeue();
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
})(jQuery);
|
113
include/javascript/jquery/jquery.elementReady.js
Executable file
|
@ -0,0 +1,113 @@
|
|||
/* jQuery elementReady plugin
|
||||
* Version 0.6
|
||||
* Copyright (C) 2007-08 Bennett McElwee.
|
||||
* Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License (http://creativecommons.org/licenses/by-sa/3.0/)
|
||||
* Permissions beyond the scope of this license may be available at http://www.thunderguy.com/semicolon/.
|
||||
*/
|
||||
|
||||
/*
|
||||
IMPLEMENTATION NOTES
|
||||
There may be race conditions. The most likely could occur if check() is
|
||||
called while a previous invocation of check() is still running. This could
|
||||
cause a callback to be called more than once, or not at all. Less likely is
|
||||
for elementReady() to be called concurrently with check() (with similar
|
||||
effects) or with itself (which could cause an interval to run forever).
|
||||
None of these are likely to occur. In fact I don't think they are possible
|
||||
at all except on IE. -- Bennett McElwee, August 2007
|
||||
*/
|
||||
(function($) {
|
||||
|
||||
/**
|
||||
* While a page is loading, call a given callback function as soon as a specific
|
||||
* element (with a specific ID) is loaded into the DOM, even before the full DOM
|
||||
* has been loaded. Executes the function within the context of the element. This
|
||||
* means that when the passed-in function is executed, the 'this' keyword points
|
||||
* to the specific DOM element.
|
||||
*
|
||||
* The function returns 'this', so you can chain multiple calls to
|
||||
* elementReady(). (Not that there's much benefit in doing that.)
|
||||
*
|
||||
* One argument is passed to the callback: a reference to the jQuery function.
|
||||
* You can name this argument $ and therefore use the $ alias even in
|
||||
* noConflict mode.
|
||||
*
|
||||
* If the element has not been found by the time the DOM is fully loaded, then
|
||||
* the function will not be called.
|
||||
*
|
||||
* The function works by polling the DOM at short intervals. By default it polls
|
||||
* every 23 milliseconds, but you can change this by setting
|
||||
* $.elementReady.interval_ms to whatever value you like.
|
||||
* Don't bother changing this unless you really know what you're doing.
|
||||
*
|
||||
* @example
|
||||
* $.elementReady('powerpic', function(){
|
||||
* this.src = 'powered-by-jquery.png';
|
||||
* });
|
||||
* @desc Change the source of a specific image as soon as it is loaded into the
|
||||
* DOM (before the whole DOM is loaded).
|
||||
*
|
||||
* @example
|
||||
* $.elementReady('header', function(){
|
||||
* $(this).addClass('fancy');
|
||||
* });
|
||||
* @desc If you want to have the jQuery object instead of the regular DOM
|
||||
* element, use the $(this) function.
|
||||
*
|
||||
* @example
|
||||
* $.elementReady('first', function(){ $(this).fancify(); })
|
||||
* .elementReady('second', function(){ $(this).fancify(); });
|
||||
* @desc Chain multiple calls to $.elementReady().
|
||||
*
|
||||
* @example
|
||||
* jQuery.noConflict();
|
||||
* jQuery.elementReady('header', function($){
|
||||
* $(this).addClass('fancy');
|
||||
* });
|
||||
* @desc Use the '$' alias within your callback, even in noConflict mode.
|
||||
*
|
||||
* @example
|
||||
* $.elementReady.interval_ms = 100;
|
||||
* @desc Change the polling interval to 100ms. This only works if $.elementReady()
|
||||
* has not yet been called.
|
||||
*
|
||||
* @name $.elementReady
|
||||
* @type jQuery
|
||||
* @param String id string ID of the element to wait for
|
||||
* @param Function fn function to call when the element is ready
|
||||
* @return jQuery
|
||||
* @cat Plugins/Event
|
||||
* @author Bennett McElwee
|
||||
*/
|
||||
var interval = null;
|
||||
var checklist = [];
|
||||
|
||||
$.elementReady = function(id, fn) {
|
||||
checklist.push({id: id, fn: fn});
|
||||
if (!interval) {
|
||||
interval = setInterval(check, $.elementReady.interval_ms);
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
// Plugin settings
|
||||
$.elementReady.interval_ms = 23; // polling interval in ms
|
||||
|
||||
// Private function
|
||||
function check() {
|
||||
var docReady = $.isReady; // check doc ready first; thus ensure that check is made at least once _after_ doc is ready
|
||||
for (var i = checklist.length - 1; 0 <= i; --i) {
|
||||
var el = document.getElementById(checklist[i].id);
|
||||
if (el) {
|
||||
var fn = checklist[i].fn; // first remove from checklist, then call function
|
||||
checklist[i] = checklist[checklist.length - 1];
|
||||
checklist.pop();
|
||||
fn.apply(el, [$]);
|
||||
}
|
||||
}
|
||||
if (docReady) {
|
||||
clearInterval(interval);
|
||||
interval = null;
|
||||
}
|
||||
};
|
||||
|
||||
})(jQuery);
|
39
include/javascript/jquery/jquery.highLight.js
Executable file
|
@ -0,0 +1,39 @@
|
|||
jQuery.fn.highlight = function(pat) {
|
||||
function innerHighlight(node, pat) {
|
||||
var skip = 0;
|
||||
if (node.nodeType == 3) {
|
||||
var pos = node.data.toUpperCase().indexOf(pat);
|
||||
if (pos >= 0) {
|
||||
var spannode = document.createElement('span');
|
||||
spannode.className = 'highlight';
|
||||
var middlebit = node.splitText(pos);
|
||||
var endbit = middlebit.splitText(pat.length);
|
||||
var middleclone = middlebit.cloneNode(true);
|
||||
spannode.appendChild(middleclone);
|
||||
middlebit.parentNode.replaceChild(spannode, middlebit);
|
||||
skip = 1;
|
||||
}
|
||||
}
|
||||
else if (node.nodeType == 1 && node.childNodes && !/(script|style)/i.test(node.tagName)) {
|
||||
for (var i = 0; i < node.childNodes.length; ++i) {
|
||||
i += innerHighlight(node.childNodes[i], pat);
|
||||
}
|
||||
}
|
||||
return skip;
|
||||
}
|
||||
|
||||
return this.each(function() {
|
||||
innerHighlight(this, pat.toUpperCase());
|
||||
});
|
||||
};
|
||||
|
||||
jQuery.fn.removeHighlight = function() {
|
||||
return this.find("span.highlight").each(
|
||||
function() {
|
||||
this.parentNode.firstChild.nodeName;
|
||||
with (this.parentNode) {
|
||||
replaceChild(this.firstChild, this);
|
||||
normalize();
|
||||
}
|
||||
}).end();
|
||||
};
|
12
include/javascript/jquery/jquery.hotkeys.js
Executable file
|
@ -0,0 +1,12 @@
|
|||
/*
|
||||
* jQuery Hotkeys Plugin
|
||||
* Copyright 2010, John Resig
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
*
|
||||
* Based upon the plugin by Tzury Bar Yochay:
|
||||
* http://github.com/tzuryby/hotkeys
|
||||
*
|
||||
* Original idea by:
|
||||
* Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/
|
||||
*/
|
||||
!function(t){function e(e){if("string"==typeof e.data&&(e.data={keys:e.data}),e.data&&e.data.keys&&"string"==typeof e.data.keys){var a=e.handler,s=e.data.keys.toLowerCase().split(" ");e.handler=function(e){if(this===e.target||!(t.hotkeys.options.filterInputAcceptingElements&&t.hotkeys.textInputTypes.test(e.target.nodeName)||t.hotkeys.options.filterContentEditable&&t(e.target).attr("contenteditable")||t.hotkeys.options.filterTextInputs&&t.inArray(e.target.type,t.hotkeys.textAcceptingInputTypes)>-1)){var n="keypress"!==e.type&&t.hotkeys.specialKeys[e.which],i=String.fromCharCode(e.which).toLowerCase(),r="",o={};t.each(["alt","ctrl","shift"],function(t,a){e[a+"Key"]&&n!==a&&(r+=a+"+")}),e.metaKey&&!e.ctrlKey&&"meta"!==n&&(r+="meta+"),e.metaKey&&"meta"!==n&&r.indexOf("alt+ctrl+shift+")>-1&&(r=r.replace("alt+ctrl+shift+","hyper+")),n?o[r+n]=!0:(o[r+i]=!0,o[r+t.hotkeys.shiftNums[i]]=!0,"shift+"===r&&(o[t.hotkeys.shiftNums[i]]=!0));for(var p=0,l=s.length;l>p;p++)if(o[s[p]])return a.apply(this,arguments)}}}}t.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",10:"return",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",59:";",61:"=",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},shiftNums:{"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"},textAcceptingInputTypes:["text","password","number","email","url","range","date","month","week","time","datetime","datetime-local","search","color","tel"],textInputTypes:/textarea|input|select/i,options:{filterInputAcceptingElements:!0,filterTextInputs:!0,filterContentEditable:!0}},t.each(["keydown","keyup","keypress"],function(){t.event.special[this]={add:e}})}(jQuery||this.jQuery||window.jQuery);
|
9
include/javascript/jquery/jquery.hoverIntent.js
Executable file
|
@ -0,0 +1,9 @@
|
|||
/*!
|
||||
* hoverIntent v1.8.0 // 2014.06.29 // jQuery v1.9.1+
|
||||
* http://cherne.net/brian/resources/jquery.hoverIntent.html
|
||||
*
|
||||
* You may use hoverIntent under the terms of the MIT license. Basically that
|
||||
* means you are free to use hoverIntent as long as this header is left intact.
|
||||
* Copyright 2007, 2014 Brian Cherne
|
||||
*/
|
||||
(function($){$.fn.hoverIntent=function(handlerIn,handlerOut,selector){var cfg={interval:100,sensitivity:6,timeout:0};if(typeof handlerIn==="object"){cfg=$.extend(cfg,handlerIn)}else{if($.isFunction(handlerOut)){cfg=$.extend(cfg,{over:handlerIn,out:handlerOut,selector:selector})}else{cfg=$.extend(cfg,{over:handlerIn,out:handlerIn,selector:handlerOut})}}var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if(Math.sqrt((pX-cX)*(pX-cX)+(pY-cY)*(pY-cY))<cfg.sensitivity){$(ob).off("mousemove.hoverIntent",track);ob.hoverIntent_s=true;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=false;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var ev=$.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type==="mouseenter"){pX=ev.pageX;pY=ev.pageY;$(ob).on("mousemove.hoverIntent",track);if(!ob.hoverIntent_s){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}}else{$(ob).off("mousemove.hoverIntent",track);if(ob.hoverIntent_s){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}}};return this.on({"mouseenter.hoverIntent":handleHover,"mouseleave.hoverIntent":handleHover},cfg.selector)}})(jQuery);
|
16
include/javascript/jquery/jquery.hoverscroll.js
Executable file
4
include/javascript/jquery/jquery.js
vendored
Executable file
15
include/javascript/jquery/jquery.json-2.3.js
Executable file
|
@ -0,0 +1,15 @@
|
|||
/**
|
||||
* jQuery JSON plugin 2.4.0
|
||||
*
|
||||
* @author Brantley Harris, 2009-2011
|
||||
* @author Timo Tijhof, 2011-2012
|
||||
* @source This plugin is heavily influenced by MochiKit's serializeJSON, which is
|
||||
* copyrighted 2005 by Bob Ippolito.
|
||||
* @source Brantley Harris wrote this plugin. It is based somewhat on the JSON.org
|
||||
* website's http://www.json.org/json2.js, which proclaims:
|
||||
* "NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.", a sentiment that
|
||||
* I uphold.
|
||||
* @license MIT License <http://www.opensource.org/licenses/mit-license.php>
|
||||
*/
|
||||
|
||||
!function($){"use strict";var escape=/["\\\x00-\x1f\x7f-\x9f]/g,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},hasOwn=Object.prototype.hasOwnProperty;$.toJSON="object"==typeof JSON&&JSON.stringify?JSON.stringify:function(t){if(null===t)return"null";var e,r,n,o,i=$.type(t);if("undefined"===i)return void 0;if("number"===i||"boolean"===i)return String(t);if("string"===i)return $.quoteString(t);if("function"==typeof t.toJSON)return $.toJSON(t.toJSON());if("date"===i){var u=t.getUTCMonth()+1,f=t.getUTCDate(),s=t.getUTCFullYear(),a=t.getUTCHours(),l=t.getUTCMinutes(),c=t.getUTCSeconds(),p=t.getUTCMilliseconds();return 10>u&&(u="0"+u),10>f&&(f="0"+f),10>a&&(a="0"+a),10>l&&(l="0"+l),10>c&&(c="0"+c),100>p&&(p="0"+p),10>p&&(p="0"+p),'"'+s+"-"+u+"-"+f+"T"+a+":"+l+":"+c+"."+p+'Z"'}if(e=[],$.isArray(t)){for(r=0;r<t.length;r++)e.push($.toJSON(t[r])||"null");return"["+e.join(",")+"]"}if("object"==typeof t){for(r in t)if(hasOwn.call(t,r)){if(i=typeof r,"number"===i)n='"'+r+'"';else{if("string"!==i)continue;n=$.quoteString(r)}i=typeof t[r],"function"!==i&&"undefined"!==i&&(o=$.toJSON(t[r]),e.push(n+":"+o))}return"{"+e.join(",")+"}"}},$.evalJSON="object"==typeof JSON&&JSON.parse?JSON.parse:function(str){return eval("("+str+")")},$.secureEvalJSON="object"==typeof JSON&&JSON.parse?JSON.parse:function(str){var filtered=str.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"");if(/^[\],:{}\s]*$/.test(filtered))return eval("("+str+")");throw new SyntaxError("Error parsing JSON, source is not valid.")},$.quoteString=function(t){return t.match(escape)?'"'+t.replace(escape,function(t){var e=meta[t];return"string"==typeof e?e:(e=t.charCodeAt(),"\\u00"+Math.floor(e/16).toString(16)+(e%16).toString(16))})+'"':'"'+t+'"'}}(jQuery);
|
186
include/javascript/jquery/jquery.popoverext.js
Executable file
|
@ -0,0 +1,186 @@
|
|||
!function( $ ) {
|
||||
|
||||
"use strict"
|
||||
|
||||
var PopoverExt = function ( element, options ) {
|
||||
this.init('popoverext', element, options)
|
||||
}
|
||||
|
||||
/* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
|
||||
========================================== */
|
||||
|
||||
PopoverExt.prototype = $.extend({}, $.fn.popover.Constructor.prototype, {
|
||||
|
||||
constructor: PopoverExt
|
||||
, init: function ( type, element, options ) {
|
||||
var eventIn
|
||||
, eventOut
|
||||
|
||||
this.type = type
|
||||
this.$element = $(element)
|
||||
this.options = this.getOptions(options)
|
||||
this.enabled = true
|
||||
|
||||
if (this.options.trigger != 'manual') {
|
||||
eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
|
||||
eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
|
||||
this.$element.on(eventIn, this.options.selector, $.proxy(this.enter, this))
|
||||
this.$element.on(eventOut, this.options.selector, $.proxy(this.leave, this))
|
||||
}
|
||||
|
||||
//console.log(this.tip())
|
||||
var $tip = this.tip();
|
||||
|
||||
|
||||
this.options.selector ?
|
||||
(this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
|
||||
this.fixTitle()
|
||||
}
|
||||
|
||||
, setContent: function () {
|
||||
var $tip = this.tip()
|
||||
, title = this.getTitle()
|
||||
, content = this.getContent()
|
||||
, footer = this.getFooter();
|
||||
|
||||
$tip.find('.popover-title')[ $.type(title) == 'object' ? 'append' : 'html' ](title);
|
||||
$tip.find('.popover-content > *')[ $.type(content) == 'object' ? 'append' : 'html' ](content);
|
||||
$tip.find('.popover-footer')[ $.type(footer) == 'object' ? 'append' : 'html' ](footer);
|
||||
|
||||
$tip.removeClass('fade top bottom left right in');
|
||||
}
|
||||
|
||||
, hasContent: function () {
|
||||
return this.getTitle() || this.getContent()
|
||||
}
|
||||
|
||||
|
||||
, setId: function() {
|
||||
var $tip;
|
||||
if(this.options.id) {
|
||||
$tip = this.tip();
|
||||
$tip.attr("id",this.$element.attr("id") + "Popover");
|
||||
}
|
||||
}
|
||||
, show: function () {
|
||||
var $tip
|
||||
, inside
|
||||
, pos
|
||||
, actualWidth
|
||||
, actualHeight
|
||||
, placement
|
||||
, tp;
|
||||
|
||||
|
||||
if (this.hasContent() && this.enabled) {
|
||||
$tip = this.tip();
|
||||
this.setContent();
|
||||
this.setId();
|
||||
|
||||
if (this.options.animation) {
|
||||
$tip.addClass('fade')
|
||||
}
|
||||
|
||||
placement = typeof this.options.placement == 'function' ?
|
||||
this.options.placement.call(this, $tip[0], this.$element[0]) :
|
||||
this.options.placement;
|
||||
|
||||
inside = /in/.test(placement)
|
||||
|
||||
$tip
|
||||
.remove()
|
||||
.css({ top: 0, left: 0, display: 'block' })
|
||||
.appendTo(inside ? this.$element : document.body);
|
||||
|
||||
if(this.options.hideOnBlur) {
|
||||
$tip
|
||||
.attr("tabindex","-1")
|
||||
.on("blur", $.proxy(this.hide, this))
|
||||
.trigger("focus");
|
||||
}
|
||||
|
||||
pos = this.getPosition(inside)
|
||||
actualWidth = $tip[0].offsetWidth
|
||||
actualHeight = $tip[0].offsetHeight
|
||||
|
||||
switch (inside ? placement.split(' ')[1] : placement) {
|
||||
case 'bottom':
|
||||
tp = {top: pos.top + pos.height + this.options.topOffset, left: pos.left + pos.width / 2 - actualWidth / 2}
|
||||
break
|
||||
case 'bottom left':
|
||||
tp = {top: pos.top + pos.height + this.options.topOffset, left: pos.left + this.options.leftOffset}
|
||||
break
|
||||
case 'bottom right':
|
||||
tp = {top: pos.top + pos.height + this.options.topOffset , left: (pos.left + pos.width) - actualWidth - this.options.leftOffset }
|
||||
break
|
||||
case 'top':
|
||||
tp = {top: pos.top - actualHeight + this.options.topOffset, left: pos.left + (pos.width / 2 - actualWidth / 2) + this.options.leftOffset}
|
||||
break
|
||||
case 'top right':
|
||||
tp = {top: pos.top - actualHeight + this.options.topOffset, left: (pos.left + pos.width) - actualWidth - this.options.leftOffset}
|
||||
break
|
||||
case 'top left':
|
||||
tp = {top: pos.top - actualHeight + this.options.topOffset, left: pos.left + this.options.leftOffset}
|
||||
break
|
||||
case 'left':
|
||||
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
|
||||
break
|
||||
case 'right':
|
||||
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
|
||||
break
|
||||
}
|
||||
|
||||
$tip
|
||||
.css(tp)
|
||||
.addClass(placement)
|
||||
.addClass('in')
|
||||
|
||||
if(this.options.fixed == true) {
|
||||
$tip.css("position","fixed");
|
||||
}
|
||||
}
|
||||
this.options.onShow();
|
||||
}
|
||||
, getFooter: function () {
|
||||
var footer
|
||||
, $e = this.$element
|
||||
, o = this.options;
|
||||
|
||||
footer = $e.attr('data-footer')
|
||||
|| (typeof o.content == 'function' ? o.footer.call($e[0]) : o.footer);
|
||||
|
||||
footer = footer.toString().replace(/(^\s*|\s*$)/, "");
|
||||
|
||||
return footer;
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
/* POPOVER PLUGIN DEFINITION
|
||||
* ======================= */
|
||||
|
||||
$.fn.popoverext = function ( option ) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('popoverext')
|
||||
, options = typeof option == 'object' && option
|
||||
if (!data) $this.data('popoverext', (data = new PopoverExt(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.popoverext.Constructor = PopoverExt
|
||||
|
||||
$.fn.popoverext.defaults = $.extend({} , $.fn.popover.defaults, {
|
||||
fixed: false,
|
||||
template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div><div class="popover-footer"></div></div></div>',
|
||||
id: false,
|
||||
footer: '',
|
||||
onShow:$.empty,
|
||||
leftOffset: 0,
|
||||
topOffset: 0,
|
||||
hideOnBlur: false
|
||||
})
|
||||
|
||||
}( window.jQuery );
|
10
include/javascript/jquery/jquery.showLoading.js
Executable file
|
@ -0,0 +1,10 @@
|
|||
/*
|
||||
* jQuery showLoading plugin v1.0
|
||||
*
|
||||
* Copyright (c) 2009 Jim Keller
|
||||
* Context - http://www.contextllc.com
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
*
|
||||
*/
|
||||
jQuery.fn.showLoading=function(e){var t,r={addClass:"",beforeShow:"",afterShow:"",hPos:"center",vPos:"center",indicatorZIndex:5001,overlayZIndex:5e3,parent:"",marginTop:0,marginLeft:0,overlayWidth:null,overlayHeight:null};jQuery.extend(r,e);var s=jQuery("<div></div>"),o=jQuery("<div></div>");t=r.indicatorID?r.indicatorID:jQuery(this).attr("id"),jQuery(s).attr("id","loading-indicator-"+t),jQuery(s).addClass("loading-indicator-ui"),r.addClass&&jQuery(s).addClass(r.addClass),jQuery(o).css("display","none"),jQuery(document.body).append(o),jQuery(o).attr("id","loading-indicator-"+t+"-overlay"),jQuery(o).addClass("loading-indicator-ui-overlay"),r.addClass&&jQuery(o).addClass(r.addClass+"-overlay");var i,a,n=jQuery(this).css("border-top-width"),d=jQuery(this).css("border-left-width");n=isNaN(parseInt(n))?0:n,d=isNaN(parseInt(d))?0:d;var y=jQuery(this).offset().left+parseInt(d),u=jQuery(this).offset().top+parseInt(n);i=null!==r.overlayWidth?r.overlayWidth:parseInt(jQuery(this).width())+parseInt(jQuery(this).css("padding-right"))+parseInt(jQuery(this).css("padding-left")),a=null!==r.overlayHeight?r.overlayWidth:parseInt(jQuery(this).height())+parseInt(jQuery(this).css("padding-top"))+parseInt(jQuery(this).css("padding-bottom")),jQuery(o).css("width",i.toString()+"px"),jQuery(o).css("height",a.toString()+"px"),jQuery(o).css("left",y.toString()+"px"),jQuery(o).css("position","absolute"),jQuery(o).css("top",u.toString()+"px"),jQuery(o).css("z-index",r.overlayZIndex),r.overlayCSS&&jQuery(o).css(r.overlayCSS),jQuery(s).css("display","none"),jQuery(document.body).append(s),jQuery(s).css("position","absolute"),jQuery(s).css("z-index",r.indicatorZIndex);var j=u;r.marginTop&&(j+=parseInt(r.marginTop));var p=y;r.marginLeft&&(p+=parseInt(r.marginTop)),"center"==r.hPos.toString().toLowerCase()?jQuery(s).css("left",(p+(jQuery(o).width()-parseInt(jQuery(s).width()))/2).toString()+"px"):"left"==r.hPos.toString().toLowerCase()?jQuery(s).css("left",(p+parseInt(jQuery(o).css("margin-left"))).toString()+"px"):"right"==r.hPos.toString().toLowerCase()?jQuery(s).css("left",(p+(jQuery(o).width()-parseInt(jQuery(s).width()))).toString()+"px"):jQuery(s).css("left",(p+parseInt(r.hPos)).toString()+"px"),"center"==r.vPos.toString().toLowerCase()?jQuery(s).css("top",(j+(jQuery(o).height()-parseInt(jQuery(s).height()))/2).toString()+"px"):"top"==r.vPos.toString().toLowerCase()?jQuery(s).css("top",j.toString()+"px"):"bottom"==r.vPos.toString().toLowerCase()?jQuery(s).css("top",(j+(jQuery(o).height()-parseInt(jQuery(s).height()))).toString()+"px"):jQuery(s).css("top",(j+parseInt(r.vPos)).toString()+"px"),r.css&&jQuery(s).css(r.css);var Q={overlay:o,indicator:s,element:this};return"function"==typeof r.beforeShow&&r.beforeShow(Q),jQuery(o).show(),jQuery(s).show(),"function"==typeof r.afterShow&&r.afterShow(Q),this},jQuery.fn.hideLoading=function(e){var t={};return jQuery.extend(t,e),indicatorID=t.indicatorID?t.indicatorID:jQuery(this).attr("id"),jQuery(document.body).find("#loading-indicator-"+indicatorID).remove(),jQuery(document.body).find("#loading-indicator-"+indicatorID+"-overlay").remove(),this};
|
429
include/javascript/jquery/jquery.sugarMenu.js
Executable file
|
@ -0,0 +1,429 @@
|
|||
/* This is a simple plugin to render action dropdown menus from html.
|
||||
* John Barlow - SugarCRM
|
||||
* add secondary popup implementation by Justin Park - SugarCRM
|
||||
*
|
||||
* The html structure it expects is as follows:
|
||||
*
|
||||
* <ul> - Menu root
|
||||
* <li> - First element in menu (visible)
|
||||
* <ul class="subnav"> - Popout menu (should start hidden)
|
||||
* <li></li> - \
|
||||
* ... - Elements in popout menu
|
||||
* <li></li> - /
|
||||
* <li>
|
||||
* <input></input> - element contains submenu
|
||||
* <ul class="subnav-sub"> - sub-popout menu (shown when mouseover on the above element)
|
||||
* <li></li> - \
|
||||
* ... - Elements in sub-popout menu
|
||||
* <li></li> - /
|
||||
* </ul>
|
||||
* </li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* </ul>
|
||||
*
|
||||
* By adding a class of "fancymenu" to the menu root, the plugin adds an additional "ab" class to the
|
||||
* dropdown handle, allowing you to make the menu "fancy" with additional css if you would like :)
|
||||
*
|
||||
* Functions:
|
||||
*
|
||||
* init: initializes things (called by default)... currently no options are passed
|
||||
*
|
||||
* Adds item to the menu at position index
|
||||
* addItem: (item, index)
|
||||
* item - created dom element or string that represents one
|
||||
* index(optional) - the position you want your new menuitem. If you leave this off,
|
||||
* the item is appended to the end of the list.
|
||||
* returns: nothing
|
||||
*
|
||||
* Finds an item in the menu (including the root node "outside" the ul structure).
|
||||
* findItem: (item)
|
||||
* item - string of the menu item you are looking for.
|
||||
* returns: index of element, or -1 if not found.
|
||||
*/
|
||||
(function ($) {
|
||||
var methods = {
|
||||
init: function (options) {
|
||||
|
||||
var menuNode = this;
|
||||
if (!this.hasClass("SugarActionMenu")) {
|
||||
//tag this element as a sugarmenu
|
||||
this.addClass("SugarActionMenu");
|
||||
|
||||
//Fix custom code buttons programatically to prevent metadata edits
|
||||
this.find("input[type='submit'], input[type='button']").each(function (idx, node) {
|
||||
var jNode = $(node);
|
||||
var parent = jNode.parent();
|
||||
var _subnav = menuNode.find("ul.subnav");
|
||||
var _timer_for_subnav = null;
|
||||
var disabled = $(this).prop('disabled');
|
||||
var newItem = $(document.createElement("li"));
|
||||
var newItemA = $(document.createElement("a"));
|
||||
var accesskey = jNode.attr("accesskey");
|
||||
var accesskey_el = $("<a></a>");
|
||||
|
||||
newItemA.html(jNode.val());
|
||||
if (!disabled) {
|
||||
newItemA.click(function (event) {
|
||||
if ($(this).hasClass("void") === false) {
|
||||
jNode.click();
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
newItemA.addClass("disabled");
|
||||
}
|
||||
newItemA.attr("id", jNode.attr("id"));
|
||||
accesskey_el.attr("id", jNode.attr("id") + "_accesskey");
|
||||
jNode.attr("id", jNode.attr("id") + "_old");
|
||||
|
||||
|
||||
if (accesskey !== undefined) {
|
||||
if ($('#' + accesskey_el.attr('id')).length === 0) {
|
||||
accesskey_el.attr("accesskey", accesskey).click(function () {
|
||||
jNode.click();
|
||||
}).appendTo("#content");
|
||||
}
|
||||
jNode.attr("accesskey", '');
|
||||
}
|
||||
|
||||
//make sure the node we found isn't the main item of the list -- we don't want
|
||||
//to show it then.
|
||||
if (menuNode.sugarActionMenu("findItem", newItemA.html()) == -1) {
|
||||
parent.prepend(newItemA);
|
||||
}
|
||||
|
||||
//make sub sliding menu
|
||||
jNode.siblings(".subnav-sub").each(function (idx, node) {
|
||||
var _menu = $(node);
|
||||
var _hide_menu = function () {
|
||||
if (_menu.hasClass("hover") === false)
|
||||
_menu.hide();
|
||||
};
|
||||
var _hide_timer = null;
|
||||
var _delay = 300;
|
||||
_menu.mouseover(function (evt) {
|
||||
if ($(this).hasClass("hover") === false)
|
||||
$(this).addClass("hover");
|
||||
}).mouseout(function (evt) {
|
||||
if ($(this).hasClass("hover"))
|
||||
$(this).removeClass("hover");
|
||||
if (_hide_timer)
|
||||
clearTimeout(_hide_timer);
|
||||
_hide_timer = setTimeout(_hide_menu, _delay);
|
||||
});
|
||||
|
||||
newItemA.mouseover(function (evt) {
|
||||
$("ul.SugarActionMenu ul.subnav-sub").each(function (index, node) {
|
||||
$(node).removeClass("hover");
|
||||
$(node).hide();
|
||||
});
|
||||
var _left = parent.offset().left + parent.width() - newItemA.css("paddingRight").replace("px", "");
|
||||
var _top = parent.offset().top - _menu.css("paddingTop").replace("px", "");
|
||||
_menu.css({
|
||||
left: _left,
|
||||
top: _top
|
||||
});
|
||||
if (_menu.hasClass("hover") === false)
|
||||
_menu.addClass("hover");
|
||||
if (_subnav.hasClass("subnav-sub-handler") === false)
|
||||
_subnav.addClass("subnav-sub-handler");
|
||||
_menu.show();
|
||||
}).mouseout(function (evt) {
|
||||
_menu.removeClass("hover");
|
||||
_subnav.removeClass("subnav-sub-handler")
|
||||
if (_hide_timer)
|
||||
clearTimeout(_hide_timer);
|
||||
_hide_timer = setTimeout(_hide_menu, _delay);
|
||||
}).click(function (evt) {
|
||||
if (_timer_for_subnav)
|
||||
clearTimeout(_timer_for_subnav);
|
||||
}).addClass("void");
|
||||
menuNode.append(_menu);
|
||||
});
|
||||
jNode.css("display", "none");
|
||||
});
|
||||
|
||||
//look for all subnavs and set them up
|
||||
this.find("ul.subnav").each(function (index, node) {
|
||||
var jNode = $(node);
|
||||
var parent = jNode.parent();
|
||||
var fancymenu = "";
|
||||
var slideUpSpeed = 1;
|
||||
var slideDownSpeed = 1;
|
||||
var dropDownHandle;
|
||||
|
||||
//if the dropdown handle doesn't exist, lets create it and
|
||||
//add it to the dom
|
||||
var foundSpanCount = parent.find("span.suitepicon-action-caret").length;
|
||||
if (foundSpanCount === 0) {
|
||||
|
||||
//create dropdown handle
|
||||
dropDownHandle = $(document.createElement("span"));
|
||||
dropDownHandle.addClass('suitepicon suitepicon-action-caret');
|
||||
parent.append(dropDownHandle);
|
||||
|
||||
} else if (foundSpanCount === 1) {
|
||||
dropDownHandle = $(parent.find("span"));
|
||||
} else {
|
||||
dropDownHandle = $(parent.find("span").first());
|
||||
}
|
||||
|
||||
var toggleDropDown = function () {
|
||||
//close all other open menus
|
||||
//restore the dom elements back by handling iefix
|
||||
$("ul.SugarActionMenu > li").each(function () {
|
||||
$(this).sugarActionMenu('IEfix');
|
||||
});
|
||||
$("ul.SugarActionMenu ul.subnav").each(function (subIndex, node) {
|
||||
var subjNode = $(node);
|
||||
if (!(subjNode[0] === jNode[0])) {
|
||||
subjNode.slideUp(slideUpSpeed);
|
||||
subjNode.removeClass("ddopen");
|
||||
}
|
||||
});
|
||||
if (jNode.hasClass("ddopen")) {
|
||||
parent.sugarActionMenu('IEfix');
|
||||
//Bug#50983: Popup the dropdown list above the arrow if the bottom part is cut off .
|
||||
var _animation = {
|
||||
'height': 0
|
||||
};
|
||||
if (jNode.hasClass("upper")) {
|
||||
_animation['top'] = (dropDownHandle.height() * -1);
|
||||
}
|
||||
jNode.animate(_animation, slideUpSpeed, function () {
|
||||
$(this).css({
|
||||
'height': '',
|
||||
'top': ''
|
||||
}).hide().removeClass("upper ddopen");
|
||||
});
|
||||
}
|
||||
else {
|
||||
//To support IE fixed size rendering,
|
||||
//parse out dom elements out of the fixed element
|
||||
parent.sugarActionMenu('IEfix', jNode);
|
||||
var _dropdown_height = jNode.height(),
|
||||
_animation = {'height': _dropdown_height},
|
||||
_dropdown_bottom = dropDownHandle.offset().top + dropDownHandle.height() - $(document).scrollTop() + jNode.outerHeight(),
|
||||
_win_height = $(window).height();
|
||||
if (dropDownHandle.offset().top > jNode.height() && _dropdown_bottom > $(window).height()) {
|
||||
jNode.css('top', (dropDownHandle.height() * -1)).addClass("upper");
|
||||
_animation['top'] = (jNode.height() + dropDownHandle.height()) * -1;
|
||||
}
|
||||
|
||||
jNode.height(0).show().animate(_animation, slideDownSpeed, function () {
|
||||
$(this).css('height', '');
|
||||
setTimeout(function () {
|
||||
// $('.subnav.ddopen').each(function (i, e) {
|
||||
// if (!$(e).hasClass('upper')) {
|
||||
// $(e).css('top', parseInt($(e).css('top')) + 10 + 'px');
|
||||
// }
|
||||
// })
|
||||
}, 2);
|
||||
});
|
||||
jNode.addClass("ddopen");
|
||||
}
|
||||
};
|
||||
|
||||
//add click handler to handle
|
||||
dropDownHandle.click(function (event) {
|
||||
toggleDropDown();
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
var parentDropDownHandler = parent.find('a').first().hasClass('parent-dropdown-handler');
|
||||
if (parentDropDownHandler) {
|
||||
parent.click(function (event) {
|
||||
dropDownHandle.click();
|
||||
event.stopPropagation();
|
||||
});
|
||||
}
|
||||
|
||||
//add submenu click off to body
|
||||
var jBody = $("body");
|
||||
var _hide_subnav_delay = 30;
|
||||
var _hide_subnav = function (subnav) {
|
||||
if (subnav.hasClass("subnav-sub-handler") === false) {
|
||||
subnav.slideUp(slideUpSpeed);
|
||||
subnav.removeClass("ddopen");
|
||||
}
|
||||
}
|
||||
if (jBody.data("sugarActionMenu") != true) {
|
||||
jBody.data("sugarActionMenu", true);
|
||||
jBody.bind("click", function () {
|
||||
//retore the dom elements back by handling iefix
|
||||
$("ul.SugarActionMenu > li").each(function () {
|
||||
$(this).sugarActionMenu('IEfix');
|
||||
});
|
||||
|
||||
$("ul.SugarActionMenu ul.subnav").each(function (subIndex, node) {
|
||||
//prevent hiding the submenu when user click the submenu which contains one more depth submenu
|
||||
var _hide = function () {
|
||||
_hide_subnav($(node));
|
||||
}
|
||||
setTimeout(_hide, _hide_subnav_delay);
|
||||
});
|
||||
//Hide second depth submenu
|
||||
$("ul.SugarActionMenu ul.subnav-sub").each(function (subIndex, node) {
|
||||
var _hide = function () {
|
||||
$(this).removeClass("hover");
|
||||
$(this).hide();
|
||||
}
|
||||
_timer_for_subnav = setTimeout(_hide, _hide_subnav_delay);
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
//add hover handler to handle
|
||||
dropDownHandle.hover(function () {
|
||||
dropDownHandle.addClass("subhover");
|
||||
}, function () {
|
||||
dropDownHandle.removeClass("subhover");
|
||||
});
|
||||
|
||||
|
||||
//bind click event to submenu items to hide the menu on click
|
||||
jNode.find("li").each(function (index, subnode) {
|
||||
//prevent hiding the submenu when user click the submenu which contains one more depth submenu
|
||||
$(subnode).bind("click", function (evt) {
|
||||
var _hide = function () {
|
||||
_hide_subnav(jNode);
|
||||
}
|
||||
setTimeout(_hide, _hide_subnav_delay);
|
||||
});
|
||||
});
|
||||
|
||||
//fix up text of <a> tags so they span correctly
|
||||
jNode.find("a").each(function (index, subnode) {
|
||||
$(subnode).html(function (index, oldhtml) {
|
||||
return oldhtml.replace(" ", " ");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
//Bug#51579: delete li tags which contains empty due to access role
|
||||
this.find(".subnav > li").each(function (index, subnode) {
|
||||
if ($(subnode).html().replace(/ /g, '') == '') {
|
||||
$(subnode).remove();
|
||||
}
|
||||
});
|
||||
//Bug#51579: If the first item is empty due to the access role,
|
||||
// replace the first button from the first of the sub-list items.
|
||||
this.find("li.sugar_action_button:first").each(function (index, node) {
|
||||
var _this = $(node);
|
||||
var _first_item = $(node).find("a:first").not($(node).find(".subnav > li a"));
|
||||
if (_first_item.length == 0) {
|
||||
var sub_items = $(node).find(".subnav > li:first").children();
|
||||
if (sub_items.length == 0)
|
||||
menuNode.hide();
|
||||
else
|
||||
_this.prepend(sub_items);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
return this;
|
||||
},
|
||||
addItem: function (args) {
|
||||
if (args.index == null) {
|
||||
this.find("ul.subnav").each(function (index, node) {
|
||||
$(node).append(args.item);
|
||||
})
|
||||
}
|
||||
else {
|
||||
this.find("ul.subnav").find("li").each(function (index, node) {
|
||||
if (args.index == index + 1) {
|
||||
$(node).before(args.item);
|
||||
}
|
||||
});
|
||||
}
|
||||
return this;
|
||||
},
|
||||
findItem: function (item) {
|
||||
var index = -1;
|
||||
this.find("a").each(function (idx, node) {
|
||||
var jNode = $(node);
|
||||
if ($.trim(jNode.html()) == $.trim(item)) {
|
||||
index = idx;
|
||||
}
|
||||
});
|
||||
return index;
|
||||
},
|
||||
/**
|
||||
* To support IE fixed size rendering,
|
||||
* parse out dom elements out of the fixed element
|
||||
*
|
||||
* Prepare ===
|
||||
* <div style=position:fixed>
|
||||
* ...
|
||||
* <li jquery-attached>
|
||||
* <ul style=position:absoulte>
|
||||
* ...
|
||||
* </ul>
|
||||
* </li>
|
||||
* </div>
|
||||
*
|
||||
* Application ===
|
||||
* <div style=position:fixed>
|
||||
* <li ul-child-id='auto-evaluted-id'>
|
||||
* ...
|
||||
* </li>
|
||||
* </div>
|
||||
*
|
||||
* <ul id='auto-evaluted-id' style=position:fix;left/right/top-positioning:auto-calculated>
|
||||
* ...
|
||||
* </ul>
|
||||
* @param this - element container which is inside the fixed box model
|
||||
* @param $ul - dropdown box model which needs to render out of the fixed box range
|
||||
* if $ul is not given, it will restore back to the original structure
|
||||
*/
|
||||
IEfix: function ($ul) {
|
||||
if ($ul) {
|
||||
if ($ul.hasClass('iefixed') === false)
|
||||
return;
|
||||
this.each(function () {
|
||||
SUGAR.themes.counter = SUGAR.themes.counter ? SUGAR.themes.counter++ : 1;
|
||||
var $$ = $(this),
|
||||
_id = $$.attr("ul-child-id") ? $$.attr("ul-child-id") : ($$.parent('.SugarActionMenu').attr("id")) ? $$.parent('.SugarActionMenu').attr("id") + 'Subnav' : 'sugaractionmenu' + SUGAR.themes.counter,
|
||||
_top = $$.position().top + $$.outerHeight(),
|
||||
_width = 'auto', //to obtain a certain size, apply min-width in css
|
||||
_css = {
|
||||
top: _top,
|
||||
width: _width,
|
||||
position: 'fixed'
|
||||
},
|
||||
_right = $('body').width() - $$.offset().left - $$.width(),
|
||||
_left = $$.offset().left;
|
||||
//fixed positioning depends on the css property
|
||||
if ($ul.css('right') != 'auto') {
|
||||
_css['right'] = _right;
|
||||
} else {
|
||||
_css['left'] = _left;
|
||||
}
|
||||
$('body').append($ul.attr("id", _id).addClass("SugarActionMenuIESub").css(_css));
|
||||
$$.attr("ul-child-id", _id);
|
||||
});
|
||||
|
||||
} else {
|
||||
this.each(function () {
|
||||
var _id = $(this).attr("ul-child-id");
|
||||
$(this).append($("body>#" + _id).removeClass("SugarActionMenuIESub"));
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$.fn.sugarActionMenu = function (method) {
|
||||
|
||||
if (methods[method]) {
|
||||
return methods[method].apply(this, Array.prototype.slice.call(
|
||||
arguments, 1));
|
||||
} else if (typeof method === 'object' || !method) {
|
||||
return methods.init.apply(this, arguments);
|
||||
} else {
|
||||
$.error('Method ' + method + ' does not exist on jQuery.tooltip');
|
||||
}
|
||||
}
|
||||
})(jQuery);
|
9
include/javascript/jquery/jquery.superfish.js
Executable file
|
@ -0,0 +1,9 @@
|
|||
/*
|
||||
* jQuery Superfish Menu Plugin
|
||||
* Copyright (c) 2013 Joel Birch
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*/
|
||||
!function(e,s){"use strict";var n=function(){var n={bcClass:"sf-breadcrumb",menuClass:"sf-js-enabled",anchorClass:"sf-with-ul",menuArrowClass:"sf-arrows"},o=function(){var n=/iPhone|iPad|iPod/i.test(navigator.userAgent);return n&&e(s).load(function(){e("body").children().on("click",e.noop)}),n}(),t=function(){var e=document.documentElement.style;return"behavior"in e&&"fill"in e&&/iemobile/i.test(navigator.userAgent)}(),i=function(){return!!s.PointerEvent}(),r=function(e,s){var o=n.menuClass;s.cssArrows&&(o+=" "+n.menuArrowClass),e.toggleClass(o)},a=function(s,o){return s.find("li."+o.pathClass).slice(0,o.pathLevels).addClass(o.hoverClass+" "+n.bcClass).filter(function(){return e(this).children(o.popUpSelector).hide().show().length}).removeClass(o.pathClass)},l=function(e){e.children("a").toggleClass(n.anchorClass)},h=function(e){var s=e.css("ms-touch-action"),n=e.css("touch-action");n=n||s,n="pan-y"===n?"auto":"pan-y",e.css({"ms-touch-action":n,"touch-action":n})},u=function(s,n){var r="li:has("+n.popUpSelector+")";e.fn.hoverIntent&&!n.disableHI?s.hoverIntent(c,f,r):s.on("mouseenter.superfish",r,c).on("mouseleave.superfish",r,f);var a="MSPointerDown.superfish";i&&(a="pointerdown.superfish"),o||(a+=" touchend.superfish"),t&&(a+=" mousedown.superfish"),s.on("focusin.superfish","li",c).on("focusout.superfish","li",f).on(a,"a",n,p)},p=function(s){var n=e(this),o=n.siblings(s.data.popUpSelector);o.length>0&&o.is(":hidden")&&(n.one("click.superfish",!1),"MSPointerDown"===s.type||"pointerdown"===s.type?n.trigger("focus"):e.proxy(c,n.parent("li"))())},c=function(){var s=e(this),n=m(s);clearTimeout(n.sfTimer),s.siblings().superfish("hide").end().superfish("show")},f=function(){var s=e(this),n=m(s);o?e.proxy(d,s,n)():(clearTimeout(n.sfTimer),n.sfTimer=setTimeout(e.proxy(d,s,n),n.delay))},d=function(s){s.retainPath=e.inArray(this[0],s.$path)>-1,this.superfish("hide"),this.parents("."+s.hoverClass).length||(s.onIdle.call(v(this)),s.$path.length&&e.proxy(c,s.$path)())},v=function(e){return e.closest("."+n.menuClass)},m=function(e){return v(e).data("sf-options")};return{hide:function(s){if(this.length){var n=this,o=m(n);if(!o)return this;var t=o.retainPath===!0?o.$path:"",i=n.find("li."+o.hoverClass).add(this).not(t).removeClass(o.hoverClass).children(o.popUpSelector),r=o.speedOut;s&&(i.show(),r=0),o.retainPath=!1,o.onBeforeHide.call(i),i.stop(!0,!0).animate(o.animationOut,r,function(){var s=e(this);o.onHide.call(s)})}return this},show:function(){var e=m(this);if(!e)return this;var s=this.addClass(e.hoverClass),n=s.children(e.popUpSelector);return e.onBeforeShow.call(n),n.stop(!0,!0).animate(e.animation,e.speed,function(){e.onShow.call(n)}),this},destroy:function(){return this.each(function(){var s,o=e(this),t=o.data("sf-options");return t?(s=o.find(t.popUpSelector).parent("li"),clearTimeout(t.sfTimer),r(o,t),l(s),h(o),o.off(".superfish").off(".hoverIntent"),s.children(t.popUpSelector).attr("style",function(e,s){return s.replace(/display[^;]+;?/g,"")}),t.$path.removeClass(t.hoverClass+" "+n.bcClass).addClass(t.pathClass),o.find("."+t.hoverClass).removeClass(t.hoverClass),t.onDestroy.call(o),void o.removeData("sf-options")):!1})},init:function(s){return this.each(function(){var o=e(this);if(o.data("sf-options"))return!1;var t=e.extend({},e.fn.superfish.defaults,s),i=o.find(t.popUpSelector).parent("li");t.$path=a(o,t),o.data("sf-options",t),r(o,t),l(i),h(o),u(o,t),i.not("."+n.bcClass).superfish("hide",!0),t.onInit.call(this)})}}}();e.fn.superfish=function(s){return n[s]?n[s].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof s&&s?e.error("Method "+s+" does not exist on jQuery.fn.superfish"):n.init.apply(this,arguments)},e.fn.superfish.defaults={popUpSelector:"ul,.sf-mega",hoverClass:"sfHover",pathClass:"overrideThisToUse",pathLevels:1,delay:800,animation:{opacity:"show"},animationOut:{opacity:"hide"},speed:"normal",speedOut:"fast",cssArrows:!0,disableHI:!1,onInit:e.noop,onBeforeShow:e.noop,onShow:e.noop,onBeforeHide:e.noop,onHide:e.noop,onIdle:e.noop,onDestroy:e.noop}}(jQuery,window);
|
21
include/javascript/jquery/jquery.tipTip.js
Executable file
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* TipTip
|
||||
* Copyright 2010 Drew Wilson
|
||||
* www.drewwilson.com
|
||||
* code.drewwilson.com/entry/tiptip-jquery-plugin
|
||||
*
|
||||
* Version 1.3 - Updated: Mar. 23, 2010
|
||||
*
|
||||
* This Plug-In will create a custom tooltip to replace the default
|
||||
* browser tooltip. It is extremely lightweight and very smart in
|
||||
* that it detects the edges of the browser window and will make sure
|
||||
* the tooltip stays within the current window size. As a result the
|
||||
* tooltip will adjust itself to be displayed above, below, to the left
|
||||
* or to the right depending on what is necessary to stay within the
|
||||
* browser window. It is completely customizable as well via CSS.
|
||||
*
|
||||
* This TipTip jQuery plug-in is dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*/
|
||||
(function($){$.fn.tipTip=function(options){var defaults={activation:"hover",keepAlive:false,maxWidth:"200px",edgeOffset:3,defaultPosition:"bottom",delay:400,fadeIn:200,fadeOut:200,attribute:"title",content:false,enter:function(){},exit:function(){}};var opts=$.extend(defaults,options);if($("#tiptip_holder").length<=0){var tiptip_holder=$('<div id="tiptip_holder" style="max-width:'+opts.maxWidth+';"></div>');var tiptip_content=$('<div id="tiptip_content"></div>');var tiptip_arrow=$('<div id="tiptip_arrow"></div>');$("body").append(tiptip_holder.html(tiptip_content).prepend(tiptip_arrow.html('<div id="tiptip_arrow_inner"></div>')))}else{var tiptip_holder=$("#tiptip_holder");var tiptip_content=$("#tiptip_content");var tiptip_arrow=$("#tiptip_arrow")}return this.each(function(){var org_elem=$(this);if(opts.content){var org_title=opts.content}else{var org_title=org_elem.attr(opts.attribute)}if(org_title!=""){if(!opts.content){org_elem.removeAttr(opts.attribute)}var timeout=false;if(opts.activation=="hover"){org_elem.hover(function(){active_tiptip()},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}else if(opts.activation=="focus"){org_elem.focus(function(){active_tiptip()}).blur(function(){deactive_tiptip()})}else if(opts.activation=="click"){org_elem.click(function(){active_tiptip();return false}).hover(function(){},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}function active_tiptip(){opts.enter.call(this);tiptip_content.html(org_title);tiptip_holder.hide().removeAttr("class").css("margin","0");tiptip_arrow.removeAttr("style");var top=parseInt(org_elem.offset()['top']);var left=parseInt(org_elem.offset()['left']);var org_width=parseInt(org_elem.outerWidth());var org_height=parseInt(org_elem.outerHeight());var tip_w=tiptip_holder.outerWidth();var tip_h=tiptip_holder.outerHeight();var w_compare=Math.round((org_width-tip_w)/2);var h_compare=Math.round((org_height-tip_h)/2);var marg_left=Math.round(left+w_compare);var marg_top=Math.round(top+org_height+opts.edgeOffset);var t_class="";var arrow_top="";var arrow_left=Math.round(tip_w-12)/2;if(opts.defaultPosition=="bottom"){t_class="_bottom"}else if(opts.defaultPosition=="top"){t_class="_top"}else if(opts.defaultPosition=="left"){t_class="_left"}else if(opts.defaultPosition=="right"){t_class="_right"}var right_compare=(w_compare+left)<parseInt($(window).scrollLeft());var left_compare=(tip_w+left)>parseInt($(window).width());if((right_compare&&w_compare<0)||(t_class=="_right"&&!left_compare)||(t_class=="_left"&&left<(tip_w+opts.edgeOffset+5))){t_class="_right";arrow_top=Math.round(tip_h-13)/2;arrow_left=-12;marg_left=Math.round(left+org_width+opts.edgeOffset);marg_top=Math.round(top+h_compare)}else if((left_compare&&w_compare<0)||(t_class=="_left"&&!right_compare)){t_class="_left";arrow_top=Math.round(tip_h-13)/2;arrow_left=Math.round(tip_w);marg_left=Math.round(left-(tip_w+opts.edgeOffset+5));marg_top=Math.round(top+h_compare)}var top_compare=(top+org_height+opts.edgeOffset+tip_h+8)>parseInt($(window).height()+$(window).scrollTop());var bottom_compare=((top+org_height)-(opts.edgeOffset+tip_h+8))<0;if(top_compare||(t_class=="_bottom"&&top_compare)||(t_class=="_top"&&!bottom_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_top"}else{t_class=t_class+"_top"}arrow_top=tip_h;marg_top=Math.round(top-(tip_h+5+opts.edgeOffset))}else if(bottom_compare|(t_class=="_top"&&bottom_compare)||(t_class=="_bottom"&&!top_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_bottom"}else{t_class=t_class+"_bottom"}arrow_top=-12;marg_top=Math.round(top+org_height+opts.edgeOffset)}if(t_class=="_right_top"||t_class=="_left_top"){marg_top=marg_top+5}else if(t_class=="_right_bottom"||t_class=="_left_bottom"){marg_top=marg_top-5}if(t_class=="_left_top"||t_class=="_left_bottom"){marg_left=marg_left+5}tiptip_arrow.css({"margin-left":arrow_left+"px","margin-top":arrow_top+"px"});tiptip_holder.css({"margin-left":marg_left+"px","margin-top":marg_top+"px"}).attr("class","tip"+t_class);if(timeout){clearTimeout(timeout)}timeout=setTimeout(function(){tiptip_holder.stop(true,true).fadeIn(opts.fadeIn)},opts.delay)}function deactive_tiptip(){opts.exit.call(this);if(timeout){clearTimeout(timeout)}tiptip_holder.fadeOut(opts.fadeOut)}}})}})(jQuery);
|
11
include/javascript/jquery/jquery.ui.touch-punch.min.js
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
/*!
|
||||
* jQuery UI Touch Punch 0.2.3
|
||||
*
|
||||
* Copyright 2011–2014, Dave Furfero
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
*
|
||||
* Depends:
|
||||
* jquery.ui.widget.js
|
||||
* jquery.ui.mouse.js
|
||||
*/
|
||||
!function(a){function f(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery);
|
611
include/javascript/jquery/markitup/jquery.markitup.js
Executable file
|
@ -0,0 +1,611 @@
|
|||
// ----------------------------------------------------------------------------
|
||||
// markItUp! Universal MarkUp Engine, JQuery plugin
|
||||
// v 1.1.x
|
||||
// Dual licensed under the MIT and GPL licenses.
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright (C) 2007-2011 Jay Salvat
|
||||
// http://markitup.jaysalvat.com/
|
||||
// ----------------------------------------------------------------------------
|
||||
// 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.
|
||||
// ----------------------------------------------------------------------------
|
||||
/*
|
||||
Modified on 4-26-12 by SugarCRM
|
||||
get and insert functions modifed for better IE8 compatibility.
|
||||
Various global varaible cleanups
|
||||
*/
|
||||
(function($) {
|
||||
$.fn.markItUp = function(settings, extraSettings) {
|
||||
var options, ctrlKey, shiftKey, altKey, selection, caretPosition;
|
||||
ctrlKey = shiftKey = altKey = false;
|
||||
|
||||
options = { id: '',
|
||||
nameSpace: '',
|
||||
root: '',
|
||||
previewInWindow: '', // 'width=800, height=600, resizable=yes, scrollbars=yes'
|
||||
previewAutoRefresh: true,
|
||||
previewPosition: 'after',
|
||||
previewTemplatePath: '~/templates/preview.html',
|
||||
previewParser: false,
|
||||
previewParserPath: '',
|
||||
previewParserVar: 'data',
|
||||
resizeHandle: true,
|
||||
beforeInsert: '',
|
||||
afterInsert: '',
|
||||
onEnter: {},
|
||||
onShiftEnter: {},
|
||||
onCtrlEnter: {},
|
||||
onTab: {},
|
||||
markupSet: [ { /* set */ } ]
|
||||
};
|
||||
$.extend(options, settings, extraSettings);
|
||||
|
||||
// compute markItUp! path
|
||||
if (!options.root) {
|
||||
$('script').each(function(a, tag) {
|
||||
var miuScript = $(tag).get(0).src.match(/(.*)jquery\.markitup(\.pack)?\.js$/);
|
||||
if (miuScript !== null) {
|
||||
options.root = miuScript[1];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return this.each(function() {
|
||||
var $$, textarea, levels, scrollPosition, caretPosition, caretOffset,
|
||||
clicked, hash, header, footer, previewWindow, template, iFrame, abort;
|
||||
$$ = $(this);
|
||||
textarea = this;
|
||||
levels = [];
|
||||
abort = false;
|
||||
scrollPosition = caretPosition = 0;
|
||||
caretOffset = -1;
|
||||
|
||||
options.previewParserPath = localize(options.previewParserPath);
|
||||
options.previewTemplatePath = localize(options.previewTemplatePath);
|
||||
|
||||
// apply the computed path to ~/
|
||||
function localize(data, inText) {
|
||||
if (inText) {
|
||||
return data.replace(/("|')~\//g, "$1"+options.root);
|
||||
}
|
||||
return data.replace(/^~\//, options.root);
|
||||
}
|
||||
|
||||
// init and build editor
|
||||
function init() {
|
||||
id = ''; nameSpace = '';
|
||||
if (options.id) {
|
||||
id = 'id="'+options.id+'"';
|
||||
} else if ($$.attr("id")) {
|
||||
id = 'id="markItUp'+($$.attr("id").substr(0, 1).toUpperCase())+($$.attr("id").substr(1))+'"';
|
||||
|
||||
}
|
||||
if (options.nameSpace) {
|
||||
nameSpace = 'class="'+options.nameSpace+'"';
|
||||
}
|
||||
$$.wrap('<div '+nameSpace+'></div>');
|
||||
$$.wrap('<div '+id+' class="markItUp"></div>');
|
||||
$$.wrap('<div class="markItUpContainer"></div>');
|
||||
$$.addClass("markItUpEditor");
|
||||
|
||||
// add the header before the textarea
|
||||
header = $('<div class="markItUpHeader"></div>').insertBefore($$);
|
||||
$(dropMenus(options.markupSet)).appendTo(header);
|
||||
|
||||
// add the footer after the textarea
|
||||
footer = $('<div class="markItUpFooter"></div>').insertAfter($$);
|
||||
|
||||
// add the resize handle after textarea
|
||||
if (options.resizeHandle === true && $.browser.safari !== true) {
|
||||
var resizeHandle = $('<div class="markItUpResizeHandle"></div>')
|
||||
.insertAfter($$)
|
||||
.bind("mousedown", function(e) {
|
||||
var h = $$.height(), y = e.clientY, mouseMove, mouseUp;
|
||||
mouseMove = function(e) {
|
||||
$$.css("height", Math.max(20, e.clientY+h-y)+"px");
|
||||
return false;
|
||||
};
|
||||
mouseUp = function(e) {
|
||||
$("html").unbind("mousemove", mouseMove).unbind("mouseup", mouseUp);
|
||||
return false;
|
||||
};
|
||||
$("html").bind("mousemove", mouseMove).bind("mouseup", mouseUp);
|
||||
});
|
||||
footer.append(resizeHandle);
|
||||
}
|
||||
|
||||
// listen key events
|
||||
$$.keydown(keyPressed).keyup(keyPressed);
|
||||
|
||||
// bind an event to catch external calls
|
||||
$$.bind("insertion", function(e, settings) {
|
||||
if (settings.target !== false) {
|
||||
get();
|
||||
}
|
||||
if (textarea === $.markItUp.focused) {
|
||||
markup(settings);
|
||||
}
|
||||
});
|
||||
|
||||
// remember the last focus
|
||||
$$.focus(function() {
|
||||
$.markItUp.focused = this;
|
||||
});
|
||||
}
|
||||
|
||||
// recursively build header with dropMenus from markupset
|
||||
function dropMenus(markupSet) {
|
||||
var ul = $('<ul></ul>'), i = 0;
|
||||
$('li:hover > ul', ul).css('display', 'block');
|
||||
$.each(markupSet, function() {
|
||||
var button = this, t = '', title, li, j, key;
|
||||
title = (button.key) ? (button.name||'')+' [Ctrl+'+button.key+']' : (button.name||'');
|
||||
key = (button.key) ? 'accesskey="'+button.key+'"' : '';
|
||||
if (button.separator) {
|
||||
li = $('<li class="markItUpSeparator">'+(button.separator||'')+'</li>').appendTo(ul);
|
||||
} else {
|
||||
i++;
|
||||
for (j = levels.length -1; j >= 0; j--) {
|
||||
t += levels[j]+"-";
|
||||
}
|
||||
li = $('<li class="markItUpButton markItUpButton'+t+(i)+' '+(button.className||'')+'"><a href="" '+key+' title="'+title+'">'+(button.name||'')+'</a></li>')
|
||||
.bind("contextmenu", function() { // prevent contextmenu on mac and allow ctrl+click
|
||||
return false;
|
||||
}).click(function() {
|
||||
return false;
|
||||
}).bind("focusin", function(){
|
||||
$$.focus();
|
||||
}).mouseup(function() {
|
||||
if (button.call) {
|
||||
eval(button.call)();
|
||||
}
|
||||
setTimeout(function() { markup(button) },1);
|
||||
return false;
|
||||
}).hover(function() {
|
||||
$('> ul', this).show();
|
||||
$(document).one('click', function() { // close dropmenu if click outside
|
||||
$('ul ul', header).hide();
|
||||
}
|
||||
);
|
||||
}, function() {
|
||||
$('> ul', this).hide();
|
||||
}
|
||||
).appendTo(ul);
|
||||
if (button.dropMenu) {
|
||||
levels.push(i);
|
||||
$(li).addClass('markItUpDropMenu').append(dropMenus(button.dropMenu));
|
||||
}
|
||||
}
|
||||
});
|
||||
levels.pop();
|
||||
return ul;
|
||||
}
|
||||
|
||||
// markItUp! markups
|
||||
function magicMarkups(string) {
|
||||
if (string) {
|
||||
string = string.toString();
|
||||
string = string.replace(/\(\!\(([\s\S]*?)\)\!\)/g,
|
||||
function(x, a) {
|
||||
var b = a.split('|!|');
|
||||
if (altKey === true) {
|
||||
return (b[1] !== undefined) ? b[1] : b[0];
|
||||
} else {
|
||||
return (b[1] === undefined) ? "" : b[0];
|
||||
}
|
||||
}
|
||||
);
|
||||
// [![prompt]!], [![prompt:!:value]!]
|
||||
string = string.replace(/\[\!\[([\s\S]*?)\]\!\]/g,
|
||||
function(x, a) {
|
||||
var b = a.split(':!:');
|
||||
if (abort === true) {
|
||||
return false;
|
||||
}
|
||||
value = prompt(b[0], (b[1]) ? b[1] : '');
|
||||
if (value === null) {
|
||||
abort = true;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
);
|
||||
return string;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
// prepare action
|
||||
function prepare(action) {
|
||||
if ($.isFunction(action)) {
|
||||
action = action(hash);
|
||||
}
|
||||
return magicMarkups(action);
|
||||
}
|
||||
|
||||
// build block to insert
|
||||
function build(string) {
|
||||
var block, line;
|
||||
var openWith = prepare(clicked.openWith);
|
||||
var placeHolder = prepare(clicked.placeHolder);
|
||||
var replaceWith = prepare(clicked.replaceWith);
|
||||
var closeWith = prepare(clicked.closeWith);
|
||||
var openBlockWith = prepare(clicked.openBlockWith);
|
||||
var closeBlockWith = prepare(clicked.closeBlockWith);
|
||||
var multiline = clicked.multiline;
|
||||
|
||||
if (replaceWith !== "") {
|
||||
block = openWith + replaceWith + closeWith;
|
||||
} else if (selection === '' && placeHolder !== '') {
|
||||
block = openWith + placeHolder + closeWith;
|
||||
} else {
|
||||
string = string || selection;
|
||||
|
||||
var lines = selection.split(/\r?\n/), blocks = [];
|
||||
|
||||
for (var l=0; l < lines.length; l++) {
|
||||
line = lines[l];
|
||||
var trailingSpaces;
|
||||
if (trailingSpaces = line.match(/ *$/)) {
|
||||
blocks.push(openWith + line.replace(/ *$/g, '') + closeWith + trailingSpaces);
|
||||
} else {
|
||||
blocks.push(openWith + line + closeWith);
|
||||
}
|
||||
}
|
||||
|
||||
block = blocks.join("\n");
|
||||
}
|
||||
|
||||
block = openBlockWith + block + closeBlockWith;
|
||||
|
||||
return { block:block,
|
||||
openWith:openWith,
|
||||
replaceWith:replaceWith,
|
||||
placeHolder:placeHolder,
|
||||
closeWith:closeWith
|
||||
};
|
||||
}
|
||||
|
||||
// define markup to insert
|
||||
function markup(button) {
|
||||
var len, j, n, i, lines, string, start;
|
||||
hash = clicked = button;
|
||||
get();
|
||||
$.extend(hash, { line:"",
|
||||
root:options.root,
|
||||
textarea:textarea,
|
||||
selection:(selection||''),
|
||||
caretPosition:caretPosition,
|
||||
ctrlKey:ctrlKey,
|
||||
shiftKey:shiftKey,
|
||||
altKey:altKey
|
||||
}
|
||||
);
|
||||
// callbacks before insertion
|
||||
prepare(options.beforeInsert);
|
||||
prepare(clicked.beforeInsert);
|
||||
if ((ctrlKey === true && shiftKey === true) || button.multiline === true) {
|
||||
prepare(clicked.beforeMultiInsert);
|
||||
}
|
||||
$.extend(hash, { line:1 });
|
||||
|
||||
if ((ctrlKey === true && shiftKey === true)) {
|
||||
lines = selection.split(/\r?\n/);
|
||||
for (j = 0, n = lines.length, i = 0; i < n; i++) {
|
||||
if ($.trim(lines[i]) !== '') {
|
||||
$.extend(hash, { line:++j, selection:lines[i] } );
|
||||
lines[i] = build(lines[i]).block;
|
||||
} else {
|
||||
lines[i] = "";
|
||||
}
|
||||
}
|
||||
string = { block:lines.join('\n')};
|
||||
start = caretPosition;
|
||||
len = string.block.length + (($.browser.opera) ? n-1 : 0);
|
||||
} else if (ctrlKey === true) {
|
||||
string = build(selection);
|
||||
start = caretPosition + string.openWith.length;
|
||||
len = string.block.length - string.openWith.length - string.closeWith.length;
|
||||
len = len - (string.block.match(/ $/) ? 1 : 0);
|
||||
len -= fixIeBug(string.block);
|
||||
} else if (shiftKey === true) {
|
||||
string = build(selection);
|
||||
start = caretPosition;
|
||||
len = string.block.length;
|
||||
len -= fixIeBug(string.block);
|
||||
} else {
|
||||
string = build(selection);
|
||||
start = caretPosition + string.block.length ;
|
||||
len = 0;
|
||||
start -= fixIeBug(string.block);
|
||||
}
|
||||
if ((selection === '' && string.replaceWith === '')) {
|
||||
caretOffset += fixOperaBug(string.block);
|
||||
|
||||
start = caretPosition + string.openWith.length;
|
||||
len = string.block.length - string.openWith.length - string.closeWith.length;
|
||||
|
||||
caretOffset = $$.val().substring(caretPosition, $$.val().length).length;
|
||||
caretOffset -= fixOperaBug($$.val().substring(0, caretPosition));
|
||||
}
|
||||
$.extend(hash, { caretPosition:caretPosition, scrollPosition:scrollPosition } );
|
||||
|
||||
if (string.block !== selection && abort === false) {
|
||||
insert(string.block);
|
||||
set(start, len);
|
||||
} else {
|
||||
caretOffset = -1;
|
||||
}
|
||||
get();
|
||||
|
||||
$.extend(hash, { line:'', selection:selection });
|
||||
|
||||
// callbacks after insertion
|
||||
if ((ctrlKey === true && shiftKey === true) || button.multiline === true) {
|
||||
prepare(clicked.afterMultiInsert);
|
||||
}
|
||||
prepare(clicked.afterInsert);
|
||||
prepare(options.afterInsert);
|
||||
|
||||
// refresh preview if opened
|
||||
if (previewWindow && options.previewAutoRefresh) {
|
||||
refreshPreview();
|
||||
}
|
||||
|
||||
// reinit keyevent
|
||||
shiftKey = altKey = ctrlKey = abort = false;
|
||||
}
|
||||
|
||||
// Substract linefeed in Opera
|
||||
function fixOperaBug(string) {
|
||||
if ($.browser.opera) {
|
||||
return string.length - string.replace(/\n*/g, '').length;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
// Substract linefeed in IE
|
||||
function fixIeBug(string) {
|
||||
if ($.browser.msie) {
|
||||
return string.length - string.replace(/\r*/g, '').length;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// add markup
|
||||
function insert(block) {
|
||||
textarea.value = textarea.value.substring(0, caretPosition) + block
|
||||
+ textarea.value.substring(caretPosition + selection.length, textarea.value.length);
|
||||
}
|
||||
|
||||
// set a selection
|
||||
function set(start, len) {
|
||||
var range;
|
||||
if (textarea.createTextRange){
|
||||
// quick fix to make it work on Opera 9.5
|
||||
if ($.browser.opera && $.browser.version >= 9.5 && len == 0) {
|
||||
return false;
|
||||
}
|
||||
range = textarea.createTextRange();
|
||||
range.collapse(true);
|
||||
range.moveStart('character', start);
|
||||
range.moveEnd('character', len);
|
||||
range.select();
|
||||
} else if (textarea.setSelectionRange ){
|
||||
textarea.setSelectionRange(start, start + len);
|
||||
}
|
||||
textarea.scrollTop = scrollPosition;
|
||||
textarea.focus();
|
||||
}
|
||||
|
||||
// get the selection
|
||||
function get() {
|
||||
textarea.focus();
|
||||
|
||||
scrollPosition = textarea.scrollTop;
|
||||
if (document.selection) {
|
||||
selection = document.selection.createRange().text;
|
||||
if ($.browser.msie) { // ie
|
||||
var range = document.selection.createRange(),
|
||||
rangeCopy = range.duplicate();
|
||||
//If nothing is selected, we have to use a different technique to find the caret position
|
||||
if (document.selection.type =="None")
|
||||
{
|
||||
var sel = range;
|
||||
range = textarea.createTextRange();
|
||||
rangeCopy = range.duplicate();
|
||||
range.moveToBookmark(sel.getBookmark());
|
||||
rangeCopy.setEndPoint("EndToStart", range);
|
||||
if (rangeCopy.parentElement() == textarea)
|
||||
caretPosition = rangeCopy.text.length;
|
||||
}
|
||||
else {
|
||||
rangeCopy.moveToElementText(textarea);
|
||||
caretPosition = -1;
|
||||
var inrange = false;
|
||||
while(rangeCopy.inRange(range, inrange)) {
|
||||
rangeCopy.moveStart('character');
|
||||
caretPosition ++;
|
||||
}
|
||||
}
|
||||
} else { // opera
|
||||
caretPosition = textarea.selectionStart;
|
||||
}
|
||||
} else { // gecko & webkit
|
||||
caretPosition = textarea.selectionStart;
|
||||
|
||||
selection = textarea.value.substring(caretPosition, textarea.selectionEnd);
|
||||
}
|
||||
return selection;
|
||||
}
|
||||
|
||||
// open preview window
|
||||
function preview() {
|
||||
if (!previewWindow || previewWindow.closed) {
|
||||
if (options.previewInWindow) {
|
||||
previewWindow = window.open('', 'preview', options.previewInWindow);
|
||||
$(window).unload(function() {
|
||||
previewWindow.close();
|
||||
});
|
||||
} else {
|
||||
iFrame = $('<iframe class="markItUpPreviewFrame"></iframe>');
|
||||
if (options.previewPosition == 'after') {
|
||||
iFrame.insertAfter(footer);
|
||||
} else {
|
||||
iFrame.insertBefore(header);
|
||||
}
|
||||
previewWindow = iFrame[iFrame.length - 1].contentWindow || frame[iFrame.length - 1];
|
||||
}
|
||||
} else if (altKey === true) {
|
||||
if (iFrame) {
|
||||
iFrame.remove();
|
||||
} else {
|
||||
previewWindow.close();
|
||||
}
|
||||
previewWindow = iFrame = false;
|
||||
}
|
||||
if (!options.previewAutoRefresh) {
|
||||
refreshPreview();
|
||||
}
|
||||
if (options.previewInWindow) {
|
||||
previewWindow.focus();
|
||||
}
|
||||
}
|
||||
|
||||
// refresh Preview window
|
||||
function refreshPreview() {
|
||||
renderPreview();
|
||||
}
|
||||
|
||||
function renderPreview() {
|
||||
var phtml;
|
||||
if (options.previewParser && typeof options.previewParser === 'function') {
|
||||
var data = options.previewParser( $$.val() );
|
||||
writeInPreview( localize(data, 1) );
|
||||
} else if (options.previewParserPath !== '') {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
dataType: 'text',
|
||||
global: false,
|
||||
url: options.previewParserPath,
|
||||
data: options.previewParserVar+'='+encodeURIComponent($$.val()),
|
||||
success: function(data) {
|
||||
writeInPreview( localize(data, 1) );
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (!template) {
|
||||
$.ajax({
|
||||
url: options.previewTemplatePath,
|
||||
dataType: 'text',
|
||||
global: false,
|
||||
success: function(data) {
|
||||
writeInPreview( localize(data, 1).replace(/<!-- content -->/g, $$.val()) );
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function writeInPreview(data) {
|
||||
if (previewWindow.document) {
|
||||
try {
|
||||
sp = previewWindow.document.documentElement.scrollTop
|
||||
} catch(e) {
|
||||
sp = 0;
|
||||
}
|
||||
previewWindow.document.open();
|
||||
previewWindow.document.write(data);
|
||||
previewWindow.document.close();
|
||||
previewWindow.document.documentElement.scrollTop = sp;
|
||||
}
|
||||
}
|
||||
|
||||
// set keys pressed
|
||||
function keyPressed(e) {
|
||||
shiftKey = e.shiftKey;
|
||||
altKey = e.altKey;
|
||||
ctrlKey = (!(e.altKey && e.ctrlKey)) ? (e.ctrlKey || e.metaKey) : false;
|
||||
|
||||
if (e.type === 'keydown') {
|
||||
if (ctrlKey === true) {
|
||||
li = $('a[accesskey="'+String.fromCharCode(e.keyCode)+'"]', header).parent('li');
|
||||
if (li.length !== 0) {
|
||||
ctrlKey = false;
|
||||
setTimeout(function() {
|
||||
li.triggerHandler('mouseup');
|
||||
},1);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (e.keyCode === 13 || e.keyCode === 10) { // Enter key
|
||||
if (ctrlKey === true) { // Enter + Ctrl
|
||||
ctrlKey = false;
|
||||
markup(options.onCtrlEnter);
|
||||
return options.onCtrlEnter.keepDefault;
|
||||
} else if (shiftKey === true) { // Enter + Shift
|
||||
shiftKey = false;
|
||||
markup(options.onShiftEnter);
|
||||
return options.onShiftEnter.keepDefault;
|
||||
} else { // only Enter
|
||||
markup(options.onEnter);
|
||||
return options.onEnter.keepDefault;
|
||||
}
|
||||
}
|
||||
if (e.keyCode === 9) { // Tab key
|
||||
if (shiftKey == true || ctrlKey == true || altKey == true) {
|
||||
return false;
|
||||
}
|
||||
if (caretOffset !== -1) {
|
||||
get();
|
||||
caretOffset = $$.val().length - caretOffset;
|
||||
set(caretOffset, 0);
|
||||
caretOffset = -1;
|
||||
return false;
|
||||
} else {
|
||||
markup(options.onTab);
|
||||
return options.onTab.keepDefault;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
init();
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.markItUpRemove = function() {
|
||||
return this.each(function() {
|
||||
var $$ = $(this).unbind().removeClass('markItUpEditor');
|
||||
$$.parent('div').parent('div.markItUp').parent('div').replaceWith($$);
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
$.markItUp = function(settings) {
|
||||
var options = { target:false };
|
||||
$.extend(options, settings);
|
||||
if (options.target) {
|
||||
return $(options.target).each(function() {
|
||||
$(this).focus();
|
||||
$(this).trigger('insertion', [options]);
|
||||
});
|
||||
} else {
|
||||
$('textarea').trigger('insertion', [options]);
|
||||
}
|
||||
};
|
||||
})(jQuery);
|
BIN
include/javascript/jquery/markitup/sets/default/images/bold.png
Executable file
After Width: | Height: | Size: 304 B |
BIN
include/javascript/jquery/markitup/sets/default/images/clean.png
Executable file
After Width: | Height: | Size: 667 B |
BIN
include/javascript/jquery/markitup/sets/default/images/image.png
Executable file
After Width: | Height: | Size: 516 B |
BIN
include/javascript/jquery/markitup/sets/default/images/italic.png
Executable file
After Width: | Height: | Size: 223 B |
BIN
include/javascript/jquery/markitup/sets/default/images/link.png
Executable file
After Width: | Height: | Size: 343 B |
BIN
include/javascript/jquery/markitup/sets/default/images/list-bullet.png
Executable file
After Width: | Height: | Size: 344 B |
BIN
include/javascript/jquery/markitup/sets/default/images/list-numeric.png
Executable file
After Width: | Height: | Size: 357 B |
BIN
include/javascript/jquery/markitup/sets/default/images/picture.png
Executable file
After Width: | Height: | Size: 606 B |
BIN
include/javascript/jquery/markitup/sets/default/images/preview.png
Executable file
After Width: | Height: | Size: 537 B |
BIN
include/javascript/jquery/markitup/sets/default/images/stroke.png
Executable file
After Width: | Height: | Size: 269 B |
30
include/javascript/jquery/markitup/sets/default/set.js
vendored
Executable file
|
@ -0,0 +1,30 @@
|
|||
// ----------------------------------------------------------------------------
|
||||
// markItUp!
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright (C) 2011 Jay Salvat
|
||||
// http://markitup.jaysalvat.com/
|
||||
// ----------------------------------------------------------------------------
|
||||
// Html tags
|
||||
// http://en.wikipedia.org/wiki/html
|
||||
// ----------------------------------------------------------------------------
|
||||
// Basic set. Feel free to add more tags
|
||||
// ----------------------------------------------------------------------------
|
||||
var mySettings = {
|
||||
onShiftEnter: {keepDefault:true},
|
||||
onCtrlEnter: {keepDefault:true},
|
||||
onTab: {keepDefault:false, replaceWith:' '},
|
||||
markupSet: [
|
||||
{name:'Bold', key:'B', openWith:'(!(<strong>|!|<b>)!)', closeWith:'(!(</strong>|!|</b>)!)' },
|
||||
{name:'Italic', key:'I', openWith:'(!(<em>|!|<i>)!)', closeWith:'(!(</em>|!|</i>)!)' },
|
||||
{name:'Stroke through', key:'S', openWith:'<del>', closeWith:'</del>' },
|
||||
{separator:'---------------' },
|
||||
{name:'Bulleted List', openWith:' <li>', closeWith:'</li>', multiline:true, openBlockWith:'<ul>\n', closeBlockWith:'\n</ul>'},
|
||||
{name:'Numeric List', openWith:' <li>', closeWith:'</li>', multiline:true, openBlockWith:'<ol>\n', closeBlockWith:'\n</ol>'},
|
||||
{separator:'---------------' },
|
||||
{name:'Picture', key:'P', replaceWith:'<img src="[![Source:!:http://]!]" alt="[![Alternative text]!]" />' },
|
||||
{name:'Link', key:'L', openWith:'<a href="[![Link:!:http://]!]"(!( title="[![Title]!]")!)>', closeWith:'</a>', placeHolder:'Your text to link...' },
|
||||
{separator:'---------------' },
|
||||
{name:'Clean', className:'clean', replaceWith:function(markitup) { return markitup.selection.replace(/<(.*?)>/g, "") } },
|
||||
{name:'Preview', className:'preview', call:'preview'}
|
||||
]
|
||||
}
|
34
include/javascript/jquery/markitup/sets/default/style.css
Executable file
|
@ -0,0 +1,34 @@
|
|||
/* -------------------------------------------------------------------
|
||||
// markItUp!
|
||||
// By Jay Salvat - http://markitup.jaysalvat.com/
|
||||
// ------------------------------------------------------------------*/
|
||||
.markItUp .markItUpButton1 a {
|
||||
background-image:url(images/bold.png);
|
||||
}
|
||||
.markItUp .markItUpButton2 a {
|
||||
background-image:url(images/italic.png);
|
||||
}
|
||||
.markItUp .markItUpButton3 a {
|
||||
background-image:url(images/stroke.png);
|
||||
}
|
||||
|
||||
.markItUp .markItUpButton4 a {
|
||||
background-image:url(images/list-bullet.png);
|
||||
}
|
||||
.markItUp .markItUpButton5 a {
|
||||
background-image:url(images/list-numeric.png);
|
||||
}
|
||||
|
||||
.markItUp .markItUpButton6 a {
|
||||
background-image:url(images/picture.png);
|
||||
}
|
||||
.markItUp .markItUpButton7 a {
|
||||
background-image:url(images/link.png);
|
||||
}
|
||||
|
||||
.markItUp .markItUpButton8 a {
|
||||
background-image:url(images/clean.png);
|
||||
}
|
||||
.markItUp .preview a {
|
||||
background-image:url(images/preview.png);
|
||||
}
|
BIN
include/javascript/jquery/markitup/skins/simple/images/handle.png
Executable file
After Width: | Height: | Size: 258 B |
BIN
include/javascript/jquery/markitup/skins/simple/images/menu.png
Normal file
After Width: | Height: | Size: 376 B |
BIN
include/javascript/jquery/markitup/skins/simple/images/submenu.png
Executable file
After Width: | Height: | Size: 240 B |
118
include/javascript/jquery/markitup/skins/simple/style.css
Executable file
|
@ -0,0 +1,118 @@
|
|||
/* -------------------------------------------------------------------
|
||||
// markItUp! Universal MarkUp Engine, JQuery plugin
|
||||
// By Jay Salvat - http://markitup.jaysalvat.com/
|
||||
// ------------------------------------------------------------------*/
|
||||
.markItUp * {
|
||||
margin:0px; padding:0px;
|
||||
outline:none;
|
||||
}
|
||||
.markItUp a:link,
|
||||
.markItUp a:visited {
|
||||
color:#000;
|
||||
text-decoration:none;
|
||||
}
|
||||
.markItUp {
|
||||
/*width:700px;*/
|
||||
margin:5px 0 5px 0;
|
||||
}
|
||||
.markItUpContainer {
|
||||
font:11px Verdana, Arial, Helvetica, sans-serif;
|
||||
}
|
||||
.markItUpEditor {
|
||||
font:12px 'Courier New', Courier, monospace;
|
||||
padding:5px;
|
||||
width:690px;
|
||||
height:320px;
|
||||
clear:both;
|
||||
line-height:18px;
|
||||
overflow:auto;
|
||||
}
|
||||
.markItUpPreviewFrame {
|
||||
overflow:auto;
|
||||
background-color:#FFF;
|
||||
width:99.9%;
|
||||
height:300px;
|
||||
margin:5px 0;
|
||||
}
|
||||
.markItUpFooter {
|
||||
width:100%;
|
||||
}
|
||||
.markItUpResizeHandle {
|
||||
overflow:hidden;
|
||||
width:22px; height:5px;
|
||||
margin-left:auto;
|
||||
margin-right:auto;
|
||||
background-image:url(images/handle.png);
|
||||
cursor:n-resize;
|
||||
}
|
||||
/********/
|
||||
/* first row of buttons */
|
||||
.markItUpHeader ul li {
|
||||
list-style:none;
|
||||
float:left;
|
||||
position:relative;
|
||||
}
|
||||
.markItUpHeader ul li:hover > ul{
|
||||
display:block;
|
||||
}
|
||||
.markItUpHeader ul .markItUpDropMenu {
|
||||
background:transparent url(images/menu.png) no-repeat 115% 50%;
|
||||
margin-right:5px;
|
||||
}
|
||||
.markItUpHeader ul .markItUpDropMenu li {
|
||||
margin-right:0px;
|
||||
}
|
||||
/* next rows of buttons */
|
||||
.markItUpHeader ul ul {
|
||||
display:none;
|
||||
position:absolute;
|
||||
top:18px; left:0px;
|
||||
background:#FFF;
|
||||
border:1px solid #000;
|
||||
}
|
||||
.markItUpHeader ul ul li {
|
||||
float:none;
|
||||
border-bottom:1px solid #000;
|
||||
}
|
||||
.markItUpHeader ul ul .markItUpDropMenu {
|
||||
background:#FFF url(images/submenu.png) no-repeat 100% 50%;
|
||||
}
|
||||
.markItUpHeader ul .markItUpSeparator {
|
||||
margin:0 10px;
|
||||
width:1px;
|
||||
height:16px;
|
||||
overflow:hidden;
|
||||
background-color:#CCC;
|
||||
}
|
||||
.markItUpHeader ul ul .markItUpSeparator {
|
||||
width:auto; height:1px;
|
||||
margin:0px;
|
||||
}
|
||||
/* next rows of buttons */
|
||||
.markItUpHeader ul ul ul {
|
||||
position:absolute;
|
||||
top:-1px; left:150px;
|
||||
}
|
||||
.markItUpHeader ul ul ul li {
|
||||
float:none;
|
||||
}
|
||||
.markItUpHeader ul a {
|
||||
display:block;
|
||||
width:16px; height:16px;
|
||||
text-indent:-10000px;
|
||||
background-repeat:no-repeat;
|
||||
padding:3px;
|
||||
margin:0px;
|
||||
}
|
||||
.markItUpHeader ul ul a {
|
||||
display:block;
|
||||
padding-left:0px;
|
||||
text-indent:0;
|
||||
width:120px;
|
||||
padding:5px 5px 5px 25px;
|
||||
background-position:2px 50%;
|
||||
}
|
||||
.markItUpHeader ul ul a:hover {
|
||||
color:#FFF;
|
||||
background-color:#000;
|
||||
}
|
5
include/javascript/jquery/markitup/templates/preview.css
Executable file
|
@ -0,0 +1,5 @@
|
|||
/* preview style examples */
|
||||
body {
|
||||
background-color:#EFEFEF;
|
||||
font:70% Verdana, Arial, Helvetica, sans-serif;
|
||||
}
|
11
include/javascript/jquery/markitup/templates/preview.html
Executable file
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>markItUp! preview template</title>
|
||||
<link rel="stylesheet" type="text/css" href="~/templates/preview.css" />
|
||||
</head>
|
||||
<body>
|
||||
<!-- content -->
|
||||
</body>
|
||||
</html>
|
5
include/javascript/jquery/respond.min.js
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
/*! Respond.js v1.4.2: min/max-width media query polyfill * Copyright 2013 Scott Jehl
|
||||
* Licensed under https://github.com/scottjehl/Respond/blob/master/LICENSE-MIT
|
||||
* */
|
||||
|
||||
!function(a){"use strict";a.matchMedia=a.matchMedia||function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='­<style media="'+a+'"> #mq-test-1 { width: 42px; }</style>',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";function b(){u(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))};if(c.ajax=f,c.queue=d,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var g,h,i,j=a.document,k=j.documentElement,l=[],m=[],n=[],o={},p=30,q=j.getElementsByTagName("head")[0]||k,r=j.getElementsByTagName("base")[0],s=q.getElementsByTagName("link"),t=function(){var a,b=j.createElement("div"),c=j.body,d=k.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=j.createElement("body"),c.style.background="none"),k.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&k.insertBefore(c,k.firstChild),a=b.offsetWidth,f?k.removeChild(c):c.removeChild(b),k.style.fontSize=d,e&&(c.style.fontSize=e),a=i=parseFloat(a)},u=function(b){var c="clientWidth",d=k[c],e="CSS1Compat"===j.compatMode&&d||j.body[c]||d,f={},o=s[s.length-1],r=(new Date).getTime();if(b&&g&&p>r-g)return a.clearTimeout(h),h=a.setTimeout(u,p),void 0;g=r;for(var v in l)if(l.hasOwnProperty(v)){var w=l[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?i||t():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?i||t():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(m[w.rules]))}for(var C in n)n.hasOwnProperty(C)&&n[C]&&n[C].parentNode===q&&q.removeChild(n[C]);n.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=j.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,q.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(j.createTextNode(F)),n.push(E)}},v=function(a,b,d){var e=a.replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var g=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},h=!f&&d;b.length&&(b+="/"),h&&(f=1);for(var i=0;f>i;i++){var j,k,n,o;h?(j=d,m.push(g(a))):(j=e[i].match(c.regex.findStyles)&&RegExp.$1,m.push(RegExp.$2&&g(RegExp.$2))),n=j.split(","),o=n.length;for(var p=0;o>p;p++)k=n[p],l.push({media:k.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:m.length-1,hasquery:k.indexOf("(")>-1,minw:k.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:k.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},w=function(){if(d.length){var b=d.shift();f(b.href,function(c){v(c,b.href,b.media),o[b.href]=!0,a.setTimeout(function(){w()},0)})}},x=function(){for(var b=0;b<s.length;b++){var c=s[b],e=c.href,f=c.media,g=c.rel&&"stylesheet"===c.rel.toLowerCase();e&&g&&!o[e]&&(c.styleSheet&&c.styleSheet.rawCssText?(v(c.styleSheet.rawCssText,e,f),o[e]=!0):(!/^([a-zA-Z:]*\/\/)/.test(e)&&!r||e.replace(RegExp.$1,"").split("/")[0]===a.location.host)&&("//"===e.substring(0,2)&&(e=a.location.protocol+e),d.push({href:e,media:f})))}w()};x(),c.update=x,c.getEmValue=t,a.addEventListener?a.addEventListener("resize",b,!1):a.attachEvent&&a.attachEvent("onresize",b)}}(this);
|
After Width: | Height: | Size: 212 B |
After Width: | Height: | Size: 208 B |
After Width: | Height: | Size: 335 B |
BIN
include/javascript/jquery/themes/base/images/ui-bg_glass_65_ffffff_1x400.png
Executable file
After Width: | Height: | Size: 207 B |
After Width: | Height: | Size: 262 B |
After Width: | Height: | Size: 262 B |
After Width: | Height: | Size: 332 B |
After Width: | Height: | Size: 280 B |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 4.4 KiB |
1225
include/javascript/jquery/themes/base/jquery-ui.css
vendored
Normal file
7
include/javascript/jquery/themes/base/jquery-ui.min.css
vendored
Normal file
833
include/javascript/jquery/themes/base/jquery-ui.structure.css
vendored
Normal file
|
@ -0,0 +1,833 @@
|
|||
/*!
|
||||
* jQuery UI CSS Framework 1.11.3
|
||||
* http://jqueryui.com
|
||||
*
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://api.jqueryui.com/category/theming/
|
||||
*/
|
||||
|
||||
/* Layout helpers
|
||||
----------------------------------*/
|
||||
.ui-helper-hidden {
|
||||
display: none;
|
||||
}
|
||||
.ui-helper-hidden-accessible {
|
||||
border: 0;
|
||||
clip: rect(0 0 0 0);
|
||||
height: 1px;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
}
|
||||
.ui-helper-reset {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
outline: 0;
|
||||
line-height: 1.3;
|
||||
text-decoration: none;
|
||||
font-size: 100%;
|
||||
list-style: none;
|
||||
}
|
||||
.ui-helper-clearfix:before,
|
||||
.ui-helper-clearfix:after {
|
||||
content: "";
|
||||
display: table;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
.ui-helper-clearfix:after {
|
||||
clear: both;
|
||||
}
|
||||
.ui-helper-clearfix {
|
||||
min-height: 0; /* support: IE7 */
|
||||
}
|
||||
.ui-helper-zfix {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
filter:Alpha(Opacity=0); /* support: IE8 */
|
||||
}
|
||||
|
||||
.ui-front {
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
|
||||
/* Interaction Cues
|
||||
----------------------------------*/
|
||||
.ui-state-disabled {
|
||||
cursor: default !important;
|
||||
}
|
||||
|
||||
|
||||
/* Icons
|
||||
----------------------------------*/
|
||||
|
||||
/* states and images */
|
||||
.ui-icon {
|
||||
display: block;
|
||||
text-indent: -99999px;
|
||||
overflow: hidden;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
|
||||
/* Misc visuals
|
||||
----------------------------------*/
|
||||
|
||||
/* Overlays */
|
||||
.ui-widget-overlay {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.ui-draggable-handle {
|
||||
-ms-touch-action: none;
|
||||
touch-action: none;
|
||||
}
|
||||
.ui-resizable {
|
||||
position: relative;
|
||||
}
|
||||
.ui-resizable-handle {
|
||||
position: absolute;
|
||||
font-size: 0.1px;
|
||||
display: block;
|
||||
-ms-touch-action: none;
|
||||
touch-action: none;
|
||||
}
|
||||
.ui-resizable-disabled .ui-resizable-handle,
|
||||
.ui-resizable-autohide .ui-resizable-handle {
|
||||
display: none;
|
||||
}
|
||||
.ui-resizable-n {
|
||||
cursor: n-resize;
|
||||
height: 7px;
|
||||
width: 100%;
|
||||
top: -5px;
|
||||
left: 0;
|
||||
}
|
||||
.ui-resizable-s {
|
||||
cursor: s-resize;
|
||||
height: 7px;
|
||||
width: 100%;
|
||||
bottom: -5px;
|
||||
left: 0;
|
||||
}
|
||||
.ui-resizable-e {
|
||||
cursor: e-resize;
|
||||
width: 7px;
|
||||
right: -5px;
|
||||
top: 0;
|
||||
height: 100%;
|
||||
}
|
||||
.ui-resizable-w {
|
||||
cursor: w-resize;
|
||||
width: 7px;
|
||||
left: -5px;
|
||||
top: 0;
|
||||
height: 100%;
|
||||
}
|
||||
.ui-resizable-se {
|
||||
cursor: se-resize;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
right: 1px;
|
||||
bottom: 1px;
|
||||
}
|
||||
.ui-resizable-sw {
|
||||
cursor: sw-resize;
|
||||
width: 9px;
|
||||
height: 9px;
|
||||
left: -5px;
|
||||
bottom: -5px;
|
||||
}
|
||||
.ui-resizable-nw {
|
||||
cursor: nw-resize;
|
||||
width: 9px;
|
||||
height: 9px;
|
||||
left: -5px;
|
||||
top: -5px;
|
||||
}
|
||||
.ui-resizable-ne {
|
||||
cursor: ne-resize;
|
||||
width: 9px;
|
||||
height: 9px;
|
||||
right: -5px;
|
||||
top: -5px;
|
||||
}
|
||||
.ui-selectable {
|
||||
-ms-touch-action: none;
|
||||
touch-action: none;
|
||||
}
|
||||
.ui-selectable-helper {
|
||||
position: absolute;
|
||||
z-index: 100;
|
||||
border: 1px dotted black;
|
||||
}
|
||||
.ui-sortable-handle {
|
||||
-ms-touch-action: none;
|
||||
touch-action: none;
|
||||
}
|
||||
.ui-accordion .ui-accordion-header {
|
||||
display: block;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
margin: 2px 0 0 0;
|
||||
padding: .5em .5em .5em .7em;
|
||||
min-height: 0; /* support: IE7 */
|
||||
font-size: 100%;
|
||||
}
|
||||
.ui-accordion .ui-accordion-icons {
|
||||
padding-left: 2.2em;
|
||||
}
|
||||
.ui-accordion .ui-accordion-icons .ui-accordion-icons {
|
||||
padding-left: 2.2em;
|
||||
}
|
||||
.ui-accordion .ui-accordion-header .ui-accordion-header-icon {
|
||||
position: absolute;
|
||||
left: .5em;
|
||||
top: 50%;
|
||||
margin-top: -8px;
|
||||
}
|
||||
.ui-accordion .ui-accordion-content {
|
||||
padding: 1em 2.2em;
|
||||
border-top: 0;
|
||||
overflow: auto;
|
||||
}
|
||||
.ui-autocomplete {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
cursor: default;
|
||||
}
|
||||
.ui-button {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
padding: 0;
|
||||
line-height: normal;
|
||||
margin-right: .1em;
|
||||
cursor: pointer;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
overflow: visible; /* removes extra width in IE */
|
||||
}
|
||||
.ui-button,
|
||||
.ui-button:link,
|
||||
.ui-button:visited,
|
||||
.ui-button:hover,
|
||||
.ui-button:active {
|
||||
text-decoration: none;
|
||||
}
|
||||
/* to make room for the icon, a width needs to be set here */
|
||||
.ui-button-icon-only {
|
||||
width: 2.2em;
|
||||
}
|
||||
/* button elements seem to need a little more width */
|
||||
button.ui-button-icon-only {
|
||||
width: 2.4em;
|
||||
}
|
||||
.ui-button-icons-only {
|
||||
width: 3.4em;
|
||||
}
|
||||
button.ui-button-icons-only {
|
||||
width: 3.7em;
|
||||
}
|
||||
|
||||
/* button text element */
|
||||
.ui-button .ui-button-text {
|
||||
display: block;
|
||||
line-height: normal;
|
||||
}
|
||||
.ui-button-text-only .ui-button-text {
|
||||
padding: .4em 1em;
|
||||
}
|
||||
.ui-button-icon-only .ui-button-text,
|
||||
.ui-button-icons-only .ui-button-text {
|
||||
padding: .4em;
|
||||
text-indent: -9999999px;
|
||||
}
|
||||
.ui-button-text-icon-primary .ui-button-text,
|
||||
.ui-button-text-icons .ui-button-text {
|
||||
padding: .4em 1em .4em 2.1em;
|
||||
}
|
||||
.ui-button-text-icon-secondary .ui-button-text,
|
||||
.ui-button-text-icons .ui-button-text {
|
||||
padding: .4em 2.1em .4em 1em;
|
||||
}
|
||||
.ui-button-text-icons .ui-button-text {
|
||||
padding-left: 2.1em;
|
||||
padding-right: 2.1em;
|
||||
}
|
||||
/* no icon support for input elements, provide padding by default */
|
||||
input.ui-button {
|
||||
padding: .4em 1em;
|
||||
}
|
||||
|
||||
/* button icon element(s) */
|
||||
.ui-button-icon-only .ui-icon,
|
||||
.ui-button-text-icon-primary .ui-icon,
|
||||
.ui-button-text-icon-secondary .ui-icon,
|
||||
.ui-button-text-icons .ui-icon,
|
||||
.ui-button-icons-only .ui-icon {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
margin-top: -8px;
|
||||
}
|
||||
.ui-button-icon-only .ui-icon {
|
||||
left: 50%;
|
||||
margin-left: -8px;
|
||||
}
|
||||
.ui-button-text-icon-primary .ui-button-icon-primary,
|
||||
.ui-button-text-icons .ui-button-icon-primary,
|
||||
.ui-button-icons-only .ui-button-icon-primary {
|
||||
left: .5em;
|
||||
}
|
||||
.ui-button-text-icon-secondary .ui-button-icon-secondary,
|
||||
.ui-button-text-icons .ui-button-icon-secondary,
|
||||
.ui-button-icons-only .ui-button-icon-secondary {
|
||||
right: .5em;
|
||||
}
|
||||
|
||||
/* button sets */
|
||||
.ui-buttonset {
|
||||
margin-right: 7px;
|
||||
}
|
||||
.ui-buttonset .ui-button {
|
||||
margin-left: 0;
|
||||
margin-right: -.3em;
|
||||
}
|
||||
|
||||
/* workarounds */
|
||||
/* reset extra padding in Firefox, see h5bp.com/l */
|
||||
input.ui-button::-moz-focus-inner,
|
||||
button.ui-button::-moz-focus-inner {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.ui-datepicker {
|
||||
width: 17em;
|
||||
padding: .2em .2em 0;
|
||||
display: none;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-header {
|
||||
position: relative;
|
||||
padding: .2em 0;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-prev,
|
||||
.ui-datepicker .ui-datepicker-next {
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
width: 1.8em;
|
||||
height: 1.8em;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-prev-hover,
|
||||
.ui-datepicker .ui-datepicker-next-hover {
|
||||
top: 1px;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-prev {
|
||||
left: 2px;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-next {
|
||||
right: 2px;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-prev-hover {
|
||||
left: 1px;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-next-hover {
|
||||
right: 1px;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-prev span,
|
||||
.ui-datepicker .ui-datepicker-next span {
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
margin-left: -8px;
|
||||
top: 50%;
|
||||
margin-top: -8px;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-title {
|
||||
margin: 0 2.3em;
|
||||
line-height: 1.8em;
|
||||
text-align: center;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-title select {
|
||||
font-size: 1em;
|
||||
margin: 1px 0;
|
||||
}
|
||||
.ui-datepicker select.ui-datepicker-month,
|
||||
.ui-datepicker select.ui-datepicker-year {
|
||||
width: 45%;
|
||||
}
|
||||
.ui-datepicker table {
|
||||
width: 100%;
|
||||
font-size: .9em;
|
||||
border-collapse: collapse;
|
||||
margin: 0 0 .4em;
|
||||
}
|
||||
.ui-datepicker th {
|
||||
padding: .7em .3em;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
border: 0;
|
||||
}
|
||||
.ui-datepicker td {
|
||||
border: 0;
|
||||
padding: 1px;
|
||||
}
|
||||
.ui-datepicker td span,
|
||||
.ui-datepicker td a {
|
||||
display: block;
|
||||
padding: .2em;
|
||||
text-align: right;
|
||||
text-decoration: none;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-buttonpane {
|
||||
background-image: none;
|
||||
margin: .7em 0 0 0;
|
||||
padding: 0 .2em;
|
||||
border-left: 0;
|
||||
border-right: 0;
|
||||
border-bottom: 0;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-buttonpane button {
|
||||
float: right;
|
||||
margin: .5em .2em .4em;
|
||||
cursor: pointer;
|
||||
padding: .2em .6em .3em .6em;
|
||||
width: auto;
|
||||
overflow: visible;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
|
||||
float: left;
|
||||
}
|
||||
|
||||
/* with multiple calendars */
|
||||
.ui-datepicker.ui-datepicker-multi {
|
||||
width: auto;
|
||||
}
|
||||
.ui-datepicker-multi .ui-datepicker-group {
|
||||
float: left;
|
||||
}
|
||||
.ui-datepicker-multi .ui-datepicker-group table {
|
||||
width: 95%;
|
||||
margin: 0 auto .4em;
|
||||
}
|
||||
.ui-datepicker-multi-2 .ui-datepicker-group {
|
||||
width: 50%;
|
||||
}
|
||||
.ui-datepicker-multi-3 .ui-datepicker-group {
|
||||
width: 33.3%;
|
||||
}
|
||||
.ui-datepicker-multi-4 .ui-datepicker-group {
|
||||
width: 25%;
|
||||
}
|
||||
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
|
||||
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
|
||||
border-left-width: 0;
|
||||
}
|
||||
.ui-datepicker-multi .ui-datepicker-buttonpane {
|
||||
clear: left;
|
||||
}
|
||||
.ui-datepicker-row-break {
|
||||
clear: both;
|
||||
width: 100%;
|
||||
font-size: 0;
|
||||
}
|
||||
|
||||
/* RTL support */
|
||||
.ui-datepicker-rtl {
|
||||
direction: rtl;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-prev {
|
||||
right: 2px;
|
||||
left: auto;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-next {
|
||||
left: 2px;
|
||||
right: auto;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-prev:hover {
|
||||
right: 1px;
|
||||
left: auto;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-next:hover {
|
||||
left: 1px;
|
||||
right: auto;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane {
|
||||
clear: right;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane button {
|
||||
float: left;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
|
||||
.ui-datepicker-rtl .ui-datepicker-group {
|
||||
float: right;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
|
||||
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
|
||||
border-right-width: 0;
|
||||
border-left-width: 1px;
|
||||
}
|
||||
.ui-dialog {
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
padding: .2em;
|
||||
outline: 0;
|
||||
}
|
||||
.ui-dialog .ui-dialog-titlebar {
|
||||
padding: .4em 1em;
|
||||
position: relative;
|
||||
}
|
||||
.ui-dialog .ui-dialog-title {
|
||||
float: left;
|
||||
margin: .1em 0;
|
||||
white-space: nowrap;
|
||||
width: 90%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.ui-dialog .ui-dialog-titlebar-close {
|
||||
position: absolute;
|
||||
right: .3em;
|
||||
top: 50%;
|
||||
width: 20px;
|
||||
margin: -10px 0 0 0;
|
||||
padding: 1px;
|
||||
height: 20px;
|
||||
}
|
||||
.ui-dialog .ui-dialog-content {
|
||||
position: relative;
|
||||
border: 0;
|
||||
padding: .5em 1em;
|
||||
background: none;
|
||||
overflow: auto;
|
||||
}
|
||||
.ui-dialog .ui-dialog-buttonpane {
|
||||
text-align: left;
|
||||
border-width: 1px 0 0 0;
|
||||
background-image: none;
|
||||
margin-top: .5em;
|
||||
padding: .3em 1em .5em .4em;
|
||||
}
|
||||
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
|
||||
float: right;
|
||||
}
|
||||
.ui-dialog .ui-dialog-buttonpane button {
|
||||
margin: .5em .4em .5em 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
.ui-dialog .ui-resizable-se {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
right: -5px;
|
||||
bottom: -5px;
|
||||
background-position: 16px 16px;
|
||||
}
|
||||
.ui-draggable .ui-dialog-titlebar {
|
||||
cursor: move;
|
||||
}
|
||||
.ui-menu {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
display: block;
|
||||
outline: none;
|
||||
}
|
||||
.ui-menu .ui-menu {
|
||||
position: absolute;
|
||||
}
|
||||
.ui-menu .ui-menu-item {
|
||||
position: relative;
|
||||
margin: 0;
|
||||
padding: 3px 1em 3px .4em;
|
||||
cursor: pointer;
|
||||
min-height: 0; /* support: IE7 */
|
||||
/* support: IE10, see #8844 */
|
||||
list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
|
||||
}
|
||||
.ui-menu .ui-menu-divider {
|
||||
margin: 5px 0;
|
||||
height: 0;
|
||||
font-size: 0;
|
||||
line-height: 0;
|
||||
border-width: 1px 0 0 0;
|
||||
}
|
||||
.ui-menu .ui-state-focus,
|
||||
.ui-menu .ui-state-active {
|
||||
margin: -1px;
|
||||
}
|
||||
|
||||
/* icon support */
|
||||
.ui-menu-icons {
|
||||
position: relative;
|
||||
}
|
||||
.ui-menu-icons .ui-menu-item {
|
||||
padding-left: 2em;
|
||||
}
|
||||
|
||||
/* left-aligned */
|
||||
.ui-menu .ui-icon {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: .2em;
|
||||
margin: auto 0;
|
||||
}
|
||||
|
||||
/* right-aligned */
|
||||
.ui-menu .ui-menu-icon {
|
||||
left: auto;
|
||||
right: 0;
|
||||
}
|
||||
.ui-progressbar {
|
||||
height: 2em;
|
||||
text-align: left;
|
||||
overflow: hidden;
|
||||
}
|
||||
.ui-progressbar .ui-progressbar-value {
|
||||
margin: -1px;
|
||||
height: 100%;
|
||||
}
|
||||
.ui-progressbar .ui-progressbar-overlay {
|
||||
background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");
|
||||
height: 100%;
|
||||
filter: alpha(opacity=25); /* support: IE8 */
|
||||
opacity: 0.25;
|
||||
}
|
||||
.ui-progressbar-indeterminate .ui-progressbar-value {
|
||||
background-image: none;
|
||||
}
|
||||
.ui-selectmenu-menu {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
display: none;
|
||||
}
|
||||
.ui-selectmenu-menu .ui-menu {
|
||||
overflow: auto;
|
||||
/* Support: IE7 */
|
||||
overflow-x: hidden;
|
||||
padding-bottom: 1px;
|
||||
}
|
||||
.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup {
|
||||
font-size: 1em;
|
||||
font-weight: bold;
|
||||
line-height: 1.5;
|
||||
padding: 2px 0.4em;
|
||||
margin: 0.5em 0 0 0;
|
||||
height: auto;
|
||||
border: 0;
|
||||
}
|
||||
.ui-selectmenu-open {
|
||||
display: block;
|
||||
}
|
||||
.ui-selectmenu-button {
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
.ui-selectmenu-button span.ui-icon {
|
||||
right: 0.5em;
|
||||
left: auto;
|
||||
margin-top: -8px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
}
|
||||
.ui-selectmenu-button span.ui-selectmenu-text {
|
||||
text-align: left;
|
||||
padding: 0.4em 2.1em 0.4em 1em;
|
||||
display: block;
|
||||
line-height: 1.4;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.ui-slider {
|
||||
position: relative;
|
||||
text-align: left;
|
||||
}
|
||||
.ui-slider .ui-slider-handle {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
width: 1.2em;
|
||||
height: 1.2em;
|
||||
cursor: default;
|
||||
-ms-touch-action: none;
|
||||
touch-action: none;
|
||||
}
|
||||
.ui-slider .ui-slider-range {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
font-size: .7em;
|
||||
display: block;
|
||||
border: 0;
|
||||
background-position: 0 0;
|
||||
}
|
||||
|
||||
/* support: IE8 - See #6727 */
|
||||
.ui-slider.ui-state-disabled .ui-slider-handle,
|
||||
.ui-slider.ui-state-disabled .ui-slider-range {
|
||||
filter: inherit;
|
||||
}
|
||||
|
||||
.ui-slider-horizontal {
|
||||
height: .8em;
|
||||
}
|
||||
.ui-slider-horizontal .ui-slider-handle {
|
||||
top: -.3em;
|
||||
margin-left: -.6em;
|
||||
}
|
||||
.ui-slider-horizontal .ui-slider-range {
|
||||
top: 0;
|
||||
height: 100%;
|
||||
}
|
||||
.ui-slider-horizontal .ui-slider-range-min {
|
||||
left: 0;
|
||||
}
|
||||
.ui-slider-horizontal .ui-slider-range-max {
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.ui-slider-vertical {
|
||||
width: .8em;
|
||||
height: 100px;
|
||||
}
|
||||
.ui-slider-vertical .ui-slider-handle {
|
||||
left: -.3em;
|
||||
margin-left: 0;
|
||||
margin-bottom: -.6em;
|
||||
}
|
||||
.ui-slider-vertical .ui-slider-range {
|
||||
left: 0;
|
||||
width: 100%;
|
||||
}
|
||||
.ui-slider-vertical .ui-slider-range-min {
|
||||
bottom: 0;
|
||||
}
|
||||
.ui-slider-vertical .ui-slider-range-max {
|
||||
top: 0;
|
||||
}
|
||||
.ui-spinner {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.ui-spinner-input {
|
||||
border: none;
|
||||
background: none;
|
||||
color: inherit;
|
||||
padding: 0;
|
||||
margin: .2em 0;
|
||||
vertical-align: middle;
|
||||
margin-left: .4em;
|
||||
margin-right: 22px;
|
||||
}
|
||||
.ui-spinner-button {
|
||||
width: 16px;
|
||||
height: 50%;
|
||||
font-size: .5em;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
cursor: default;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
right: 0;
|
||||
}
|
||||
/* more specificity required here to override default borders */
|
||||
.ui-spinner a.ui-spinner-button {
|
||||
border-top: none;
|
||||
border-bottom: none;
|
||||
border-right: none;
|
||||
}
|
||||
/* vertically center icon */
|
||||
.ui-spinner .ui-icon {
|
||||
position: absolute;
|
||||
margin-top: -8px;
|
||||
top: 50%;
|
||||
left: 0;
|
||||
}
|
||||
.ui-spinner-up {
|
||||
top: 0;
|
||||
}
|
||||
.ui-spinner-down {
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
/* TR overrides */
|
||||
.ui-spinner .ui-icon-triangle-1-s {
|
||||
/* need to fix icons sprite */
|
||||
background-position: -65px -16px;
|
||||
}
|
||||
.ui-tabs {
|
||||
position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
|
||||
padding: .2em;
|
||||
}
|
||||
.ui-tabs .ui-tabs-nav {
|
||||
margin: 0;
|
||||
padding: .2em .2em 0;
|
||||
}
|
||||
.ui-tabs .ui-tabs-nav li {
|
||||
list-style: none;
|
||||
float: left;
|
||||
position: relative;
|
||||
top: 0;
|
||||
margin: 1px .2em 0 0;
|
||||
border-bottom-width: 0;
|
||||
padding: 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.ui-tabs .ui-tabs-nav .ui-tabs-anchor {
|
||||
float: left;
|
||||
padding: .5em 1em;
|
||||
text-decoration: none;
|
||||
}
|
||||
.ui-tabs .ui-tabs-nav li.ui-tabs-active {
|
||||
margin-bottom: -1px;
|
||||
padding-bottom: 1px;
|
||||
}
|
||||
.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
|
||||
.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,
|
||||
.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor {
|
||||
cursor: text;
|
||||
}
|
||||
.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {
|
||||
cursor: pointer;
|
||||
}
|
||||
.ui-tabs .ui-tabs-panel {
|
||||
display: block;
|
||||
border-width: 0;
|
||||
padding: 1em 1.4em;
|
||||
background: none;
|
||||
}
|
||||
.ui-tooltip {
|
||||
padding: 8px;
|
||||
position: absolute;
|
||||
z-index: 9999;
|
||||
max-width: 300px;
|
||||
-webkit-box-shadow: 0 0 5px #aaa;
|
||||
box-shadow: 0 0 5px #aaa;
|
||||
}
|
||||
body .ui-tooltip {
|
||||
border-width: 2px;
|
||||
}
|
5
include/javascript/jquery/themes/base/jquery-ui.structure.min.css
vendored
Normal file
410
include/javascript/jquery/themes/base/jquery-ui.theme.css
vendored
Normal file
|
@ -0,0 +1,410 @@
|
|||
/*!
|
||||
* jQuery UI CSS Framework 1.11.3
|
||||
* http://jqueryui.com
|
||||
*
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://api.jqueryui.com/category/theming/
|
||||
*
|
||||
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
|
||||
*/
|
||||
|
||||
|
||||
/* Component containers
|
||||
----------------------------------*/
|
||||
.ui-widget {
|
||||
font-family: Verdana,Arial,sans-serif;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
.ui-widget .ui-widget {
|
||||
font-size: 1em;
|
||||
}
|
||||
.ui-widget input,
|
||||
.ui-widget select,
|
||||
.ui-widget textarea,
|
||||
.ui-widget button {
|
||||
font-family: Verdana,Arial,sans-serif;
|
||||
font-size: 1em;
|
||||
}
|
||||
.ui-widget-content {
|
||||
border: 1px solid #aaaaaa;
|
||||
background: #ffffff url("images/ui-bg_flat_75_ffffff_40x100.png") 50% 50% repeat-x;
|
||||
color: #222222;
|
||||
}
|
||||
.ui-widget-content a {
|
||||
color: #222222;
|
||||
}
|
||||
.ui-widget-header {
|
||||
border: 1px solid #aaaaaa;
|
||||
background: #cccccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;
|
||||
color: #222222;
|
||||
font-weight: bold;
|
||||
}
|
||||
.ui-widget-header a {
|
||||
color: #222222;
|
||||
}
|
||||
|
||||
/* Interaction states
|
||||
----------------------------------*/
|
||||
.ui-state-default,
|
||||
.ui-widget-content .ui-state-default,
|
||||
.ui-widget-header .ui-state-default {
|
||||
border: 1px solid #d3d3d3;
|
||||
background: #e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;
|
||||
font-weight: normal;
|
||||
color: #555555;
|
||||
}
|
||||
.ui-state-default a,
|
||||
.ui-state-default a:link,
|
||||
.ui-state-default a:visited {
|
||||
color: #555555;
|
||||
text-decoration: none;
|
||||
}
|
||||
.ui-state-hover,
|
||||
.ui-widget-content .ui-state-hover,
|
||||
.ui-widget-header .ui-state-hover,
|
||||
.ui-state-focus,
|
||||
.ui-widget-content .ui-state-focus,
|
||||
.ui-widget-header .ui-state-focus {
|
||||
border: 1px solid #999999;
|
||||
background: #dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;
|
||||
font-weight: normal;
|
||||
color: #212121;
|
||||
}
|
||||
.ui-state-hover a,
|
||||
.ui-state-hover a:hover,
|
||||
.ui-state-hover a:link,
|
||||
.ui-state-hover a:visited,
|
||||
.ui-state-focus a,
|
||||
.ui-state-focus a:hover,
|
||||
.ui-state-focus a:link,
|
||||
.ui-state-focus a:visited {
|
||||
color: #212121;
|
||||
text-decoration: none;
|
||||
}
|
||||
.ui-state-active,
|
||||
.ui-widget-content .ui-state-active,
|
||||
.ui-widget-header .ui-state-active {
|
||||
border: 1px solid #aaaaaa;
|
||||
background: #ffffff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;
|
||||
font-weight: normal;
|
||||
color: #212121;
|
||||
}
|
||||
.ui-state-active a,
|
||||
.ui-state-active a:link,
|
||||
.ui-state-active a:visited {
|
||||
color: #212121;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* Interaction Cues
|
||||
----------------------------------*/
|
||||
.ui-state-highlight,
|
||||
.ui-widget-content .ui-state-highlight,
|
||||
.ui-widget-header .ui-state-highlight {
|
||||
border: 1px solid #fcefa1;
|
||||
background: #fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;
|
||||
color: #363636;
|
||||
}
|
||||
.ui-state-highlight a,
|
||||
.ui-widget-content .ui-state-highlight a,
|
||||
.ui-widget-header .ui-state-highlight a {
|
||||
color: #363636;
|
||||
}
|
||||
.ui-state-error,
|
||||
.ui-widget-content .ui-state-error,
|
||||
.ui-widget-header .ui-state-error {
|
||||
border: 1px solid #cd0a0a;
|
||||
background: #fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;
|
||||
color: #cd0a0a;
|
||||
}
|
||||
.ui-state-error a,
|
||||
.ui-widget-content .ui-state-error a,
|
||||
.ui-widget-header .ui-state-error a {
|
||||
color: #cd0a0a;
|
||||
}
|
||||
.ui-state-error-text,
|
||||
.ui-widget-content .ui-state-error-text,
|
||||
.ui-widget-header .ui-state-error-text {
|
||||
color: #cd0a0a;
|
||||
}
|
||||
.ui-priority-primary,
|
||||
.ui-widget-content .ui-priority-primary,
|
||||
.ui-widget-header .ui-priority-primary {
|
||||
font-weight: bold;
|
||||
}
|
||||
.ui-priority-secondary,
|
||||
.ui-widget-content .ui-priority-secondary,
|
||||
.ui-widget-header .ui-priority-secondary {
|
||||
opacity: .7;
|
||||
filter:Alpha(Opacity=70); /* support: IE8 */
|
||||
font-weight: normal;
|
||||
}
|
||||
.ui-state-disabled,
|
||||
.ui-widget-content .ui-state-disabled,
|
||||
.ui-widget-header .ui-state-disabled {
|
||||
opacity: .35;
|
||||
filter:Alpha(Opacity=35); /* support: IE8 */
|
||||
background-image: none;
|
||||
}
|
||||
.ui-state-disabled .ui-icon {
|
||||
filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */
|
||||
}
|
||||
|
||||
/* Icons
|
||||
----------------------------------*/
|
||||
|
||||
/* states and images */
|
||||
.ui-icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
.ui-icon,
|
||||
.ui-widget-content .ui-icon {
|
||||
background-image: url("images/ui-icons_222222_256x240.png");
|
||||
}
|
||||
.ui-widget-header .ui-icon {
|
||||
background-image: url("images/ui-icons_222222_256x240.png");
|
||||
}
|
||||
.ui-state-default .ui-icon {
|
||||
background-image: url("images/ui-icons_888888_256x240.png");
|
||||
}
|
||||
.ui-state-hover .ui-icon,
|
||||
.ui-state-focus .ui-icon {
|
||||
background-image: url("images/ui-icons_454545_256x240.png");
|
||||
}
|
||||
.ui-state-active .ui-icon {
|
||||
background-image: url("images/ui-icons_454545_256x240.png");
|
||||
}
|
||||
.ui-state-highlight .ui-icon {
|
||||
background-image: url("images/ui-icons_2e83ff_256x240.png");
|
||||
}
|
||||
.ui-state-error .ui-icon,
|
||||
.ui-state-error-text .ui-icon {
|
||||
background-image: url("images/ui-icons_cd0a0a_256x240.png");
|
||||
}
|
||||
|
||||
/* positioning */
|
||||
.ui-icon-blank { background-position: 16px 16px; }
|
||||
.ui-icon-carat-1-n { background-position: 0 0; }
|
||||
.ui-icon-carat-1-ne { background-position: -16px 0; }
|
||||
.ui-icon-carat-1-e { background-position: -32px 0; }
|
||||
.ui-icon-carat-1-se { background-position: -48px 0; }
|
||||
.ui-icon-carat-1-s { background-position: -64px 0; }
|
||||
.ui-icon-carat-1-sw { background-position: -80px 0; }
|
||||
.ui-icon-carat-1-w { background-position: -96px 0; }
|
||||
.ui-icon-carat-1-nw { background-position: -112px 0; }
|
||||
.ui-icon-carat-2-n-s { background-position: -128px 0; }
|
||||
.ui-icon-carat-2-e-w { background-position: -144px 0; }
|
||||
.ui-icon-triangle-1-n { background-position: 0 -16px; }
|
||||
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
|
||||
.ui-icon-triangle-1-e { background-position: -32px -16px; }
|
||||
.ui-icon-triangle-1-se { background-position: -48px -16px; }
|
||||
.ui-icon-triangle-1-s { background-position: -64px -16px; }
|
||||
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
|
||||
.ui-icon-triangle-1-w { background-position: -96px -16px; }
|
||||
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
|
||||
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
|
||||
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
|
||||
.ui-icon-arrow-1-n { background-position: 0 -32px; }
|
||||
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
|
||||
.ui-icon-arrow-1-e { background-position: -32px -32px; }
|
||||
.ui-icon-arrow-1-se { background-position: -48px -32px; }
|
||||
.ui-icon-arrow-1-s { background-position: -64px -32px; }
|
||||
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
|
||||
.ui-icon-arrow-1-w { background-position: -96px -32px; }
|
||||
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
|
||||
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
|
||||
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
|
||||
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
|
||||
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
|
||||
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
|
||||
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
|
||||
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
|
||||
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
|
||||
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
|
||||
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
|
||||
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
|
||||
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
|
||||
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
|
||||
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
|
||||
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
|
||||
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
|
||||
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
|
||||
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
|
||||
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
|
||||
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
|
||||
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
|
||||
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
|
||||
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
|
||||
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
|
||||
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
|
||||
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
|
||||
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
|
||||
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
|
||||
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
|
||||
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
|
||||
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
|
||||
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
|
||||
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
|
||||
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
|
||||
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
|
||||
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
|
||||
.ui-icon-arrow-4 { background-position: 0 -80px; }
|
||||
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
|
||||
.ui-icon-extlink { background-position: -32px -80px; }
|
||||
.ui-icon-newwin { background-position: -48px -80px; }
|
||||
.ui-icon-refresh { background-position: -64px -80px; }
|
||||
.ui-icon-shuffle { background-position: -80px -80px; }
|
||||
.ui-icon-transfer-e-w { background-position: -96px -80px; }
|
||||
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
|
||||
.ui-icon-folder-collapsed { background-position: 0 -96px; }
|
||||
.ui-icon-folder-open { background-position: -16px -96px; }
|
||||
.ui-icon-document { background-position: -32px -96px; }
|
||||
.ui-icon-document-b { background-position: -48px -96px; }
|
||||
.ui-icon-note { background-position: -64px -96px; }
|
||||
.ui-icon-mail-closed { background-position: -80px -96px; }
|
||||
.ui-icon-mail-open { background-position: -96px -96px; }
|
||||
.ui-icon-suitcase { background-position: -112px -96px; }
|
||||
.ui-icon-comment { background-position: -128px -96px; }
|
||||
.ui-icon-person { background-position: -144px -96px; }
|
||||
.ui-icon-print { background-position: -160px -96px; }
|
||||
.ui-icon-trash { background-position: -176px -96px; }
|
||||
.ui-icon-locked { background-position: -192px -96px; }
|
||||
.ui-icon-unlocked { background-position: -208px -96px; }
|
||||
.ui-icon-bookmark { background-position: -224px -96px; }
|
||||
.ui-icon-tag { background-position: -240px -96px; }
|
||||
.ui-icon-home { background-position: 0 -112px; }
|
||||
.ui-icon-flag { background-position: -16px -112px; }
|
||||
.ui-icon-calendar { background-position: -32px -112px; }
|
||||
.ui-icon-cart { background-position: -48px -112px; }
|
||||
.ui-icon-pencil { background-position: -64px -112px; }
|
||||
.ui-icon-clock { background-position: -80px -112px; }
|
||||
.ui-icon-disk { background-position: -96px -112px; }
|
||||
.ui-icon-calculator { background-position: -112px -112px; }
|
||||
.ui-icon-zoomin { background-position: -128px -112px; }
|
||||
.ui-icon-zoomout { background-position: -144px -112px; }
|
||||
.ui-icon-search { background-position: -160px -112px; }
|
||||
.ui-icon-wrench { background-position: -176px -112px; }
|
||||
.ui-icon-gear { background-position: -192px -112px; }
|
||||
.ui-icon-heart { background-position: -208px -112px; }
|
||||
.ui-icon-star { background-position: -224px -112px; }
|
||||
.ui-icon-link { background-position: -240px -112px; }
|
||||
.ui-icon-cancel { background-position: 0 -128px; }
|
||||
.ui-icon-plus { background-position: -16px -128px; }
|
||||
.ui-icon-plusthick { background-position: -32px -128px; }
|
||||
.ui-icon-minus { background-position: -48px -128px; }
|
||||
.ui-icon-minusthick { background-position: -64px -128px; }
|
||||
.ui-icon-close { background-position: -80px -128px; }
|
||||
.ui-icon-closethick { background-position: -96px -128px; }
|
||||
.ui-icon-key { background-position: -112px -128px; }
|
||||
.ui-icon-lightbulb { background-position: -128px -128px; }
|
||||
.ui-icon-scissors { background-position: -144px -128px; }
|
||||
.ui-icon-clipboard { background-position: -160px -128px; }
|
||||
.ui-icon-copy { background-position: -176px -128px; }
|
||||
.ui-icon-contact { background-position: -192px -128px; }
|
||||
.ui-icon-image { background-position: -208px -128px; }
|
||||
.ui-icon-video { background-position: -224px -128px; }
|
||||
.ui-icon-script { background-position: -240px -128px; }
|
||||
.ui-icon-alert { background-position: 0 -144px; }
|
||||
.ui-icon-info { background-position: -16px -144px; }
|
||||
.ui-icon-notice { background-position: -32px -144px; }
|
||||
.ui-icon-help { background-position: -48px -144px; }
|
||||
.ui-icon-check { background-position: -64px -144px; }
|
||||
.ui-icon-bullet { background-position: -80px -144px; }
|
||||
.ui-icon-radio-on { background-position: -96px -144px; }
|
||||
.ui-icon-radio-off { background-position: -112px -144px; }
|
||||
.ui-icon-pin-w { background-position: -128px -144px; }
|
||||
.ui-icon-pin-s { background-position: -144px -144px; }
|
||||
.ui-icon-play { background-position: 0 -160px; }
|
||||
.ui-icon-pause { background-position: -16px -160px; }
|
||||
.ui-icon-seek-next { background-position: -32px -160px; }
|
||||
.ui-icon-seek-prev { background-position: -48px -160px; }
|
||||
.ui-icon-seek-end { background-position: -64px -160px; }
|
||||
.ui-icon-seek-start { background-position: -80px -160px; }
|
||||
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
|
||||
.ui-icon-seek-first { background-position: -80px -160px; }
|
||||
.ui-icon-stop { background-position: -96px -160px; }
|
||||
.ui-icon-eject { background-position: -112px -160px; }
|
||||
.ui-icon-volume-off { background-position: -128px -160px; }
|
||||
.ui-icon-volume-on { background-position: -144px -160px; }
|
||||
.ui-icon-power { background-position: 0 -176px; }
|
||||
.ui-icon-signal-diag { background-position: -16px -176px; }
|
||||
.ui-icon-signal { background-position: -32px -176px; }
|
||||
.ui-icon-battery-0 { background-position: -48px -176px; }
|
||||
.ui-icon-battery-1 { background-position: -64px -176px; }
|
||||
.ui-icon-battery-2 { background-position: -80px -176px; }
|
||||
.ui-icon-battery-3 { background-position: -96px -176px; }
|
||||
.ui-icon-circle-plus { background-position: 0 -192px; }
|
||||
.ui-icon-circle-minus { background-position: -16px -192px; }
|
||||
.ui-icon-circle-close { background-position: -32px -192px; }
|
||||
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
|
||||
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
|
||||
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
|
||||
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
|
||||
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
|
||||
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
|
||||
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
|
||||
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
|
||||
.ui-icon-circle-zoomin { background-position: -176px -192px; }
|
||||
.ui-icon-circle-zoomout { background-position: -192px -192px; }
|
||||
.ui-icon-circle-check { background-position: -208px -192px; }
|
||||
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
|
||||
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
|
||||
.ui-icon-circlesmall-close { background-position: -32px -208px; }
|
||||
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
|
||||
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
|
||||
.ui-icon-squaresmall-close { background-position: -80px -208px; }
|
||||
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
|
||||
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
|
||||
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
|
||||
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
|
||||
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
|
||||
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
|
||||
|
||||
|
||||
/* Misc visuals
|
||||
----------------------------------*/
|
||||
|
||||
/* Corner radius */
|
||||
.ui-corner-all,
|
||||
.ui-corner-top,
|
||||
.ui-corner-left,
|
||||
.ui-corner-tl {
|
||||
border-top-left-radius: 4px;
|
||||
}
|
||||
.ui-corner-all,
|
||||
.ui-corner-top,
|
||||
.ui-corner-right,
|
||||
.ui-corner-tr {
|
||||
border-top-right-radius: 4px;
|
||||
}
|
||||
.ui-corner-all,
|
||||
.ui-corner-bottom,
|
||||
.ui-corner-left,
|
||||
.ui-corner-bl {
|
||||
border-bottom-left-radius: 4px;
|
||||
}
|
||||
.ui-corner-all,
|
||||
.ui-corner-bottom,
|
||||
.ui-corner-right,
|
||||
.ui-corner-br {
|
||||
border-bottom-right-radius: 4px;
|
||||
}
|
||||
|
||||
/* Overlays */
|
||||
.ui-widget-overlay {
|
||||
background: #aaaaaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;
|
||||
opacity: .3;
|
||||
filter: Alpha(Opacity=30); /* support: IE8 */
|
||||
}
|
||||
.ui-widget-shadow {
|
||||
margin: -8px 0 0 -8px;
|
||||
padding: 8px;
|
||||
background: #aaaaaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;
|
||||
opacity: .3;
|
||||
filter: Alpha(Opacity=30); /* support: IE8 */
|
||||
border-radius: 8px;
|
||||
}
|
5
include/javascript/jquery/themes/base/jquery-ui.theme.min.css
vendored
Normal file
12
include/javascript/jquery/themes/base/jquery.ui.all.css
vendored
Executable file
|
@ -0,0 +1,12 @@
|
|||
/*
|
||||
* jQuery UI CSS Framework @VERSION
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Theming
|
||||
*/
|
||||
@import "jquery-ui.min.css";
|
||||
@import "jquery-ui.structure.min.css";
|
||||
@import "jquery-ui.theme.min.css";
|
218
include/javascript/jsAlerts.php
Executable file
|
@ -0,0 +1,218 @@
|
|||
<?php
|
||||
if (!defined('sugarEntry') || !sugarEntry) {
|
||||
die('Not A Valid Entry Point');
|
||||
}
|
||||
/**
|
||||
*
|
||||
* SugarCRM Community Edition is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
|
||||
*
|
||||
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
|
||||
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
|
||||
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
|
||||
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
|
||||
*/
|
||||
|
||||
|
||||
require_once("include/utils/db_utils.php");
|
||||
|
||||
class jsAlerts
|
||||
{
|
||||
public $script;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
global $app_strings;
|
||||
$this->script .= <<<EOQ
|
||||
if (!alertsTimeoutId) {
|
||||
checkAlerts();
|
||||
}
|
||||
|
||||
EOQ;
|
||||
$this->addActivities();
|
||||
Reminder::addNotifications($this);
|
||||
if (!empty($GLOBALS['sugar_config']['enable_timeout_alerts'])) {
|
||||
$this->addAlert($app_strings['ERROR_JS_ALERT_SYSTEM_CLASS'], $app_strings['ERROR_JS_ALERT_TIMEOUT_TITLE'], '', $app_strings['ERROR_JS_ALERT_TIMEOUT_MSG_1'], (session_cache_expire() - 2) * 60);
|
||||
$this->addAlert($app_strings['ERROR_JS_ALERT_SYSTEM_CLASS'], $app_strings['ERROR_JS_ALERT_TIMEOUT_TITLE'], '', $app_strings['ERROR_JS_ALERT_TIMEOUT_MSG_2'], (session_cache_expire()) * 60, 'index.php');
|
||||
}
|
||||
}
|
||||
|
||||
public function addAlert($type, $name, $subtitle, $description, $countdown, $redirect = '', $reminder_id = '')
|
||||
{
|
||||
if ($countdown < 0) {
|
||||
$countdown = 0;
|
||||
}
|
||||
$script = 'addAlert(' . json_encode($type) . ',' . json_encode($name) . ',' . json_encode($subtitle)
|
||||
. ',' . json_encode(str_replace(array("\r", "\n"), array('', '<br>'), $description))
|
||||
. ',' . $countdown . ',' . json_encode($redirect) . ',' . json_encode($reminder_id) . ');' . "\n";
|
||||
$this->script .= $script;
|
||||
}
|
||||
|
||||
public function getScript()
|
||||
{
|
||||
return "<script>secondsSinceLoad = 0; alertList = [];" . $this->script . "</script>";
|
||||
}
|
||||
|
||||
/*
|
||||
* To return the name of parent bean.
|
||||
* @param $parentType string parent type
|
||||
* @param $parentId string parent id
|
||||
*/
|
||||
public function getRelatedName($parentType, $parentId)
|
||||
{
|
||||
if (!empty($parentType) && !empty($parentId)) {
|
||||
$parentBean = BeanFactory::getBean($parentType, $parentId);
|
||||
if (($parentBean instanceof SugarBean) && isset($parentBean->name)) {
|
||||
return $parentBean->name;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
public function addActivities()
|
||||
{
|
||||
global $app_list_strings, $timedate, $current_user, $app_strings;
|
||||
global $sugar_config;
|
||||
|
||||
if (empty($current_user->id)) {
|
||||
return;
|
||||
}
|
||||
|
||||
//Create separate variable to hold timedate value
|
||||
$alertDateTimeNow = $timedate->nowDb();
|
||||
|
||||
// cn: get a boundary limiter
|
||||
$dateTimeMax = $timedate->getNow()->modify("+{$app_list_strings['reminder_max_time']} seconds")->asDb();
|
||||
$dateTimeNow = $timedate->getNow()->modify("-60 seconds")->asDb();
|
||||
|
||||
$db = DBManagerFactory::getInstance();
|
||||
$dateTimeNow = $db->convert($db->quoted($dateTimeNow), 'datetime');
|
||||
$dateTimeMax = $db->convert($db->quoted($dateTimeMax), 'datetime');
|
||||
$desc = $db->convert("description", "text2char");
|
||||
if ($desc != "description") {
|
||||
$desc .= " description";
|
||||
}
|
||||
|
||||
// Prep Meetings Query
|
||||
$selectMeetings = "SELECT meetings.id, name,reminder_time, $desc,location, status, parent_type, parent_id, date_start, assigned_user_id
|
||||
FROM meetings LEFT JOIN meetings_users ON meetings.id = meetings_users.meeting_id
|
||||
WHERE meetings_users.user_id ='".$current_user->id."'
|
||||
AND meetings_users.accept_status != 'decline'
|
||||
AND meetings.reminder_time != -1
|
||||
AND meetings_users.deleted != 1
|
||||
AND meetings.status = 'Planned'
|
||||
AND date_start >= $dateTimeNow
|
||||
AND date_start <= $dateTimeMax";
|
||||
$result = $db->query($selectMeetings);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//// MEETING INTEGRATION
|
||||
$meetingIntegration = null;
|
||||
if (isset($sugar_config['meeting_integration']) && !empty($sugar_config['meeting_integration'])) {
|
||||
if (!class_exists($sugar_config['meeting_integration'])) {
|
||||
require_once("modules/{$sugar_config['meeting_integration']}/{$sugar_config['meeting_integration']}.php");
|
||||
}
|
||||
$meetingIntegration = new $sugar_config['meeting_integration']();
|
||||
}
|
||||
//// END MEETING INTEGRATION
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
while ($row = $db->fetchByAssoc($result)) {
|
||||
// need to concatenate since GMT times can bridge two local days
|
||||
$timeStart = strtotime($db->fromConvert($row['date_start'], 'datetime'));
|
||||
$timeRemind = $row['reminder_time'];
|
||||
$timeStart -= $timeRemind;
|
||||
|
||||
$url = 'index.php?action=DetailView&module=Meetings&record=' . $row['id'];
|
||||
$instructions = $app_strings['MSG_JS_ALERT_MTG_REMINDER_MEETING_MSG'];
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
//// MEETING INTEGRATION
|
||||
if (!empty($meetingIntegration) && $meetingIntegration->isIntegratedMeeting($row['id'])) {
|
||||
$url = $meetingIntegration->miUrlGetJsAlert($row);
|
||||
$instructions = $meetingIntegration->miGetJsAlertInstructions();
|
||||
}
|
||||
//// END MEETING INTEGRATION
|
||||
///////////////////////////////////////////////////////////////////
|
||||
|
||||
$meetingName = from_html($row['name']);
|
||||
$desc1 = from_html($row['description']);
|
||||
$location = from_html($row['location']);
|
||||
|
||||
$relatedToMeeting = $this->getRelatedName($row['parent_type'], $row['parent_id']);
|
||||
|
||||
$description = empty($desc1) ? '' : $app_strings['MSG_JS_ALERT_MTG_REMINDER_AGENDA'].$desc1."\n";
|
||||
$description = $description ."\n" .$app_strings['MSG_JS_ALERT_MTG_REMINDER_STATUS'] . $row['status'] ."\n". $app_strings['MSG_JS_ALERT_MTG_REMINDER_RELATED_TO']. $relatedToMeeting;
|
||||
|
||||
|
||||
// standard functionality
|
||||
$this->addAlert(
|
||||
$app_strings['MSG_JS_ALERT_MTG_REMINDER_MEETING'],
|
||||
$meetingName,
|
||||
$app_strings['MSG_JS_ALERT_MTG_REMINDER_TIME'].$timedate->to_display_date_time($db->fromConvert($row['date_start'], 'datetime')),
|
||||
$app_strings['MSG_JS_ALERT_MTG_REMINDER_LOC'].$location.
|
||||
$description.
|
||||
$instructions,
|
||||
$timeStart - strtotime($alertDateTimeNow),
|
||||
$url
|
||||
);
|
||||
}
|
||||
|
||||
// Prep Calls Query
|
||||
$selectCalls = "
|
||||
SELECT calls.id, name, reminder_time, $desc, date_start, status, parent_type, parent_id
|
||||
FROM calls LEFT JOIN calls_users ON calls.id = calls_users.call_id
|
||||
WHERE calls_users.user_id ='".$current_user->id."'
|
||||
AND calls_users.accept_status != 'decline'
|
||||
AND calls.reminder_time != -1
|
||||
AND calls_users.deleted != 1
|
||||
AND calls.status = 'Planned'
|
||||
AND date_start >= $dateTimeNow
|
||||
AND date_start <= $dateTimeMax";
|
||||
|
||||
$result = $db->query($selectCalls);
|
||||
|
||||
while ($row = $db->fetchByAssoc($result)) {
|
||||
// need to concatenate since GMT times can bridge two local days
|
||||
$timeStart = strtotime($db->fromConvert($row['date_start'], 'datetime'));
|
||||
$timeRemind = $row['reminder_time'];
|
||||
$timeStart -= $timeRemind;
|
||||
$row['description'] = (isset($row['description'])) ? $row['description'] : '';
|
||||
|
||||
$relatedToCall = $this->getRelatedName($row['parent_type'], $row['parent_id']);
|
||||
|
||||
$callDescription = $row['description'] ."\n" .$app_strings['MSG_JS_ALERT_MTG_REMINDER_STATUS'] . $row['status'] ."\n". $app_strings['MSG_JS_ALERT_MTG_REMINDER_RELATED_TO']. $relatedToCall;
|
||||
|
||||
|
||||
$this->addAlert($app_strings['MSG_JS_ALERT_MTG_REMINDER_CALL'], $row['name'], $app_strings['MSG_JS_ALERT_MTG_REMINDER_TIME'].$timedate->to_display_date_time($db->fromConvert($row['date_start'], 'datetime')), $app_strings['MSG_JS_ALERT_MTG_REMINDER_DESC'].$callDescription, $timeStart - strtotime($alertDateTimeNow), 'index.php?action=DetailView&module=Calls&record=' . $row['id']);
|
||||
}
|
||||
}
|
||||
}
|
62
include/javascript/jsclass_async.js
Executable file
|
@ -0,0 +1,62 @@
|
|||
/**
|
||||
*
|
||||
* SugarCRM Community Edition is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
|
||||
*
|
||||
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
|
||||
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
|
||||
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
|
||||
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
|
||||
*/function method_callback(o){var resp=JSON.parse(o.responseText),request_id=o.tId,result=resp.result;if(result==null){return;}
|
||||
reqid=global_request_registry[request_id];if(typeof(reqid)!='undefined'){widget=global_request_registry[request_id][0];method_name=global_request_registry[request_id][1];widget[method_name](result);}}
|
||||
SugarClass.inherit("SugarVCalClient","SugarClass");function SugarVCalClient(){this.init();}
|
||||
SugarVCalClient.prototype.init=function(){};SugarVCalClient.prototype.load=function(user_id,request_id){this.user_id=user_id;YAHOO.util.Connect.asyncRequest('GET','./vcal_server.php?type=vfb&source=outlook&noAuth=noAuth&user_id='+user_id,{success:function(result){if(typeof GLOBAL_REGISTRY.freebusy=='undefined'){GLOBAL_REGISTRY.freebusy=new Object();}
|
||||
if(typeof GLOBAL_REGISTRY.freebusy_adjusted=='undefined'){GLOBAL_REGISTRY.freebusy_adjusted=new Object();}
|
||||
GLOBAL_REGISTRY.freebusy[user_id]=SugarVCalClient.prototype.parseResults(result.responseText,false,global_request_registry[request_id][0].timeslots[0].date_obj);GLOBAL_REGISTRY.freebusy_adjusted[user_id]=SugarVCalClient.prototype.parseResults(result.responseText,true,global_request_registry[request_id][0].timeslots[0].date_obj);global_request_registry[request_id][0].display();},failure:function(result){this.success(result);},argument:{result:result}});};SugarVCalClient.prototype.parseResults=function(textResult,adjusted,meetingDate){var matchXFREEBUSYID=/X\-FREEBUSY\-ID.*?\:([\w]+)\-([\w]+)\-([\w]+)\-([\w]+)\-([\w]+)/g;var matchFREEBUSY=/FREEBUSY.*?\:([\w]+)\/([\w]+)/g;var matchFREEBUSYTYPE=/X\-FREEBUSY\-TYPE.*?\:([\w]+)/g;var timehash=new Object();var dst_id;var dst_start;var dst_end;if(GLOBAL_REGISTRY.current_user.fields.dst_start==null)
|
||||
dst_start='19700101T000000Z';else
|
||||
dst_start=GLOBAL_REGISTRY.current_user.fields.dst_start.replace(/ /gi,'T').replace(/:/gi,'').replace(/-/gi,'')+'Z';if(GLOBAL_REGISTRY.current_user.fields.dst_end==null)
|
||||
dst_end='19700101T000000Z';else
|
||||
dst_end=GLOBAL_REGISTRY.current_user.fields.dst_end.replace(/ /gi,'T').replace(/:/gi,'').replace(/-/gi,'')+'Z';var d=new Date(meetingDate);var offset=d.getTimezoneOffset();if(offset>0||offset<0){gmt_offset_secs=(GLOBAL_REGISTRY.current_user.fields.gmt_offset+60)*60;}else{gmt_offset_secs=GLOBAL_REGISTRY.current_user.fields.gmt_offset*60;}
|
||||
var index=0;while(((resultFREEBUSYID=matchXFREEBUSYID.exec(textResult)))!=null&&((resultFREEBUSY=matchFREEBUSY.exec(textResult)))!=null&&((resultFREEBUSYTYPE=matchFREEBUSYTYPE.exec(textResult)))!=null){var startdate;var enddate;if(adjusted){startdate=SugarDateTime.parseAdjustedDate(resultFREEBUSY[1],dst_start,dst_end,gmt_offset_secs);enddate=SugarDateTime.parseAdjustedDate(resultFREEBUSY[2],dst_start,dst_end,gmt_offset_secs);}
|
||||
else{startdate=SugarDateTime.parseUTCDate(resultFREEBUSY[1]);enddate=SugarDateTime.parseUTCDate(resultFREEBUSY[2]);}
|
||||
var startmins=startdate.getUTCMinutes();if(startmins>=0&&startmins<15){startdate.setUTCMinutes(0);}
|
||||
else if(startmins>=15&&startmins<30){startdate.setUTCMinutes(15);}
|
||||
else if(startmins>=30&&startmins<45){startdate.setUTCMinutes(30);}
|
||||
else{startdate.setUTCMinutes(45);}
|
||||
while(startdate.valueOf()<enddate.valueOf()){var hash=SugarDateTime.getUTCHash(startdate);id=resultFREEBUSYID[1]+'-'+
|
||||
resultFREEBUSYID[2]+'-'+
|
||||
resultFREEBUSYID[3]+'-'+
|
||||
resultFREEBUSYID[4]+'-'+
|
||||
resultFREEBUSYID[5];if(typeof(timehash[hash])=='undefined'){timehash[hash]={records:{}};timehash[hash]['records'][id]=resultFREEBUSYTYPE[1];}else{timehash[hash]['records'][id]=resultFREEBUSYTYPE[1];}
|
||||
startdate=new Date(startdate.valueOf()+(15*60*1000));}
|
||||
index++;}
|
||||
return timehash;};SugarVCalClient.parseResults=SugarVCalClient.prototype.parseResults;SugarRPCClient.allowed_methods=['retrieve','query','save','set_accept_status','get_objects_from_module','email','get_user_array','get_full_list'];SugarClass.inherit("SugarRPCClient","SugarClass");function SugarRPCClient(){this.init();}
|
||||
SugarRPCClient.prototype.allowed_methods=['retrieve','query','get_objects_from_module'];SugarRPCClient.prototype.init=function(){this._showError=function(e){alert("ERROR CONNECTING to: ./index.php?entryPoint=json_server, ERROR:"+e);};this.serviceURL='./index.php?entryPoint=json_server';};SugarRPCClient.prototype.call_method=function(method,args,synchronous){var result,transaction,post_data=JSON.stringify({method:method,id:1,params:[args]});synchronous=synchronous||false;try{if(synchronous){result=$.ajax({type:"POST",url:this.serviceURL,contentType:"application/json",data:post_data,dataType:"json",async:false});result=JSON.parse(result.responseText).result;return result;}else{var currentPostHeader=YAHOO.util.Connect._default_post_header;YAHOO.util.Connect.setDefaultPostHeader("application/json");transaction=YAHOO.util.Connect.asyncRequest('POST',this.serviceURL,{success:method_callback,failure:method_callback},post_data);YAHOO.util.Connect.setDefaultPostHeader(currentPostHeader);return transaction.tId;}}catch(e){this._showError(e);}};var global_rpcClient=new SugarRPCClient();
|
65
include/javascript/jsclass_base.js
Executable file
|
@ -0,0 +1,65 @@
|
|||
/**
|
||||
*
|
||||
* SugarCRM Community Edition is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
|
||||
*
|
||||
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
|
||||
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
|
||||
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
|
||||
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
|
||||
*/function SugarClass(){this.init();}
|
||||
SugarClass.prototype.init=function(){}
|
||||
SugarClass.inherit=function(className,parentClassName){var str=className+".prototype = new "+parentClassName+"();";str+=className+".prototype.constructor = "+className+";";str+=className+".superclass = "+parentClassName+".prototype;";try{SUGAR.util.globalEval(str);}catch(e){}}
|
||||
SugarClass.inherit("SugarContainer","SugarClass");function SugarContainer(root_div){GLOBAL_REGISTRY.container=this;this.init(root_div);}
|
||||
SugarContainer.prototype.init=function(root_div){this.root_div=root_div;SugarContainer.superclass.init.call(this);}
|
||||
SugarContainer.prototype.start=function(root_widget){this.root_widget=new root_widget();this.root_widget.load(this.root_div);}
|
||||
if(typeof(global_request_registry)=="undefined"){var global_request_registry=new Object();}
|
||||
var req_count=0;SugarClass.inherit("SugarDateTime","SugarClass");function SugarDateTime(){this.init(root_div);}
|
||||
SugarDateTime.prototype.init=function(root_div){this.root_div=root_div;}
|
||||
SugarDateTime.mysql2jsDateTime=function(mysql_date,mysql_time){var match=new RegExp(date_reg_format);if(((result=match.exec(mysql_date)))==null){return null;}
|
||||
var match2=new RegExp(time_reg_format);if((result2=match2.exec(mysql_time))==null){result2=[0,0,0,0];}
|
||||
var match3=/^0(\d)/;if((result3=match3.exec(result2[1]))!=null){result2[1]=result3[1];}
|
||||
if(typeof(result2[3])!='undefined'){if(result2[3]=='pm'||result2[3]=='PM'){if(parseInt(result2[1])!=12){result2[1]=parseInt(result2[1])+12;}}
|
||||
else if(result2[1]==12){result2[1]=0;}}
|
||||
return new Date(result[date_reg_positions['Y']],result[date_reg_positions['m']]-1,result[date_reg_positions['d']],result2[1],result2[2],0,0);}
|
||||
SugarDateTime.prototype.getFormattedDate=function(date_obj){var returnDate='';var userDateFormat=GLOBAL_REGISTRY['current_user']['fields']['date_time_format']['date'];var dow=GLOBAL_REGISTRY['calendar_strings']['dom_cal_weekdays_long'][date_obj.getDay()];var month=date_obj.getMonth()+1;month=GLOBAL_REGISTRY['calendar_strings']['dom_cal_month_long'][month];returnDate=dow;for(i=0;i<5;i++){switch(userDateFormat.charAt(i)){case"Y":returnDate+=" "+date_obj.getFullYear();break;case"m":returnDate+=" "+month;break;case"d":returnDate+=" "+date_obj.getDate();break;default:}}
|
||||
return returnDate;}
|
||||
SugarDateTime.getFormattedDate=SugarDateTime.prototype.getFormattedDate;SugarDateTime.prototype.getFormattedDOW=function(date_obj){var hour=config.strings.mod_strings.Calendar.dow[date_obj.getDay()];}
|
||||
SugarDateTime.getFormattedDOW=SugarDateTime.prototype.getFormattedDOW;SugarDateTime.getAMPM=function(date_obj){var hour=date_obj.getHour();var am_pm='AM';if(hour>12){hour-=12;am_pm='PM';}
|
||||
else if(hour==12){am_pm='PM';}
|
||||
else if(hour==0){hour=12;}
|
||||
return am_pm;}
|
||||
SugarDateTime.getFormattedHour=SugarDateTime.prototype.getFormattedHour;SugarDateTime.prototype.parseUTCDate=function(date_string){var match=/(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})Z/;if(((result=match.exec(date_string)))!=null){var new_date=new Date(Date.UTC(result[1],result[2]-1,result[3],result[4],result[5],parseInt(result[6])+time_offset));return new_date;}}
|
||||
SugarDateTime.parseUTCDate=SugarDateTime.prototype.parseUTCDate;SugarDateTime.prototype.parseAdjustedDate=function(date_string,dst_start,dst_end,gmt_offset_secs){var match=/(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})Z/;dst_start_parse=match.exec(dst_start);dst_end_parse=match.exec(dst_end);if(dst_start_parse==null||dst_end_parse==null){var new_date=new Date(result[1],result[2]-1,result[3],result[4],result[5],parseInt(result[6]));new_date=new Date(new_date.getTime()+gmt_offset_secs*1000);}else{dst_start_obj=new Date(dst_start_parse[1],dst_start_parse[2]-1,dst_start_parse[3],dst_start_parse[4],dst_start_parse[5],parseInt(dst_start_parse[6]));dst_end_obj=new Date(dst_end_parse[1],dst_end_parse[2]-1,dst_end_parse[3],dst_end_parse[4],dst_end_parse[5],parseInt(dst_end_parse[6]));if(((result=match.exec(date_string)))!=null){var new_date=new Date(result[1],result[2]-1,result[3],result[4],result[5],parseInt(result[6]));var event_ts=new_date.getTime();var dst_start_ts=dst_start_obj.getTime();var dst_end_ts=dst_end_obj.getTime();if(((event_ts>=dst_start_ts||event_ts<dst_end_ts)&&dst_start_ts>dst_end_ts)||(event_ts>=dst_start_ts&&event_ts<dst_end_ts)){new_date=new Date(new_date.getTime()+60*60*1000);}
|
||||
new_date=new Date(new_date.getTime()+gmt_offset_secs*1000);}}
|
||||
return new_date;}
|
||||
SugarDateTime.parseAdjustedDate=SugarDateTime.prototype.parseAdjustedDate;SugarDateTime.prototype.getUTCHash=function(startdate){var month=(startdate.getUTCMonth()<10)?"0"+startdate.getUTCMonth():""+startdate.getUTCMonth();var day=(startdate.getUTCDate()<10)?"0"+startdate.getUTCDate():""+startdate.getUTCDate();var hours=(startdate.getUTCHours()<10)?"0"+startdate.getUTCHours():""+startdate.getUTCHours();var minutes=(startdate.getUTCMinutes()<10)?"0"+startdate.getUTCMinutes():""+startdate.getUTCMinutes();return startdate.getUTCFullYear()+month+day+hours+minutes;}
|
||||
SugarDateTime.getUTCHash=SugarDateTime.prototype.getUTCHash;
|
14
include/javascript/jstree/.gitignore
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
/debug
|
||||
/jstree.sublime-project
|
||||
/jstree.sublime-workspace
|
||||
/bower_components
|
||||
/node_modules
|
||||
/site
|
||||
/nuget
|
||||
/demo/filebrowser/data/root
|
||||
/npm.txt
|
||||
/libs
|
||||
/docs
|
||||
/dist/libs
|
||||
/.vscode
|
||||
/.idea
|
22
include/javascript/jstree/LICENSE-MIT
Normal file
|
@ -0,0 +1,22 @@
|
|||
Copyright (c) 2014 Ivan Bozhanov
|
||||
|
||||
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.
|
662
include/javascript/jstree/README.md
Normal file
|
@ -0,0 +1,662 @@
|
|||
# jstree
|
||||
|
||||
[jsTree](http://www.jstree.com/) is jquery plugin, that provides interactive trees. It is absolutely free, [open source](https://github.com/vakata/jstree) and distributed under the MIT license.
|
||||
|
||||
jsTree is easily extendable, themable and configurable, it supports HTML & JSON data sources, AJAX & async callback loading.
|
||||
|
||||
jsTree functions properly in either box-model (content-box or border-box), can be loaded as an AMD module, and has a built in mobile theme for responsive design, that can easily be customized. It uses jQuery's event system, so binding callbacks on various events in the tree is familiar and easy.
|
||||
|
||||
You also get:
|
||||
* drag & drop support
|
||||
* keyboard navigation
|
||||
* inline edit, create and delete
|
||||
* tri-state checkboxes
|
||||
* fuzzy searching
|
||||
* customizable node types
|
||||
|
||||
_Aside from this readme you can find a lot more info on [jstree.com](http://www.jstree.com) & [the discussion group](https://groups.google.com/forum/#!forum/jstree)_.
|
||||
|
||||
---
|
||||
|
||||
<!-- MarkdownTOC depth=0 autolink=true bracket=round -->
|
||||
|
||||
- [Getting Started](#getting-started)
|
||||
- [Include all neccessary files](#include-all-neccessary-files)
|
||||
- [Populating a tree using HTML](#populating-a-tree-using-html)
|
||||
- [Populating a tree using an array \(or JSON\)](#populating-a-tree-using-an-array-or-json)
|
||||
- [The required JSON format](#the-required-json-format)
|
||||
- [Populating the tree using AJAX](#populating-the-tree-using-ajax)
|
||||
- [Populating the tree using AJAX and lazy loading nodes](#populating-the-tree-using-ajax-and-lazy-loading-nodes)
|
||||
- [Populating the tree using a callback function](#populating-the-tree-using-a-callback-function)
|
||||
- [Working with events](#working-with-events)
|
||||
- [Interacting with the tree using the API](#interacting-with-the-tree-using-the-api)
|
||||
- [More on configuration](#more-on-configuration)
|
||||
- [Plugins](#plugins)
|
||||
- [checkbox](#checkbox)
|
||||
- [contextmenu](#contextmenu)
|
||||
- [dnd](#dnd)
|
||||
- [massload](#massload)
|
||||
- [search](#search)
|
||||
- [sort](#sort)
|
||||
- [state](#state)
|
||||
- [types](#types)
|
||||
- [unique](#unique)
|
||||
- [wholerow](#wholerow)
|
||||
- [More plugins](#more-plugins)
|
||||
- [PHP demos moved to new repository](#php-demos-moved-to-new-repository)
|
||||
- [License & Contributing](#license--contributing)
|
||||
|
||||
<!-- /MarkdownTOC -->
|
||||
|
||||
|
||||
---
|
||||
|
||||
## Getting Started
|
||||
|
||||
### Include all neccessary files
|
||||
To get started you need 3 things in your page:
|
||||
1. jQuery (anything above 1.9.1 will work)
|
||||
2. A jstree theme (there is only one theme supplied by default)
|
||||
3. The jstree source file
|
||||
|
||||
```html
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
|
||||
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/jstree/3.3.3/themes/default/style.min.css" />
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/jstree/3.3.3/jstree.min.js"></script>
|
||||
```
|
||||
|
||||
_If you decide to host jstree yourself - the files are located in the `dist` folder. You can safely ignore the `dist/libs` folder._
|
||||
|
||||
---
|
||||
|
||||
### Populating a tree using HTML
|
||||
|
||||
Now we are all set to create a tree, inline HTML is the easiest option (suitable for menus). All you need to do is select a node (using a jQuery selector) and invoke the `.jstree()` function to let jstree know you want to render a tree inside the selected node. `$.jstree.create(element)` can be used too.
|
||||
|
||||
```html
|
||||
<div id="container">
|
||||
<ul>
|
||||
<li>Root node
|
||||
<ul>
|
||||
<li>Child node 1</li>
|
||||
<li>Child node 2</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<script>
|
||||
$(function() {
|
||||
$('#container').jstree();
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
[view result](http://jsfiddle.net/vakata/2kwkh2uL/)
|
||||
|
||||
_You can add a few options when rendering a node using a data-attribute (note the quotes):_
|
||||
```html
|
||||
<li data-jstree='{ "selected" : true, "opened" : true }'>Root node ...
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Populating a tree using an array (or JSON)
|
||||
|
||||
Building trees from HTML is easy, but it is not very flexible, inline JS data is a better option:
|
||||
|
||||
```html
|
||||
<div id="container"></div>
|
||||
<script>
|
||||
$(function() {
|
||||
$('#container').jstree({
|
||||
'core' : {
|
||||
'data' : [
|
||||
{ "text" : "Root node", "children" : [
|
||||
{ "text" : "Child node 1" },
|
||||
{ "text" : "Child node 2" }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
[view result](http://jsfiddle.net/vakata/2kwkh2uL/4478/)
|
||||
|
||||
Unlike the previous simple HTML example, this time the `.jstree()` function accepts a config object.
|
||||
|
||||
For now it is important to note that jstree will try to parse any data you specify in the `core.data` key and use it to create a tree. As seen in the previous example, if this key is missing jstree will try to parse the inline HTML of the container.
|
||||
|
||||
#### The required JSON format
|
||||
|
||||
The data you use must be in a specific format, each branch of the tree is represented by an object, which must at least have a `text` key. The `children` key can be used to add children to the branch, it should be an array of objects.
|
||||
|
||||
_Keep in mind, you can use a simple string instead of an object if all you need is node with the given text, the above data can be written as:_
|
||||
|
||||
```js
|
||||
[ { "text" : "Root node", "children" : [ "Child node 1", "Child node 2" ] } ]
|
||||
```
|
||||
|
||||
There are other available options for each node, only set them if you need them like:
|
||||
|
||||
* `id` - makes if possible to identify a node later (will also be used as a DOM ID of the `LI` node). _Make sure you do not repeat the same ID in a tree instance (that would defeat its purpose of being a unique identifier and may cause problems for jstree)_.
|
||||
* `icon` - a string which will be used for the node's icon - this can either be a path to a file, or a className (or list of classNames), which you can style in your CSS (font icons also work).
|
||||
* `data` - this can be anything you want - it is metadata you want attached to the node - you will be able to access and modify it any time later - it has no effect on the visuals of the node.
|
||||
* `state` - an object specifyng a few options about the node:
|
||||
- `selected` - if the node should be initially selected
|
||||
- `opened` - if the node should be initially opened
|
||||
- `disabled` - if the node should be disabled
|
||||
- `checked` - __checkbox plugin specific__ - if the node should be checked (only used when `tie_selection` is `false`, which you should only do if you really know what you are doing)
|
||||
- `undetermined` - __checkbox plugin specific__ - if the node should be rendered in undetermined state (only used with lazy loading and when the node is not yet loaded, otherwise this state is automatically calculated).
|
||||
* `type` - __types plugin specific__ - the type of the nodes (should be defined in the types config), if not set `"default"` is assumed.
|
||||
* `li_attr` - object of values which will be used to add HTML attributes on the resulting `LI` DOM node.
|
||||
* `a_attr` - object of values which will be used to add HTML attributes on the resulting `A` node.
|
||||
|
||||
Here is a new demo with some of those properties set:
|
||||
|
||||
```html
|
||||
<div id="container"></div>
|
||||
<script>
|
||||
$(function() {
|
||||
$('#container').jstree({
|
||||
'core' : {
|
||||
'data' : [
|
||||
{
|
||||
"text" : "Root node",
|
||||
"state" : {"opened" : true },
|
||||
"children" : [
|
||||
{
|
||||
"text" : "Child node 1",
|
||||
"state" : { "selected" : true },
|
||||
"icon" : "glyphicon glyphicon-flash"
|
||||
},
|
||||
{ "text" : "Child node 2", "state" : { "disabled" : true } }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
[view result](http://jsfiddle.net/vakata/2kwkh2uL/4479/)
|
||||
|
||||
---
|
||||
|
||||
### Populating the tree using AJAX
|
||||
|
||||
Building off of the previous example, let's see how to have jstree make AJAX requests for you.
|
||||
|
||||
```html
|
||||
<div id="container"></div>
|
||||
<script>
|
||||
$(function() {
|
||||
$('#container').jstree({
|
||||
'core' : {
|
||||
'data' : {
|
||||
"url" : "//www.jstree.com/fiddle/",
|
||||
"dataType" : "json" // needed only if you do not supply JSON headers
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
The server response is:
|
||||
```json
|
||||
[{
|
||||
"id":1,"text":"Root node","children":[
|
||||
{"id":2,"text":"Child node 1"},
|
||||
{"id":3,"text":"Child node 2"}
|
||||
]
|
||||
}]
|
||||
```
|
||||
|
||||
[view result](http://jsfiddle.net/vakata/2kwkh2uL/4480/)
|
||||
|
||||
Instead of a JS array, you can set `core.data` to a [jQuery AJAX config](http://api.jquery.com/jQuery.ajax/).
|
||||
jsTree will hit that URL, and provided you return properly formatted JSON it will be displayed.
|
||||
|
||||
_If you cannot provide proper JSON headers, set `core.data.dataType` to `"json"`._
|
||||
|
||||
The ids in the server response make it possible to identify nodes later (which we will see in the next few demos), but they are not required.
|
||||
|
||||
__WHEN USING IDS MAKE SURE THEY ARE UNIQUE INSIDE A PARTICULAR TREE__
|
||||
|
||||
---
|
||||
|
||||
### Populating the tree using AJAX and lazy loading nodes
|
||||
|
||||
Lazy loading means nodes will be loaded when they are needed. Imagine you have a huge amount of nodes you want to show, but loading them with a single request is way too much traffic. Lazy loading makes it possible to load nodes on the fly - jstree will perform AJAX requests as the user browses the tree.
|
||||
|
||||
Here we take our previous example, and lazy load the "Child node 1" node.
|
||||
|
||||
```html
|
||||
<div id="container"></div>
|
||||
<script>
|
||||
$(function() {
|
||||
$('#container').jstree({
|
||||
'core' : {
|
||||
'data' : {
|
||||
"url" : "//www.jstree.com/fiddle/?lazy",
|
||||
"data" : function (node) {
|
||||
return { "id" : node.id };
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
The initial server response is:
|
||||
```json
|
||||
[{
|
||||
"id":1,"text":"Root node","children":[
|
||||
{"id":2,"text":"Child node 1","children":true},
|
||||
{"id":3,"text":"Child node 2"}
|
||||
]
|
||||
}]
|
||||
```
|
||||
|
||||
[view result](http://jsfiddle.net/vakata/2kwkh2uL/4481/)
|
||||
|
||||
Now to focus on what is different. First off the `"data"` config option of the data object. If you check with jQuery, it is supposed to be a string or an object. But jstree makes it possible to set a function.
|
||||
|
||||
Each time jstree needs to make an AJAX call this function will be called and will receive a single parameter - the node that is being loaded. The return value of this function will be used as the actual `"data"` of the AJAX call. To understand better open up the demo and see the requests go off in the console.
|
||||
|
||||
You will notice that the first request goes off to:
|
||||
`http://www.jstree.com/fiddle?lazy&id=#`
|
||||
`#` is the special ID that the function receives when jstree needs to load the root nodes.
|
||||
|
||||
Now go ahead and open the root node - two children will be shown, but no request will be made - that is because we loaded those children along with the first request.
|
||||
|
||||
Onto the next difference - "Child node 1" appears closed - that is because in the data we supplied `true` as the `"children"` property of this node (you can see it in the server response). This special value indicated to jstree, that it has to lazy load the "Child node 1" node.
|
||||
|
||||
Proceed and open this node - you will see a next request fire off to:
|
||||
`http://www.jstree.com/fiddle?lazy&id=2`
|
||||
ID is set to `2` because the node being loaded has an ID of `2`, and we have configured jstree to send the node ID along with the AJAX request (the `data` function).
|
||||
|
||||
The server response is:
|
||||
```json
|
||||
["Child node 3","Child node 4"]
|
||||
```
|
||||
|
||||
_You can also set `"url"` to a function and it works exactly as with `"data"` - each time a request has to be made, jstree will invoke your function and the request will go off to whatever you return in this function. This is useful when dealing with URLs like: `http://example.com/get_children/1`._
|
||||
|
||||
### Populating the tree using a callback function
|
||||
|
||||
Sometimes you may not want jsTree to make AJAX calls for you - you might want to make them yourself, or use some other method of puplating the tree. In that case you can use a callback function.
|
||||
|
||||
```html
|
||||
<div id="container"></div>
|
||||
<script>
|
||||
$(function() {
|
||||
$('#container').jstree({
|
||||
'core' : {
|
||||
'data' : function (node, cb) {
|
||||
if(node.id === "#") {
|
||||
cb([{"text" : "Root", "id" : "1", "children" : true}]);
|
||||
}
|
||||
else {
|
||||
cb(["Child"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
[view result](http://jsfiddle.net/vakata/2kwkh2uL/4482/)
|
||||
|
||||
As you can see your function will receive two arguments - the node whose children need to be loaded and a callback function to call with the data once you have it. The data follows the same familiar JSON format and lazy loading works just as with AJAX (as you can see in the above example).
|
||||
|
||||
---
|
||||
|
||||
## Working with events
|
||||
|
||||
jstree provides a lot of events to let you know something happened with the tree. The events are the same regardless of how you populate the tree.
|
||||
Let's use the most basic event `changed` - it fires when selection on the tree changes:
|
||||
|
||||
```html
|
||||
<div id="container"></div>
|
||||
<script>
|
||||
$(function() {
|
||||
$('#container').jstree({
|
||||
'core' : {
|
||||
'data' : [
|
||||
{"id" : 1, "text" : "Node 1"},
|
||||
{"id" : 2, "text" : "Node 2"},
|
||||
]
|
||||
}
|
||||
});
|
||||
$('#container').on("changed.jstree", function (e, data) {
|
||||
console.log("The selected nodes are:");
|
||||
console.log(data.selected);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
[view result](http://jsfiddle.net/vakata/2kwkh2uL/4483/)
|
||||
|
||||
All jstree events fire in a special `".jstree"` namespace - this is why we listen for `"changed.jstree"`. The handler itself receives one additional parameter - it will be populated with all you need to know about the event that happened. In this case `data.selected` is an array of selected node IDs (please note, that if you have not specified IDs they will be autogenerated).
|
||||
|
||||
Let's extend this a bit and log out the text of the node instead of the ID.
|
||||
|
||||
```js
|
||||
$('#container').on("changed.jstree", function (e, data) {
|
||||
console.log(data.instance.get_selected(true)[0].text);
|
||||
console.log(data.instance.get_node(data.selected[0]).text);
|
||||
});
|
||||
```
|
||||
|
||||
The two rows above achieve exactly the same thing - get the text of the first selected node.
|
||||
|
||||
In the `data` argument object you will always get an `instance` key - that is a reference to the tree instance, so that you can easily invoke methods.
|
||||
|
||||
__All available functions and events are documented in the API docs__
|
||||
|
||||
---
|
||||
|
||||
## Interacting with the tree using the API
|
||||
|
||||
We scratched the surface on interacting with the tree in the previous example. Let's move on to obtaining an instance and calling a method on this instance:
|
||||
|
||||
```html
|
||||
<button>Select node 1</button>
|
||||
<div id="container"></div>
|
||||
<script>
|
||||
$(function() {
|
||||
$('#container').jstree({
|
||||
'core' : {
|
||||
'data' : [
|
||||
{"id" : 1, "text" : "Node 1"},
|
||||
{"id" : 2, "text" : "Node 2"},
|
||||
]
|
||||
}
|
||||
});
|
||||
$('button').on("click", function () {
|
||||
var instance = $('#container').jstree(true);
|
||||
instance.deselect_all();
|
||||
instance.select_node('1');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
[view result](http://jsfiddle.net/vakata/2kwkh2uL/4484/)
|
||||
|
||||
The above example shows how to obtain a reference to a jstree instance (again with a selector, but this time instead of a config, we pass a boolean `true`), and call a couple of methods - the latter one is selecting a node by its ID.
|
||||
|
||||
Methods can also be invoked like this:
|
||||
|
||||
```js
|
||||
$('#container').jstree("select_node", "1");
|
||||
```
|
||||
|
||||
__All available functions and events are documented in the API docs__
|
||||
|
||||
## More on configuration
|
||||
|
||||
We already covered the config object in general (when we specified inline & AJAX data sources).
|
||||
|
||||
```js
|
||||
$("#tree").jstree({ /* config object goes here */ });
|
||||
```
|
||||
|
||||
Each key in the config object corresponds to a plugin, and the value of that key is the configuration for that plugin. There are also two special keys `"core"` and `"plugins"`:
|
||||
* `"core"` stores the core configuration options
|
||||
* `"plugins"` is an array of plugin names (strings) you want active on the instance
|
||||
|
||||
When configuring you only need to set values that you want to be different from the defaults.
|
||||
|
||||
__All config options and defaults are documented in the API docs__
|
||||
|
||||
```js
|
||||
$("#tree").jstree({
|
||||
"core" : { // core options go here
|
||||
"multiple" : false, // no multiselection
|
||||
"themes" : {
|
||||
"dots" : false // no connecting dots between dots
|
||||
}
|
||||
},
|
||||
"plugins" : ["state"] // activate the state plugin on this instance
|
||||
});
|
||||
```
|
||||
|
||||
[view result](http://jsfiddle.net/vakata/2kwkh2uL/4485/)
|
||||
|
||||
We will cover all plugins further down.
|
||||
|
||||
__Keep in mind by default all modifications to the structure are prevented - that means drag'n'drop, create, rename, delete will not work unless you enable them.__
|
||||
|
||||
```js
|
||||
$("#tree").jstree({
|
||||
"core" : {
|
||||
"check_callback" : true, // enable all modifications
|
||||
},
|
||||
"plugins" : ["dnd","contextmenu"]
|
||||
});
|
||||
```
|
||||
|
||||
[view result](http://jsfiddle.net/vakata/2kwkh2uL/4486/)
|
||||
|
||||
`"core.check_callback"` can also be set to a function, that will be invoked every time a modification is about to happen (or when jstree needs to check if a modification is possible). If you return `true` the operation will be allowed, a value of `false` means it will not be allowed. The possible operation you can expect are `create_node`, `rename_node`, `delete_node`, `move_node` and `copy_node`. The `more` parameter will contain various information provided by the plugin that is invoking the check. For example the DND plugin will provide an object containing information about the move or copy operation that is being checked - is it a multi tree operation, which node is currently hovered, where the insert arrow is pointing - before, after or inside, etc.
|
||||
|
||||
```js
|
||||
$("#tree").jstree({
|
||||
"core" : {
|
||||
"check_callback" : function (operation, node, parent, position, more) {
|
||||
if(operation === "copy_node" || operation === "move_node") {
|
||||
if(parent.id === "#") {
|
||||
return false; // prevent moving a child above or below the root
|
||||
}
|
||||
},
|
||||
return true; // allow everything else
|
||||
}
|
||||
},
|
||||
"plugins" : ["dnd","contextmenu"]
|
||||
});
|
||||
```
|
||||
|
||||
[view result](http://jsfiddle.net/vakata/2kwkh2uL/4487/)
|
||||
|
||||
The `more` parameter you receive contains other information related to the check being performed.
|
||||
|
||||
__For example__: `move_node` & `copy_node` checks will fire repeatedly while the user drags a node, if the check was triggered by the `dnd` plugin `more` will contain a `dnd` key, which will be set to `true`.
|
||||
You can check for `more.dnd` and only perform a certain action if `dnd` triggered the check.
|
||||
If you only want to perform an operation when a node is really about to be dropped check for `more.core`.
|
||||
|
||||
## Plugins
|
||||
|
||||
jsTree comes with a few plugin bundled, but they will only modify your tree if you activate them using the `"plugins"` config option. Here is a brief description of each plugin. You can read more on the available config options for each plugin in the API docs.
|
||||
|
||||
### checkbox
|
||||
Renders a checkbox icon in front of each node, making multiselection easy. It also has a "tri-state" option, meaning a node with some of its children checked will get a "square" icon.
|
||||
|
||||
_Keep in mind that if any sort of cascade is enabled, disabled nodes may be checked too (not by themselves, but for example when a parent of a disabled node is checked and selection is configured to cascade down)._
|
||||
|
||||
```js
|
||||
$("#tree").jstree({
|
||||
"plugins" : ["checkbox"]
|
||||
});
|
||||
```
|
||||
|
||||
[view result](http://jsfiddle.net/vakata/2kwkh2uL/4488/)
|
||||
|
||||
### contextmenu
|
||||
Makes it possible to right click nodes and shows a list of configurable actions in a menu.
|
||||
|
||||
```js
|
||||
$("#tree").jstree({
|
||||
"core" : { "check_callback" : true }, // so that modifying operations work
|
||||
"plugins" : ["contextmenu"]
|
||||
});
|
||||
```
|
||||
|
||||
[view result](http://jsfiddle.net/vakata/2kwkh2uL/4489/)
|
||||
|
||||
### dnd
|
||||
Makes it possible to drag and drop tree nodes and rearrange the tree.
|
||||
|
||||
```js
|
||||
$("#tree").jstree({
|
||||
"core" : { "check_callback" : true }, // so that operations work
|
||||
"plugins" : ["dnd"]
|
||||
});
|
||||
```
|
||||
|
||||
[view result](http://jsfiddle.net/vakata/2kwkh2uL/4490/)
|
||||
|
||||
### massload
|
||||
Makes it possible to load multiple nodes in a single go (for a lazy loaded tree).
|
||||
|
||||
```js
|
||||
$("#tree").jstree({
|
||||
"core" : {
|
||||
"data" : { .. AJAX config .. }
|
||||
},
|
||||
"massload" : {
|
||||
"url" : "/some/path",
|
||||
"data" : function (nodes) {
|
||||
return { "ids" : nodes.join(",") };
|
||||
}
|
||||
},
|
||||
"plugins" : [ "massload", "state" ]
|
||||
});
|
||||
```
|
||||
|
||||
### search
|
||||
Adds the possibility to search for items in the tree and show only matching nodes. It also has AJAX / callback hooks, so that search will work on lazy loaded trees too.
|
||||
|
||||
```html
|
||||
<form id="s">
|
||||
<input type="search" id="q" />
|
||||
<button type="submit">Search</button>
|
||||
</form>
|
||||
<script>
|
||||
$("#container").jstree({
|
||||
"plugins" : ["search"]
|
||||
});
|
||||
$("#s").submit(function(e) {
|
||||
e.preventDefault();
|
||||
$("#container").jstree(true).search($("#q").val());
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
[view result](http://jsfiddle.net/vakata/2kwkh2uL/4491/)
|
||||
|
||||
### sort
|
||||
Automatically arranges all sibling nodes according to a comparison config option function, which defaults to alphabetical order.
|
||||
|
||||
```js
|
||||
$("#tree").jstree({
|
||||
"plugins" : ["sort"]
|
||||
});
|
||||
```
|
||||
|
||||
[view result](http://jsfiddle.net/vakata/2kwkh2uL/4492/)
|
||||
|
||||
### state
|
||||
Saves all opened and selected nodes in the user's browser, so when returning to the same tree the previous state will be restored.
|
||||
|
||||
```js
|
||||
$("#tree").jstree({
|
||||
// the key is important if you have multiple trees in the same domain
|
||||
"state" : { "key" : "state_demo" },
|
||||
"plugins" : ["state"]
|
||||
});
|
||||
```
|
||||
|
||||
[view result](http://jsfiddle.net/vakata/2kwkh2uL/4493/)
|
||||
|
||||
### types
|
||||
Makes it possible to add a "type" for a node, which means to easily control nesting rules and icon for groups of nodes instead of individually. To set a node type add a type property to the node structure.
|
||||
|
||||
```js
|
||||
$("#tree").jstree({
|
||||
"types" : {
|
||||
"default" : {
|
||||
"icon" : "glyphicon glyphicon-flash"
|
||||
},
|
||||
"demo" : {
|
||||
"icon" : "glyphicon glyphicon-ok"
|
||||
}
|
||||
},
|
||||
"plugins" : ["types"]
|
||||
});
|
||||
```
|
||||
|
||||
[view result](http://jsfiddle.net/vakata/2kwkh2uL/4494/)
|
||||
|
||||
### unique
|
||||
Enforces that no nodes with the same name can coexist as siblings - prevents renaming and moving nodes to a parent, which already contains a node with the same name.
|
||||
|
||||
```js
|
||||
$("#tree").jstree({
|
||||
"plugins" : ["unique"]
|
||||
});
|
||||
```
|
||||
|
||||
[view result](http://jsfiddle.net/vakata/2kwkh2uL/4495/)
|
||||
|
||||
### wholerow
|
||||
Makes each node appear block level which makes selection easier. May cause slow down for large trees in old browsers.
|
||||
|
||||
```js
|
||||
$("#tree").jstree({
|
||||
"plugins" : ["wholerow"]
|
||||
});
|
||||
```
|
||||
|
||||
[view result](http://jsfiddle.net/vakata/2kwkh2uL/4496/)
|
||||
|
||||
### More plugins
|
||||
If you create your own plugin (or download a 3rd party one) you must include its source on the page and list its name in the `"plugins"` config array.
|
||||
|
||||
```js
|
||||
// conditional select
|
||||
(function ($, undefined) {
|
||||
"use strict";
|
||||
$.jstree.defaults.conditionalselect = function () { return true; };
|
||||
$.jstree.plugins.conditionalselect = function (options, parent) {
|
||||
this.activate_node = function (obj, e) {
|
||||
if(this.settings.conditionalselect.call(this, this.get_node(obj))) {
|
||||
parent.activate_node.call(this, obj, e);
|
||||
}
|
||||
};
|
||||
};
|
||||
})(jQuery);
|
||||
$("#tree").jstree({
|
||||
"conditionalselect" : function (node) {
|
||||
return node.text === "Root node" ? false : true;
|
||||
},
|
||||
"plugins" : ["conditionalselect"]
|
||||
});
|
||||
```
|
||||
|
||||
[view result](http://jsfiddle.net/vakata/2kwkh2uL/4497/)
|
||||
|
||||
As seen here when creating a plugin you can define a default config, add your own functions to jstree, or override existing ones while maintaining the ability to call the overridden function.
|
||||
|
||||
## PHP demos moved to new repository
|
||||
https://github.com/vakata/jstree-php-demos
|
||||
|
||||
## License & Contributing
|
||||
|
||||
_Please do NOT edit files in the "dist" subdirectory as they are generated via grunt. You'll find source code in the "src" subdirectory!_
|
||||
|
||||
If you want to you can always [donate a small amount][paypal] to help the development of jstree.
|
||||
[paypal]: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=paypal@vakata.com¤cy_code=USD&amount=&return=http://jstree.com/donation&item_name=Buy+me+a+coffee+for+jsTree
|
||||
|
||||
Copyright (c) 2014 Ivan Bozhanov (http://vakata.com)
|
||||
|
||||
Licensed under the [MIT license](http://www.opensource.org/licenses/mit-license.php).
|
32
include/javascript/jstree/bower.json
Normal file
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"name": "jstree",
|
||||
"version": "3.3.4",
|
||||
"main" : [
|
||||
"./dist/jstree.js",
|
||||
"./dist/themes/default/style.css"
|
||||
],
|
||||
"ignore": [
|
||||
"**/.*",
|
||||
"docs",
|
||||
"demo",
|
||||
"libs",
|
||||
"node_modules",
|
||||
"test",
|
||||
"libs",
|
||||
"jstree.jquery.json",
|
||||
"gruntfile.js",
|
||||
"package.json",
|
||||
"bower.json",
|
||||
"component.json",
|
||||
"LICENCE-MIT",
|
||||
"README.md"
|
||||
],
|
||||
"dependencies": {
|
||||
"jquery": ">=1.9.1"
|
||||
},
|
||||
"keywords": [
|
||||
"ui",
|
||||
"tree",
|
||||
"jstree"
|
||||
]
|
||||
}
|
28
include/javascript/jstree/component.json
Normal file
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"name": "jstree",
|
||||
"repo": "vakata/jstree",
|
||||
"description": "jsTree is jquery plugin, that provides interactive trees.",
|
||||
"version": "3.3.4",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"ui",
|
||||
"tree",
|
||||
"jstree"
|
||||
],
|
||||
"scripts": [
|
||||
"dist/jstree.js",
|
||||
"dist/jstree.min.js"
|
||||
],
|
||||
"images": [
|
||||
"dist/themes/default/32px.png",
|
||||
"dist/themes/default/40px.png",
|
||||
"dist/themes/default/throbber.gif"
|
||||
],
|
||||
"styles": [
|
||||
"dist/themes/default/style.css",
|
||||
"dist/themes/default/style.min.css"
|
||||
],
|
||||
"dependencies": {
|
||||
"components/jquery": ">=1.9.1"
|
||||
}
|
||||
}
|
46
include/javascript/jstree/composer.json
Normal file
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
"name": "vakata/jstree",
|
||||
"description": "jsTree is jquery plugin, that provides interactive trees.",
|
||||
"type": "component",
|
||||
"homepage": "http://jstree.com",
|
||||
"license": "MIT",
|
||||
"support": {
|
||||
"issues": "https://github.com/vakata/jstree/issues",
|
||||
"forum": "https://groups.google.com/forum/#!forum/jstree",
|
||||
"source": "https://github.com/vakata/jstree"
|
||||
},
|
||||
"authors": [
|
||||
{
|
||||
"name": "Ivan Bozhanov",
|
||||
"email": "jstree@jstree.com"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"components/jquery": ">=1.9.1"
|
||||
},
|
||||
"suggest": {
|
||||
"robloach/component-installer": "Allows installation of Components via Composer"
|
||||
},
|
||||
"extra": {
|
||||
"component": {
|
||||
"scripts": [
|
||||
"dist/jstree.js"
|
||||
],
|
||||
"styles": [
|
||||
"dist/themes/default/style.css"
|
||||
],
|
||||
"images": [
|
||||
"dist/themes/default/32px.png",
|
||||
"dist/themes/default/40px.png",
|
||||
"dist/themes/default/throbber.gif"
|
||||
],
|
||||
"files": [
|
||||
"dist/jstree.min.js",
|
||||
"dist/themes/default/style.min.css",
|
||||
"dist/themes/default/32px.png",
|
||||
"dist/themes/default/40px.png",
|
||||
"dist/themes/default/throbber.gif"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
2
include/javascript/jstree/demo/README.md
Normal file
|
@ -0,0 +1,2 @@
|
|||
## PHP demos moved to new repository
|
||||
https://github.com/vakata/jstree-php-demos
|
146
include/javascript/jstree/demo/basic/index.html
Normal file
|
@ -0,0 +1,146 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>jstree basic demos</title>
|
||||
<style>
|
||||
html { margin:0; padding:0; font-size:62.5%; }
|
||||
body { max-width:800px; min-width:300px; margin:0 auto; padding:20px 10px; font-size:14px; font-size:1.4em; }
|
||||
h1 { font-size:1.8em; }
|
||||
.demo { overflow:auto; border:1px solid silver; min-height:100px; }
|
||||
</style>
|
||||
<link rel="stylesheet" href="../../dist/themes/default/style.min.css" />
|
||||
</head>
|
||||
<body>
|
||||
<h1>HTML demo</h1>
|
||||
<div id="html" class="demo">
|
||||
<ul>
|
||||
<li data-jstree='{ "opened" : true }'>Root node
|
||||
<ul>
|
||||
<li data-jstree='{ "selected" : true }'>Child node 1</li>
|
||||
<li>Child node 2</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<h1>Inline data demo</h1>
|
||||
<div id="data" class="demo"></div>
|
||||
|
||||
<h1>Data format demo</h1>
|
||||
<div id="frmt" class="demo"></div>
|
||||
|
||||
<h1>AJAX demo</h1>
|
||||
<div id="ajax" class="demo"></div>
|
||||
|
||||
<h1>Lazy loading demo</h1>
|
||||
<div id="lazy" class="demo"></div>
|
||||
|
||||
<h1>Callback function data demo</h1>
|
||||
<div id="clbk" class="demo"></div>
|
||||
|
||||
<h1>Interaction and events demo</h1>
|
||||
<button id="evts_button">select node with id 1</button> <em>either click the button or a node in the tree</em>
|
||||
<div id="evts" class="demo"></div>
|
||||
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
|
||||
<script src="../../dist/jstree.min.js"></script>
|
||||
|
||||
<script>
|
||||
// html demo
|
||||
$('#html').jstree();
|
||||
|
||||
// inline data demo
|
||||
$('#data').jstree({
|
||||
'core' : {
|
||||
'data' : [
|
||||
{ "text" : "Root node", "children" : [
|
||||
{ "text" : "Child node 1" },
|
||||
{ "text" : "Child node 2" }
|
||||
]}
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
// data format demo
|
||||
$('#frmt').jstree({
|
||||
'core' : {
|
||||
'data' : [
|
||||
{
|
||||
"text" : "Root node",
|
||||
"state" : { "opened" : true },
|
||||
"children" : [
|
||||
{
|
||||
"text" : "Child node 1",
|
||||
"state" : { "selected" : true },
|
||||
"icon" : "jstree-file"
|
||||
},
|
||||
{ "text" : "Child node 2", "state" : { "disabled" : true } }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
// ajax demo
|
||||
$('#ajax').jstree({
|
||||
'core' : {
|
||||
'data' : {
|
||||
"url" : "./root.json",
|
||||
"dataType" : "json" // needed only if you do not supply JSON headers
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// lazy demo
|
||||
$('#lazy').jstree({
|
||||
'core' : {
|
||||
'data' : {
|
||||
"url" : "//www.jstree.com/fiddle/?lazy",
|
||||
"data" : function (node) {
|
||||
return { "id" : node.id };
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// data from callback
|
||||
$('#clbk').jstree({
|
||||
'core' : {
|
||||
'data' : function (node, cb) {
|
||||
if(node.id === "#") {
|
||||
cb([{"text" : "Root", "id" : "1", "children" : true}]);
|
||||
}
|
||||
else {
|
||||
cb(["Child"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// interaction and events
|
||||
$('#evts_button').on("click", function () {
|
||||
var instance = $('#evts').jstree(true);
|
||||
instance.deselect_all();
|
||||
instance.select_node('1');
|
||||
});
|
||||
$('#evts')
|
||||
.on("changed.jstree", function (e, data) {
|
||||
if(data.selected.length) {
|
||||
alert('The selected node is: ' + data.instance.get_node(data.selected[0]).text);
|
||||
}
|
||||
})
|
||||
.jstree({
|
||||
'core' : {
|
||||
'multiple' : false,
|
||||
'data' : [
|
||||
{ "text" : "Root node", "children" : [
|
||||
{ "text" : "Child node 1", "id" : 1 },
|
||||
{ "text" : "Child node 2" }
|
||||
]}
|
||||
]
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
1
include/javascript/jstree/demo/basic/root.json
Normal file
|
@ -0,0 +1 @@
|
|||
[{"id":1,"text":"Root node","children":[{"id":2,"text":"Child node 1"},{"id":3,"text":"Child node 2"}]}]
|
8423
include/javascript/jstree/dist/jstree.js
vendored
Normal file
6
include/javascript/jstree/dist/jstree.min.js
vendored
Normal file
BIN
include/javascript/jstree/dist/themes/default-dark/32px.png
vendored
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
include/javascript/jstree/dist/themes/default-dark/40px.png
vendored
Normal file
After Width: | Height: | Size: 5.6 KiB |
1152
include/javascript/jstree/dist/themes/default-dark/style.css
vendored
Normal file
1
include/javascript/jstree/dist/themes/default-dark/style.min.css
vendored
Normal file
BIN
include/javascript/jstree/dist/themes/default-dark/throbber.gif
vendored
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
include/javascript/jstree/dist/themes/default/32px.png
vendored
Normal file
After Width: | Height: | Size: 3 KiB |
BIN
include/javascript/jstree/dist/themes/default/40px.png
vendored
Normal file
After Width: | Height: | Size: 1.8 KiB |