Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions controllers/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ var getScriptPageTasks = function (aOptions) {
var copyright = null;
var license = null;
var licenseConflict = false;
var antifeature = null;
var types = [];
var author = null;
var collaborator = null;

Expand Down Expand Up @@ -175,6 +177,24 @@ var getScriptPageTasks = function (aOptions) {
aOptions.script.licenseConflict = true;
}

// Show antifeatures of the script
antifeature = scriptStorage.findMeta(script.meta, 'UserScript.antifeature');
if (antifeature) {
aOptions.hasAntiFeature = true;

antifeature.forEach(function (aElement, aIndex, aArray) {
var type = types[aElement.value1];
var comment = type ? (type.comment || '') : '';

types[aElement.value1] = { name: aElement.value1, comment:
(aElement.value2 ? aElement.value2 : '')
+ (comment ? (aElement.value2 ? '\n' : '') + comment: '')
};
});

aOptions.script.antifeatures = Object.values(types);
}

// Show collaborators of the script
author = scriptStorage.findMeta(script.meta, 'OpenUserJS.author.0.value');
collaborator = scriptStorage.findMeta(script.meta, 'OpenUserJS.collaborator');
Expand Down
65 changes: 65 additions & 0 deletions views/includes/documents/Frequently-Asked-Questions.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,71 @@ A: Yes, use the raw source route like this in the UserScript metadata block:

The `@downloadURL` UserScript metadata block key is not currently required but highly encouraged especially due to potential faulty .user.js engine updaters.

### Q: What is antifeature?

A: Adopted and vetted from another site, this UserScript metadata block key indicates what types of Author beneficial Code has been included with the script. This allows any visitor to make a more informed decision before installation.

Non-localized usage:
``` js
// @antifeature type comment
```

Localized usage:
``` js
// @antifeature:cs type komentář.
// @antifeature:es-MX type comentario.
// @antifeature:ru type комментарий

```

* There can be any number of @antifeature keys in a script.
* `comment` is optional but recommended. Comments will show up as a tooltip for all unlocalized and localized values.


The following key type(s) are currently supported:

#### antifeature ads

``` js
// @antifeature ads This script contains too many ads.
```

#### antifeature membership

``` js
// @antifeature membership This script requires an account for full functionality.
```

#### antifeature miner

``` js
// @antifeature miner This script uses a lot of electricity on your behalf.
```

#### antifeature referral-link

``` js
// @antifeature referral-link This script makes money for the Author.
```


#### antifeature tracking

``` js
// @antifeature tracking This script contains a tracking of your activity.
```

The following key type(s) are currently __not__ supported:

#### antifeature payment

``` js
// @antifeature payment This script utilizes additional proprietary upstream software and access.
```

If any of these keys are present then additional consideration should be utilized for moderation requests. If any key is absent and a script is found to contain Code relevant to these types please flag the script for moderation inspection.


### Q: Does OpenUserJS.org have script synchronization from a version control site?

This site is currently a presentational userscript repository and is intended to distribute the final published product in a familiar community setting.
Expand Down
3 changes: 3 additions & 0 deletions views/pages/scriptPage.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
{{#script.copyrights}}<p><i class="fa fa-fw fa-copyright"></i> <b>Copyright:</b> {{name}}</p>{{/script.copyrights}}
{{#script.licenseConflict}}<p><i class="fa fa-fw fa-legal"></i> <b>License:</b> {{#script.licenseParadox}}<s>{{/script.licenseParadox}}<a rel="external noreferrer noopener nofollow ugc license" referrerpolicy="same-origin" href="https://spdx.org/licenses/MIT.html">MIT</a>; <a rel="external noreferrer noopener nofollow ugc license" referrerpolicy="same-origin" href="https://opensource.org/licenses/MIT">https://opensource.org/licenses/MIT</a>{{#script.licenseParadox}}</s>{{/script.licenseParadox}}</p>{{/script.licenseConflict}}
{{#script.licenses}}<p><i class="fa fa-fw fa-balance-scale"></i> <b>License:</b> {{#name}}{{name}}{{/name}}{{^name}}<a rel="external noreferrer noopener nofollow ugc license" referrerpolicy="same-origin" href="https://spdx.org/licenses/{{spdx}}.html">{{spdx}}</a>{{#url}}; <a rel="external noreferrer noopener nofollow ugc license" referrerpolicy="same-origin" href="{{url}}">{{url}}</a>{{/url}}{{/name}}</p>{{/script.licenses}}
{{#hasAntiFeature}}
<p><i class="fa fa-fw fa-exclamation-triangle"></i> <b>Antifeatures:</b> <span>{{#script.antifeatures}}<a href="/about/Frequently-Asked-Questions#antifeature-{{name}}" title="{{comment}}"> {{name}}</a>{{/script.antifeatures}}</span></p>
{{/hasAntiFeature}}
{{#hasCollab}}
<p><i class="fa fa-fw fa-user"></i> <b>Collaborator:</b> {{#script.collaborators}} <span class="label label-info"><a href="/users/{{{url}}}">{{text}}</a></span> {{/script.collaborators}}</p>
{{/hasCollab}}
Expand Down