From 04ec35d9cc39cbf62c8db2818574c1f6d56f2a20 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 25 Feb 2018 19:25:00 -0800 Subject: hubzilla issue #979 - alter image selection widget to accept/submit on choose (jot, wiki, cover_photo, profile_photo) --- view/js/mod_cover_photo.js | 23 ++++++++++------------- view/js/mod_profile_photo.js | 23 ++++++++++------------- view/tpl/cover_photo.tpl | 4 ---- view/tpl/jot-header.tpl | 20 ++++++++------------ view/tpl/jot.tpl | 4 ---- view/tpl/profile_photo.tpl | 6 ------ view/tpl/wiki.tpl | 41 +++++++++++++++++------------------------ 7 files changed, 45 insertions(+), 76 deletions(-) diff --git a/view/js/mod_cover_photo.js b/view/js/mod_cover_photo.js index b9af8ce5c..5b64b8b91 100644 --- a/view/js/mod_cover_photo.js +++ b/view/js/mod_cover_photo.js @@ -27,13 +27,7 @@ if (typeof($(image).parent()[0]) !== 'undefined') { var imageparent = document.getElementById($(image).parent()[0].id); $(imageparent).toggleClass('embed-photo-selected-photo'); - } - }); - $('#embedPhotoModalBodyAlbumListDialog').addClass('d-none'); - $('#embedPhotoModalBodyAlbumDialog').removeClass('d-none'); - $('#embed-photo-OKButton').click(function () { - $('.embed-photo-selected-photo').each(function (index) { - var href = $(this).attr('href'); + var href = $(imageparent).attr('href'); $.post("embedphotos/photolink", {href: href}, function(ddata) { if (ddata['status']) { @@ -42,13 +36,16 @@ window.console.log("{{$modalerrorlink}}" + ':' + ddata['errormsg']); } return false; - }, - 'json'); - }); - $('#embedPhotoModalBodyAlbumDialog').html(''); - $('#embedPhotoModalBodyAlbumDialog').off('click'); - $('#embedPhotoModal').modal('hide'); + }, + 'json'); + $('#embedPhotoModalBodyAlbumDialog').html(''); + $('#embedPhotoModalBodyAlbumDialog').off('click'); + $('#embedPhotoModal').modal('hide'); + } }); + + $('#embedPhotoModalBodyAlbumListDialog').addClass('d-none'); + $('#embedPhotoModalBodyAlbumDialog').removeClass('d-none'); } else { window.console.log("{{$modalerroralbum}} " + JSON.stringify(album) + ':' + data['errormsg']); } diff --git a/view/js/mod_profile_photo.js b/view/js/mod_profile_photo.js index 832da764b..c05c8e25e 100644 --- a/view/js/mod_profile_photo.js +++ b/view/js/mod_profile_photo.js @@ -27,13 +27,7 @@ if (typeof($(image).parent()[0]) !== 'undefined') { var imageparent = document.getElementById($(image).parent()[0].id); $(imageparent).toggleClass('embed-photo-selected-photo'); - } - }); - $('#embedPhotoModalBodyAlbumListDialog').addClass('d-none'); - $('#embedPhotoModalBodyAlbumDialog').removeClass('d-none'); - $('#embed-photo-OKButton').click(function () { - $('.embed-photo-selected-photo').each(function (index) { - var href = $(this).attr('href'); + var href = $(imageparent).attr('href'); $.post("embedphotos/photolink", {href: href}, function(ddata) { if (ddata['status']) { @@ -44,13 +38,16 @@ window.console.log("{{$modalerrorlink}}" + ':' + ddata['errormsg']); } return false; - }, - 'json'); - }); - $('#embedPhotoModalBodyAlbumDialog').html(''); - $('#embedPhotoModalBodyAlbumDialog').off('click'); - $('#embedPhotoModal').modal('hide'); + }, + 'json'); + $('#embedPhotoModalBodyAlbumDialog').html(''); + $('#embedPhotoModalBodyAlbumDialog').off('click'); + $('#embedPhotoModal').modal('hide'); + } }); + + $('#embedPhotoModalBodyAlbumListDialog').addClass('d-none'); + $('#embedPhotoModalBodyAlbumDialog').removeClass('d-none'); } else { window.console.log("{{$modalerroralbum}} " + JSON.stringify(album) + ':' + data['errormsg']); } diff --git a/view/tpl/cover_photo.tpl b/view/tpl/cover_photo.tpl index 7ad4482e4..cbcf46320 100755 --- a/view/tpl/cover_photo.tpl +++ b/view/tpl/cover_photo.tpl @@ -41,10 +41,6 @@
- diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl index 0ffc8b349..c1dab52d5 100755 --- a/view/tpl/jot-header.tpl +++ b/view/tpl/jot-header.tpl @@ -459,13 +459,7 @@ var activeCommentText = ''; if (typeof($(image).parent()[0]) !== 'undefined') { var imageparent = document.getElementById($(image).parent()[0].id); $(imageparent).toggleClass('embed-photo-selected-photo'); - } - }); - $('#embedPhotoModalBodyAlbumListDialog').addClass('d-none'); - $('#embedPhotoModalBodyAlbumDialog').removeClass('d-none'); - $('#embed-photo-OKButton').click(function () { - $('.embed-photo-selected-photo').each(function (index) { - var href = $(this).attr('href'); + var href = $(imageparent).attr('href'); $.post("embedphotos/photolink", {href: href}, function(ddata) { if (ddata['status']) { @@ -476,12 +470,14 @@ var activeCommentText = ''; } return false; }, - 'json'); - }); - $('#embedPhotoModalBodyAlbumDialog').html(''); - $('#embedPhotoModalBodyAlbumDialog').off('click'); - $('#embedPhotoModal').modal('hide'); + 'json'); + $('#embedPhotoModalBodyAlbumDialog').html(''); + $('#embedPhotoModalBodyAlbumDialog').off('click'); + $('#embedPhotoModal').modal('hide'); + } }); + $('#embedPhotoModalBodyAlbumListDialog').addClass('d-none'); + $('#embedPhotoModalBodyAlbumDialog').removeClass('d-none'); } else { window.console.log("{{$modalerroralbum}} " + JSON.stringify(album) + ':' + data['errormsg']); } diff --git a/view/tpl/jot.tpl b/view/tpl/jot.tpl index 13e7602be..bc9339d4c 100755 --- a/view/tpl/jot.tpl +++ b/view/tpl/jot.tpl @@ -293,10 +293,6 @@
- diff --git a/view/tpl/profile_photo.tpl b/view/tpl/profile_photo.tpl index 832f135f3..edde6af3f 100755 --- a/view/tpl/profile_photo.tpl +++ b/view/tpl/profile_photo.tpl @@ -35,8 +35,6 @@
{{/if}} - -
@@ -65,10 +63,6 @@
- diff --git a/view/tpl/wiki.tpl b/view/tpl/wiki.tpl index f1ab1ebad..2be323deb 100644 --- a/view/tpl/wiki.tpl +++ b/view/tpl/wiki.tpl @@ -91,10 +91,6 @@
- @@ -391,16 +387,10 @@ if (typeof($(image).parent()[0]) !== 'undefined') { var imageparent = document.getElementById($(image).parent()[0].id); $(imageparent).toggleClass('embed-photo-selected-photo'); - } - }); - $('#embedPhotoModalBodyAlbumListDialog').addClass('d-none'); - $('#embedPhotoModalBodyAlbumDialog').removeClass('d-none'); - $('#embed-photo-OKButton').click(function () { - $('.embed-photo-selected-photo').each(function (index) { - var href = $(this).attr('href'); - $.post("embedphotos/photolink", {href: href}, - function(ddata) { - if (ddata['status']) { + var href = $(imageparent).attr('href'); + $.post("embedphotos/photolink", {href: href}, + function(ddata) { + if (ddata['status']) { {{if !$mimeType || $mimeType == 'text/markdown'}} var imgURL = ddata['photolink'].replace( /\[.*\]\[.*\](.*)\[.*\]\[.*\]/, '\n![image]($1)' ) editor.getSession().insert(editor.getCursorPosition(), imgURL) @@ -408,17 +398,20 @@ var currentContent = $('#editor').val(); $('#editor').val(currentContent + ddata['photolink']); {{/if}} - } else { - window.console.log("{{$modalerrorlink}}" + ':' + ddata['errormsg']); - } - return false; + } else { + window.console.log("{{$modalerrorlink}}" + ':' + ddata['errormsg']); + } + return false; }, - 'json'); - }); - $('#embedPhotoModalBodyAlbumDialog').html(''); - $('#embedPhotoModalBodyAlbumDialog').off('click'); - $('#embedPhotoModal').modal('hide'); - }); + 'json'); + $('#embedPhotoModalBodyAlbumDialog').html(''); + $('#embedPhotoModalBodyAlbumDialog').off('click'); + $('#embedPhotoModal').modal('hide'); + } + }); + + $('#embedPhotoModalBodyAlbumListDialog').addClass('d-none'); + $('#embedPhotoModalBodyAlbumDialog').removeClass('d-none'); } else { window.console.log("{{$modalerroralbum}} " + JSON.stringify(album) + ':' + data['errormsg']); } -- cgit v1.2.3 From 1b1550fb318081a92ab92b90eda533117d112370 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 25 Feb 2018 19:35:45 -0800 Subject: mention the hidden setting for #972 in doc/hidden_configs --- doc/hidden_configs.bb | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/hidden_configs.bb b/doc/hidden_configs.bb index f34c253ce..8b5429deb 100644 --- a/doc/hidden_configs.bb +++ b/doc/hidden_configs.bb @@ -28,6 +28,7 @@ Options are: [*= system.prevent_tag_hijacking ] Prevent foreign networks hijacking hashtags in your posts and directing them at its own resources. [*= system.startpage ] Another of those technically hidden configs made available by addons. Sets the default page to view when logging in. This is exposed to the UI by the startpage addon. [*= system.taganyone ] Requires the config of the same name to be enabled. Allow the @mention tagging of anyone, whether you are connected or not. This doesn't scale. + [*= system.anonymous_comments ] By default or if set to 1, custom permissions can be set to allow anonymous (moderated) comments like WordPress, moderated by the channel owner. If set to 0, no member of your site can select or enable this. [*= system.user_scalable ] Determine if the app is scalable on touch screens. Defaults to on, to disable, set to zero - real zero, not just false. [/dl] [h2]Site config[/h2][dl terms="mb"] -- cgit v1.2.3 From d2ed3a9abbb5c68d1a02eae629bc103aa43a1263 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 25 Feb 2018 21:40:19 -0800 Subject: provide opt-out link and text with notification emails --- Zotlabs/Lib/Enotify.php | 11 ++++++++++- view/tpl/email_notify_html.tpl | 3 +++ view/tpl/email_notify_text.tpl | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Lib/Enotify.php index c5bc706c2..1461a2e18 100644 --- a/Zotlabs/Lib/Enotify.php +++ b/Zotlabs/Lib/Enotify.php @@ -63,7 +63,9 @@ class Enotify { $thanks = t('Thank You,'); $sitename = get_config('system','sitename'); $site_admin = sprintf( t('%s Administrator'), $sitename); - + $opt_out1 = sprintf( t('This email was sent by %1$s at %2$s.'), t('$Projectname'), \App::get_hostname()); + $opt_out2 = sprintf( t('To stop receiving these messages, please adjust your Notification Settings at %s'), z_root() . '/settings'); + $hopt_out2 = sprintf( t('To stop receiving these messages, please adjust your %s.'), '' . t('Notification Settings') . ''); $sender_name = $product; $hostname = \App::get_hostname(); if(strpos($hostname,':')) @@ -613,6 +615,9 @@ class Enotify { $datarray['titemlink'] = $itemlink; $datarray['thanks'] = $thanks; $datarray['site_admin'] = $site_admin; + $datarray['opt_out1'] = $opt_out1; + $datarray['opt_out2'] = $opt_out2; + $datarray['hopt_out2'] = $hopt_out2; $datarray['title'] = stripslashes($title); $datarray['htmlversion'] = $htmlversion; $datarray['textversion'] = $textversion; @@ -670,6 +675,8 @@ class Enotify { '$hitemlink' => $datarray['hitemlink'], '$thanks' => $datarray['thanks'], '$site_admin' => $datarray['site_admin'], + '$opt_out1' => $datarray['opt_out1'], + '$opt_out2' => $datarray['hopt_out2'], '$title' => $datarray['title'], '$htmlversion' => $datarray['htmlversion'], )); @@ -690,6 +697,8 @@ class Enotify { '$titemlink' => $datarray['titemlink'], '$thanks' => $datarray['thanks'], '$site_admin' => $datarray['site_admin'], + '$opt_out1' => $datarray['opt_out1'], + '$opt_out2' => $datarray['opt_out2'], '$title' => $datarray['title'], '$textversion' => $datarray['textversion'], )); diff --git a/view/tpl/email_notify_html.tpl b/view/tpl/email_notify_html.tpl index 5b4954c8e..f4e12d793 100755 --- a/view/tpl/email_notify_html.tpl +++ b/view/tpl/email_notify_html.tpl @@ -21,6 +21,9 @@ {{$hitemlink}} {{$thanks}} {{$site_admin}} + + {{$opt_out1}} + {{$opt_out2}} diff --git a/view/tpl/email_notify_text.tpl b/view/tpl/email_notify_text.tpl index 56925c18b..5f1984edb 100755 --- a/view/tpl/email_notify_text.tpl +++ b/view/tpl/email_notify_text.tpl @@ -11,3 +11,4 @@ {{$thanks}} {{$site_admin}} +{{$opt_out1}} {{$opt_out2}} \ No newline at end of file -- cgit v1.2.3