| | |
| | | |
| | | options: { |
| | | useLoadIndicator: false, |
| | | useComboBox: false, |
| | | useComboBox: false |
| | | }, |
| | | |
| | | setOption: function(key, value) { |
| | |
| | | placeholder: '', |
| | | width: 'element', |
| | | selectOnBlur: true, |
| | | allowClear: true, |
| | | allowClear: true |
| | | }); |
| | | } |
| | | }, |
| | |
| | | }); |
| | | } |
| | | |
| | | $('input[data-input-element="date"]').datetimepicker({ |
| | | 'language': 'en', // TODO |
| | | 'todayHighlight': true, |
| | | 'todayBtn': 'linked', |
| | | 'bootcssVer': 3, |
| | | 'fontAwesome': true, |
| | | 'autoclose': true, |
| | | 'minView': 'month' |
| | | }); |
| | | $('input[data-input-element="datetime"]').datetimepicker({ |
| | | 'language': 'en', // TODO |
| | | 'todayHighlight': true, |
| | | 'todayBtn': 'linked', |
| | | 'bootcssVer': 3, |
| | | 'fontAwesome': true, |
| | | 'autoclose': true |
| | | }); |
| | | |
| | | ISPConfig.callHook('onAfterContentLoad', {'url': url, 'data': data }); |
| | | }, |
| | | |
| | | /* THIS ONE SHOULD BE REMOVED AFTER CREATING THE STATIC LOGIN PAGE!!! */ |
| | | submitLoginForm: function(formname) { |
| | | /*submitLoginForm: function(formname) { |
| | | //* Validate form. TODO: username and password with strip(); |
| | | var frm = document.getElementById(formname); |
| | | var userNameObj = frm.username; |
| | |
| | | ISPConfig.reportError('Ajax Request was not successful.110'); |
| | | } |
| | | }); |
| | | }, |
| | | },*/ |
| | | |
| | | submitForm: function(formname, target, confirmation) { |
| | | var successMessage = arguments[3]; |
| | |
| | | if(jqXHR.responseText.indexOf('HEADER_REDIRECT:') > -1) { |
| | | var parts = jqXHR.responseText.split(':'); |
| | | ISPConfig.loadContent(parts[1]); |
| | | } else if (jqXHR.responseText.indexOf('LOGIN_REDIRECT:') > -1) { |
| | | // Go to the login page |
| | | document.location.href = '/index.php'; |
| | | } else { |
| | | $('#pageContent').html(jqXHR.responseText); |
| | | ISPConfig.onAfterContentLoad(target, $('#'+formname).serialize()); |
| | |
| | | loadInitContent: function() { |
| | | var pageContentObject = $.ajax({ |
| | | type: "GET", |
| | | url: "content.php", |
| | | data: "s_mod=login&s_pg=index", |
| | | url: "dashboard/dashboard.php", |
| | | data: "", |
| | | dataType: "html", |
| | | beforeSend: function() { |
| | | ISPConfig.showLoadIndicator(); |
| | |
| | | ISPConfig.loadContent(parts[1]); |
| | | } else { |
| | | $('#pageContent').html(jqXHR.responseText); |
| | | ISPConfig.onAfterContentLoad('content.php', "s_mod=login&s_pg=index"); |
| | | ISPConfig.onAfterContentLoad('dashboard/dashboard.php', ""); |
| | | ISPConfig.pageFormChanged = false; |
| | | } |
| | | ISPConfig.hideLoadIndicator(); |
| | |
| | | }); |
| | | }, |
| | | |
| | | loadOptionInto: function(elementid,pagename) { |
| | | loadOptionInto: function(elementid,pagename,callback) { |
| | | var pageContentObject2 = $.ajax({ |
| | | type: "GET", |
| | | url: pagename, |
| | |
| | | foo2.appendChild(document.createTextNode(elemente[i])); |
| | | foo2.value=elemente[i]; |
| | | el.appendChild(foo2); |
| | | } |
| | | if (typeof(callback) != 'undefined') { |
| | | callback(elementid,pagename); |
| | | } |
| | | }, |
| | | error: function() { |
| | |
| | | }); |
| | | |
| | | $(document).on('click', 'a[data-load-content],button[data-load-content]', function(e) { |
| | | e.preventDefault(); |
| | | //e.preventDefault(); |
| | | var content_to_load = $(this).attr('data-load-content'); |
| | | if(!content_to_load) return this; |
| | | |
| | |
| | | }); |
| | | |
| | | $(document).on('click', 'a[data-capp],button[data-capp]', function(e) { |
| | | e.preventDefault(); |
| | | //e.preventDefault(); |
| | | var content_to_load = $(this).attr('data-capp'); |
| | | if(!content_to_load) return this; |
| | | |
| | |
| | | }); |
| | | |
| | | $(document).on('click', 'a[data-submit-form],button[data-submit-form]', function(e) { |
| | | e.preventDefault(); |
| | | //e.preventDefault(); |
| | | |
| | | var $el = $(this); |
| | | var act = $el.attr('data-form-action'); |
| | |
| | | var act = $el.attr('data-form-action'); |
| | | var form = $el.attr('data-submit-form'); |
| | | |
| | | act = act + '?orderby=' + column; |
| | | var dir = $self.attr('data-ordered'); |
| | | |
| | | var separator = '?'; |
| | | if(act.indexOf("?") >= 0){ |
| | | separator = '&'; |
| | | } |
| | | act = act + separator + 'orderby=' + column; |
| | | ISPConfig.submitForm(form, act); |
| | | |
| | | $(document).ajaxComplete(function() { |
| | | var $self = $('#pageForm .table th[data-column="' + column + '"]'); |
| | | $self.parent().children('th[data-column]').removeAttr('data-ordered'); |
| | | if(dir && dir == 'asc') $self.attr('data-ordered', 'desc'); |
| | | else $self.attr('data-ordered', 'asc'); |
| | | }); |
| | | |
| | | } |
| | | }); |
| | | |
| | |
| | | if ($("#pageForm .table #Filter").length > 0) { |
| | | e.preventDefault(); |
| | | } |
| | | }); |
| | | |
| | | $('#globalsearch').ispconfigSearch({ |
| | | dataSrc: '/dashboard/ajax_get_json.php?type=globalsearch', |
| | | resultsLimit: '$ <tmpl_var name="globalsearch_resultslimit_of_txt"> % <tmpl_var name="globalsearch_resultslimit_results_txt">', |
| | | noResultsText: '<tmpl_var name="globalsearch_noresults_text_txt">', |
| | | noResultsLimit: '<tmpl_var name="globalsearch_noresults_limit_txt">', |
| | | searchFieldWatermark: '<tmpl_var name="globalsearch_searchfield_watermark_txt">', |
| | | resultBoxPosition: '' |
| | | }); |
| | | }); |