diff options
author | DM42.Net Hubzilla Development <hzdev@dm42.net> | 2019-11-28 00:27:12 -0500 |
---|---|---|
committer | DM42.Net Hubzilla Development <hzdev@dm42.net> | 2019-11-28 00:27:12 -0500 |
commit | c86b35da701674510a97ccc21e46581bd864cc31 (patch) | |
tree | 840a17f2f4a39e627578fe2bbc9c518cc04ab790 | |
parent | b2003e2c3cac231f92a23331bdbd21721403d4c9 (diff) | |
download | volse-hubzilla-c86b35da701674510a97ccc21e46581bd864cc31.tar.gz volse-hubzilla-c86b35da701674510a97ccc21e46581bd864cc31.tar.bz2 volse-hubzilla-c86b35da701674510a97ccc21e46581bd864cc31.zip |
Move auto_save_draft to header from thread comment
-rw-r--r-- | Zotlabs/Lib/ThreadItem.php | 5 | ||||
-rw-r--r-- | Zotlabs/Module/Photos.php | 4 | ||||
-rwxr-xr-x | boot.php | 3 | ||||
-rwxr-xr-x | view/tpl/comment_item.tpl | 3 | ||||
-rwxr-xr-x | view/tpl/head.tpl | 1 |
5 files changed, 5 insertions, 11 deletions
diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php index 0f59953dc..32cd52751 100644 --- a/Zotlabs/Lib/ThreadItem.php +++ b/Zotlabs/Lib/ThreadItem.php @@ -789,8 +789,6 @@ class ThreadItem { call_hooks('comment_buttons',$arr); $comment_buttons = $arr['comment_buttons']; - $feature_auto_save_draft = ((feature_enabled($conv->get_profile_owner(), 'auto_save_draft')) ? "true" : "false"); - $comment_box = replace_macros($template,array( '$return_path' => '', '$threaded' => $this->is_threaded(), @@ -825,8 +823,7 @@ class ThreadItem { '$anoncomments' => ((($conv->get_mode() === 'channel' || $conv->get_mode() === 'display') && perm_is_allowed($conv->get_profile_owner(),'','post_comments')) ? true : false), '$anonname' => [ 'anonname', t('Your full name (required)') ], '$anonmail' => [ 'anonmail', t('Your email address (required)') ], - '$anonurl' => [ 'anonurl', t('Your website URL (optional)') ], - '$auto_save_draft' => $feature_auto_save_draft + '$anonurl' => [ 'anonurl', t('Your website URL (optional)') ] )); return $comment_box; diff --git a/Zotlabs/Module/Photos.php b/Zotlabs/Module/Photos.php index 13ec64ab9..43c9f86ee 100644 --- a/Zotlabs/Module/Photos.php +++ b/Zotlabs/Module/Photos.php @@ -1080,7 +1080,6 @@ class Photos extends \Zotlabs\Web\Controller { $comments = ''; if(! $r) { if($observer && ($can_post || $can_comment)) { - $feature_auto_save_draft = ((feature_enabled($owner_uid, 'auto_save_draft')) ? "true" : "false"); $commentbox = replace_macros($cmnt_tpl,array( '$return_path' => '', '$mode' => 'photos', @@ -1096,8 +1095,7 @@ class Photos extends \Zotlabs\Web\Controller { '$submit' => t('Submit'), '$preview' => t('Preview'), '$ww' => '', - '$feature_encrypt' => false, - '$auto_save_draft' => $feature_auto_save_draft + '$feature_encrypt' => false )); } } @@ -1205,7 +1205,8 @@ class App { '$linkrel' => head_get_links(), '$js_strings' => js_strings(), '$zid' => get_my_address(), - '$channel_id' => self::$profile['uid'] + '$channel_id' => self::$profile['uid'], + '$auto_save_draft' => ((feature_enabled(self::$profile['uid'], 'auto_save_draft')) ? "true" : "false") ] ) . self::$page['htmlhead']; diff --git a/view/tpl/comment_item.tpl b/view/tpl/comment_item.tpl index 23594677c..3b51971ec 100755 --- a/view/tpl/comment_item.tpl +++ b/view/tpl/comment_item.tpl @@ -1,6 +1,3 @@ - <script> - var auto_save_draft = {{$auto_save_draft}}; - </script> {{if $threaded}} <div class="comment-wwedit-wrapper threaded" id="comment-edit-wrapper-{{$id}}" style="display: block;"> {{else}} diff --git a/view/tpl/head.tpl b/view/tpl/head.tpl index 5f874426c..bd4cf3747 100755 --- a/view/tpl/head.tpl +++ b/view/tpl/head.tpl @@ -15,6 +15,7 @@ {{if $channel_hash}}var channelHash = '{{$channel_hash}}';{{/if}} {{if $channel_id}}var channelId = '{{$channel_id}}';{{/if}}{{* Used in e.g. autocomplete *}} var preloadImages = {{$preload_images}}; + var auto_save_draft = {{$auto_save_draft}}; </script> |