fixing auto loading theme bugs and moving db and theme config to index.html
This commit is contained in:
1 parent
c632242ac2
commit
b2a9bb0194
7 files changed
+40
-947
No files matched your search
+1
-1
@@ -22,7 +22,7 @@ var dateCalcMenuOpened = false // date calculator menu state
|
||||
var encodingMenuOpened = false // encoding menu state
|
||||
|
||||
var enabledCiphCount = 0 // number of enabled ciphers
|
||||
var optShowExtraCiphers = false // enable extra ciphers
|
||||
var optShowExtraCiphers = true // enable extra ciphers
|
||||
|
||||
// Cipher colors
|
||||
var origColors = [] // preserve original cipher colors
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// ciphers.js
|
||||
// IMPORTANT NOTE: This file is bypassed when automatically loading a theme. Edit default-interface.js in the theme folder instead.
|
||||
|
||||
/*
|
||||
new cipher(
|
||||
@@ -14,43 +13,6 @@ new cipher(
|
||||
)
|
||||
*/
|
||||
|
||||
calcOptions = [
|
||||
"optNumCalcMethod = 1",
|
||||
"optFiltCrossCipherMatch = true",
|
||||
"optFiltSameCipherMatch = false",
|
||||
"optShowOnlyMatching = false",
|
||||
"optNewPhrasesGoFirst = false",
|
||||
"optShowExtraCiphers = true",
|
||||
"optAllowPhraseComments = true",
|
||||
"liveDatabaseMode = true",
|
||||
"optLetterWordCount = true",
|
||||
"optWordBreakdown = true",
|
||||
"optCompactBreakdown = true",
|
||||
"optShowCipherChart = true",
|
||||
"optGradientCharts = false",
|
||||
"optLoadUserHistCiphers = true",
|
||||
"optMatrixCodeRain = true",
|
||||
"interfaceHue = 222",
|
||||
"interfaceSat = 2",
|
||||
"interfaceLit = 0.6",
|
||||
"fontHue = 200",
|
||||
"fontSat = 1",
|
||||
"fontLit = 0.9",
|
||||
"coderainHue = 222",
|
||||
"coderainSat = 0.4",
|
||||
"coderainLit = 0.19",
|
||||
"optPhraseLimit = 5",
|
||||
"dbPageItems = 15",
|
||||
"dbScrollItems = 1",
|
||||
"optForceTwoColumnLayout = false",
|
||||
"optColoredCiphers = true",
|
||||
"optGemSubstitutionMode = true",
|
||||
"optGemMultCharPos = false",
|
||||
"optGemMultCharPosReverse = false",
|
||||
"encDefAlphArr = 'abcdefghijklmnopqrstuvwxyz'",
|
||||
"encDefVowArr = 'aeiouy'",
|
||||
"encDefExcLetArr = 'qzjx'"
|
||||
]
|
||||
cipherList = [
|
||||
new cipher(
|
||||
"Standard",
|
||||
|
||||
+6
-1
@@ -103,7 +103,12 @@ function importFileAction(file, hasLocalFile) {
|
||||
cipherList.push(eval("new cipher("+ciph[n].slice(1,-1)+")")) // remove parethesis, evaluate string as javascript code
|
||||
}
|
||||
document.getElementById("calcOptionsPanel").innerHTML = "" // clear menu panel
|
||||
initCalc() // reinit
|
||||
if(hasLocalFile){
|
||||
// initCalc() // reinit. This seems to add duplicate menu options when loading a theme and so this call has been disabled.
|
||||
} else {
|
||||
initCalc() // reinit.
|
||||
}
|
||||
|
||||
updateTables() // update tables
|
||||
updateInterfaceColor(true) // update interface color (first run)
|
||||
if (userDBlive.length !== 0) { // restore controls if live database is loaded
|
||||
|
||||
+14
-18
@@ -264,6 +264,17 @@ $(document).ready(function(){
|
||||
// ==================================================================
|
||||
// export.js
|
||||
|
||||
function loadFile(filePath) {
|
||||
var result = null;
|
||||
var xmlhttp = new XMLHttpRequest();
|
||||
xmlhttp.open("GET", filePath, false);
|
||||
xmlhttp.send();
|
||||
if (xmlhttp.status==200) {
|
||||
result = xmlhttp.responseText;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
$("body").on("click", "#btn-print-cipher-png", function () { // for future elements
|
||||
@@ -330,24 +341,9 @@ $(document).ready(function(){
|
||||
openImageWindow(".numPropTooltip", fileName, optImageScale);
|
||||
});
|
||||
|
||||
function loadFile(filePath) {
|
||||
var result = null;
|
||||
var xmlhttp = new XMLHttpRequest();
|
||||
xmlhttp.open("GET", filePath, false);
|
||||
xmlhttp.send();
|
||||
if (xmlhttp.status==200) {
|
||||
result = xmlhttp.responseText;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//Autoload DB
|
||||
var file = loadFile('db.txt');
|
||||
importFileAction(file, true);
|
||||
|
||||
//Autoload Theme
|
||||
var file = loadFile('theme/default-interface.js');
|
||||
importFileAction(file, true);
|
||||
// //Autoload DB function has moved to index.html for easy editing
|
||||
// var file = loadFile('db.txt');
|
||||
// importFileAction(file, true);
|
||||
|
||||
$("body").on("change", "#importFileDummy", function(){
|
||||
var file = document.querySelector("#importFileDummy").files[0];
|
||||
|
||||
Reference in new issue
Block a user