This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| val = redis.call('zrange', KEYS[1], -1, -1) | |
| if val then redis.call('zremrangebyrank', KEYS[1], -1, -1) end | |
| return val |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| val = redis.call('zrange', KEYS[1], 0, 0) | |
| if val then redis.call('zremrangebyrank', KEYS[1], 0, 0) end | |
| return val |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div id="config-input" style="padding: 20px;"> | |
| <div data-role="fieldcontain"> | |
| <label for="text" >Enter Color Value (ex. red, green) :</label> | |
| <input id="color-input" type="text" value="blue"> </input> | |
| </div> | |
| <div data-role="fieldcontain"> | |
| <label for="text" >Enter Width of the box (ex. 50, 70) :</label> | |
| <input id="width-input" type="text" value="100"> </input> | |
| </div> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script type="text/x-jquery-tmpl" id="color-box-template"> | |
| <div style="margin: 20px; float: left;height:${width}px; width: ${width}px; background-color: ${color}; border: 2px solid;"> | |
| </div> | |
| </script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| init = -> | |
| cbl = new ColorBoxController | |
| $(document).ready init |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ColorBoxController extends Backbone.Controller | |
| initialize: -> | |
| model = new ConfigModel | |
| color_input = new ConfigInputView 'el': $('#config-input'), 'model': model | |
| for x in [1..5] | |
| view = new ColorBoxView {model: model} | |
| $('#color-boxes').append view.render().el |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ColorBoxView extends Backbone.View | |
| tagName: 'li' | |
| initialize: -> | |
| @template = $('#color-box-template').template() | |
| @model.bind 'change', @render | |
| @model.view = @ | |
| render: => | |
| $(@el).html $.tmpl @template, @model.toJSON() | |
| return @ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ConfigInputView extends Backbone.View | |
| initialize: -> | |
| @model.view = @ | |
| events: | |
| 'keyup #color-input': "updateConfig" | |
| 'keyup #width-input': "updateConfig" | |
| updateConfig: (e)=> | |
| @model.set 'color': $('#color-input').val() , 'width': $('#width-input').val(), 'height': $('#width-input').val() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ConfigModel extends Backbone.Model | |
| initialize: -> | |
| @set 'color': 'blue', 'width': '100', 'height': '100' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script language="javascript" type="text/javascript"> | |
| ss_mi.add_products( | |
| [{ | |
| prod_page_url: 'http://www.merchant.com/ProductPage1.htm', /*EXAMPLE ONLY*/ | |
| prod_img_url: 'http://www.merchant.com/Image1.jpg', /*EXAMPLE ONLY*/ | |
| prod_img_url_https:'https://www.merchant.com/Image2.jpg', /*EXAMPLE ONLY*/ | |
| prod_title:'Snoozeberry Travel Mug', /*EXAMPLE ONLY*/ | |
| prod_currency:'USD', /*EXAMPLE ONLY*/ | |
| prod_price:'19.99' /*EXAMPLE ONLY*/ | |
| }, |