2
Fork 0

Fixed example offline use, and prepare for 0.3.0

This commit is contained in:
Willem 2016-11-17 19:47:02 +01:00
parent 7b94313f90
commit 78d1baa89a
9 changed files with 40 additions and 49 deletions

View file

@ -1,7 +1,14 @@
pageRouteInit.push(function ($routeProvider, $locationProvider) {
var tpl = '<div><h2>Bar</h2><p>Welcome to the bar.</p><div class="table-responsive">';
tpl += '<table class="table table-bordered table-hover table-striped"><tbody>';
tpl += '<tr><th>Chair</th><th>Person</th><th>Drinking</th></tr></tbody><tbody>';
tpl += '<tr><td>seat 1</td><td>empty</td><td>none</td></tr>';
tpl += '<tr><td>seat 2</td><td>you</td><td>coffee</td></tr>';
tpl += '<tr><td>seat 3</td><td>cat</td><td>water</td></tr>';
tpl += '</tbody></table></div></div>';
$routeProvider.when('/example-ui/bar', {
templateUrl: window.serverUrl+'/example-ui/thtml/bar',
template: tpl,
controller: PageFoo
});
});

View file

@ -1,11 +1,10 @@
var tpl = '<div><h2>Foo</h2><p>Welcome to the foo.</p></div>';
tpl += '<input type=\"button\" class=\"btn btn-default\" ng-click=\"doReload()\" value=\"Reload\"></input>';
tpl += '<input type=\"button\" class=\"btn btn-default\" ng-click=\"doClearServerUrl()\" value=\"Clear Server Url\"></input>';
tpl += '<input type=\"button\" class=\"btn btn-default\" ng-click=\"doClearCache()\" value=\"Clear Cache\"></input>';
tpl += '<p>{{message}}</p>';
pageRouteInit.push(function ($routeProvider, $locationProvider) {
var tpl = '<div><h2>Foo</h2><p>Welcome to the foo.</p></div>';
tpl += '<input type=\"button\" class=\"btn btn-default\" ng-click=\"doReload()\" value=\"Reload\"></input>';
tpl += '<input type=\"button\" class=\"btn btn-default\" ng-click=\"doClearServerUrl()\" value=\"Clear Server Url\"></input>';
tpl += '<input type=\"button\" class=\"btn btn-default\" ng-click=\"doClearCache()\" value=\"Clear Cache\"></input>';
tpl += '<p>{{message}}</p>';
$routeProvider.when('/example-ui/foo', {
template: tpl,
controller: PageFoo

View file

@ -12,14 +12,35 @@ console.log('FFExample provided serverUrl \"'+serverUrl+'\"');
// });
//});
var moduleTpl = angular.module('app-tpl', []);
moduleTpl.run(["$templateCache", function($templateCache) {
var tpl = '';
tpl += '<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">\n';
tpl += ' <div class="navbar-header">\n';
tpl += ' <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">\n';
tpl += ' <span class="sr-only">Toggle navigation</span>\n';
tpl += ' <span class="icon-bar"></span>\n';
tpl += ' <span class="icon-bar"></span>\n';
tpl += ' <span class="icon-bar"></span>\n';
tpl += ' </button>\n';
tpl += ' <a class="navbar-brand" ng-click="goLink(\'/example-ui/\')">Home</a>\n';
tpl += ' <a class="navbar-brand" ng-click="goLink(\'/example-ui/foo\')">Foo</a>\n';
tpl += ' <a class="navbar-brand" ng-click="goLink(\'/example-ui/bar\')">Bar</a>\n';
tpl += ' </div>\n';
tpl += '</nav>\n';
$templateCache.put('/example-ui/thtml/header', tpl);
$templateCache.put('/example-ui/thtml/footer', '<nav class="navbar">\n<div class="navbar-footer">\nExample footer\n</div>\n</nav>\n');
}]);
$(document.createElement('div')).attr('id', 'wrapper').appendTo($('body'));
$(document.createElement('div')).attr('ng-controller', 'ApplicationController').attr('ng-include', '\''+serverUrl+'/example-ui/thtml/header\'').appendTo($('#wrapper'));
$(document.createElement('div')).attr('ng-controller', 'ApplicationController').attr('ng-include', '\'/example-ui/thtml/header\'').appendTo($('#wrapper'));
$(document.createElement('div')).attr('id', 'page-wrapper').appendTo($('#wrapper'));
$(document.createElement('div')).attr('id', 'container-fluid').attr('ng-view', '').appendTo($('#page-wrapper'));
$(document.createElement('div')).attr('ng-include', '\''+serverUrl+'/example-ui/thtml/footer\'').appendTo($('body'));
$(document.createElement('div')).attr('ng-include', '\'/example-ui/thtml/footer\'').appendTo($('body'));
var pageRouteInit = [];
var exampleUI = angular.module('exampleUI', ['ngRoute']).config(
var exampleUI = angular.module('exampleUI', ['app-tpl','ngRoute']).config(
['$routeProvider','$locationProvider','$sceDelegateProvider', function
($routeProvider , $locationProvider , $sceDelegateProvider) {
pageRouteInit.forEach(function(init) { init($routeProvider, $locationProvider); });