Here is the start of the Gentle Feedback Free Nodelet Hack
Untested, but I'm pretty sure I got the magic strings right
<script language="javascript" type="text/javascript">
<!--//
var TehGentleFeedback = function()
{
if( document.getElementById("Gentle-Feedback-Popup") !== null ){
/* single instance checker */
return;
}
String.prototype.escapeHTML = function(){
var result = "";
for(var i = 0; i < this.length; i++){
if(this.charAt(i) == "&"
&& this.length-i-1 >= 4
&& this.substr(i, 4) != "&"){
result = result + "&";
} else if(this.charAt(i)== "<"){
result = result + "<";
} else if(this.charAt(i)== ">"){
result = result + ">";
} else {
result = result + this.charAt(i);
}
}
return result;
};
var IQ = function IQ(msg){
msg = "/msg `[`author_title\``] " + msg;
var ret = '';
ret += '<form method="post" action="?" enctype="multipart/form
+-data">';
ret += '<input name="op" type="hidden" value="message">';
ret += '<input name="node_id" type="hidden" value="`id`">';
ret += '<input name="message" type="hidden" value="' + msg +'"
+>';
ret += '<input type="submit" value="send">';
ret += msg.escapeHTML();
ret += '</form>'
return ret;
};
var SURVEY = function(){ return 'shabba' };
var p = document.createElement("p");
var ret = '<div id="Gentle-Feedback-Popup" style="padding: 1em 1em
+ 1em 1em; background:white;border:5px red dashed; position: fixed; le
+ft:120px; top:20px; z-index:3; display: block; visibility: visible; w
+idth:80%; " >';
ret += '<button style="width:100%" onclick="this.parentNode.parent
+Node.parentNode.removeChild(this.parentNode.parentNode);">Close</butt
+on><hr>';
ret += "<p>Gentle Feedback <p> Instant Quicky <p> ";
ret += IQ("Regarding [`id`|`title\`], title ok, enough information
+ provided, formatting acceptable, nice job ");
ret += IQ("Regarding [`id`|`title\`], blah blah blah");
ret += IQ("Hello");
ret += "<hr>" + SURVEY();
ret += '<hr> <button style="width:100%" onclick="this.parentNode.p
+arentNode.parentNode.removeChild(this.parentNode.parentNode);">Close<
+/button>';
ret += "</div>";
p.innerHTML = ret;
document.body.appendChild(p);
return;
};
//-->
</script>
<a href='javascript:TehGentleFeedback()'>TehGentleFeedback()</a>
For the magic strings refer to
I ran out of steam for SURVEY , implement as you see fit
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|