]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
replybutton.darc
authormike <mike@ice2o.com>
Tue, 8 Jul 2008 11:20:16 +0000 (07:20 -0400)
committermike <mike@ice2o.com>
Tue, 8 Jul 2008 11:20:16 +0000 (07:20 -0400)
Add a simple reply button to notices

darcs-hash:20080708112016-f7d30-321142883159fa91338754140ac4ea37e54bb746.gz

js/util.js
lib/jabber.php
lib/stream.php
theme/default/display.css
theme/stoica/display.css

index 4f2e7c724d99f8c2adc67124c593a53a4c4d6b5c..50c311f993b558e420067552b540690c5c013ac8 100644 (file)
@@ -19,5 +19,14 @@ $(document).ready(function(){
             // run once in case there's something in there
                        counter();
         }
+
 });
 
+        function doreply(nick) {
+            rgx_username = /^[0-9a-zA-Z\-_.]*$/;
+            if (nick.match(rgx_username)) {
+              replyto = "@" + nick + " ";
+              document.getElementById("status_textarea").value=replyto; 
+              document.getElementById("status_textarea").focus();
+            }
+        }
index 66ff24e63a792eb4fa43a861eb47b9e2558a5848..8890f6456d2d10674d9c69adbab67c9ad5951cbb 100644 (file)
@@ -19,7 +19,7 @@
 
 if (!defined('LACONICA')) { exit(1); }
 
-require_once('XMPPHP/XMPP.php');
+require_once('xmpp.php');
 
 function jabber_valid_base_jid($jid) {
        # Cheap but effective
index 8da07c3160fb5a219ff2f9d3bd868d53f94da317..bef3abff019ae790ee053cefb55bd1171d7d1827 100644 (file)
@@ -86,6 +86,7 @@ class StreamAction extends Action {
                                                                  'href' => $noticeurl,
                                                                  'title' => common_exact_date($notice->created)),
                                           common_date_string($notice->created));
+               common_element('a', array('href' => "#", 'onclick' => 'javascript: doreply("'.$profile->nickname.'")', 'class' => 'replybutton'), 'reply');
                if ($replied_id) {
                        $replyurl = common_local_url('shownotice', array('notice' => $replied_id));
                        common_text('(');
index 98dad5d02a51b6e3b96c5d6115179315fb541249..0e681b909ad612412c13568eafc26893f94d00cb 100644 (file)
@@ -568,4 +568,7 @@ input#openid_url {
 }
 
 /* ===== End Forms Styling ===== */
-               
+
+.replybutton {
+  margin-left: 55%;
+}
index fb300326a1100350afebc8ecf3f8b72917dade3b..6a706dc6a34a6a479ef628d89c99e35aeb71cc68 100644 (file)
@@ -595,3 +595,7 @@ input#openid_url {
 }
 
 /* ===== End Forms Styling ===== */
+
+.replybutton {
+  margin-left: 55%;
+}