mirror of
https://ghproxy.net/https://github.com/elementor/wp2static.git
synced 2025-09-10 06:22:45 +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
|
@ -185,6 +185,7 @@ class StaticHtmlOutput
|
||||||
|
|
||||||
do_action(self::HOOK . '-saveOptions');
|
do_action(self::HOOK . '-saveOptions');
|
||||||
|
|
||||||
|
|
||||||
$this->_view
|
$this->_view
|
||||||
->setTemplate('options-page')
|
->setTemplate('options-page')
|
||||||
->assign('exportLog', $this->_exportLog)
|
->assign('exportLog', $this->_exportLog)
|
||||||
|
|
|
@ -119,6 +119,37 @@ jQuery(document).ready(function($){
|
||||||
$('.options-form:last').clone().insertAfter('.options-form:last');
|
$('.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>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue