Skip to content

Commit

Permalink
Merge pull request #19 from devgeniem/red-color-support
Browse files Browse the repository at this point in the history
added support for red colors
  • Loading branch information
JuhaniGeniem authored Feb 25, 2021
2 parents 5fd2828 + 538868c commit bafc8ce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion js/jquery.jsonview.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ https://github.com/yesmeck/jquery-jsonview

JSONFormatter.prototype.htmlEncode = function(html) {
if (html !== null) {
return html.toString().replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
var htmlEncoded = html.toString().replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");

htmlEncoded = htmlEncoded.replace("[RED]", "<span style='color: red;'>").replace("[/RED]", "</span>");

return htmlEncoded;
} else {
return '';
}
Expand Down
6 changes: 3 additions & 3 deletions plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin Name: DustPress Debugger
* Plugin URI: https://github.com/devgeniem/dustpress-debugger
* Description: Provides handy ajaxified debugger tool for DustPress based themes.
* Version: 1.5.5
* Version: 1.6.0
* Author: Geniem Oy / Miika Arponen & Ville Siltala
* Author URI: http://www.geniem.com
*/
Expand Down Expand Up @@ -47,11 +47,11 @@ public static function init() {
)
) {
// Register the debugger script
wp_register_script('dustpress_debugger', plugin_dir_url(__FILE__) . 'js/dustpress-debugger.js', ['jquery'], '1.5.2', true);
wp_register_script('dustpress_debugger', plugin_dir_url(__FILE__) . 'js/dustpress-debugger.js', ['jquery'], '1.6.0', true);

// JsonView jQuery plugin
wp_enqueue_style('jquery.jsonview', plugin_dir_url(__FILE__) . 'css/jquery.jsonview.css', null, null, null);
wp_enqueue_script('jquery.jsonview', plugin_dir_url(__FILE__) . 'js/jquery.jsonview.js', ['jquery'], null, true);
wp_enqueue_script('jquery.jsonview', plugin_dir_url(__FILE__) . 'js/jquery.jsonview.js', ['jquery'], '1.6.0', true);

// Register debugger ajax hook
add_action('wp_ajax_dustpress_debugger', array(__CLASS__, 'get_debugger_data'));
Expand Down

0 comments on commit bafc8ce

Please sign in to comment.