├── .gitattributes ├── Gruntfile.js ├── LICENSE.md ├── README.md ├── package.json └── src ├── assets ├── data │ └── countryList.json ├── media │ └── images │ │ ├── logo.png │ │ └── moblie-icons │ │ ├── icon-100x100.png │ │ ├── icon-144x144.png │ │ ├── icon-29x29.png │ │ ├── icon-50x50.png │ │ ├── icon-58x58.png │ │ └── icon-72x72.png ├── scripts │ ├── AppBootstrap.ts │ ├── TestApp.ts │ ├── _declare │ │ ├── external.d.ts │ │ ├── handlebars.d.ts │ │ ├── jquery.d.ts │ │ ├── lodash.d.ts │ │ └── require.d.ts │ ├── config.ts │ ├── util │ │ └── TemplateFactory.ts │ └── view │ │ ├── AnotherClass.ts │ │ └── Base.ts ├── styles │ ├── bootstrap.css │ └── styles.css ├── templates │ ├── login │ │ └── LoginTemplate.hbs │ └── topbar │ │ └── TopNavigationTemplate.hbs └── vendor │ ├── handlebars │ └── handlebars.js │ ├── jquery │ └── jquery-1.9.1.js │ ├── lodash │ └── lodash.js │ ├── require-handlebars-plugin │ ├── .bower.json │ ├── .gitignore │ ├── README.md │ ├── build.sh │ ├── demo-build.html │ ├── demo.html │ ├── demo │ │ ├── app.build.js │ │ ├── main.js │ │ ├── require.js │ │ ├── styles │ │ │ ├── one.css │ │ │ └── two.css │ │ └── template │ │ │ ├── coolPartial.hbs │ │ │ ├── helpers │ │ │ ├── all.js │ │ │ ├── myhelper.js │ │ │ └── yeller.js │ │ │ ├── i18n │ │ │ ├── en_ca.json │ │ │ └── en_us.json │ │ │ └── one.hbs │ ├── hbs.js │ ├── hbs │ │ ├── handlebars.js │ │ ├── i18nprecompile.js │ │ ├── json2.js │ │ └── underscore.js │ ├── karma.conf.js │ ├── package.json │ ├── r.js │ └── tests │ │ ├── spec │ │ ├── main.js │ │ ├── partial.js │ │ ├── partial_subdir.js │ │ └── simple.js │ │ ├── templates │ │ ├── _partial.hbs │ │ ├── partial.hbs │ │ ├── partial_fullpath.hbs │ │ ├── partial_subdir.hbs │ │ ├── partials │ │ │ └── _simple.hbs │ │ ├── simple.hbs │ │ └── subdir │ │ │ └── parent.hbs │ │ ├── test-main.js │ │ └── test.html │ └── require │ ├── json.js │ ├── noext.js │ ├── require.js │ ├── text.js │ └── tpl.js ├── config.html └── favicon.ico /.gitattributes: -------------------------------------------------------------------------------- 1 | *.rb linguist-language=TypeScript 2 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function(grunt) { 2 | 3 | // Load Grunt tasks declared in the package.json file. 4 | require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks); 5 | 6 | // Project configuration. 7 | grunt.initConfig({ 8 | 9 | /** 10 | * This will load in our package.json file so we can have access 11 | * to the project name and appVersion number. 12 | */ 13 | pkg: grunt.file.readJSON('package.json'), 14 | 15 | /** 16 | * Constants for the Gruntfile so we can easily change the path for our environments. 17 | */ 18 | BASE_PATH: '', 19 | DEVELOPMENT_PATH: 'src/', 20 | PRODUCTION_PATH: 'web/', 21 | 22 | /** 23 | * A code block that will be added to our minified code files. 24 | * Gets the name and appVersion and other info from the above loaded 'package.json' file. 25 | * @example <%= banner.join("\\n") %> 26 | */ 27 | banner: [ 28 | '/*', 29 | '* Project: <%= pkg.name %>', 30 | '* Version: <%= pkg.appVersion %> (<%= grunt.template.today("yyyy-mm-dd") %>)', 31 | '* Development By: <%= pkg.developedBy %>', 32 | '* Copyright(c): <%= grunt.template.today("yyyy") %>', 33 | '*/' 34 | ], 35 | 36 | /** 37 | * The different constant names that will be use to build our html files. 38 | * @example 39 | */ 40 | env: { 41 | src: { 42 | NODE_ENV : 'DEVELOPMENT' 43 | }, 44 | web : { 45 | NODE_ENV : 'PRODUCTION' 46 | } 47 | }, 48 | 49 | /** 50 | * Allows us to pass in variables to files that have place holders so we can similar files with different data. 51 | * This plugin works with the 'env' plugin above. 52 | * @example or 53 | */ 54 | preprocess : { 55 | // Task to create the index.html file that will be used during development. 56 | // Passes the app version and creates the /index.html 57 | src : { 58 | src : '<%= DEVELOPMENT_PATH %>' + 'config.html', 59 | dest : '<%= DEVELOPMENT_PATH %>' + 'index.html', 60 | options : { 61 | context : { 62 | appVersion : '<%= pkg.appVersion %>', 63 | filePath: '' 64 | } 65 | } 66 | }, 67 | // Task to create the index.html file that will be used in production. 68 | // Passes the app version and creates the /index.html 69 | web : { 70 | src : '<%= DEVELOPMENT_PATH %>' + 'config.html', 71 | dest : '<%= PRODUCTION_PATH %>' + 'index.html', 72 | options : { 73 | context : { 74 | appVersion : '<%= pkg.appVersion %>', 75 | filePath: '' 76 | } 77 | } 78 | } 79 | }, 80 | 81 | /** 82 | * Cleans or deletes our production folder before we create a new production build. 83 | */ 84 | clean: { 85 | web: ['<%= PRODUCTION_PATH %>'], 86 | temp: ['.tmp'] 87 | }, 88 | 89 | /** 90 | * Copies certain files over from the development folder to the production folder so we don't have to do it manually. 91 | */ 92 | copy: { 93 | web: { 94 | files: [ 95 | // Copy favicon.ico file from development to production 96 | { expand: true, cwd: '<%= DEVELOPMENT_PATH %>', src: 'favicon.ico', dest: '<%= PRODUCTION_PATH %>' }, 97 | { expand: true, cwd: '<%= DEVELOPMENT_PATH %>', src: 'assets/vendor/require/require.js', dest: '<%= PRODUCTION_PATH %>' }, 98 | // Copy the media folder from development to production 99 | { expand: true, cwd: '<%= DEVELOPMENT_PATH %>', src: ['assets/media/**'], dest: '<%= PRODUCTION_PATH %>' }, 100 | // Copy the index.html file from development to production 101 | { expand: true, cwd: '<%= DEVELOPMENT_PATH %>', dest: '<%= PRODUCTION_PATH %>', src: ['index.html'], filter: 'isFile', dot: true } 102 | ] 103 | } 104 | }, 105 | 106 | /** 107 | * Prepends the banner above to the minified files. 108 | */ 109 | usebanner: { 110 | dist: { 111 | options: { 112 | position: 'top', 113 | banner: '<%= banner.join("\\n") %>', 114 | linebreak: true 115 | }, 116 | files: { 117 | src: [ 118 | '<%= PRODUCTION_PATH %>' + 'assets/scripts/app.min.js', 119 | '<%= PRODUCTION_PATH %>' + 'assets/styles/app.min.css' 120 | ] 121 | } 122 | } 123 | }, 124 | 125 | /** 126 | * Turns any JSON files into JavaScript files. 127 | */ 128 | json: { 129 | web: { 130 | options: { 131 | namespace: 'JSON_DATA', 132 | includePath: false, 133 | processName: function(filename) { 134 | return filename.toLowerCase(); 135 | } 136 | }, 137 | src: ['<%= DEVELOPMENT_PATH %>' + 'assets/data/**/*.json'], 138 | dest: '<%= DEVELOPMENT_PATH %>' + 'assets/scripts/compiled/json.js' 139 | } 140 | }, 141 | 142 | /** 143 | * Compiles the Handlebars templates into Javascript. 144 | * http://handlebarsjs.com/ 145 | */ 146 | handlebars: { 147 | compile: { 148 | options: { 149 | namespace: 'JST', 150 | // Registers all files that start with '_' as a partial. 151 | partialRegex: /^_/, 152 | // Shortens the file path for the templates. 153 | processName: function(filePath) { // input: src/templates/_header.hbs 154 | return filePath.slice(filePath.indexOf('template'), filePath.lastIndexOf('.')); // output: templates/_header 155 | }, 156 | // Shortens the file path for the partials. 157 | processPartialName: function(filePath) { // input: src/templates/_header.hbs 158 | return filePath.slice(filePath.indexOf('template'), filePath.lastIndexOf('.')); // output: templates/_header 159 | } 160 | }, 161 | files: { 162 | '<%= DEVELOPMENT_PATH %>assets/scripts/compiled/templates.tmpl.js': ['<%= DEVELOPMENT_PATH %>' + 'assets/templates/**/*.hbs'] 163 | } 164 | } 165 | }, 166 | 167 | /** 168 | * Compiles the TypeScript files into one JavaScript file. 169 | */ 170 | typescript: { 171 | main: { 172 | src: ['<%= DEVELOPMENT_PATH %>' + 'assets/scripts/AppBootstrap.ts'], 173 | //dest: '<%= PRODUCTION_PATH %>', 174 | options: { 175 | target: 'es3', //or es5 176 | module: 'AMD', 177 | basePath: '', 178 | sourcemap: false, 179 | declaration: false, 180 | nolib: false, 181 | comments: false 182 | } 183 | } 184 | }, 185 | 186 | /** 187 | * The useminPrepare part of the usemin plugin looks at the html file and checks for a build:js or build:css code block. 188 | * It will take those files found in the code block(s) and concat them together and then runs uglify for js and/or cssmin for css files. 189 | * useminPrepare requires grunt-contrib-uglify, grunt-contrib-concat, and grunt-contrib-cssmin plugins to be installed. Which is listed in the package.json file. 190 | * 191 | * The usemin part will remove the code block(s) and replace that area with the single file path in the html file. 192 | */ 193 | useminPrepare: { 194 | html: ['<%= DEVELOPMENT_PATH %>' + 'index.html'], 195 | options: { 196 | dest: '<%= PRODUCTION_PATH %>'// Moves the single concatenated files to production. 197 | } 198 | }, 199 | usemin: { 200 | html: ['<%= PRODUCTION_PATH %>' + 'index.html'], 201 | options: { 202 | dirs: ['<%= PRODUCTION_PATH %>'] 203 | } 204 | }, 205 | 206 | /** 207 | * Removes all comments from the production index.html file. I can also remove all whitespace if desired. 208 | */ 209 | htmlmin: { 210 | dist: { 211 | options: { 212 | removeComments: true, 213 | collapseWhitespace: false 214 | }, 215 | files: { 216 | '<%= PRODUCTION_PATH %>index.html': '<%= PRODUCTION_PATH %>' + 'index.html' 217 | } 218 | } 219 | }, 220 | 221 | /** 222 | * Creates a Cache Manifest file. 223 | */ 224 | manifest: { 225 | generate: { 226 | options: { 227 | basePath: '<%= PRODUCTION_PATH %>', 228 | exclude: [ 229 | 'assets/media/images/moblie-icons/icon-144x144.png', 230 | 'assets/media/images/moblie-icons/icon-100x100.png', 231 | 'assets/media/images/moblie-icons/icon-29x29.png', 232 | 'assets/media/images/moblie-icons/icon-50x50.png', 233 | 'assets/media/images/moblie-icons/icon-58x58.png', 234 | 'assets/media/images/moblie-icons/icon-72x72.png' 235 | ], 236 | preferOnline: false, 237 | verbose: true, 238 | timestamp: true, 239 | master: [] 240 | }, 241 | src: [ 242 | 'assets/data/**/*.json', 243 | 'assets/media/images/**/*.jpg', 244 | 'assets/media/images/**/*.png', 245 | 'assets/scripts/**/*.js', 246 | 'assets/styles/**/*.css' 247 | ], 248 | dest: '<%= PRODUCTION_PATH %>' + 'offline.appcache' 249 | } 250 | }, 251 | 252 | /** 253 | * YUIDoc plugin that will generate documentation from our YUI comments. 254 | */ 255 | yuidoc: { 256 | compile: { 257 | name: '<%= pkg.name %>', 258 | description: '<%= pkg.description %>', 259 | version: '<%= pkg.appVersion %>', 260 | url: '<%= pkg.homepage %>', 261 | options: { 262 | paths: '<%= DEVELOPMENT_PATH %>' + 'assets/scripts/', 263 | outdir: '<%= BASE_PATH %>docs', 264 | themedir: '', 265 | extension: '.ts', // Default '.js' 266 | exclude: '' 267 | } 268 | } 269 | }, 270 | 271 | /** 272 | * Creates a node.js Express Server to test our code in a server like environment. 273 | * Note: We are using the watch task to keep the server running. 274 | */ 275 | express: { 276 | src: { 277 | options: { 278 | port: 8000, 279 | hostname: "0.0.0.0", 280 | bases: ['<%= DEVELOPMENT_PATH %>'], 281 | livereload: true 282 | } 283 | }, 284 | web: { 285 | options: { 286 | port: 8001, 287 | hostname: "0.0.0.1", 288 | bases: ['<%= PRODUCTION_PATH %>'], 289 | livereload: true 290 | } 291 | } 292 | }, 293 | 294 | /** 295 | * Opens the index.html file in the default browser after the node.js Express Server is running. 296 | */ 297 | open: { 298 | src: { 299 | // Gets the port from the connect configuration 300 | path: 'http://localhost:<%= express.src.options.port%>' 301 | }, 302 | web: { 303 | // Gets the port from the connect configuration 304 | path: 'http://localhost:<%= express.web.options.port%>' 305 | } 306 | }, 307 | 308 | /** 309 | * The RequireJS plugin that will use uglify2 to build and minify our JavaScript, 310 | * templates and any other data we include in the require files. 311 | */ 312 | requirejs: { 313 | compile: { 314 | options: { 315 | baseUrl: '<%= DEVELOPMENT_PATH %>' + 'assets/scripts/', // Path of source scripts, relative to this build file 316 | mainConfigFile: '<%= DEVELOPMENT_PATH %>' + 'assets/scripts/config.js', // Path of shared configuration file, relative to this build file 317 | name: 'AppBootstrap', // Name of input script (.js extension inferred) 318 | out: '<%= PRODUCTION_PATH %>' + 'assets/scripts/app.min.js', // Path of built script output 319 | 320 | fileExclusionRegExp: /.svn/, // Ignore all files matching this pattern 321 | useStrict: true, 322 | preserveLicenseComments: false, 323 | pragmas: { 324 | debugExclude: true 325 | }, 326 | 327 | optimize: 'uglify2', // Use 'none' If you do not want to uglify. 328 | uglify2: { 329 | output: { 330 | beautify: false, 331 | comments: false 332 | }, 333 | compress: { 334 | sequences: false, 335 | global_defs: { 336 | DEBUG: false 337 | } 338 | }, 339 | warnings: false, 340 | mangle: true 341 | } 342 | } 343 | } 344 | }, 345 | 346 | /** 347 | * Watches files and will run task(s) when files are changed. It will also reload/refresh the browser. 348 | */ 349 | watch: { 350 | css: { 351 | options: { 352 | livereload: true 353 | }, 354 | files: [ 355 | '<%= DEVELOPMENT_PATH %>' + 'assets/styles/**/*.css', 356 | ] 357 | }, 358 | src: { 359 | options: { 360 | livereload: true 361 | }, 362 | files: [ 363 | '<%= DEVELOPMENT_PATH %>' + 'assets/scripts/**/*.ts', 364 | '<%= DEVELOPMENT_PATH %>' + 'config.html', 365 | '<%= DEVELOPMENT_PATH %>' + 'assets/templates/**/*.hbs' 366 | ], 367 | tasks: ['src'] 368 | } 369 | } 370 | 371 | }); 372 | 373 | /** 374 | * Grunt tasks: 375 | * 376 | * grunt (Will build and run your development code/server) 377 | * grunt web (Will build and run your production code/server) 378 | * grunt doc (Will generate the YUI documentation from the code comments) 379 | * grunt build (Will build the production code but will not start a local server.) 380 | */ 381 | grunt.registerTask('default', [ 382 | 'server' 383 | ]); 384 | 385 | grunt.registerTask('server', [ 386 | 'src', 387 | 'express:src', 388 | 'open:src', 389 | 'watch' 390 | ]); 391 | 392 | grunt.registerTask('src', [ 393 | 'env:src', 394 | 'preprocess:src', 395 | 'json', 396 | 'handlebars', 397 | 'typescript' 398 | ]); 399 | 400 | grunt.registerTask('web', [ 401 | 'build', 402 | 'open:web', 403 | 'express:web', 404 | 'express-keepalive' 405 | ]); 406 | 407 | grunt.registerTask('build', [ 408 | 'env:web', 409 | 'preprocess', 410 | 'json', 411 | 'handlebars', 412 | 'typescript', 413 | 'clean', 414 | 'requirejs', 415 | 'copy', 416 | 'useminPrepare', 'concat', 'cssmin', 417 | 'usemin', 418 | 'usebanner', 419 | 'htmlmin', 420 | 'manifest' 421 | ]); 422 | 423 | grunt.registerTask('doc', [ 424 | 'yuidoc' 425 | ]); 426 | 427 | 428 | }; -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Robert S. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | TypeScript AMD (Require.js) Boilerplate 2 | ====================== 3 | Here is the [TypeScript AMD with RequireJS Tutorial](http://www.codebelt.com/typescript/typescript-amd-with-requirejs-tutorial/) for these files. 4 | 5 | Also check out my preferred way of starting a TypeScript project which uses Internal Modules and not AMD: [TypeScript Boilerplate](https://github.com/codeBelt/TypeScript-Boilerplate) 6 | 7 | 8 | Be sure to check out all my [TypeScript tutorials and examples](http://www.codebelt.com/category/typescript/). 9 | 10 | 11 | ###GruntJS - Getting Started 12 | ---------- 13 | Have you ever used different tools to minify CSS and JavaScript? Wouldn't it be great if you could automatically do this without needing to install special OS applications or backend-specific tools? Wouldn't it be great if there was just one easy workflow and command to do this? The answer is `grunt`! 14 | 15 | ####What is Grunt 16 | 17 | Grunt is a command line task runner that will run tasks/plugins that perform repetitive tasks like minification, compilation, unit testing, linting, etc. Grunt is dependent on having [Node.js](http://nodejs.org) installed, but that is all you need to know about nodejs. You can check out the __Install Grunt__ section below later. 18 | 19 | ####Grunt Setup 20 | 21 | At bare minimum we need have a `package.json` file and a `Gruntfile.js` file. 22 | 23 | 1. The `package.json` file will list what plugins we want to use. 24 | 2. The `Gruntfile.js` file is where we will confingure those plugins that are mentioned in the `package.json` file. 25 | 26 | __Empty package.json File__ 27 | 28 | ``` 29 | { 30 | "name": "my-project-name", 31 | "version": "0.1.0", 32 | "devDependencies": { 33 | "grunt": "~0.4.1", 34 | 35 | // Add your plugins here 36 | 37 | } 38 | } 39 | ``` 40 | 41 | __Empty Gruntfile.js File__ 42 | 43 | ``` 44 | module.exports = function(grunt) { 45 | 46 | grunt.initConfig({ 47 | pkg: grunt.file.readJSON('package.json'), 48 | 49 | // Add configuration options for each of your plugins here 50 | 51 | }); 52 | 53 | }; 54 | ``` 55 | 56 | ####Adding Grunt Tasks 57 | You can find a lot of Grunt plugins at [http://gruntjs.com/plugins](http://gruntjs.com/plugins), but for now let's add a RequireJS plugin which will help us create a minified version of our JavaScript code suitable for production use. 58 | 59 | __package.json with RequireJS Plugin__ 60 | 61 | ``` 62 | { 63 | "name": "my-project-name", 64 | "version": "0.1.0", 65 | "devDependencies": { 66 | "grunt": "~0.4.1", 67 | 68 | // Added plugin name with current plugin version. 69 | "grunt-contrib-requirejs": "~0.4.0", 70 | 71 | } 72 | } 73 | ``` 74 | Before you can start using the plugins, we need to download them to our project folder. 75 | 76 | First, with Terminal or the Command Line, navigate to the directory that has the `package.json` and `Gruntfile.js` files. 77 | 78 | Next, type `npm install` for Windows or `sudo npm install` for Mac. This command will automatically download each of the plugins specified in your `package.json` file. The plugins will be downloaded into a new `node_modules` folder in the same directory. 79 | 80 | __Gruntfile.js with RequireJS Plugin__ 81 | 82 | ``` 83 | module.exports = function(grunt) { 84 | 85 | grunt.initConfig({ 86 | pkg: grunt.file.readJSON('package.json'), 87 | 88 | // Add plugins configuration options. 89 | requirejs: { 90 | compile: { 91 | options: { 92 | baseUrl: "path/to/base", 93 | mainConfigFile: "path/to/config.js", 94 | out: "path/to/optimized.js" 95 | } 96 | } 97 | } 98 | 99 | // Loads the RequireJS plugin so we have access to it into this file. 100 | grunt.loadNpmTasks('grunt-contrib-requirejs'); 101 | 102 | // Registers the default task to run the RequireJS plugin. 103 | // In Terminal/Command Line you will be able to type 'grunt' and 104 | // this will run the 'requirejs' plugin in this file. 105 | grunt.registerTask('default', ['requirejs']); 106 | }); 107 | 108 | }; 109 | ``` 110 | 111 | Like I said in the comments you can just type `grunt` and that will run the 'requirejs' plugin. 112 | 113 | __Create Other Tasks__ 114 | 115 | We can do the following to create/register other shortcut command tasks: 116 | 117 | ``` 118 | grunt.registerTask('default', ['requirejs']); 119 | 120 | grunt.registerTask('src', ['pluginName1', 'pluginName2', 'pluginName3']); 121 | grunt.registerTask('web', ['pluginName1', 'pluginName2', 'pluginName3', 'pluginName4']) 122 | 123 | ``` 124 | Above you would call `grunt src` or `grunt web` depending on what series of plugins you would want to run. 125 | 126 | One thing to point out is most plugins allow you to have multiple sub tasks. For example checkout the 'grunt-env' plugin below. 127 | 128 | ``` 129 | env: { 130 | src: { 131 | NODE_ENV : '../src/' 132 | }, 133 | web : { 134 | NODE_ENV : '../web/' 135 | } 136 | } 137 | ``` 138 | You can call `grunt env:src` or `grunt env:web` to run each sub task. If you were to call `grunt env` it would run both sub tasks. 139 | 140 | 141 | ####Installing Grunt 142 | 143 | 1. Install Node.js (This is required in order to run grunt). 144 | * Download and install Node.js from http://nodejs.org 145 | 146 | 2. Install grunt command line interface (CLI) 147 | * On the command line, run the following command: `npm install grunt-cli -g` 148 | 149 | 3. Install grunt packages 150 | * Change to the directory(where package.json is located 151 | * On the command line, run the following command: `npm install` 152 | * It take several minutes to completely download the dependencies. 153 | * If this works successfully, a `node_modules` directory will be created. These files do not need to be redistributed or committed into source control. 154 | 155 | If you have issues installing, please see the following tutorials: 156 | 157 | * [Install Grunt on Mac](http://www.codebelt.com/javascript/install-grunt-js-on-a-mac/) 158 | * [Install Grunt on Windows](http://www.codebelt.com/javascript/install-grunt-js-on-windows/) 159 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "TypeScript-AMD-Boilerplate", 3 | "version": "1.0.0", 4 | 5 | "appVersion": "0.1.0", 6 | "description": "A TypeScript AMD (Require.js) Boilerplate for Web Applications", 7 | "url": "https://github.com/codeBelt/TypeScript-AMD-Boilerplate", 8 | "repository": { 9 | "type" : "git" , 10 | "url" : "https://github.com/codeBelt/TypeScript-AMD-Boilerplate" 11 | }, 12 | "developedBy": "codeBelt", 13 | 14 | "devDependencies": { 15 | "grunt": "0.4.2", 16 | "matchdep": "0.3.0", 17 | 18 | "grunt-contrib-yuidoc": "0.5.0", 19 | "grunt-contrib-watch": "0.5.3", 20 | "grunt-contrib-cssmin": "0.7.0", 21 | "grunt-contrib-htmlmin": "0.1.3", 22 | "grunt-contrib-handlebars": "0.6.0", 23 | "grunt-contrib-concat": "0.3.0", 24 | "grunt-contrib-uglify": "0.2.7", 25 | "grunt-contrib-copy": "0.4.1", 26 | "grunt-contrib-requirejs": "0.4.3", 27 | "grunt-contrib-clean": "0.5.0", 28 | "grunt-banner": "0.2.0", 29 | "grunt-usemin": "2.0.2", 30 | "grunt-json": "0.1.3", 31 | "grunt-manifest": "0.4.0", 32 | "grunt-typescript": "0.2.10", 33 | "grunt-preprocess": "4.0.0", 34 | "grunt-env": "0.4.1", 35 | "grunt-express": "1.2.1", 36 | "grunt-open": "0.2.2" 37 | } 38 | } -------------------------------------------------------------------------------- /src/assets/data/countryList.json: -------------------------------------------------------------------------------- 1 | { 2 | "US": "United States", 3 | "CA": "Canada", 4 | 5 | "AF": "Afghanistan", 6 | "AL": "Albania", 7 | "DZ": "Algeria", 8 | "AS": "American Samoa", 9 | "AD": "Andorra", 10 | "AO": "Angola", 11 | "AI": "Anguilla", 12 | "AQ": "Antarctica", 13 | "AG": "Antigua and Barbuda", 14 | "AR": "Argentina", 15 | "AM": "Armenia", 16 | "AW": "Aruba", 17 | "AU": "Australia", 18 | "AT": "Austria", 19 | "AZ": "Azerbaijan", 20 | "BS": "Bahamas", 21 | "BH": "Bahrain", 22 | "BD": "Bangladesh", 23 | "BB": "Barbados", 24 | "BY": "Belarus", 25 | "BE": "Belgium", 26 | "BZ": "Belize", 27 | "BJ": "Benin", 28 | "BM": "Bermuda", 29 | "BT": "Bhutan", 30 | "BO": "Bolivia", 31 | "BA": "Bosnia and Herzegovina", 32 | "BW": "Botswana", 33 | "BV": "Bouvet Island", 34 | "BR": "Brazil", 35 | "BQ": "British Antarctic Territory", 36 | "IO": "British Indian Ocean Territory", 37 | "VG": "British Virgin Islands", 38 | "BN": "Brunei", 39 | "BG": "Bulgaria", 40 | "BF": "Burkina Faso", 41 | "BI": "Burundi", 42 | "KH": "Cambodia", 43 | "CM": "Cameroon", 44 | "CA": "Canada", 45 | "CT": "Canton and Enderbury Islands", 46 | "CV": "Cape Verde", 47 | "KY": "Cayman Islands", 48 | "CF": "Central African Republic", 49 | "TD": "Chad", 50 | "CL": "Chile", 51 | "CN": "China", 52 | "CX": "Christmas Island", 53 | "CC": "Cocos [Keeling] Islands", 54 | "CO": "Colombia", 55 | "KM": "Comoros", 56 | "CG": "Congo - Brazzaville", 57 | "CD": "Congo - Kinshasa", 58 | "CK": "Cook Islands", 59 | "CR": "Costa Rica", 60 | "HR": "Croatia", 61 | "CU": "Cuba", 62 | "CY": "Cyprus", 63 | "CZ": "Czech Republic", 64 | "CI": "Côte d’Ivoire", 65 | "DK": "Denmark", 66 | "DJ": "Djibouti", 67 | "DM": "Dominica", 68 | "DO": "Dominican Republic", 69 | "NQ": "Dronning Maud Land", 70 | "DD": "East Germany", 71 | "EC": "Ecuador", 72 | "EG": "Egypt", 73 | "SV": "El Salvador", 74 | "GQ": "Equatorial Guinea", 75 | "ER": "Eritrea", 76 | "EE": "Estonia", 77 | "ET": "Ethiopia", 78 | "FK": "Falkland Islands", 79 | "FO": "Faroe Islands", 80 | "FJ": "Fiji", 81 | "FI": "Finland", 82 | "FR": "France", 83 | "GF": "French Guiana", 84 | "PF": "French Polynesia", 85 | "TF": "French Southern Territories", 86 | "FQ": "French Southern and Antarctic Territories", 87 | "GA": "Gabon", 88 | "GM": "Gambia", 89 | "GE": "Georgia", 90 | "DE": "Germany", 91 | "GH": "Ghana", 92 | "GI": "Gibraltar", 93 | "GR": "Greece", 94 | "GL": "Greenland", 95 | "GD": "Grenada", 96 | "GP": "Guadeloupe", 97 | "GU": "Guam", 98 | "GT": "Guatemala", 99 | "GG": "Guernsey", 100 | "GN": "Guinea", 101 | "GW": "Guinea-Bissau", 102 | "GY": "Guyana", 103 | "HT": "Haiti", 104 | "HM": "Heard Island and McDonald Islands", 105 | "HN": "Honduras", 106 | "HK": "Hong Kong SAR China", 107 | "HU": "Hungary", 108 | "IS": "Iceland", 109 | "IN": "India", 110 | "ID": "Indonesia", 111 | "IR": "Iran", 112 | "IQ": "Iraq", 113 | "IE": "Ireland", 114 | "IM": "Isle of Man", 115 | "IL": "Israel", 116 | "IT": "Italy", 117 | "JM": "Jamaica", 118 | "JP": "Japan", 119 | "JE": "Jersey", 120 | "JT": "Johnston Island", 121 | "JO": "Jordan", 122 | "KZ": "Kazakhstan", 123 | "KE": "Kenya", 124 | "KI": "Kiribati", 125 | "KW": "Kuwait", 126 | "KG": "Kyrgyzstan", 127 | "LA": "Laos", 128 | "LV": "Latvia", 129 | "LB": "Lebanon", 130 | "LS": "Lesotho", 131 | "LR": "Liberia", 132 | "LY": "Libya", 133 | "LI": "Liechtenstein", 134 | "LT": "Lithuania", 135 | "LU": "Luxembourg", 136 | "MO": "Macau SAR China", 137 | "MK": "Macedonia", 138 | "MG": "Madagascar", 139 | "MW": "Malawi", 140 | "MY": "Malaysia", 141 | "MV": "Maldives", 142 | "ML": "Mali", 143 | "MT": "Malta", 144 | "MH": "Marshall Islands", 145 | "MQ": "Martinique", 146 | "MR": "Mauritania", 147 | "MU": "Mauritius", 148 | "YT": "Mayotte", 149 | "FX": "Metropolitan France", 150 | "MX": "Mexico", 151 | "FM": "Micronesia", 152 | "MI": "Midway Islands", 153 | "MD": "Moldova", 154 | "MC": "Monaco", 155 | "MN": "Mongolia", 156 | "ME": "Montenegro", 157 | "MS": "Montserrat", 158 | "MA": "Morocco", 159 | "MZ": "Mozambique", 160 | "MM": "Myanmar [Burma]", 161 | "NA": "Namibia", 162 | "NR": "Nauru", 163 | "NP": "Nepal", 164 | "NL": "Netherlands", 165 | "AN": "Netherlands Antilles", 166 | "NT": "Neutral Zone", 167 | "NC": "New Caledonia", 168 | "NZ": "New Zealand", 169 | "NI": "Nicaragua", 170 | "NE": "Niger", 171 | "NG": "Nigeria", 172 | "NU": "Niue", 173 | "NF": "Norfolk Island", 174 | "KP": "North Korea", 175 | "VD": "North Vietnam", 176 | "MP": "Northern Mariana Islands", 177 | "NO": "Norway", 178 | "OM": "Oman", 179 | "PC": "Pacific Islands Trust Territory", 180 | "PK": "Pakistan", 181 | "PW": "Palau", 182 | "PS": "Palestinian Territories", 183 | "PA": "Panama", 184 | "PZ": "Panama Canal Zone", 185 | "PG": "Papua New Guinea", 186 | "PY": "Paraguay", 187 | "YD": "People's Democratic Republic of Yemen", 188 | "PE": "Peru", 189 | "PH": "Philippines", 190 | "PN": "Pitcairn Islands", 191 | "PL": "Poland", 192 | "PT": "Portugal", 193 | "PR": "Puerto Rico", 194 | "QA": "Qatar", 195 | "RO": "Romania", 196 | "RU": "Russia", 197 | "RW": "Rwanda", 198 | "RE": "Réunion", 199 | "BL": "Saint Barthélemy", 200 | "SH": "Saint Helena", 201 | "KN": "Saint Kitts and Nevis", 202 | "LC": "Saint Lucia", 203 | "MF": "Saint Martin", 204 | "PM": "Saint Pierre and Miquelon", 205 | "VC": "Saint Vincent and the Grenadines", 206 | "WS": "Samoa", 207 | "SM": "San Marino", 208 | "SA": "Saudi Arabia", 209 | "SN": "Senegal", 210 | "RS": "Serbia", 211 | "CS": "Serbia and Montenegro", 212 | "SC": "Seychelles", 213 | "SL": "Sierra Leone", 214 | "SG": "Singapore", 215 | "SK": "Slovakia", 216 | "SI": "Slovenia", 217 | "SB": "Solomon Islands", 218 | "SO": "Somalia", 219 | "ZA": "South Africa", 220 | "GS": "South Georgia and the South Sandwich Islands", 221 | "KR": "South Korea", 222 | "ES": "Spain", 223 | "LK": "Sri Lanka", 224 | "SD": "Sudan", 225 | "SR": "Suriname", 226 | "SJ": "Svalbard and Jan Mayen", 227 | "SZ": "Swaziland", 228 | "SE": "Sweden", 229 | "CH": "Switzerland", 230 | "SY": "Syria", 231 | "ST": "São Tomé and Príncipe", 232 | "TW": "Taiwan", 233 | "TJ": "Tajikistan", 234 | "TZ": "Tanzania", 235 | "TH": "Thailand", 236 | "TL": "Timor-Leste", 237 | "TG": "Togo", 238 | "TK": "Tokelau", 239 | "TO": "Tonga", 240 | "TT": "Trinidad and Tobago", 241 | "TN": "Tunisia", 242 | "TR": "Turkey", 243 | "TM": "Turkmenistan", 244 | "TC": "Turks and Caicos Islands", 245 | "TV": "Tuvalu", 246 | "UM": "U.S. Minor Outlying Islands", 247 | "PU": "U.S. Miscellaneous Pacific Islands", 248 | "VI": "U.S. Virgin Islands", 249 | "UG": "Uganda", 250 | "UA": "Ukraine", 251 | "SU": "Union of Soviet Socialist Republics", 252 | "AE": "United Arab Emirates", 253 | "GB": "United Kingdom", 254 | "US": "United States", 255 | "ZZ": "Unknown or Invalid Region", 256 | "UY": "Uruguay", 257 | "UZ": "Uzbekistan", 258 | "VU": "Vanuatu", 259 | "VA": "Vatican City", 260 | "VE": "Venezuela", 261 | "VN": "Vietnam", 262 | "WK": "Wake Island", 263 | "WF": "Wallis and Futuna", 264 | "EH": "Western Sahara", 265 | "YE": "Yemen", 266 | "ZM": "Zambia", 267 | "ZW": "Zimbabwe", 268 | "AX": "Åland Islands" 269 | } -------------------------------------------------------------------------------- /src/assets/media/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeBelt/TypeScript-AMD-Boilerplate/5d3f3d67795717c720cd29aa7c4a33f04ad9384e/src/assets/media/images/logo.png -------------------------------------------------------------------------------- /src/assets/media/images/moblie-icons/icon-100x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeBelt/TypeScript-AMD-Boilerplate/5d3f3d67795717c720cd29aa7c4a33f04ad9384e/src/assets/media/images/moblie-icons/icon-100x100.png -------------------------------------------------------------------------------- /src/assets/media/images/moblie-icons/icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeBelt/TypeScript-AMD-Boilerplate/5d3f3d67795717c720cd29aa7c4a33f04ad9384e/src/assets/media/images/moblie-icons/icon-144x144.png -------------------------------------------------------------------------------- /src/assets/media/images/moblie-icons/icon-29x29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeBelt/TypeScript-AMD-Boilerplate/5d3f3d67795717c720cd29aa7c4a33f04ad9384e/src/assets/media/images/moblie-icons/icon-29x29.png -------------------------------------------------------------------------------- /src/assets/media/images/moblie-icons/icon-50x50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeBelt/TypeScript-AMD-Boilerplate/5d3f3d67795717c720cd29aa7c4a33f04ad9384e/src/assets/media/images/moblie-icons/icon-50x50.png -------------------------------------------------------------------------------- /src/assets/media/images/moblie-icons/icon-58x58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeBelt/TypeScript-AMD-Boilerplate/5d3f3d67795717c720cd29aa7c4a33f04ad9384e/src/assets/media/images/moblie-icons/icon-58x58.png -------------------------------------------------------------------------------- /src/assets/media/images/moblie-icons/icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeBelt/TypeScript-AMD-Boilerplate/5d3f3d67795717c720cd29aa7c4a33f04ad9384e/src/assets/media/images/moblie-icons/icon-72x72.png -------------------------------------------------------------------------------- /src/assets/scripts/AppBootstrap.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | /// 4 | /// 5 | 6 | /** 7 | * Main entry point for RequireJS 8 | */ 9 | require( 10 | [ 11 | 'TestApp', 12 | 'jquery' 13 | ], 14 | (TestApp, $) => { 15 | 'use strict'; 16 | 17 | $(document).ready(function () { 18 | var app = new TestApp(); 19 | app.appendTo('body'); 20 | }); 21 | } 22 | ); -------------------------------------------------------------------------------- /src/assets/scripts/TestApp.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | 5 | /// 6 | /// 7 | declare var require:(moduleId:string) => any; 8 | var TopNavigationTemplate:Function = require('hbs!templates/topbar/TopNavigationTemplate'); 9 | var LoginTemplate:Function = require('hbs!templates/login/LoginTemplate'); 10 | 11 | import TemplateFactory = require("util/TemplateFactory"); 12 | import Base = require("view/Base"); 13 | import AnotherClass = require("view/AnotherClass"); 14 | import _ = require("lodash"); 15 | 16 | /** 17 | * YUIDoc_comment 18 | * 19 | * @class TestApp 20 | * @module namespace 21 | * @constructor 22 | **/ 23 | class TestApp extends Base { 24 | 25 | private _title:string = 'TypeScript AMD Boilerplate'; 26 | private _anotherClass:AnotherClass = null; 27 | 28 | constructor() { 29 | super(); 30 | } 31 | 32 | /** 33 | * @overridden Base.createChildren 34 | */ 35 | public createChildren():void { 36 | var template:string = TopNavigationTemplate(); 37 | this.addChild(template); 38 | 39 | template = LoginTemplate({title: this._title}); 40 | this.addChild(template); 41 | 42 | this._anotherClass = new AnotherClass(); 43 | this._anotherClass.sayHi(); 44 | 45 | console.log("_", _); 46 | } 47 | 48 | } 49 | 50 | export = TestApp; -------------------------------------------------------------------------------- /src/assets/scripts/_declare/external.d.ts: -------------------------------------------------------------------------------- 1 | declare var JSON_DATA:any; 2 | declare var JST:any; -------------------------------------------------------------------------------- /src/assets/scripts/_declare/handlebars.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for Handlebars 1.0 2 | // Project: http://handlebarsjs.com/ 3 | // Definitions by: Boris Yankov 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | 6 | 7 | interface HandlebarsStatic { 8 | registerHelper(name: string, fn: Function, inverse?: boolean): void; 9 | registerPartial(name: string, str): void; 10 | K(); 11 | createFrame(object); 12 | 13 | Exception(message: string): void; 14 | SafeString(str: string): void; 15 | 16 | parse(string: string); 17 | print(ast); 18 | logger; 19 | log(level, str): void; 20 | compile(environment, options?, context?, asObject?); 21 | } 22 | 23 | declare var Handlebars: HandlebarsStatic; 24 | -------------------------------------------------------------------------------- /src/assets/scripts/_declare/require.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for RequireJS 2.1.8 2 | // Project: http://requirejs.org/ 3 | // Definitions by: Josh Baldwin 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | 6 | /* 7 | require-2.1.8.d.ts may be freely distributed under the MIT license. 8 | 9 | Copyright (c) 2013 Josh Baldwin https://github.com/jbaldwin/require.d.ts 10 | 11 | Permission is hereby granted, free of charge, to any person 12 | obtaining a copy of this software and associated documentation 13 | files (the "Software"), to deal in the Software without 14 | restriction, including without limitation the rights to use, 15 | copy, modify, merge, publish, distribute, sublicense, and/or sell 16 | copies of the Software, and to permit persons to whom the 17 | Software is furnished to do so, subject to the following conditions: 18 | 19 | The above copyright notice and this permission notice shall be 20 | included in all copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 23 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 24 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 25 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 26 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 27 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 28 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 29 | OTHER DEALINGS IN THE SOFTWARE. 30 | */ 31 | 32 | interface RequireError extends Error { 33 | 34 | /** 35 | * The error ID that maps to an ID on a web page. 36 | **/ 37 | requireType: string; 38 | 39 | /** 40 | * Required modules. 41 | **/ 42 | requireModules: string[]; 43 | 44 | /** 45 | * The original error, if there is one (might be null). 46 | **/ 47 | originalError: Error; 48 | } 49 | 50 | interface RequireShim { 51 | 52 | /** 53 | * List of dependencies. 54 | **/ 55 | deps?: string[]; 56 | 57 | /** 58 | * Name the module will be exported as. 59 | **/ 60 | exports?: string; 61 | 62 | /** 63 | * Initialize function with all dependcies passed in, 64 | * if the function returns a value then that value is used 65 | * as the module export value instead of the object 66 | * found via the 'exports' string. 67 | * @param dependencies 68 | * @return 69 | **/ 70 | init?: (...dependencies: any[]) => any; 71 | } 72 | 73 | interface RequireConfig { 74 | 75 | // The root path to use for all module lookups. 76 | baseUrl?: string; 77 | 78 | // Path mappings for module names not found directly under 79 | // baseUrl. 80 | paths?: { [key: string]: any; }; 81 | 82 | // Dictionary of Shim's. 83 | // does not cover case of key->string[] 84 | shim?: { [key: string]: RequireShim; }; 85 | 86 | /** 87 | * For the given module prefix, instead of loading the 88 | * module with the given ID, substitude a different 89 | * module ID. 90 | * 91 | * @example 92 | * requirejs.config({ 93 | * map: { 94 | * 'some/newmodule': { 95 | * 'foo': 'foo1.2' 96 | * }, 97 | * 'some/oldmodule': { 98 | * 'foo': 'foo1.0' 99 | * } 100 | * } 101 | * }); 102 | **/ 103 | map?: { 104 | [id: string]: { 105 | [id: string]: string; 106 | }; 107 | }; 108 | 109 | /** 110 | * AMD configurations, use module.config() to access in 111 | * define() functions 112 | **/ 113 | config?: { [id: string]: {}; }; 114 | 115 | /** 116 | * Configures loading modules from CommonJS packages. 117 | **/ 118 | packages?: {}; 119 | 120 | /** 121 | * The number of seconds to wait before giving up on loading 122 | * a script. The default is 7 seconds. 123 | **/ 124 | waitSeconds?: number; 125 | 126 | /** 127 | * A name to give to a loading context. This allows require.js 128 | * to load multiple versions of modules in a page, as long as 129 | * each top-level require call specifies a unique context string. 130 | **/ 131 | context?: string; 132 | 133 | /** 134 | * An array of dependencies to load. 135 | **/ 136 | deps?: string[]; 137 | 138 | /** 139 | * A function to pass to require that should be require after 140 | * deps have been loaded. 141 | * @param modules 142 | **/ 143 | callback?: (...modules: any[]) => void; 144 | 145 | /** 146 | * If set to true, an error will be thrown if a script loads 147 | * that does not call define() or have shim exports string 148 | * value that can be checked. 149 | **/ 150 | enforceDefine?: boolean; 151 | 152 | /** 153 | * If set to true, document.createElementNS() will be used 154 | * to create script elements. 155 | **/ 156 | xhtml?: boolean; 157 | 158 | /** 159 | * Extra query string arguments appended to URLs that RequireJS 160 | * uses to fetch resources. Most useful to cachce bust when 161 | * the browser or server is not configured correcty. 162 | * 163 | * @example 164 | * urlArgs: "bust= + (new Date()).getTime() 165 | **/ 166 | urlArgs?: string; 167 | 168 | /** 169 | * Specify the value for the type="" attribute used for script 170 | * tags inserted into the document by RequireJS. Default is 171 | * "text/javascript". To use Firefox's JavasScript 1.8 172 | * features, use "text/javascript;version=1.8". 173 | **/ 174 | scriptType?: string; 175 | 176 | } 177 | 178 | // todo: not sure what to do with this guy 179 | interface RequireModule { 180 | 181 | /** 182 | * 183 | **/ 184 | config(): {}; 185 | 186 | } 187 | 188 | /** 189 | * 190 | **/ 191 | interface RequireMap { 192 | 193 | /** 194 | * 195 | **/ 196 | prefix: string; 197 | 198 | /** 199 | * 200 | **/ 201 | name: string; 202 | 203 | /** 204 | * 205 | **/ 206 | parentMap: RequireMap; 207 | 208 | /** 209 | * 210 | **/ 211 | url: string; 212 | 213 | /** 214 | * 215 | **/ 216 | originalName: string; 217 | 218 | /** 219 | * 220 | **/ 221 | fullName: string; 222 | } 223 | 224 | interface Require { 225 | 226 | /** 227 | * Configure require.js 228 | **/ 229 | config(config: RequireConfig): Require; 230 | 231 | /** 232 | * CommonJS require call 233 | * @param module Module to load 234 | * @return The loaded module 235 | */ 236 | (module: string): any; 237 | 238 | /** 239 | * Start the main app logic. 240 | * Callback is optional. 241 | * Can alternatively use deps and callback. 242 | * @param modules Required modules to load. 243 | **/ 244 | (modules: string[]): void; 245 | 246 | /** 247 | * @see Require() 248 | * @param ready Called when required modules are ready. 249 | **/ 250 | (modules: string[], ready: Function): void; 251 | 252 | /** 253 | * @see http://requirejs.org/docs/api.html#errbacks 254 | * @param ready Called when required modules are ready. 255 | **/ 256 | (modules: string[], ready: Function, errback: Function): void; 257 | 258 | /** 259 | * Generate URLs from require module 260 | * @param module Module to URL 261 | * @return URL string 262 | **/ 263 | toUrl(module: string): string; 264 | 265 | /** 266 | * On Error override 267 | * @param err 268 | **/ 269 | onError(err: RequireError, errback?: (err: RequireError) => void): void; 270 | 271 | /** 272 | * Undefine a module 273 | * @param module Module to undefine. 274 | **/ 275 | undef(module: string): void; 276 | 277 | /** 278 | * Semi-private function, overload in special instance of undef() 279 | **/ 280 | onResourceLoad(context: Object, map: RequireMap, depArray: RequireMap[]): void; 281 | } 282 | 283 | interface RequireDefine { 284 | 285 | /** 286 | * Define Simple Name/Value Pairs 287 | * @param config Dictionary of Named/Value pairs for the config. 288 | **/ 289 | (config: { [key: string]: any; }): void; 290 | 291 | /** 292 | * Define function. 293 | * @param func: The function module. 294 | **/ 295 | (func: () => any): void; 296 | 297 | /** 298 | * Define function with dependencies. 299 | * @param deps List of dependencies module IDs. 300 | * @param ready Callback function when the dependencies are loaded. 301 | * callback param deps module dependencies 302 | * callback return module definition 303 | **/ 304 | (deps: string[], ready: Function): void; 305 | 306 | /** 307 | * Define module with simplified CommonJS wrapper. 308 | * @param ready 309 | * callback require requirejs instance 310 | * callback exports exports object 311 | * callback module module 312 | * callback return module definition 313 | **/ 314 | (ready: (require: Require, exports: { [key: string]: any; }, module: RequireModule) => any): void; 315 | 316 | /** 317 | * Define a module with a name and dependencies. 318 | * @param name The name of the module. 319 | * @param deps List of dependencies module IDs. 320 | * @param ready Callback function when the dependencies are loaded. 321 | * callback deps module dependencies 322 | * callback return module definition 323 | **/ 324 | (name: string, deps: string[], ready: Function): void; 325 | } 326 | 327 | // Ambient declarations for 'require' and 'define' 328 | declare var requirejs: Require; 329 | declare var require: Require; 330 | declare var define: RequireDefine; 331 | -------------------------------------------------------------------------------- /src/assets/scripts/config.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Application configuration declaration. 3 | */ 4 | require.config({ 5 | 6 | baseUrl: 'assets/scripts/', 7 | 8 | paths: { 9 | //main libraries 10 | jquery: '../vendor/jquery/jquery-1.9.1', 11 | lodash: '../vendor/lodash/lodash', 12 | 13 | //shortcut paths 14 | templates: '../templates', 15 | data: '../data', 16 | 17 | //require plugins 18 | text: '../vendor/require/text', 19 | tpl: '../vendor/require/tpl', 20 | json: '../vendor/require/json', 21 | hbs: '../vendor/require-handlebars-plugin/hbs' 22 | }, 23 | 24 | shim: { 25 | jquery: { 26 | exports: '$' 27 | }, 28 | lodash: { 29 | exports: '_' 30 | }, 31 | Handlebars: { 32 | exports: 'Handlebars' 33 | } 34 | } 35 | }); -------------------------------------------------------------------------------- /src/assets/scripts/util/TemplateFactory.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * YUIDoc_comment 3 | * 4 | * @class TemplateFactory 5 | * @module namespace 6 | * @constructor 7 | **/ 8 | class TemplateFactory { 9 | 10 | public static CLASS_NAME:string = 'TemplateFactory'; 11 | 12 | public static TEMPLATES:any = null; 13 | 14 | constructor() { 15 | } 16 | 17 | /** 18 | * YUIDoc_comment 19 | * 20 | * @method create 21 | * @param templatePath {string} 22 | * @param [data=null] {Object} 23 | * @return {string} 24 | * @public 25 | * @static 26 | */ 27 | public static create(templatePath:string, data:Object = null):string { 28 | var templateFunction:Function = TemplateFactory.TEMPLATES[templatePath]; 29 | var template:string = templateFunction(data); 30 | 31 | return template; 32 | } 33 | 34 | } 35 | 36 | export = TemplateFactory; -------------------------------------------------------------------------------- /src/assets/scripts/view/AnotherClass.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * YUIDoc_comment 3 | * 4 | * @class TestApp 5 | * @module namespace 6 | * @constructor 7 | **/ 8 | class AnotherClass { 9 | 10 | constructor() { 11 | } 12 | 13 | /** 14 | * YUIDoc_comment 15 | * 16 | * @method sayHi 17 | * @public 18 | */ 19 | public sayHi():void { 20 | console.log('Hi there!'); 21 | } 22 | 23 | } 24 | 25 | export = AnotherClass; -------------------------------------------------------------------------------- /src/assets/scripts/view/Base.ts: -------------------------------------------------------------------------------- 1 | import $ = require("jquery"); 2 | 3 | /** 4 | * YUIDoc_comment 5 | * 6 | * @class TestApp 7 | * @module namespace 8 | * @constructor 9 | **/ 10 | class Base { 11 | 12 | private _parent:JQuery = null; 13 | 14 | constructor() { 15 | } 16 | 17 | /** 18 | * YUIDoc_comment 19 | * 20 | * @method createChildren 21 | * @protected 22 | */ 23 | public createChildren():void { 24 | 25 | } 26 | 27 | /** 28 | * YUIDoc_comment 29 | * 30 | * @method appendTo 31 | * @param selector {string} 32 | * @public 33 | */ 34 | public appendTo(selector:string):void { 35 | this._parent = $(selector); 36 | this.createChildren(); 37 | } 38 | 39 | /** 40 | * YUIDoc_comment 41 | * 42 | * @method addChild 43 | * @public 44 | */ 45 | public addChild(template:string):void { 46 | this._parent.append(template); 47 | } 48 | 49 | } 50 | 51 | export = Base; -------------------------------------------------------------------------------- /src/assets/styles/styles.css: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------- 2 | Original Author: 3 | 4 | Target Browsers: All 5 | Media Type: Screen, Projection 6 | Width: All Sizes 7 | ------------------------------------------------------------------------ */ 8 | 9 | /* --------------------------------------------------------------------- 10 | BODY - Adjutment for Fixed Header 11 | ------------------------------------------------------------------------ */ 12 | body { 13 | padding-top: 43px; 14 | /* 15 | height: 768px; 16 | overflow: hidden; 17 | */ 18 | } 19 | 20 | @media (min-width: 1200px) { 21 | body { 22 | padding-top: 43px; 23 | height: auto; 24 | overflow: auto; 25 | } 26 | } 27 | 28 | .span-main { 29 | margin-left: 0px; 30 | } 31 | 32 | a { 33 | cursor: pointer; 34 | } 35 | 36 | .test { 37 | vertical-align: bottom; 38 | } 39 | 40 | .nowrap { 41 | white-space: nowrap; 42 | } 43 | 44 | /* --------------------------------------------------------------------- 45 | Frame Structure 46 | ------------------------------------------------------------------------ */ 47 | 48 | .frame { 49 | position: relative; 50 | } 51 | 52 | .frame_header { 53 | padding: 0 5px 0 20px; 54 | } 55 | 56 | .frame-hd { 57 | width: 300px; 58 | position: fixed; 59 | top: 42px; 60 | left: 0; 61 | height: -webkit-calc(100% - 42px); 62 | height: -moz-calc(100% - 42px); 63 | height: calc(100% - 42px); 64 | } 65 | 66 | .frame-bd { 67 | margin-left: 320px; 68 | } 69 | 70 | .sidebarScroller { 71 | height: -webkit-calc(100% - 44px); 72 | height: -moz-calc(100% - 44px); 73 | height: calc(100% - 44px); 74 | overflow: auto; 75 | -webkit-overflow-scrolling: touch; 76 | } 77 | 78 | .smallPanel { 79 | width: 300px; 80 | margin: 0 auto; 81 | } 82 | 83 | .mediumPanel { 84 | width: 450px; 85 | margin: 0 auto; 86 | } 87 | 88 | .largePanel { 89 | width: 600px; 90 | margin: 0 auto; 91 | } 92 | 93 | .subFrame { 94 | position: relative; 95 | } 96 | 97 | .subFrame-bd { 98 | margin-right: 200px; 99 | min-width: 464px; 100 | } 101 | 102 | .subFrame-ft { 103 | width: 180px; 104 | position: absolute; 105 | top: 0; 106 | right: 0; 107 | } 108 | 109 | .columns { 110 | overflow: hidden; 111 | } 112 | 113 | .columns-column { 114 | float: left; 115 | width: 50%; 116 | } 117 | 118 | .columns-column + .columns-column { 119 | text-align: right; 120 | } 121 | 122 | .col .icon-arrow-down, 123 | .col .icon-arrow-up { 124 | display: none; 125 | } 126 | 127 | .col.descending .icon-arrow-up { 128 | display: inline-block; 129 | } 130 | 131 | .col.ascending .icon-arrow-down { 132 | display: inline-block; 133 | } 134 | 135 | .col.sortable { 136 | cursor: pointer; 137 | } 138 | 139 | /* --------------------------------------------------------------------- 140 | Inline Form 141 | ------------------------------------------------------------------------ */ 142 | 143 | .form-inline { 144 | 145 | } 146 | 147 | .form-inline .control-label { 148 | display: inline-block; 149 | *display: inline; 150 | margin-right: 10px; 151 | } 152 | 153 | .form-inline .controls { 154 | display: inline-block; 155 | *display: inline; 156 | } 157 | 158 | .form-inline label { 159 | } 160 | 161 | /* --------------------------------------------------------------------- 162 | Page Header 163 | ------------------------------------------------------------------------ */ 164 | 165 | .icon-logo { 166 | height: 16px; 167 | width: 16px; 168 | margin-top: 4px; 169 | background-image: url("../media/images/logo.png"); 170 | background-position: 0 0; 171 | text-indent: -999em; 172 | } 173 | 174 | .hd-page { 175 | position: absolute; 176 | width: 400px; 177 | left: 50%; 178 | margin: 0 0 0 -200px; 179 | text-align: center; 180 | color: #ffffff; 181 | font-size: 20px; 182 | font-weight: normal; 183 | line-height: 43px 184 | } 185 | 186 | .label-header { 187 | margin-top: 12px; 188 | margin-right: 10px; 189 | } 190 | 191 | /* --------------------------------------------------------------------- 192 | Panel Nav - Bootstrap Overrides 193 | ------------------------------------------------------------------------ */ 194 | 195 | .navbarPanel { 196 | margin-bottom: 2px; 197 | } 198 | 199 | .navbarPanel .divider-vertical { 200 | margin: 0; 201 | } 202 | 203 | .navbarPanel .navbar-inner { 204 | padding-left: 3px; 205 | padding-right: 3px; 206 | } 207 | 208 | .navbarPanel .nav { 209 | margin-right: 0; 210 | } 211 | 212 | .navbarPanel .nav > li > a { 213 | padding: 10px 5px; 214 | } 215 | 216 | /* --------------------------------------------------------------------- 217 | Headings 218 | ------------------------------------------------------------------------ */ 219 | 220 | .hd { 221 | margin: 0 0 1em 0; 222 | line-height: 1; 223 | } 224 | 225 | .hd_1 { 226 | font-size: 30px; 227 | } 228 | 229 | .hd_2 { 230 | font-size: 24px; 231 | } 232 | 233 | .hd_3 { 234 | font-size: 22px; 235 | } 236 | 237 | .hd_4 { 238 | font-size: 18px; 239 | } 240 | 241 | .hd_5 { 242 | font-size: 16px; 243 | } 244 | 245 | .hd_6 { 246 | font-size: 14px; 247 | } 248 | 249 | .hdg-section { 250 | display: block; 251 | height: 40px; 252 | line-height: 40px; 253 | padding: 0 12px; 254 | margin: 0 0 2px 0; 255 | -webkit-border-radius: 5px; 256 | -moz-border-radius: 5px; 257 | border-radius: 5px; 258 | font-size: 14px; 259 | color: #ffffff; 260 | text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); 261 | background-color: #363636; 262 | *background-color: #222222; 263 | background-image: -moz-linear-gradient(top, #444444, #222222); 264 | background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#444444), to(#222222)); 265 | background-image: -webkit-linear-gradient(top, #444444, #222222); 266 | background-image: -o-linear-gradient(top, #444444, #222222); 267 | background-image: linear-gradient(to bottom, #444444, #222222); 268 | background-repeat: repeat-x; 269 | border-color: #222222 #222222 #000000; 270 | border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); 271 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444', endColorstr='#ff222222', GradientType=0); 272 | filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); 273 | } 274 | 275 | 276 | .hdg-section .hd { 277 | height: 40px; 278 | line-height: 40px; 279 | } 280 | 281 | .hdg-section .btn { 282 | font-weight: normal; 283 | margin-top: -2px; 284 | } 285 | 286 | .hdg-gap { 287 | margin-bottom: 20px; 288 | } 289 | 290 | .leagalize { 291 | padding: 0 20px; 292 | margin-bottom: 20px; 293 | font-size: 12px; 294 | line-height: 1.2; 295 | } 296 | 297 | /* --------------------------------------------------------------------- 298 | Buttons 299 | ------------------------------------------------------------------------ */ 300 | 301 | .btn-fixedWidth_medium { 302 | width: 200px; 303 | } 304 | 305 | .btn-steps { 306 | display: block; 307 | /*width: 274px;*/ 308 | text-align: left; 309 | } 310 | 311 | .btn-menu { 312 | width: 274px; 313 | text-align: center; 314 | } 315 | 316 | .icon-right { 317 | display: block; 318 | float: right; 319 | } 320 | 321 | /* --------------------------------------------------------------------- 322 | Misc Modules 323 | ------------------------------------------------------------------------ */ 324 | 325 | .inset { 326 | padding: 10px 10px 0 10px; 327 | } 328 | 329 | .modal-content-scroll { 330 | overflow: auto; 331 | -webkit-overflow-scrolling: touch; 332 | } 333 | 334 | /* --------------------------------------------------------------------- 335 | Project Information Panel 336 | ------------------------------------------------------------------------ */ 337 | 338 | .projectInformationPanel { 339 | height: 115px; 340 | overflow: auto; 341 | -webkit-overflow-scrolling: touch; 342 | } 343 | 344 | /* --------------------------------------------------------------------- 345 | Panel Overflows 346 | ------------------------------------------------------------------------ */ 347 | 348 | .windowTypesPanel-bd { 349 | /*height: 373px;*/ 350 | /*overflow: auto;*/ 351 | } 352 | 353 | .fullPanel { 354 | height: 586px; 355 | overflow: auto; 356 | -webkit-overflow-scrolling: touch; 357 | } 358 | 359 | /* --------------------------------------------------------------------- 360 | Project Listings 361 | ------------------------------------------------------------------------ */ 362 | 363 | .infoBlock { 364 | margin-bottom: 2px; 365 | border: 1px solid #d4d4d4; 366 | position: relative; 367 | -webkit-border-radius: 5px; 368 | -moz-border-radius: 5px; 369 | border-radius: 5px; 370 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff2f2f2', GradientType=0); 371 | -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); 372 | -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); 373 | box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); 374 | } 375 | 376 | .infoBlock_archive, 377 | .infoBlock_archive > a, 378 | .infoBlock_archive > a:hover { 379 | background-color: #333; 380 | filter: none; 381 | color: #fff; 382 | } 383 | 384 | .infoBlock-hd:hover { 385 | text-decoration: none; 386 | } 387 | 388 | .infoBlock-hd { 389 | display: block; 390 | cursor: pointer; 391 | height: 40px; 392 | line-height: 40px; 393 | padding: 0 12px; 394 | margin: 0 0 2px 0; 395 | -webkit-border-radius: 5px; 396 | -moz-border-radius: 5px; 397 | border-radius: 5px 5px 0 0; 398 | text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); 399 | background-color: #363636; 400 | *background-color: #222222; 401 | background-image: -moz-linear-gradient(top, #444444, #222222); 402 | background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#444444), to(#222222)); 403 | background-image: -webkit-linear-gradient(top, #444444, #222222); 404 | background-image: -o-linear-gradient(top, #444444, #222222); 405 | background-image: linear-gradient(to bottom, #444444, #222222); 406 | background-repeat: repeat-x; 407 | border-color: #222222 #222222 #000000; 408 | border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); 409 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#444444', endColorstr='#222222', GradientType=0); 410 | filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); 411 | } 412 | 413 | .infoBlock-hd.active { 414 | background-color: #006dcc; 415 | background-image: -moz-linear-gradient(top, #0088cc, #0044cc); 416 | background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); 417 | background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); 418 | background-image: -o-linear-gradient(top, #0088cc, #0044cc); 419 | background-image: linear-gradient(to bottom, #0088cc, #0044cc); 420 | background-repeat: repeat-x; 421 | border-color: #0044cc #0044cc #002a80; 422 | border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); 423 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0); 424 | filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); 425 | } 426 | 427 | /*.infoBlock_archive .infoBlock-hd {*/ 428 | /*cursor: default;*/ 429 | /*}*/ 430 | 431 | .infoBlock_archive .infoBlock-hd { 432 | background-color: #363636; 433 | *background-color: #222222; 434 | background-image: -moz-linear-gradient(top, #444444, #222222); 435 | background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#444444), to(#222222)); 436 | background-image: -webkit-linear-gradient(top, #444444, #222222); 437 | background-image: -o-linear-gradient(top, #444444, #222222); 438 | background-image: linear-gradient(to bottom, #444444, #222222); 439 | background-repeat: repeat-x; 440 | border-color: #222222 #222222 #000000; 441 | border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); 442 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#444444', endColorstr='#222222', GradientType=0); 443 | filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); 444 | } 445 | 446 | .infoBlock_archive .infoBlock-hd.active { 447 | background-color: #faa732; 448 | background-image: -moz-linear-gradient(top, #fbb450, #f89406); 449 | background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406)); 450 | background-image: -webkit-linear-gradient(top, #fbb450, #f89406); 451 | background-image: -o-linear-gradient(top, #fbb450, #f89406); 452 | background-image: linear-gradient(to bottom, #fbb450, #f89406); 453 | background-repeat: repeat-x; 454 | border-color: #f89406 #f89406 #ad6704; 455 | border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); 456 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fbb450', endColorstr='#f89406', GradientType=0); 457 | filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); 458 | } 459 | 460 | .hdg-listing { 461 | font-size: 14px; 462 | color: #ffffff; 463 | margin: 0; 464 | } 465 | 466 | .hdg-listing .btn { 467 | margin-top: 8px; 468 | } 469 | 470 | /* --------------------------------------------------------------------- 471 | Alternate Wells 472 | ------------------------------------------------------------------------ */ 473 | 474 | .well-alt { 475 | min-height: 20px; 476 | padding: 19px 19px 9px 19px; 477 | margin-bottom: 2px; 478 | border: 1px solid #e3e3e3; 479 | -webkit-border-radius: 4px; 480 | -moz-border-radius: 4px; 481 | border-radius: 4px; 482 | -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); 483 | -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); 484 | box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); 485 | } 486 | 487 | .well-indent { 488 | padding: 10px 20px; 489 | margin-bottom: 2px; 490 | } 491 | 492 | .well_noTop { 493 | padding-top: 0; 494 | } 495 | 496 | .well_noBottom { 497 | padding-bottom: 0; 498 | } 499 | 500 | /* --------------------------------------------------------------------- 501 | Wrappers 502 | ------------------------------------------------------------------------ */ 503 | 504 | .wrapperFixed { 505 | margin: 0 auto; 506 | width: 1024px; 507 | height: 725px; 508 | } 509 | 510 | /* --------------------------------------------------------------------- 511 | Gaps 512 | ------------------------------------------------------------------------ */ 513 | 514 | .gapTop { 515 | padding-top: 20px; 516 | } 517 | 518 | .gapBottom { 519 | padding-bottom: 20px; 520 | } 521 | 522 | .gapTop-primary { 523 | padding-top: 80px; 524 | } 525 | 526 | .gapTop-secondary { 527 | padding-top: 40px; 528 | } 529 | 530 | .gutterLeft { 531 | padding-left: 40px; 532 | } 533 | 534 | /* --------------------------------------------------------------------- 535 | Window File Choices 536 | ------------------------------------------------------------------------ */ 537 | 538 | .input-filmChoices { 539 | width: 180px; 540 | } 541 | 542 | .invalid { 543 | background-color: #cc0000; 544 | color: #ee8888; 545 | } 546 | 547 | /* Styles for safarimobile-multiline-select.js jquery plugin on mobile devices */ 548 | #js-film-list_safarimobile { 549 | height: 553px; 550 | width: 176px; 551 | } 552 | 553 | #js-film-list_safarimobile .selected { 554 | background-color: #0075d4; 555 | } 556 | 557 | #js-film-list_safarimobile .invalid.selected { 558 | background-color: #ee8888; 559 | color: #cc0000; 560 | } 561 | 562 | /* --------------------------------------------------------------------- 563 | Dividers 564 | ------------------------------------------------------------------------ */ 565 | 566 | .textDivider { 567 | position: relative; 568 | } 569 | 570 | .strikethoughHeading { 571 | position: relative; 572 | z-index: 2; 573 | margin-bottom: 15px; 574 | } 575 | 576 | .strikethoughHeading:before { 577 | content: " "; 578 | position: absolute; 579 | border-bottom: 1px solid #dbdbdb; 580 | width: 100%; 581 | top: 50%; 582 | z-index: -1; 583 | } 584 | 585 | .strikethoughHeading-indent { 586 | margin-left: 15px; 587 | padding: 0 15px; 588 | background-color: #f5f5f5; 589 | } 590 | 591 | .dividerEmail { 592 | border-left: 1px solid #000000; 593 | padding-left: 30px; 594 | } 595 | 596 | .textHightlight { 597 | -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */ 598 | -moz-box-sizing: border-box; /* Firefox, other Gecko */ 599 | box-sizing: border-box; /* Opera/IE 8+ */ 600 | display: inline-block; 601 | border: 1px solid #cccccc; 602 | padding: 4px 13px; 603 | text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); 604 | background-color: #cccccc; 605 | -webkit-border-radius: 4px; 606 | -moz-border-radius: 4px; 607 | border-radius: 4px; 608 | font-weight: bold; 609 | } 610 | 611 | .textHightlight.input-mini { 612 | width: 70px; 613 | } 614 | 615 | .textHightlight.input-small { 616 | width: 100px; 617 | } 618 | 619 | .textHightlight.input-medium { 620 | width: 160px; 621 | } 622 | 623 | .textHightlight.input-large { 624 | width: 220px; 625 | } 626 | 627 | .textHightlight.input-xlarge { 628 | width: 280px; 629 | } 630 | 631 | .textHightlight.input-xxlarge { 632 | width: 540px; 633 | } 634 | 635 | .input-append .textHightlight { 636 | border-radius: 4px 0 0 4px; 637 | font-size: 14px; 638 | } 639 | 640 | .altSidebar { 641 | width: 300px; 642 | } 643 | 644 | .userFilter { 645 | width: 1024px; 646 | margin: 20px auto 0 auto; 647 | } 648 | 649 | .project-sync-button { 650 | position: absolute; 651 | top: 9px; 652 | right: 10px; 653 | } 654 | 655 | .accordion-heading { 656 | position: relative; 657 | } 658 | 659 | .accordion-heading-actions { 660 | position: absolute; 661 | top: 6px; 662 | right: 10px; 663 | } 664 | 665 | .wrapWord { 666 | width: 100px; 667 | word-wrap: break-word; 668 | } 669 | 670 | .note { 671 | font-size: 10px; 672 | color: #666666; 673 | padding-right: 10px; 674 | } 675 | 676 | .windowName { 677 | display: inline-block; 678 | *display: inline; 679 | width: 150px; 680 | } 681 | 682 | .syncing { 683 | opacity: 0.65; 684 | } 685 | 686 | @-webkit-keyframes rotate { 687 | 0% { -webkit-transform: rotate(0deg); } 688 | 100% { -webkit-transform: rotate(360deg); } 689 | } 690 | @-moz-keyframes rotate { 691 | 0% { -moz-transform: rotate(0deg); } 692 | 100% { -moz-transform: rotate(360deg); } 693 | } 694 | @-o-keyframes rotate { 695 | 0% { -o-transform: rotate(0deg); } 696 | 100% { -o-transform: rotate(360deg); } 697 | } 698 | @keyframes rotate { 699 | 0% { transform: rotate(0deg); } 700 | 100% { transform: rotate(360deg); } 701 | } 702 | 703 | .syncing .icon-refresh { 704 | -webkit-animation: rotate 1s linear infinite; /* Chrome, Safari 5+ */ 705 | -moz-animation: rotate 1s linear infinite; /* Firefox 5-15 */ 706 | -o-animation: rotate 1s linear infinite; /* Opera 12.00 */ 707 | animation: rotate 1s linear infinite; /* Chrome, Firefox 16+, IE 10+, Opera 12.10+ */ 708 | } 709 | 710 | .help-inline { 711 | font-size: 14px; 712 | } 713 | 714 | .address { 715 | display: inline-block; 716 | vertical-align: top; 717 | } 718 | 719 | .unstyled.project strong { 720 | display: inline-block; 721 | width: 120px; 722 | } 723 | 724 | .nothing-found { 725 | text-align: center; 726 | margin: 30px 0 0; 727 | } 728 | 729 | #help-section { 730 | width: 960px; 731 | padding: 0 20px; 732 | } 733 | 734 | .link-project { 735 | color: black; 736 | } 737 | 738 | .link-project:hover { 739 | color: black; 740 | text-decoration: none; 741 | } -------------------------------------------------------------------------------- /src/assets/templates/login/LoginTemplate.hbs: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 |

{{ title }}

7 |
8 | 9 |
10 |
11 | 12 |
13 |
14 | 15 |
16 |

Forgot your password?

17 |
18 |
19 | 20 |
21 | 22 |
23 | 24 |
25 | -------------------------------------------------------------------------------- /src/assets/templates/topbar/TopNavigationTemplate.hbs: -------------------------------------------------------------------------------- 1 | 44 | -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "require-handlebars-plugin", 3 | "homepage": "https://github.com/SlexAxton/require-handlebars-plugin", 4 | "version": "0.7.0", 5 | "_release": "0.7.0", 6 | "_resolution": { 7 | "type": "version", 8 | "tag": "v0.7.0", 9 | "commit": "96db4f16d3a18219823605447090c3cd68e8f1e2" 10 | }, 11 | "_source": "git://github.com/SlexAxton/require-handlebars-plugin.git", 12 | "_target": "0.7.0", 13 | "_originalSource": "require-handlebars-plugin" 14 | } -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | demo-build/* 3 | .DS_STORE 4 | -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/README.md: -------------------------------------------------------------------------------- 1 | # Require.js Handlebars Plugin 2 | 3 | ## Version 4 | 5 | Handlebars : `v1.1.2` 6 | 7 | hbs.js : `v0.7.0` 8 | 9 | ## Requirements 10 | 11 | Should work in both the java and node build environments. 12 | 13 | Require.js >= 2.1.x (The last tag to work for Require < 2.1 is the `0.3.3` tag) 14 | 15 | ## Usage 16 | 17 | Write a template ( path: `App/Template/One.hbs` ): 18 | 19 | ```html 20 |
21 | This is my {{ adjective }} template. 22 | 23 | {{! To include a partial: }} 24 | {{! just provide the path to the partial without the extension }} 25 | 26 | {{> App/Template/CoolPartial }} 27 | 28 | {{! the path can also be relative to the current template: }} 29 | {{> ./coolPartial }} 30 |
31 | ``` 32 | 33 | Here's the partial (optional) ( path : `App/Template/CoolPartial.hbs` ) 34 | 35 | ```html 36 |
37 | {{! This can obviously have it's own partials, etc, etc }} 38 | I am a partial 39 |
40 | ``` 41 | 42 | ## Installation 43 | Clone this repo or use `bower` to add `require-handlebars-plugin` to your project (typically in you `lib/` directory) and make sure you tell `requirejs` about the new `hbs` plugin by editing your `requirejs.conf.js` file (you can also pass a few options): 44 | 45 | require.config({ 46 | paths: { 47 | hbs: 'lib/require-handlebars-plugin/hbs' 48 | }, 49 | hbs: { // optional 50 | helpers: true, // default: true 51 | i18n: false, // default: false 52 | templateExtension: 'hbs', // default: 'hbs' 53 | partialsUrl: '' // default: '' 54 | } 55 | }); 56 | 57 | `partialsUrl`: base url for loading partials so that you don't have to provide the full path every time you need to load a partial within a template. 58 | 59 | 60 | Then require your templates like so: 61 | 62 | ```javascript 63 | require(['hbs!App/Template/One'], function ( tmplOne ) { 64 | // Use whatever you would to render the template function 65 | document.body.innerHTML = tmplOne({adjective: "favorite"}); 66 | }); 67 | ``` 68 | 69 | 70 | And then the output into your body would be as follows: 71 | 72 | ```html 73 |
74 | This is my favorite template. 75 | 76 |
77 | I am a partial 78 |
79 |
80 | 81 | ``` 82 | 83 | YAY! 84 | 85 | # i18n 86 | 87 | **Note for [jam](http://jamjs.org/) users**: i18n is not currently supported in `jam compile` due to configuration issues. This is being worked on. 88 | 89 | I added a build-time/run-time helper for internationalization. The best way to see how this works is the demo. 90 | 91 | Right now, the syntax for this is the same as handlebars helper syntax, with a helper named `$` (for brevity). 92 | 93 | `{{$ "i18nkey"}}` 94 | 95 | This key should map to your locale json file. 96 | 97 | ```javascript 98 | { 99 | "i18nkey" : "This is a localized string." 100 | } 101 | ``` 102 | 103 | This 'helper' works differently than actual handlebars templates. It actually modifies the AST that is generated by handlebars at build time. 104 | It takes the 'helper' node and converts it into a simple content node with the correct localized content. 105 | 106 | The benefit of this is not having to send your entire localization object to the browser in production apps. Instead the localized strings are added directly into the compiled templates. This is faster in every case. :D 107 | 108 | The locale defaults to the `en_us.json` file, but you can set the locale in your require.config (often needs to happen in both your app.build.js and your actual app code) and the locale will change along with that property. 109 | 110 | # Helpers 111 | 112 | Just put your helpers in `template/helpers/*` and they'll automagically get pulled in as long as you write them as modules. 113 | 114 | I find that many helpers are good helpers in regular code as well, so the following is a good practice: 115 | 116 | ```javascript 117 | define('template/helpers/roundNumber', ['Handlebars'], function ( Handlebars ) { 118 | function roundNumber ( context, options ) { 119 | // Simple function for example 120 | return Math.round( context ); 121 | } 122 | Handlebars.registerHelper( 'roundNumber', roundNumber ); 123 | return roundNumber; 124 | }); 125 | ``` 126 | 127 | Then in your templates, you can just do: 128 | 129 | ```mustache 130 | {{roundNumber Data.ThreeFourths}} 131 | ``` 132 | 133 | The system will make sure these modules are pulled in automatically from that directory. But if in your app, you need a rounding module (perhaps in a view/datanormalization place), you could do this: 134 | 135 | ```javascript 136 | require(['template/helpers/roundNumber'], function ( roundNumber ) { 137 | var threeFourths = (3/4); 138 | alert( roundNumber( threeFourths )); 139 | }); 140 | ``` 141 | 142 | It's just a module that happens to register itself. 143 | 144 | You can specify a helper path callback in the config. The callback should be a function that gets a name of a helper as the only argument and returns the full path to be `require()`-d, e.g., the following callback allows for automatic loading of helper modules written in CoffeeScript (via the require-cs plugin) under a non-standard location: 145 | 146 | ```javascript 147 | require({ 148 | hbs : { 149 | helperPathCallback: function(name) {return 'cs!/helpers/' + name;} 150 | } 151 | }, ['main']) 152 | ``` 153 | 154 | # Meta Data 155 | 156 | Any template that begins with a comment, with _only_ a valid json object in it will be read in as meta data for the template. 157 | 158 | I encourage you to list the name of the template and give a description, though these aren't strictly necessary. 159 | 160 | ## Styles 161 | 162 | If you want to build stylesheets that are comprised of only styles needed by the templates that your app uses, I encourage you to add a `styles` property to the meta info: 163 | 164 | ``` 165 | {{! 166 | { 167 | "name" : "template1", 168 | "description" : "A nice template.", 169 | "styles" : ["templatecss"] 170 | } 171 | }} 172 | ``` 173 | 174 | This will inject a link tag in dev mode to load in this style dynamically. At build time, a screen.build.css is created. At this time it is just a list of import statements. These can be inlined by many existing tools. Eventually I'd love it to just happen. 175 | 176 | De-duping happens automatically, so don't worry if multiple templates require the same styles. The styles are injected in the order that they are read in, so usually from least specific to most specific. This is usually what you want, but know that if you do weird things, it could break. 177 | 178 | # Introspection 179 | 180 | In dev mode a few properties are added to your function (an object in javascript) as a helper with debugging and as a testing plug-point. 181 | 182 | Those variables look like the following: 183 | 184 | ```javascript 185 | require(['hbs!template/one'], function ( tmplOne ) { 186 | console.log( 187 | 'Variables referenced in this template: ', tmplOne.vars, 188 | 'Partials/templates that this file directly depends on: ', tmplOne.deps, 189 | 'Helpers that this template directly depends on: ', tmplOne.helpers, 190 | 'The metadata object at the top of the file (if it exists): ', tmplOne.meta 191 | ); 192 | }); 193 | ``` 194 | 195 | Note: All of these go away after a build, as they just take up space with data that is known at build time, which is the ideal time to get stuff figured out (speed-wise). 196 | 197 | # Builds 198 | 199 | As long as all of your paths match up, this should precompile all of your templates and include them in the build. 200 | 201 | ## Before Build 202 | 203 | ![Before Build](http://i.imgur.com/YSTI3.jpg) 204 | 205 | ## After Build 206 | 207 | ![After Build](http://i.imgur.com/JUOlC.jpg) 208 | 209 | ## So many dependencies in the `hbs` plugin! 210 | 211 | I use them for coding happiness. It shouldn't bother you tooooo much, because it all gets built out in production. The `hbs.js` file essentially gets written to the main.js file as a noop (a few empty definitions), and none of it's dependencies are included into the build. All the dependencies are inside the `hbs` folder and this folder should be a sibling of the `hbs.js` file. 212 | 213 | # Demo 214 | 215 | To run the demo, go into the root directory of this project and run the following command. 216 | 217 | `./build.sh` 218 | 219 | This requires that node.js is installed. To see these in your browser, I'd suggest serving them quickly with the python simple server. (Linux/OSX assumed here, but there is a java implementation of the require.js build that should work just as well as the node version. I have not tried it though.) 220 | 221 | ```sh 222 | cd ~/require-handlebars-plugin 223 | python -m SimpleHTTPServer 224 | ``` 225 | 226 | You could also use the node 'serve' module. 227 | 228 | ```sh 229 | npm install serve -g 230 | serve . 231 | ``` 232 | 233 | Then visit `http://127.0.0.1:8000/demo.html` for the dev version. 234 | 235 | And visit `http://127.0.0.1:8000/demo-build.html` for the production build version. 236 | 237 | You should be able to see all of the templates and individual files in your network panel in dev mode, and just 2 minified files in build mode. 238 | 239 | # Config 240 | 241 | There are several configurable options, which you can set in your require.config: 242 | 243 | ```javascript 244 | require.config({ 245 | // ... other require config here 246 | 247 | // hbs config 248 | hbs: { 249 | disableI18n: true, // This disables the i18n helper and 250 | // doesn't require the json i18n files (e.g. en_us.json) 251 | // (false by default) 252 | 253 | disableHelpers: true, // When true, won't look for and try to automatically load 254 | // helpers (false by default) 255 | 256 | helperPathCallback: // Callback to determine the path to look for helpers 257 | function (name) { // ('/template/helpers/'+name by default) 258 | return 'cs!' + name; 259 | }, 260 | 261 | templateExtension: "html" // Set the extension automatically appended to templates 262 | // ('hbs' by default) 263 | 264 | compileOptions: {} // options object which is passed to Handlebars compiler 265 | } 266 | 267 | }) 268 | ``` 269 | 270 | # Notes/QA 271 | 272 | ## Partial Collision 273 | 274 | This plugin registers every single template as a partial with it's modified module name and no file extension. 275 | 276 | `App/Template/One.handlebars` is registered as `App_Template_One` 277 | 278 | I'd encourage you to _not_ call registerPartials in your code, and just use the automatic module registering, that way you definitely won't hit any collisions. You could also just be careful. We're all adults here. 279 | 280 | ## Templates not loading cross-domain 281 | 282 | In dev mode, loading the templates requires that you are on the same domain as your templates. This is standard same origin policy stuff. Once you build, though, it won't matter since there are no additional requests. Usually a few cleverly placed host overrides get you through the dev mode hurdles. 283 | 284 | # Other Templating Languages 285 | 286 | _Very_ little of this is specific to handlebars, but things are just a _tiny_ bit too specific about how everything works to properly generalize this. 287 | 288 | If you'd like to implement this for your templating language of choice, you'll need: 289 | 290 | * Has a pre-compile type functionality (unless you don't care about builds) 291 | * If it has some concept of partials, that you can register them externally 292 | * It eventually returns a function that takes data context and outputs something you can deal with. 293 | * For any of the meta-data, you'll need some fancy regex or an AST to walk through. 294 | 295 | I'd just turn your template language into a module first (just the old global name, or whatever), then look through the references to `Handlebars` in `hbs.js` and see if your templating language does something similar. It's not a terribly complicated process. 296 | 297 | # License 298 | 299 | Most of the code in this is from James Burke and Yehuda Katz in require.js and handlebars.js (respectively). Those projects are under their own license. Any other code added by me is released under the WTFPL license. 300 | -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/build.sh: -------------------------------------------------------------------------------- 1 | node r.js -o demo/app.build.js 2 | node r.js -o cssIn=demo-build/styles/screen.build.css out=demo-build/styles/screen.build.css 3 | -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/demo-build.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Demo App (built) for require-handlebars-plugin 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 |

40 | Note 1: if this page isn't working for you, you probably need to run the build.
41 | Make sure you have node.js installed and then run this in the base directory:

42 | node r.js -o demo/app.build.js 43 |

44 |

45 | Note 2: Generally you won't have 2 different html files for the build and dev modes. Normally you'd just serve the built directory on production where the non-build directory is on your dev server. So your template never have to change, just your static directory switched out. 46 |

47 | 48 | -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/demo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Demo App for require-handlebars-plugin 6 | 7 | 8 |
9 | 10 | 11 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/demo/app.build.js: -------------------------------------------------------------------------------- 1 | ({ 2 | appDir: "./", 3 | baseUrl: "./", 4 | dir: "../demo-build", 5 | 6 | optimizeCss: "standard", 7 | // optimize: "none", 8 | // inlining ftw 9 | inlineText: true, 10 | 11 | pragmasOnSave: { 12 | //removes Handlebars.Parser code (used to compile template strings) set 13 | //it to `false` if you need to parse template strings even after build 14 | excludeHbsParser : true, 15 | // kills the entire plugin set once it's built. 16 | excludeHbs: true, 17 | // removes i18n precompiler, handlebars and json2 18 | excludeAfterBuild: true 19 | }, 20 | 21 | paths: { 22 | "hbs": "../hbs", 23 | "Handlebars" : "../Handlebars", 24 | "underscore" : "../hbs/underscore", 25 | "i18nprecompile" : "../hbs/i18nprecompile", 26 | "json2" : "../hbs/json2" 27 | // if your project is already using underscore.js and you want to keep 28 | // the hbs plugin even after build (excludeHbs:false) you should set the 29 | // "hbs/underscore" path to point to the shared location like 30 | // "hbs/underscore" : "lib/underscore" to avoid loading it twice 31 | }, 32 | 33 | locale: "en_ca", 34 | 35 | // default plugin settings, listing here just as a reference 36 | hbs : { 37 | templateExtension : 'hbs', 38 | // if disableI18n is `true` it won't load locales and the i18n helper 39 | // won't work as well. 40 | disableI18n : false 41 | }, 42 | 43 | modules: [ 44 | { 45 | name: "main" 46 | } 47 | ] 48 | }) 49 | -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/demo/main.js: -------------------------------------------------------------------------------- 1 | // Require our template with the handlebars plugin 2 | define(['hbs!template/one'], function (tmplOne) { 3 | // Find our container 4 | var container = document.getElementById('demo-app-container'); 5 | // Run your template function, and inject it. 6 | container.innerHTML = tmplOne({ 7 | adjective : 'favorite', 8 | listofstuff : ['bananas', 'democracy', 'expired milk'] 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/demo/styles/one.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #AAAAAA; 3 | } -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/demo/styles/two.css: -------------------------------------------------------------------------------- 1 | .partial { 2 | border: 2px solid #BADA55; 3 | padding: 5px; 4 | } -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/demo/template/coolPartial.hbs: -------------------------------------------------------------------------------- 1 | {{! 2 | { 3 | "name" : "coolPartial", 4 | "decription" : "A Demo Partial", 5 | "styles" : ["two"] 6 | } 7 | }} 8 |
9 | This is a partial include. 10 |
11 | i18n1: {{$ "key1"}} 12 |
13 | -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/demo/template/helpers/all.js: -------------------------------------------------------------------------------- 1 | //>>excludeStart('excludeAfterBuild', pragmas.excludeAfterBuild) 2 | /* 3 | I have no idea why this dependency can't be met without this, but for now it works. 4 | Keep it updated with all of your helpers. 5 | It will get completely removed in the build. 6 | I think it has to do with circular dependencies, but I don't know how to fix it. 7 | 8 | Sucks. I know. 9 | */ 10 | 11 | 12 | 13 | 14 | 15 | define([ 16 | 'template/helpers/yeller', 17 | ], function(){ 18 | return {}; 19 | }); 20 | //>>excludeEnd('excludeAfterBuild') -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/demo/template/helpers/myhelper.js: -------------------------------------------------------------------------------- 1 | define(["Handlebars"], function(Handlebars) { 2 | function myhelper(options) { 3 | return options.fn(); 4 | } 5 | 6 | Handlebars.registerHelper("myhelper", myhelper); 7 | return myhelper; 8 | }); 9 | -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/demo/template/helpers/yeller.js: -------------------------------------------------------------------------------- 1 | define(['Handlebars'], function ( Handlebars ){ 2 | function yeller ( context, options ) { 3 | // Assume it's a string for simplicity. 4 | return context + "!!!!!!oneone!!one1"; 5 | } 6 | 7 | Handlebars.registerHelper( 'yeller', yeller ); 8 | return yeller; 9 | }); 10 | -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/demo/template/i18n/en_ca.json: -------------------------------------------------------------------------------- 1 | { 2 | "key1" : "This is key 1, eh?", 3 | "key2" : "This is key 2, eh?" 4 | } -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/demo/template/i18n/en_us.json: -------------------------------------------------------------------------------- 1 | { 2 | "key1" : "This is key 1.", 3 | "key2" : "This is key 2." 4 | } -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/demo/template/one.hbs: -------------------------------------------------------------------------------- 1 | {{! 2 | { 3 | "name" : "one", 4 | "decription" : "A Demo Template", 5 | "styles" : ["one"], 6 | "helpers": ["myhelper"] 7 | } 8 | }} 9 |
10 | 11 | {{#myhelper}} 12 | Wow 13 | {{else}} 14 | Nope 15 | {{/myhelper}} 16 | 17 | {{! Do a little bit of unecessary logic in here 18 | to show that it works with block helpers 19 | and iterators }} 20 | 21 | {{#if "1"}} 22 | This plugin is my {{ adjective }} plugin ever. 23 | {{/if}} 24 |
25 |
26 | 27 | {{#each listofstuff}} 28 | {{#if doesntexist}} 29 | cant get here 30 | {{else}} 31 | {{yeller .}} 32 |
33 | {{/if}} 34 | {{/each}} 35 |
36 | 37 | {{> template_coolPartial }} 38 |
39 | i18n2: {{$ "key2"}} 40 |
41 | -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/hbs.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Handlebars hbs 0.4.0 - Alex Sexton, but Handlebars has it's own licensing junk 3 | * 4 | * Available via the MIT or new BSD license. 5 | * see: http://github.com/jrburke/require-cs for details on the plugin this was based off of 6 | */ 7 | 8 | /* Yes, deliciously evil. */ 9 | /*jslint evil: true, strict: false, plusplus: false, regexp: false */ 10 | /*global require: false, XMLHttpRequest: false, ActiveXObject: false, 11 | define: false, process: false, window: false */ 12 | define([ 13 | //>>excludeStart('excludeHbs', pragmas.excludeHbs) 14 | 'hbs/handlebars', 'hbs/underscore', 'hbs/i18nprecompile', 'hbs/json2' 15 | //>>excludeEnd('excludeHbs') 16 | ], function ( 17 | //>>excludeStart('excludeHbs', pragmas.excludeHbs) 18 | Handlebars, _, precompile, JSON 19 | //>>excludeEnd('excludeHbs') 20 | ) { 21 | //>>excludeStart('excludeHbs', pragmas.excludeHbs) 22 | var fs; 23 | var getXhr; 24 | var progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0']; 25 | var fetchText = function () { 26 | throw new Error('Environment unsupported.'); 27 | }; 28 | var buildMap = []; 29 | var filecode = 'w+'; 30 | var templateExtension = 'hbs'; 31 | var customNameExtension = '@hbs'; 32 | var devStyleDirectory = '/styles/'; 33 | var buildStyleDirectory = '/demo-build/styles/'; 34 | var helperDirectory = 'templates/helpers/'; 35 | var i18nDirectory = 'templates/i18n/'; 36 | var buildCSSFileName = 'screen.build.css'; 37 | 38 | Handlebars.registerHelper('$', function() { 39 | //placeholder for translation helper 40 | }); 41 | 42 | if (typeof window !== 'undefined' && window.navigator && window.document && !window.navigator.userAgent.match(/Node.js/)) { 43 | // Browser action 44 | getXhr = function () { 45 | // Would love to dump the ActiveX crap in here. Need IE 6 to die first. 46 | var xhr; 47 | var i; 48 | var progId; 49 | if (typeof XMLHttpRequest !== 'undefined') { 50 | return ((arguments[0] === true)) ? new XDomainRequest() : new XMLHttpRequest(); 51 | } 52 | else { 53 | for (i = 0; i < 3; i++) { 54 | progId = progIds[i]; 55 | try { 56 | xhr = new ActiveXObject(progId); 57 | } 58 | catch (e) {} 59 | 60 | if (xhr) { 61 | // Faster next time 62 | progIds = [progId]; 63 | break; 64 | } 65 | } 66 | } 67 | 68 | if (!xhr) { 69 | throw new Error('getXhr(): XMLHttpRequest not available'); 70 | } 71 | 72 | return xhr; 73 | }; 74 | 75 | // Returns the version of Windows Internet Explorer or a -1 76 | // (indicating the use of another browser). 77 | // Note: this is only for development mode. Does not run in production. 78 | getIEVersion = function(){ 79 | // Return value assumes failure. 80 | var rv = -1; 81 | if (navigator.appName == 'Microsoft Internet Explorer') { 82 | var ua = navigator.userAgent; 83 | var re = new RegExp('MSIE ([0-9]{1,}[\.0-9]{0,})'); 84 | if (re.exec(ua) != null) { 85 | rv = parseFloat( RegExp.$1 ); 86 | } 87 | } 88 | return rv; 89 | }; 90 | 91 | fetchText = function (url, callback) { 92 | var xdm = false; 93 | // If url is a fully qualified URL, it might be a cross domain request. Check for that. 94 | // IF url is a relative url, it cannot be cross domain. 95 | if (url.indexOf('http') != 0 ){ 96 | xdm = false; 97 | }else{ 98 | var uidx = (url.substr(0,5) === 'https') ? 8 : 7; 99 | var hidx = (window.location.href.substr(0,5) === 'https') ? 8 : 7; 100 | var dom = url.substr(uidx).split('/').shift(); 101 | var msie = getIEVersion(); 102 | xdm = ( dom != window.location.href.substr(hidx).split('/').shift() ) && (msie >= 7); 103 | } 104 | 105 | if ( xdm ) { 106 | var xdr = getXhr(true); 107 | xdr.open('GET', url); 108 | xdr.onload = function() { 109 | callback(xdr.responseText); 110 | }; 111 | xdr.onprogress = function(){}; 112 | xdr.ontimeout = function(){}; 113 | xdr.onerror = function(){}; 114 | setTimeout(function(){ 115 | xdr.send(); 116 | }, 0); 117 | } 118 | else { 119 | var xhr = getXhr(); 120 | xhr.open('GET', url, true); 121 | xhr.onreadystatechange = function (evt) { 122 | //Do not explicitly handle errors, those should be 123 | //visible via console output in the browser. 124 | if (xhr.readyState === 4) { 125 | callback(xhr.responseText); 126 | } 127 | }; 128 | xhr.send(null); 129 | } 130 | }; 131 | 132 | } 133 | else if ( 134 | typeof process !== 'undefined' && 135 | process.versions && 136 | !!process.versions.node 137 | ) { 138 | //Using special require.nodeRequire, something added by r.js. 139 | fs = require.nodeRequire('fs'); 140 | fetchText = function ( path, callback ) { 141 | var body = fs.readFileSync(path, 'utf8') || ''; 142 | // we need to remove BOM stuff from the file content 143 | body = body.replace(/^\uFEFF/, ''); 144 | callback(body); 145 | }; 146 | } 147 | else if (typeof java !== 'undefined' && typeof java.io !== 'undefined') { 148 | fetchText = function(path, callback) { 149 | var f = new java.io.File(path); 150 | var is = new java.io.FileReader(f); 151 | var reader = new java.io.BufferedReader(is); 152 | var line; 153 | var text = ''; 154 | while ((line = reader.readLine()) !== null) { 155 | text += new String(line) + '\n'; 156 | } 157 | reader.close(); 158 | callback(text); 159 | }; 160 | } 161 | 162 | var cache = {}; 163 | var fetchOrGetCached = function ( path, callback ){ 164 | if ( cache[path] ){ 165 | callback(cache[path]); 166 | } 167 | else { 168 | fetchText(path, function(data){ 169 | cache[path] = data; 170 | callback.call(this, data); 171 | }); 172 | } 173 | }; 174 | var styleList = []; 175 | var styleMap = {}; 176 | //>>excludeEnd('excludeHbs') 177 | 178 | return { 179 | 180 | get: function () { 181 | return Handlebars; 182 | }, 183 | 184 | write: function (pluginName, name, write) { 185 | if ( (name + customNameExtension ) in buildMap) { 186 | var text = buildMap[name + customNameExtension]; 187 | write.asModule(pluginName + '!' + name, text); 188 | } 189 | }, 190 | 191 | version: '0.5.0', 192 | 193 | load: function (name, parentRequire, load, config) { 194 | //>>excludeStart('excludeHbs', pragmas.excludeHbs) 195 | 196 | var compiledName = name + customNameExtension; 197 | config.hbs = config.hbs || {}; 198 | var disableI18n = !(config.hbs.i18n == true); // by default we disable i18n unless config.hbs.i18n is true 199 | var disableHelpers = (config.hbs.helpers == false); // be default we enable helpers unless config.hbs.helpers is false 200 | var partialsUrl = ''; 201 | if(config.hbs.partialsUrl) { 202 | partialsUrl = config.hbs.partialsUrl; 203 | if(!partialsUrl.match(/\/$/)) partialsUrl += '/'; 204 | } 205 | 206 | var partialDeps = []; 207 | 208 | function recursiveNodeSearch( statements, res ) { 209 | _(statements).forEach(function ( statement ) { 210 | if ( statement && statement.type && statement.type === 'partial' ) { 211 | res.push(statement.partialName.name); 212 | } 213 | if ( statement && statement.program && statement.program.statements ) { 214 | recursiveNodeSearch( statement.program.statements, res ); 215 | } 216 | if ( statement && statement.program && statement.program.inverse && statement.program.inverse.statements ) { 217 | recursiveNodeSearch( statement.program.inverse.statements, res ); 218 | } 219 | }); 220 | return res; 221 | } 222 | 223 | // TODO :: use the parser to do this! 224 | function findPartialDeps( nodes ) { 225 | var res = []; 226 | if ( nodes && nodes.statements ) { 227 | res = recursiveNodeSearch( nodes.statements, [] ); 228 | } 229 | return _(res).unique(); 230 | } 231 | 232 | // See if the first item is a comment that's json 233 | function getMetaData( nodes ) { 234 | var statement, res, test; 235 | if ( nodes && nodes.statements ) { 236 | statement = nodes.statements[0]; 237 | if ( statement && statement.type === 'comment' ) { 238 | try { 239 | res = ( statement.comment ).replace(new RegExp('^[\\s]+|[\\s]+$', 'g'), ''); 240 | test = JSON.parse(res); 241 | return res; 242 | } 243 | catch (e) { 244 | return '{ \'description\' : \'' + statement.comment + '\' }'; 245 | } 246 | } 247 | } 248 | return '{}'; 249 | } 250 | 251 | function composeParts ( parts ) { 252 | if ( !parts ) { 253 | return []; 254 | } 255 | var res = [parts[0]]; 256 | var cur = parts[0]; 257 | var i; 258 | 259 | for (i = 1; i < parts.length; ++i) { 260 | if ( parts.hasOwnProperty(i) ) { 261 | cur += '.' + parts[i]; 262 | res.push( cur ); 263 | } 264 | } 265 | return res; 266 | } 267 | 268 | function recursiveVarSearch( statements, res, prefix, helpersres ) { 269 | prefix = prefix ? prefix + '.' : ''; 270 | 271 | var newprefix = ''; 272 | var flag = false; 273 | 274 | // loop through each statement 275 | _(statements).forEach(function(statement) { 276 | var parts; 277 | var part; 278 | var sideways; 279 | 280 | // if it's a mustache block 281 | if ( statement && statement.type && statement.type === 'mustache' ) { 282 | 283 | // If it has params, the first part is a helper or something 284 | if ( !statement.params || ! statement.params.length ) { 285 | parts = composeParts( statement.id.parts ); 286 | for( part in parts ) { 287 | if ( parts[ part ] ) { 288 | newprefix = parts[ part ] || newprefix; 289 | res.push( prefix + parts[ part ] ); 290 | } 291 | } 292 | res.push(prefix + statement.id.string); 293 | } 294 | 295 | var paramsWithoutParts = ['this', '.', '..', './..', '../..', '../../..']; 296 | 297 | // grab the params 298 | if ( statement.params && typeof Handlebars.helpers[statement.id.string] === 'undefined') { 299 | _(statement.params).forEach(function(param) { 300 | if ( _(paramsWithoutParts).contains(param.original) 301 | || param instanceof Handlebars.AST.StringNode 302 | || param instanceof Handlebars.AST.IntegerNode 303 | || param instanceof Handlebars.AST.BooleanNode 304 | ) { 305 | helpersres.push(statement.id.string); 306 | } 307 | 308 | parts = composeParts( param.parts ); 309 | 310 | for(var part in parts ) { 311 | if ( parts[ part ] ) { 312 | newprefix = parts[part] || newprefix; 313 | helpersres.push(statement.id.string); 314 | res.push( prefix + parts[ part ] ); 315 | } 316 | } 317 | }); 318 | } 319 | } 320 | 321 | // If it's a meta block 322 | if ( statement && statement.mustache ) { 323 | recursiveVarSearch( [statement.mustache], res, prefix + newprefix, helpersres ); 324 | } 325 | 326 | // if it's a whole new program 327 | if ( statement && statement.program && statement.program.statements ) { 328 | sideways = recursiveVarSearch([statement.mustache],[], '', helpersres)[0] || ''; 329 | if ( statement.program.inverse && statement.program.inverse.statements ) { 330 | recursiveVarSearch( statement.program.inverse.statements, res, prefix + newprefix + (sideways ? (prefix+newprefix) ? '.'+sideways : sideways : ''), helpersres); 331 | } 332 | recursiveVarSearch( statement.program.statements, res, prefix + newprefix + (sideways ? (prefix+newprefix) ? '.'+sideways : sideways : ''), helpersres); 333 | } 334 | }); 335 | return res; 336 | } 337 | 338 | // This finds the Helper dependencies since it's soooo similar 339 | function getExternalDeps( nodes ) { 340 | var res = []; 341 | var helpersres = []; 342 | 343 | if ( nodes && nodes.statements ) { 344 | res = recursiveVarSearch( nodes.statements, [], undefined, helpersres ); 345 | } 346 | 347 | var defaultHelpers = [ 348 | 'helperMissing', 349 | 'blockHelperMissing', 350 | 'each', 351 | 'if', 352 | 'unless', 353 | 'with' 354 | ]; 355 | 356 | return { 357 | vars: _(res).chain().unique().map(function(e) { 358 | if ( e === '' ) { 359 | return '.'; 360 | } 361 | if ( e.length && e[e.length-1] === '.' ) { 362 | return e.substr(0,e.length-1) + '[]'; 363 | } 364 | return e; 365 | }).value(), 366 | 367 | helpers: _(helpersres).chain().unique().map(function(e){ 368 | if ( _(defaultHelpers).contains(e) ) { 369 | return undefined; 370 | } 371 | return e; 372 | }).compact().value() 373 | }; 374 | } 375 | 376 | function cleanPath(path) { 377 | var tokens = path.split('/'); 378 | for(var i=0;i'; 512 | debugOutputEnd = ''; 513 | debugProperties = 't.meta = ' + meta + ';\n' + 514 | 't.helpers = ' + JSON.stringify(helps) + ';\n' + 515 | 't.deps = ' + JSON.stringify(deps) + ';\n' + 516 | 't.vars = ' + JSON.stringify(vars) + ';\n'; 517 | } 518 | 519 | var mapping = disableI18n? false : _.extend( langMap, config.localeMapping ); 520 | var configHbs = config.hbs || {}; 521 | var options = _.extend(configHbs.compileOptions || {}, { originalKeyFallback: configHbs.originalKeyFallback }); 522 | var prec = precompile( text, mapping, options); 523 | var tmplName = config.isBuild ? '' : "'" + name + "',"; 524 | 525 | if(depStr) depStr = ", '"+depStr+"'"; 526 | 527 | var partialReferences = []; 528 | if(require.config.hbs._partials[name]) 529 | partialReferences = require.config.hbs._partials[name].references; 530 | 531 | text = '/* START_TEMPLATE */\n' + 532 | 'define('+tmplName+"['hbs','hbs/handlebars'"+depStr+helpDepStr+'], function( hbs, Handlebars ){ \n' + 533 | 'var t = Handlebars.template(' + prec + ');\n'; 534 | 535 | for(var i=0; i>excludeEnd('excludeHbs') 621 | } 622 | }; 623 | }); 624 | /* END_hbs_PLUGIN */ 625 | -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/hbs/i18nprecompile.js: -------------------------------------------------------------------------------- 1 | //>>excludeStart('excludeAfterBuild', pragmas.excludeAfterBuild) 2 | define(['hbs/handlebars', "hbs/underscore"], function ( Handlebars, _ ) { 3 | 4 | function replaceLocaleStrings ( ast, mapping, options ) { 5 | options = options || {}; 6 | mapping = mapping || {}; 7 | // Base set of things 8 | if ( ast && ast.type === "program" && ast.statements ) { 9 | _(ast.statements).forEach(function(statement, i){ 10 | var newString = ""; 11 | // If it's a translation node 12 | if ( statement.type === "mustache" && statement.id && statement.id.original === "$" ) { 13 | 14 | if ( statement.params.length && statement.params[0].string ) { 15 | var key = statement.params[0].string; 16 | newString = mapping[ key ] || (options.originalKeyFallback ? key : newString); 17 | } 18 | ast.statements[i] = new Handlebars.AST.ContentNode(newString); 19 | } 20 | // If we need to recurse 21 | else if ( statement.program ) { 22 | statement.program = replaceLocaleStrings( statement.program, mapping, options ); 23 | } 24 | }); 25 | // Also cover the else blocks 26 | if (ast.inverse) { 27 | replaceLocaleStrings(ast.inverse, mapping, options); 28 | } 29 | } 30 | return ast; 31 | } 32 | 33 | return function(string, mapping, options) { 34 | options = options || {}; 35 | var ast, environment; 36 | ast = Handlebars.parse(string); 37 | // avoid replacing locale if mapping is `false` 38 | if (mapping !== false) { 39 | ast = replaceLocaleStrings(ast, mapping, options); 40 | } 41 | environment = new Handlebars.Compiler().compile(ast, options); 42 | return new Handlebars.JavaScriptCompiler().compile(environment, options); 43 | }; 44 | }); 45 | //>>excludeEnd('excludeAfterBuild') 46 | -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/hbs/json2.js: -------------------------------------------------------------------------------- 1 | //>>excludeStart('excludeAfterBuild', pragmas.excludeAfterBuild) 2 | /* 3 | http://www.JSON.org/json2.js 4 | 2011-10-19 5 | 6 | Public Domain. 7 | 8 | NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. 9 | 10 | See http://www.JSON.org/js.html 11 | 12 | 13 | This code should be minified before deployment. 14 | See http://javascript.crockford.com/jsmin.html 15 | 16 | USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO 17 | NOT CONTROL. 18 | */ 19 | 20 | /*jslint evil: true, regexp: true */ 21 | 22 | /*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply, 23 | call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours, 24 | getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join, 25 | lastIndex, length, parse, prototype, push, replace, slice, stringify, 26 | test, toJSON, toString, valueOf 27 | */ 28 | 29 | (function (window){ 30 | 31 | // Create a JSON object only if one does not already exist. We create the 32 | // methods in a closure to avoid creating global variables. 33 | 34 | // Return the window JSON element if it exists; 35 | var JSON = window.JSON || {}; 36 | 37 | (function () { 38 | 'use strict'; 39 | 40 | function f(n) { 41 | // Format integers to have at least two digits. 42 | return n < 10 ? '0' + n : n; 43 | } 44 | 45 | if (typeof Date.prototype.toJSON !== 'function') { 46 | 47 | Date.prototype.toJSON = function (key) { 48 | 49 | return isFinite(this.valueOf()) 50 | ? this.getUTCFullYear() + '-' + 51 | f(this.getUTCMonth() + 1) + '-' + 52 | f(this.getUTCDate()) + 'T' + 53 | f(this.getUTCHours()) + ':' + 54 | f(this.getUTCMinutes()) + ':' + 55 | f(this.getUTCSeconds()) + 'Z' 56 | : null; 57 | }; 58 | 59 | String.prototype.toJSON = 60 | Number.prototype.toJSON = 61 | Boolean.prototype.toJSON = function (key) { 62 | return this.valueOf(); 63 | }; 64 | } 65 | 66 | var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, 67 | escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, 68 | gap, 69 | indent, 70 | meta = { // table of character substitutions 71 | '\b': '\\b', 72 | '\t': '\\t', 73 | '\n': '\\n', 74 | '\f': '\\f', 75 | '\r': '\\r', 76 | '"' : '\\"', 77 | '\\': '\\\\' 78 | }, 79 | rep; 80 | 81 | 82 | function quote(string) { 83 | 84 | // If the string contains no control characters, no quote characters, and no 85 | // backslash characters, then we can safely slap some quotes around it. 86 | // Otherwise we must also replace the offending characters with safe escape 87 | // sequences. 88 | 89 | escapable.lastIndex = 0; 90 | return escapable.test(string) ? '"' + string.replace(escapable, function (a) { 91 | var c = meta[a]; 92 | return typeof c === 'string' 93 | ? c 94 | : '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); 95 | }) + '"' : '"' + string + '"'; 96 | } 97 | 98 | 99 | function str(key, holder) { 100 | 101 | // Produce a string from holder[key]. 102 | 103 | var i, // The loop counter. 104 | k, // The member key. 105 | v, // The member value. 106 | length, 107 | mind = gap, 108 | partial, 109 | value = holder[key]; 110 | 111 | // If the value has a toJSON method, call it to obtain a replacement value. 112 | 113 | if (value && typeof value === 'object' && 114 | typeof value.toJSON === 'function') { 115 | value = value.toJSON(key); 116 | } 117 | 118 | // If we were called with a replacer function, then call the replacer to 119 | // obtain a replacement value. 120 | 121 | if (typeof rep === 'function') { 122 | value = rep.call(holder, key, value); 123 | } 124 | 125 | // What happens next depends on the value's type. 126 | 127 | switch (typeof value) { 128 | case 'string': 129 | return quote(value); 130 | 131 | case 'number': 132 | 133 | // JSON numbers must be finite. Encode non-finite numbers as null. 134 | 135 | return isFinite(value) ? String(value) : 'null'; 136 | 137 | case 'boolean': 138 | case 'null': 139 | 140 | // If the value is a boolean or null, convert it to a string. Note: 141 | // typeof null does not produce 'null'. The case is included here in 142 | // the remote chance that this gets fixed someday. 143 | 144 | return String(value); 145 | 146 | // If the type is 'object', we might be dealing with an object or an array or 147 | // null. 148 | 149 | case 'object': 150 | 151 | // Due to a specification blunder in ECMAScript, typeof null is 'object', 152 | // so watch out for that case. 153 | 154 | if (!value) { 155 | return 'null'; 156 | } 157 | 158 | // Make an array to hold the partial results of stringifying this object value. 159 | 160 | gap += indent; 161 | partial = []; 162 | 163 | // Is the value an array? 164 | 165 | if (Object.prototype.toString.apply(value) === '[object Array]') { 166 | 167 | // The value is an array. Stringify every element. Use null as a placeholder 168 | // for non-JSON values. 169 | 170 | length = value.length; 171 | for (i = 0; i < length; i += 1) { 172 | partial[i] = str(i, value) || 'null'; 173 | } 174 | 175 | // Join all of the elements together, separated with commas, and wrap them in 176 | // brackets. 177 | 178 | v = partial.length === 0 179 | ? '[]' 180 | : gap 181 | ? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' 182 | : '[' + partial.join(',') + ']'; 183 | gap = mind; 184 | return v; 185 | } 186 | 187 | // If the replacer is an array, use it to select the members to be stringified. 188 | 189 | if (rep && typeof rep === 'object') { 190 | length = rep.length; 191 | for (i = 0; i < length; i += 1) { 192 | if (typeof rep[i] === 'string') { 193 | k = rep[i]; 194 | v = str(k, value); 195 | if (v) { 196 | partial.push(quote(k) + (gap ? ': ' : ':') + v); 197 | } 198 | } 199 | } 200 | } else { 201 | 202 | // Otherwise, iterate through all of the keys in the object. 203 | 204 | for (k in value) { 205 | if (Object.prototype.hasOwnProperty.call(value, k)) { 206 | v = str(k, value); 207 | if (v) { 208 | partial.push(quote(k) + (gap ? ': ' : ':') + v); 209 | } 210 | } 211 | } 212 | } 213 | 214 | // Join all of the member texts together, separated with commas, 215 | // and wrap them in braces. 216 | 217 | v = partial.length === 0 218 | ? '{}' 219 | : gap 220 | ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' 221 | : '{' + partial.join(',') + '}'; 222 | gap = mind; 223 | return v; 224 | } 225 | } 226 | 227 | // If the JSON object does not yet have a stringify method, give it one. 228 | 229 | if (typeof JSON.stringify !== 'function') { 230 | JSON.stringify = function (value, replacer, space) { 231 | 232 | // The stringify method takes a value and an optional replacer, and an optional 233 | // space parameter, and returns a JSON text. The replacer can be a function 234 | // that can replace values, or an array of strings that will select the keys. 235 | // A default replacer method can be provided. Use of the space parameter can 236 | // produce text that is more easily readable. 237 | 238 | var i; 239 | gap = ''; 240 | indent = ''; 241 | 242 | // If the space parameter is a number, make an indent string containing that 243 | // many spaces. 244 | 245 | if (typeof space === 'number') { 246 | for (i = 0; i < space; i += 1) { 247 | indent += ' '; 248 | } 249 | 250 | // If the space parameter is a string, it will be used as the indent string. 251 | 252 | } else if (typeof space === 'string') { 253 | indent = space; 254 | } 255 | 256 | // If there is a replacer, it must be a function or an array. 257 | // Otherwise, throw an error. 258 | 259 | rep = replacer; 260 | if (replacer && typeof replacer !== 'function' && 261 | (typeof replacer !== 'object' || 262 | typeof replacer.length !== 'number')) { 263 | throw new Error('JSON.stringify'); 264 | } 265 | 266 | // Make a fake root object containing our value under the key of ''. 267 | // Return the result of stringifying the value. 268 | 269 | return str('', {'': value}); 270 | }; 271 | } 272 | 273 | 274 | // If the JSON object does not yet have a parse method, give it one. 275 | 276 | if (typeof JSON.parse !== 'function') { 277 | JSON.parse = function (text, reviver) { 278 | 279 | // The parse method takes a text and an optional reviver function, and returns 280 | // a JavaScript value if the text is a valid JSON text. 281 | 282 | var j; 283 | 284 | function walk(holder, key) { 285 | 286 | // The walk method is used to recursively walk the resulting structure so 287 | // that modifications can be made. 288 | 289 | var k, v, value = holder[key]; 290 | if (value && typeof value === 'object') { 291 | for (k in value) { 292 | if (Object.prototype.hasOwnProperty.call(value, k)) { 293 | v = walk(value, k); 294 | if (v !== undefined) { 295 | value[k] = v; 296 | } else { 297 | delete value[k]; 298 | } 299 | } 300 | } 301 | } 302 | return reviver.call(holder, key, value); 303 | } 304 | 305 | 306 | // Parsing happens in four stages. In the first stage, we replace certain 307 | // Unicode characters with escape sequences. JavaScript handles many characters 308 | // incorrectly, either silently deleting them, or treating them as line endings. 309 | 310 | text = String(text); 311 | cx.lastIndex = 0; 312 | if (cx.test(text)) { 313 | text = text.replace(cx, function (a) { 314 | return '\\u' + 315 | ('0000' + a.charCodeAt(0).toString(16)).slice(-4); 316 | }); 317 | } 318 | 319 | // In the second stage, we run the text against regular expressions that look 320 | // for non-JSON patterns. We are especially concerned with '()' and 'new' 321 | // because they can cause invocation, and '=' because it can cause mutation. 322 | // But just to be safe, we want to reject all unexpected forms. 323 | 324 | // We split the second stage into 4 regexp operations in order to work around 325 | // crippling inefficiencies in IE's and Safari's regexp engines. First we 326 | // replace the JSON backslash pairs with '@' (a non-JSON character). Second, we 327 | // replace all simple value tokens with ']' characters. Third, we delete all 328 | // open brackets that follow a colon or comma or that begin the text. Finally, 329 | // we look to see that the remaining characters are only whitespace or ']' or 330 | // ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval. 331 | 332 | if (/^[\],:{}\s]*$/ 333 | .test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@') 334 | .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']') 335 | .replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) { 336 | 337 | // In the third stage we use the eval function to compile the text into a 338 | // JavaScript structure. The '{' operator is subject to a syntactic ambiguity 339 | // in JavaScript: it can begin a block or an object literal. We wrap the text 340 | // in parens to eliminate the ambiguity. 341 | 342 | j = eval('(' + text + ')'); 343 | 344 | // In the optional fourth stage, we recursively walk the new structure, passing 345 | // each name/value pair to a reviver function for possible transformation. 346 | 347 | return typeof reviver === 'function' 348 | ? walk({'': j}, '') 349 | : j; 350 | } 351 | 352 | // If the text is not JSON parseable, then a SyntaxError is thrown. 353 | 354 | throw new SyntaxError('JSON.parse'); 355 | }; 356 | } 357 | }()); 358 | 359 | define(function(){ 360 | return JSON; 361 | }); 362 | // otherwise just leave it alone 363 | 364 | }).call(this, this); 365 | //>>excludeEnd('excludeAfterBuild') 366 | -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration 2 | // Generated on Tue Dec 10 2013 22:17:35 GMT-0800 (PST) 3 | 4 | module.exports = function(config) { 5 | config.set({ 6 | 7 | // base path, that will be used to resolve files and exclude 8 | basePath: '', 9 | 10 | 11 | // frameworks to use 12 | frameworks: ['mocha', 'cajon', 'chai'], 13 | 14 | 15 | // list of files / patterns to load in the browser 16 | files: [ 17 | 'tests/test-main.js', 18 | 'requirejs.conf.js', 19 | {pattern: 'hbs.js', included: false}, 20 | {pattern: 'hbs/*.js', included: false}, 21 | {pattern: 'tests/*.js', included: false}, 22 | {pattern: 'tests/spec/*.js', included: false}, 23 | {pattern: 'tests/templates/**/*.hbs', included: false} 24 | ], 25 | 26 | 27 | // list of files to exclude 28 | exclude: [ 29 | ], 30 | 31 | 32 | // test results reporter to use 33 | // possible values: 'dots', 'progress', 'junit', 'growl', 'coverage' 34 | reporters: ['progress'], 35 | 36 | 37 | // web server port 38 | port: 9876, 39 | 40 | 41 | // enable / disable colors in the output (reporters and logs) 42 | colors: true, 43 | 44 | 45 | // level of logging 46 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG 47 | logLevel: config.LOG_INFO, 48 | 49 | 50 | // enable / disable watching file and executing tests whenever any file changes 51 | autoWatch: true, 52 | 53 | 54 | // Start these browsers, currently available: 55 | // - Chrome 56 | // - ChromeCanary 57 | // - Firefox 58 | // - Opera (has to be installed with `npm install karma-opera-launcher`) 59 | // - Safari (only Mac; has to be installed with `npm install karma-safari-launcher`) 60 | // - PhantomJS 61 | // - IE (only Windows; has to be installed with `npm install karma-ie-launcher`) 62 | browsers: ['Chrome'], 63 | 64 | 65 | // If browser does not capture in given timeout [ms], kill it 66 | captureTimeout: 60000, 67 | 68 | 69 | // Continuous Integration mode 70 | // if true, it capture browsers, run tests and exit 71 | singleRun: false 72 | }); 73 | }; 74 | -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "require-handlebars-plugin", 3 | "version": "0.7.0", 4 | "author": "Alex Sexton ", 5 | "description": "A plugin for handlebars in require.js", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://SlexAxton@github.com/SlexAxton/require-handlebars-plugin.git" 9 | }, 10 | "license": "To Use: WTFPL, To Contribute: Dojo CLA", 11 | "main": "hbs", 12 | "volo": { 13 | "type": "directory", 14 | "dependencies": { 15 | "Handlebars": "https://raw.github.com/SlexAxton/require-handlebars-plugin/master/Handlebars.js" 16 | } 17 | }, 18 | "jam": { 19 | "name": "hbs", 20 | "dependencies": { 21 | "Handlebars": null 22 | } 23 | }, 24 | "scripts": { 25 | "test":"node_modules/karma/bin/karma run" 26 | }, 27 | "contributors": [ 28 | "Xavier Damman " 29 | ], 30 | "devDependencies": { 31 | "karma-script-launcher": "~0.1.0", 32 | "karma-chrome-launcher": "~0.1.1", 33 | "karma-html2js-preprocessor": "~0.1.0", 34 | "karma-firefox-launcher": "~0.1.2", 35 | "karma-jasmine": "~0.1.4", 36 | "requirejs": "~2.1.9", 37 | "karma-requirejs": "~0.2.0", 38 | "karma-coffee-preprocessor": "~0.1.1", 39 | "karma-phantomjs-launcher": "~0.1.1", 40 | "karma": "~0.10.8", 41 | "mocha": "~1.15.1", 42 | "karma-mocha": "~0.1.1", 43 | "karma-chai": "0.0.2", 44 | "karma-cajon": "0.0.1" 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/tests/spec/main.js: -------------------------------------------------------------------------------- 1 | define(['hbs!'+require.toUrl('tests/templates/simple')], function(template) { 2 | 3 | describe("Simple handlebar template", function() { 4 | 5 | it("can load a simple template", function() { 6 | expect(typeof template).to.equal('function'); 7 | var html = template({hello: 'world'}); 8 | var container = document.createElement('div'); 9 | container.innerHTML=html; 10 | var text = container.innerText.trim(); 11 | expect(text).to.equal('This is a very simple template world'); 12 | }); 13 | 14 | }); 15 | 16 | }); 17 | -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/tests/spec/partial.js: -------------------------------------------------------------------------------- 1 | define(['hbs!'+require.toUrl('tests/templates/partial')], function(template) { 2 | 3 | describe("template with a partial", function() { 4 | 5 | it("loads the partials", function() { 6 | 7 | var html = template({partialValue: "ha"}); 8 | var container = document.createElement('div'); 9 | container.innerHTML = html; 10 | var bs = container.getElementsByTagName('b'); 11 | expect(bs).to.exist; 12 | expect(bs.length).to.equal(1); 13 | expect(bs[0].innerText).to.equal('Hello ha'); 14 | 15 | }); 16 | 17 | }); 18 | 19 | }); 20 | -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/tests/spec/partial_subdir.js: -------------------------------------------------------------------------------- 1 | var templates = ['partial_subdir', 'subdir/parent', 'partial_fullpath']; 2 | 3 | templates = templates.map(function(template) { 4 | return 'hbs!'+require.toUrl('tests/templates/'+template); 5 | }); 6 | 7 | define(templates, function(template, parentTemplate, fullPathTemplate) { 8 | 9 | describe("template with a partial in a subdirectory {{> partials/_simple}}", function() { 10 | 11 | it("loads the partials", function() { 12 | 13 | var html = template({partialValue: "ha"}); 14 | var container = document.createElement('div'); 15 | container.innerHTML = html; 16 | var bs = container.getElementsByTagName('b'); 17 | expect(bs).to.exist; 18 | expect(bs.length).to.equal(1); 19 | expect(bs[0].innerText).to.equal('Hello ha'); 20 | 21 | }); 22 | 23 | }); 24 | 25 | describe("template with a partial in a higher directory", function() { 26 | 27 | it("loads the partial using a relative path {{> ../partials/_simple}}", function() { 28 | 29 | var html = parentTemplate({partialValue: "ha"}); 30 | var container = document.createElement('div'); 31 | container.innerHTML = html; 32 | var bs = container.getElementsByTagName('b'); 33 | expect(bs).to.exist; 34 | expect(bs.length).to.equal(1); 35 | expect(bs[0].innerText).to.equal('Hello ha'); 36 | 37 | }); 38 | 39 | it("loads the partial using an absolute path {{> tests/templates/partials/_simple}}", function() { 40 | 41 | var html = fullPathTemplate({partialValue: "ha"}); 42 | var container = document.createElement('div'); 43 | container.innerHTML = html; 44 | var bs = container.getElementsByTagName('b'); 45 | expect(bs).to.exist; 46 | expect(bs.length).to.equal(1); 47 | expect(bs[0].innerText).to.equal('Hello ha'); 48 | 49 | }); 50 | 51 | }); 52 | 53 | }); 54 | -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/tests/spec/simple.js: -------------------------------------------------------------------------------- 1 | define(['hbs!'+require.toUrl('tests/templates/simple')], function(template) { 2 | 3 | describe("Simple handlebar template", function() { 4 | 5 | it("can load a simple template", function() { 6 | expect(typeof template).to.equal('function'); 7 | var html = template({hello: 'world'}); 8 | var container = document.createElement('div'); 9 | container.innerHTML=html; 10 | var text = container.innerText.trim(); 11 | expect(text).to.equal('This is a very simple template world'); 12 | }); 13 | 14 | }); 15 | 16 | }); 17 | -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/tests/templates/_partial.hbs: -------------------------------------------------------------------------------- 1 | Hello {{partialValue}} 2 | -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/tests/templates/partial.hbs: -------------------------------------------------------------------------------- 1 |
More complicated template with a {{>tests/templates/_partial}}
2 | -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/tests/templates/partial_fullpath.hbs: -------------------------------------------------------------------------------- 1 |
More complicated template with a full path {{> tests/templates/partials/_simple}}
2 | 3 | -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/tests/templates/partial_subdir.hbs: -------------------------------------------------------------------------------- 1 |
More complicated template with a {{>./partials/_simple}}
2 | 3 | -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/tests/templates/partials/_simple.hbs: -------------------------------------------------------------------------------- 1 |
2 | This is a partial (/tests/templates/partials/_simple.hbs) 3 |
4 | Hello {{partialValue}} 5 |
6 | -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/tests/templates/simple.hbs: -------------------------------------------------------------------------------- 1 |
This is a very simple template {{hello}}
2 | -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/tests/templates/subdir/parent.hbs: -------------------------------------------------------------------------------- 1 |
This is the main template loaded (/tests/templates/subdir/parent.hbs). We are going to load a partial in a sibling directory (../partials/_simple.hbs)
2 |
{{> ../partials/_simple}}
3 | -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/tests/test-main.js: -------------------------------------------------------------------------------- 1 | var tests = []; 2 | for (var file in window.__karma__.files) { 3 | if (window.__karma__.files.hasOwnProperty(file)) { 4 | if (/tests\/spec\/.*\.js$/.test(file)) { 5 | tests.push(file); 6 | } 7 | } 8 | }; 9 | 10 | requirejs.config({ 11 | 12 | // Karma serves files from '/base' 13 | baseUrl: '/base/', 14 | 15 | // ask Require.js to load these files (all our tests) 16 | deps: tests, 17 | 18 | // start test run, once Require.js is done 19 | callback: window.__karma__.start 20 | }); 21 | 22 | -------------------------------------------------------------------------------- /src/assets/vendor/require-handlebars-plugin/tests/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | 13 | 14 |
15 | 16 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/assets/vendor/require/json.js: -------------------------------------------------------------------------------- 1 | /** @license 2 | * RequireJS plugin for loading JSON files 3 | * - depends on Text plugin and it was HEAVILY "inspired" by it as well. 4 | * Author: Miller Medeiros 5 | * Version: 0.3.1 (2013/02/04) 6 | * Released under the MIT license 7 | */ 8 | define(['text'], function(text){ 9 | 10 | var CACHE_BUST_QUERY_PARAM = 'bust', 11 | CACHE_BUST_FLAG = '!bust', 12 | jsonParse = (typeof JSON !== 'undefined' && typeof JSON.parse === 'function')? JSON.parse : function(val){ 13 | return eval('('+ val +')'); //quick and dirty 14 | }, 15 | buildMap = {}; 16 | 17 | function cacheBust(url){ 18 | url = url.replace(CACHE_BUST_FLAG, ''); 19 | url += (url.indexOf('?') < 0)? '?' : '&'; 20 | return url + CACHE_BUST_QUERY_PARAM +'='+ Math.round(2147483647 * Math.random()); 21 | } 22 | 23 | //API 24 | return { 25 | 26 | load : function(name, req, onLoad, config) { 27 | if ( config.isBuild && (config.inlineJSON === false || name.indexOf(CACHE_BUST_QUERY_PARAM +'=') !== -1) ) { 28 | //avoid inlining cache busted JSON or if inlineJSON:false 29 | onLoad(null); 30 | } else { 31 | text.get(req.toUrl(name), function(data){ 32 | if (config.isBuild) { 33 | buildMap[name] = data; 34 | onLoad(data); 35 | } else { 36 | onLoad(jsonParse(data)); 37 | } 38 | }, 39 | onLoad.error, { 40 | accept: 'application/json' 41 | } 42 | ); 43 | } 44 | }, 45 | 46 | normalize : function (name, normalize) { 47 | //used normalize to avoid caching references to a "cache busted" request 48 | return (name.indexOf(CACHE_BUST_FLAG) === -1)? name : cacheBust(name); 49 | }, 50 | 51 | //write method based on RequireJS official text plugin by James Burke 52 | //https://github.com/jrburke/requirejs/blob/master/text.js 53 | write : function(pluginName, moduleName, write){ 54 | if(moduleName in buildMap){ 55 | var content = buildMap[moduleName]; 56 | write('define("'+ pluginName +'!'+ moduleName +'", function(){ return '+ content +';});\n'); 57 | } 58 | } 59 | 60 | }; 61 | }); -------------------------------------------------------------------------------- /src/assets/vendor/require/noext.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * RequireJS plugin for loading files without adding the JS extension, useful for 3 | * JSONP services and any other kind of resource that already contain a file 4 | * extension or that shouldn't have one (like dynamic scripts). 5 | * @author Miller Medeiros 6 | * @version 0.3.0 (2011/10/26) 7 | * Released under the WTFPL 8 | */ 9 | define(function () { 10 | 11 | var QUERY_PARAM = 'noext'; 12 | 13 | //API 14 | return { 15 | load: function (name, req, onLoad, config) { 16 | var url = req.toUrl(name).replace(/\.js$/, ''); 17 | req([url], function (mod) { 18 | onLoad(mod); 19 | }); 20 | }, 21 | normalize: function (name, norm) { 22 | //append query string to avoid adding .js extension 23 | name += (name.indexOf('?') < 0) ? '?' : '&'; 24 | return name + QUERY_PARAM + '=1'; 25 | } 26 | 27 | }; 28 | }); -------------------------------------------------------------------------------- /src/assets/vendor/require/require.js: -------------------------------------------------------------------------------- 1 | /* 2 | RequireJS 2.1.2 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. 3 | Available via the MIT or new BSD license. 4 | see: http://github.com/jrburke/requirejs for details 5 | */ 6 | var requirejs,require,define; 7 | (function(Y){function H(b){return"[object Function]"===L.call(b)}function I(b){return"[object Array]"===L.call(b)}function x(b,c){if(b){var d;for(d=0;dthis.depCount&&!this.defined){if(H(n)){if(this.events.error)try{e=j.execCb(c,n,b,e)}catch(d){a=d}else e=j.execCb(c,n,b,e);this.map.isDefine&&((b=this.module)&&void 0!==b.exports&&b.exports!==this.exports?e=b.exports:void 0===e&&this.usingExports&&(e=this.exports));if(a)return a.requireMap=this.map,a.requireModules=[this.map.id],a.requireType="define",C(this.error=a)}else e=n;this.exports=e;if(this.map.isDefine&& 19 | !this.ignore&&(p[c]=e,l.onResourceLoad))l.onResourceLoad(j,this.map,this.depMaps);delete k[c];this.defined=!0}this.defining=!1;this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else this.fetch()}},callPlugin:function(){var a=this.map,b=a.id,d=h(a.prefix);this.depMaps.push(d);s(d,"defined",t(this,function(e){var n,d;d=this.map.name;var v=this.map.parentMap?this.map.parentMap.name:null,f=j.makeRequire(a.parentMap,{enableBuildCallback:!0, 20 | skipMap:!0});if(this.map.unnormalized){if(e.normalize&&(d=e.normalize(d,function(a){return c(a,v,!0)})||""),e=h(a.prefix+"!"+d,this.map.parentMap),s(e,"defined",t(this,function(a){this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),d=i(k,e.id)){this.depMaps.push(e);if(this.events.error)d.on("error",t(this,function(a){this.emit("error",a)}));d.enable()}}else n=t(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),n.error=t(this,function(a){this.inited=!0;this.error= 21 | a;a.requireModules=[b];E(k,function(a){0===a.map.id.indexOf(b+"_unnormalized")&&delete k[a.map.id]});C(a)}),n.fromText=t(this,function(e,c){var d=a.name,u=h(d),v=O;c&&(e=c);v&&(O=!1);q(u);r(m.config,b)&&(m.config[d]=m.config[b]);try{l.exec(e)}catch(k){throw Error("fromText eval for "+d+" failed: "+k);}v&&(O=!0);this.depMaps.push(u);j.completeLoad(d);f([d],n)}),e.load(a.name,f,n,m)}));j.enable(d,this);this.pluginMaps[d.id]=d},enable:function(){this.enabling=this.enabled=!0;x(this.depMaps,t(this,function(a, 22 | b){var c,e;if("string"===typeof a){a=h(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap);this.depMaps[b]=a;if(c=i(N,a.id)){this.depExports[b]=c(this);return}this.depCount+=1;s(a,"defined",t(this,function(a){this.defineDep(b,a);this.check()}));this.errback&&s(a,"error",this.errback)}c=a.id;e=k[c];!r(N,c)&&(e&&!e.enabled)&&j.enable(a,this)}));E(this.pluginMaps,t(this,function(a){var b=i(k,a.id);b&&!b.enabled&&j.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c= 23 | this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){x(this.events[a],function(a){a(b)});"error"===a&&delete this.events[a]}};j={config:m,contextName:b,registry:k,defined:p,urlFetched:S,defQueue:F,Module:W,makeModuleMap:h,nextTick:l.nextTick,configure:function(a){a.baseUrl&&"/"!==a.baseUrl.charAt(a.baseUrl.length-1)&&(a.baseUrl+="/");var b=m.pkgs,c=m.shim,e={paths:!0,config:!0,map:!0};E(a,function(a,b){e[b]?"map"===b?Q(m[b],a,!0,!0):Q(m[b],a,!0):m[b]=a});a.shim&&(E(a.shim,function(a, 24 | b){I(a)&&(a={deps:a});if((a.exports||a.init)&&!a.exportsFn)a.exportsFn=j.makeShimExports(a);c[b]=a}),m.shim=c);a.packages&&(x(a.packages,function(a){a="string"===typeof a?{name:a}:a;b[a.name]={name:a.name,location:a.location||a.name,main:(a.main||"main").replace(ga,"").replace(aa,"")}}),m.pkgs=b);E(k,function(a,b){!a.inited&&!a.map.unnormalized&&(a.map=h(b))});if(a.deps||a.callback)j.require(a.deps||[],a.callback)},makeShimExports:function(a){return function(){var b;a.init&&(b=a.init.apply(Y,arguments)); 25 | return b||a.exports&&Z(a.exports)}},makeRequire:function(a,d){function f(e,c,u){var i,m;d.enableBuildCallback&&(c&&H(c))&&(c.__requireJsBuild=!0);if("string"===typeof e){if(H(c))return C(J("requireargs","Invalid require call"),u);if(a&&r(N,e))return N[e](k[a.id]);if(l.get)return l.get(j,e,a);i=h(e,a,!1,!0);i=i.id;return!r(p,i)?C(J("notloaded",'Module name "'+i+'" has not been loaded yet for context: '+b+(a?"":". Use require([])"))):p[i]}K();j.nextTick(function(){K();m=q(h(null,a));m.skipMap=d.skipMap; 26 | m.init(e,c,u,{enabled:!0});B()});return f}d=d||{};Q(f,{isBrowser:z,toUrl:function(b){var d=b.lastIndexOf("."),g=null;-1!==d&&(g=b.substring(d,b.length),b=b.substring(0,d));return j.nameToUrl(c(b,a&&a.id,!0),g)},defined:function(b){return r(p,h(b,a,!1,!0).id)},specified:function(b){b=h(b,a,!1,!0).id;return r(p,b)||r(k,b)}});a||(f.undef=function(b){w();var c=h(b,a,!0),d=i(k,b);delete p[b];delete S[c.url];delete X[b];d&&(d.events.defined&&(X[b]=d.events),delete k[b])});return f},enable:function(a){i(k, 27 | a.id)&&q(a).enable()},completeLoad:function(a){var b,c,d=i(m.shim,a)||{},h=d.exports;for(w();F.length;){c=F.shift();if(null===c[0]){c[0]=a;if(b)break;b=!0}else c[0]===a&&(b=!0);D(c)}c=i(k,a);if(!b&&!r(p,a)&&c&&!c.inited){if(m.enforceDefine&&(!h||!Z(h)))return y(a)?void 0:C(J("nodefine","No define call for "+a,null,[a]));D([a,d.deps||[],d.exportsFn])}B()},nameToUrl:function(a,b){var c,d,h,f,j,k;if(l.jsExtRegExp.test(a))f=a+(b||"");else{c=m.paths;d=m.pkgs;f=a.split("/");for(j=f.length;0f.attachEvent.toString().indexOf("[native code"))&&!V?(O=!0,f.attachEvent("onreadystatechange", 33 | b.onScriptLoad)):(f.addEventListener("load",b.onScriptLoad,!1),f.addEventListener("error",b.onScriptError,!1)),f.src=d,K=f,D?A.insertBefore(f,D):A.appendChild(f),K=null,f;$&&(importScripts(d),b.completeLoad(c))};z&&M(document.getElementsByTagName("script"),function(b){A||(A=b.parentNode);if(s=b.getAttribute("data-main"))return q.baseUrl||(G=s.split("/"),ba=G.pop(),ca=G.length?G.join("/")+"/":"./",q.baseUrl=ca,s=ba),s=s.replace(aa,""),q.deps=q.deps?q.deps.concat(s):[s],!0});define=function(b,c,d){var i, 34 | f;"string"!==typeof b&&(d=c,c=b,b=null);I(c)||(d=c,c=[]);!c.length&&H(d)&&d.length&&(d.toString().replace(ia,"").replace(ja,function(b,d){c.push(d)}),c=(1===d.length?["require"]:["require","exports","module"]).concat(c));if(O){if(!(i=K))P&&"interactive"===P.readyState||M(document.getElementsByTagName("script"),function(b){if("interactive"===b.readyState)return P=b}),i=P;i&&(b||(b=i.getAttribute("data-requiremodule")),f=B[i.getAttribute("data-requirecontext")])}(f?f.defQueue:R).push([b,c,d])};define.amd= 35 | {jQuery:!0};l.exec=function(b){return eval(b)};l(q)}})(this); 36 | -------------------------------------------------------------------------------- /src/assets/vendor/require/text.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license RequireJS text 2.0.3 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. 3 | * Available via the MIT or new BSD license. 4 | * see: http://github.com/requirejs/text for details 5 | */ 6 | /*jslint regexp: true */ 7 | /*global require: false, XMLHttpRequest: false, ActiveXObject: false, 8 | define: false, window: false, process: false, Packages: false, 9 | java: false, location: false */ 10 | 11 | define(['module'], function (module) { 12 | 'use strict'; 13 | 14 | var text, fs, 15 | progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'], 16 | xmlRegExp = /^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im, 17 | bodyRegExp = /]*>\s*([\s\S]+)\s*<\/body>/im, 18 | hasLocation = typeof location !== 'undefined' && location.href, 19 | defaultProtocol = hasLocation && location.protocol && location.protocol.replace(/\:/, ''), 20 | defaultHostName = hasLocation && location.hostname, 21 | defaultPort = hasLocation && (location.port || undefined), 22 | buildMap = [], 23 | masterConfig = (module.config && module.config()) || {}; 24 | 25 | text = { 26 | version: '2.0.3', 27 | 28 | strip: function (content) { 29 | //Strips declarations so that external SVG and XML 30 | //documents can be added to a document without worry. Also, if the string 31 | //is an HTML document, only the part inside the body tag is returned. 32 | if (content) { 33 | content = content.replace(xmlRegExp, ""); 34 | var matches = content.match(bodyRegExp); 35 | if (matches) { 36 | content = matches[1]; 37 | } 38 | } else { 39 | content = ""; 40 | } 41 | return content; 42 | }, 43 | 44 | jsEscape: function (content) { 45 | return content.replace(/(['\\])/g, '\\$1') 46 | .replace(/[\f]/g, "\\f") 47 | .replace(/[\b]/g, "\\b") 48 | .replace(/[\n]/g, "\\n") 49 | .replace(/[\t]/g, "\\t") 50 | .replace(/[\r]/g, "\\r") 51 | .replace(/[\u2028]/g, "\\u2028") 52 | .replace(/[\u2029]/g, "\\u2029"); 53 | }, 54 | 55 | createXhr: masterConfig.createXhr || function () { 56 | //Would love to dump the ActiveX crap in here. Need IE 6 to die first. 57 | var xhr, i, progId; 58 | if (typeof XMLHttpRequest !== "undefined") { 59 | return new XMLHttpRequest(); 60 | } else if (typeof ActiveXObject !== "undefined") { 61 | for (i = 0; i < 3; i += 1) { 62 | progId = progIds[i]; 63 | try { 64 | xhr = new ActiveXObject(progId); 65 | } catch (e) {} 66 | 67 | if (xhr) { 68 | progIds = [progId]; // so faster next time 69 | break; 70 | } 71 | } 72 | } 73 | 74 | return xhr; 75 | }, 76 | 77 | /** 78 | * Parses a resource name into its component parts. Resource names 79 | * look like: module/name.ext!strip, where the !strip part is 80 | * optional. 81 | * @param {String} name the resource name 82 | * @returns {Object} with properties "moduleName", "ext" and "strip" 83 | * where strip is a boolean. 84 | */ 85 | parseName: function (name) { 86 | var strip = false, index = name.indexOf("."), 87 | modName = name.substring(0, index), 88 | ext = name.substring(index + 1, name.length); 89 | 90 | index = ext.indexOf("!"); 91 | if (index !== -1) { 92 | //Pull off the strip arg. 93 | strip = ext.substring(index + 1, ext.length); 94 | strip = strip === "strip"; 95 | ext = ext.substring(0, index); 96 | } 97 | 98 | return { 99 | moduleName: modName, 100 | ext: ext, 101 | strip: strip 102 | }; 103 | }, 104 | 105 | xdRegExp: /^((\w+)\:)?\/\/([^\/\\]+)/, 106 | 107 | /** 108 | * Is an URL on another domain. Only works for browser use, returns 109 | * false in non-browser environments. Only used to know if an 110 | * optimized .js version of a text resource should be loaded 111 | * instead. 112 | * @param {String} url 113 | * @returns Boolean 114 | */ 115 | useXhr: function (url, protocol, hostname, port) { 116 | var uProtocol, uHostName, uPort, 117 | match = text.xdRegExp.exec(url); 118 | if (!match) { 119 | return true; 120 | } 121 | uProtocol = match[2]; 122 | uHostName = match[3]; 123 | 124 | uHostName = uHostName.split(':'); 125 | uPort = uHostName[1]; 126 | uHostName = uHostName[0]; 127 | 128 | return (!uProtocol || uProtocol === protocol) && 129 | (!uHostName || uHostName.toLowerCase() === hostname.toLowerCase()) && 130 | ((!uPort && !uHostName) || uPort === port); 131 | }, 132 | 133 | finishLoad: function (name, strip, content, onLoad) { 134 | content = strip ? text.strip(content) : content; 135 | if (masterConfig.isBuild) { 136 | buildMap[name] = content; 137 | } 138 | onLoad(content); 139 | }, 140 | 141 | load: function (name, req, onLoad, config) { 142 | //Name has format: some.module.filext!strip 143 | //The strip part is optional. 144 | //if strip is present, then that means only get the string contents 145 | //inside a body tag in an HTML string. For XML/SVG content it means 146 | //removing the declarations so the content can be inserted 147 | //into the current doc without problems. 148 | 149 | // Do not bother with the work if a build and text will 150 | // not be inlined. 151 | if (config.isBuild && !config.inlineText) { 152 | onLoad(); 153 | return; 154 | } 155 | 156 | masterConfig.isBuild = config.isBuild; 157 | 158 | var parsed = text.parseName(name), 159 | nonStripName = parsed.moduleName + '.' + parsed.ext, 160 | url = req.toUrl(nonStripName), 161 | useXhr = (masterConfig.useXhr) || 162 | text.useXhr; 163 | 164 | //Load the text. Use XHR if possible and in a browser. 165 | if (!hasLocation || useXhr(url, defaultProtocol, defaultHostName, defaultPort)) { 166 | text.get(url, function (content) { 167 | text.finishLoad(name, parsed.strip, content, onLoad); 168 | }, function (err) { 169 | if (onLoad.error) { 170 | onLoad.error(err); 171 | } 172 | }); 173 | } else { 174 | //Need to fetch the resource across domains. Assume 175 | //the resource has been optimized into a JS module. Fetch 176 | //by the module name + extension, but do not include the 177 | //!strip part to avoid file system issues. 178 | req([nonStripName], function (content) { 179 | text.finishLoad(parsed.moduleName + '.' + parsed.ext, 180 | parsed.strip, content, onLoad); 181 | }); 182 | } 183 | }, 184 | 185 | write: function (pluginName, moduleName, write, config) { 186 | if (buildMap.hasOwnProperty(moduleName)) { 187 | var content = text.jsEscape(buildMap[moduleName]); 188 | write.asModule(pluginName + "!" + moduleName, 189 | "define(function () { return '" + 190 | content + 191 | "';});\n"); 192 | } 193 | }, 194 | 195 | writeFile: function (pluginName, moduleName, req, write, config) { 196 | var parsed = text.parseName(moduleName), 197 | nonStripName = parsed.moduleName + '.' + parsed.ext, 198 | //Use a '.js' file name so that it indicates it is a 199 | //script that can be loaded across domains. 200 | fileName = req.toUrl(parsed.moduleName + '.' + 201 | parsed.ext) + '.js'; 202 | 203 | //Leverage own load() method to load plugin value, but only 204 | //write out values that do not have the strip argument, 205 | //to avoid any potential issues with ! in file names. 206 | text.load(nonStripName, req, function (value) { 207 | //Use own write() method to construct full module value. 208 | //But need to create shell that translates writeFile's 209 | //write() to the right interface. 210 | var textWrite = function (contents) { 211 | return write(fileName, contents); 212 | }; 213 | textWrite.asModule = function (moduleName, contents) { 214 | return write.asModule(moduleName, fileName, contents); 215 | }; 216 | 217 | text.write(pluginName, nonStripName, textWrite, config); 218 | }, config); 219 | } 220 | }; 221 | 222 | if (masterConfig.env === 'node' || (!masterConfig.env && 223 | typeof process !== "undefined" && 224 | process.versions && 225 | !!process.versions.node)) { 226 | //Using special require.nodeRequire, something added by r.js. 227 | fs = require.nodeRequire('fs'); 228 | 229 | text.get = function (url, callback) { 230 | var file = fs.readFileSync(url, 'utf8'); 231 | //Remove BOM (Byte Mark Order) from utf8 files if it is there. 232 | if (file.indexOf('\uFEFF') === 0) { 233 | file = file.substring(1); 234 | } 235 | callback(file); 236 | }; 237 | } else if (masterConfig.env === 'xhr' || (!masterConfig.env && 238 | text.createXhr())) { 239 | text.get = function (url, callback, errback) { 240 | var xhr = text.createXhr(); 241 | xhr.open('GET', url, true); 242 | 243 | //Allow overrides specified in config 244 | if (masterConfig.onXhr) { 245 | masterConfig.onXhr(xhr, url); 246 | } 247 | 248 | xhr.onreadystatechange = function (evt) { 249 | var status, err; 250 | //Do not explicitly handle errors, those should be 251 | //visible via console output in the browser. 252 | if (xhr.readyState === 4) { 253 | status = xhr.status; 254 | if (status > 399 && status < 600) { 255 | //An http 4xx or 5xx error. Signal an error. 256 | err = new Error(url + ' HTTP status: ' + status); 257 | err.xhr = xhr; 258 | errback(err); 259 | } else { 260 | callback(xhr.responseText); 261 | } 262 | } 263 | }; 264 | xhr.send(null); 265 | }; 266 | } else if (masterConfig.env === 'rhino' || (!masterConfig.env && 267 | typeof Packages !== 'undefined' && typeof java !== 'undefined')) { 268 | //Why Java, why is this so awkward? 269 | text.get = function (url, callback) { 270 | var stringBuffer, line, 271 | encoding = "utf-8", 272 | file = new java.io.File(url), 273 | lineSeparator = java.lang.System.getProperty("line.separator"), 274 | input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(file), encoding)), 275 | content = ''; 276 | try { 277 | stringBuffer = new java.lang.StringBuffer(); 278 | line = input.readLine(); 279 | 280 | // Byte Order Mark (BOM) - The Unicode Standard, version 3.0, page 324 281 | // http://www.unicode.org/faq/utf_bom.html 282 | 283 | // Note that when we use utf-8, the BOM should appear as "EF BB BF", but it doesn't due to this bug in the JDK: 284 | // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4508058 285 | if (line && line.length() && line.charAt(0) === 0xfeff) { 286 | // Eat the BOM, since we've already found the encoding on this file, 287 | // and we plan to concatenating this buffer with others; the BOM should 288 | // only appear at the top of a file. 289 | line = line.substring(1); 290 | } 291 | 292 | stringBuffer.append(line); 293 | 294 | while ((line = input.readLine()) !== null) { 295 | stringBuffer.append(lineSeparator); 296 | stringBuffer.append(line); 297 | } 298 | //Make sure we return a JavaScript string and not a Java string. 299 | content = String(stringBuffer.toString()); //String 300 | } finally { 301 | input.close(); 302 | } 303 | callback(content); 304 | }; 305 | } 306 | 307 | return text; 308 | }); -------------------------------------------------------------------------------- /src/assets/vendor/require/tpl.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Adapted from the official plugin text.js 3 | * 4 | * Uses UnderscoreJS micro-templates : http://documentcloud.github.com/underscore/#template 5 | * @author Julien Cabanès 6 | * @version 0.2 7 | * 8 | * @license RequireJS text 0.24.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. 9 | * Available via the MIT or new BSD license. 10 | * see: http://github.com/jrburke/requirejs for details 11 | */ 12 | /*jslint regexp: false, nomen: false, plusplus: false, strict: false */ 13 | /*global require: false, XMLHttpRequest: false, ActiveXObject: false, 14 | define: false, window: false, process: false, Packages: false, 15 | java: false */ 16 | 17 | (function () { 18 | //>>excludeStart('excludeTpl', pragmas.excludeTpl) 19 | var progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'], 20 | 21 | xmlRegExp = /^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im, 22 | 23 | bodyRegExp = /]*>\s*([\s\S]+)\s*<\/body>/im, 24 | 25 | buildMap = [], 26 | 27 | templateSettings = { 28 | evaluate : /<%([\s\S]+?)%>/g, 29 | interpolate : /<%=([\s\S]+?)%>/g, 30 | comment : //g, 31 | comment2 : /{\*[\s\S]*?\*}/g 32 | }, 33 | 34 | /** 35 | * JavaScript micro-templating, similar to John Resig's implementation. 36 | * Underscore templating handles arbitrary delimiters, preserves whitespace, 37 | * and correctly escapes quotes within interpolated code. 38 | */ 39 | template = function(str, data) { 40 | var c = templateSettings; 41 | var tmpl = 'var __p=[],print=function(){__p.push.apply(__p,arguments);};' + 42 | 'with(obj||{}){__p.push(\'' + 43 | str.replace(/\\/g, '\\\\') 44 | .replace(/'/g, "\\'") 45 | .replace(c.comment, '') 46 | .replace(c.comment2, '') 47 | .replace(c.interpolate, function(match, code) { 48 | return "'," + code.replace(/\\'/g, "'") + ",'"; 49 | }) 50 | .replace(c.evaluate || null, function(match, code) { 51 | return "');" + code.replace(/\\'/g, "'") 52 | .replace(/[\r\n\t]/g, ' ') + "; __p.push('"; 53 | }) 54 | .replace(/\r/g, '') 55 | .replace(/\n/g, '') 56 | .replace(/\t/g, '') 57 | + "');}return __p.join('');"; 58 | return tmpl; 59 | 60 | /** / 61 | var func = new Function('obj', tmpl); 62 | return data ? func(data) : func; 63 | /**/ 64 | }; 65 | //>>excludeEnd('excludeTpl') 66 | 67 | define(function () { 68 | //>>excludeStart('excludeTpl', pragmas.excludeTpl) 69 | var tpl; 70 | 71 | var get, fs; 72 | if (typeof window !== "undefined" && window.navigator && window.document) { 73 | get = function (url, callback) { 74 | 75 | var xhr = tpl.createXhr(); 76 | xhr.open('GET', url, true); 77 | xhr.onreadystatechange = function (evt) { 78 | //Do not explicitly handle errors, those should be 79 | //visible via console output in the browser. 80 | if (xhr.readyState === 4) { 81 | callback(xhr.responseText); 82 | } 83 | }; 84 | xhr.send(null); 85 | }; 86 | } else if (typeof process !== "undefined" && 87 | process.versions && 88 | !!process.versions.node) { 89 | //Using special require.nodeRequire, something added by r.js. 90 | fs = require.nodeRequire('fs'); 91 | 92 | get = function (url, callback) { 93 | 94 | callback(fs.readFileSync(url, 'utf8')); 95 | }; 96 | } 97 | return tpl = { 98 | version: '0.24.0', 99 | strip: function (content) { 100 | //Strips declarations so that external SVG and XML 101 | //documents can be added to a document without worry. Also, if the string 102 | //is an HTML document, only the part inside the body tag is returned. 103 | if (content) { 104 | content = content.replace(xmlRegExp, ""); 105 | var matches = content.match(bodyRegExp); 106 | if (matches) { 107 | content = matches[1]; 108 | } 109 | } else { 110 | content = ""; 111 | } 112 | 113 | return content; 114 | }, 115 | 116 | jsEscape: function (content) { 117 | return content.replace(/(['\\])/g, '\\$1') 118 | .replace(/[\f]/g, "\\f") 119 | .replace(/[\b]/g, "\\b") 120 | .replace(/[\n]/g, "") 121 | .replace(/[\t]/g, "") 122 | .replace(/[\r]/g, ""); 123 | }, 124 | 125 | createXhr: function () { 126 | //Would love to dump the ActiveX crap in here. Need IE 6 to die first. 127 | var xhr, i, progId; 128 | if (typeof XMLHttpRequest !== "undefined") { 129 | return new XMLHttpRequest(); 130 | } else { 131 | for (i = 0; i < 3; i++) { 132 | progId = progIds[i]; 133 | try { 134 | xhr = new ActiveXObject(progId); 135 | } catch (e) {} 136 | 137 | if (xhr) { 138 | progIds = [progId]; // so faster next time 139 | break; 140 | } 141 | } 142 | } 143 | 144 | if (!xhr) { 145 | throw new Error("require.getXhr(): XMLHttpRequest not available"); 146 | } 147 | 148 | return xhr; 149 | }, 150 | 151 | get: get, 152 | 153 | load: function (name, req, onLoad, config) { 154 | 155 | //Name has format: some.module.filext!strip 156 | //The strip part is optional. 157 | //if strip is present, then that means only get the string contents 158 | //inside a body tag in an HTML string. For XML/SVG content it means 159 | //removing the declarations so the content can be inserted 160 | //into the current doc without problems. 161 | 162 | var strip = false, url, index = name.indexOf("."), 163 | modName = name.substring(0, index), 164 | ext = name.substring(index + 1, name.length); 165 | 166 | index = ext.indexOf("!"); 167 | 168 | if (index !== -1) { 169 | //Pull off the strip arg. 170 | strip = ext.substring(index + 1, ext.length); 171 | strip = strip === "strip"; 172 | ext = ext.substring(0, index); 173 | } 174 | 175 | //Load the tpl. 176 | url = 'nameToUrl' in req ? req.nameToUrl(modName, "." + ext) : req.toUrl(modName + "." + ext); 177 | 178 | tpl.get(url, function (content) { 179 | content = template(content); 180 | 181 | if(!config.isBuild) { 182 | //if(typeof window !== "undefined" && window.navigator && window.document) { 183 | content = new Function('obj', content); 184 | } 185 | content = strip ? tpl.strip(content) : content; 186 | 187 | if (config.isBuild && config.inlineText) { 188 | buildMap[name] = content; 189 | } 190 | onLoad(content); 191 | }); 192 | 193 | }, 194 | 195 | write: function (pluginName, moduleName, write) { 196 | if (moduleName in buildMap) { 197 | var content = tpl.jsEscape(buildMap[moduleName]); 198 | write("define('" + pluginName + "!" + moduleName + 199 | "', function() {return function(obj) { " + 200 | content.replace(/(\\')/g, "'").replace(/(\\\\)/g, "\\")+ 201 | "}});\n"); 202 | } 203 | } 204 | }; 205 | //>>excludeEnd('excludeTpl') 206 | return function() {}; 207 | }); 208 | //>>excludeEnd('excludeTpl') 209 | }()); 210 | -------------------------------------------------------------------------------- /src/config.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeBelt/TypeScript-AMD-Boilerplate/5d3f3d67795717c720cd29aa7c4a33f04ad9384e/src/favicon.ico --------------------------------------------------------------------------------