From d7c9b293d3dfd34ec8e2639fc88c547d858a665c Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 8 Jan 2017 02:16:03 +1100 Subject: [PATCH] =?UTF-8?q?Update=20insertFormatting()=20definition=20-=20?= =?UTF-8?q?Remove=20now=20useless=20comment=20parameter=20-=20Formatting?= =?UTF-8?q?=20all=20around=20-=20Update=20data-role=3D=E2=80=9Cinsert-form?= =?UTF-8?q?atting=E2=80=9D=20links=20-=20Update=20onclick=3D=E2=80=9Cinser?= =?UTF-8?q?tFormatting()=E2=80=9D=20links?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/main.js | 4 +- .../duepuntozero/templates/comment_item.tpl | 16 ++--- .../templates/moderated_comment.tpl | 16 ++--- view/theme/duepuntozero/theme.php | 33 +++++----- view/theme/frio/js/textedit.js | 33 +++++----- view/theme/frio/templates/comment_item.tpl | 14 ++--- view/theme/frost-mobile/js/theme.js | 21 ++++--- .../frost-mobile/templates/comment_item.tpl | 10 +-- .../templates/moderated_comment.tpl | 16 ++--- view/theme/frost/js/theme.js | 21 ++++--- view/theme/frost/templates/comment_item.tpl | 16 ++--- .../frost/templates/moderated_comment.tpl | 16 ++--- view/theme/quattro/js/quattro.js | 33 +++++----- view/theme/quattro/templates/comment_item.tpl | 16 ++--- view/theme/smoothly/templates/bottom.tpl | 63 ++++++++++--------- view/theme/smoothly/theme.php | 33 +++++----- view/theme/vier/templates/comment_item.tpl | 16 ++--- view/theme/vier/templates/event_form.tpl | 28 ++++----- view/theme/vier/theme.php | 33 +++++----- 19 files changed, 222 insertions(+), 216 deletions(-) diff --git a/js/main.js b/js/main.js index 1b7b304a2..b08e45150 100644 --- a/js/main.js +++ b/js/main.js @@ -72,21 +72,19 @@ /* setup comment textarea buttons */ /* comment textarea buttons needs some "data-*" attributes to work: * data-role="insert-formatting" : to mark the element as a formatting button - * data-comment="" : string for "Comment", used by insertFormatting() function * data-bbcode="" : name of the bbcode element to insert. insertFormatting() will insert it as "[name][/name]" * data-id="" : id of the comment, used to find other comment-related element, like the textarea * */ $('body').on('click','[data-role="insert-formatting"]', function(e) { e.preventDefault(); var o = $(this); - var comment = o.data('comment'); var bbcode = o.data('bbcode'); var id = o.data('id'); if (bbcode=="img") { Dialog.doImageBrowser("comment", id); return; } - insertFormatting(comment, bbcode, id); + insertFormatting(bbcode, id); }); /* event from comment textarea button popups */ diff --git a/view/theme/duepuntozero/templates/comment_item.tpl b/view/theme/duepuntozero/templates/comment_item.tpl index b7158f4ee..f1ef37f14 100644 --- a/view/theme/duepuntozero/templates/comment_item.tpl +++ b/view/theme/duepuntozero/templates/comment_item.tpl @@ -20,28 +20,28 @@
  • + data-role="insert-formatting" data-bbcode="b" data-id="{{$id}}">
  • + data-role="insert-formatting" data-bbcode="i" data-id="{{$id}}">
  • + data-role="insert-formatting" data-bbcode="u" data-id="{{$id}}">
  • + data-role="insert-formatting" data-bbcode="quote" data-id="{{$id}}">
  • + data-role="insert-formatting" data-bbcode="code" data-id="{{$id}}">
  • + data-role="insert-formatting" data-bbcode="img" data-id="{{$id}}">
  • + data-role="insert-formatting" data-bbcode="url" data-id="{{$id}}">
  • + data-role="insert-formatting" data-bbcode="video" data-id="{{$id}}">
diff --git a/view/theme/duepuntozero/templates/moderated_comment.tpl b/view/theme/duepuntozero/templates/moderated_comment.tpl index ede08751a..e5c2e5b9a 100644 --- a/view/theme/duepuntozero/templates/moderated_comment.tpl +++ b/view/theme/duepuntozero/templates/moderated_comment.tpl @@ -23,28 +23,28 @@
  • + onclick="insertFormatting('b', {{$id}});">
  • + onclick="insertFormatting('i', {{$id}});">
  • + onclick="insertFormatting('u', {{$id}});">
  • + onclick="insertFormatting('quote', {{$id}});">
  • + onclick="insertFormatting('code', {{$id}});">
  • + onclick="insertFormatting('img', {{$id}});">
  • + onclick="insertFormatting('url', {{$id}});">
  • + onclick="insertFormatting('video', {{$id}});">
diff --git a/view/theme/duepuntozero/theme.php b/view/theme/duepuntozero/theme.php index 347e542e1..c1a1321ae 100644 --- a/view/theme/duepuntozero/theme.php +++ b/view/theme/duepuntozero/theme.php @@ -23,33 +23,34 @@ set_template_engine($a, 'smarty3'); } $a->page['htmlhead'] .= <<< EOT