Merge branch 'MDL-41098-master-fix1' of git://github.com/damyon/moodle

This commit is contained in:
Dan Poltawski
2013-08-28 10:00:46 +08:00
5 changed files with 53 additions and 4 deletions
+49
View File
@@ -0,0 +1,49 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Atto text editor installation steps.
*
* @package editor_atto
* @copyright 2013 Damyon Wiese <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Enable this text editor by default.
*
* @return bool
*/
function xmldb_editor_atto_install() {
global $CFG;
// Get the current list of editors.
$currentconfig = $CFG->texteditors;
if (is_null($currentconfig)) {
$currentconfig = '';
}
$editors = explode(',', $currentconfig);
// Insert atto in the second position.
array_splice($editors, 1, 0, array('atto'));
// Remove duplicates.
$editors = array_unique($editors);
// Set the new config.
unset_config('texteditors');
set_config('texteditors', implode(',', $editors));
return true;
}
@@ -284,7 +284,7 @@ M.editor_atto = M.editor_atto || {
cssfont = css.responseText.substring(pos + 'font:'.length, css.responseText.length - 1);
atto.setStyle('font', cssfont);
}
atto.setStyle('min-height', (1.2 * (textarea.getAttribute('rows') - 1)) + 'em');
atto.setStyle('minHeight', (1.2 * (textarea.getAttribute('rows') - 1)) + 'em');
// Copy text to editable div.
atto.append(textarea.get('value'));
File diff suppressed because one or more lines are too long
@@ -284,7 +284,7 @@ M.editor_atto = M.editor_atto || {
cssfont = css.responseText.substring(pos + 'font:'.length, css.responseText.length - 1);
atto.setStyle('font', cssfont);
}
atto.setStyle('min-height', (1.2 * (textarea.getAttribute('rows') - 1)) + 'em');
atto.setStyle('minHeight', (1.2 * (textarea.getAttribute('rows') - 1)) + 'em');
// Copy text to editable div.
atto.append(textarea.get('value'));
+1 -1
View File
@@ -282,7 +282,7 @@ M.editor_atto = M.editor_atto || {
cssfont = css.responseText.substring(pos + 'font:'.length, css.responseText.length - 1);
atto.setStyle('font', cssfont);
}
atto.setStyle('min-height', (1.2 * (textarea.getAttribute('rows') - 1)) + 'em');
atto.setStyle('minHeight', (1.2 * (textarea.getAttribute('rows') - 1)) + 'em');
// Copy text to editable div.
atto.append(textarea.get('value'));