Changeset 1900519
- Timestamp:
- 06/28/2018 11:57:50 AM (8 years ago)
- Location:
- code-editor-and-compiler/trunk
- Files:
-
- 7 edited
-
admin/compilebin-admin.php (modified) (3 diffs)
-
admin/js/editor-handler.js (modified) (8 diffs)
-
common/js/include.js (modified) (2 diffs)
-
compilebin.php (modified) (1 diff)
-
public/compilebin-public.php (modified) (1 diff)
-
public/js/editor-handler-public.js (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
code-editor-and-compiler/trunk/admin/compilebin-admin.php
r1900373 r1900519 7 7 public function __construct() { 8 8 $this->plugin_name = "code-editor-and-compiler"; 9 $this->plugin_version = "1.3. 1";9 $this->plugin_version = "1.3.2"; 10 10 add_action('admin_notices', array($this, 'plugin_activation')); 11 11 add_action('deactivated_plugin', array($this, 'plugin_deactivation')); … … 85 85 $response = wp_remote_post($url, array( 86 86 'body' => $postData, 87 'timeout' => 20 87 88 ) 88 89 ); 90 91 //print_r($response); 89 92 90 93 echo $response['body']; … … 111 114 $response = wp_remote_post($url, array( 112 115 'body' => $postData, 116 'timeout' => 20 113 117 ) 114 118 ); -
code-editor-and-compiler/trunk/admin/js/editor-handler.js
r1900373 r1900519 23 23 24 24 var cdbx_setMode = function() { 25 cdbx_editor.getSession().setMode(cdbx_languages[cdbx_curLangId].mode); 26 $(CDBX_FILENAME_EXT).text(cdbx_languages[cdbx_curLangId].ext); 25 if (cdbx_curLangId == cdbx_defLangId) { 26 cdbx_editor.getSession().setMode(cdbx_defaultMode); 27 } else { 28 cdbx_editor.getSession().setMode(cdbx_languages[cdbx_curLangId].mode); 29 $(CDBX_FILENAME_EXT).text(cdbx_languages[cdbx_curLangId].ext); 30 } 27 31 }; 28 32 … … 106 110 107 111 if (cdbx_curLangId == cdbx_defLangId) { 108 cdbx_info_html += '<p style="color:#696969"><label style="color:#008B8B">Default language is selected.</label><br> Code that you write in any language will only be automatically syntax highlighted in public view. Select a specific language from the drop down menu to run your code.</p>';112 cdbx_info_html += '<p style="color:#696969"><label style="color:#008B8B">Default programming language is selected.</label><br> Code that you write in any language will only be automatically syntax highlighted in public view. Select a specific language from the drop down menu to run your code.</p>'; 109 113 } 110 114 … … 192 196 success: function(data, textStatus, jqXHR) { 193 197 var output = JSON.parse(data).output.replace(/\n/g, '<br />'); 194 $(CDBX_DIV_OUTPUT).html(output); 198 $(CDBX_DIV_OUTPUT).html(output); 195 199 }, 196 200 error: function(jqXHR, textStatus, errorThrown) { … … 223 227 var options = $(CDBX_LANG); 224 228 $.each(cdbx_languages, function(key, val) { 225 options.append(new Option(val.name, key));229 options.append(new Option(val.name, val.id)); 226 230 }); 227 231 $(CDBX_LANG).val(cdbx_curLangId); … … 519 523 var output_div = document.getElementById(CDBX_ELEM_DIV_OUTPUT); 520 524 cdbx_executeHtmlCode(html, css, js, externalCss, externalJs, output_div); 525 }); 526 527 $(CDBX_OUTPUT_WEB_LINK).live(CDBX_EVENT_CLICK, function (e) { 528 if ($(this).attr('href') == "") { 529 e.preventDefault(); 530 } 521 531 }); 522 532 … … 763 773 var optionsEditor = $(CDBX_PREF_EDITOR); 764 774 $.each(cdbx_editor_type, function(key, val) { 765 optionsEditor.append(new Option(val.name, key));775 optionsEditor.append(new Option(val.name, val.id)); 766 776 }); 767 777 $(CDBX_PREF_EDITOR).val(cdbx_curEditorIdPref); … … 769 779 var optionsLang = $(CDBX_PREF_LANG); 770 780 $.each(cdbx_languages, function(key, val) { 771 optionsLang.append(new Option(val.name, key));781 optionsLang.append(new Option(val.name, val.id)); 772 782 }); 773 783 $(CDBX_PREF_LANG).val(cdbx_curLangIdPref); … … 775 785 var optionsTheme = $(CDBX_PREF_THEME); 776 786 $.each(cdbx_editor_theme, function(key, val) { 777 optionsTheme.append(new Option(val.name, key));787 optionsTheme.append(new Option(val.name, val.id)); 778 788 }); 779 789 $(CDBX_PREF_THEME).val(cdbx_curThemePrefId); -
code-editor-and-compiler/trunk/common/js/include.js
r1900373 r1900519 121 121 { id: 14, name: 'VB.Net', mode: 'ace/mode/vbscript', ext: '.vb' }, 122 122 { id: 15, name: 'Swift3', mode: 'ace/mode/objectivec', ext: '.swift' }, 123 { id: 16, name: 'Default', mode: 'ace/mode/c_cpp', ext: ''}123 { id: 9999, name: 'Default', mode: 'ace/mode/c_cpp', ext: '' } 124 124 ]; 125 125 … … 156 156 var cdbx_editor_css = null; 157 157 var cdbx_editor_js = null; 158 var cdbx_defLangId = cdbx_languages.length - 1; 158 var cdbx_defaultMode = 'ace/mode/c_cpp'; 159 var cdbx_defLangId = cdbx_languages[cdbx_languages.length - 1].id; 159 160 var cdbx_curLangId = cdbx_defLangId; 160 161 var cdbx_curLangIdPref = cdbx_defLangId; -
code-editor-and-compiler/trunk/compilebin.php
r1900373 r1900519 10 10 * Plugin URI: https://www.compilebin.com 11 11 * Description: Syntax highlighter and code compiler. 12 * Version: 1.3. 112 * Version: 1.3.2 13 13 * Author: Compilebin 14 14 * Author URI: https://www.compilebin.com -
code-editor-and-compiler/trunk/public/compilebin-public.php
r1897955 r1900519 7 7 public function __construct() { 8 8 $this->plugin_name = "code-editor-and-compiler"; 9 $this->plugin_version = "1.3. 1";9 $this->plugin_version = "1.3.2"; 10 10 add_action('wp_enqueue_scripts', array(&$this, 'enqueueScripts')); 11 11 add_action('wp_enqueue_scripts', array(&$this, 'enqueueStyles')); -
code-editor-and-compiler/trunk/public/js/editor-handler-public.js
r1897951 r1900519 236 236 var output_div = document.getElementById(CDBX_ELEM_DIV_OUTPUT); 237 237 cdbx_executeHtmlCode(html, css, js, externalCss, externalJs, output_div); 238 }); 239 240 $(CDBX_OUTPUT_WEB_LINK).live(CDBX_EVENT_CLICK, function (e) { 241 if ($(this).attr('href') == "") { 242 e.preventDefault(); 243 } 238 244 }); 239 245 -
code-editor-and-compiler/trunk/readme.txt
r1900373 r1900519 5 5 Requires at least: 3.1 6 6 Tested up to: 4.9.4 7 Stable tag: 1.3. 17 Stable tag: 1.3.2 8 8 Requires PHP: 5.2.4 9 9 License: GPLv2 or later … … 35 35 36 36 == Changelog == 37 1.3.2 38 Support for syntax highlighting of languages for which compilation feature is not available. 39 Bug fixes. 40 37 41 1.3.1 38 42 UI enhancement.
Note: See TracChangeset
for help on using the changeset viewer.