diff --git a/lib/editor/atto/styles.css b/lib/editor/atto/styles.css
index 6511ee9f515..2acc6590b5d 100644
--- a/lib/editor/atto/styles.css
+++ b/lib/editor/atto/styles.css
@@ -1,24 +1,29 @@
-div.editor_atto {
+.editor_atto_content_wrap {
background-color: white;
- border: 1px solid #BBB;
- width: 100%;
+}
+.editor_atto_content {
+ padding: 4px;
}
+.editor_atto_content_wrap,
.editor_atto + textarea {
width: 100%;
padding: 0;
- resize: vertical;
- border-radius: 0;
border: 1px solid #BBB;
+ border-top: none;
+}
+
+.editor_atto + textarea {
+ border-radius: 0;
+ resize: vertical;
+ margin-top: -1px;
}
div.editor_atto_toolbar {
display: block;
background: #F2F2F2;
min-height: 42px;
- border-top: 1px solid #BBB;
- border-left: 1px solid #BBB;
- border-right: 1px solid #BBB;
+ border: 1px solid #BBB;
width: 100%;
padding: 0 0 9px 0;
}
@@ -53,7 +58,7 @@ div.editor_atto_toolbar div.atto_group {
background: #FFF;
}
-.editor_atto img {
+.editor_atto_content img {
resize: both; overflow: auto;
}
diff --git a/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-debug.js b/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-debug.js
index 96ccd495ef5..ccdc137dc2a 100644
--- a/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-debug.js
+++ b/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-debug.js
@@ -15,15 +15,34 @@ YUI.add('moodle-editor_atto-editor', function (Y, NAME) {
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see .
+/**
+ * Atto editor.
+ *
+ * @package editor_atto
+ * @copyright 2013 Damyon Wiese
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+/**
+ * Classes constants.
+ */
+CSS = {
+ CONTENT: 'editor_atto_content',
+ CONTENTWRAPPER: 'editor_atto_content_wrap',
+ TOOLBAR: 'editor_atto_toolbar',
+ WRAPPER: 'editor_atto'
+};
+
/**
* Atto editor main class.
* Common functions required by editor plugins.
*
- * @package editor-atto
+ * @package editor_atto
* @copyright 2013 Damyon Wiese
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
M.editor_atto = M.editor_atto || {
+
/**
* List of attached button handlers to prevent duplicates.
*/
@@ -309,12 +328,22 @@ M.editor_atto = M.editor_atto || {
*/
init : function(params) {
var textarea = Y.one('#' +params.elementid);
+ var wrapper = Y.Node.create('');
var atto = Y.Node.create('');
+ 'class="' + CSS.CONTENT + '" />');
+
var cssfont = '';
- var toolbar = Y.Node.create('');
+ var toolbar = Y.Node.create('');
+
+ // Editable content wrapper.
+ var content = Y.Node.create('');
+ content.appendChild(atto);
+
+ // Add everything to the wrapper.
+ wrapper.appendChild(toolbar);
+ wrapper.appendChild(content);
// Bleh - why are we sent a url and not the css to apply directly?
var css = Y.io(params.content_css, { sync: true });
@@ -328,10 +357,8 @@ M.editor_atto = M.editor_atto || {
// Copy text to editable div.
atto.append(textarea.get('value'));
- // Add the toolbar to the page.
- textarea.get('parentNode').insert(toolbar, textarea);
- // Add the editable div to the page.
- textarea.get('parentNode').insert(atto, textarea);
+ // Add the toolbar and editable zone to the page.
+ textarea.get('parentNode').insert(wrapper, textarea);
atto.setStyle('color', textarea.getStyle('color'));
atto.setStyle('lineHeight', textarea.getStyle('lineHeight'));
atto.setStyle('fontSize', textarea.getStyle('fontSize'));
diff --git a/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js b/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
index 21a2acec687..6bf193f3e92 100644
--- a/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
+++ b/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
@@ -1,2 +1,2 @@
-YUI.add("moodle-editor_atto-editor",function(e,t){M.editor_atto=M.editor_atto||{buttonhandlers:{},menus:{},menuhandlers:{},filepickeroptions:{},widgets:{},showhide_menu_handler:function(e){e.preventDefault();var t=this.getAttribute("disabled"),n=this.getAttribute("data-menu"),r=M.editor_atto.menus[n],i=r.get("bodyContent");r.get("visible")||t?(r.hide(),i.detach("clickoutside")):(i.on("clickoutside",function(e){e.target.ancestor()!==this&&e.target!==this&&r.get("visible")&&(i.detach("clickoutside"),r.hide())},this),r.show())},buttonclicked_handler:function(e){var t=this.getAttribute("data-editor"),n=this.getAttribute("data-plugin"),r=this.getAttribute("data-handler"),i=M.editor_atto.menus[n+"_"+t];i&&i.hide();if(M.editor_atto.is_enabled(t,n))return r=M.editor_atto.buttonhandlers[r],r(e,t)},is_enabled:function(t,n){var r=e.one("#"+t+"_toolbar .atto_"+n+"_button");return!r.hasAttribute("disabled")},disable_all_widgets:function(t){var n,r;for(n in M.editor_atto.widgets)r=e.one("#"+t+"_toolbar .atto_"+n+"_button"),r&&r.setAttribute("disabled","true")},enable_widget:function(t,n){var r=e.one("#"+t+"_toolbar .atto_"+n+"_button");r&&r.removeAttribute("disabled")},enable_all_widgets:function(t){var n,r;for(n in M.editor_atto.widgets)r=e.one("#"+t+"_toolbar .atto_"+n+"_button"),r&&r.removeAttribute("disabled")},add_toolbar_menu:function(t,n,r,i,s){var o=e.one("#"+t+"_toolbar"),u=e.one("#"+t+"_toolbar .atto_group."+i+"_group"),a,f;u||(u=e.Node.create(''),o.append(u)),f=e.Node.create('"),u.append(f),a=o.getAttribute("aria-activedescendant"),a||(f.setAttribute("tabindex","0"),o.setAttribute("aria-activedescendant",f.generateID())),M.editor_atto.widgets[n]=n;var l=e.Node.create(''),c=0,h={};for(c=0;c