Skip to content

Commit

Permalink
Fixed version printing bug. Changed format from object to function
Browse files Browse the repository at this point in the history
  • Loading branch information
Douglas Neiner authored and Douglas Neiner committed Jul 20, 2009
1 parent 6da5c4d commit b1f61d6
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions console.js
@@ -1,14 +1,14 @@
(function($){
$.consoleController = {
version : '0.2.1',
counter : 0,
queries : [],
historyCounter : 0,
$.consoleController = function(){
this.version = '0.2.1';
this.counter = 0;
this.queries = [];
this.historyCounter = 0;

var self = this;

init: function() {

var self = this;

this.init = function() {
self.url = WP_CONSOLE_URL;
self.secret = WP_CONSOLE_SECRET;

Expand Down Expand Up @@ -104,11 +104,9 @@

self.about();
self.doPrompt();
},

doPrompt: function(prompt) {
}

var self = this;
this.doPrompt = function(prompt) {

// increment prompt counter
self.counter++;
Expand Down Expand Up @@ -213,27 +211,27 @@
} // end case
});

},
}

about: function() {
this.about = function() {
self.$header = $('<div id="header">' +
'WordPress Console [' + self.version + '] by ' +
'<a target="_blank" href="http://jerodsanto.net">Jerod Santo</a>' +
'</div>');
this.shell.append(self.$header);
},
}

print: function(string) {
this.print = function(string) {
// Using text() escapes HTML to output visible tags
var result = $('<pre></pre>').text(string);
this.shell.append( $('<div></div>').append(result) );
},
}

error: function(string) {
this.error = function(string) {
this.shell.append('<div class="err">Error: ' + string + '</div>');
},
}

check: function(json) {
this.check = function(json) {

// make sure json result is not an error
if (typeof json.error != "undefined") {
Expand All @@ -243,9 +241,12 @@
return true;
}
}

// Trigger init
this.init();

}
$(document).ready(function() { $.consoleController.init(); });
$(document).ready(function() { window.consoleController = new $.consoleController(); });
})(jQuery);

// HELPER FUNCTIONS
Expand Down

0 comments on commit b1f61d6

Please sign in to comment.