From 9f621dac85c1c417b17d031e3ca2798c6b63ece7 Mon Sep 17 00:00:00 2001 From: marijus Date: Tue, 8 Apr 2014 22:07:06 +0200 Subject: change the way jot tools are displayed/hidden --- include/conversation.php | 4 ++-- mod/blocks.php | 2 +- mod/channel.php | 2 +- mod/display.php | 2 +- mod/editblock.php | 4 ++-- mod/editlayout.php | 4 ++-- mod/editpost.php | 6 +++--- mod/editwebpage.php | 4 ++-- mod/layouts.php | 2 +- mod/mail.php | 8 ++++---- mod/network.php | 2 +- mod/rpost.php | 2 +- mod/webpages.php | 2 +- view/tpl/jot.tpl | 22 ++++++++++++++-------- view/tpl/prv_message.tpl | 14 ++++++++------ 15 files changed, 44 insertions(+), 36 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index 8803e74e7..5a7e9e2cd 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1144,9 +1144,9 @@ function status_editor($a,$x,$popup=false) { '$source' => ((x($x,'source')) ? $x['source'] : ''), '$jotplugins' => $jotplugins, '$defexpire' => '', - '$feature_expire' => ((feature_enabled($x['profile_uid'],'content_expire') && (! $webpage)) ? 'block' : 'none'), + '$feature_expire' => ((feature_enabled($x['profile_uid'],'content_expire') && (! $webpage)) ? true : false), '$expires' => t('Set expiration date'), - '$feature_encrypt' => ((feature_enabled($x['profile_uid'],'content_encrypt') && (! $webpage)) ? 'block' : 'none'), + '$feature_encrypt' => ((feature_enabled($x['profile_uid'],'content_encrypt') && (! $webpage)) ? true : false), '$encrypt' => t('Encrypt text'), '$cipher' => $cipher, '$expiryModalOK' => t('OK'), diff --git a/mod/blocks.php b/mod/blocks.php index 81337448c..343653ac4 100644 --- a/mod/blocks.php +++ b/mod/blocks.php @@ -60,7 +60,7 @@ require_once ('include/conversation.php'); 'nickname' => $a->profile['channel_address'], 'lockstate' => (($group || $cid || $channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'), 'bang' => (($group || $cid) ? '!' : ''), - 'visitor' => 'block', + 'visitor' => true, 'mimetype' => 'choose', 'ptlabel' => t('Block Name'), 'profile_uid' => intval($owner), diff --git a/mod/channel.php b/mod/channel.php index 0551f2645..9ee82a682 100644 --- a/mod/channel.php +++ b/mod/channel.php @@ -115,7 +115,7 @@ function channel_content(&$a, $update = 0, $load = false) { 'acl' => (($is_owner) ? populate_acl($channel_acl) : ''), 'showacl' => (($is_owner) ? 'yes' : ''), 'bang' => '', - 'visitor' => (($is_owner || $observer) ? 'block' : 'none'), + 'visitor' => (($is_owner || $observer) ? true : false), 'profile_uid' => $a->profile['profile_uid'] ); diff --git a/mod/display.php b/mod/display.php index 0b7335028..f4d4c38c3 100644 --- a/mod/display.php +++ b/mod/display.php @@ -57,7 +57,7 @@ function display_content(&$a, $update = 0, $load = false) { 'acl' => populate_acl($channel_acl, false), 'bang' => '', - 'visitor' => 'block', + 'visitor' => true, 'profile_uid' => local_user(), 'return_path' => 'channel/' . $channel['channel_address'] ); diff --git a/mod/editblock.php b/mod/editblock.php index 8ccccc24b..8aca9e1f4 100644 --- a/mod/editblock.php +++ b/mod/editblock.php @@ -125,7 +125,7 @@ function editblock_content(&$a) { '$post_id' => $post_id, '$baseurl' => $a->get_baseurl(), '$defloc' => $channel['channel_location'], - '$visitor' => 'none', + '$visitor' => false, '$pvisit' => 'none', '$public' => t('Public post'), '$jotnets' => $jotnets, @@ -143,7 +143,7 @@ function editblock_content(&$a) { '$jotplugins' => $jotplugins, '$sourceapp' => $itm[0]['app'], '$defexpire' => '', - '$feature_expire' => 'none', + '$feature_expire' => false, '$expires' => t('Set expiration date'), )); diff --git a/mod/editlayout.php b/mod/editlayout.php index 838a219c9..4d0c00293 100644 --- a/mod/editlayout.php +++ b/mod/editlayout.php @@ -119,7 +119,7 @@ function editlayout_content(&$a) { '$post_id' => $post_id, '$baseurl' => $a->get_baseurl(), '$defloc' => $channel['channel_location'], - '$visitor' => 'none', + '$visitor' => false, '$pvisit' => 'none', '$public' => t('Public post'), '$jotnets' => $jotnets, @@ -137,7 +137,7 @@ function editlayout_content(&$a) { '$jotplugins' => $jotplugins, '$sourceapp' => t($a->sourcename), '$defexpire' => '', - '$feature_expire' => 'none', + '$feature_expire' => false, '$expires' => t('Set expiration date'), )); diff --git a/mod/editpost.php b/mod/editpost.php index 8c4117e7a..938c12083 100644 --- a/mod/editpost.php +++ b/mod/editpost.php @@ -125,7 +125,7 @@ function editpost_content(&$a) { '$post_id' => $post_id, '$baseurl' => $a->get_baseurl(), '$defloc' => $channel['channel_location'], - '$visitor' => 'none', + '$visitor' => false, '$pvisit' => 'none', '$public' => t('Public post'), '$jotnets' => $jotnets, @@ -143,9 +143,9 @@ function editpost_content(&$a) { '$sourceapp' => t($a->sourcename), '$catsenabled' => $catsenabled, '$defexpire' => datetime_convert('UTC', date_default_timezone_get(),$itm[0]['expires']), - '$feature_expire' => ((feature_enabled(get_app()->profile['profile_uid'],'content_expire') && (! $webpage)) ? 'block' : 'none'), + '$feature_expire' => ((feature_enabled(get_app()->profile['profile_uid'],'content_expire') && (! $webpage)) ? true : false), '$expires' => t('Set expiration date'), - '$feature_encrypt' => ((feature_enabled(get_app()->profile['profile_uid'],'content_encrypt') && (! $webpage)) ? 'block' : 'none'), + '$feature_encrypt' => ((feature_enabled(get_app()->profile['profile_uid'],'content_encrypt') && (! $webpage)) ? true : false), '$encrypt' => t('Encrypt text'), '$cipher' => $cipher, '$expiryModalOK' => t('OK'), diff --git a/mod/editwebpage.php b/mod/editwebpage.php index e9c8f5c37..5b6d91784 100644 --- a/mod/editwebpage.php +++ b/mod/editwebpage.php @@ -156,7 +156,7 @@ function editwebpage_content(&$a) { '$post_id' => $post_id, '$baseurl' => $a->get_baseurl(), '$defloc' => $itm[0]['location'], - '$visitor' => ($is_owner) ? 'block' : 'none', + '$visitor' => ($is_owner) ? true : false, '$acl' => populate_acl($itm[0]), '$showacl' => true, '$pvisit' => ($is_owner) ? 'block' : 'none', @@ -177,7 +177,7 @@ function editwebpage_content(&$a) { '$jotplugins' => $jotplugins, '$sourceapp' => t($a->sourcename), '$defexpire' => '', - '$feature_expire' => 'none', + '$feature_expire' => false, '$expires' => t('Set expiration date'), )); diff --git a/mod/layouts.php b/mod/layouts.php index 0dcaba361..3fbb63ed4 100644 --- a/mod/layouts.php +++ b/mod/layouts.php @@ -78,7 +78,7 @@ function layouts_content(&$a) { 'nickname' => $a->profile['channel_address'], 'lockstate' => (($group || $cid || $channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'), 'bang' => (($group || $cid) ? '!' : ''), - 'visitor' => 'none', + 'visitor' => false, 'nopreview' => 1, 'ptlabel' => t('Layout Name'), 'profile_uid' => intval($owner), diff --git a/mod/mail.php b/mod/mail.php index eb1b0ddc0..9c84872ef 100644 --- a/mod/mail.php +++ b/mod/mail.php @@ -222,9 +222,9 @@ function mail_content(&$a) { '$wait' => t('Please wait'), '$submit' => t('Submit'), '$defexpire' => '', - '$feature_expire' => ((feature_enabled(local_user(),'content_expire')) ? 'block' : 'none'), + '$feature_expire' => ((feature_enabled(local_user(),'content_expire')) ? true : false), '$expires' => t('Set expiration date'), - '$feature_encrypt' => ((feature_enabled(local_user(),'content_encrypt')) ? 'block' : 'none'), + '$feature_encrypt' => ((feature_enabled(local_user(),'content_encrypt')) ? true : false), '$encrypt' => t('Encrypt text'), '$cipher' => $cipher, @@ -335,9 +335,9 @@ function mail_content(&$a) { '$submit' => t('Submit'), '$wait' => t('Please wait'), '$defexpire' => '', - '$feature_expire' => ((feature_enabled(local_user(),'content_expire')) ? 'block' : 'none'), + '$feature_expire' => ((feature_enabled(local_user(),'content_expire')) ? true : false), '$expires' => t('Set expiration date'), - '$feature_encrypt' => ((feature_enabled(local_user(),'content_encrypt')) ? 'block' : 'none'), + '$feature_encrypt' => ((feature_enabled(local_user(),'content_encrypt')) ? true : false), '$encrypt' => t('Encrypt text'), '$cipher' => $cipher, diff --git a/mod/network.php b/mod/network.php index 8a05a5eaa..8202b1044 100644 --- a/mod/network.php +++ b/mod/network.php @@ -136,7 +136,7 @@ function network_content(&$a, $update = 0, $load = false) { 'lockstate' => (($group || $cid || $channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'), 'acl' => populate_acl((($group || $cid) ? $def_acl : $channel_acl)), 'bang' => (($group || $cid) ? '!' : ''), - 'visitor' => 'block', + 'visitor' => true, 'profile_uid' => local_user() ); diff --git a/mod/rpost.php b/mod/rpost.php index a9a864d5e..dc25444a3 100644 --- a/mod/rpost.php +++ b/mod/rpost.php @@ -107,7 +107,7 @@ function rpost_content(&$a) { 'acl' => populate_acl($channel, $false), 'bang' => '', // 'channel_select' => true, - 'visitor' => 'block', + 'visitor' => true, 'profile_uid' => local_user(), 'title' => $_REQUEST['title'], 'body' => $_REQUEST['body'], diff --git a/mod/webpages.php b/mod/webpages.php index ac9012ce1..6328454a6 100644 --- a/mod/webpages.php +++ b/mod/webpages.php @@ -85,7 +85,7 @@ function webpages_content(&$a) { 'lockstate' => (($group || $cid || $channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'), 'bang' => (($group || $cid) ? '!' : ''), 'acl' => ((local_user() && local_user() == $owner) ? populate_acl($channel_acl) : ''), - 'visitor' => 'block', + 'visitor' => true, 'profile_uid' => intval($owner), 'mimetype' => $mimetype, 'layout' => $layout, diff --git a/view/tpl/jot.tpl b/view/tpl/jot.tpl index 87a9b721f..b130818d0 100755 --- a/view/tpl/jot.tpl +++ b/view/tpl/jot.tpl @@ -36,33 +36,39 @@
- - - - - - - - + {{/if}}
diff --git a/view/tpl/prv_message.tpl b/view/tpl/prv_message.tpl index 3330a338f..118bd846f 100755 --- a/view/tpl/prv_message.tpl +++ b/view/tpl/prv_message.tpl @@ -37,14 +37,16 @@ - -
- -
-
+ {{if $feature_expire}} +
+ +
+ {{/if}} + {{if $feature_encrypt}} +
- + {{/if}}
-- cgit v1.2.3 From b52ccaa9e1163c0dcf13ea97c5b808dafb5ef3a1 Mon Sep 17 00:00:00 2001 From: marijus Date: Tue, 8 Apr 2014 22:37:58 +0200 Subject: whitespace cleanup --- view/tpl/jot.tpl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/view/tpl/jot.tpl b/view/tpl/jot.tpl index b130818d0..ab8a3f77b 100755 --- a/view/tpl/jot.tpl +++ b/view/tpl/jot.tpl @@ -74,11 +74,11 @@
- {{if $showacl}} -
- {{$bang}} -
- {{/if}} + {{if $showacl}} +
+ {{$bang}} +
+ {{/if}} {{if $preview}}
- {{$jotplugins}} + {{$jotplugins}}
-- cgit v1.2.3 From 74bd772a5bba5cd2c92e708d237128ab2dbdb53c Mon Sep 17 00:00:00 2001 From: marijus Date: Wed, 9 Apr 2014 17:10:07 +0200 Subject: replace lock icon with icon-{lock, unlock} --- view/css/conversation.css | 4 ---- view/js/acl.js | 16 ++-------------- view/js/mod_chat.js | 4 ++-- view/js/mod_filestorage.js | 4 ++-- view/js/mod_mitem.js | 4 ++-- view/js/mod_photos.js | 4 ++-- view/js/mod_settings.js | 4 ++-- view/theme/redbasic/css/style.css | 1 + view/tpl/jot.tpl | 8 +++----- view/tpl/photo_view.tpl | 2 +- view/tpl/photos_upload.tpl | 5 ++--- 11 files changed, 19 insertions(+), 37 deletions(-) diff --git a/view/css/conversation.css b/view/css/conversation.css index ee26bbf47..6fbc86df6 100644 --- a/view/css/conversation.css +++ b/view/css/conversation.css @@ -30,10 +30,6 @@ margin-top: 10px; } -#jot-perms-icon { - margin: 1px; -} - #profile-jot-perms-end { height: 30px; } diff --git a/view/js/acl.js b/view/js/acl.js index 6c3d9b462..308e65131 100644 --- a/view/js/acl.js +++ b/view/js/acl.js @@ -162,23 +162,11 @@ ACL.prototype.set_deny = function(itemid){ } ACL.prototype.update_view = function(){ - var jotpermslock; - var jotpermsunlock; - if (document.jotpermslock == null) { - jotpermslock = 'lock'; - } else { - jotpermslock = document.jotpermslock; - } - if (document.jotpermsunlock == null) { - jotpermsunlock = 'unlock'; - } else { - jotpermsunlock = document.jotpermsunlock; - } if (that.allow_gid.length==0 && that.allow_cid.length==0 && that.deny_gid.length==0 && that.deny_cid.length==0){ that.showall.addClass("selected"); /* jot acl */ - $('#jot-perms-icon').removeClass(jotpermslock).addClass(jotpermsunlock); + $('#jot-perms-icon').removeClass('icon-lock').addClass('icon-unlock'); $('#jot-public').show(); $('.profile-jot-net input').attr('disabled', false); if(typeof editor != 'undefined' && editor != false) { @@ -188,7 +176,7 @@ ACL.prototype.update_view = function(){ } else { that.showall.removeClass("selected"); /* jot acl */ - $('#jot-perms-icon').removeClass(jotpermsunlock).addClass(jotpermslock); + $('#jot-perms-icon').removeClass('icon-unlock').addClass('icon-lock'); $('#jot-public').hide(); $('.profile-jot-net input').attr('disabled', 'disabled'); $('#profile-jot-desc').html(' '); diff --git a/view/js/mod_chat.js b/view/js/mod_chat.js index 82957ae44..88c1cf7d8 100644 --- a/view/js/mod_chat.js +++ b/view/js/mod_chat.js @@ -4,11 +4,11 @@ $(document).ready(function() { var selstr; $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() { selstr = $(this).text(); - $('#jot-perms-icon').removeClass('unlock').addClass('lock'); + $('#jot-perms-icon').removeClass('icon-unlock').addClass('icon-lock'); $('#jot-public').hide(); }); if(selstr == null) { - $('#jot-perms-icon').removeClass('lock').addClass('unlock'); + $('#jot-perms-icon').removeClass('icon-lock').addClass('icon-unlock'); $('#jot-public').show(); } diff --git a/view/js/mod_filestorage.js b/view/js/mod_filestorage.js index 82957ae44..88c1cf7d8 100644 --- a/view/js/mod_filestorage.js +++ b/view/js/mod_filestorage.js @@ -4,11 +4,11 @@ $(document).ready(function() { var selstr; $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() { selstr = $(this).text(); - $('#jot-perms-icon').removeClass('unlock').addClass('lock'); + $('#jot-perms-icon').removeClass('icon-unlock').addClass('icon-lock'); $('#jot-public').hide(); }); if(selstr == null) { - $('#jot-perms-icon').removeClass('lock').addClass('unlock'); + $('#jot-perms-icon').removeClass('icon-lock').addClass('icon-unlock'); $('#jot-public').show(); } diff --git a/view/js/mod_mitem.js b/view/js/mod_mitem.js index d33713ee3..979a15297 100644 --- a/view/js/mod_mitem.js +++ b/view/js/mod_mitem.js @@ -10,11 +10,11 @@ $(document).ready(function() { var selstr; $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() { selstr = $(this).text(); - $('#jot-perms-icon').removeClass('unlock').addClass('lock'); + $('#jot-perms-icon').removeClass('icon-unlock').addClass('icon-lock'); $('#jot-public').hide(); }); if(selstr == null) { - $('#jot-perms-icon').removeClass('lock').addClass('unlock'); + $('#jot-perms-icon').removeClass('icon-lock').addClass('icon-unlock'); $('#jot-public').show(); } diff --git a/view/js/mod_photos.js b/view/js/mod_photos.js index d9497af1e..aaa86df40 100644 --- a/view/js/mod_photos.js +++ b/view/js/mod_photos.js @@ -17,11 +17,11 @@ $(document).ready(function() { var selstr; $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() { selstr = $(this).text(); - $('#jot-perms-icon').removeClass('unlock').addClass('lock'); + $('#jot-perms-icon').removeClass('icon-unlock').addClass('icon-lock'); $('#jot-public').hide(); }); if(selstr == null) { - $('#jot-perms-icon').removeClass('lock').addClass('unlock'); + $('#jot-perms-icon').removeClass('icon-lock').addClass('icon-unlock'); $('#jot-public').show(); } diff --git a/view/js/mod_settings.js b/view/js/mod_settings.js index 8cd062f43..fa788280d 100644 --- a/view/js/mod_settings.js +++ b/view/js/mod_settings.js @@ -12,11 +12,11 @@ $(document).ready(function() { var selstr; $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() { selstr = $(this).text(); - $('#jot-perms-icon').removeClass('unlock').addClass('lock'); + $('#jot-perms-icon').removeClass('icon-unlock').addClass('icon-lock'); $('#jot-public').hide(); }); if(selstr == null) { - $('#jot-perms-icon').removeClass('lock').addClass('unlock'); + $('#jot-perms-icon').removeClass('icon-lock').addClass('icon-unlock'); $('#jot-public').show(); } diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index d078d4473..6ee71a1bd 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -1896,6 +1896,7 @@ img.mail-list-sender-photo { color: #777; } +#jot-perms-icon, .jot-icons { color: $toolicon_colour; } diff --git a/view/tpl/jot.tpl b/view/tpl/jot.tpl index ab8a3f77b..b20644f49 100755 --- a/view/tpl/jot.tpl +++ b/view/tpl/jot.tpl @@ -70,14 +70,12 @@ {{/if}}
-
+
{{if $showacl}} -
- {{$bang}} -
+ {{$bang}} {{/if}} {{if $preview}}
-