From 1ccf1b8bdb2290f861b6bec6789fc3cd2f523484 Mon Sep 17 00:00:00 2001 From: James Adam Date: Mon, 7 Sep 2009 16:42:00 +0100 Subject: [PATCH] Got rid of the waiting stuff, it wasn't working. Also added toggle-able logging. --- FreeAgent.dcproj/james.wdgtuser | 21 +++++++----------- FreeAgent.dcproj/project.wdgt/free_agent.js | 18 ++++++++-------- FreeAgent.dcproj/project.wdgt/gui.js | 24 ++++++--------------- FreeAgent.dcproj/project.wdgt/logger.js | 13 +++++++++++ FreeAgent.dcproj/project.wdgt/main.html | 3 ++- FreeAgent.dcproj/project.wdgt/main.js | 3 +++ 6 files changed, 41 insertions(+), 41 deletions(-) create mode 100644 FreeAgent.dcproj/project.wdgt/logger.js diff --git a/FreeAgent.dcproj/james.wdgtuser b/FreeAgent.dcproj/james.wdgtuser index a8e2e8f..d755186 100644 --- a/FreeAgent.dcproj/james.wdgtuser +++ b/FreeAgent.dcproj/james.wdgtuser @@ -3,14 +3,7 @@ Breakpoints - - free_agent.js:85 - - gui.js:120 - -populateSelect - main.js:142 - -postTime - + BreakpointsFrame 603 48 404 338 0 0 1440 878 ContentSplitViewGeometry @@ -36,11 +29,11 @@ Dashboard Widget Prefs id - f9313eff5555b041 + ba4e67fa6055b041 in-layer path - /private/var/folders/OG/OGHFsoDxGYmTuil4f-W3M++++TI/-Tmp-/Dashcode/.FreeAgent.dcprojqlynds/FreeAgent.dcproj/project.wdgt/ + /private/var/folders/OG/OGHFsoDxGYmTuil4f-W3M++++TI/-Tmp-/Dashcode/.FreeAgent.dcproj7pAx1x/FreeAgent.dcproj/project.wdgt/ percent-offset-x 0 percent-offset-y @@ -66,6 +59,8 @@ SavePath /Users/james/Desktop + WidgetCompatibilityTag + 0 Design time language en.lproj @@ -138,15 +133,15 @@ 0 - 0 - 13 + 1 + 8 Opened Steps Visible StackLayout Views - front + back diff --git a/FreeAgent.dcproj/project.wdgt/free_agent.js b/FreeAgent.dcproj/project.wdgt/free_agent.js index 5a08b0e..da05ba2 100644 --- a/FreeAgent.dcproj/project.wdgt/free_agent.js +++ b/FreeAgent.dcproj/project.wdgt/free_agent.js @@ -21,14 +21,14 @@ FreeAgent = { var results = []; var things = xml.find(kind); if (things.length == 0) { - alert("Found no " + kind + "s"); + Logger.log("Found no " + kind + "s"); } else { things.each(function() { var thing = $(this); if (checkFunction == null || checkFunction(thing)) { var thing_id = thing.find("id").text(); var thing_name = thing.find("name").text(); - alert("adding " + kind + " '" + thing_name + "'"); + Logger.log("adding " + kind + " '" + thing_name + "'"); results.push({name:thing_name, id:thing_id}); } }); @@ -39,7 +39,7 @@ FreeAgent = { loadUser: function() { this.loadXML("users", function(xml) { FreeAgent.userID = xml.find("user= 60) { @@ -86,9 +72,7 @@ GUI = { }, selectProject: function(event) { - this.wait(); FreeAgent.setProject(this.selectedProjectID()); - this.ready(); }, selectTask: function(event) { @@ -137,7 +121,11 @@ GUI = { showBack(); }, - isEnabled: function() { - return (this.buttonText().css('color') == "rgb(0, 0, 0)"); + updateLoggerStatus: function(status) { + if (status) { + $("#message").css('color', "#ff0"); + } else { + $("#message").css('color', "#fff"); + } } }; diff --git a/FreeAgent.dcproj/project.wdgt/logger.js b/FreeAgent.dcproj/project.wdgt/logger.js new file mode 100644 index 0000000..6ea0a8c --- /dev/null +++ b/FreeAgent.dcproj/project.wdgt/logger.js @@ -0,0 +1,13 @@ +Logger = { + on: false, + + toggle: function() { + return (this.on = !this.on); + }, + + log: function(message) { + if (Logger.on) { + alert(message); + } + } +} \ No newline at end of file diff --git a/FreeAgent.dcproj/project.wdgt/main.html b/FreeAgent.dcproj/project.wdgt/main.html index c078d0b..009df08 100644 --- a/FreeAgent.dcproj/project.wdgt/main.html +++ b/FreeAgent.dcproj/project.wdgt/main.html @@ -13,6 +13,7 @@ + @@ -51,7 +52,7 @@
-
+
diff --git a/FreeAgent.dcproj/project.wdgt/main.js b/FreeAgent.dcproj/project.wdgt/main.js index 4a545dc..2256ea4 100644 --- a/FreeAgent.dcproj/project.wdgt/main.js +++ b/FreeAgent.dcproj/project.wdgt/main.js @@ -178,3 +178,6 @@ function visitSite(event) { function openFreeRange(event) { widget.openURL("http://gofreerange.com"); } function openLazyatom(event) { widget.openURL("http://lazyatom.com"); } +function toggleLogger(event) { + GUI.updateLoggerStatus(Logger.toggle()); +}