From 4c6afe630d4505a9e78a62bc7ef553ee2fb1ed6c Mon Sep 17 00:00:00 2001 From: Manuel Castillo Date: Thu, 17 Nov 2011 15:59:40 -0500 Subject: [PATCH 1/3] Standardization Function added --- .../aiagallery/source/class/aiagallery/dbif/MDbifCommon.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontendfsm/aiagallery/source/class/aiagallery/dbif/MDbifCommon.js b/frontendfsm/aiagallery/source/class/aiagallery/dbif/MDbifCommon.js index da07285..265eaf3 100644 --- a/frontendfsm/aiagallery/source/class/aiagallery/dbif/MDbifCommon.js +++ b/frontendfsm/aiagallery/source/class/aiagallery/dbif/MDbifCommon.js @@ -1,4 +1,4 @@ -/** +/*** * Copyright (c) 2011 Derrell Lipman * * License: From 63d234fec65b524a26a06ebf202973750c956d36 Mon Sep 17 00:00:00 2001 From: Manuel Castillo Date: Mon, 5 Dec 2011 03:32:13 -0500 Subject: [PATCH 2/3] Appinfo now uses standardized date (still working on other displays) --- .../class/aiagallery/dbif/MDbifCommon.js | 22 +++++++++++++++++-- .../aiagallery/module/dgallery/appinfo/Fsm.js | 2 +- .../aiagallery/module/dgallery/appinfo/Gui.js | 18 +++++++++++---- 3 files changed, 35 insertions(+), 7 deletions(-) diff --git a/frontendfsm/aiagallery/source/class/aiagallery/dbif/MDbifCommon.js b/frontendfsm/aiagallery/source/class/aiagallery/dbif/MDbifCommon.js index 265eaf3..f677996 100644 --- a/frontendfsm/aiagallery/source/class/aiagallery/dbif/MDbifCommon.js +++ b/frontendfsm/aiagallery/source/class/aiagallery/dbif/MDbifCommon.js @@ -65,9 +65,27 @@ qx.Mixin.define("aiagallery.dbif.MDbifCommon", */ currentTimestamp : function() { - return new Date().getTime(); + return new Date(); }, - + /** + * Function to convert linux-time to a standard date + * according to the current locale settings. + * + *@param myDate {Date} + * The time in seconds since beginning of epoch: Jan 1 1970 + *@return newDate {String} + * The date in String form + * + * + */ + formatDate : function(myDate) + { + var myFormat = new DateFormat("E MMM dd y HH:m (z)"); + //Mon Dec 05 2011 02:46 (GMT-05:00) + //E MMM dd y HH:m (z) + return(myFormat.format(myDate)); + }, + /** * Function to be called for authorization to run a service * method. diff --git a/frontendfsm/aiagallery/source/class/aiagallery/module/dgallery/appinfo/Fsm.js b/frontendfsm/aiagallery/source/class/aiagallery/module/dgallery/appinfo/Fsm.js index 67de040..1352e11 100644 --- a/frontendfsm/aiagallery/source/class/aiagallery/module/dgallery/appinfo/Fsm.js +++ b/frontendfsm/aiagallery/source/class/aiagallery/module/dgallery/appinfo/Fsm.js @@ -160,7 +160,7 @@ qx.Class.define("aiagallery.module.dgallery.appinfo.Fsm", }); state.addTransition(trans); - + /* * Transition: Idle to AwaitRpcResult * diff --git a/frontendfsm/aiagallery/source/class/aiagallery/module/dgallery/appinfo/Gui.js b/frontendfsm/aiagallery/source/class/aiagallery/module/dgallery/appinfo/Gui.js index 6b8d3bc..14b4bb5 100644 --- a/frontendfsm/aiagallery/source/class/aiagallery/module/dgallery/appinfo/Gui.js +++ b/frontendfsm/aiagallery/source/class/aiagallery/module/dgallery/appinfo/Gui.js @@ -108,16 +108,24 @@ qx.Class.define("aiagallery.module.dgallery.appinfo.Gui", // (which could use some additional tweaking, perhaps) // FIXME: This needs to be internationalized. There are existing // functions to do so. - var dateObj = new Date(commentTime); //not sure what to do here.. - var dateString = dateObj.toDateString(); - var timeString = dateObj.getHours() + ":" + dateObj.getMinutes(); - var dateTimeString = dateString + " " + timeString + " ET"; + //// HOURS + var dateObjNew = aiagallery.dbif.MDbifCommon.currentTimestamp(); + // var dateObj = new Date(commentTime); //not sure what to do here.. + //var dateString = dateObj.toDateString(); + //var timeString = dateObj.getHours() + ":" + dateObj.getMinutes(); + //var dateTimeString = dateString + " " + timeString + " ET"; + var dateTimeString = dateObjNew; + // 2nd line var postedStringStart = 'Posted: '; var postedString = postedStringStart + dateTimeString + ''; var postedStringLabel = new qx.ui.basic.Label(postedString); + + + + postedStringLabel.set( { rich : true, @@ -645,6 +653,8 @@ qx.Class.define("aiagallery.module.dgallery.appinfo.Gui", // Get result data--in this case, the comment that was added. comment = response.data.result; + + // Add the new comment to the GUI, if nonempty. if (comment["text"] != null) { From c107336eb9e408523dc77cd4e26cea71f0939c92 Mon Sep 17 00:00:00 2001 From: Manuel Castillo Date: Mon, 5 Dec 2011 14:55:05 -0500 Subject: [PATCH 3/3] hour displayed through static function currentTimestamp() --- .../aiagallery/module/dgallery/appinfo/Gui.js | 29 +++++-------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/frontendfsm/aiagallery/source/class/aiagallery/module/dgallery/appinfo/Gui.js b/frontendfsm/aiagallery/source/class/aiagallery/module/dgallery/appinfo/Gui.js index d2307ca..14b4bb5 100644 --- a/frontendfsm/aiagallery/source/class/aiagallery/module/dgallery/appinfo/Gui.js +++ b/frontendfsm/aiagallery/source/class/aiagallery/module/dgallery/appinfo/Gui.js @@ -327,17 +327,7 @@ qx.Class.define("aiagallery.module.dgallery.appinfo.Gui", new qx.ui.container.Composite(new qx.ui.layout.HBox(10)); // Create a download button to allow to user to download the application - downloadBtn = - new qx.ui.form.Button("Download", - "qx/icon/Tango/16/apps/internet-download-manager.png"); - - // Makes download button smaller and centers it - downloadBtn.set( - { - maxWidth : 200, - alignX : "center" - }); - + downloadBtn = new qx.ui.form.Button("Download", "qx/icon/Tango/16/apps/internet-download-manager.png"); fsm.addObject("downloadBtn", downloadBtn); downloadBtn.addListener( "execute", @@ -365,11 +355,9 @@ qx.Class.define("aiagallery.module.dgallery.appinfo.Gui", } // Create a button to allow users to "flag" things. - flagItButton = new qx.ui.form.Button("Flag it!", + // FIXME: Implement this + flagItButton = new aiagallery.widget.Button("Flag it!", "qx/icon/Oxygen/16/status/dialog-error.png"); - flagItButton.setAppearance("flagIt-button"); - fsm.addObject("flagItButton", flagItButton); - flagItButton.addListener("execute", fsm.eventListener, fsm); // Add likeItButton to the hbox. hboxFlagLike.add(this.likeItButton, { flex : 1 }); @@ -592,7 +580,10 @@ qx.Class.define("aiagallery.module.dgallery.appinfo.Gui", input.dataType = input.DATA_TYPE.TEXT; //The url of the download link to encode into a qr code. - input.data = location.host + "/rpc?getdata=" + appId + ":apk"; + input.data = + "http://app-inventor-gallery.appspot.com/rpc?getdata=" + + appId + + ":apk"; //This generates the qr code matrix. var matrix = new qr.Matrix(input, code); @@ -716,12 +707,6 @@ qx.Class.define("aiagallery.module.dgallery.appinfo.Gui", break; - case "flagIt": - - console.log(response.data.result ); - - break; - default: throw new Error("Unexpected request type: " + requestType); }