editor1.js
4 days ago
handlebars.baldrick2.js
4 days ago
handlebars2.js
4 days ago
jquery.baldrick3.js
4 days ago
panel.js
4 days ago
scripts-pod_reference.js
4 days ago
scripts-view_template.js
4 days ago
scripts-pod_reference.js
34 lines
| 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 | } ); |
| 33 | |
| 34 |