aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-08-01 18:05:04 -0700
committerzotlabs <mike@macgirvin.com>2017-08-01 18:05:04 -0700
commita97b09210e977d52a5bda1dee2b1eddc19afc013 (patch)
tree98ae52f892549b6c0464243dc3b8a3caedd1e585
parent9476c631b0f9ba52be869b0c430fea81f4202352 (diff)
downloadvolse-hubzilla-a97b09210e977d52a5bda1dee2b1eddc19afc013.tar.gz
volse-hubzilla-a97b09210e977d52a5bda1dee2b1eddc19afc013.tar.bz2
volse-hubzilla-a97b09210e977d52a5bda1dee2b1eddc19afc013.zip
auto preview when inserting a media item or embed into a post. Since this unanticipated action could be alarming (some might think the post was actually submitted), also provide a visible preview indicator within the previewed content. Remove the css for the old striped background image which hasn't been available for previewed content for a year or two.
-rw-r--r--Zotlabs/Lib/ThreadItem.php1
-rw-r--r--include/conversation.php2
-rw-r--r--view/theme/redbasic/css/style.css3
-rwxr-xr-xview/tpl/conv_item.tpl1
-rwxr-xr-xview/tpl/jot-header.tpl2
-rwxr-xr-xview/tpl/search_item.tpl1
6 files changed, 8 insertions, 2 deletions
diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php
index 72d8af4dd..9ee16480a 100644
--- a/Zotlabs/Lib/ThreadItem.php
+++ b/Zotlabs/Lib/ThreadItem.php
@@ -407,6 +407,7 @@ class ThreadItem {
'showdislike' => $showdislike,
'comment' => $this->get_comment_box($indent),
'previewing' => ($conv->is_preview() ? true : false ),
+ 'preview_lbl' => t('This is an unsaved preview'),
'wait' => t('Please wait'),
'submid' => str_replace(['+','='], ['',''], base64_encode(substr($item['mid'],0,32))),
'thread_level' => $thread_level
diff --git a/include/conversation.php b/include/conversation.php
index 1c1a4479d..460c97efb 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -467,6 +467,7 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
$preview = (($page_mode === 'preview') ? true : false);
$previewing = (($preview) ? ' preview ' : '');
+ $preview_lbl = t('This is an unsaved preview');
if ($mode === 'network') {
@@ -684,6 +685,7 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
'mode' => $mode,
'approve' => t('Approve'),
'delete' => t('Delete'),
+ 'preview_lbl' => $preview_lbl,
'id' => (($preview) ? 'P0' : $item['item_id']),
'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, $profile_url),
'profile_url' => $profile_link,
diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css
index 2c881049e..17956ef31 100644
--- a/view/theme/redbasic/css/style.css
+++ b/view/theme/redbasic/css/style.css
@@ -251,8 +251,7 @@ footer {
margin-top: 15px;
}
-.preview {
- background: url('../img/gray_and_white_diagonal_stripes_background_seamless.gif');
+.preview-indicator {
}
#theme-preview {
diff --git a/view/tpl/conv_item.tpl b/view/tpl/conv_item.tpl
index 36cb4cc83..663b02890 100755
--- a/view/tpl/conv_item.tpl
+++ b/view/tpl/conv_item.tpl
@@ -39,6 +39,7 @@
</div>
{{/if}}
<div class="wall-item-author">
+ {{if $item.previewing}}<span class="preview-indicator"><i class="fa fa-eye" title="{{$item.preview_lbl}}"></i></span>&nbsp;{{/if}}
<a href="{{$item.profile_url}}" title="{{$item.linktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$item.sparkle}}" id="wall-item-name-{{$item.id}}" >{{$item.name}}</span></a>{{if $item.owner_url}}&nbsp;{{$item.via}}&nbsp;<a href="{{$item.owner_url}}" title="{{$item.olinktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$item.osparkle}}" id="wall-item-ownername-{{$item.id}}">{{$item.owner_name}}</span></a>{{/if}}
</div>
<div class="wall-item-ago" id="wall-item-ago-{{$item.id}}">
diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl
index d8f296aa4..8adef6427 100755
--- a/view/tpl/jot-header.tpl
+++ b/view/tpl/jot-header.tpl
@@ -126,6 +126,7 @@ function enableOnUser(){
$('#jot-media').val($('#jot-media').val() + data.result.message);
},
stop: function(e,data) {
+ preview_post();
$('#profile-rotator').spin(false);
},
});
@@ -175,6 +176,7 @@ function enableOnUser(){
$('#profile-rotator').spin('tiny');
$.get('{{$baseurl}}/linkinfo?f=&binurl=' + reply, function(data) {
addeditortext(data);
+ preview_post();
$('#profile-rotator').spin(false);
});
}
diff --git a/view/tpl/search_item.tpl b/view/tpl/search_item.tpl
index 4ca6378b8..28667eb58 100755
--- a/view/tpl/search_item.tpl
+++ b/view/tpl/search_item.tpl
@@ -32,6 +32,7 @@
</div>
{{/if}}
<div class="wall-item-author">
+ {{if $item.previewing}}<span class="preview-indicator"><i class="fa fa-eye" title="{{$item.preview_lbl}}"></i></span>&nbsp;{{/if}}
<a href="{{$item.profile_url}}" title="{{$item.linktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$item.sparkle}}" id="wall-item-name-{{$item.id}}" >{{$item.name}}</span></a>{{if $item.owner_url}}&nbsp;{{$item.via}}&nbsp;<a href="{{$item.owner_url}}" title="{{$item.olinktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$item.osparkle}}" id="wall-item-ownername-{{$item.id}}">{{$item.owner_name}}</span></a>{{/if}}
</div>
<div class="wall-item-ago" id="wall-item-ago-{{$item.id}}">