Javascript RegEx replacing " -
i'm trying patch drupal panels module fix this nasty issue, makes ajax errorhandler unreadable. error handler has this:
// replace < , > < , > error_text = error_text.replace("/&(lt|gt);/g", function (m, p) { return (p == "lt")? "<" : ">"; });
i've tried 2 approaches:
adding
// replace " ' readability, goodness sakes, per // http://drupal.org/node/1124042 error_text = error_text.replace(/"/g, "'");
modifying
// replace < , > < , > error_text = error_text.replace("/&(lt|gt|quot);/g", function (m, p) { return (p == "lt")? "<" : (p == "gt") ? ">" : "'"; });
yet neither has worked. little help?
edit: when printed out console (in ff4 or chrome) html entities not shown. resulting alert(""), however, looks so:
an error occurred @ /home/panels/ajax/editor/select-content/panel_context%3apage-faculty_page%3apage_faculty_page_panel_context/center. error description: [ { "command": "settings", "argument": { "basepath": "/home/", "admin_menu": { "margin_top": 1 }, "asu_webauth": { "callapp": >"home", quot;onlogouturl": "http://physics-dev.asu.edu" } } }, { "command": "css_files", "argument": [ { "file": "/home/modules/node/node.css?e", "media": "all" }, { "file": "/home/modules/system/defaults.css?e", "media": "all" }, { "file": "/home/modules/system/system.css?e", "media": "all" }, { "file": "/home/modules/system/system-menus.css?e", "media": "all" }, { "file": "/home/modules/user/user.css?e", "media": "all" }, { "file": "/home/sites/all/modules/admin_menu/admin_menu.css?e", "media": "all" }, { "file": "/home/sites/all/modules/cck/theme/content-module.css?e", "media": "all" }, { "file": "/home/sites/all/modules/ctools/css/ctools.css?e", "media": "all" }, { "file": "/home/sites/all/modules/date/date.css?e", "media": "all" }, { "file": "/home/sites/all/modules/filefield/filefield.css?e", "media": "all" }, { "file": "/home/sites/all/modules/office_hours/office_hours.css?e", "media": "all" }, { "file": "/home/sites/all/modules/og/theme/og.css?e", "media": "all" }, { "file": "/home/sites/all/modules/panels/css/panels.css?e", "media": "all" }, { "file": "/home/sites/all/modules/views_slideshow/contrib/views_slideshow_singleframe/views_slideshow.css?e", "media": "all" }, { "file": "/home/sites/all/modules/views_slideshow/contrib/views_slideshow_thumbnailhover/views_slideshow.css?e", "media": "all" }, { "file": "/home/misc/farbtastic/farbtastic.css?e", "media": "all" }, { "file": "/home/sites/all/modules/calendar/calendar.css?e", "media": "all" }, { "file": "/home/sites/all/modules/cck/modules/fieldgroup/fieldgroup.css?e", "media": "all" }, { "file": "/home/sites/all/modules/views/css/views.css?e", "media": "all" } ] }, { "command": "scripts", "argument": [ "/home/misc/jquery.js", "/home/misc/drupal.js", "/home/sites/all/modules/admin_menu/admin_menu.js", "/home/sites/all/modules/og/og.js", "/home/sites/all/modules/panels/js/panels.js", "/home/sites/all/modules/views_slideshow/js/jquery.cycle.all.min.js", "/home/sites/all/modules/views_slideshow/contrib/views_slideshow_singleframe/views_slideshow.js", "/home/sites/all/modules/views_slideshow/contrib/views_slideshow_thumbnailhover/views_slideshow.js", "/home/sites/all/modules/asu_webauth/asu_webauth.js" ] }, { "command": "modal_display", "title": "add content center", "output": "\x3cdiv class=\"panels-add-content-modal\"\x3e\x3cdiv class=\"panels-section-column panels-section-column-categories\"\x3e\x3cdiv class=\"inside\"\x3e\x3cdiv class=\"panels-categories-box\"\x3e\x3ca href=\"/home/panels/ajax/editor/select-content/panel_context%3apage-faculty_page%3apage_faculty_page_panel_context/center/activity\" class=\"ctools-use-ajax panels-modal-add-category\" title=\"\"\x3eactivity\x3c/a\x3e\x3ca href=\"/home/panels/ajax/editor/select-content/panel_context%3apage-faculty_page%3apage_faculty_page_panel_context/center/menus\" class=\"ctools-use-ajax panels-modal-add-category\" title=\"\"\x3emenus\x3c/a\x3e\x3ca href=\"/home/panels/ajax/editor/select-content/panel_context%3apage-faculty_page%3apage_faculty_page_panel_context/center/miscellaneous\" class=\"ctools-use-ajax panels-modal-add-category\" title=\"\"\x3emiscellaneous\x3c/a\x3e\x3ca href=\"/home/panels/ajax/editor/select-content/panel_context%3apage-faculty_page%3apage_faculty_page_panel_context/center/page-elements\" class=\"ctools-use-ajax panels-modal-add-category\" title=\"\"\x3epage elements\x3c/a\x3e\x3ca href=\"/home/panels/ajax/editor/select-content/panel_context%3apage-faculty_page%3apage_faculty_page_panel_context/center/view-panes\" class=\"ctools-use-ajax panels-modal-add-category\" title=\"\"\x3eview panes\x3c/a\x3e\x3ca href=\"/home/panels/ajax/editor/select-content/panel_context%3apage-faculty_page%3apage_faculty_page_panel_context/center/views\" class=\"ctools-use-ajax panels-modal-add-category\" title=\"\"\x3eviews\x3c/a\x3e\x3ca href=\"/home/panels/ajax/editor/select-content/panel_context%3apage-faculty_page%3apage_faculty_page_panel_context/center/widgets\" class=\"ctools-use-ajax panels-modal-add-category\" title=\"\"\x3ewidgets\x3c/a\x3e\x3c/div\x3e\x3cdiv class=\"content-type-button clear-block\"\x3e\x3ca href=\"/home/panels/ajax/editor/add-pane/panel_context%3apage-faculty_page%3apage_faculty_page_panel_context/center/node/node\" class=\"ctools-use-ajax panels-modal-add-config\" title=\"add node site content.\"\x3e\x3cimg src=\"/home/sites/all/modules/ctools/plugins/content_types/node/icon_node.png\" alt=\"\" title=\"\" width=\"16\" height=\"16\" /\x3e\x3c/a\x3e\x3cdiv\x3e\x3ca href=\"/home/panels/ajax/editor/add-pane/panel_context%3apage-faculty_page%3apage_faculty_page_panel_context/center/node/node\" class=\"ctools-use-ajax panels-modal-add-config\" title=\"add node site content.\"\x3eexisting node\x3c/a\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class=\"content-type-button clear-block\"\x3e\x3ca href=\"/home/panels/ajax/editor/add-pane/panel_context%3apage-faculty_page%3apage_faculty_page_panel_context/center/custom/custom\" class=\"ctools-use-ajax panels-modal-add-config\" title=\"create custom piece of html content.\"\x3e\x3cimg src=\"/home/sites/all/modules/ctools/images/no-icon.png\" alt=\"\" title=\"\" width=\"16\" height=\"16\" /\x3e\x3c/a\x3e\x3cdiv\x3e\x3ca href=\"/home/panels/ajax/editor/add-pane/panel_context%3apage-faculty_page%3apage_faculty_page_panel_context/center/custom/custom\" class=\"ctools-use-ajax panels-modal-add-config\" title=\"create custom piece of html content.\"\x3enew custom content\x3c/a\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class=\"panels-categories-description\"\x3econtent options divided category. please select category left proceed.\x3c/div\x3e\x3c/div\x3e" } ]
remove quotes around regex
error_text = error_text.replace(/&(lt|gt|quot);/g, function (m, p) { return (p == "lt")? "<" : (p == "gt") ? ">" : "'"; });
Comments
Post a Comment