mirror of
https://ghproxy.net/https://github.com/elementor/wp2static.git
synced 2025-09-05 12:02:54 +08:00
WIP getting values back into client
This commit is contained in:
parent
d279786f39
commit
c7b9731d0a
2 changed files with 32 additions and 0 deletions
|
@ -119,6 +119,37 @@ jQuery(document).ready(function($){
|
|||
$('.options-form:last').clone().insertAfter('.options-form:last');
|
||||
|
||||
});
|
||||
|
||||
// load existing settings
|
||||
if (settings != 'banana') {
|
||||
console.log('existing settings found, lets use those');
|
||||
|
||||
archives = settings.split('baseUrl=');
|
||||
// remove crufty first element
|
||||
archives.shift();
|
||||
console.log(archives);
|
||||
|
||||
|
||||
// iterate each saved settings chunk and create forms for them
|
||||
$.each(archives, function(index, value) {
|
||||
// add back in the 'baseUrl='
|
||||
archive = 'baseUrl=' + value;
|
||||
// trim trailing field
|
||||
//archive = archive.substring(0, archive.indexOf('&staticExportSettings=&'));
|
||||
archive = archive.substring(0, archive.indexOf('&staticExportSettings='));
|
||||
//archive = archive.substring(0, archive.indexOf('staticExportSettings='));
|
||||
console.log(archive);
|
||||
|
||||
settingsBlock = JSON.parse('{"' + decodeURI(archive).replace(/\n/g, ",").replace(/\r/g, ",").replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g,'":"') + '"}');
|
||||
|
||||
console.log(settingsBlock);
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue