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
| /*global define:true */ | |
| define( | |
| [ | |
| 'module/bootstrap', | |
| 'module/timestamp', | |
| 'module/imageenhancer', | |
| 'module/transclude', | |
| 'module/hyperpuff/hyperpuff' | |
| ], 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
| // -- changed lines | |
| return { | |
| init: function() { | |
| // store DOM references | |
| var hyperpuff = news.$('.hyperpuff'), | |
| hyperTitleText = news.$('.hyper-title', hyperpuff).text(), | |
| firstGroupArticles = news.$('.group:first-child .article-wrapper article', hyperpuff), | |
| insertBeforeTarget = news.$('.story-body .introduction'), |
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
| // -- changed lines | |
| define(['module/bootstrap', 'module/hyperpuff/minihyper'], function(news, MiniHyper) { | |
| module('MiniHyper'); | |
| test('has an init method', function() { | |
| ok('init' in MiniHyper); | |
| }); |
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
| ====== | |
| BEFORE | |
| ====== | |
| This is how we currently do 'JS templating' when we want to insert | |
| snippets of markup into the DOM: Strings of markup in an array, | |
| using [].join(''); We then do String.replace() to replace the | |
| {{placeholders}} with content. | |
| // minihyper.js | |
| define([ |
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
| // LOCATOR | |
| locator:error [response, actionType] | |
| locator:renderChangePrompt | |
| locator:renderForm | |
| locator:open [selectorString] | |
| locator:close | |
| locator:locationChanged [location] <---- maybe we should listen to this? | |
| locator:renderWait | |
| locator:searchResults [data] | |
| locator:newsLocalRegions [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
| ====== | |
| BEFORE | |
| ====== | |
| // base.spv | |
| 86: 'locator': '../../../locator/news/responsive/<?= $config['locatorVersion'] ?>/js/' | |
| // localweather.js | |
| 3: 'locator/module/main', |
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
| // locator_news_responsive/webapp/static/js/module/main.js | |
| define([ | |
| 'vendor/ender/reqwest', | |
| 'locator/bootstrap', <---- 'locator' here...where does this path come from? | |
| 'locator/locatorView' <---- is this the curl path that _we_ define in _our_ base.spv? | |
| ], function( | |
| reqwest, | |
| bootstrap, | |
| LocatorView | |
| ){ |
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
| // ---------------------------------------- | |
| // /path/to/dependency.js | |
| define(function() { | |
| return { | |
| doSomethingWithIt: function() { | |
| // blah | |
| } | |
| }; | |
| }); |
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
| // ---------------------------------------- | |
| // /path/to/dependency.js | |
| define(function() { | |
| return { | |
| doSomethingWithIt: function() { | |
| // blah | |
| } | |
| }; | |
| }); |
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
| ----- | |
| MAJOR | |
| ----- | |
| These are what I refer to as 'major' breakpoints. They're defined on our link tags, and are on the 'outside'. | |
| All of our stylesheets are conditionally inserted (based off window innerWidth/innerHeight) into the page dynamically using javascript. | |
| <head> | |
| ... | |
| <link rel="stylesheet" type="text/css" href="compact.css" media="(max-width: 640px)" /> | |
| <link rel="stylesheet" type="text/css" href="tablet.css" media="(min-width: 641px)" /> |