-
Notifications
You must be signed in to change notification settings - Fork 15
Contributing
Thank you for considering to contribute to SOX!
We would appreciate any and all contributions, partial or complete, and try to respond to all issues/pull requests as soon as we can!
Contributing doesn't have to be with code! Fixing a simple typo, or helping us document code/update the wiki, is equally as important! :)
Please follow the following steps when adding a new feature:
- Write a Javascript function that implements the feature. It's name should be in
camelCase
. Your function may use jQuery! - Add it to the bottom of the
features
object insox.features.js
. - Add a JSON object for the feature to
sox.features.info.json
. Please put it under the most fitting category array fromAppearance
,Comments
,Editing
,Flags
,Sidebar
,Chat
,Voting
, andExtras
. The following fields must be included:-
name
: thecamelCase
ID of the function you added to sox.features.js -
desc
: a short description of the feature you're adding, which will be displayed in the control panel -
meta
: a URL linking to a meta post if that is where you got the idea from/were trying to fix, or""
-
match
: a string of comma-separated match patterns for URLs where the feature should run on. Some common match patterns that you may need are:- for question pages:
*://*/questions*,
- for review pages:
*://*/review*
- for user profile pages:
*://*/users/*
- for search pages:
*://*.com/search*
- for question pages:
-
exclude
: a string of comma-separated match patterns for URLs where the feature should run on, or""
. An extra 'match pattern' is included calledSE1.0
for Stack Exchange 1.0 sites.
-
- Submit a pull request to the dev branch!
Please note any CSS that the feature uses should be added to the bottom of sox.css
, with a comment before it indicating which feature it is for. CSS rules should ideally be prepended with the function's ID (the camelCase name).
If you've found a bug, we'd be grateful for any fixes (even if they're partial!) you could provide. We ask that you first raise an issue on Github so other contributors can discuss and help fix it.
SOX should automatically add a list of your features to any issues that you add to help in debugging :)
Please submit any pull requests to the dev branch.
SOX has various helper functions and getters you can use to get information. Please see Helper Functions for a list of them.
To test locally, simply create a userscript which //@require
's the local version of your files. We strongy recommend using Tampermonkey as your userscript manager.
Here's a template that you can modify to work for your system:
// ==UserScript==
// @name Local SOX
// @match *://*.stackoverflow.com/*
// @match *://*.stackexchange.com/*
// @match *://*.superuser.com/*
// @match *://*.serverfault.com/*
// @match *://*.askubuntu.com/*
// @match *://*.stackapps.com/*
// @match *://*.mathoverflow.net/*
// @match *://github.com/soscripted/*
// @match *://soscripted.github.io/sox/*
// @exclude *://data.stackexchange.com/*
// @exclude *://api.stackexchange.com/*
// @require https://code.jquery.com/jquery-3.3.1.min.js
// @require https://code.jquery.com/ui/1.12.1/jquery-ui.min.js
// @require https://api.stackexchange.com/js/2.0/all.js
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery-timeago/1.5.3/jquery.timeago.min.js
// @require file:///C:/User/Github/sox/sox.common.js
// @require file:///C:/User/Github/sox/sox.github.js
// @require file:///C:/User/Github/sox/sox.dialog.js
// @require file:///C:/User/Github/sox/sox.features.js
// @require file:///C:/User/Github/sox/sox.user.js
// @resource css file:///C:/User/Github/sox/sox.css
// @resource dialog file:///C:/User/Github/sox/sox.dialog.html
// @resource featuresJSON file:///C:/User/Github/sox/sox.features.info.json
// @resource common file:///C:/User/Github/sox/sox.common.info.json
// @grant GM_setValue
// @grant GM_getValue
// @grant GM_deleteValue
// @grant GM_getResourceText
// @grant GM_addStyle
// @grant GM_info
// ==/UserScript==
Make sure Tampermonkey has been allowed access to local file URLs!