Pasar al contenido principal
Alberto Permuy Leal

Menú de navegación

  • Home
  • Blog
  • Proyectos
  • Arsenal
  • Conciertos
  • Acerca de
  • Contacto

Ruta de navegación

  1. Inicio
  2. Blog de Alberto Permuy Leal

Habilitar CKEditor para Chrome y Safari en Moodle

Por Un veloz murci… (no verificado), 19 Diciembre, 2010

Para que el editor WYSIWYG CKEditor pueda "funcionar" correctamente en Chrome y Safari modificaremos

Fichero: /lib/moodlelib.php

Donde nos topamos con :


function can_use_html_editor() {
global $USER, $CFG;

if (!empty($USER->htmleditor) and !empty($CFG->htmleditor)) {
if (check_browser_version('MSIE', 5.5)) {
return 'MSIE';
} else if (check_browser_version('Gecko', 20030516)) {
return 'Gecko';
}
}
return false;
}

usaremos este código :


function can_use_html_editor() {
global $USER, $CFG;

if (!empty($USER->htmleditor) and !empty($CFG->htmleditor)) {
if (check_browser_version('MSIE', 5.5)) {
return 'MSIE';
} else if (check_browser_version('Gecko', 20030516)) {
return 'Gecko';
}
else {

return 1;

}
}
return false;
}

Fichero /lib/editor/htmlarea/htmlarea.php

Donde nos topamos con:

HTMLArea.checkSupportedBrowser = function() {
if (HTMLArea.is_gecko) {
if (navigator.productSub 20021201) {
alert("You need at least Mozilla-1.3 Alpha.\n" +
"Sorry, your Gecko is not supported.");
return false;
}
if (navigator.productSub 20030210) {
alert("Mozilla 1.3 Beta is not supported!\n" +
"I'll try, though, but it might not work.");
}
}
if(HTMLArea.is_safari) {
return false;
}
return HTMLArea.is_gecko || HTMLArea.is_ie;
};

deberíamos ....


HTMLArea.checkSupportedBrowser = function() {
if (HTMLArea.is_gecko) {
if (navigator.productSub 20021201) {
alert("You need at least Mozilla-1.3 Alpha.\n" +
"Sorry, your Gecko is not supported.");
return false;
}
if (navigator.productSub 20030210) {
//alert("Mozilla 1.3 Beta is not supported!\n" +
// "I'll try, though, but it might not work.");
return 'HTMLArea.is_gecko';
}
}
if(HTMLArea.is_safari) {
//return false;
return 'HTMLArea.is_gecko';
}
return HTMLArea.is_gecko || HTMLArea.is_ie;
};

Visto en http://lewiscarr.co.uk/

Quizá te interesen estos artículos...

Cuaderno de bitácora: migración abeancos.gal - Nota 1

Publicado el 16/06/2025

Como descargar música desde Spotify con docker en Linux

Publicado el 10/05/2025

Activar Wake On LAN (wol) al iniciar Debian 12

Publicado el 28/09/2024

Aviso legal 


Este obra está bajo una licencia de Creative Commons Reconocimiento-NoComercial-CompartirIgual 4.0 Internacional.

Sígueme en Mastodon

Powered by Drupal