forked from OpenUserJS/OpenUserJS.org
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnewScriptPage.html
More file actions
147 lines (145 loc) · 8.14 KB
/
Copy pathnewScriptPage.html
File metadata and controls
147 lines (145 loc) · 8.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<!DOCTYPE html>
<html>
<head>
<title>{{title}}</title>
{{> includes/head.html }}
<style>
.script-metadata-definitions .list-group-item-heading code {
white-space: pre-line;
}
</style>
</head>
<body>
{{> includes/header.html }}
<div class="container-fluid">
<div class="row">
<div class="col-xs-12">
<div class="col-md-4">
{{#newUserJS}}
<h2><i class="fa fa-tags"></i> Script Metadata</h2>
<div class="panel panel-default">
<div class="panel-body">
<p>You can read about most userscript metadata blocks on the <a href="http://wiki.greasespot.net/Metadata_Block">Greasespot wiki</a> and at the <a href="https://sourceforge.net/p/greasemonkey/wiki/Metadata_Block/">Greasemonkey on SourceForge wiki</a>.</p>
</div>
</div>
<h3>OpenUserJS.org Specific</h3>
<div class="list-group script-metadata-definitions">
<div class="list-group-item active">
<h4 class="list-group-item-heading"><code>@description This script even does the laundry!</code></h4>
<p class="list-group-item-text">Specially formatted on the script page. Last value shown.</p>
</div>
<div class="list-group-item active">
<h4 class="list-group-item-heading"><code>@copyright Year, Author (Author Website)</code></h4>
<p class="list-group-item-text">Specially formatted on the script page. All values shown in reverse order.</p>
</div>
<div class="list-group-item active">
<h4 class="list-group-item-heading"><code>@icon url</code></h4>
<p class="list-group-item-text">A url or data url. Resolution should be near 48px by 48px, Used in the script list page at 16px and on the script page at ~45px. Last value is shown.</p>
</div>
<div class="list-group-item active">
<h4 class="list-group-item-heading"><code>@license License Type; License Homepage</code></h4>
<p class="list-group-item-text">Specially formatted on the script page. All values shown in reverse order. If absent MIT License (Expat) is implied.</p>
</div>
<div class="list-group-item active">
<h4 class="list-group-item-heading"><code>@homepageURL url</code></h4>
<p class="list-group-item-text">A url of http, https or mailto protocol. Specially formatted on the script page. All values shown in reverse order.</p>
</div>
<div class="list-group-item active">
<h4 class="list-group-item-heading"><code>@supportURL url</code></h4>
<p class="list-group-item-text">A url of http, https or mailto protocol. Specially formatted on the script page. Last value shown.</p>
</div>
<div class="list-group-item inactive">
<h4 class="list-group-item-heading"><code>@oujs:author {{#authedUser}}{{authedUser.name}}{{/authedUser}}{{^authedUser}}username{{/authedUser}}</code></h4>
<p class="list-group-item-text">The author of the script. Required to enable <a href="#collaboration">Collaboration</a>. Last value shown. This key may be subject to change.</p>
</div>
<div class="list-group-item inactive">
<h4 class="list-group-item-heading"><code>@oujs:collaborator username</code></h4>
<p class="list-group-item-text">Can be defined multiple times. Required for <a href="#collaboration">Collaboration</a>. All values shown in reverse order. This key may be subject to change.</p>
</div>
</div>
<a name="collaboration"></a>
<h3>Collaboration</h3>
<div class="panel panel-default">
<div class="panel-body">
<p>To allow other users to upload modified versions of your script to your account, add <code>@oujs:author {{#authedUser}}{{authedUser.name}}{{/authedUser}}{{^authedUser}}username{{/authedUser}}</code> to the metadata of your script, along with <code>@oujs:collaborator username</code> for every user you wish to give write access. Only the real author of the script can modify these metadata keys. Collaborators cannot use GitHub integration to update the script. Add them as collaborators to the GitHub repo instead.</p>
</div>
</div>
{{/newUserJS}}
{{#newJSLibrary}}
<h2><i class="fa fa-question"></i> Library Docs</h2>
<div class="panel panel-default">
<div class="panel-body">
<h3>OpenUserJS.org Specific</h3>
<p>Any UserScript on OpenUserJS.org that <code>//@require</code>'s libraries also on OpenUserJS.org will link to the library on the UserScript page.</p>
</div>
</div>
{{/newJSLibrary}}
</div>
<div class="col-md-4">
<h2><i class="fa fa-plus-square"></i> New Script</h2>
<div class="list-group">
<a href="{{{newScriptEditorPageUrl}}}" class="list-group-item">
<h4 class="list-group-item-heading">Write Script Online</h4>
<p class="list-group-item-text">
Click here to write a script using the Ace editor (used by GitHub).
</p>
</a>
<div class="list-group-item">
<h4 class="list-group-item-heading">Upload Script</h4>
<p class="list-group-item-text">
<form action="{{{uploadNewScriptPageUrl}}}" method="post" enctype="multipart/form-data" class="form-horizontal">
<input type="hidden" name="uploadScript" value="true">
{{#newJSLibrary}}
<div class="form-group">
<input type="text" class="form-control" name="script_name" placeholder="Script Name" required />
</div>
{{/newJSLibrary}}
<div class="form-group">
<div class="input-group">
<input type="file" class="form-control" name="script" placeholder="Enter email" required />
<span class="input-group-btn">
<button class="btn btn-success" type="submit">Submit</button>
</span>
</div>
</div>
</form>
</p>
</div>
<div class="list-group-item">
<h4 class="list-group-item-heading">Fork An Existing Script</h4>
<p class="list-group-item-text">
While logged in, click the fork button on any script's main page, or view a script's source and "Submit As Fork".
</p>
</div>
<a href="{{{authedUser.userGitHubRepoListPageUrl}}}" class="list-group-item">
<h4 class="list-group-item-heading">Import Script from GitHub</h4>
<p class="list-group-item-text">
Click here import a script(s) from a GitHub repository.
</p>
</a>
</div>
</div>
<div class="col-md-4">
<h2><i class="fa fa-refresh"></i> Sync Script</h2>
<div class="panel panel-default">
<div class="panel-body">
<h3><i class="fa fa-github"></i> GitHub</h3>
<p>You can add a webhook to a GitHub repository to automatically keep it up to date on OpenUserJS.org.</p>
<h4>Instructions</h4>
<p>Firstly you must upload the script to the site. You can <a href="{{{authedUser.userGitHubRepoListPageUrl}}}">Import from Github</a> to speed things up.</p>
<ol>
<li>On your target GitHub repo, click Settings > Webhooks & Services > Add Webhook.</li>
<li>In the Payload URL input, paste <code>https://openuserjs.org/github/hook</code></li>
<li>Change the Content Type dropdown to <code>application/x-www-form-urlencoded</code></li>
<li>Click <code>Add Webhook</code>.</li>
</ol>
<p>After adding the webhook, push a change to github to make sure it's working.</p>
</div>
</div>
</div>
</div>
</div>
</div>
{{> includes/footer.html }}
</body>
</html>