Changeset 1067775
- Timestamp:
- 01/14/2015 10:15:06 AM (11 years ago)
- Location:
- safe-editor/trunk
- Files:
-
- 4 edited
-
css/safe_editor.css (modified) (1 diff)
-
index.php (modified) (9 diffs)
-
readme.txt (modified) (1 diff)
-
screenshot-1.png (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
safe-editor/trunk/css/safe_editor.css
r938323 r1067775 28 28 .safe_editor_wrapper .CodeMirror { 29 29 border: 1px solid #ddd; 30 font-size:16px; 31 line-height:20px; 32 height:800px; 33 font-family: "Courier New"; 30 34 margin-bottom: 20px; } 31 35 .safe_editor_wrapper .button { -
safe-editor/trunk/index.php
r938323 r1067775 2 2 /* 3 3 Plugin Name: Safe Editor 4 Plugin URI: 5 Description: Safe Editor allows you to write custom CSS / Javascript to manipulate the appearance and behavior of themes / plugins on your website without worrying that your changes will be overwritten with the future theme / plugin updates. 6 Version: 1. 04 Plugin URI: 5 Description: Safe Editor allows you to write custom CSS / Javascript to manipulate the appearance and behavior of themes / plugins on your website without worrying that your changes will be overwritten with the future theme / plugin updates. 6 Version: 1.1 7 7 Author: Konrad Węgrzyniak 8 8 Author URI: http://forde.pl/ … … 16 16 17 17 if(!wp_script_is('jquery')) wp_enqueue_script('jquery',false,array(),false, true); 18 19 wp_enqueue_style('codemirror-theme-ambiance', plugins_url('/theme/ambiance.css', __FILE__)); 20 wp_enqueue_style('codemirror-theme-monokai', plugins_url('/theme/monokai.css', __FILE__)); 21 wp_enqueue_style('codemirror-theme-solarized', plugins_url('/theme/solarized.css', __FILE__)); 22 wp_enqueue_style('codemirror-theme-tomorrow-night-eighties', plugins_url('/theme/tomorrow-night-eighties.css', __FILE__)); 23 18 24 wp_enqueue_style('codemirror-css', plugins_url('/codemirror/codemirror.css', __FILE__)); 19 25 wp_enqueue_script('codemirror', plugins_url( '/codemirror/codemirror.js', __FILE__ ),array(),false, true); … … 44 50 <?php ( isset($_GET['tab']) )? $this->se_tabs($_GET['tab']) : $this->se_tabs('css'); ?> 45 51 <?php $tab = ( isset($_GET['tab']) )? $_GET['tab'] : false; ?> 46 52 47 53 <div class="safe_editor_wrapper <?php if($tab == 'css' || !isset($_GET['tab'])) echo 'tab_vis' ?>"> 48 <?php 49 $css = get_option('safe_edit_css'); 50 $css = ($css)? stripcslashes($css) : ''; 54 <?php 55 $css = get_option('safe_edit_css'); 56 $css = ($css)? stripcslashes($css) : ''; 51 57 ?> 52 58 <p class="se_tab_desc">Your custom css will be added to the <i><body></i> tag on your website "front-end" (wrapped in <i><style></i> tags).</p> … … 57 63 58 64 <div class="safe_editor_wrapper <?php if($tab == 'js') echo 'tab_vis' ?>"> 59 <?php 60 $js = get_option('safe_edit_js'); 61 $js = ($js)? stripcslashes($js) : ''; 65 <?php 66 $js = get_option('safe_edit_js'); 67 $js = ($js)? stripcslashes($js) : ''; 62 68 ?> 63 69 <p class="se_tab_desc">Your custom Javascript will be added to the footer of your website "front-end" (wrapped in <i><script></i> tags).</p> … … 76 82 </form> 77 83 </div> 78 79 84 80 85 81 86 87 82 88 <script type="text/javascript"> 83 jQuery(document).ready(function( $ ) { 89 jQuery(document).ready(function( $ ) { 84 90 var css_editor = CodeMirror.fromTextArea(document.getElementById("safe_css_editor"), { 85 91 mode: "css", 86 92 indentUnit: 4, 87 lineNumbers: true 93 lineNumbers: true, 94 theme: "solarized light" 88 95 }); 89 96 var js_editor = CodeMirror.fromTextArea(document.getElementById("safe_js_editor"), { 90 97 mode: "javascript", 91 98 indentUnit: 4, 92 lineNumbers: true 99 lineNumbers: true, 100 theme: "solarized light" 93 101 }); 94 102 … … 113 121 textarea = $('.safe_editor_js_textarea'); 114 122 value = js_editor.getValue(); 115 saving_js = true; 123 saving_js = true; 116 124 } 117 125 … … 123 131 url: scriptsajax.ajaxurl, 124 132 data: { 125 action: 'se_save', 133 action: 'se_save', 126 134 type: type, 127 135 data: value … … 130 138 t.parent().after(data); 131 139 t.parent().find('.saving').addClass('saved').fadeOut(4000, function() { $(this).remove() }); 132 if(type == 'css') saving_css = false; 140 if(type == 'css') saving_css = false; 133 141 if(type == 'js') saving_js = false; 134 142 }, … … 167 175 168 176 function se_save() { 169 //echo "<pre>"; print_r($_POST); echo "</pre>"; 177 //echo "<pre>"; print_r($_POST); echo "</pre>"; 170 178 switch($_POST['type']) { 171 case 'css' : 179 case 'css' : 172 180 update_option( 'safe_edit_css', $_POST['data']); 173 181 break; 174 case 'js' : 182 case 'js' : 175 183 update_option( 'safe_edit_js', $_POST['data']); 176 184 break; -
safe-editor/trunk/readme.txt
r938339 r1067775 31 31 == Change Log == 32 32 33 = 1.1 = 34 * Solarized light theme for css and javascript editor added 35 33 36 = 1.0 = 34 37 * First release.
Note: See TracChangeset
for help on using the changeset viewer.