Skip to content

Commit

Permalink
Added basic Flight module
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed May 11, 2013
1 parent 439d4ee commit b82dd01
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Gruntfile.js
Expand Up @@ -37,6 +37,10 @@ module.exports = function(grunt) {
name: 'view/mariaView/spec',
include: ['view/mariaView/main'],
exclude: ['maria']
}, {
name: 'view/flightView/spec',
include: ['view/flightView/main'],
exclude: ['core/composer', 'jquery']
}]
}
}
Expand Down
3 changes: 2 additions & 1 deletion bower.json
Expand Up @@ -9,6 +9,7 @@
"when": "~2",
"wire": "~0.9",
"meld": "~1.2",
"phonegap": "2.5.0"
"phonegap": "2.5.0",
"flight": "~1.0.8"
}
}
7 changes: 7 additions & 0 deletions src/index.html
Expand Up @@ -82,6 +82,13 @@ <h2>Default</h2>
</div>
</div>

<div class="box">
<h2>Flight</h2>
<p class="info">This module is built with Flight.</p>
<div data-module="view/flightView">
<p>Fallback content (no module was loaded).</p>
</div>
</div>
</div>

<!--
Expand Down
5 changes: 5 additions & 0 deletions src/main.dev.js
Expand Up @@ -16,4 +16,9 @@ require(['main'], function() {
]
});

require(['flight/tools/debug/debug'], function(debug) {
debug.enable(true);
debug.events.logAll();
})

});
6 changes: 5 additions & 1 deletion src/main.js
Expand Up @@ -7,14 +7,18 @@ require.config({
'backbone': {
'deps': ['lodash', 'jquery'],
'exports': 'Backbone'
},
'flight/lib/component': {
'deps': ['jquery']
}
},
paths: {
'jquery': '../lib/jquery/jquery.min',
'lodash': '../lib/lodash/dist/lodash.min',
'backbone': '../lib/backbone/backbone-min',
'maria.orig': 'lib/maria-amd',
'maria': 'lib/maria.extensions'
'maria': 'lib/maria.extensions',
'flight': '../lib/flight'
},
map: {
'*': {
Expand Down
18 changes: 18 additions & 0 deletions src/view/flightView/main.js
@@ -0,0 +1,18 @@
define(['flight/lib/component'], function(defineComponent) {

var template = '<p class="module">Rendered the default Flight view (<code>view/flightView</code>).</p>';

function flightView() {

this.render = function() {
this.$node.html(template);
};

this.after('initialize', function() {
this.render();
})
}

return defineComponent(flightView);

});
14 changes: 14 additions & 0 deletions src/view/flightView/spec.js
@@ -0,0 +1,14 @@
define({

flightView: {
create: {
module: 'view/flightView/main',
args: { $ref: 'viewNode' }
}
},

plugins: [
{ module: 'wire/debug', trace: true }
]

});

0 comments on commit b82dd01

Please sign in to comment.