Permalink
Browse files

Remember your color scheme

  • Loading branch information...
1 parent a466d71 commit 85f11c6d59364ef6a2664976645e182b186847a7 Adam Savitzky committed Apr 12, 2012
Showing with 12 additions and 1 deletion.
  1. +1 −1 ui/webserver/julia_web_base.jl
  2. +11 −0 ui/website/repl.js
@@ -104,7 +104,7 @@ ans = nothing
function __socket_callback(fd)
# read the message
__msg = __read_message()
-
+
# MSG_INPUT_EVAL
if __msg.msg_type == __MSG_INPUT_EVAL
# split the input into lines
View
@@ -39,6 +39,13 @@ var color_schemes = [
// the current color scheme
var current_color_scheme = 0;
+// Fetch items out of local storage if they exist
+if (Modernizr.localstorage) {
+ if (localStorage.getItem("current_color_scheme")) {
+ current_color_scheme = localStorage.getItem("current_color_scheme");
+ }
+}
+
// apply a particular color scheme -- call this every time the terminal content changes
function apply_color_scheme() {
$("form#terminal-form").css("background-color", color_schemes[current_color_scheme][1].background_color);
@@ -53,6 +60,10 @@ function apply_color_scheme() {
$("svg .line").css("stroke", color_schemes[current_color_scheme][1].plot_line_color);
$("svg .rect").css("fill", color_schemes[current_color_scheme][1].plot_rect_color);
$("svg .rect").css("stroke", color_schemes[current_color_scheme][1].plot_rect_stroke_width);
+
+ if (Modernizr.localstorage) {
+ localStorage.setItem("current_color_scheme", current_color_scheme);
+ }
}
// when the DOM loads

0 comments on commit 85f11c6

Please sign in to comment.