Skip to content

Commit

Permalink
Add ui test page/controller as a sandbox for ui stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
gashcrumb committed May 1, 2013
1 parent 5b78e89 commit c6fde0e
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 42 deletions.
31 changes: 0 additions & 31 deletions hawtio-web/src/main/webapp/app/forms/html/test.html
Expand Up @@ -23,37 +23,6 @@ <h3>Form Testing</h3>

<hr>

<div>
Confirmation Dialog
<div class="row-fluid">
<button class="btn" ng-click="showDeleteOne = true">Delete Stuff</button>
<button class="btn" ng-click="showDeleteTwo = true">Delete Other Stuff</button>

<div hawtio-confirm-dialog="showDeleteOne"
title="Delete Stuff?"
ok-button-text="Yes, Delete the Stuff"
cancel-button-text="No, Keep the Stuff"
on-cancel="onCancelled('One')"
on-ok="onOk('One')">
<div class="dialog-body">
Are you sure you want to delete all the stuff?
</div>
</div>
<!-- Use more defaults -->
<div hawtio-confirm-dialog="showDeleteTwo"
on-cancel="onCancelled('Two')"
on-ok="onOk('Two')">
<div class="dialog-body">
Are you sure you want to delete all the other stuff?
</div>
</div>

</div>


</div>


<!--
<div>
Form with config object
Expand Down
11 changes: 0 additions & 11 deletions hawtio-web/src/main/webapp/app/forms/js/test.ts
Expand Up @@ -4,17 +4,6 @@ module Forms {

$scope.editing = false;

$scope.showDeleteOne = false;
$scope.showDeleteTwo = false;

$scope.onCancelled = (number) => {
notification('info', 'cancelled ' + number);
}

$scope.onOk = (number) => {
notification('info', number + ' ok!');
}

$scope.toggleEdit = function() {
$scope.editing = !$scope.editing;
};
Expand Down
40 changes: 40 additions & 0 deletions hawtio-web/src/main/webapp/app/ui/html/test.html
@@ -0,0 +1,40 @@
<div ng-controller="UI.UITestController">

<div>
Confirmation Dialog
<div class="row-fluid">
<button class="btn" ng-click="showDeleteOne = true">Delete Stuff</button>
<button class="btn" ng-click="showDeleteTwo = true">Delete Other Stuff</button>

<div hawtio-confirm-dialog="showDeleteOne"
title="Delete Stuff?"
ok-button-text="Yes, Delete the Stuff"
cancel-button-text="No, Keep the Stuff"
on-cancel="onCancelled('One')"
on-ok="onOk('One')">
<div class="dialog-body">
<p>
Are you sure you want to delete all the stuff?
</p>
</div>
</div>
<!-- Use more defaults -->
<div hawtio-confirm-dialog="showDeleteTwo"
on-cancel="onCancelled('Two')"
on-ok="onOk('Two')">
<div class="dialog-body">
<p>
Are you sure you want to delete all the other stuff?
</p>
</div>
</div>

</div>


</div>




</div>
19 changes: 19 additions & 0 deletions hawtio-web/src/main/webapp/app/ui/js/testController.ts
@@ -0,0 +1,19 @@
module UI {

export function UITestController($scope, workspace) {

$scope.showDeleteOne = false;
$scope.showDeleteTwo = false;

$scope.onCancelled = (number) => {
notification('info', 'cancelled ' + number);
}

$scope.onOk = (number) => {
notification('info', number + ' ok!');
}


}

}
4 changes: 4 additions & 0 deletions hawtio-web/src/main/webapp/app/ui/js/uiPlugin.ts
Expand Up @@ -5,6 +5,10 @@ module UI {
export var templatePath = 'app/ui/html/';

angular.module(UI.pluginName, ['bootstrap', 'ngResource', 'hawtioCore', 'ui', 'ui.bootstrap']).
config(function($routeProvider) => {
$routeProvider.
when('/ui/test', {templateUrl: templatePath + 'test.html'})
}).
directive('hawtioConfirmDialog', function() {
return new UI.ConfirmDialog();
});
Expand Down

0 comments on commit c6fde0e

Please sign in to comment.