]> git.mxchange.org Git - friendica.git/commitdiff
some work on poke template
authorrabuzarus <>
Sat, 24 Oct 2015 17:51:58 +0000 (19:51 +0200)
committerrabuzarus <>
Sat, 24 Oct 2015 17:51:58 +0000 (19:51 +0200)
12 files changed:
mod/poke.php
view/templates/poke_content.tpl
view/templates/poke_head.tpl [new file with mode: 0644]
view/theme/duepuntozero/style.css
view/theme/frost-mobile/style.css
view/theme/frost/style.css
view/theme/quattro/dark/style.css
view/theme/quattro/green/style.css
view/theme/quattro/lilac/style.css
view/theme/quattro/quattro.less
view/theme/smoothly/style.css
view/theme/vier/style.css

index db1c94963618f8acbe5f84e64d8b4a2acc8d4872..45a577cda6bfd3764e9ac2d723112eea76df74f2 100644 (file)
@@ -1,4 +1,18 @@
-<?php
+<?php /** @file */
+
+/**
+ *
+ * Poke, prod, finger, or otherwise do unspeakable things to somebody - who must be a connection in your address book
+ * This function can be invoked with the required arguments (verb and cid and private and possibly parent) silently via ajax or
+ * other web request. You must be logged in and connected to a profile. 
+ * If the required arguments aren't present, we'll display a simple form to choose a recipient and a verb.
+ * parent is a special argument which let's you attach this activity as a comment to an existing conversation, which
+ * may have started with somebody else poking (etc.) somebody, but this isn't necessary. This can be used in the more pokes
+ * plugin version to have entire conversations where Alice poked Bob, Bob fingered Alice, Alice hugged Bob, etc.  
+ *
+ * private creates a private conversation with the recipient. Otherwise your profile's default post privacy is used.
+ *
+ */
 
 require_once('include/security.php');
 require_once('include/bbcode.php');
