Skip to content

Instantly share code, notes, and snippets.

@withinboredom
Created March 30, 2018 00:43
Show Gist options
  • Save withinboredom/b61308b32455b8212712f499deb73bdf to your computer and use it in GitHub Desktop.
Save withinboredom/b61308b32455b8212712f499deb73bdf to your computer and use it in GitHub Desktop.
A better phabricator
// ==UserScript==
// @name A better phabricator
// @namespace http://tampermonkey.net/
// @version 0.1
// @description shows how to use babel compiler
// @author You
// @require https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.18.2/babel.js
// @require https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.16.0/polyfill.js
// @require https://code.jquery.com/jquery-3.3.1.min.js
// @match https://code.a8c.com/*
// ==/UserScript==
/* jshint ignore:start */
var inline_src = (<><![CDATA[
/* jshint ignore:end */
/* jshint esnext: false */
/* jshint esversion: 6 */
$('.phui-header-shell').on('click', (ev) => {
$(ev.delegateTarget).next().slideToggle();
});
$('.differential-file-icon-header').on('click', (ev) => {
$(ev.delegateTarget).next().slideToggle();
});
/* jshint ignore:start */
]]></>).toString();
var c = Babel.transform(inline_src, { presets: [ "es2015", "es2016" ] });
eval(c.code);
/* jshint ignore:end */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment