Permalink
Browse files

MDL-16336: add Chrome to browser identification to display HMTL editor.

  • Loading branch information...
1 parent 064f325 commit c476a2ecfcf850a2a7d3b1e8fa5f91cd8ba03cc0 @rwijaya rwijaya committed Nov 18, 2010
Showing with 6 additions and 0 deletions.
  1. +4 −0 lib/editor/htmlarea/htmlarea.php
  2. +2 −0 lib/moodlelib.php
@@ -2371,6 +2371,7 @@ classAttr = classAttr.replace(/multilang/, '').trim();
HTMLArea.is_win_ie = (HTMLArea.is_ie && !HTMLArea.is_mac);
HTMLArea.is_gecko = (navigator.product == "Gecko");
HTMLArea.is_safari = (HTMLArea.agt.indexOf("safari") != -1);
+HTMLArea.is_webkit = (HTMLArea.agt.indexOf("applewebkit") != -1); // eg: chrome
// variable used to pass the object to the popup editor window.
HTMLArea._object = null;
@@ -2398,6 +2399,9 @@ classAttr = classAttr.replace(/multilang/, '').trim();
// FIXME!!! this should return false for IE < 5.5
HTMLArea.checkSupportedBrowser = function() {
+ if (HTMLArea.is_webkit) {
+ return true;
+ }
if (HTMLArea.is_gecko) {
if (navigator.productSub < 20021201) {
alert("You need at least Mozilla-1.3 Alpha.\n" +
View
@@ -6528,6 +6528,8 @@ function can_use_html_editor() {
return 'MSIE';
} else if (check_browser_version('Gecko', 20030516)) {
return 'Gecko';
+ } else if (check_browser_version('Safari', 531)) {
+ return 'AppleWebKit';
}
}
return false;

0 comments on commit c476a2e

Please sign in to comment.