Skip to content

Commit

Permalink
initial status setup for wearscript#4
Browse files Browse the repository at this point in the history
  • Loading branch information
lrvick committed Mar 18, 2014
1 parent ecebbfc commit 43718e9
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 13 deletions.
25 changes: 13 additions & 12 deletions app/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!doctype html>
<html>
<head>
<html data-ng-app="wearscriptPlaygroundApp">
<head >
<meta charset="utf-8">
<title>Wearscript Playground</title>
<meta name="description" content="">
Expand Down Expand Up @@ -34,19 +34,19 @@
<!(endif)-->
</head>
<body
data-ng-app="wearscriptPlaygroundApp"
data-ng-class="{'menu-open': menu }"
data-ng-class="{'menu-open': profile.menu }"
data-ng-cloak >
<header>
<a
data-ng-click="menu=!menu"
data-ng-init="menu=true"><i class="fa fa-bars"></i></a>
<header data-ng-controller="HeaderCtrl">
<a data-ng-click="profile.toggle('menu')">
<i class="fa fa-bars"></i>
</a>
<div class="status">{{status}}</div>
<div ng-controller="ModalCtrl">
<a ng-click="open()"><i class="fa fa-ellipsis-v"></i></a>
</div>
<h1>Wearscript Playground</h1>
</header>
<aside ng-show="menu" data-ng-controller="MenuCtrl">
<aside ng-show="profile.menu" data-ng-controller="MenuCtrl">
<nav>
<ul>
<li>
Expand Down Expand Up @@ -79,7 +79,7 @@ <h1>Wearscript Playground</h1>
data-ng-class="{'active': active==logging}"
href="#/logging">Logging</a>
</li>
<li data-ng-show="debugMode">
<li data-ng-show="profile.debug_mode">
<a data-ng-click='active=channels'
data-ng-class="{'active': active==debug}"
href="#/debug">Debug</a>
Expand Down Expand Up @@ -148,14 +148,15 @@ <h1>Wearscript Playground</h1>
<script src="scripts/controllers/help.js"></script>
<script src="scripts/controllers/modal.js"></script>
<script src="scripts/controllers/logging.js"></script>
<script src="scripts/controllers/header.js"></script>
<script src="scripts/controllers/debug.js"></script>
<script src="scripts/controllers/menu.js"></script>
<script src="scripts/services/storage.js"></script>
<script src="scripts/services/socket.js"></script>
<script src="scripts/services/editor.js"></script>
<script src="scripts/services/storage.js"></script>
<script src="scripts/services/profile.js"></script>
<script src="scripts/services/playground.js"></script>
<script src="scripts/controllers/debug.js"></script>
<script src="scripts/controllers/menu.js"></script>
<!-- endbuild -->
</body>
</html>
7 changes: 7 additions & 0 deletions app/scripts/controllers/header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use strict';

angular.module('wearscriptPlaygroundApp')
.controller('HeaderCtrl', function ($scope,Editor) {
$scope.status = Editor.status || "Loaded"
$scope.editorActive = Editor.active;
});
4 changes: 3 additions & 1 deletion app/scripts/services/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ angular.module('wearscriptPlaygroundApp')
gistid: undefined,
file: undefined,
forkonsave: false,
session: false
session: false,
menu: true,
status: "Loaded"
}

service.init = function(editor){
Expand Down
13 changes: 13 additions & 0 deletions app/styles/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@ body {
left:0px;
height:@nav_height;
background:#333;
div.status {
font-size:12px;
position:absolute;
color:#888;
right:50px;
top:6px;
border:1px #111 solid;
background:#222;
opacity:0.6;
padding:2px 8px;
text-align:center;
border-radius:10px;
}
> a, div > a {
display:block;
height:@nav_height;
Expand Down
22 changes: 22 additions & 0 deletions test/spec/controllers/header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
'use strict';

describe('Controller: HeaderCtrl', function () {

// load the controller's module
beforeEach(module('wearscriptPlaygroundApp'));

var HeaderCtrl,
scope;

// Initialize the controller and a mock scope
beforeEach(inject(function ($controller, $rootScope) {
scope = $rootScope.$new();
HeaderCtrl = $controller('HeaderCtrl', {
$scope: scope
});
}));

it('should attach a list of awesomeThings to the scope', function () {
expect(scope.awesomeThings.length).toBe(3);
});
});

0 comments on commit 43718e9

Please sign in to comment.