From 37851cbd12dcb17be77265164876184019d34602 Mon Sep 17 00:00:00 2001 From: Julie Lala Date: Thu, 16 Oct 2014 03:09:22 -0400 Subject: .. and floor and ceiling --- public/assets/javascripts/ui/editor/Presets.js | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'public/assets/javascripts/ui/editor') 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 = $("") @@ -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 -- cgit v1.2.3-70-g09d2