Plugin Directory

Changeset 1900519


Ignore:
Timestamp:
06/28/2018 11:57:50 AM (8 years ago)
Author:
rahburma
Message:

support for syntax highlighting of languages for which compilation feature is not available

Location:
code-editor-and-compiler/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • code-editor-and-compiler/trunk/admin/compilebin-admin.php

    r1900373 r1900519  
    77   public function __construct() {
    88      $this->plugin_name = "code-editor-and-compiler";
    9       $this->plugin_version = "1.3.1";
     9      $this->plugin_version = "1.3.2";
    1010      add_action('admin_notices', array($this, 'plugin_activation'));
    1111      add_action('deactivated_plugin', array($this, 'plugin_deactivation'));   
     
    8585      $response = wp_remote_post($url, array(
    8686          'body' => $postData,
     87          'timeout' => 20
    8788        )
    8889      );
     90
     91      //print_r($response);   
    8992
    9093      echo $response['body'];
     
    111114      $response = wp_remote_post($url, array(
    112115          'body' => $postData,
     116          'timeout' => 20
    113117        )
    114118      );
  • code-editor-and-compiler/trunk/admin/js/editor-handler.js

    r1900373 r1900519  
    2323
    2424        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           }
    2731        };
    2832       
     
    106110
    107111             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>';
    109113             }
    110114
     
    192196               success: function(data, textStatus, jqXHR) {
    193197                  var output = JSON.parse(data).output.replace(/\n/g, '<br />');
    194                   $(CDBX_DIV_OUTPUT).html(output);
     198                  $(CDBX_DIV_OUTPUT).html(output); 
    195199               },
    196200               error: function(jqXHR, textStatus, errorThrown) {
     
    223227              var options = $(CDBX_LANG);
    224228              $.each(cdbx_languages, function(key, val) {
    225                 options.append(new Option(val.name, key));
     229                options.append(new Option(val.name, val.id));
    226230              });
    227231              $(CDBX_LANG).val(cdbx_curLangId);
     
    519523            var output_div = document.getElementById(CDBX_ELEM_DIV_OUTPUT);
    520524            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            }
    521531        });
    522532
     
    763773            var optionsEditor = $(CDBX_PREF_EDITOR);
    764774              $.each(cdbx_editor_type, function(key, val) {
    765                 optionsEditor.append(new Option(val.name, key));
     775                optionsEditor.append(new Option(val.name, val.id));
    766776              });
    767777            $(CDBX_PREF_EDITOR).val(cdbx_curEditorIdPref);
     
    769779            var optionsLang = $(CDBX_PREF_LANG);
    770780              $.each(cdbx_languages, function(key, val) {
    771                 optionsLang.append(new Option(val.name, key));
     781                optionsLang.append(new Option(val.name, val.id));
    772782              });
    773783            $(CDBX_PREF_LANG).val(cdbx_curLangIdPref);
     
    775785            var optionsTheme = $(CDBX_PREF_THEME);
    776786              $.each(cdbx_editor_theme, function(key, val) {
    777                 optionsTheme.append(new Option(val.name, key));
     787                optionsTheme.append(new Option(val.name, val.id));
    778788              });
    779789            $(CDBX_PREF_THEME).val(cdbx_curThemePrefId);
  • code-editor-and-compiler/trunk/common/js/include.js

    r1900373 r1900519  
    121121    { id: 14,    name: 'VB.Net',      mode: 'ace/mode/vbscript',   ext: '.vb'    },
    122122    { 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: ''       }
    124124];
    125125
     
    156156var cdbx_editor_css = null;
    157157var cdbx_editor_js = null;
    158 var cdbx_defLangId = cdbx_languages.length - 1;
     158var cdbx_defaultMode = 'ace/mode/c_cpp';
     159var cdbx_defLangId = cdbx_languages[cdbx_languages.length - 1].id;
    159160var cdbx_curLangId = cdbx_defLangId;
    160161var cdbx_curLangIdPref = cdbx_defLangId;
  • code-editor-and-compiler/trunk/compilebin.php

    r1900373 r1900519  
    1010 * Plugin URI:        https://www.compilebin.com
    1111 * Description:       Syntax highlighter and code compiler.
    12  * Version:           1.3.1
     12 * Version:           1.3.2
    1313 * Author:            Compilebin
    1414 * Author URI:        https://www.compilebin.com
  • code-editor-and-compiler/trunk/public/compilebin-public.php

    r1897955 r1900519  
    77   public function __construct() {
    88      $this->plugin_name = "code-editor-and-compiler";
    9       $this->plugin_version = "1.3.1";
     9      $this->plugin_version = "1.3.2";
    1010      add_action('wp_enqueue_scripts', array(&$this, 'enqueueScripts'));
    1111      add_action('wp_enqueue_scripts', array(&$this, 'enqueueStyles'));
  • code-editor-and-compiler/trunk/public/js/editor-handler-public.js

    r1897951 r1900519  
    236236            var output_div = document.getElementById(CDBX_ELEM_DIV_OUTPUT);
    237237            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            }
    238244        });
    239245
  • code-editor-and-compiler/trunk/readme.txt

    r1900373 r1900519  
    55Requires at least: 3.1
    66Tested up to: 4.9.4
    7 Stable tag: 1.3.1
     7Stable tag: 1.3.2
    88Requires PHP: 5.2.4
    99License: GPLv2 or later
     
    3535
    3636== Changelog ==
     371.3.2
     38Support for syntax highlighting of languages for which compilation feature is not available.
     39Bug fixes.
     40
    37411.3.1
    3842UI enhancement.
Note: See TracChangeset for help on using the changeset viewer.