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
snippet model | |
var ${1:model} = Backbone.Model.extend({ | |
initialize: function () { | |
} | |
}); | |
var ${2:$1}s = Backbone.Collection.extend({ | |
model: ${3:$1}, | |
url: "${4}" | |
}); |
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 setTextMeasure = function (contentElement, targetMeasure, maxSize, minSize) { | |
if (!contentElement) contentElement = $(document.createElement('p')); | |
if (!targetMeasure) targetMeasure = 66; | |
if (!maxSize) maxSize = 16; | |
if (!minSize) minSize = 9; | |
var body = $('body'); | |
var sizer = contentElement.clone(); |
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 App = { | |
init: function(){ | |
this.setup(); | |
this.doOtherStuff(); | |
}, | |
setup: function(){ | |
// | |
}, | |
doOtherStuff: 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
{% extends "base.html" %} | |
{% block extra_head %} | |
<script type="text/javascript" charset="utf-8" src="{{ MEDIA_URL }}js/jquery.tools.date.min.js"></script> | |
<script type="text/javascript"> | |
var tlProtocol = (('https:' == document.location.protocol) ? 'https://' : 'http://'); | |
document.write(unescape("%3Cscript src='" + tlProtocol + "assets.transloadit.com/js/jquery.transloadit2.js' type='text/javascript'%3E%3C/script%3E")); | |
</script> | |
{% endblock %} |
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 self = this, | |
baseUrl = '/myGCS/sw/tracker/gtuSettings/', | |
idString = '?unitId='+this.model.id, | |
noCacheString = '&a='+(+new Date), | |
urls = { | |
'settings': [baseUrl, idString, 'deviceSettings', noCacheString].join(''), | |
'battery': [baseUrl, idString, 'batteryUsage', noCacheString].join(''), | |
'notifications': [baseUrl, idString, 'deviceNotifications', noCacheString].join(''), | |
'continuous-tracking': [baseUrl, idString, 'batteryUsage', noCacheString].join(''), | |
'check-ins': [baseUrl, idString, 'batteryUsage', noCacheString].join(''), |
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
{ | |
"status": "ok", | |
"result": [{ | |
"baseIcon": "album/0/5/2/00000000000ed250/square-200.jpg", | |
"releaseDate": "2011-08-29", | |
"displayDate": "Aug 29, 2011", | |
"duration": 4299, | |
"isClean": false, | |
"shortUrl": "http://rd.io/x/QFtyPk2NAg", | |
"canStream": true, |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Rdio-Simple Example</title> | |
</head> | |
<body> | |
<a href="/logout">Log out of Rdio</a> | |
<p>Logged in as <%= firstName %></p> | |
<div id="player"> | |
<div id="rdioSwf"></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
Lstn.Views.SearchView = Backbone.View.extend({ | |
el: '#search', | |
events:{ | |
'focus':'bindToReset', | |
'blur':'unbindReset' | |
}, | |
initialize: function(options){ |
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
Garmin.msc.Views.DashboardProductView = Backbone.View.extend({ | |
//this is the view for a single selected product in | |
//the dashboard (the dashboardCollection) and should. | |
className:"product-dashboard", | |
events: { | |
// "mouseenter .display":"goOver", | |
// "mouseleave .display":"goOut", | |
"dragstart":"startDrag", | |
"dragstop":"stopDrag", | |
"drag":"whileDragging", |
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
define([ | |
'jquery', | |
'underscore', | |
'backbone', | |
'collections/widget-list', | |
'text!templates/widget-list.html', | |
'ui' | |
], function($,_,Backbone, WidgetCollection, widgetTemplate){ | |
var WidgetList = Backbone.View.extend({ |
OlderNewer