This file contains 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
function(){ | |
if (typeof jQuery != 'undefined') | |
{ | |
console.log('jquery version ' + $.fn.jquery); | |
return; | |
} | |
var s=document.createElement('script'); | |
s.setAttribute('src','http://code.jquery.com/jquery.min.js'); | |
document.body.appendChild(s); | |
void(s); |
This file contains 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
/* globals */ | |
html { | |
font:62.5%/1 "Droid Sans", "Lucida Sans Unicode", "Lucida Grande", Verdana, Arial, Helvetica, sans-serif; | |
background: url('background.png'); | |
background-repeat: no-repeat | |
} | |
body { | |
margin: 0 auto; | |
} |
This file contains 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
_ ____ | |
(_)/ __ \ | |
_| | | |_ _ ___ _ __ _ _ | |
| | | | | | | |/ _ \ '__| | | | | |
| | |__| | |_| | __/ | | |_| | | |
| |\___\_\\__,_|\___|_| \__, | | |
_/ | __/ | | |
|__/ |___/ | |
//get latest minified |
This file contains 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
$(function () { // this line makes sure this code runs on page load | |
$('.checkall').click(function () { | |
$(this).parents('fieldset:eq(0)').find(':checkbox').attr('checked', this.checked); | |
}); | |
}); |
This file contains 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
// extract the stories from rally list | |
//jQuerieze the page first to use it | |
var stories=""; rows = jQuery('#storycard_tps tr').each(function(ind, e) { | |
var vals={}; $(e).find('td').each(function(indt,f) { | |
if (f.className.indexOf('idstring') != -1) | |
stories += f.innerText + ","; | |
else if (f.className.indexOf('name0') !=-1) | |
stories += f.innerText + ","; | |
else if (f.className.indexOf('owner') !=-1) | |
stories += f.innerText + "\n"; |
This file contains 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
// Usage: $(['img1.jpg','img2.jpg']).preloadImages(function(){ ... }); | |
// Callback function gets called after all images are preloaded | |
$.fn.preloadImages = function (callback) | |
{ | |
// Helper function, used below. | |
// Usage: ['img1.jpg','img2.jpg'].remove('img1.jpg'); | |
var checklist = this.toArray(); | |
var removeImg = function (element) | |
{ |
This file contains 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 TwipsyView = Backbone.View.extend({ | |
tagName: "div", | |
className: "twipsy fade", | |
events: { | |
"mouseenter": "show", | |
"mouseleave": "hide" | |
}, | |
options: { | |
enabled: true, | |
title: "twipsyView", |
This file contains 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
describe("NotesView", function() { | |
beforeEach(function() { | |
var notes = new NotesCollection(); | |
spyOn(notes, "fetch"); | |
var view = new NotesView({collection: notes}); | |
}); | |
describe("#initialize", function() { | |
it("should fetch the notes", function() { |
This file contains 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
// with jQuery on the page do the nezt line in the debugger to include the timer scripts | |
jQuery.getScript("http://remysharp.com/time.packed.js") | |
time.func(funcname); | |
time.stop('nameforeport') | |
time.start('nameforreport') | |
//----------------------- DOC ---------------- | |
// see http://remysharp.com/2007/04/20/performance-profiling-javascript/ | |
Synxtax |
This file contains 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
//*debug layout *// | |
function randomColor() { | |
return '#' + Math.floor(Math.random() * 16777215).toString(16); | |
} | |
//The .offset() the current position of an element relative to the document | |
function colorParents(startelt, on) { |
OlderNewer