Fixed changelog direction so newest changes is listed at top of the file. Finished the init function of super powers. Adds rest function inside super power. Adds super powers to all templates. Updates many helper class methods to now use the utility classes. Adds the method to the component entry file (as-well). Moved most methods from the compiler fields class to powers. #955 Refactored many new builder classes from the registry class. Converted the Content class to two builder classes. Adds option to add additional templates to a module. Resolves #1002 by adding STRING instead of WORD. Ported the FOF encryption class into Powers. https://git.vdm.dev/joomla/fof Changed all CSS and JS to use instead of in compiler code. Adds option to turn jQuery off if UIKIT 3 is added. Adds option to auto write injection boilerplate code in Powers area. Adds option to auto write service provider boilerplate code in the Powers area. Improved the method and all banner locations to fetch from https://git.vdm.dev/joomla/jcb-external/ instead. Major stability improvements all over the new powers complier classes. New [base Registry class](https://git.vdm.dev/joomla/super-powers/src/branch/master/src/7e822c03-1b20-41d1-9427-f5b8d5836af7) has been created specially for JCB. Remember to update all plug-ins with this version update (use the package).
This commit is contained in:
@ -836,7 +836,7 @@ jQuery(document).ready(function()
|
||||
});
|
||||
|
||||
function checkAliasField() {
|
||||
getCodeFrom_server(1, 'type', 'type', 'checkAliasField').done(function(result) {
|
||||
getCodeFrom_server(1, 'type', 'type', 'checkAliasField').then(function(result) {
|
||||
if(result){
|
||||
// remove the notice
|
||||
jQuery('.note_create_edit_notice_p').remove();
|
||||
@ -851,7 +851,7 @@ function checkAliasField() {
|
||||
}
|
||||
|
||||
function checkCategoryField() {
|
||||
getCodeFrom_server(1, 'type', 'type', 'checkCategoryField').done(function(result) {
|
||||
getCodeFrom_server(1, 'type', 'type', 'checkCategoryField').then(function(result) {
|
||||
if(result){
|
||||
// remove the notice
|
||||
jQuery('.note_create_edit_notice_p').remove();
|
||||
@ -864,7 +864,7 @@ function checkCategoryField() {
|
||||
}
|
||||
|
||||
function getAjaxDisplay(type){
|
||||
getCodeFrom_server(1, type, 'type', 'getAjaxDisplay').done(function(result) {
|
||||
getCodeFrom_server(1, type, 'type', 'getAjaxDisplay').then(function(result) {
|
||||
if(result){
|
||||
jQuery('#display_'+type).html(result);
|
||||
}
|
||||
@ -882,7 +882,7 @@ function getTableColumns(fieldKey, table_, nr_){
|
||||
if(jQuery("#jform_addtables_"+table_+"addtables"+fieldKey+nr_+"_table").length) {
|
||||
// get options
|
||||
var tableName = jQuery("#jform_addtables_"+table_+"addtables"+fieldKey+nr_+"_table option:selected").val();
|
||||
getCodeFrom_server(1, tableName, 'table', 'tableColumns').done(function(result) {
|
||||
getCodeFrom_server(1, tableName, 'table', 'tableColumns').then(function(result) {
|
||||
if(result){
|
||||
jQuery("textarea#jform_addtables_"+table_+"addtables"+fieldKey+nr_+"_sourcemap").val(result);
|
||||
} else {
|
||||
@ -904,7 +904,7 @@ function getDynamicScripts(id){
|
||||
var current_ext = jQuery('textarea#jform_php_import_ext').val();
|
||||
// set the display method script
|
||||
if(current_import_display.length == 0){
|
||||
getCodeFrom_server(1, 'display', 'type', 'getDynamicScripts').done(function(result) {
|
||||
getCodeFrom_server(1, 'display', 'type', 'getDynamicScripts').then(function(result) {
|
||||
if(result){
|
||||
jQuery('textarea#jform_php_import_display').val(result);
|
||||
}
|
||||
@ -912,7 +912,7 @@ function getDynamicScripts(id){
|
||||
}
|
||||
// set the import method script
|
||||
if(current_import.length == 0){
|
||||
getCodeFrom_server(1, 'import', 'type', 'getDynamicScripts').done(function(result) {
|
||||
getCodeFrom_server(1, 'import', 'type', 'getDynamicScripts').then(function(result) {
|
||||
if(result){
|
||||
jQuery('textarea#jform_php_import').val(result);
|
||||
}
|
||||
@ -920,7 +920,7 @@ function getDynamicScripts(id){
|
||||
}
|
||||
// set the headers method script
|
||||
if(current_headers.length == 0){
|
||||
getCodeFrom_server(1, 'headers', 'type', 'getDynamicScripts').done(function(result) {
|
||||
getCodeFrom_server(1, 'headers', 'type', 'getDynamicScripts').then(function(result) {
|
||||
if(result){
|
||||
jQuery('textarea#jform_php_import_headers').val(result);
|
||||
}
|
||||
@ -928,7 +928,7 @@ function getDynamicScripts(id){
|
||||
}
|
||||
// set the setData method script
|
||||
if(current_setdata.length == 0){
|
||||
getCodeFrom_server(1, 'setdata', 'type', 'getDynamicScripts').done(function(result) {
|
||||
getCodeFrom_server(1, 'setdata', 'type', 'getDynamicScripts').then(function(result) {
|
||||
if(result){
|
||||
jQuery('textarea#jform_php_import_setdata').val(result);
|
||||
}
|
||||
@ -936,7 +936,7 @@ function getDynamicScripts(id){
|
||||
}
|
||||
// set the save method script
|
||||
if(current_save.length == 0){
|
||||
getCodeFrom_server(1, 'save', 'type', 'getDynamicScripts').done(function(result) {
|
||||
getCodeFrom_server(1, 'save', 'type', 'getDynamicScripts').then(function(result) {
|
||||
if(result){
|
||||
jQuery('textarea#jform_php_import_save').val(result);
|
||||
}
|
||||
@ -944,7 +944,7 @@ function getDynamicScripts(id){
|
||||
}
|
||||
// set the view script
|
||||
if(current_view.length == 0){
|
||||
getCodeFrom_server(1, 'view', 'type', 'getDynamicScripts').done(function(result) {
|
||||
getCodeFrom_server(1, 'view', 'type', 'getDynamicScripts').then(function(result) {
|
||||
if(result){
|
||||
jQuery('textarea#jform_html_import_view').val(result);
|
||||
}
|
||||
@ -952,7 +952,7 @@ function getDynamicScripts(id){
|
||||
}
|
||||
// set the import ext script
|
||||
if(current_ext.length == 0){
|
||||
getCodeFrom_server(1, 'ext', 'type', 'getDynamicScripts').done(function(result) {
|
||||
getCodeFrom_server(1, 'ext', 'type', 'getDynamicScripts').then(function(result) {
|
||||
if(result){
|
||||
jQuery('textarea#jform_php_import_ext').val(result);
|
||||
}
|
||||
@ -961,20 +961,29 @@ function getDynamicScripts(id){
|
||||
}
|
||||
}
|
||||
|
||||
function getCodeFrom_server(id, type, type_name, callingName){
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax." + callingName + "&format=json&raw=true&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0 && type.length > 0) {
|
||||
var request = token + '=1&' + type_name + '=' + type + '&id=' + id;
|
||||
function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
var url = "index.php?option=com_componentbuilder&task=ajax." + callingName + "&format=json&raw=true&vdm="+vastDevMod;
|
||||
if (token.length > 0 && id > 0 && type.length > 0) {
|
||||
url += '&' + token + '=1&' + type_name + '=' + type + '&id=' + id;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
var getUrl = JRouter(url);
|
||||
return fetch(getUrl, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(function(response) {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
}).then(function(data) {
|
||||
return data;
|
||||
}).catch(function(error) {
|
||||
console.error('There was a problem with the fetch operation:', error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function getEditCustomCodeButtons_server(id){
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
|
||||
@ -1068,7 +1077,7 @@ function addButton(type, where, size){
|
||||
}
|
||||
|
||||
function getLinked(){
|
||||
getCodeFrom_server(1, 'type', 'type', 'getLinked').done(function(result) {
|
||||
getCodeFrom_server(1, 'type', 'type', 'getLinked').then(function(result) {
|
||||
if(result){
|
||||
jQuery('#display_linked_to').html(result);
|
||||
}
|
||||
|
@ -206,23 +206,32 @@ jQuery(document).ready(function()
|
||||
getEditCustomCodeButtons();
|
||||
});
|
||||
|
||||
function getCodeFrom_server(id, type, type_name, callingName){
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax." + callingName + "&format=json&raw=true&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0 && type.length > 0) {
|
||||
var request = token + '=1&' + type_name + '=' + type + '&id=' + id;
|
||||
function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
var url = "index.php?option=com_componentbuilder&task=ajax." + callingName + "&format=json&raw=true&vdm="+vastDevMod;
|
||||
if (token.length > 0 && id > 0 && type.length > 0) {
|
||||
url += '&' + token + '=1&' + type_name + '=' + type + '&id=' + id;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
var getUrl = JRouter(url);
|
||||
return fetch(getUrl, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(function(response) {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
}).then(function(data) {
|
||||
return data;
|
||||
}).catch(function(error) {
|
||||
console.error('There was a problem with the fetch operation:', error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function getLinked(){
|
||||
getCodeFrom_server(1, 'type', 'type', 'getLinked').done(function(result) {
|
||||
getCodeFrom_server(1, 'type', 'type', 'getLinked').then(function(result) {
|
||||
if(result){
|
||||
jQuery('#display_linked_to').html(result);
|
||||
}
|
||||
@ -230,7 +239,7 @@ function getLinked(){
|
||||
}
|
||||
|
||||
function getSnippetDetails(id){
|
||||
getCodeFrom_server(id, '_type', '_type', 'snippetDetails').done(function(result) {
|
||||
getCodeFrom_server(id, '_type', '_type', 'snippetDetails').then(function(result) {
|
||||
if(result.snippet){
|
||||
var description = '';
|
||||
if (result.description.length > 0) {
|
||||
@ -318,7 +327,7 @@ function getLayoutDetails(id){
|
||||
}
|
||||
|
||||
function getTemplateDetails(id){
|
||||
getCodeFrom_server(id, 'type', 'type', 'templateDetails').done(function(result) {
|
||||
getCodeFrom_server(id, 'type', 'type', 'templateDetails').then(function(result) {
|
||||
if(result){
|
||||
jQuery('#details').append(result);
|
||||
// make sure the code bocks are active
|
||||
@ -354,7 +363,7 @@ function getSnippets(){
|
||||
// get libraries value if set
|
||||
var libraries = jQuery("#jform_libraries").val();
|
||||
if (libraries) {
|
||||
getCodeFrom_server(1, JSON.stringify(libraries), 'libraries', 'getSnippets').done(function(result) {
|
||||
getCodeFrom_server(1, JSON.stringify(libraries), 'libraries', 'getSnippets').then(function(result) {
|
||||
setSnippets(result);
|
||||
jQuery("#loading").hide();
|
||||
if (typeof snippetButton !== 'undefined') {
|
||||
|
@ -1576,7 +1576,7 @@ function getDynamicScripts(id){
|
||||
var current_router_parse = jQuery('textarea#jform_php_router_parse').val();
|
||||
// set the router parse method script
|
||||
if(current_router_parse.length == 0){
|
||||
getCodeFrom_server(1, 'routerparse', 'type', 'getDynamicScripts').done(function(result) {
|
||||
getCodeFrom_server(1, 'routerparse', 'type', 'getDynamicScripts').then(function(result) {
|
||||
if(result){
|
||||
jQuery('textarea#jform_php_router_parse').val(result);
|
||||
}
|
||||
@ -1585,20 +1585,29 @@ function getDynamicScripts(id){
|
||||
}
|
||||
}
|
||||
|
||||
function getCodeFrom_server(id, type, type_name, callingName){
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax." + callingName + "&format=json&raw=true&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0 && type.length > 0) {
|
||||
var request = token + '=1&' + type_name + '=' + type + '&id=' + id;
|
||||
function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
var url = "index.php?option=com_componentbuilder&task=ajax." + callingName + "&format=json&raw=true&vdm="+vastDevMod;
|
||||
if (token.length > 0 && id > 0 && type.length > 0) {
|
||||
url += '&' + token + '=1&' + type_name + '=' + type + '&id=' + id;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
var getUrl = JRouter(url);
|
||||
return fetch(getUrl, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(function(response) {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
}).then(function(data) {
|
||||
return data;
|
||||
}).catch(function(error) {
|
||||
console.error('There was a problem with the fetch operation:', error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function getEditCustomCodeButtons_server(id){
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
|
||||
@ -1640,7 +1649,7 @@ function isObject(obj) {
|
||||
}
|
||||
|
||||
function getLinked(){
|
||||
getCodeFrom_server(1, 'type', 'type', 'getLinked').done(function(result) {
|
||||
getCodeFrom_server(1, 'type', 'type', 'getLinked').then(function(result) {
|
||||
if(result){
|
||||
jQuery('#display_linked_to').html(result);
|
||||
}
|
||||
|
@ -551,7 +551,7 @@ jQuery(document).ready(function()
|
||||
var rowIdKey = 'properties';
|
||||
|
||||
function getFieldTypeProperties(fieldtype, db){
|
||||
getCodeFrom_server(fieldtype, 'type', 'type', 'fieldTypeProperties').done(function(result) {
|
||||
getCodeFrom_server(fieldtype, 'type', 'type', 'fieldTypeProperties').then(function(result) {
|
||||
if(result.subform){
|
||||
// load the list of properties
|
||||
propertiesArray = result.nameListOptions;
|
||||
@ -754,7 +754,7 @@ function getFieldPropertyDesc_server(fieldtype, property){
|
||||
}
|
||||
|
||||
function getValidationRulesTable(){
|
||||
getCodeFrom_server(1,'type','type', 'getValidationRulesTable').done(function(result) {
|
||||
getCodeFrom_server(1,'type','type', 'getValidationRulesTable').then(function(result) {
|
||||
if(result){
|
||||
jQuery('#display_validation_rules').html(result);
|
||||
}
|
||||
@ -822,23 +822,32 @@ function dbChecker(type){
|
||||
}
|
||||
}
|
||||
|
||||
function getCodeFrom_server(id, type, type_name, callingName){
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax." + callingName + "&format=json&raw=true&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0 && type.length > 0) {
|
||||
var request = token + '=1&' + type_name + '=' + type + '&id=' + id;
|
||||
function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
var url = "index.php?option=com_componentbuilder&task=ajax." + callingName + "&format=json&raw=true&vdm="+vastDevMod;
|
||||
if (token.length > 0 && id > 0 && type.length > 0) {
|
||||
url += '&' + token + '=1&' + type_name + '=' + type + '&id=' + id;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
var getUrl = JRouter(url);
|
||||
return fetch(getUrl, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(function(response) {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
}).then(function(data) {
|
||||
return data;
|
||||
}).catch(function(error) {
|
||||
console.error('There was a problem with the fetch operation:', error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function getLinked(){
|
||||
getCodeFrom_server(1, 'type', 'type', 'getLinked').done(function(result) {
|
||||
getCodeFrom_server(1, 'type', 'type', 'getLinked').then(function(result) {
|
||||
if(result){
|
||||
jQuery('#display_linked_to').html(result);
|
||||
}
|
||||
|
@ -541,7 +541,7 @@ function setModuleCode() {
|
||||
var libraries = jQuery("#jform_libraries").val();
|
||||
var values = {'class': selected_get, 'get': custom_gets, 'lib': libraries};
|
||||
var editor_id = 'jform_mod_code';
|
||||
getCodeFrom_server(1, JSON.stringify(values), 'data', 'getModuleCode').done(function(result) {
|
||||
getCodeFrom_server(1, JSON.stringify(values), 'data', 'getModuleCode').then(function(result) {
|
||||
if(result.tmpl){
|
||||
addCodeToEditor(result.tmpl.code, editor_id, result.tmpl.merge, result.tmpl.merge_target);
|
||||
}
|
||||
@ -561,27 +561,36 @@ function setModuleCode() {
|
||||
}
|
||||
|
||||
function getLinked(){
|
||||
getCodeFrom_server(1, 'type', 'type', 'getLinked').done(function(result) {
|
||||
getCodeFrom_server(1, 'type', 'type', 'getLinked').then(function(result) {
|
||||
if(result){
|
||||
jQuery('#display_linked_to').html(result);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getCodeFrom_server(id, type, type_name, callingName){
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax." + callingName + "&format=json&raw=true&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0 && type.length > 0) {
|
||||
var request = token + '=1&' + type_name + '=' + type + '&id=' + id;
|
||||
function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
var url = "index.php?option=com_componentbuilder&task=ajax." + callingName + "&format=json&raw=true&vdm="+vastDevMod;
|
||||
if (token.length > 0 && id > 0 && type.length > 0) {
|
||||
url += '&' + token + '=1&' + type_name + '=' + type + '&id=' + id;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
var getUrl = JRouter(url);
|
||||
return fetch(getUrl, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(function(response) {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
}).then(function(data) {
|
||||
return data;
|
||||
}).catch(function(error) {
|
||||
console.error('There was a problem with the fetch operation:', error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function addCodeToEditor(code_string, editor_id, merge, merge_target){
|
||||
if (Joomla.editors.instances.hasOwnProperty(editor_id)) {
|
||||
@ -703,7 +712,7 @@ function isObject(obj) {
|
||||
}
|
||||
|
||||
function getSnippetDetails(id){
|
||||
getCodeFrom_server(id, '_type', '_type', 'snippetDetails').done(function(result) {
|
||||
getCodeFrom_server(id, '_type', '_type', 'snippetDetails').then(function(result) {
|
||||
if(result.snippet){
|
||||
var description = '';
|
||||
if (result.description.length > 0) {
|
||||
@ -762,7 +771,7 @@ function getSnippets(){
|
||||
// get libraries value if set
|
||||
var libraries = jQuery("#jform_libraries").val();
|
||||
if (libraries) {
|
||||
getCodeFrom_server(1, JSON.stringify(libraries), 'libraries', 'getSnippets').done(function(result) {
|
||||
getCodeFrom_server(1, JSON.stringify(libraries), 'libraries', 'getSnippets').then(function(result) {
|
||||
setSnippets(result);
|
||||
jQuery("#loading").hide();
|
||||
if (typeof snippetButton !== 'undefined') {
|
||||
|
@ -681,20 +681,29 @@ jQuery(document).ready(function()
|
||||
rowWatcher();
|
||||
});
|
||||
|
||||
function getCodeFrom_server(id, type, type_name, callingName){
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax." + callingName + "&format=json&raw=true&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0 && type.length > 0) {
|
||||
var request = token + '=1&' + type_name + '=' + type + '&id=' + id;
|
||||
function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
var url = "index.php?option=com_componentbuilder&task=ajax." + callingName + "&format=json&raw=true&vdm="+vastDevMod;
|
||||
if (token.length > 0 && id > 0 && type.length > 0) {
|
||||
url += '&' + token + '=1&' + type_name + '=' + type + '&id=' + id;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
var getUrl = JRouter(url);
|
||||
return fetch(getUrl, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(function(response) {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
}).then(function(data) {
|
||||
return data;
|
||||
}).catch(function(error) {
|
||||
console.error('There was a problem with the fetch operation:', error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// set selection the options
|
||||
selectionMemory = {'property':{},'method':{}};
|
||||
@ -725,7 +734,7 @@ function getClassHeaderCode(){
|
||||
addCodeToEditor(_result, "jform_head", false, null);
|
||||
} else {
|
||||
// now get the code
|
||||
getCodeFrom_server(value, 'extends', 'type', 'getClassHeaderCode').done(function(result) {
|
||||
getCodeFrom_server(value, 'extends', 'type', 'getClassHeaderCode').then(function(result) {
|
||||
if(result){
|
||||
// now set the code
|
||||
addCodeToEditor(result, "jform_head", false, null);
|
||||
@ -741,7 +750,7 @@ function getClassCodeIds(type, target_field, reset_all){
|
||||
// now get the value
|
||||
var value = jQuery('#'+target_field).val();
|
||||
// now get the code
|
||||
getCodeFrom_server(value, type, 'type', 'getClassCodeIds').done(function(result) {
|
||||
getCodeFrom_server(value, type, 'type', 'getClassCodeIds').then(function(result) {
|
||||
if(result){
|
||||
// reset the selection
|
||||
selectionActiveArray[type] = {};
|
||||
@ -836,7 +845,7 @@ function getClassCode(field, type){
|
||||
}
|
||||
} else {
|
||||
// now get the code
|
||||
getCodeFrom_server(old_value, type, 'type', 'getClassCode').done(function(result) {
|
||||
getCodeFrom_server(old_value, type, 'type', 'getClassCode').then(function(result) {
|
||||
if(result){
|
||||
// now remove the code
|
||||
if (removeCodeFromEditor(result, 'jform_main_class_code')) {
|
||||
@ -874,7 +883,7 @@ function getClassCode(field, type){
|
||||
}
|
||||
} else {
|
||||
// now get the code
|
||||
getCodeFrom_server(value, type, 'type', 'getClassCode').done(function(result) {
|
||||
getCodeFrom_server(value, type, 'type', 'getClassCode').then(function(result) {
|
||||
if(result){
|
||||
// now set the code
|
||||
if (addCodeToEditor(result, "jform_main_class_code", true, _action_add)) {
|
||||
@ -955,7 +964,7 @@ function rowWatcher() {
|
||||
}
|
||||
} else {
|
||||
// now get the code
|
||||
getCodeFrom_server(valid_value, type_call, 'type', 'getClassCode').done(function(result) {
|
||||
getCodeFrom_server(valid_value, type_call, 'type', 'getClassCode').then(function(result) {
|
||||
if(result){
|
||||
if (removeCodeFromEditor(result, 'jform_main_class_code')) {
|
||||
selectionMemory[type_call][valid_call] = 0;;
|
||||
@ -1001,7 +1010,6 @@ function propertyIsSet(prop, id, type) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function addCodeToEditor(code_string, editor_id, merge, merge_target){
|
||||
if (Joomla.editors.instances.hasOwnProperty(editor_id)) {
|
||||
@ -1084,7 +1092,7 @@ function removeCodeFromEditor(code_string, editor_id){
|
||||
|
||||
|
||||
function getLinked(){
|
||||
getCodeFrom_server(1, 'type', 'type', 'getLinked').done(function(result) {
|
||||
getCodeFrom_server(1, 'type', 'type', 'getLinked').then(function(result) {
|
||||
if(result){
|
||||
jQuery('#display_linked_to').html(result);
|
||||
}
|
||||
|
@ -45,20 +45,29 @@ jQuery(document).ready(function($)
|
||||
getEditCustomCodeButtons();
|
||||
});
|
||||
|
||||
function getCodeFrom_server(id, type, type_name, callingName){
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax." + callingName + "&format=json&raw=true&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0 && type.length > 0) {
|
||||
var request = token + '=1&' + type_name + '=' + type + '&id=' + id;
|
||||
function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
var url = "index.php?option=com_componentbuilder&task=ajax." + callingName + "&format=json&raw=true&vdm="+vastDevMod;
|
||||
if (token.length > 0 && id > 0 && type.length > 0) {
|
||||
url += '&' + token + '=1&' + type_name + '=' + type + '&id=' + id;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
var getUrl = JRouter(url);
|
||||
return fetch(getUrl, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(function(response) {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
}).then(function(data) {
|
||||
return data;
|
||||
}).catch(function(error) {
|
||||
console.error('There was a problem with the fetch operation:', error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function getEditCustomCodeButtons_server(id){
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
|
||||
@ -100,7 +109,7 @@ function isObject(obj) {
|
||||
}
|
||||
|
||||
function getSnippetDetails(id){
|
||||
getCodeFrom_server(id, '_type', '_type', 'snippetDetails').done(function(result) {
|
||||
getCodeFrom_server(id, '_type', '_type', 'snippetDetails').then(function(result) {
|
||||
if(result.snippet){
|
||||
var description = '';
|
||||
if (result.description.length > 0) {
|
||||
@ -212,7 +221,7 @@ function getSnippets(){
|
||||
// get libraries value if set
|
||||
var libraries = jQuery("#jform_libraries").val();
|
||||
if (libraries) {
|
||||
getCodeFrom_server(1, JSON.stringify(libraries), 'libraries', 'getSnippets').done(function(result) {
|
||||
getCodeFrom_server(1, JSON.stringify(libraries), 'libraries', 'getSnippets').then(function(result) {
|
||||
setSnippets(result);
|
||||
jQuery("#loading").hide();
|
||||
if (typeof snippetButton !== 'undefined') {
|
||||
|
@ -864,7 +864,7 @@ function addData(result,where){
|
||||
}
|
||||
|
||||
function getAjaxDisplay(type){
|
||||
getCodeFrom_server(1, type, 'type', 'getAjaxDisplay').done(function(result) {
|
||||
getCodeFrom_server(1, type, 'type', 'getAjaxDisplay').then(function(result) {
|
||||
if (result) {
|
||||
jQuery('#display_'+type).html(result);
|
||||
}
|
||||
@ -877,7 +877,7 @@ function getFieldSelectOptions(fieldKey){
|
||||
// first check if the field is set
|
||||
if(jQuery("#jform_addconditions__addconditions"+fieldKey+"__option_field").length) {
|
||||
var fieldId = jQuery("#jform_addconditions__addconditions"+fieldKey+"__option_field option:selected").val();
|
||||
getCodeFrom_server(fieldId, 'type', 'type', 'fieldSelectOptions').done(function(result) {
|
||||
getCodeFrom_server(fieldId, 'type', 'type', 'fieldSelectOptions').then(function(result) {
|
||||
if(result) {
|
||||
jQuery('textarea#jform_addconditions__addconditions'+fieldKey+'__field_options').val(result);
|
||||
} else {
|
||||
@ -887,20 +887,29 @@ function getFieldSelectOptions(fieldKey){
|
||||
}
|
||||
}
|
||||
|
||||
function getCodeFrom_server(id, type, type_name, callingName){
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax." + callingName + "&format=json&raw=true&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0 && type.length > 0) {
|
||||
var request = token + '=1&' + type_name + '=' + type + '&id=' + id;
|
||||
function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
var url = "index.php?option=com_componentbuilder&task=ajax." + callingName + "&format=json&raw=true&vdm="+vastDevMod;
|
||||
if (token.length > 0 && id > 0 && type.length > 0) {
|
||||
url += '&' + token + '=1&' + type_name + '=' + type + '&id=' + id;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
var getUrl = JRouter(url);
|
||||
return fetch(getUrl, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(function(response) {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
}).then(function(data) {
|
||||
return data;
|
||||
}).catch(function(error) {
|
||||
console.error('There was a problem with the fetch operation:', error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function getEditCustomCodeButtons_server(id){
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
|
||||
@ -994,7 +1003,7 @@ function addButton(type, where, size){
|
||||
}
|
||||
|
||||
function getLinked(){
|
||||
getCodeFrom_server(1, 'type', 'type', 'getLinked').done(function(result) {
|
||||
getCodeFrom_server(1, 'type', 'type', 'getLinked').then(function(result) {
|
||||
if(result){
|
||||
jQuery('#display_linked_to').html(result);
|
||||
}
|
||||
|
@ -55,20 +55,29 @@ jQuery(document).ready(function()
|
||||
rowWatcher();
|
||||
});
|
||||
|
||||
function getCodeFrom_server(id, type, type_name, callingName){
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax." + callingName + "&format=json&raw=true&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0 && type.length > 0) {
|
||||
var request = token + '=1&' + type_name + '=' + type + '&id=' + id;
|
||||
function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
var url = "index.php?option=com_componentbuilder&task=ajax." + callingName + "&format=json&raw=true&vdm="+vastDevMod;
|
||||
if (token.length > 0 && id > 0 && type.length > 0) {
|
||||
url += '&' + token + '=1&' + type_name + '=' + type + '&id=' + id;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
var getUrl = JRouter(url);
|
||||
return fetch(getUrl, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(function(response) {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
}).then(function(data) {
|
||||
return data;
|
||||
}).catch(function(error) {
|
||||
console.error('There was a problem with the fetch operation:', error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// set selection the options
|
||||
selectionMemory = {'property':{},'method':{}};
|
||||
@ -99,7 +108,7 @@ function getClassHeaderCode(){
|
||||
addCodeToEditor(_result, "jform_head", false, null);
|
||||
} else {
|
||||
// now get the code
|
||||
getCodeFrom_server(value, 'extends', 'type', 'getClassHeaderCode').done(function(result) {
|
||||
getCodeFrom_server(value, 'extends', 'type', 'getClassHeaderCode').then(function(result) {
|
||||
if(result){
|
||||
// now set the code
|
||||
addCodeToEditor(result, "jform_head", false, null);
|
||||
@ -115,7 +124,7 @@ function getClassCodeIds(type, target_field, reset_all){
|
||||
// now get the value
|
||||
var value = jQuery('#'+target_field).val();
|
||||
// now get the code
|
||||
getCodeFrom_server(value, type, 'type', 'getClassCodeIds').done(function(result) {
|
||||
getCodeFrom_server(value, type, 'type', 'getClassCodeIds').then(function(result) {
|
||||
if(result){
|
||||
// reset the selection
|
||||
selectionActiveArray[type] = {};
|
||||
@ -210,7 +219,7 @@ function getClassCode(field, type){
|
||||
}
|
||||
} else {
|
||||
// now get the code
|
||||
getCodeFrom_server(old_value, type, 'type', 'getClassCode').done(function(result) {
|
||||
getCodeFrom_server(old_value, type, 'type', 'getClassCode').then(function(result) {
|
||||
if(result){
|
||||
// now remove the code
|
||||
if (removeCodeFromEditor(result, 'jform_main_class_code')) {
|
||||
@ -248,7 +257,7 @@ function getClassCode(field, type){
|
||||
}
|
||||
} else {
|
||||
// now get the code
|
||||
getCodeFrom_server(value, type, 'type', 'getClassCode').done(function(result) {
|
||||
getCodeFrom_server(value, type, 'type', 'getClassCode').then(function(result) {
|
||||
if(result){
|
||||
// now set the code
|
||||
if (addCodeToEditor(result, "jform_main_class_code", true, _action_add)) {
|
||||
@ -329,7 +338,7 @@ function rowWatcher() {
|
||||
}
|
||||
} else {
|
||||
// now get the code
|
||||
getCodeFrom_server(valid_value, type_call, 'type', 'getClassCode').done(function(result) {
|
||||
getCodeFrom_server(valid_value, type_call, 'type', 'getClassCode').then(function(result) {
|
||||
if(result){
|
||||
if (removeCodeFromEditor(result, 'jform_main_class_code')) {
|
||||
selectionMemory[type_call][valid_call] = 0;;
|
||||
@ -375,7 +384,6 @@ function propertyIsSet(prop, id, type) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function addCodeToEditor(code_string, editor_id, merge, merge_target){
|
||||
if (Joomla.editors.instances.hasOwnProperty(editor_id)) {
|
||||
@ -458,7 +466,7 @@ function removeCodeFromEditor(code_string, editor_id){
|
||||
|
||||
|
||||
function getLinked(){
|
||||
getCodeFrom_server(1, 'type', 'type', 'getLinked').done(function(result) {
|
||||
getCodeFrom_server(1, 'type', 'type', 'getLinked').then(function(result) {
|
||||
if(result){
|
||||
jQuery('#display_linked_to').html(result);
|
||||
}
|
||||
|
@ -247,23 +247,32 @@ jQuery(document).ready(function()
|
||||
getEditCustomCodeButtons();
|
||||
});
|
||||
|
||||
function getCodeFrom_server(id, type, type_name, callingName){
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax." + callingName + "&format=json&raw=true&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0 && type.length > 0) {
|
||||
var request = token + '=1&' + type_name + '=' + type + '&id=' + id;
|
||||
function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
var url = "index.php?option=com_componentbuilder&task=ajax." + callingName + "&format=json&raw=true&vdm="+vastDevMod;
|
||||
if (token.length > 0 && id > 0 && type.length > 0) {
|
||||
url += '&' + token + '=1&' + type_name + '=' + type + '&id=' + id;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
var getUrl = JRouter(url);
|
||||
return fetch(getUrl, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(function(response) {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
}).then(function(data) {
|
||||
return data;
|
||||
}).catch(function(error) {
|
||||
console.error('There was a problem with the fetch operation:', error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function getLinked(){
|
||||
getCodeFrom_server(1, 'type', 'type', 'getLinked').done(function(result) {
|
||||
getCodeFrom_server(1, 'type', 'type', 'getLinked').then(function(result) {
|
||||
if(result){
|
||||
jQuery('#display_linked_to').html(result);
|
||||
}
|
||||
@ -271,7 +280,7 @@ function getLinked(){
|
||||
}
|
||||
|
||||
function getSnippetDetails(id){
|
||||
getCodeFrom_server(id, '_type', '_type', 'snippetDetails').done(function(result) {
|
||||
getCodeFrom_server(id, '_type', '_type', 'snippetDetails').then(function(result) {
|
||||
if(result.snippet){
|
||||
var description = '';
|
||||
if (result.description.length > 0) {
|
||||
@ -359,7 +368,7 @@ function getLayoutDetails(id){
|
||||
}
|
||||
|
||||
function getTemplateDetails(id){
|
||||
getCodeFrom_server(id, 'type', 'type', 'templateDetails').done(function(result) {
|
||||
getCodeFrom_server(id, 'type', 'type', 'templateDetails').then(function(result) {
|
||||
if(result){
|
||||
jQuery('#details').append(result);
|
||||
// make sure the code bocks are active
|
||||
@ -395,7 +404,7 @@ function getSnippets(){
|
||||
// get libraries value if set
|
||||
var libraries = jQuery("#jform_libraries").val();
|
||||
if (libraries) {
|
||||
getCodeFrom_server(1, JSON.stringify(libraries), 'libraries', 'getSnippets').done(function(result) {
|
||||
getCodeFrom_server(1, JSON.stringify(libraries), 'libraries', 'getSnippets').then(function(result) {
|
||||
setSnippets(result);
|
||||
jQuery("#loading").hide();
|
||||
if (typeof snippetButton !== 'undefined') {
|
||||
|
@ -45,20 +45,29 @@ jQuery(document).ready(function($)
|
||||
getEditCustomCodeButtons();
|
||||
});
|
||||
|
||||
function getCodeFrom_server(id, type, type_name, callingName){
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax." + callingName + "&format=json&raw=true&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0 && type.length > 0) {
|
||||
var request = token + '=1&' + type_name + '=' + type + '&id=' + id;
|
||||
function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
var url = "index.php?option=com_componentbuilder&task=ajax." + callingName + "&format=json&raw=true&vdm="+vastDevMod;
|
||||
if (token.length > 0 && id > 0 && type.length > 0) {
|
||||
url += '&' + token + '=1&' + type_name + '=' + type + '&id=' + id;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
var getUrl = JRouter(url);
|
||||
return fetch(getUrl, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(function(response) {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
}).then(function(data) {
|
||||
return data;
|
||||
}).catch(function(error) {
|
||||
console.error('There was a problem with the fetch operation:', error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function getEditCustomCodeButtons_server(id){
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
|
||||
@ -100,7 +109,7 @@ function isObject(obj) {
|
||||
}
|
||||
|
||||
function getSnippetDetails(id){
|
||||
getCodeFrom_server(id, '_type', '_type', 'snippetDetails').done(function(result) {
|
||||
getCodeFrom_server(id, '_type', '_type', 'snippetDetails').then(function(result) {
|
||||
if(result.snippet){
|
||||
var description = '';
|
||||
if (result.description.length > 0) {
|
||||
@ -188,7 +197,7 @@ function getLayoutDetails(id){
|
||||
}
|
||||
|
||||
function getTemplateDetails(id){
|
||||
getCodeFrom_server(id, 'type', 'type', 'templateDetails').done(function(result) {
|
||||
getCodeFrom_server(id, 'type', 'type', 'templateDetails').then(function(result) {
|
||||
if(result){
|
||||
jQuery('#details').append(result);
|
||||
// make sure the code bocks are active
|
||||
@ -224,7 +233,7 @@ function getSnippets(){
|
||||
// get libraries value if set
|
||||
var libraries = jQuery("#jform_libraries").val();
|
||||
if (libraries) {
|
||||
getCodeFrom_server(1, JSON.stringify(libraries), 'libraries', 'getSnippets').done(function(result) {
|
||||
getCodeFrom_server(1, JSON.stringify(libraries), 'libraries', 'getSnippets').then(function(result) {
|
||||
setSnippets(result);
|
||||
jQuery("#loading").hide();
|
||||
if (typeof snippetButton !== 'undefined') {
|
||||
|
Reference in New Issue
Block a user