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 Application = { | |
| run: function() { | |
| document.addEventListener("deviceready", this.onDeviceReady.bind(this), false); | |
| this.disableScrolling(); | |
| $$("div").first().fade({duration: 5}); | |
| }, | |
| onDeviceReady: function() { | |
| }, | |
| disableScrolling: function() { | |
| document.addEventListener("touchmove", function(e) { alert("touchmove"); e.stop(); }, false); |
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
| Element.addMethods({ | |
| /** | |
| * Element extension to swap out one class for another on an element. | |
| **/ | |
| swapClassName: function(element, oldClassName, newClassName) { | |
| if (!(element = $(element))) return; | |
| return element.removeClassName(oldClassName).addClassName(newClassName); | |
| } | |
| }); |
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
| // Here you go Bess. Let me know if you have any questions. | |
| /** | |
| * ChangeMonth([e]) -> "undefined" | |
| * - e (HTMLSelectChangeEvent): Optional, provided when this function is an event handler on a select element. | |
| **/ | |
| function ChangeMonth(e){ | |
| // Get the select element and its current value. | |
| var select = $('<%= this.monthListControl.ClientId_Dropdown %>'), | |
| selectedMonth = select.value; |
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
| (function(doc) { | |
| var getHtml = function getHtml(element) { | |
| return $(element).outerHTML; | |
| }; | |
| if (!('outerHTML' in doc.documentElement)) { | |
| var dummy = doc.createElement('html'); | |
| getHtml = function getHtml(element) { | |
| dummy.appendChild($(element).cloneNode(true)); | |
| var result = dummy.innerHTML; |
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
| Element.addMethods("INPUT", { | |
| whatever: function(element) { | |
| // make this shit work. | |
| return element; | |
| } | |
| }); |
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 'net/dns/resolver' | |
| # Custom Domain | |
| # | |
| # Require net-dns gem | |
| # | |
| # A Rack middleware to to resolve the custom domain to original subdomain | |
| # for your multi telent application. | |
| # | |
| # It's all transperant to your application, it performs cname lookup and |
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: | |
| styleSet.each(this.add, this); | |
| // is the same as this: | |
| styleSet.each(function(s) { | |
| this.add(s); | |
| }, this); | |
| // The first one is not only shorter, but speedier | |
| // because it has one less function in its closure chain. |
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
| Number.MIN_VALUE > 0; | |
| // true? really? wtf. | |
| // It turns out that MIN_VALUE is the smallest number | |
| // GREATER THAN ZERO, which of course totally makes sense. |
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
| /** | |
| * person = '/*-secure-\n{"name": "Violet", "occupation": "character"}\n*/'.evalJSON() | |
| **/ |
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
| ##### | |
| ## INITIAL CONFIGURATION | |
| ##### | |
| # Fork sstephenson/prototype on GitHub | |
| # Go to this url and click the fork button. This will create a prototype | |
| # repository under your GitHub account. | |
| http://github.com/sstephenson/prototype |