From 4656a28c51c34c722c99da3cf4e7ba62e4445065 Mon Sep 17 00:00:00 2001 From: Martii Date: Thu, 15 Apr 2021 11:10:23 -0600 Subject: [PATCH] Shrink instructions * Use *bootstrap* accordion to hide the instructions until clicked/tapped. If/when the feature gets reenabled they might be longer for GH. * Symmetry * Some bolding elsewhere * Verbage on previously published... webhook currently sends all push notices whether published or not. Applies to #1705 and post #1736 --- views/pages/newScriptPage.html | 81 ++++++++++++++++++++++------------ 1 file changed, 53 insertions(+), 28 deletions(-) diff --git a/views/pages/newScriptPage.html b/views/pages/newScriptPage.html index 6a71f7a65..57499088f 100644 --- a/views/pages/newScriptPage.html +++ b/views/pages/newScriptPage.html @@ -69,7 +69,7 @@

Import Script from GitHub

- Click here to import a script(s) from a personal user GitHub repository. If Sync Script using GitHub has already been set up for the selected repository then it should automatically be linked for any scripts imported. + Click here to import a script(s) from a personal user GitHub repository. If Sync Script using GitHub has already been set up for the selected repository then it should automatically be linked for any scripts imported or previously directly published.

{{/authedUser.hasGithub}} @@ -299,7 +299,7 @@

The OpenUserJS Author username to collaborate with.

-

Required to activate Collaboration. Please ensure the usernames exist for your scripts security.

+

Required to activate Collaboration. Please ensure the usernames exist for your scripts security.

May be defined multiple times.

All values shown in reverse order.

@@ -313,15 +313,29 @@

Sync Script

Collaboration

-

To allow other users to upload modified versions of your script to your account from this site create an OpenUserJS metadata block and add the necessary keys... one for you yourself and for every existing user you wish to give write access as demonstrated here:

// ==OpenUserJS==
// @author {{#authedUser}}{{authedUser.name}}{{/authedUser}}{{^authedUser}}username{{/authedUser}}
// @collaborator username
// ==/OpenUserJS==

-

Caveats

-
    -
  • Only the real author of the script may modify these metadata keys.
  • - {{#authedUser.hasGithub}} -
  • Collaborators on this site may not use GitHub integration to update the script. Add them as collaborators to the GitHub repository instead.
  • -
  • If the webhook is enabled on a GitHub repository it will clobber any changes here on this site.
  • - {{/authedUser.hasGithub}} -
+

To allow other users to upload modified versions of your script to your account from this site create an OpenUserJS metadata block and add the necessary keys. +

+
+

+ + Instructions +

+
+
+
+

Add one for you yourself and for every existing user you wish to give write access as demonstrated here:

+
// ==OpenUserJS==
// @author {{#authedUser}}{{authedUser.name}}{{/authedUser}}{{^authedUser}}username{{/authedUser}}
// @collaborator username
// ==/OpenUserJS==

+

Caveats

+
    +
  • Only the real author of the script may modify these metadata keys.
  • + {{#authedUser.hasGithub}} +
  • Collaborators on this site may not use GitHub integration to update the script. Add them as collaborators to the GitHub repository instead.
  • +
  • If the webhook is enabled on a GitHub repository it will clobber any changes here on this site.
  • + {{/authedUser.hasGithub}} +
+
+
+

{{#authedUser.hasGithub}} @@ -329,23 +343,34 @@

Caveats

GitHub

You may add a webhook to one or more of your personal user GitHub repositories to automatically keep it up to date on OpenUserJS.org.

-

Instructions

-

Optionally you may upload the script to the site first. You may also use Import from Github to speed things up as a shortcut.

-
    -
  1. Ensure that you have GitHub as an authentication for this site.
  2. -
  3. Ensure that you have and use a default master branch.
  4. -
  5. On your target GitHub repo, click Settings > Webhooks > Add Webhook.
  6. -
  7. In the Payload URL input, paste
    https://openuserjs.org/github/hook
  8. -
  9. Change the Content Type dropdown to
    application/x-www-form-urlencoded
  10. -
  11. Click Add Webhook.
  12. -
-

After adding the webhook, push a change to GitHub to make sure it's working.

-

Caveats

-
    -
  • This site will return an acknowledgement to GitHub of acceptance for queued retrieval. Larger payloads will take more time to process.
  • -
  • GitHub currently has a caching mecahnism that may prevent serving the next version from being pulled too quickly so please give a little time in-between commits.
  • -
  • If the database is locked, such as during brief maintenance periods or lockdown, updates may be temporarily rejected and may need to be redelivered manually.
  • -
+
+
+

+ + Instructions +

+
+
+
+

Optionally you may upload the script to the site first. You may also use Import from Github to speed things up as a shortcut.

+
    +
  1. Ensure that you have GitHub as an authentication for this site.
  2. +
  3. Ensure that you have and use a default master branch.
  4. +
  5. On your target GitHub repo, click Settings > Webhooks > Add Webhook.
  6. +
  7. In the Payload URL input, paste
    https://openuserjs.org/github/hook
  8. +
  9. Change the Content Type dropdown to
    application/x-www-form-urlencoded
  10. +
  11. Click Add Webhook.
  12. +
+

After adding the webhook, push a change to GitHub to make sure it's working.

+

Caveats

+
    +
  • This site will return an acknowledgement to GitHub of acceptance for queued retrieval. Larger payloads will take more time to process.
  • +
  • GitHub currently has a caching mecahnism that may prevent serving the next version from being pulled too quickly so please give a little time in-between commits.
  • +
  • If the database is locked, such as during brief maintenance periods or lockdown, updates may be temporarily rejected and may need to be redelivered manually.
  • +
+
+
+
{{/authedUser.hasGithub}}