X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=www%2Fjssrc%2Fblerg%2FPost.js;h=de01c86a96fca7e0ac3892d4a75048c340099937;hb=25d71dcb7110a90a83b287686ce27c7de450c619;hp=ee537f2bc7fc2b69eda351309883da10cff34d9b;hpb=fc5b9f1f68322c876b331c049749f113eb0271f7;p=blerg.git diff --git a/www/jssrc/blerg/Post.js b/www/jssrc/blerg/Post.js index ee537f2..de01c86 100644 --- a/www/jssrc/blerg/Post.js +++ b/www/jssrc/blerg/Post.js @@ -9,12 +9,17 @@ enyo.kind({ }, resizePostContentTimeout: null, components: [ - {tag: "h2", content: "What's on your mind?"}, + {name: "helpContent", allowHtml: true, showing: false}, + {style: "position: relative;", components: [ + {tag: "h2", content: "What's on your mind?", style: "width: 75%;",}, + {name: "showHelpLink", kind: "blerg.Link", onNavigate: "showHelp", content: "Help!", style: "position: absolute; right: 1pt; bottom: 1pt; font-weight: bold; font-size: large;"}, + {name: "hideHelpLink", kind: "blerg.Link", onNavigate: "hideHelp", content: "Hide Help", style: "position: absolute; right: 1pt; bottom: 1pt; font-weight: bold; font-size: large;", showing: false} + ]}, {kind: "onyx.InputDecorator", components: [ {name: "postContent", classes: "content", kind: "onyx.TextArea", onkeydown: "resizePostContent", attributes: {tabindex: 4}} ]}, {classes: "buttons", components: [ - {name: "loginReminder", tag: "span", classes: "blerg-error", style: "margin-right: 8px; vertical-align: 60%", content: "You must log in before posting."}, + {name: "loginReminder", tag: "span", classes: "blerg-error", style: "margin-right: 8px; vertical-align: 60%;", content: "You must log in before posting."}, {kind: "onyx.Button", content: "Close", onclick: "closePost", classes: "onyx-negative", attributes: {tabindex: 6}}, {name: "postButton", kind: "onyx.Button", content: "Post", onclick: "doPost", classes: "onyx-affirmative", disabled: true, attributes: {tabindex: 5}} ]}, @@ -40,7 +45,11 @@ enyo.kind({ postSuccessful: function() { this.setData(''); this.closePost(); - this.href = '#' + blerg.API.username; + if (location.hash != '#' + blerg.API.username) { + qlink(blerg.API.username); + } else { + this.bubble('onReload'); + } }, postFailed: function() { alert('Could not post!'); @@ -84,5 +93,25 @@ enyo.kind({ loggedOut: function() { this.$.postButton.setDisabled(true); this.$.loginReminder.show(); + }, + showHelp: function() { + this.$.helpContent.show(); + this.$.showHelpLink.hide(); + this.$.hideHelpLink.show(); + if (this.$.helpContent.getContent() == '') { + var req = new enyo.Ajax({ + url: baseURL + '/doc/post_help.html', + handleAs: 'text' + }); + req.response(function(inSender, inResponse) { + this.$.helpContent.setContent(inResponse); + }.bind(this)); + req.go(); + } + }, + hideHelp: function() { + this.$.helpContent.hide(); + this.$.showHelpLink.show(); + this.$.hideHelpLink.hide(); } });