Update for backup

This commit is contained in:
narcolepticinsomniac 2017-01-30 14:22:28 -05:00 committed by GitHub
parent ab12ccc1c0
commit 801c637d7e
2 changed files with 8 additions and 26 deletions

View File

@ -205,32 +205,17 @@
<div><input id="show-badge" type="checkbox"><label id="show-badge-label" for="show-badge" i18n-text="prefShowBadge"></label></div>
<div><input id="popup.stylesFirst" type="checkbox"><label id="stylesFirst-label" for="popup.stylesFirst" i18n-text="popupStylesFirst"></label></div>
</div>
<div id="import">
<h2>Stylish Migration</h2>
<ul>
<li>1. Copy this script to the clipboard</li>
<pre contenteditable="true">chrome.extension.getBackgroundPage().getStyles({}, e => {
<span style='color:#7f0055; font-weight:bold; '>let</span> styles = JSON.stringify(e);
<span style='color:#7f0055; font-weight:bold; '>let</span> <span style='color:#7f0055; font-weight:bold; '>link</span> = document.createElement(<span style='color:#2a00ff; '>'</span><span style='color:#2a00ff; '>a</span><span style='color:#2a00ff; '>'</span>);
<span style='color:#7f0055; font-weight:bold; '>let</span> data = <span style='color:#7f0055; font-weight:bold; '>new</span> Blob([styles], {type: <span style='color:#2a00ff; '>'</span><span style='color:#2a00ff; '>text/plain;charset=utf-8;</span><span style='color:#2a00ff; '>'</span>});
<span style='color:#7f0055; font-weight:bold; '>link</span>.href = window.URL.createObjectURL(data);
<span style='color:#7f0055; font-weight:bold; '>link</span>.setAttribute(<span style='color:#2a00ff; '>'</span><span style='color:#2a00ff; '>download</span><span style='color:#2a00ff; '>'</span>, <span style='color:#2a00ff; '>'</span><span style='color:#2a00ff; '>styles.json</span><span style='color:#2a00ff; '>'</span>);
document.body.appendChild(<span style='color:#7f0055; font-weight:bold; '>link</span>);
<span style='color:#7f0055; font-weight:bold; '>link</span>.click();
document.body.removeChild(<span style='color:#7f0055; font-weight:bold; '>link</span>);
});
</pre>
<li>2. Right-Click the Stylish toolbar button and select "Inspect Popup"</li>
<li>3. Paste the script in the console tab and press Enter key</li>
<li>4. Use the import button to import "styles.json" file</li>
</ul>
</div>
<div>
<h2>Import Styles</h2>
<input type="file">
<div id="backup">
<h2>Backup</h2>
<span>Larger files may take a moment, be patient.<br><br>Editor styles require adding rules for Stylus.<br><br></span>
<button id="file-all-styles" i18n-text="bckpInstStyles"></button>
<button id="unfile-all-styles" i18n-text="retrieveBckp"></button>
</div>
<p id="manage-text" i18n-html="manageText"></p>
</div>
<div id="installed"></div>
<script src="backup/fileSaveLoad.js"></script>
<script src="backup/manage/moment.min.js"></script>
<script src="backup/manage/fileSaveLoad.js"></script>
</body>
</html>

View File

@ -508,9 +508,6 @@ document.addEventListener("DOMContentLoaded", function() {
document.getElementById("search").addEventListener("input", searchStyles);
searchStyles(true); // re-apply filtering on history Back
document.querySelector('input[type=file]').addEventListener('change', importStyles);
document.querySelector('#import pre').addEventListener('click', selectAll);
setupLivePrefs([
"manage.onlyEnabled",
"manage.onlyEdited",