With the lastest version of Require, a new config object was introduced, the shim.
http://requirejs.org/docs/api.html#config-shim
That allows Amplify to now be used within AMD projects.
Have Fun!
| requirejs.config({ | |
| shim: { | |
| 'foundation/jquery.foundation.topbar': { | |
| deps: ['jquery'], | |
| }, | |
| 'foundation/jquery.cookie': { | |
| deps: ['jquery'] | |
| }, | |
| 'foundation/jquery.event.move': { | |
| deps: ['jquery'] |
| <!-- standard viewport tag to set the viewport to the device's width | |
| , Android 2.3 devices need this so 100% width works properly and | |
| doesn't allow children to blow up the viewport width--> | |
| <meta name="viewport" id="vp" content="initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width" /> | |
| <!-- width=device-width causes the iPhone 5 to letterbox the app, so | |
| we want to exclude it for iPhone 5 to allow full screen apps --> | |
| <meta name="viewport" id="vp" content="initial-scale=1.0,user-scalable=no,maximum-scale=1" media="(device-height: 568px)" /> | |
| <!-- provide the splash screens for iPhone 5 and previous --> | |
| <link href="assets/splashs/splash_1096.png" rel="apple-touch-startup-image" media="(device-height: 568px)"> | |
| <link href="assets/splashs/splash_iphone_2x.png" rel="apple-touch-startup-image" sizes="640x960" media="(device-height: 480px)"> |
| /* | |
| * parse_link_header() | |
| * | |
| * Parse the Github Link HTTP header used for pageination | |
| * http://developer.github.com/v3/#pagination | |
| */ | |
| function parse_link_header(header) { | |
| if (header.length == 0) { | |
| throw new Error("input must not be of zero length"); | |
| } |
With the lastest version of Require, a new config object was introduced, the shim.
http://requirejs.org/docs/api.html#config-shim
That allows Amplify to now be used within AMD projects.
Have Fun!
This gist assumes:
Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.
open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl
You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html
| do shell script "/System/Library/CoreServices/Menu\\ Extras/User.menu/Contents/Resources/CGSession -suspend" |
| //Wait for relevant code bits to load before starting any tests | |
| define(['core.js'], function( core ) { | |
| module("Core Tests"); | |
| test("Test core methods", function(){ | |
| expect(2); | |
| equals( 1, 1, "A trivial test"); | |
| ok( true, "Another trivial test"); | |
| }); |
| // Original code from http://www.blog.highub.com/mobile-2/a-fix-for-iphone-viewport-scale-bug/ | |
| var metas = document.getElementsByTagName('meta'); | |
| var i; | |
| if (navigator.userAgent.match(/iPhone/i)) { | |
| for (i=0; i<metas.length; i++) { | |
| if (metas[i].name == "viewport") { | |
| metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0"; | |
| } | |
| } |