Permalink
Browse files

Revised Guake support.

  • Loading branch information...
1 parent 74b64f8 commit 23a94df99149f26271348911d3557758c54ac480 @ciembor committed Sep 1, 2012
Showing with 47 additions and 38 deletions.
  1. +4 −4 index.html
  2. +43 −34 js/main.js
View
@@ -5,7 +5,7 @@
<meta name="author" content="Maciej Ciemborowicz" />
<title>4bit. Terminal Color Scheme Designer</title>
<meta name="description" content="This application allows you to create custom theme for a Linux terminal and export it to the .Xresources / .Xdefaults configuration file (xterm, aterm, eterm, rxvt, urxvt) and *.colorscheme (konsole, yakuake)."/>
- <link href="css/merged.css?modified=20120827" rel="stylesheet" />
+ <link href="css/merged.css?modified=20120901" rel="stylesheet" />
<style id="outline-fix"></style>
</head>
<body onmousedown="document.getElementById('outline-fix').innerHTML='a{outline:none}';" onkeydown="document.getElementById('outline-fix').innerHTML=''">
@@ -117,7 +117,7 @@ <h2>Advanced</h2>
</ul>
</div>
- <!-- JavaScript ------------------------------------------------------------------------------>
+ <!-- JavaScript =========================================================================== -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<script>window.jQuery || document.write("<script src='lib/js/jquery-1.8.0.min.js'>\x3C/script>")</script>
@@ -128,11 +128,11 @@ <h2>Advanced</h2>
<script src="http://cdnjs.cloudflare.com/ajax/libs/backbone.js/0.9.2/backbone-min.js"></script>
<script>window.Backbone || document.write("<script src='lib/js/backbone-min.js'>\x3C/script>")</script>
- <script src="js/compiled.js"></script>
+ <script src="js/compiled.js?modified=20120901"></script>
<script>_4bit();</script>
- <!-- End of JavaScript ----------------------------------------------------------------------->
+ <!-- End of JavaScript ==================================================================== -->
</body>
</html>
View
@@ -395,40 +395,49 @@ _4bit = function() {
});
- var SchemeGuakeView = Backbone.View.extend({
- model: scheme,
- initialize: function() {
- _.bindAll(this, 'render');
- var that = this;
- $('#guake-button').hover(function() {
- that.render();
- });
- $('#guake-button').focus(function() {
- that.render();
- });
- },
-
- render: function() {
- var that = this;
- var palette = [];
- var colors = that.model.get("colors");
- _.each(COLOR_NAMES, function(name) {
- palette.push( that.gnomeColor(colors[name]) )
- });
- out = "# save this script and run it as file " + '\n';
- out +="# or copy the lines below directly into your shell " + '\n';
-
- out += "gconftool-2 -s -t string /apps/guake/style/background/color '" + that.gnomeColor(colors["background"]) + "'" +'\n';
- out += "gconftool-2 -s -t string /apps/guake/style/font/color '" + that.gnomeColor(colors["foreground"]) + "'" + '\n';
- out += "gconftool-2 -s -t string /apps/guake/style/font/palette '" + palette.join(":") + "'" + '\n';
- $('#guake-button').attr('href', 'data:text/plain,' + encodeURIComponent(out));
- },
-
- // Duplicate: #ab1224 -> #abab12122424, which is the expected format
- gnomeColor: function(color) {
- return color.toString().replace(/#(.{2})(.{2})(.{2})/, '#$1$1$2$2$3$3');
- }
- });
+ var SchemeGuakeView = Backbone.View.extend({
+ model: scheme,
+ initialize: function() {
+ _.bindAll(this, 'render');
+ var that = this;
+ $('#guake-button').hover(function() {
+ that.render();
+ });
+ $('#guake-button').focus(function() {
+ that.render();
+ });
+ },
+
+ render: function() {
+ var that = this;
+ var palette = [];
+ var colors = that.model.get("colors");
+
+ // Duplicate: #ab1224 -> #abab12122424, which is the expected format
+ function gnomeColor(color) {
+ return color.toString().replace(/#(.{2})(.{2})(.{2})/, '#$1$1$2$2$3$3');
+ }
+
+ _.each(COLOR_NAMES, function(name) {
+ palette.push( gnomeColor(colors[name]) )
+ });
+
+ out = '#!/bin/bash \n\n';
+ out += '# Save this script into set_colors.sh, make this file executable and run it: \n';
+ out += '# \n';
+ out += '# $ chmod +x set_colors.sh \n';
+ out += '# $ ./set_colors.sh \n';
+ out += '# \n';
+ out += '# Alternatively copy lines below directly into your shell. \n\n';
+
+ out += "gconftool-2 -s -t string /apps/guake/style/background/color '" + gnomeColor(colors["background"]) + "'" +'\n';
+ out += "gconftool-2 -s -t string /apps/guake/style/font/color '" + gnomeColor(colors["foreground"]) + "'" + '\n';
+ out += "gconftool-2 -s -t string /apps/guake/style/font/palette '" + palette.join(":") + "'" + '\n';
+
+ $('#guake-button').attr('href', 'data:text/plain,' + encodeURIComponent(out));
+ },
+
+ });
var SchemeKonsoleView = Backbone.View.extend({

0 comments on commit 23a94df

Please sign in to comment.