Last active
July 20, 2018 08:29
-
-
Save MaienM/d6131f286942e530f4b4267162178d80 to your computer and use it in GitHub Desktop.
Revisions
-
Michon van Dooren revised this gist
Jul 20, 2018 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ // ==UserScript== // @name GitLab Utils // @namespace https://gist.github.com/MaienM/d6131f286942e530f4b4267162178d80 // @updateUrl https://gist.githubusercontent.com/MaienM/d6131f286942e530f4b4267162178d80/raw/ // @version 0.1 // @description GitLab Utilities // @author MaienM -
Michon van Dooren created this gist
Jul 20, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ // ==UserScript== // @name GitLab Utils // @namespace http://tampermonkey.net/ // @version 0.1 // @description GitLab Utilities // @author MaienM // @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://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.4/lodash.min.js // @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js // @match https://gitlab.waxd.nl/* // ==/UserScript== var inline_src = (<><![CDATA[ $('body[data-page="admin:users:index"] .content .flex-row .controls').each(function() { const $this = $(this); const $btnEdit = $this.find('.btn[href$="/edit"]'); const $btnImpersonate = $btnEdit.clone(); $btnImpersonate.attr('href', $btnImpersonate.attr('href').replace('/edit', '/impersonate')); $btnImpersonate.html('Impersonate'); $btnImpersonate.attr('data-method', 'post'); $btnEdit.before($btnImpersonate); }); ]]></>).toString(); var c = Babel.transform(inline_src, { presets: [ "es2015", "es2016" ] }); eval(c.code);