change the way jot tools are displayed/hidden

This commit is contained in:
marijus 2014-04-08 22:07:06 +02:00
parent 95751dddff
commit 9f621dac85
15 changed files with 44 additions and 36 deletions

View File

@ -1144,9 +1144,9 @@ function status_editor($a,$x,$popup=false) {
'$source' => ((x($x,'source')) ? $x['source'] : ''), '$source' => ((x($x,'source')) ? $x['source'] : ''),
'$jotplugins' => $jotplugins, '$jotplugins' => $jotplugins,
'$defexpire' => '', '$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'), '$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'), '$encrypt' => t('Encrypt text'),
'$cipher' => $cipher, '$cipher' => $cipher,
'$expiryModalOK' => t('OK'), '$expiryModalOK' => t('OK'),

View File

@ -60,7 +60,7 @@ require_once ('include/conversation.php');
'nickname' => $a->profile['channel_address'], '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'), 'lockstate' => (($group || $cid || $channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
'bang' => (($group || $cid) ? '!' : ''), 'bang' => (($group || $cid) ? '!' : ''),
'visitor' => 'block', 'visitor' => true,
'mimetype' => 'choose', 'mimetype' => 'choose',
'ptlabel' => t('Block Name'), 'ptlabel' => t('Block Name'),
'profile_uid' => intval($owner), 'profile_uid' => intval($owner),

View File

@ -115,7 +115,7 @@ function channel_content(&$a, $update = 0, $load = false) {
'acl' => (($is_owner) ? populate_acl($channel_acl) : ''), 'acl' => (($is_owner) ? populate_acl($channel_acl) : ''),
'showacl' => (($is_owner) ? 'yes' : ''), 'showacl' => (($is_owner) ? 'yes' : ''),
'bang' => '', 'bang' => '',
'visitor' => (($is_owner || $observer) ? 'block' : 'none'), 'visitor' => (($is_owner || $observer) ? true : false),
'profile_uid' => $a->profile['profile_uid'] 'profile_uid' => $a->profile['profile_uid']
); );

View File

@ -57,7 +57,7 @@ function display_content(&$a, $update = 0, $load = false) {
'acl' => populate_acl($channel_acl, false), 'acl' => populate_acl($channel_acl, false),
'bang' => '', 'bang' => '',
'visitor' => 'block', 'visitor' => true,
'profile_uid' => local_user(), 'profile_uid' => local_user(),
'return_path' => 'channel/' . $channel['channel_address'] 'return_path' => 'channel/' . $channel['channel_address']
); );

View File

@ -125,7 +125,7 @@ function editblock_content(&$a) {
'$post_id' => $post_id, '$post_id' => $post_id,
'$baseurl' => $a->get_baseurl(), '$baseurl' => $a->get_baseurl(),
'$defloc' => $channel['channel_location'], '$defloc' => $channel['channel_location'],
'$visitor' => 'none', '$visitor' => false,
'$pvisit' => 'none', '$pvisit' => 'none',
'$public' => t('Public post'), '$public' => t('Public post'),
'$jotnets' => $jotnets, '$jotnets' => $jotnets,
@ -143,7 +143,7 @@ function editblock_content(&$a) {
'$jotplugins' => $jotplugins, '$jotplugins' => $jotplugins,
'$sourceapp' => $itm[0]['app'], '$sourceapp' => $itm[0]['app'],
'$defexpire' => '', '$defexpire' => '',
'$feature_expire' => 'none', '$feature_expire' => false,
'$expires' => t('Set expiration date'), '$expires' => t('Set expiration date'),
)); ));

View File

@ -119,7 +119,7 @@ function editlayout_content(&$a) {
'$post_id' => $post_id, '$post_id' => $post_id,
'$baseurl' => $a->get_baseurl(), '$baseurl' => $a->get_baseurl(),
'$defloc' => $channel['channel_location'], '$defloc' => $channel['channel_location'],
'$visitor' => 'none', '$visitor' => false,
'$pvisit' => 'none', '$pvisit' => 'none',
'$public' => t('Public post'), '$public' => t('Public post'),
'$jotnets' => $jotnets, '$jotnets' => $jotnets,
@ -137,7 +137,7 @@ function editlayout_content(&$a) {
'$jotplugins' => $jotplugins, '$jotplugins' => $jotplugins,
'$sourceapp' => t($a->sourcename), '$sourceapp' => t($a->sourcename),
'$defexpire' => '', '$defexpire' => '',
'$feature_expire' => 'none', '$feature_expire' => false,
'$expires' => t('Set expiration date'), '$expires' => t('Set expiration date'),
)); ));

