mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 16:43:33 +02:00
reworked exporting properties
This commit is contained in:
parent
ad43e4ff6d
commit
bf21bc2d48
2 changed files with 34 additions and 5 deletions
|
@ -35,6 +35,26 @@ body{
|
|||
.importer{
|
||||
margin-bottom:4px;
|
||||
}
|
||||
.exported-props-section {
|
||||
width: 50%;
|
||||
margin: 0 auto;
|
||||
|
||||
}
|
||||
#exported-props {
|
||||
/* Set the margin-left and margin-right automatically set */
|
||||
color: white;
|
||||
white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
|
||||
white-space: -pre-wrap; /* Opera 4-6 */
|
||||
white-space: -o-pre-wrap; /* Opera 7 */
|
||||
white-space: pre-wrap; /* css-3 */
|
||||
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
||||
white-space: -webkit-pre-wrap; /* Newer versions of Chrome/Safari*/
|
||||
word-break: break-all;
|
||||
white-space: normal;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
::-webkit-input-placeholder {
|
||||
text-align: center;
|
||||
|
@ -52,6 +72,8 @@ body{
|
|||
<body>
|
||||
<div class="importer">
|
||||
<input type='text' id="importer-input" placeholder="Import: Paste JSON here." onkeypress="handleInputKeyPress(event)">
|
||||
<div class = "exported-props-section">
|
||||
<div id = "exported-props"></div>
|
||||
</div>
|
||||
<div id="my-gui-container">
|
||||
</div>
|
||||
|
|
|
@ -383,9 +383,9 @@ function importSettings() {
|
|||
var keys = _.keys(importedSettings);
|
||||
|
||||
_.each(keys, function(key) {
|
||||
var shouldIgnore = _.contains(keysToIgnore, key);
|
||||
var shouldAllow = _.contains(keysToAllow, key);
|
||||
|
||||
if (shouldIgnore) {
|
||||
if (!shouldAllow) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -406,9 +406,9 @@ function prepareSettingsForExport() {
|
|||
var exportSettings = {};
|
||||
|
||||
_.each(keys, function(key) {
|
||||
var shouldIgnore = _.contains(keysToIgnore, key);
|
||||
var shouldAllow = _.contains(keysToAllow, key);
|
||||
|
||||
if (shouldIgnore) {
|
||||
if (!shouldAllow) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -424,7 +424,14 @@ function prepareSettingsForExport() {
|
|||
}
|
||||
|
||||
function showPreselectedPrompt() {
|
||||
window.prompt("Ctrl-C to copy, then Enter.", prepareSettingsForExport());
|
||||
var elem = document.getElementById("exported-props");
|
||||
var exportSettings = prepareSettingsForExport();
|
||||
elem.innerHTML = "";
|
||||
elem.appendChild(document.createTextNode(exportSettings));
|
||||
elem.select();
|
||||
document.execCopy('copy');
|
||||
|
||||
//window.alert("Ctrl-C to copy, then Enter.", prepareSettingsForExport());
|
||||
}
|
||||
|
||||
function removeContainerDomElement() {
|
||||
|
|
Loading…
Reference in a new issue