X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=www%2Fjssrc%2Fblerg%2FPost.js;h=79ab1263ab3baa1f8e0e2db8ee66c5a43a7fde9d;hb=73a1174eca9932fa03220d13222b6a62eda2bfa1;hp=0c72a99332bf1cc07efeb342005534031e9f5da5;hpb=f52a8f9713f3695944257d179b7c418ee60062c7;p=blerg.git diff --git a/www/jssrc/blerg/Post.js b/www/jssrc/blerg/Post.js index 0c72a99..79ab126 100644 --- a/www/jssrc/blerg/Post.js +++ b/www/jssrc/blerg/Post.js @@ -9,7 +9,12 @@ 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}} ]}, @@ -88,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(); } });