/** * property-editor.js - keys and values * Versatile editor block for editing properties. Value can be * retrieved later by calling value(). * Property Types: text, uiText, bool, numericRange, enumeration, * dateRange, optionsEditor, skipConditionsEditor, relevanceConditionsEditor */ var ctrlCollapse = true; var isShippoCancel = false; var listIconsImage = {}; var listIconsButtonImage = {}; var isFirstLoadFilibIcons = true; var changeColor; var actionButtonAddingCustomIcon = false; var hasInitialization = false; $.live('.formBuilder .ctrlExpand', 'click', function(event) { ctrlCollapse = false; $('.formBuilder .collapse-expand-session').removeClass('expand-property').addClass('collapse-property'); $('ul.propertyList .collapse_expand_ctrl').trigger('collapse_expand_ctrl_change'); }); $.live('.formBuilder .ctrlCollapse', 'click', function(event) { ctrlCollapse = true; $('.formBuilder .collapse-expand-session').removeClass('collapse-property').addClass('expand-property'); $('ul.propertyList .collapse_expand_ctrl').trigger('collapse_expand_ctrl_change'); }); var makeCboSelectDataFromControl = function($cboCtrl, controlData){ if(!controlData.options){ return; } var bkVal = $cboCtrl.val(); $cboCtrl.empty(); $cboCtrl.append('') $cboCtrl.append(tmp); }); $cboCtrl.val(bkVal); }; var addCboReportDataSourceProject = function($cboReportDataSourceProject, currentDataSourceProject, emptyOptionName){ currentDataSourceProject.sort(function(a, b){ var aVal = a.name?a.name.toLowerCase():''; var bVal = b.name?b.name.toLowerCase():''; if (aVal == bVal) { return 0; // if they are equal, return 0 (no sorting) } else if (aVal > bVal) { return 1; // if a should come after b, return 1 } else { return -1; // if b should come after a, return -1 } }); var emptyOption = $('') .attr(CONST_VALUE, tableItem.id) .text(tableItem.name); combo.append(optionRow); } }); } }); combo.val(defaultValue); } var getPropertyValue = function(property){ if(property.value instanceof Object){ return property.value.val; } else{ return property.value; } } var setPropertyValue = function(property, val){ if(property.value instanceof Object){ property.value.val = val; } else{ property.value = val; } } var showRightPanelHelp = function(url, screenWidth){ var path = DOCS_SERVER; if(url == null || url == "" || url == "/"){ path = path.replace("/articles", ""); url = ""; } var newwindow = window.open(path + url,'doForms Support','height=600,width=600'); if (window.focus) {newwindow.focus()} return false; // $('.builder:visible div.mainWrapper').addClass('showHelp'); // $('.builder:visible .closeHelp').removeClass('disabled'); // var iframeObj = $('').attr('src', DOCS_SERVER + url + '?view=narrow'); // $('.builder:visible div.rightScrollArea') // .empty() // .append(iframeObj); // $('.builder:visible .showHelp .rightScrollAreaClose').off().click(function(){ // $('.builder:visible .closeHelp').addClass('disabled'); // $('.builder:visible div.mainWrapper').removeClass('showHelp'); // }); /*var height = screen.height; var width = screen.width / 3; var posLeft = screen.width - width; window.open(DOCS_SERVER + url, '_blank', 'menubar=no, titlebar=no, toolbar=no, height=' + height + ', width=' + width + ', left=' + posLeft); */ /* var rightPanelStyle = ''; var jqmOverlayStyle = ''; if(screenWidth){ rightPanelStyle = 'width: ' + screenWidth + ';'; }else{ rightPanelStyle = 'width: 20em;'; } rightPanelStyle += 'display: initial; display: inline; z-index: 9999;'; jqmOverlayStyle = 'height: 100%; width: 100%; position: fixed; left: 0px; top: 0px; z-index: 9998; opacity: 0.5; display: initial; opacity: 0;' appendOverlayIfNotExist(); var $jqmOverlay = $($('.jqmOverlay')[0]); var zIndexSave = $jqmOverlay.css('z-index'); var jqmOverlayDisplay = $jqmOverlay.css(CONST_CSS_KEY_DISPLAY); var ignoreOverlayStyle = false; if(jqmOverlayDisplay && jqmOverlayDisplay != CONST_VALUE_NONE){ ignoreOverlayStyle = true; } if(!ignoreOverlayStyle){ $jqmOverlay.attr('style',jqmOverlayStyle); }else{ $jqmOverlay.css('z-index', '9998'); } var iframeObj = $('').attr('src', DOCS_SERVER + url); $('#rightPanel').attr('style', rightPanelStyle) .empty() .append(iframeObj); $jqmOverlay.off().click(function(){ $('#rightPanel').attr('style', 'display: none'); if(!ignoreOverlayStyle){ $(this).attr('style', 'height: 100%; width: 100%; position: fixed; left: 0px; top: 0px; z-index: 9998; opacity: 0.5; display: none;'); }else{ $jqmOverlay.css('z-index', zIndexSave); } $(this).off(); });*/ } var showRightPanelHelpFullUrl = function(url, screenWidth){ var newwindow = window.open(url,'doForms Support','height=600,width=600'); if (window.focus) {newwindow.focus()} return false; /*$('.builder:visible div.mainWrapper').addClass('showHelp'); $('.builder:visible .closeHelp').removeClass('disabled'); var iframeObj = $('').attr('src', url); $('.builder:visible div.rightScrollArea') .empty() .append(iframeObj); $('.builder:visible .showHelp .rightScrollAreaClose').off().click(function(){ $('.builder:visible .closeHelp').addClass('disabled'); $('.builder:visible div.mainWrapper').removeClass('showHelp'); });*/ /*var rightPanelStyle = ''; var jqmOverlayStyle = ''; if(screenWidth){ rightPanelStyle = 'width: ' + screenWidth + ';'; }else{ rightPanelStyle = 'width: 20em;'; } rightPanelStyle += 'display: initial; display: inline; z-index: 9999;'; jqmOverlayStyle = 'height: 100%; width: 100%; position: fixed; left: 0px; top: 0px; z-index: 9998; opacity: 0.5; display: initial; opacity: 0;' appendOverlayIfNotExist(); var $jqmOverlay = $($('.jqmOverlay')[0]); var zIndexSave = $jqmOverlay.css('z-index'); var jqmOverlayDisplay = $jqmOverlay.css(CONST_CSS_KEY_DISPLAY); var ignoreOverlayStyle = false; if(jqmOverlayDisplay && jqmOverlayDisplay != CONST_VALUE_NONE){ ignoreOverlayStyle = true; } if(!ignoreOverlayStyle){ $jqmOverlay.attr('style',jqmOverlayStyle); }else{ $jqmOverlay.css('z-index', '9998'); } var iframeObj = $('').attr('src', url); $('#rightPanel').attr('style', rightPanelStyle) .empty() .append(iframeObj); $jqmOverlay.off().click(function(){ $('#rightPanel').attr('style', 'display: none'); if(!ignoreOverlayStyle){ $(this).attr('style', 'height: 100%; width: 100%; position: fixed; left: 0px; top: 0px; z-index: 9998; opacity: 0.5; display: none;'); }else{ $jqmOverlay.css('z-index', zIndexSave); } $(this).off(); });*/ } var showRightPanelHelp_2 = function(url, screenWidth){ var path = DOCS_SERVER; if(url == null || url == "" || url == "/"){ path = path.replace("/articles", ""); url = ""; } var newwindow = window.open(path + url,'doForms Support','height=600,width=600'); if (window.focus) {newwindow.focus()} return false; /*var rightPanelStyle = ''; var jqmOverlayStyle = ''; if(screenWidth){ rightPanelStyle = 'width: ' + screenWidth + ';'; }else{ rightPanelStyle = 'width: 20em;'; } rightPanelStyle += 'display: initial; display: inline; z-index: 9999;'; jqmOverlayStyle = 'height: 100%; width: 100%; position: fixed; left: 0px; top: 0px; z-index: 9998; opacity: 0.5; display: initial; opacity: 0;' appendOverlayIfNotExist(); var $jqmOverlay = $($('.jqmOverlay')[0]); var zIndexSave = $jqmOverlay.css('z-index'); var jqmOverlayDisplay = $jqmOverlay.css(CONST_CSS_KEY_DISPLAY); var ignoreOverlayStyle = false; if(jqmOverlayDisplay && jqmOverlayDisplay != CONST_VALUE_NONE){ ignoreOverlayStyle = true; } if(!ignoreOverlayStyle){ $jqmOverlay.attr('style',jqmOverlayStyle); }else{ $jqmOverlay.css('z-index', '9998'); } var iframeObj = $('').attr('src', DOCS_SERVER + url); $('#rightPanel').attr('style', rightPanelStyle) .empty() .append(iframeObj); $jqmOverlay.off().click(function(){ $('#rightPanel').attr('style', 'display: none'); if(!ignoreOverlayStyle){ $(this).attr('style', 'height: 100%; width: 100%; position: fixed; left: 0px; top: 0px; z-index: 9998; opacity: 0.5; display: none;'); }else{ $jqmOverlay.css('z-index', zIndexSave); } $(this).off(); });*/ } var loadPrivateFormToCombo = function(cboControl){ waitForDataLoading(true); setTimeout(function() { loadPrivateFormToComboNew(cboControl); waitForDataLoading(false); }, 2000); } var loadPrivateFormToComboNew = function(cboControl){ if(!dataNS.PrivateFormJSon || dataNS.pleaseReloadFormList){ reloadPrivateFormJson(); } dataNS.pleaseReloadFormList = false; var saveValue = cboControl.val(); cboControl.empty(); cboControl.append($('