From 4d153c9fcd322a44be233334628637861e7c0cbb Mon Sep 17 00:00:00 2001 From: Paul Rodwell Date: Fri, 1 Mar 2024 15:34:46 +0000 Subject: [PATCH 1/3] Use HTML dialog, rather than wiki.dialog for plugin error --- lib/plugin.coffee | 48 +++++++++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/lib/plugin.coffee b/lib/plugin.coffee index 91cf10f3..238748fd 100644 --- a/lib/plugin.coffee +++ b/lib/plugin.coffee @@ -174,24 +174,36 @@ plugin.emit = (div, item, done=->) -> div.find('.error').on 'dblclick', (e) -> wiki.textEditor div, item div.find('button').on 'click', -> - wiki.dialog ex.toString(), """ -

This "#{item.type}" plugin won't show.

-
  • Is it available on this server? -
  • Is its markup correct? -
  • Can it find necessary data? -
  • Has network access been interrupted? -
  • Has its code been tested? -

    Developers may open debugging tools and retry the plugin.

    - -

    Learn more - - About Plugins - - -

    - """ + # only append dialog if not already done. + if not div[0].querySelector('dialog') + div.append """ + +

    This "#{item.type}" plugin won't show.

    +
      +
    • Is it available on this server? +
    • Is its markup correct? +
    • Can it find necessary data? +
    • Has network access been interrupted? +
    • Has its code been tested? +
    +

    Developers may open debugging tools and retry the plugin.

    + +

    Learn more + + About Plugins + + +

    +

    To close this dialog, press ESCAPE key or click outside this dialog.

    +
    + """ + dialog = div[0].querySelector('dialog') + dialog.addEventListener 'click', (evt) -> + if evt.target is dialog + dialog.close() + dialog.showModal() $('.retry').on 'click', -> if script.emit.length > 2 script.emit div, item, -> From dfe41349b9b7348023bd3b15dda69585b64b242a Mon Sep 17 00:00:00 2001 From: Paul Rodwell Date: Fri, 1 Mar 2024 16:02:13 +0000 Subject: [PATCH 2/3] change close to button --- lib/plugin.coffee | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/plugin.coffee b/lib/plugin.coffee index 238748fd..dde4f081 100644 --- a/lib/plugin.coffee +++ b/lib/plugin.coffee @@ -187,7 +187,7 @@ plugin.emit = (div, item, done=->) ->
  • Has its code been tested?

    Developers may open debugging tools and retry the plugin.

    - +

    Learn more ) ->

    -

    To close this dialog, press ESCAPE key or click outside this dialog.

    + """ dialog = div[0].querySelector('dialog') @@ -204,6 +204,8 @@ plugin.emit = (div, item, done=->) -> if evt.target is dialog dialog.close() dialog.showModal() + $('.close').on 'click', -> + dialog.close() $('.retry').on 'click', -> if script.emit.length > 2 script.emit div, item, -> From ef9bd7ca572809252984b48f71bfdbffa6abeb47 Mon Sep 17 00:00:00 2001 From: Paul Rodwell Date: Sat, 2 Mar 2024 11:08:37 +0000 Subject: [PATCH 3/3] Reinstate the forgotten title --- lib/plugin.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/plugin.coffee b/lib/plugin.coffee index dde4f081..bdc020bd 100644 --- a/lib/plugin.coffee +++ b/lib/plugin.coffee @@ -178,6 +178,7 @@ plugin.emit = (div, item, done=->) -> if not div[0].querySelector('dialog') div.append """ +

    #{ex.toString()}

    This "#{item.type}" plugin won't show.

    • Is it available on this server?