updater
11 years ago
admin-posts.php
11 years ago
admin-settings.php
11 years ago
column-css.php
11 years ago
column-group.php
11 years ago
column-settings.php
11 years ago
compatibility.php
11 years ago
field-code.php
11 years ago
field-color.php
11 years ago
field-editor.php
11 years ago
field-form.php
11 years ago
field-icon.php
11 years ago
field-layout.php
11 years ago
field-link.php
11 years ago
field-multiple-photos.php
11 years ago
field-photo-sizes.php
11 years ago
field-photo.php
11 years ago
field-post-type.php
11 years ago
field-select.php
11 years ago
field-suggest.php
11 years ago
field-text.php
11 years ago
field-textarea.php
11 years ago
field-video.php
11 years ago
field.php
11 years ago
global-settings.php
11 years ago
icon-selector.php
11 years ago
jquery.php
11 years ago
js-config.php
11 years ago
loop-settings.php
11 years ago
module-settings.php
11 years ago
module.php
11 years ago
row-css.php
11 years ago
row-js.php
11 years ago
row-settings.php
11 years ago
row-video.php
11 years ago
row.php
11 years ago
settings.php
11 years ago
ui.php
11 years ago
updater-config.php
11 years ago
user-template-settings.php
11 years ago
field-code.php
29 lines
| 1 | <div class="fl-code-field"> |
| 2 | <?php $editor_id = 'flcode' . time() . '_' . $name; ?> |
| 3 | <textarea id="<?php echo $editor_id; ?>" name="<?php echo $name; ?>" data-editor="<?php echo $field['editor']; ?>" <?php if(isset($field['class'])) echo ' class="'. $field['class'] .'"'; if(isset($field['rows'])) echo ' rows="'. $field['rows'] .'"'; ?>><?php echo htmlspecialchars($value); ?></textarea> |
| 4 | <script> |
| 5 | |
| 6 | jQuery(function(){ |
| 7 | |
| 8 | var textarea = jQuery('#<?php echo $editor_id; ?>'), |
| 9 | mode = textarea.data('editor'), |
| 10 | editDiv = jQuery('<div>', { |
| 11 | position: 'absolute', |
| 12 | height: parseInt(textarea.attr('rows'), 10) * 20 |
| 13 | }), |
| 14 | editor = null; |
| 15 | |
| 16 | editDiv.insertBefore(textarea); |
| 17 | textarea.css('display', 'none'); |
| 18 | |
| 19 | editor = ace.edit(editDiv[0]); |
| 20 | editor.getSession().setValue(textarea.val()); |
| 21 | editor.getSession().setMode('ace/mode/' + mode); |
| 22 | |
| 23 | editor.getSession().on('change', function(e) { |
| 24 | textarea.val(editor.getSession().getValue()).trigger('change'); |
| 25 | }); |
| 26 | }); |
| 27 | |
| 28 | </script> |
| 29 | </div> |