diff --git a/frontendfsm/aiagallery/source/class/aiagallery/dbif/MDbifCommon.js b/frontendfsm/aiagallery/source/class/aiagallery/dbif/MDbifCommon.js index 264ea1e..9ff2882 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: @@ -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 e96d719..7ee846e 100644 --- a/frontendfsm/aiagallery/source/class/aiagallery/module/dgallery/appinfo/Fsm.js +++ b/frontendfsm/aiagallery/source/class/aiagallery/module/dgallery/appinfo/Fsm.js @@ -163,7 +163,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 cb7c2e7..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, @@ -319,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", @@ -357,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 }); @@ -584,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); @@ -654,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) { @@ -706,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); }