reworked exporting properties

This commit is contained in:
ericrius1 2016-02-16 14:06:02 -08:00
parent ad43e4ff6d
commit bf21bc2d48
2 changed files with 34 additions and 5 deletions

View file

@ -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>

View file

@ -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() {