Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[ui] code cleanup

  • Loading branch information...
commit 547f0936da3385d5469755712319a7bd5dcdd456 1 parent abdcba2
hij1nx authored
Showing with 45 additions and 38 deletions.
  1. +45 −38 client/js/app.js
View
83 client/js/app.js
@@ -14,7 +14,6 @@ $(function() {
function uniqueID() {
return ++counter;
}
-
// custom .trigger logger
var _trigger = $.fn.trigger;
@@ -34,16 +33,17 @@ $(function() {
Main: function() {
- APP.exec.call(this, {
-
- ns: "NJ.nup", /* namespace */
+ APP.exec.call(this, {
- plan: [ /* execution plan */
+ ns: "NJ.nup", /* namespace */
- "pageLoad"
- ,"determineContext"
- ]
- });
+ plan: [ /* execution plan */
+
+ "splash"
+ ,"pageLoad"
+ ,"determineContext"
+ ]
+ });
},
keyBindings: {
@@ -189,6 +189,39 @@ $(function() {
return html;
},
+ splash: function() {
+
+ $("#splash").dialog({
+ resizable: false,
+ width: 655,
+ height: 400,
+ modal: true,
+ speed: 1500,
+ dialogClass: "shadow splash",
+ open: function() {
+
+ setTimeout(function progress() {
+ if($('#progressBar').slider('value') < 100){
+ $('#progressBar').slider('value', $('#progressBar').slider('value') + 1);
+ setTimeout(progress, 10);
+ }
+ else{
+ $('#progressBar').unbind("click mousedown");
+ $('.ui-button').attr('disabled', '');
+ $('.ui-button').css('opacity', 1);
+ }
+ }, 200);
+ },
+ close: function(event, ui){
+ $('#container').fadeIn(50, function(e){
+ $('.feature:first').find('input:first').focus();
+ $('.feature:first').find('input:first').caret(0,0);
+ });
+ }
+ });
+
+ },
+
pageLoad: function() {
// Remark:
@@ -199,7 +232,7 @@ $(function() {
// jQuery event pooling can be fun for UI events!!!
// http://www.michaelhamrah.com/blog/2008/12/event-pooling-with-jquery-using-bind-and-trigger-managing-complex-javascript/
- doc.bind('keydown', onKeyDown);
+ doc.bind('keydown', keyBindings.keyDown);
doc.bind('keyBindings.canDeleteSteps', keyBindings.canDeleteSteps);
@@ -325,20 +358,7 @@ $(function() {
});
// splash page dialog
- $("#splash").dialog({
- resizable: false,
- width: 655,
- height: 400,
- modal: true,
- speed: 1500,
- dialogClass: "shadow splash",
- close: function(event, ui){
- $('#container').fadeIn(50, function(e){
- $('.feature:first').find('input:first').focus();
- $('.feature:first').find('input:first').caret(0,0);
- });
- }
- });
+
$("#export-stubs").dialog({
resizable: false,
@@ -363,20 +383,7 @@ $(function() {
range: "min"
}).show();
- // Remark: start up the progress bar, perhaps move this code
- function progressSlider() {
- if($('#progressBar').slider('value') < 100){
- $('#progressBar').slider('value', $('#progressBar').slider('value') + 1);
- setTimeout(progressSlider, 10);
- }
- else{
- $('#progressBar').unbind("click mousedown");
- $('.ui-button').attr('disabled', '');
- $('.ui-button').css('opacity', 1);
- }
- }
-
- setTimeout(progressSlider, 200);
+
$("footer").click(function() {
// put ajax post here
Please sign in to comment.
Something went wrong with that request. Please try again.