Userscript experimental local features

From UnionCloud Support
Revision as of 08:43, 16 May 2018 by Dannyjkendall12 (talk | contribs) (violentmonkey not violetmonkey)
Jump to: navigation, search

After collecting feedback in certain areas of the dashboard I implemented by own test userscript (Example given NTSU) to ease use of the dashboard.

What is a userscript?

A user script is a small javascript file which modifies websites as they run locally on your machine.

Why would I want todo that?

To tweak your experience as a stop gap solution whose features will eventually be added to the platform by NUS. See ideas on get satisfaction.

Example Features

A staff logon button for the homepage. (On our page we have to click sign then, then select non student.) I have added Links to the navigation to automatically view all:

  1. Events
  2. Products
  3. Promotions
  4. Groups

It appends new links to the DOM with

 ?grid%5Border%5D=start_date&grid%5Border_direction%5D=asc&grid%5Bpp%5D=189

where D is the total number of results at the end of the chosen section.

Add new event from the nav e.g. administrator/events/new

Hide items marked as deleted in the shop

 if(location.pathname=="/administrator/products"){
 $("tr td:contains('OLD Clothing Stock')").parent().hide();
 $("tr td:contains('Delete')").parent().hide();
 };


Finally added a save button direct from product edit page.

This is done by loading the product variants page in an iframe at the side.


How do I get started

Install violentmonkey (link assumes chrome available on firefox/opera/maxthon)

Install the script from here

Open dashboard Open dashboard

Edit Edit Script

What if I have caused issues?

Really easy to disable just a couple of clicks

How to disable script

Notes on the script:

  1. Specific to trentstudents.org
  2. Not public i.e. unlisted on directory
  3. Requires a userscript manager (install page for Violentmonkey recommended)
  4. Should be easily adaptable source viewable here