@@ -33,7 +47,7 @@ function poke_init(&$a) {
        logger('poke: verb ' . $verb . ' contact ' . $contact_id, LOGGER_DEBUG);
 
 
-       $r = q("SELECT * FROM `contact` WHERE `id` = %d and  `uid` = %d LIMIT 1",
+       $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
                intval($contact_id),
                intval($uid)
        );
@@ -46,8 +60,8 @@ function poke_init(&$a) {
        $target = $r[0];
 
        if($parent) {
-               $r = q("select uri, private, allow_cid, allow_gid, deny_cid, deny_gid
-                       from item where id = %d and parent = %d and uid = %d limit 1",
+               $r = q("SELECT `uri`, `private`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`
+                       FROM `item` WHERE `id` = %d AND `parent` = %d AND `uid` = %d LIMIT 1",
                        intval($parent),
                        intval($parent),
                        intval($uid)
@@ -140,7 +154,7 @@ function poke_content(&$a) {
        $id = '';
 
        if(intval($_GET['c'])) {
-               $r = q("select id,name from contact where id = %d and uid = %d limit 1",
+               $r = q("SELECT `id`,`name` FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
                        intval($_GET['c']),
                        intval(local_user())
                );
@@ -153,31 +167,16 @@ function poke_content(&$a) {
 
        $base = $a->get_baseurl();
 
-       $a->page['htmlhead'] .= '<script src="' . $a->get_baseurl(true) . '/library/jquery_ac/friendica.complete.js" ></script>';
-       $a->page['htmlhead'] .= <<< EOT
-
-<script>$(document).ready(function() {
-       var a;
-       a = $("#poke-recip").autocomplete({
-               serviceUrl: '$base/acl',
-               minChars: 2,
-               width: 350,
-               onSelect: function(value,data) {
-                       $("#poke-recip-complete").val(data);
-               }
-       });
-       a.setOptions({ params: { type: 'a' }});
-
-
-});
+       $head_tpl = get_markup_template('poke_head.tpl');
+       $a->page['htmlhead'] .= replace_macros($head_tpl,array(
+               '$baseurl' => $a->get_baseurl(true),
+               '$base' => $base
+       ));
 
-</script>
-EOT;
 
        $parent = ((x($_GET,'parent')) ? intval($_GET['parent']) : '0');
 
 
-
        $verbs = get_poke_verbs();
 
        $shortlist = array();
index 857dfb2003893c6f7907b6cf677ebfae235202c2..18191de03fc4e633c7265fa644af4729a19a6e97 100644 (file)
@@ -3,31 +3,33 @@
 
 <div id="poke-desc">{{$desc}}</div>
 
-<form action="poke" method="get">
-<br />
-<br />
-
-<div id="poke-recip-label">{{$clabel}}</div>
-<br />
-<input id="poke-recip" type="text" size="64" maxlength="255" value="{{$name|escape:'html'}}" name="pokename" autocomplete="off" />
-<input id="poke-recip-complete" type="hidden" value="{{$id}}" name="cid" />
-<input id="poke-parent" type="hidden" value="{{$parent}}" name="parent" />
-<br />
-<br />
-<div id="poke-action-label">{{$choice}}</div>
-<br />
-<br />
-<select name="verb" id="poke-verb-select" >
-{{foreach $verbs as $v}}
-<option value="{{$v.0}}">{{$v.1}}</option>
-{{/foreach}}
-</select>
-<br />
-<br />
-<div id="poke-private-desc">{{$prv_desc}}</div>
-<input type="checkbox" name="private" {{if $parent}}disabled="disabled"{{/if}} value="1" />
-<br />
-<br />
-<input type="submit" name="submit" value="{{$submit|escape:'html'}}" />
-</form>
+
+<div id="poke-wrapper">
+       <form action="poke" method="get">
+
+       <div id="poke-recipient">
+               <div id="poke-recip-label">{{$clabel}}</div>
+               <input id="poke-recip" type="text" size="64" maxlength="255" value="{{$name|escape:'html'}}" name="pokename" autocomplete="off" />
+               <input id="poke-recip-complete" type="hidden" value="{{$id}}" name="cid" />
+               <input id="poke-parent" type="hidden" value="{{$parent}}" name="parent" />
+       </div>
+
+       <div id="poke-action">
+               <div id="poke-action-label">{{$choice}}</div>
+               <select name="verb" id="poke-verb-select" >
+               {{foreach $verbs as $v}}
+               <option value="{{$v.0}}">{{$v.1}}</option>
+               {{/foreach}}
+               </select>
+       </div>
+
+       <div id="poke-privacy-settings">
+               <div id="poke-private-desc">{{$prv_desc}}</div>
+               <input type="checkbox" name="private" {{if $parent}}disabled="disabled"{{/if}} value="1" />
+       </div>
+
+       <input type="submit" name="submit" value="{{$submit|escape:'html'}}" />
+
+       </form>
+</div>
 
diff --git a/view/templates/poke_head.tpl b/view/templates/poke_head.tpl
new file mode 100644 (file)
index 0000000..6e30eb7
--- /dev/null
@@ -0,0 +1,18 @@
+<script src="{{$baseurl}}/library/jquery_ac/friendica.complete.js" ></script>
+
+<script>$(document).ready(function() {
+       var a;
+       a = $("#poke-recip").autocomplete({
+               serviceUrl: '{{$base}}/acl',
+               minChars: 2,
+               width: 350,
+               onSelect: function(value,data) {
+                       $("#poke-recip-complete").val(data);
+               }
+       });
+       a.setOptions({ params: { type: 'a' }});
+
+
+});
+
+</script>
\ No newline at end of file
index ae2530b6a2a683dc581117f9845b302397a58271..087104123a0e607f8da70e48b540737edcf3bf10 100644 (file)
@@ -2022,6 +2022,21 @@ a.mail-list-link {
 .message-links-end {
        clear: both;
 }
+#poke-desc {
+       margin: 5px 0 10px;
+}
+
+#poke-wrapper  {
+       padding: 10px 0 20px;
+}
+
+#poke-recipient, #poke-action, #poke-privacy-settings {
+       margin: 10px 0 30px;
+}
+
+#poke-recip-label, #poke-action-label, #prvmail-message-label {
+       margin: 10px 0 10px;
+}
 
 #sidebar-group-list ul {
        list-style-type: none;
index f4b46fed84519e42135f58c62c9c9c4e4e66b98f..22460b05908559852f67e6b0a80c7b804bdfa1e1 100644 (file)
@@ -2500,6 +2500,22 @@ a.mail-list-link {
        clear: both;\r
 }\r
 \r
+#poke-desc {\r
+       margin: 5px 0 10px;\r
+}\r
+\r
+#poke-wrapper  {\r
+       padding: 10px 0 0px;\r
+}\r
+\r
+#poke-recipient, #poke-action, #poke-privacy-settings {\r
+       margin: 10px 0 30px;\r
+}\r
+\r
+#poke-recip-label, #poke-action-label, #prvmail-message-label {\r
+       margin: 10px 0 10px;\r
+}\r
+\r
 #sidebar-group-list ul {\r
        list-style-type: none;\r
 }\r
index 8b87c3bd42549e5f9a40350b04ce96fa1b69a2e4..396f32cf97091fb05fbe5d02f2b8ad16bc152815 100644 (file)
@@ -2315,6 +2315,22 @@ a.mail-list-link {
        clear: both;
 }
 
+#poke-desc {
+       margin: 5px 0 10px;
+}
+
+#poke-wrapper  {
+       padding: 10px 0 20px;
+}
+
+#poke-recipient, #poke-action, #poke-privacy-settings {
+       margin: 10px 0 30px;
+}
+
+#poke-recip-label, #poke-action-label, #prvmail-message-label {
+       margin: 10px 0 10px;
+}
+
 #sidebar-group-list ul {
        list-style-type: none;
 }
index 1eda67de13a7343325f7759811fa891284532251..aaeb74e75295030e07523e3c9d3edd23f3d923b9 100644 (file)
@@ -2267,6 +2267,20 @@ ul.tabs li .active {
   -ms-transition: all 0.2s ease-in-out;
   transition: all 0.2s ease-in-out;
 }
+/* poke */
+#poke-desc {
+  margin: 5px 0 25px;
+}
+#poke-recipient,
+#poke-action,
+#poke-privacy-settings {
+  margin: 10px 0 30px;
+}
+#poke-recip-label,
+#poke-action-label,
+#prvmail-message-label {
+  margin: 10px 0 10px;
+}
 /* theme screenshot */
 .screenshot,
 #theme-preview {
index 71569971e5ac6b2ea50068e7dd6820fbc29b3285..ef408b4cd25da3f823a247f883e4a1cf353ac5e8 100644 (file)
@@ -2267,6 +2267,20 @@ ul.tabs li .active {
   -ms-transition: all 0.2s ease-in-out;
   transition: all 0.2s ease-in-out;
 }
+/* poke */
+#poke-desc {
+  margin: 5px 0 25px;
+}
+#poke-recipient,
+#poke-action,
+#poke-privacy-settings {
+  margin: 10px 0 30px;
+}
+#poke-recip-label,
+#poke-action-label,
+#prvmail-message-label {
+  margin: 10px 0 10px;
+}
 /* theme screenshot */
 .screenshot,
 #theme-preview {
index 55b81e5dafaad6e60c413cdc2cad54373d32468b..e31a427468f65d6a75aa63106af92bd41218076e 100644 (file)
@@ -2267,6 +2267,20 @@ ul.tabs li .active {
   -ms-transition: all 0.2s ease-in-out;
   transition: all 0.2s ease-in-out;
 }
+/* poke */
+#poke-desc {
+  margin: 5px 0 25px;
+}
+#poke-recipient,
+#poke-action,
+#poke-privacy-settings {
+  margin: 10px 0 30px;
+}
+#poke-recip-label,
+#poke-action-label,
+#prvmail-message-label {
+  margin: 10px 0 10px;
+}
 /* theme screenshot */
 .screenshot,
 #theme-preview {
index 3c9915576f6b671cc6e8df659bc52599072e8739..19847ad2dede23a77ac7701b2cb57521d1d85841 100644 (file)
@@ -1525,6 +1525,18 @@ ul.tabs {
        &:hover .mail-delete { .opaque(1); }
 
 }
+/* poke */
+#poke-desc {
+       margin: 5px 0 25px;
+}
+
+#poke-recipient, #poke-action, #poke-privacy-settings {
+       margin: 10px 0 30px;
+}
+
+#poke-recip-label, #poke-action-label, #prvmail-message-label {
+       margin: 10px 0 10px;
+}
 
 /* theme screenshot */
 .screenshot, #theme-preview {
index 46d8902aebd9efc51ad76fe8a961fce5684e5b67..da180ae61ed8286859858dfae9ca6d1c70fe3e79 100644 (file)
@@ -2693,6 +2693,25 @@ margin-left: 0px;
        border: 1px solid #7C7D7B;
 }
 
+/* ========== */
+/* = Poke = */
+/* ========== */
+#poke-desc {
+       margin: 5px 0 20px;
+}
+#poke-wrapper  {
+       margin: 40px 0 20px;
+}
+#poke-recipient, #poke-action, #poke-privacy-settings {
+       margin: 10px 0 30px;
+}
+#poke-recip-label, #poke-action-label, #prvmail-message-label {
+       margin: 10px 0 20px;
+}
+#poke-recip {
+       float: none;
+}
+
 /* ================= */
 /* = Notifications = */
 /* ================= */
index 1c03edc6bfbce09d10a962e2a3de3d84bb07327a..a6a27832f5b92857c7c4d5e38996330832b30508 100644 (file)
@@ -2496,6 +2496,22 @@ a.mail-list-link {
        border: none;
 }
 
+/* ========== */
+/* = Poke = */
+/* ========== */
+#poke-desc {
+       margin: 10px 0 20px;
+}
+#poke-wrapper  {
+       margin: 40px 0 20px;
+}
+#poke-recipient, #poke-action, #poke-privacy-settings {
+       margin: 10px 0 30px;
+}
+#poke-recip-label, #poke-action-label, #prvmail-message-label {
+       margin: 10px 0 20px;
+}
+
 /* ========== */
 /* = Events = */
 /* ========== */