From: Robert Kaiser Date: Sun, 30 Oct 2011 15:07:51 +0000 (+0100) Subject: remove any global prefs the add-on sets, remove another obsolete function, fix missin... X-Git-Url: https://git-public.kairo.at/?p=mandelbrot.git;a=commitdiff_plain;h=cd6af0890f816209ef30d436a80616a0381fc7ce remove any global prefs the add-on sets, remove another obsolete function, fix missing palette after launch, add a 'back' menu item in locations and make it work - and make all that the 4.0 release --- diff --git a/Makefile.in b/Makefile.in index d7428b5..a44d02e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -49,7 +49,7 @@ endif MODULE = mandelbrot -EXTENSION_VERSION = 4.0b3 +EXTENSION_VERSION = 4.0 XPI_NAME = mandelbrot USE_EXTENSION_MANIFEST = 1 diff --git a/content/mandelbrot.js b/content/mandelbrot.js index c1f3e54..7d77b12 100644 --- a/content/mandelbrot.js +++ b/content/mandelbrot.js @@ -43,6 +43,7 @@ var gColorPalette = []; var gStartTime = 0; var gMbrotBundle; var gCurrentImageData; +var gLastImageData; function Startup() { gMbrotBundle = document.getElementById("mbrotBundle"); @@ -193,6 +194,10 @@ function drawImage() { document.getElementById("statusLabel").value = gMbrotBundle.getString("statusDrawing"); + if (gCurrentImageData) { + gLastImageData = gCurrentImageData; + } + let Cr_vals = getAdjustPref("last_image.Cr_*"); let Cr_min = Cr_vals.Cr_min; let Cr_max = Cr_vals.Cr_max; @@ -204,6 +209,10 @@ function drawImage() { let iterMax = getAdjustPref("iteration_max"); let algorithm = getAdjustPref("use_algorithm"); + let currentPalette = getAdjustPref("color_palette"); + if (!gColorPalette || !gColorPalette.length) + gColorPalette = getColorPalette(currentPalette); + let iWidth = getAdjustPref("image.width"); let iHeight = getAdjustPref("image.height"); @@ -538,18 +547,11 @@ function saveImage() { } } -function exitMandelbrot() { - var appInfo = Components.classes["@mozilla.org/xre/app-info;1"] - .getService(Components.interfaces.nsIXULAppInfo); - if (appInfo.ID == "mandelbrot@kairo.at") - quitApp(false); - else - window.close(); -} - function updateBookmarkMenu(aParent) { document.getElementById("bookmarkSave").disabled = - (!document.getElementById("drawButton").hidden || (gStartTime > 0)); + (!document.getElementById("drawButton").hidden || (gStartTime > 0)); + + document.getElementById("bookmarkBack").disabled = !gLastImageData; while (aParent.hasChildNodes() && aParent.lastChild.id != "bookmarkSeparator") @@ -586,6 +588,16 @@ function updateBookmarkMenu(aParent) { na.setAttribute("disabled", "true"); } +function goBack () { + if (gLastImageData) { + Services.prefs.setIntPref("mandelbrot.iteration_max", + gLastImageData.iterMax); + // use gLastImageData.iWidth, gLastImageData.iHeight ??? + adjustCoordsAndDraw(gLastImageData.C_min, gLastImageData.C_max); + gLastImageData = undefined; + } +} + function callBookmark(evtarget) { if (evtarget.id == "bookmarkSave" || evtarget.id == "bookmarkSeparator") return; diff --git a/content/mandelbrot.xul b/content/mandelbrot.xul index 109d86e..720f9db 100644 --- a/content/mandelbrot.xul +++ b/content/mandelbrot.xul @@ -68,8 +68,12 @@ - - + + - - + + + - + + diff --git a/prefs.js b/prefs.js index 2fbe1fe..fc5853e 100644 --- a/prefs.js +++ b/prefs.js @@ -35,19 +35,6 @@ * * ***** END LICENSE BLOCK ***** */ -pref("toolkit.defaultChromeURI", "chrome://mandelbrot/content/mandelbrot.xul"); - /* default prefs */ -// use TraceMonkey by default for getting fast calculations -pref("javascript.options.jit.chrome", true); -// instantly apply prefs to make sure the image settings dialog works -pref("browser.preferences.instantApply", true); // sync image proportions in the dialog by default pref("mandelbrot.syncProportions", true); - -/* debugging prefs */ -pref("browser.dom.window.dump.enabled", true); -pref("javascript.options.showInConsole", true); -pref("javascript.options.strict", true); -pref("nglayout.debug.disable_xul_cache", true); -pref("nglayout.debug.disable_xul_fastload", true); diff --git a/skin/classic/mobileUI.css b/skin/classic/mobileUI.css index d72ac71..a043953 100644 --- a/skin/classic/mobileUI.css +++ b/skin/classic/mobileUI.css @@ -119,3 +119,8 @@ panel { background-color: #69645c; color: white; } + +panel > titlebar { + background-color: rgb(94,97,102); + color: white; +}