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
| SB.Models.Ticket = Backbone.Model.extend( | |
| name: "ticket" | |
| urlRoot: "/tickets" | |
| ) |
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
| !!! | |
| %html{:xmlns => "http://www.w3.org/1999/xhtml"} | |
| %head | |
| %meta{:content => "text/html; charset=utf-8", "http-equiv" => "Content-Type"}/ | |
| == <link rel="shortcut icon" href="/favicon.ico" /> | |
| == <meta name="viewport" content="width=device-width, initial-scale=1.0" > | |
| %title | |
| = @page_title || "SupportBee" | |
| = include_stylesheets :common, :app, :desktop | |
| = include_javascripts :common, :app_assets, :app, :desktop |
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
| { | |
| "total":1, | |
| "current_page":1, | |
| "per_page":10, | |
| "total_pages":1, | |
| "tickets":[ | |
| { | |
| "id":1, | |
| "subject":"First Ticket Subject", | |
| ... |
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
| var Workspace = Backbone.Router.extend({ | |
| routes: { | |
| "help": "help", // #help | |
| "search/:query": "search", // #search/kiwis | |
| "search/:query/p:page": "search" // #search/kiwis/p7 | |
| }, | |
| help: function() { | |
| ... |
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
| var object = {}; | |
| _.extend(object, Backbone.Events); | |
| object.on("alert", function(msg) { | |
| alert("Triggered " + msg); | |
| }); | |
| object.trigger("alert", "an event"); |
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
| success: function( response ) { | |
| if( response.products ) { | |
| $.each( response.products, | |
| function( index, value ) { | |
| $( 'div[name="'+value.product_id+'"]' ).html( value.price ); | |
| } | |
| ); | |
| } | |
| } |
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
| $.ajax({ | |
| type: "GET", | |
| url: '/update_url', | |
| data: "id=" + id, | |
| success: function(data) { | |
| $('#summary').html(data); | |
| }); |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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
| # This will compile everything ending with .html.handlebars into | |
| # a global namespace SB.Views.Templates using the template_function | |
| # Handlebars.template | |
| template_extension: 'html.handlebars' | |
| template_function: Handlebars.template | |
| template_namespace: SB.Views.Templates | |
| # Don't compress assets | |
| compress_assets: off |
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
| require 'rubygems' | |
| require 'rb-inotify' | |
| require 'sqlite3' | |
| require 'active_record' | |
| require 'mail' | |
| require 'log4r' | |
| include Log4r | |
| MYLOG = Logger.new 'mylog' | |
| file = FileOutputter.new('fileOutputter', :filename => 'hsi_notifications.log', :trunch => false) |