Last active
June 16, 2016 11:44
-
-
Save r-k-b/525a10d814acf09611b794ee7ea9c326 to your computer and use it in GitHub Desktop.
Show BC form field names in the Admin UI
This file contains 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 characters
// ==UserScript== | |
// @name Show BC form field names in the Admin UI | |
// @namespace https://gist.github.com/r-k-b/ | |
// @version 1.0.0 | |
// @description Show Business Catalyst's form field identifiers (like `CAT_Custom_123456`) right in the GUI of the form builder. | |
// @author Robert K. Bell | |
// @homepage https://gist.github.com/r-k-b/525a10d814acf09611b794ee7ea9c326 | |
// @downloadURL https://gist.github.com/r-k-b/525a10d814acf09611b794ee7ea9c326/raw/show-bc-field-name-in-admin.user.js | |
// @include https://*.worldsecuresystems.com/* | |
// @grant none | |
// @run-at context-menu | |
// ==/UserScript== | |
/* jshint esnext: true */ | |
// todo: fix this: https://goo.gl/1eZbKr | |
// todo: either make the labels selectable, or copy them to the clipboard on click | |
(($) => { | |
const $container = $('#form-system-field'); | |
$container | |
.find('label') | |
.each((index, elem) => { | |
const $elem = $(elem); | |
const newText = `<p>「<code>${ $elem.prop('for') }</code>」</p>`; | |
$elem.before(newText); | |
}); | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment