Here's how to build an app with something like CanJS and AMD-like modules (using steal). For this example app, consider a tree-like nested grid where you can select locations and get more information. The app might look something like:
| IL | |
| Chicago |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script src="http://code.jquery.com/jquery.min.js"></script> | |
| <script src="//canjs.com/release/2.1.1/can.jquery.dev.js"></script> | |
| <script src="//canjs.com/release/2.1.1/can.map.define.js"></script> | |
| <script src="//canjs.com/release/2.1.1/can.stache.js"></script> | |
| <meta charset="utf-8"> | |
| <title>JS Bin</title> |
| /* | |
| * twitter-entities.js | |
| * This function converts a tweet with "entity" metadata | |
| * from plain text to linkified HTML. | |
| * | |
| * See the documentation here: http://dev.twitter.com/pages/tweet_entities | |
| * Basically, add ?include_entities=true to your timeline call | |
| * | |
| * Copyright 2010, Wade Simmons | |
| * Licensed under the MIT license |
| /* | |
| * twitter-entities.js | |
| * This function converts a tweet with "entity" metadata | |
| * from plain text to linkified HTML. | |
| * | |
| * See the documentation here: http://dev.twitter.com/pages/tweet_entities | |
| * Basically, add ?include_entities=true to your timeline call | |
| * | |
| * Copyright 2010, Wade Simmons | |
| * Licensed under the MIT license |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
Here's how to build an app with something like CanJS and AMD-like modules (using steal). For this example app, consider a tree-like nested grid where you can select locations and get more information. The app might look something like:
| IL | |
| Chicago |
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Document</title> | |
| <link rel="stylesheet" href="css/bootstrap.min.css"> | |
| </head> | |
| <body> | |
| <div class="container"> | |
| <ul class="nav nav-tabs" id="myTab"> |
| Handlebars.registerHelper('pagination', function(currentPage, totalPage, size, options) { | |
| var startPage, endPage, context; | |
| if (arguments.length === 3) { | |
| options = size; | |
| size = 5; | |
| } | |
| startPage = currentPage - Math.floor(size / 2); | |
| endPage = currentPage + Math.floor(size / 2); |
| @import "bootstrap/responsive.less"; //Disable importing variables and mixins, causes to break.. | |
| // LANDSCAPE PHONE TO SMALL DESKTOP & PORTRAIT TABLET | |
| // -------------------------------------------------- | |
| @media (max-width: 767px) { | |
| .customGrid(auto, 0); | |
| } | |
| // PORTRAIT TABLET TO DEFAULT DESKTOP | |
| // ---------------------------------- |
| /* ===== Primary Styles ===================================================== | |
| Author: Fruitcake Studio (Barry vd. Heuvel) | |
| ========================================================================== */ | |
| //Generate a custom (semantic) grid | |
| .customGrid(@gridColumnWidth, @gridGutterWidth){ | |
| #header, #main { | |
| .row(); | |
| } | |
| .block { |
| <?php | |
| /** | |
| * PHP versions 5 | |
| * | |
| * @copyright 2011 k-holy <k.holy74@gmail.com> | |
| * @author k.holy74@gmail.com | |
| * @license http://www.opensource.org/licenses/mit-license.php The MIT License (MIT) | |
| */ | |
| namespace Holy\Silex\Provider; |