Skip to content
Browse files

massive overhaul of structure

Signed-off-by: Jonathan Fielding <j.fielding@me.com>
  • Loading branch information...
1 parent 0f80bf7 commit 0d8ad51e2805be887d614a3ce08e7a4d774a5c87 @jonathan-fielding committed Apr 23, 2012
View
13 plugins/add_plugins.js → app/extensions/add_ext.js
@@ -1,16 +1,23 @@
-var add_plugins = function(){
+app.ext = function(){
+ var extensions = ['sample_plugin/sample_plugin.js','theme_switcher/theme_switcher.js'];
+
return {
init: function(){
//add all plugins to the app
- app.require([app.url_path + 'plugins/sample_plugin/sample_plugin.js',app.url_path + 'plugins/theme_switcher/theme_switcher.js',app.url_path + 'plugins/notify/notify.js'],function(){
+ var noExtensions = extensions.length;
+
+ for (var i = 0; i < noExtensions; i++) {
+ extensions[i] = app.url_path + 'app/extensions/' + extensions[i];
+ }
+
+ app.require(extensions,function(){
app.sample_plugin.init();
app.theme_switcher.default_theme = 'AppBoilerplate';
app.theme_switcher.android_theme = 'Android';
app.theme_switcher.iOS_theme = 'iOS';
app.theme_switcher.winmob_theme = 'WindowsMob';
app.theme_switcher.init();
- app.notify.init();
});
}
};
View
0 plugins/notify/notify.js → app/extensions/notify/notify.js
File renamed without changes.
View
0 plugins/sample_plugin/sample_plugin.js → ...extensions/sample_plugin/sample_plugin.js
File renamed without changes.
View
0 plugins/theme_switcher/theme_switcher.js → ...tensions/theme_switcher/theme_switcher.js
File renamed without changes.
View
0 modules/sample/index.html → app/views/sample/index.html
File renamed without changes.
View
0 modules/sample/sample.js → app/views/sample/sample.js
File renamed without changes.
View
0 modules/modules go here → app/views/views go here
File renamed without changes.
View
21 assets/js/AppBoilerplate.js
@@ -93,16 +93,19 @@ var app = function(){
getDevice();
//Load the plugins into the app
- app.require([app.url_path + 'plugins/add_plugins.js'],function(){
- add_plugins.init();
- });
-
- //Styling
- app.updateTheme();
+ app.require([app.url_path + 'app/extensions/add_ext.js'],function(){
+
+ //Execute extentions
+ app.ext.init();
+
+ //Styling
+ app.updateTheme();
+
+ //Each module should have a javascript file, we pull this in here
+ app.require([javascript_required],function(){
+ window[module_name].init(eventData);
+ });
- //Each module should have a javascript file, we pull this in here
- app.require([javascript_required],function(){
- window[module_name].init(eventData);
});
},
View
2 bootstrap.js
@@ -6,7 +6,7 @@ var bootstrap = function(){
return {
init: function(app){
//The bootstrap is what runs if the user goes to the root of your web application, you can use the bootstrap to send them to whichever module you want.
- $.mobile.changePage("modules/sample/index.html", {
+ $.mobile.changePage("app/views/sample/index.html", {
data: 'Send message to bootstrap from the sample page'
});
View
1 index.html
@@ -12,7 +12,6 @@
<div data-role="header" data-position="fixed">
<h1>AppBoilerplate</h1>
- <h2>Sample Page</h2>
</div>
<div data-role="content">

0 comments on commit 0d8ad51

Please sign in to comment.
Something went wrong with that request. Please try again.