View File

@ -125,7 +125,7 @@ function editpost_content(&$a) {
'$post_id' => $post_id, '$post_id' => $post_id,
'$baseurl' => $a->get_baseurl(), '$baseurl' => $a->get_baseurl(),
'$defloc' => $channel['channel_location'], '$defloc' => $channel['channel_location'],
'$visitor' => 'none', '$visitor' => false,
'$pvisit' => 'none', '$pvisit' => 'none',
'$public' => t('Public post'), '$public' => t('Public post'),
'$jotnets' => $jotnets, '$jotnets' => $jotnets,
@ -143,9 +143,9 @@ function editpost_content(&$a) {
'$sourceapp' => t($a->sourcename), '$sourceapp' => t($a->sourcename),
'$catsenabled' => $catsenabled, '$catsenabled' => $catsenabled,
'$defexpire' => datetime_convert('UTC', date_default_timezone_get(),$itm[0]['expires']), '$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'), '$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'), '$encrypt' => t('Encrypt text'),
'$cipher' => $cipher, '$cipher' => $cipher,
'$expiryModalOK' => t('OK'), '$expiryModalOK' => t('OK'),

View File

@ -156,7 +156,7 @@ function editwebpage_content(&$a) {
'$post_id' => $post_id, '$post_id' => $post_id,
'$baseurl' => $a->get_baseurl(), '$baseurl' => $a->get_baseurl(),
'$defloc' => $itm[0]['location'], '$defloc' => $itm[0]['location'],
'$visitor' => ($is_owner) ? 'block' : 'none', '$visitor' => ($is_owner) ? true : false,
'$acl' => populate_acl($itm[0]), '$acl' => populate_acl($itm[0]),
'$showacl' => true, '$showacl' => true,
'$pvisit' => ($is_owner) ? 'block' : 'none', '$pvisit' => ($is_owner) ? 'block' : 'none',
@ -177,7 +177,7 @@ function editwebpage_content(&$a) {
'$jotplugins' => $jotplugins, '$jotplugins' => $jotplugins,
'$sourceapp' => t($a->sourcename), '$sourceapp' => t($a->sourcename),
'$defexpire' => '', '$defexpire' => '',
'$feature_expire' => 'none', '$feature_expire' => false,
'$expires' => t('Set expiration date'), '$expires' => t('Set expiration date'),
)); ));

View File

@ -78,7 +78,7 @@ function layouts_content(&$a) {
'nickname' => $a->profile['channel_address'], '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'), 'lockstate' => (($group || $cid || $channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
'bang' => (($group || $cid) ? '!' : ''), 'bang' => (($group || $cid) ? '!' : ''),
'visitor' => 'none', 'visitor' => false,
'nopreview' => 1, 'nopreview' => 1,
'ptlabel' => t('Layout Name'), 'ptlabel' => t('Layout Name'),
'profile_uid' => intval($owner), 'profile_uid' => intval($owner),

View File

@ -222,9 +222,9 @@ function mail_content(&$a) {
'$wait' => t('Please wait'), '$wait' => t('Please wait'),
'$submit' => t('Submit'), '$submit' => t('Submit'),
'$defexpire' => '', '$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'), '$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'), '$encrypt' => t('Encrypt text'),
'$cipher' => $cipher, '$cipher' => $cipher,
@ -335,9 +335,9 @@ function mail_content(&$a) {
'$submit' => t('Submit'), '$submit' => t('Submit'),
'$wait' => t('Please wait'), '$wait' => t('Please wait'),
'$defexpire' => '', '$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'), '$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'), '$encrypt' => t('Encrypt text'),
'$cipher' => $cipher, '$cipher' => $cipher,

View File

@ -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'), '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)), 'acl' => populate_acl((($group || $cid) ? $def_acl : $channel_acl)),
'bang' => (($group || $cid) ? '!' : ''), 'bang' => (($group || $cid) ? '!' : ''),
'visitor' => 'block', 'visitor' => true,
'profile_uid' => local_user() 'profile_uid' => local_user()
); );

View File

@ -107,7 +107,7 @@ function rpost_content(&$a) {
'acl' => populate_acl($channel, $false), 'acl' => populate_acl($channel, $false),
'bang' => '', 'bang' => '',
// 'channel_select' => true, // 'channel_select' => true,
'visitor' => 'block', 'visitor' => true,
'profile_uid' => local_user(), 'profile_uid' => local_user(),
'title' => $_REQUEST['title'], 'title' => $_REQUEST['title'],
'body' => $_REQUEST['body'], 'body' => $_REQUEST['body'],

View File

@ -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'), 'lockstate' => (($group || $cid || $channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
'bang' => (($group || $cid) ? '!' : ''), 'bang' => (($group || $cid) ? '!' : ''),
'acl' => ((local_user() && local_user() == $owner) ? populate_acl($channel_acl) : ''), 'acl' => ((local_user() && local_user() == $owner) ? populate_acl($channel_acl) : ''),
'visitor' => 'block', 'visitor' => true,
'profile_uid' => intval($owner), 'profile_uid' => intval($owner),
'mimetype' => $mimetype, 'mimetype' => $mimetype,
'layout' => $layout, 'layout' => $layout,

View File

@ -36,33 +36,39 @@
</div> </div>
<div id="profile-jot-submit-wrapper" class="jothidden"> <div id="profile-jot-submit-wrapper" class="jothidden">
<div id="profile-jot-submit-left" class="btn-group pull-left"> <div id="profile-jot-submit-left" class="btn-group pull-left">
<button id="wall-image-upload" class="btn btn-default btn-sm" title="{{$upload}}" style="display: {{$visitor}};" > {{if $visitor}}
<button id="wall-image-upload" class="btn btn-default btn-sm" title="{{$upload}}" >
<i class="icon-camera jot-icons"></i> <i class="icon-camera jot-icons"></i>
</button> </button>
<button id="wall-file-upload" class="btn btn-default btn-sm" title="{{$attach}}" style="display: {{$visitor}};" > <button id="wall-file-upload" class="btn btn-default btn-sm" title="{{$attach}}" >
<i id="wall-file-upload" class="icon-paper-clip jot-icons"></i> <i id="wall-file-upload" class="icon-paper-clip jot-icons"></i>
</button> </button>
<button id="profile-link-wrapper" class="btn btn-default btn-sm" style="display: {{$visitor}};" title="{{$weblink}}" ondragenter="linkdropper(event);" ondragover="linkdropper(event);" ondrop="linkdrop(event);" onclick="jotGetLink(); return false;"> <button id="profile-link-wrapper" class="btn btn-default btn-sm" title="{{$weblink}}" ondragenter="linkdropper(event);" ondragover="linkdropper(event);" ondrop="linkdrop(event);" onclick="jotGetLink(); return false;">
<i id="profile-link" class="icon-link jot-icons"></i> <i id="profile-link" class="icon-link jot-icons"></i>
</button> </button>
<button id="profile-video-wrapper" class="btn btn-default btn-sm" style="display: {{$visitor}};" title="{{$video}}" onclick="jotVideoURL();return false;"> <button id="profile-video-wrapper" class="btn btn-default btn-sm" title="{{$video}}" onclick="jotVideoURL();return false;">
<i id="profile-video" class="icon-facetime-video jot-icons"></i> <i id="profile-video" class="icon-facetime-video jot-icons"></i>
</button> </button>
<button id="profile-audio-wrapper" class="btn btn-default btn-sm" style="display: {{$visitor}};" title="{{$audio}}" onclick="jotAudioURL();return false;"> <button id="profile-audio-wrapper" class="btn btn-default btn-sm" title="{{$audio}}" onclick="jotAudioURL();return false;">
<i id="profile-audio" class="icon-volume-up jot-icons"></i> <i id="profile-audio" class="icon-volume-up jot-icons"></i>
</button> </button>
<button id="profile-nolocation-wrapper" class="btn btn-default btn-sm" style="display: none;" title="{{$noloc}}" onclick="jotClearLocation();return false;"> <button id="profile-nolocation-wrapper" class="btn btn-default btn-sm" style="display: none;" title="{{$noloc}}" onclick="jotClearLocation();return false;">
<i id="profile-nolocation" class="icon-circle-blank jot-icons"></i> <i id="profile-nolocation" class="icon-circle-blank jot-icons"></i>
</button> </button>
<button id="profile-location-wrapper" class="btn btn-default btn-sm" style="display: {{$visitor}};" title="{{$setloc}}" onclick="jotGetLocation();return false;"> <button id="profile-location-wrapper" class="btn btn-default btn-sm" title="{{$setloc}}" onclick="jotGetLocation();return false;">
<i id="profile-location" class="icon-globe jot-icons"></i> <i id="profile-location" class="icon-globe jot-icons"></i>
</button> </button>
<button id="profile-expire-wrapper" class="btn btn-default btn-sm" style="display: {{$feature_expire}};" title="{{$expires}}" onclick="jotGetExpiry();return false;"> {{/if}}
{{if $feature_expire}}
<button id="profile-expire-wrapper" class="btn btn-default btn-sm" title="{{$expires}}" onclick="jotGetExpiry();return false;">
<i id="profile-expires" class="icon-eraser jot-icons"></i> <i id="profile-expires" class="icon-eraser jot-icons"></i>
</button> </button>
<button id="profile-encrypt-wrapper" class="btn btn-default btn-sm" style="display: {{$feature_encrypt}};" title="{{$encrypt}}" onclick="red_encrypt('{{$cipher}}','#profile-jot-text',$('#profile-jot-text').val());return false;"> {{/if}}
{{if $feature_encrypt}}
<button id="profile-encrypt-wrapper" class="btn btn-default btn-sm" title="{{$encrypt}}" onclick="red_encrypt('{{$cipher}}','#profile-jot-text',$('#profile-jot-text').val());return false;">
<i id="profile-encrypt" class="icon-key jot-icons"></i> <i id="profile-encrypt" class="icon-key jot-icons"></i>
</button> </button>
{{/if}}
</div> </div>
<div id="profile-rotator-wrapper" style="display: {{$visitor}};" > <div id="profile-rotator-wrapper" style="display: {{$visitor}};" >
<div id="profile-rotator"></div> <div id="profile-rotator"></div>

View File

@ -37,14 +37,16 @@
<div id="prvmail-link-wrapper" > <div id="prvmail-link-wrapper" >
<i id="prvmail-link" class="icon-link jot-icons" title="{{$insert}}" onclick="jotGetLink(); return false;"></i> <i id="prvmail-link" class="icon-link jot-icons" title="{{$insert}}" onclick="jotGetLink(); return false;"></i>
</div> </div>
{{if $feature_expire}}
<div id="prvmail-expire-wrapper" style="display: {{$feature_expire}};" > <div id="prvmail-expire-wrapper" >
<i id="prvmail-expires" class="icon-eraser jot-icons" title="{{$expires}}" onclick="prvmailGetExpiry();return false;"></i> <i id="prvmail-expires" class="icon-eraser jot-icons" title="{{$expires}}" onclick="prvmailGetExpiry();return false;"></i>
</div> </div>
<div id="prvmail-encrypt-wrapper" style="display: {{$feature_encrypt}};" > {{/if}}
{{if $feature_encrypt}}
<div id="prvmail-encrypt-wrapper" >
<i id="prvmail-encrypt" class="icon-key jot-icons" title="{{$encrypt}}" onclick="red_encrypt('{{$cipher}}','#prvmail-text',$('#prvmail-text').val());return false;"></i> <i id="prvmail-encrypt" class="icon-key jot-icons" title="{{$encrypt}}" onclick="red_encrypt('{{$cipher}}','#prvmail-text',$('#prvmail-text').val());return false;"></i>
</div> </div>
{{/if}}
<div id="prvmail-rotator-wrapper" > <div id="prvmail-rotator-wrapper" >
<img id="prvmail-rotator" src="images/rotator.gif" alt="{{$wait}}" title="{{$wait}}" style="display: none;" /> <img id="prvmail-rotator" src="images/rotator.gif" alt="{{$wait}}" title="{{$wait}}" style="display: none;" />
</div> </div>