PluginProbe
Pods – Custom Content Types and Fields / 3.1.4.3
Pods – Custom Content Types and Fields v3.1.4.3
2.7.31.4 2.8.23.5 2.9.19.5 3.0.10.5 3.1.4.3 3.2.8.4 3.3.9.2 2.8.23.4 2.9.19.4 3.0.10.4 3.1.4.2 3.2.8.3 3.3.9.1 trunk 1.14.8 2.7.31.3 2.8.23.3 2.9.19.3 3.0.10.3 3.1.4.1 3.2.0 3.2.1 3.2.1.1 3.2.2 3.2.4 All 42 releases
pods / components / Templates / assets / js / scripts-pod_reference.js
scripts-pod_reference.js
49 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 var htmleditor;
2
3 CodeMirror.defineMode("mustache", function (config, parserConfig) {
4 var mustacheOverlay = {
5 token: mustache
6 };
7 return CodeMirror.overlayMode(CodeMirror.getMode(config, parserConfig.backdrop || "text/html"), mustacheOverlay);
8 });
9
10 // setup pod selection
11 jQuery(function ($) {
12
13 htmleditor = CodeMirror.fromTextArea(document.getElementById("content"), {
14 lineNumbers: true,
15 matchBrackets: true,
16 mode: "mustache",
17 indentUnit: 4,
18 indentWithTabs: true,
19 enterMode: "keep",
20 tabMode: "shift",
21 lineWrapping: true
22
23 });
24
25 /* Setup autocomplete */
26 htmleditor.on('keyup', podFields);
27
28 $('.pod-switch').baldrick({
29 request: ajaxurl, method: 'POST'
30 });
31
32 $('#pods-magic-tag-list').on('click', 'dd.pods-magic-tag-option', function (e) {
33 e.preventDefault();
34
35 var $element = $(this);
36
37 var tag = $element.text();
38
39 navigator.clipboard.writeText('{@' + tag.trim() + '}');
40
41 $element.css('background-color', '#ffffb4');
42
43 setTimeout(function () {
44 $element.css('background-color', '');
45 }, 200);
46 });
47 });
48
49