From 4f62d7a78f63e4bae136f52d70d0af906d997b78 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 21 Aug 2016 15:43:03 +0200 Subject: move jotnets to jot and some cleanup (mostly whitespace) --- Zotlabs/Module/Channel.php | 3 +- Zotlabs/Module/Display.php | 3 +- Zotlabs/Module/Network.php | 5 +- Zotlabs/Module/Rpost.php | 3 +- include/acl_selectors.php | 7 -- include/conversation.php | 10 ++- view/css/conversation.css | 14 ++-- view/js/acl.js | 12 ++-- view/tpl/acl_selector.tpl | 13 +--- view/tpl/jot.tpl | 157 +++++++++++++++++++++++++++------------------ 10 files changed, 124 insertions(+), 103 deletions(-) diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php index 59cb9f06c..be65354a9 100644 --- a/Zotlabs/Module/Channel.php +++ b/Zotlabs/Module/Channel.php @@ -140,7 +140,8 @@ class Channel extends \Zotlabs\Web\Controller { 'profile_uid' => \App::$profile['profile_uid'], 'editor_autocomplete' => true, 'bbco_autocomplete' => 'bbcode', - 'bbcode' => true + 'bbcode' => true, + 'jotnets' => true ); $o .= status_editor($a,$x); diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php index 35ed0c894..e9441bbdf 100644 --- a/Zotlabs/Module/Display.php +++ b/Zotlabs/Module/Display.php @@ -73,7 +73,8 @@ class Display extends \Zotlabs\Web\Controller { 'expanded' => true, 'editor_autocomplete' => true, 'bbco_autocomplete' => 'bbcode', - 'bbcode' => true + 'bbcode' => true, + 'jotnets' => true ); $o = '
'; diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php index 0128adc2c..50bb05075 100644 --- a/Zotlabs/Module/Network.php +++ b/Zotlabs/Module/Network.php @@ -159,7 +159,7 @@ class Network extends \Zotlabs\Web\Controller { 'allow_gid' => $channel['channel_allow_gid'], 'deny_cid' => $channel['channel_deny_cid'], 'deny_gid' => $channel['channel_deny_gid'] - ); + ); $private_editing = ((($group || $cid) && (! intval($_GET['pf']))) ? true : false); @@ -176,7 +176,8 @@ class Network extends \Zotlabs\Web\Controller { 'profile_uid' => local_channel(), 'editor_autocomplete' => true, 'bbco_autocomplete' => 'bbcode', - 'bbcode' => true + 'bbcode' => true, + 'jotnets' => true ); if($deftag) $x['pretext'] = $deftag; diff --git a/Zotlabs/Module/Rpost.php b/Zotlabs/Module/Rpost.php index 525f053de..e7662e49a 100644 --- a/Zotlabs/Module/Rpost.php +++ b/Zotlabs/Module/Rpost.php @@ -126,7 +126,8 @@ class Rpost extends \Zotlabs\Web\Controller { 'source' => ((x($_REQUEST,'source')) ? strip_tags($_REQUEST['source']) : ''), 'return_path' => 'rpost/return', 'bbco_autocomplete' => 'bbcode', - 'bbcode' => true + 'bbcode' => true, + 'jotnets' => true ); $editor = status_editor($a,$x); diff --git a/include/acl_selectors.php b/include/acl_selectors.php index 9bee942e2..362776b44 100644 --- a/include/acl_selectors.php +++ b/include/acl_selectors.php @@ -148,11 +148,6 @@ function populate_acl($defaults = null,$show_jotnets = true, $emptyACL_descripti array_walk($deny_cid,'fixacl'); array_walk($deny_gid,'fixacl'); } - - $jotnets = ''; - if($show_jotnets) { - call_hooks('jot_networks', $jotnets); - } $r = q("SELECT id, hash, gname FROM groups WHERE deleted = 0 AND uid = %d ORDER BY gname ASC", intval(local_channel()) @@ -181,8 +176,6 @@ function populate_acl($defaults = null,$show_jotnets = true, $emptyACL_descripti '$allowgid' => json_encode($allow_gid), '$denycid' => json_encode($deny_cid), '$denygid' => json_encode($deny_gid), - '$jnetModalTitle' => t('Other networks and post services'), - '$jotnets' => $jotnets, '$aclModalTitle' => t('Permissions'), '$aclModalDesc' => $dialog_description, '$aclModalDismiss' => t('Close'), diff --git a/include/conversation.php b/include/conversation.php index 7d1473fe2..637234bff 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1200,8 +1200,6 @@ function status_editor($a, $x, $popup = false) { $tpl = get_markup_template('jot.tpl'); - $jotplugins = ''; - $preview = t('Preview'); if(x($x, 'hide_preview')) $preview = ''; @@ -1218,8 +1216,14 @@ function status_editor($a, $x, $popup = false) { if(! $cipher) $cipher = 'aes256'; + $jotplugins = ''; call_hooks('jot_tool', $jotplugins); + $jotnets = ''; + if(x($x,'jotnets')) { + call_hooks('jot_networks', $jotnets); + } + $o .= replace_macros($tpl, array( '$return_path' => ((x($x, 'return_path')) ? $x['return_path'] : App::$query_string), '$action' => z_root() . '/item', @@ -1276,6 +1280,8 @@ function status_editor($a, $x, $popup = false) { '$preview' => $preview, '$source' => ((x($x, 'source')) ? $x['source'] : ''), '$jotplugins' => $jotplugins, + '$jotnets' => $jotnets, + '$jotnets_label' => t('Other networks and post services'), '$defexpire' => $defexpire, '$feature_expire' => $feature_expire, '$expires' => t('Set expiration date'), diff --git a/view/css/conversation.css b/view/css/conversation.css index 5af0c55e7..6c5171545 100644 --- a/view/css/conversation.css +++ b/view/css/conversation.css @@ -1,6 +1,6 @@ /* jot */ -.jothidden input { +.jothidden input[type="text"] { border: 0px; margin: 0px; height: 39px; @@ -70,6 +70,10 @@ margin-bottom: 30px; } +#profile-jot-plugin-wrapper { + margin-top: 10px; +} + #profile-rotator-wrapper { float: left; } @@ -78,14 +82,6 @@ padding: 15px 0px 0px 15px; } -.profile-jot-net { - float: left; - margin-right: 10px; - margin-top: 5px; - margin-bottom: 5px; - padding: 5px; -} - /* conversation */ .thread-wrapper.toplevel_item { diff --git a/view/js/acl.js b/view/js/acl.js index eb7b7f523..c1685e137 100644 --- a/view/js/acl.js +++ b/view/js/acl.js @@ -100,13 +100,6 @@ ACL.prototype.on_submit = function() { $(that.deny_cid).each(function(i,v) { that.form_id.append(""); }); - - var formfields = $('.profile-jot-net input').serializeArray(); - - $.each(formfields, function(i, field) { - that.form_id.append(""); - }); - }; ACL.prototype.search = function() { @@ -283,6 +276,7 @@ ACL.prototype.update_view = function(value) { /* jot acl */ $('#jot-perms-icon, #dialog-perms-icon').removeClass('fa-lock').addClass('fa-unlock'); + $('#dbtn-jotnets').show(); $('.profile-jot-net input').attr('disabled', false); } @@ -295,6 +289,7 @@ ACL.prototype.update_view = function(value) { /* jot acl */ $('#jot-perms-icon, #dialog-perms-icon').removeClass('fa-unlock').addClass('fa-lock'); + $('#dbtn-jotnets').hide(); $('.profile-jot-net input').attr('disabled', 'disabled'); } @@ -306,6 +301,7 @@ ACL.prototype.update_view = function(value) { /* jot acl */ $('#jot-perms-icon, #dialog-perms-icon').removeClass('fa-unlock').addClass('fa-lock'); + $('#dbtn-jotnets').hide(); $('.profile-jot-net input').attr('disabled', 'disabled'); } @@ -317,10 +313,12 @@ ACL.prototype.update_view = function(value) { /* jot acl */ if(that.allow_gid.length === 0 && that.allow_cid.length === 0 && that.deny_gid.length === 0 && that.deny_cid.length === 0 && value === 'custom') { $('#jot-perms-icon, #dialog-perms-icon').removeClass('fa-lock').addClass('fa-unlock'); + $('#dbtn-jotnets').show(); $('.profile-jot-net input').attr('disabled', false); } else { $('#jot-perms-icon, #dialog-perms-icon').removeClass('fa-unlock').addClass('fa-lock'); + $('#dbtn-jotnets').hide(); $('.profile-jot-net input').attr('disabled', 'disabled'); } } diff --git a/view/tpl/acl_selector.tpl b/view/tpl/acl_selector.tpl index 70ef4469a..dbdbd6a56 100755 --- a/view/tpl/acl_selector.tpl +++ b/view/tpl/acl_selector.tpl @@ -27,16 +27,6 @@
{{/if}} - {{if $jotnets}} - -
- {{$jotnets}} -
-
- {{/if}} -
@@ -47,13 +37,14 @@
-
+ + -
+
+ {{if $jotplugins}}
{{$jotplugins}}
+ {{/if}} + {{if $jotnets}} + + {{/if}}
@@ -197,70 +222,78 @@ {{if $feature_expire}} {{/if}} {{if $feature_future}} - {{/if}} {{if $embedPhotos}} {{/if}} -- cgit v1.2.3