summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/ui/editor
diff options
context:
space:
mode:
authorJulie Lala <jules@okfoc.us>2014-10-16 03:09:22 -0400
committerJulie Lala <jules@okfoc.us>2014-10-16 03:09:22 -0400
commit37851cbd12dcb17be77265164876184019d34602 (patch)
tree41d9ac3a02c62ca9421c86649672cbf19720afcd /public/assets/javascripts/ui/editor
parentc13532ec95c2d410354f7d342df70fd68dd78272 (diff)
.. and floor and ceiling
Diffstat (limited to 'public/assets/javascripts/ui/editor')
-rw-r--r--public/assets/javascripts/ui/editor/Presets.js25
1 files changed, 22 insertions, 3 deletions
diff --git a/public/assets/javascripts/ui/editor/Presets.js b/public/assets/javascripts/ui/editor/Presets.js
index c34c826..cde2fdf 100644
--- a/public/assets/javascripts/ui/editor/Presets.js
+++ b/public/assets/javascripts/ui/editor/Presets.js
@@ -5,6 +5,8 @@ var Presets = View.extend({
"mousedown": "stopPropagation",
"click .presets span": "selectPreset",
"click .swatches span": "selectColor",
+ "change .url": "tileWalls",
+ "keydown .url": "enterSetUrl",
},
presets: {
@@ -21,7 +23,7 @@ var Presets = View.extend({
ceiling: [159,163,157],
background: [109,116,106],
},
- "p.funk": {
+ "p.Funk": {
wall: [255,63,78],
outline: [255,246,0],
floor: [255,255,0],
@@ -34,7 +36,7 @@ var Presets = View.extend({
ceiling: [0,0,0],
},
matrix: {
- wall: { src: "http://bibleway.biz/images/Matrix1.gif", scale: 4.0, color: [0,0,0] },
+ wall: { src: "http://dump.fm/images/20130225/1361818675427-dumpfm-melipone-matrixremixtransfast.gif", scale: 4.0, color: [0,0,0] },
outline: [0,0,0],
floor: [10,15,10],
ceiling: [0,0,0],
@@ -43,7 +45,9 @@ var Presets = View.extend({
initialize: function(opt){
this.parent = opt.parent
-
+
+ this.$url = this.$(".url")
+
this.$presets = this.$(".presets")
_.keys(this.presets).forEach(function(name){
var $swatch = $("<span>")
@@ -99,4 +103,19 @@ var Presets = View.extend({
this.lastPreset = preset
},
+ tileWalls: function(){
+ var url = this.$url.sanitize()
+ if (url.length && url.indexOf("http://") == 0) {
+ Walls.setWallpaper.wall({ src: url })
+ Walls.setWallpaper.floor({ src: url })
+ Walls.setWallpaper.ceiling({ src: url })
+ }
+ },
+ enterSetUrl: function (e) {
+ e.stopPropagation()
+ if (e.keyCode == 13) {
+ setTimeout(this.tileWalls.bind(this), 100)
+ }
+ },
+
}) \ No newline at end of file