Merge branch 'MDL-41993-master-fix1' of git://github.com/damyon/moodle
This commit is contained in:
Vendored
+2
@@ -30,6 +30,8 @@ M.atto_bold = M.atto_bold || {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
document.execCommand('bold', false, null);
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
};
|
||||
|
||||
M.editor_atto.add_toolbar_button(params.elementid, 'bold', params.icon, params.group, click);
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
YUI.add("moodle-atto_bold-button",function(e,t){M.atto_bold=M.atto_bold||{init:function(e){var t=function(e,t){e.preventDefault(),M.editor_atto.is_active(t)||M.editor_atto.focus(t),document.execCommand("bold",!1,null)};M.editor_atto.add_toolbar_button(e.elementid,"bold",e.icon,e.group,t)}}},"@VERSION@",{requires:["node"]});
|
||||
YUI.add("moodle-atto_bold-button",function(e,t){M.atto_bold=M.atto_bold||{init:function(e){var t=function(e,t){e.preventDefault(),M.editor_atto.is_active(t)||M.editor_atto.focus(t),document.execCommand("bold",!1,null),M.editor_atto.text_updated(t)};M.editor_atto.add_toolbar_button(e.elementid,"bold",e.icon,e.group,t)}}},"@VERSION@",{requires:["node"]});
|
||||
|
||||
+2
@@ -30,6 +30,8 @@ M.atto_bold = M.atto_bold || {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
document.execCommand('bold', false, null);
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
};
|
||||
|
||||
M.editor_atto.add_toolbar_button(params.elementid, 'bold', params.icon, params.group, click);
|
||||
|
||||
@@ -28,6 +28,8 @@ M.atto_bold = M.atto_bold || {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
document.execCommand('bold', false, null);
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
};
|
||||
|
||||
M.editor_atto.add_toolbar_button(params.elementid, 'bold', params.icon, params.group, click);
|
||||
|
||||
Vendored
+2
@@ -30,6 +30,8 @@ M.atto_clear = M.atto_clear || {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
document.execCommand('removeFormat', false);
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
};
|
||||
|
||||
M.editor_atto.add_toolbar_button(params.elementid, 'clear', params.icon, params.group, click);
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
YUI.add("moodle-atto_clear-button",function(e,t){M.atto_clear=M.atto_clear||{init:function(e){var t=function(e,t){e.preventDefault(),M.editor_atto.is_active(t)||M.editor_atto.focus(t),document.execCommand("removeFormat",!1)};M.editor_atto.add_toolbar_button(e.elementid,"clear",e.icon,e.group,t)}}},"@VERSION@",{requires:["node"]});
|
||||
YUI.add("moodle-atto_clear-button",function(e,t){M.atto_clear=M.atto_clear||{init:function(e){var t=function(e,t){e.preventDefault(),M.editor_atto.is_active(t)||M.editor_atto.focus(t),document.execCommand("removeFormat",!1),M.editor_atto.text_updated(t)};M.editor_atto.add_toolbar_button(e.elementid,"clear",e.icon,e.group,t)}}},"@VERSION@",{requires:["node"]});
|
||||
|
||||
Vendored
+2
@@ -30,6 +30,8 @@ M.atto_clear = M.atto_clear || {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
document.execCommand('removeFormat', false);
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
};
|
||||
|
||||
M.editor_atto.add_toolbar_button(params.elementid, 'clear', params.icon, params.group, click);
|
||||
|
||||
@@ -28,6 +28,8 @@ M.atto_clear = M.atto_clear || {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
document.execCommand('removeFormat', false);
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
};
|
||||
|
||||
M.editor_atto.add_toolbar_button(params.elementid, 'clear', params.icon, params.group, click);
|
||||
|
||||
Vendored
+4
-2
@@ -113,7 +113,7 @@ M.atto_image = M.atto_image || {
|
||||
image.src = params.url;
|
||||
}
|
||||
},
|
||||
set_image : function(e) {
|
||||
set_image : function(e, elementid) {
|
||||
e.preventDefault();
|
||||
M.atto_image.dialogue.hide();
|
||||
|
||||
@@ -143,6 +143,8 @@ M.atto_image = M.atto_image || {
|
||||
} else {
|
||||
document.execCommand('insertHTML', false, imagehtml);
|
||||
}
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
}
|
||||
},
|
||||
get_form_content : function(elementid) {
|
||||
@@ -174,7 +176,7 @@ M.atto_image = M.atto_image || {
|
||||
'</form>' +
|
||||
'<hr/>' + M.util.get_string('accessibilityhint', 'atto_image'));
|
||||
|
||||
content.one('#atto_image_urlentrysubmit').on('click', M.atto_image.set_image);
|
||||
content.one('#atto_image_urlentrysubmit').on('click', M.atto_image.set_image, this, elementid);
|
||||
content.one('#openimagebrowser').on('click', M.atto_image.open_filepicker);
|
||||
return content;
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
YUI.add("moodle-atto_image-button",function(e,t){M.atto_image=M.atto_image||{dialogue:null,selection:null,init:function(t){var n=function(t,n){t.preventDefault(),M.editor_atto.is_active(n)||M.editor_atto.focus(n),M.atto_image.selection=M.editor_atto.get_selection();if(M.atto_image.selection!==!1){var r;M.atto_image.dialogue?r=M.atto_image.dialogue:r=new M.core.dialogue({visible:!1,modal:!0,close:!0,draggable:!0}),r.set("bodyContent",M.atto_image.get_form_content(n)),r.set("headerContent",M.util.get_string("createimage","atto_image")),r.render(),r.centerDialogue(),M.atto_image.dialogue=r;var i=M.editor_atto.get_selection_text(),s=0,o=[];for(s=0;s<i.childNodes.length;s++){var u=i.childNodes[0];o.length===0&&(u.nodeName.toLowerCase()==="img"?o[0]=u:u.getElementsByTagName&&(o=u.getElementsByTagName("img")))}if(o.length>0){var a=e.one(o[0]),f=a.getAttribute("width"),l=a.getAttribute("height");f>0&&e.one("#atto_image_widthentry").set("value",f),l>0&&e.one("#atto_image_heightentry").set("value",l),e.one("#atto_image_preview").set("src",a.get("src")),e.one("#atto_image_preview").setStyle("display","inline"),e.one("#atto_image_altentry").set("value",a.get("alt")),e.one("#atto_image_urlentry").set("value",a.get("src"))}r.show()}};M.editor_atto.add_toolbar_button(t.elementid,"image",t.icon,t.group,n,this)},open_filepicker:function(e){var t=this.getAttribute("data-editor");e.preventDefault(),M.editor_atto.show_filepicker(t,"image",M.atto_image.filepicker_callback)},filepicker_callback:function(t){if(t.url!==""){var n=e.one("#atto_image_urlentry");n.set("value",t.url),n=e.one("#atto_image_altentry"),n.set("value",t.file);var r=new Image;r.onload=function(){e.one("#atto_image_widthentry").set("value",this.width),e.one("#atto_image_heightentry").set("value",this.height),e.one("#atto_image_preview").set("src",this.src),e.one("#atto_image_preview").setStyle("display","inline")},r.src=t.url}},set_image:function(t){t.preventDefault(),M.atto_image.dialogue.hide();var n=t.currentTarget.get("parentNode").one("#atto_image_urlentry"),r=n.get("value");n=t.currentTarget.get("parentNode").one("#atto_image_altentry");var i=n.get("value");n=t.currentTarget.get("parentNode").one("#atto_image_widthentry");var s=n.get("value");n=t.currentTarget.get("parentNode").one("#atto_image_heightentry");var o=n.get("value");if(r!==""&&i!==""){M.editor_atto.set_selection(M.atto_image.selection);var u='<img src="'+e.Escape.html(r)+'" alt="'+e.Escape.html(i)+'"';s&&(u+=' width="'+e.Escape.html(s)+'"'),o&&(u+=' height="'+e.Escape.html(o)+'"'),u+='"/>',document.selection&&document.selection.createRange().pasteHTML?document.selection.createRange().pasteHTML(u):document.execCommand("insertHTML",!1,u)}},get_form_content:function(t){var n=e.Node.create('<form class="atto_form"><label for="atto_image_urlentry">'+M.util.get_string("enterurl","atto_image")+"</label>"+'<input type="url" value="" id="atto_image_urlentry" size="32"/>'+'<label for="atto_image_altentry">'+M.util.get_string("enteralt","atto_image")+"</label>"+'<input type="text" value="" id="atto_image_altentry" size="32" required="true"/>'+'<label for="atto_image_widthentry">'+M.util.get_string("width","atto_image")+"</label>"+'<input type="text" value="" id="atto_image_widthentry" size="10"/>'+"<br/>"+'<label for="atto_image_heightentry">'+M.util.get_string("height","atto_image")+"</label>"+'<input type="text" value="" id="atto_image_heightentry" size="10"/>'+'<label for="atto_image_preview">'+M.util.get_string("preview","atto_image")+"</label>"+'<img src="#" width="200" id="atto_image_preview" alt="" style="display: none;"/>'+"<hr/>"+'<button id="openimagebrowser" data-editor="'+e.Escape.html(t)+'">'+M.util.get_string("browserepositories","atto_image")+"</button>"+"<hr/>"+'<button id="atto_image_urlentrysubmit">'+M.util.get_string("createimage","atto_image")+"</button>"+"</form>"+"<hr/>"+M.util.get_string("accessibilityhint","atto_image"));return n.one("#atto_image_urlentrysubmit").on("click",M.atto_image.set_image),n.one("#openimagebrowser").on("click",M.atto_image.open_filepicker),n}}},"@VERSION@",{requires:["node","escape"]});
|
||||
YUI.add("moodle-atto_image-button",function(e,t){M.atto_image=M.atto_image||{dialogue:null,selection:null,init:function(t){var n=function(t,n){t.preventDefault(),M.editor_atto.is_active(n)||M.editor_atto.focus(n),M.atto_image.selection=M.editor_atto.get_selection();if(M.atto_image.selection!==!1){var r;M.atto_image.dialogue?r=M.atto_image.dialogue:r=new M.core.dialogue({visible:!1,modal:!0,close:!0,draggable:!0}),r.set("bodyContent",M.atto_image.get_form_content(n)),r.set("headerContent",M.util.get_string("createimage","atto_image")),r.render(),r.centerDialogue(),M.atto_image.dialogue=r;var i=M.editor_atto.get_selection_text(),s=0,o=[];for(s=0;s<i.childNodes.length;s++){var u=i.childNodes[0];o.length===0&&(u.nodeName.toLowerCase()==="img"?o[0]=u:u.getElementsByTagName&&(o=u.getElementsByTagName("img")))}if(o.length>0){var a=e.one(o[0]),f=a.getAttribute("width"),l=a.getAttribute("height");f>0&&e.one("#atto_image_widthentry").set("value",f),l>0&&e.one("#atto_image_heightentry").set("value",l),e.one("#atto_image_preview").set("src",a.get("src")),e.one("#atto_image_preview").setStyle("display","inline"),e.one("#atto_image_altentry").set("value",a.get("alt")),e.one("#atto_image_urlentry").set("value",a.get("src"))}r.show()}};M.editor_atto.add_toolbar_button(t.elementid,"image",t.icon,t.group,n,this)},open_filepicker:function(e){var t=this.getAttribute("data-editor");e.preventDefault(),M.editor_atto.show_filepicker(t,"image",M.atto_image.filepicker_callback)},filepicker_callback:function(t){if(t.url!==""){var n=e.one("#atto_image_urlentry");n.set("value",t.url),n=e.one("#atto_image_altentry"),n.set("value",t.file);var r=new Image;r.onload=function(){e.one("#atto_image_widthentry").set("value",this.width),e.one("#atto_image_heightentry").set("value",this.height),e.one("#atto_image_preview").set("src",this.src),e.one("#atto_image_preview").setStyle("display","inline")},r.src=t.url}},set_image:function(t,n){t.preventDefault(),M.atto_image.dialogue.hide();var r=t.currentTarget.get("parentNode").one("#atto_image_urlentry"),i=r.get("value");r=t.currentTarget.get("parentNode").one("#atto_image_altentry");var s=r.get("value");r=t.currentTarget.get("parentNode").one("#atto_image_widthentry");var o=r.get("value");r=t.currentTarget.get("parentNode").one("#atto_image_heightentry");var u=r.get("value");if(i!==""&&s!==""){M.editor_atto.set_selection(M.atto_image.selection);var a='<img src="'+e.Escape.html(i)+'" alt="'+e.Escape.html(s)+'"';o&&(a+=' width="'+e.Escape.html(o)+'"'),u&&(a+=' height="'+e.Escape.html(u)+'"'),a+='"/>',document.selection&&document.selection.createRange().pasteHTML?document.selection.createRange().pasteHTML(a):document.execCommand("insertHTML",!1,a),M.editor_atto.text_updated(n)}},get_form_content:function(t){var n=e.Node.create('<form class="atto_form"><label for="atto_image_urlentry">'+M.util.get_string("enterurl","atto_image")+"</label>"+'<input type="url" value="" id="atto_image_urlentry" size="32"/>'+'<label for="atto_image_altentry">'+M.util.get_string("enteralt","atto_image")+"</label>"+'<input type="text" value="" id="atto_image_altentry" size="32" required="true"/>'+'<label for="atto_image_widthentry">'+M.util.get_string("width","atto_image")+"</label>"+'<input type="text" value="" id="atto_image_widthentry" size="10"/>'+"<br/>"+'<label for="atto_image_heightentry">'+M.util.get_string("height","atto_image")+"</label>"+'<input type="text" value="" id="atto_image_heightentry" size="10"/>'+'<label for="atto_image_preview">'+M.util.get_string("preview","atto_image")+"</label>"+'<img src="#" width="200" id="atto_image_preview" alt="" style="display: none;"/>'+"<hr/>"+'<button id="openimagebrowser" data-editor="'+e.Escape.html(t)+'">'+M.util.get_string("browserepositories","atto_image")+"</button>"+"<hr/>"+'<button id="atto_image_urlentrysubmit">'+M.util.get_string("createimage","atto_image")+"</button>"+"</form>"+"<hr/>"+M.util.get_string("accessibilityhint","atto_image"));return n.one("#atto_image_urlentrysubmit").on("click",M.atto_image.set_image,this,t),n.one("#openimagebrowser").on("click",M.atto_image.open_filepicker),n}}},"@VERSION@",{requires:["node","escape"]});
|
||||
|
||||
Vendored
+4
-2
@@ -113,7 +113,7 @@ M.atto_image = M.atto_image || {
|
||||
image.src = params.url;
|
||||
}
|
||||
},
|
||||
set_image : function(e) {
|
||||
set_image : function(e, elementid) {
|
||||
e.preventDefault();
|
||||
M.atto_image.dialogue.hide();
|
||||
|
||||
@@ -143,6 +143,8 @@ M.atto_image = M.atto_image || {
|
||||
} else {
|
||||
document.execCommand('insertHTML', false, imagehtml);
|
||||
}
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
}
|
||||
},
|
||||
get_form_content : function(elementid) {
|
||||
@@ -174,7 +176,7 @@ M.atto_image = M.atto_image || {
|
||||
'</form>' +
|
||||
'<hr/>' + M.util.get_string('accessibilityhint', 'atto_image'));
|
||||
|
||||
content.one('#atto_image_urlentrysubmit').on('click', M.atto_image.set_image);
|
||||
content.one('#atto_image_urlentrysubmit').on('click', M.atto_image.set_image, this, elementid);
|
||||
content.one('#openimagebrowser').on('click', M.atto_image.open_filepicker);
|
||||
return content;
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ M.atto_image = M.atto_image || {
|
||||
image.src = params.url;
|
||||
}
|
||||
},
|
||||
set_image : function(e) {
|
||||
set_image : function(e, elementid) {
|
||||
e.preventDefault();
|
||||
M.atto_image.dialogue.hide();
|
||||
|
||||
@@ -141,6 +141,8 @@ M.atto_image = M.atto_image || {
|
||||
} else {
|
||||
document.execCommand('insertHTML', false, imagehtml);
|
||||
}
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
}
|
||||
},
|
||||
get_form_content : function(elementid) {
|
||||
@@ -172,7 +174,7 @@ M.atto_image = M.atto_image || {
|
||||
'</form>' +
|
||||
'<hr/>' + M.util.get_string('accessibilityhint', 'atto_image'));
|
||||
|
||||
content.one('#atto_image_urlentrysubmit').on('click', M.atto_image.set_image);
|
||||
content.one('#atto_image_urlentrysubmit').on('click', M.atto_image.set_image, this, elementid);
|
||||
content.one('#openimagebrowser').on('click', M.atto_image.open_filepicker);
|
||||
return content;
|
||||
}
|
||||
|
||||
+2
@@ -30,6 +30,8 @@ M.atto_indent = M.atto_indent || {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
document.execCommand('indent', false, null);
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
};
|
||||
|
||||
M.editor_atto.add_toolbar_button(params.elementid, 'indent', params.icon, params.group, click);
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
YUI.add("moodle-atto_indent-button",function(e,t){M.atto_indent=M.atto_indent||{init:function(e){var t=function(e,t){e.preventDefault(),M.editor_atto.is_active(t)||M.editor_atto.focus(t),document.execCommand("indent",!1,null)};M.editor_atto.add_toolbar_button(e.elementid,"indent",e.icon,e.group,t)}}},"@VERSION@",{requires:["node"]});
|
||||
YUI.add("moodle-atto_indent-button",function(e,t){M.atto_indent=M.atto_indent||{init:function(e){var t=function(e,t){e.preventDefault(),M.editor_atto.is_active(t)||M.editor_atto.focus(t),document.execCommand("indent",!1,null),M.editor_atto.text_updated(t)};M.editor_atto.add_toolbar_button(e.elementid,"indent",e.icon,e.group,t)}}},"@VERSION@",{requires:["node"]});
|
||||
|
||||
Vendored
+2
@@ -30,6 +30,8 @@ M.atto_indent = M.atto_indent || {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
document.execCommand('indent', false, null);
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
};
|
||||
|
||||
M.editor_atto.add_toolbar_button(params.elementid, 'indent', params.icon, params.group, click);
|
||||
|
||||
@@ -28,6 +28,8 @@ M.atto_indent = M.atto_indent || {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
document.execCommand('indent', false, null);
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
};
|
||||
|
||||
M.editor_atto.add_toolbar_button(params.elementid, 'indent', params.icon, params.group, click);
|
||||
|
||||
+2
@@ -30,6 +30,8 @@ M.atto_italic = M.atto_italic || {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
document.execCommand('italic', false, null);
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
};
|
||||
|
||||
M.editor_atto.add_toolbar_button(params.elementid, 'italic', params.icon, params.group, click);
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
YUI.add("moodle-atto_italic-button",function(e,t){M.atto_italic=M.atto_italic||{init:function(e){var t=function(e,t){e.preventDefault(),M.editor_atto.is_active(t)||M.editor_atto.focus(t),document.execCommand("italic",!1,null)};M.editor_atto.add_toolbar_button(e.elementid,"italic",e.icon,e.group,t)}}},"@VERSION@",{requires:["node"]});
|
||||
YUI.add("moodle-atto_italic-button",function(e,t){M.atto_italic=M.atto_italic||{init:function(e){var t=function(e,t){e.preventDefault(),M.editor_atto.is_active(t)||M.editor_atto.focus(t),document.execCommand("italic",!1,null),M.editor_atto.text_updated(t)};M.editor_atto.add_toolbar_button(e.elementid,"italic",e.icon,e.group,t)}}},"@VERSION@",{requires:["node"]});
|
||||
|
||||
Vendored
+2
@@ -30,6 +30,8 @@ M.atto_italic = M.atto_italic || {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
document.execCommand('italic', false, null);
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
};
|
||||
|
||||
M.editor_atto.add_toolbar_button(params.elementid, 'italic', params.icon, params.group, click);
|
||||
|
||||
@@ -28,6 +28,8 @@ M.atto_italic = M.atto_italic || {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
document.execCommand('italic', false, null);
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
};
|
||||
|
||||
M.editor_atto.add_toolbar_button(params.elementid, 'italic', params.icon, params.group, click);
|
||||
|
||||
Vendored
+4
-2
@@ -158,7 +158,7 @@ M.atto_link = M.atto_link || {
|
||||
* @method set_link
|
||||
* @param Event e
|
||||
*/
|
||||
set_link : function(e) {
|
||||
set_link : function(e, elementid) {
|
||||
var input,
|
||||
target,
|
||||
selectednode,
|
||||
@@ -193,6 +193,8 @@ M.atto_link = M.atto_link || {
|
||||
anchornode.removeAttribute('target');
|
||||
}
|
||||
});
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -254,7 +256,7 @@ M.atto_link = M.atto_link || {
|
||||
'</form>' +
|
||||
'<hr/>' + M.util.get_string('accessibilityhint', 'atto_link'));
|
||||
|
||||
content.one('#atto_link_urlentrysubmit').on('click', M.atto_link.set_link);
|
||||
content.one('#atto_link_urlentrysubmit').on('click', M.atto_link.set_link, this, elementid);
|
||||
content.one('#openlinkbrowser').on('click', M.atto_link.open_filepicker);
|
||||
return content;
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
YUI.add("moodle-atto_link-button",function(e,t){M.atto_link=M.atto_link||{dialogue:null,selection:null,display_chooser:function(e,t){e.preventDefault(),M.editor_atto.is_active(t)||M.editor_atto.focus(t),M.atto_link.selection=M.editor_atto.get_selection();if(M.atto_link.selection!==!1&&!M.atto_link.selection.collapsed){var n;M.atto_link.dialogue?n=M.atto_link.dialogue:n=new M.core.dialogue({visible:!1,modal:!0,close:!0,draggable:!0}),n.render(),n.set("bodyContent",M.atto_link.get_form_content(t)),n.set("headerContent",M.util.get_string("createlink","atto_link")),M.atto_link.resolve_anchors(),n.show(),M.atto_link.dialogue=n}},init:function(e){M.editor_atto.add_toolbar_button(e.elementid,"link",e.icon,e.group,this.display_chooser,this)},resolve_anchors:function(){var t=M.editor_atto.get_selection_parent_node(),n,r,i;if(!t)return;n=M.atto_link.find_selected_anchors(e.one(t)),n.length>0&&(r=n[0],M.atto_link.selection=M.editor_atto.get_selection_from_node(r),i=r.getAttribute("href"),target=r.getAttribute("target"),i!==""&&e.one("#atto_link_urlentry").set("value",i),target==="_blank"?e.one("#atto_link_openinnewwindow").set("checked","checked"):e.one("#atto_link_openinnewwindow").set("checked",""))},open_filepicker:function(e){var t=this.getAttribute("data-editor");e.preventDefault(),M.editor_atto.show_filepicker(t,"link",M.atto_link.filepicker_callback)},filepicker_callback:function(e){M.atto_link.dialogue.hide(),e.url!==""&&(M.editor_atto.set_selection(M.atto_link.selection),document.execCommand("unlink",!1,null),document.execCommand("createLink",!1,e.url))},set_link:function(t){var n,r,i,s,o;t.preventDefault(),M.atto_link.dialogue.hide(),n=t.currentTarget.get("parentNode").one("input[type=url]"),o=n.get("value");if(o!==""){M.editor_atto.set_selection(M.atto_link.selection),document.execCommand("unlink",!1,null),document.execCommand("createLink",!1,o),i=M.editor_atto.get_selection_parent_node();if(!i)return;s=M.atto_link.find_selected_anchors(e.one(i)),e.Array.each(s,function(e){r=t.currentTarget.get("parentNode").one("input[type=checkbox]"),r.get("checked")?e.setAttribute("target","_blank"):e.removeAttribute("target")})}},find_selected_anchors:function(e){var t=e.get("tagName"),n,r;return t&&t.toLowerCase()==="a"?[e]:(r=[],e.all("a").each(function(e){!n&&M.editor_atto.selection_contains_node(e)&&r.push(e)}),r.length>0?r:(n=e.ancestor("a"),n?[n]:[]))},get_form_content:function(t){var n=e.Node.create('<form><label for="atto_link_urlentry">'+M.util.get_string("enterurl","atto_link")+"</label><br/>"+'<input type="url" value="" id="atto_link_urlentry" size="32"/>'+"<br/>"+'<label for="atto_link_openinnewwindow">'+M.util.get_string("openinnewwindow","atto_link")+"</label><br/>"+'<input type="checkbox" id="atto_link_openinnewwindow"/>'+"<br/>"+'<button id="openlinkbrowser" data-editor="'+e.Escape.html(t)+'">'+M.util.get_string("browserepositories","atto_link")+"</button>"+"<hr/>"+'<button id="atto_link_urlentrysubmit">'+M.util.get_string("createlink","atto_link")+"</button>"+"</form>"+"<hr/>"+M.util.get_string("accessibilityhint","atto_link"));return n.one("#atto_link_urlentrysubmit").on("click",M.atto_link.set_link),n.one("#openlinkbrowser").on("click",M.atto_link.open_filepicker),n}}},"@VERSION@",{requires:["node","escape"]});
|
||||
YUI.add("moodle-atto_link-button",function(e,t){M.atto_link=M.atto_link||{dialogue:null,selection:null,display_chooser:function(e,t){e.preventDefault(),M.editor_atto.is_active(t)||M.editor_atto.focus(t),M.atto_link.selection=M.editor_atto.get_selection();if(M.atto_link.selection!==!1&&!M.atto_link.selection.collapsed){var n;M.atto_link.dialogue?n=M.atto_link.dialogue:n=new M.core.dialogue({visible:!1,modal:!0,close:!0,draggable:!0}),n.render(),n.set("bodyContent",M.atto_link.get_form_content(t)),n.set("headerContent",M.util.get_string("createlink","atto_link")),M.atto_link.resolve_anchors(),n.show(),M.atto_link.dialogue=n}},init:function(e){M.editor_atto.add_toolbar_button(e.elementid,"link",e.icon,e.group,this.display_chooser,this)},resolve_anchors:function(){var t=M.editor_atto.get_selection_parent_node(),n,r,i;if(!t)return;n=M.atto_link.find_selected_anchors(e.one(t)),n.length>0&&(r=n[0],M.atto_link.selection=M.editor_atto.get_selection_from_node(r),i=r.getAttribute("href"),target=r.getAttribute("target"),i!==""&&e.one("#atto_link_urlentry").set("value",i),target==="_blank"?e.one("#atto_link_openinnewwindow").set("checked","checked"):e.one("#atto_link_openinnewwindow").set("checked",""))},open_filepicker:function(e){var t=this.getAttribute("data-editor");e.preventDefault(),M.editor_atto.show_filepicker(t,"link",M.atto_link.filepicker_callback)},filepicker_callback:function(e){M.atto_link.dialogue.hide(),e.url!==""&&(M.editor_atto.set_selection(M.atto_link.selection),document.execCommand("unlink",!1,null),document.execCommand("createLink",!1,e.url))},set_link:function(t,n){var r,i,s,o,u;t.preventDefault(),M.atto_link.dialogue.hide(),r=t.currentTarget.get("parentNode").one("input[type=url]"),u=r.get("value");if(u!==""){M.editor_atto.set_selection(M.atto_link.selection),document.execCommand("unlink",!1,null),document.execCommand("createLink",!1,u),s=M.editor_atto.get_selection_parent_node();if(!s)return;o=M.atto_link.find_selected_anchors(e.one(s)),e.Array.each(o,function(e){i=t.currentTarget.get("parentNode").one("input[type=checkbox]"),i.get("checked")?e.setAttribute("target","_blank"):e.removeAttribute("target")}),M.editor_atto.text_updated(n)}},find_selected_anchors:function(e){var t=e.get("tagName"),n,r;return t&&t.toLowerCase()==="a"?[e]:(r=[],e.all("a").each(function(e){!n&&M.editor_atto.selection_contains_node(e)&&r.push(e)}),r.length>0?r:(n=e.ancestor("a"),n?[n]:[]))},get_form_content:function(t){var n=e.Node.create('<form><label for="atto_link_urlentry">'+M.util.get_string("enterurl","atto_link")+"</label><br/>"+'<input type="url" value="" id="atto_link_urlentry" size="32"/>'+"<br/>"+'<label for="atto_link_openinnewwindow">'+M.util.get_string("openinnewwindow","atto_link")+"</label><br/>"+'<input type="checkbox" id="atto_link_openinnewwindow"/>'+"<br/>"+'<button id="openlinkbrowser" data-editor="'+e.Escape.html(t)+'">'+M.util.get_string("browserepositories","atto_link")+"</button>"+"<hr/>"+'<button id="atto_link_urlentrysubmit">'+M.util.get_string("createlink","atto_link")+"</button>"+"</form>"+"<hr/>"+M.util.get_string("accessibilityhint","atto_link"));return n.one("#atto_link_urlentrysubmit").on("click",M.atto_link.set_link,this,t),n.one("#openlinkbrowser").on("click",M.atto_link.open_filepicker),n}}},"@VERSION@",{requires:["node","escape"]});
|
||||
|
||||
+4
-2
@@ -158,7 +158,7 @@ M.atto_link = M.atto_link || {
|
||||
* @method set_link
|
||||
* @param Event e
|
||||
*/
|
||||
set_link : function(e) {
|
||||
set_link : function(e, elementid) {
|
||||
var input,
|
||||
target,
|
||||
selectednode,
|
||||
@@ -193,6 +193,8 @@ M.atto_link = M.atto_link || {
|
||||
anchornode.removeAttribute('target');
|
||||
}
|
||||
});
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -254,7 +256,7 @@ M.atto_link = M.atto_link || {
|
||||
'</form>' +
|
||||
'<hr/>' + M.util.get_string('accessibilityhint', 'atto_link'));
|
||||
|
||||
content.one('#atto_link_urlentrysubmit').on('click', M.atto_link.set_link);
|
||||
content.one('#atto_link_urlentrysubmit').on('click', M.atto_link.set_link, this, elementid);
|
||||
content.one('#openlinkbrowser').on('click', M.atto_link.open_filepicker);
|
||||
return content;
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ M.atto_link = M.atto_link || {
|
||||
* @method set_link
|
||||
* @param Event e
|
||||
*/
|
||||
set_link : function(e) {
|
||||
set_link : function(e, elementid) {
|
||||
var input,
|
||||
target,
|
||||
selectednode,
|
||||
@@ -191,6 +191,8 @@ M.atto_link = M.atto_link || {
|
||||
anchornode.removeAttribute('target');
|
||||
}
|
||||
});
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -252,7 +254,7 @@ M.atto_link = M.atto_link || {
|
||||
'</form>' +
|
||||
'<hr/>' + M.util.get_string('accessibilityhint', 'atto_link'));
|
||||
|
||||
content.one('#atto_link_urlentrysubmit').on('click', M.atto_link.set_link);
|
||||
content.one('#atto_link_urlentrysubmit').on('click', M.atto_link.set_link, this, elementid);
|
||||
content.one('#openlinkbrowser').on('click', M.atto_link.open_filepicker);
|
||||
return content;
|
||||
}
|
||||
|
||||
Vendored
+4
-2
@@ -70,7 +70,7 @@ M.atto_media = M.atto_media || {
|
||||
input.set('value', params.file);
|
||||
}
|
||||
},
|
||||
set_media : function(e) {
|
||||
set_media : function(e, elementid) {
|
||||
e.preventDefault();
|
||||
M.atto_media.dialogue.hide();
|
||||
|
||||
@@ -88,6 +88,8 @@ M.atto_media = M.atto_media || {
|
||||
} else {
|
||||
document.execCommand('insertHTML', false, mediahtml);
|
||||
}
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
}
|
||||
},
|
||||
get_form_content : function(elementid) {
|
||||
@@ -109,7 +111,7 @@ M.atto_media = M.atto_media || {
|
||||
'</form>' +
|
||||
'<hr/>' + M.util.get_string('accessibilityhint', 'atto_media'));
|
||||
|
||||
content.one('#atto_media_urlentrysubmit').on('click', M.atto_media.set_media);
|
||||
content.one('#atto_media_urlentrysubmit').on('click', M.atto_media.set_media, this, elementid);
|
||||
content.one('#openmediabrowser').on('click', M.atto_media.open_browser);
|
||||
return content;
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
YUI.add("moodle-atto_media-button",function(e,t){M.atto_media=M.atto_media||{dialogue:null,selection:null,init:function(e){var t=function(e,t){e.preventDefault(),M.editor_atto.is_active(t)||M.editor_atto.focus(t),M.atto_media.selection=M.editor_atto.get_selection();if(M.atto_media.selection!==!1){var n;M.atto_media.dialogue?n=M.atto_media.dialogue:n=new M.core.dialogue({visible:!1,modal:!0,close:!0,draggable:!0}),n.render(),n.set("bodyContent",M.atto_media.get_form_content(t)),n.set("headerContent",M.util.get_string("createmedia","atto_media")),n.centerDialogue(),n.show(),M.atto_media.dialogue=n}};M.editor_atto.add_toolbar_button(e.elementid,"media",e.icon,e.group,t,this)},open_browser:function(e){var t=this.getAttribute("data-editor");e.preventDefault(),M.editor_atto.show_filepicker(t,"media",M.atto_media.filepicker_callback)},filepicker_callback:function(t){if(t.url!==""){var n=e.one("#atto_media_urlentry");n.set("value",t.url),n=e.one("#atto_media_nameentry"),n.set("value",t.file)}},set_media:function(t){t.preventDefault(),M.atto_media.dialogue.hide();var n=t.currentTarget.get("parentNode").one("#atto_media_urlentry"),r=n.get("value");n=t.currentTarget.get("parentNode").one("#atto_media_nameentry");var i=n.get("value");if(r!==""&&i!==""){M.editor_atto.set_selection(M.atto_media.selection);var s='<a href="'+e.Escape.html(r)+'">'+i+"</a>";document.selection&&document.selection.createRange().pasteHTML?document.selection.createRange().pasteHTML(s):document.execCommand("insertHTML",!1,s)}},get_form_content:function(t){var n=e.Node.create('<form class="atto_form"><label for="atto_media_urlentry">'+M.util.get_string("enterurl","atto_media")+"</label>"+'<input type="url" value="" id="atto_media_urlentry" size="32"/>'+'<label for="atto_media_nameentry">'+M.util.get_string("entername","atto_media")+"</label>"+'<input type="text" value="" id="atto_media_nameentry" size="32" required="true"/>'+"<hr/>"+'<button id="openmediabrowser" data-editor="'+e.Escape.html(t)+'">'+M.util.get_string("browserepositories","atto_media")+"</button>"+"<hr/>"+'<button id="atto_media_urlentrysubmit">'+M.util.get_string("createmedia","atto_media")+"</button>"+"</form>"+"<hr/>"+M.util.get_string("accessibilityhint","atto_media"));return n.one("#atto_media_urlentrysubmit").on("click",M.atto_media.set_media),n.one("#openmediabrowser").on("click",M.atto_media.open_browser),n}}},"@VERSION@",{requires:["node","escape"]});
|
||||
YUI.add("moodle-atto_media-button",function(e,t){M.atto_media=M.atto_media||{dialogue:null,selection:null,init:function(e){var t=function(e,t){e.preventDefault(),M.editor_atto.is_active(t)||M.editor_atto.focus(t),M.atto_media.selection=M.editor_atto.get_selection();if(M.atto_media.selection!==!1){var n;M.atto_media.dialogue?n=M.atto_media.dialogue:n=new M.core.dialogue({visible:!1,modal:!0,close:!0,draggable:!0}),n.render(),n.set("bodyContent",M.atto_media.get_form_content(t)),n.set("headerContent",M.util.get_string("createmedia","atto_media")),n.centerDialogue(),n.show(),M.atto_media.dialogue=n}};M.editor_atto.add_toolbar_button(e.elementid,"media",e.icon,e.group,t,this)},open_browser:function(e){var t=this.getAttribute("data-editor");e.preventDefault(),M.editor_atto.show_filepicker(t,"media",M.atto_media.filepicker_callback)},filepicker_callback:function(t){if(t.url!==""){var n=e.one("#atto_media_urlentry");n.set("value",t.url),n=e.one("#atto_media_nameentry"),n.set("value",t.file)}},set_media:function(t,n){t.preventDefault(),M.atto_media.dialogue.hide();var r=t.currentTarget.get("parentNode").one("#atto_media_urlentry"),i=r.get("value");r=t.currentTarget.get("parentNode").one("#atto_media_nameentry");var s=r.get("value");if(i!==""&&s!==""){M.editor_atto.set_selection(M.atto_media.selection);var o='<a href="'+e.Escape.html(i)+'">'+s+"</a>";document.selection&&document.selection.createRange().pasteHTML?document.selection.createRange().pasteHTML(o):document.execCommand("insertHTML",!1,o),M.editor_atto.text_updated(n)}},get_form_content:function(t){var n=e.Node.create('<form class="atto_form"><label for="atto_media_urlentry">'+M.util.get_string("enterurl","atto_media")+"</label>"+'<input type="url" value="" id="atto_media_urlentry" size="32"/>'+'<label for="atto_media_nameentry">'+M.util.get_string("entername","atto_media")+"</label>"+'<input type="text" value="" id="atto_media_nameentry" size="32" required="true"/>'+"<hr/>"+'<button id="openmediabrowser" data-editor="'+e.Escape.html(t)+'">'+M.util.get_string("browserepositories","atto_media")+"</button>"+"<hr/>"+'<button id="atto_media_urlentrysubmit">'+M.util.get_string("createmedia","atto_media")+"</button>"+"</form>"+"<hr/>"+M.util.get_string("accessibilityhint","atto_media"));return n.one("#atto_media_urlentrysubmit").on("click",M.atto_media.set_media,this,t),n.one("#openmediabrowser").on("click",M.atto_media.open_browser),n}}},"@VERSION@",{requires:["node","escape"]});
|
||||
|
||||
Vendored
+4
-2
@@ -70,7 +70,7 @@ M.atto_media = M.atto_media || {
|
||||
input.set('value', params.file);
|
||||
}
|
||||
},
|
||||
set_media : function(e) {
|
||||
set_media : function(e, elementid) {
|
||||
e.preventDefault();
|
||||
M.atto_media.dialogue.hide();
|
||||
|
||||
@@ -88,6 +88,8 @@ M.atto_media = M.atto_media || {
|
||||
} else {
|
||||
document.execCommand('insertHTML', false, mediahtml);
|
||||
}
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
}
|
||||
},
|
||||
get_form_content : function(elementid) {
|
||||
@@ -109,7 +111,7 @@ M.atto_media = M.atto_media || {
|
||||
'</form>' +
|
||||
'<hr/>' + M.util.get_string('accessibilityhint', 'atto_media'));
|
||||
|
||||
content.one('#atto_media_urlentrysubmit').on('click', M.atto_media.set_media);
|
||||
content.one('#atto_media_urlentrysubmit').on('click', M.atto_media.set_media, this, elementid);
|
||||
content.one('#openmediabrowser').on('click', M.atto_media.open_browser);
|
||||
return content;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ M.atto_media = M.atto_media || {
|
||||
input.set('value', params.file);
|
||||
}
|
||||
},
|
||||
set_media : function(e) {
|
||||
set_media : function(e, elementid) {
|
||||
e.preventDefault();
|
||||
M.atto_media.dialogue.hide();
|
||||
|
||||
@@ -86,6 +86,8 @@ M.atto_media = M.atto_media || {
|
||||
} else {
|
||||
document.execCommand('insertHTML', false, mediahtml);
|
||||
}
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
}
|
||||
},
|
||||
get_form_content : function(elementid) {
|
||||
@@ -107,7 +109,7 @@ M.atto_media = M.atto_media || {
|
||||
'</form>' +
|
||||
'<hr/>' + M.util.get_string('accessibilityhint', 'atto_media'));
|
||||
|
||||
content.one('#atto_media_urlentrysubmit').on('click', M.atto_media.set_media);
|
||||
content.one('#atto_media_urlentrysubmit').on('click', M.atto_media.set_media, this, elementid);
|
||||
content.one('#openmediabrowser').on('click', M.atto_media.open_browser);
|
||||
return content;
|
||||
}
|
||||
|
||||
+2
@@ -30,6 +30,8 @@ M.atto_orderedlist = M.atto_orderedlist || {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
document.execCommand('insertOrderedList', false, null);
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
};
|
||||
|
||||
M.editor_atto.add_toolbar_button(params.elementid, 'orderedlist', params.icon, params.group, click);
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
YUI.add("moodle-atto_orderedlist-button",function(e,t){M.atto_orderedlist=M.atto_orderedlist||{init:function(e){var t=function(e,t){e.preventDefault(),M.editor_atto.is_active(t)||M.editor_atto.focus(t),document.execCommand("insertOrderedList",!1,null)};M.editor_atto.add_toolbar_button(e.elementid,"orderedlist",e.icon,e.group,t)}}},"@VERSION@",{requires:["node"]});
|
||||
YUI.add("moodle-atto_orderedlist-button",function(e,t){M.atto_orderedlist=M.atto_orderedlist||{init:function(e){var t=function(e,t){e.preventDefault(),M.editor_atto.is_active(t)||M.editor_atto.focus(t),document.execCommand("insertOrderedList",!1,null),M.editor_atto.text_updated(t)};M.editor_atto.add_toolbar_button(e.elementid,"orderedlist",e.icon,e.group,t)}}},"@VERSION@",{requires:["node"]});
|
||||
|
||||
+2
@@ -30,6 +30,8 @@ M.atto_orderedlist = M.atto_orderedlist || {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
document.execCommand('insertOrderedList', false, null);
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
};
|
||||
|
||||
M.editor_atto.add_toolbar_button(params.elementid, 'orderedlist', params.icon, params.group, click);
|
||||
|
||||
@@ -28,6 +28,8 @@ M.atto_orderedlist = M.atto_orderedlist || {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
document.execCommand('insertOrderedList', false, null);
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
};
|
||||
|
||||
M.editor_atto.add_toolbar_button(params.elementid, 'orderedlist', params.icon, params.group, click);
|
||||
|
||||
+2
@@ -30,6 +30,8 @@ M.atto_outdent = M.atto_outdent || {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
document.execCommand('outdent', false, null);
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
};
|
||||
|
||||
M.editor_atto.add_toolbar_button(params.elementid, 'outdent', params.icon, params.group, click);
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
YUI.add("moodle-atto_outdent-button",function(e,t){M.atto_outdent=M.atto_outdent||{init:function(e){var t=function(e,t){e.preventDefault(),M.editor_atto.is_active(t)||M.editor_atto.focus(t),document.execCommand("outdent",!1,null)};M.editor_atto.add_toolbar_button(e.elementid,"outdent",e.icon,e.group,t)}}},"@VERSION@",{requires:["node"]});
|
||||
YUI.add("moodle-atto_outdent-button",function(e,t){M.atto_outdent=M.atto_outdent||{init:function(e){var t=function(e,t){e.preventDefault(),M.editor_atto.is_active(t)||M.editor_atto.focus(t),document.execCommand("outdent",!1,null),M.editor_atto.text_updated(t)};M.editor_atto.add_toolbar_button(e.elementid,"outdent",e.icon,e.group,t)}}},"@VERSION@",{requires:["node"]});
|
||||
|
||||
Vendored
+2
@@ -30,6 +30,8 @@ M.atto_outdent = M.atto_outdent || {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
document.execCommand('outdent', false, null);
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
};
|
||||
|
||||
M.editor_atto.add_toolbar_button(params.elementid, 'outdent', params.icon, params.group, click);
|
||||
|
||||
@@ -28,6 +28,8 @@ M.atto_outdent = M.atto_outdent || {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
document.execCommand('outdent', false, null);
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
};
|
||||
|
||||
M.editor_atto.add_toolbar_button(params.elementid, 'outdent', params.icon, params.group, click);
|
||||
|
||||
+2
@@ -30,6 +30,8 @@ M.atto_strike = M.atto_strike || {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
document.execCommand('strikeThrough', false, null);
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
};
|
||||
|
||||
M.editor_atto.add_toolbar_button(params.elementid, 'strike', params.icon, params.group, click);
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
YUI.add("moodle-atto_strike-button",function(e,t){M.atto_strike=M.atto_strike||{init:function(e){var t=function(e,t){e.preventDefault(),M.editor_atto.is_active(t)||M.editor_atto.focus(t),document.execCommand("strikeThrough",!1,null)};M.editor_atto.add_toolbar_button(e.elementid,"strike",e.icon,e.group,t)}}},"@VERSION@",{requires:["node"]});
|
||||
YUI.add("moodle-atto_strike-button",function(e,t){M.atto_strike=M.atto_strike||{init:function(e){var t=function(e,t){e.preventDefault(),M.editor_atto.is_active(t)||M.editor_atto.focus(t),document.execCommand("strikeThrough",!1,null),M.editor_atto.text_updated(t)};M.editor_atto.add_toolbar_button(e.elementid,"strike",e.icon,e.group,t)}}},"@VERSION@",{requires:["node"]});
|
||||
|
||||
Vendored
+2
@@ -30,6 +30,8 @@ M.atto_strike = M.atto_strike || {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
document.execCommand('strikeThrough', false, null);
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
};
|
||||
|
||||
M.editor_atto.add_toolbar_button(params.elementid, 'strike', params.icon, params.group, click);
|
||||
|
||||
@@ -28,6 +28,8 @@ M.atto_strike = M.atto_strike || {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
document.execCommand('strikeThrough', false, null);
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
};
|
||||
|
||||
M.editor_atto.add_toolbar_button(params.elementid, 'strike', params.icon, params.group, click);
|
||||
|
||||
Vendored
+2
@@ -76,6 +76,8 @@ M.atto_title = M.atto_title || {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
document.execCommand('formatBlock', false, node);
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
YUI.add("moodle-atto_title-button",function(e,t){M.atto_title=M.atto_title||{init:function(e){var t=function(e,t){M.atto_title.change_title(e,t,"<h3>")},n=function(e,t){M.atto_title.change_title(e,t,"<h4>")},r=function(e,t){M.atto_title.change_title(e,t,"<h5>")},i=function(e,t){M.atto_title.change_title(e,t,"<pre>")},s=function(e,t){M.atto_title.change_title(e,t,"<blockquote>")},o=function(e,t){M.atto_title.change_title(e,t,"<p>")},u=M.util.get_string("h3","atto_title"),a=M.util.get_string("h4","atto_title"),f=M.util.get_string("h5","atto_title"),l=M.util.get_string("pre","atto_title"),c=M.util.get_string("blockquote","atto_title"),h=M.util.get_string("p","atto_title");M.editor_atto.add_toolbar_menu(e.elementid,"title",e.icon,e.group,[{text:u,handler:t},{text:a,handler:n},{text:f,handler:r},{text:l,handler:i},{text:c,handler:s},{text:h,handler:o}])},change_title:function(e,t,n){e.preventDefault(),M.editor_atto.is_active(t)||M.editor_atto.focus(t),document.execCommand("formatBlock",!1,n)}}},"@VERSION@",{requires:["node"]});
|
||||
YUI.add("moodle-atto_title-button",function(e,t){M.atto_title=M.atto_title||{init:function(e){var t=function(e,t){M.atto_title.change_title(e,t,"<h3>")},n=function(e,t){M.atto_title.change_title(e,t,"<h4>")},r=function(e,t){M.atto_title.change_title(e,t,"<h5>")},i=function(e,t){M.atto_title.change_title(e,t,"<pre>")},s=function(e,t){M.atto_title.change_title(e,t,"<blockquote>")},o=function(e,t){M.atto_title.change_title(e,t,"<p>")},u=M.util.get_string("h3","atto_title"),a=M.util.get_string("h4","atto_title"),f=M.util.get_string("h5","atto_title"),l=M.util.get_string("pre","atto_title"),c=M.util.get_string("blockquote","atto_title"),h=M.util.get_string("p","atto_title");M.editor_atto.add_toolbar_menu(e.elementid,"title",e.icon,e.group,[{text:u,handler:t},{text:a,handler:n},{text:f,handler:r},{text:l,handler:i},{text:c,handler:s},{text:h,handler:o}])},change_title:function(e,t,n){e.preventDefault(),M.editor_atto.is_active(t)||M.editor_atto.focus(t),document.execCommand("formatBlock",!1,n),M.editor_atto.text_updated(t)}}},"@VERSION@",{requires:["node"]});
|
||||
|
||||
Vendored
+2
@@ -76,6 +76,8 @@ M.atto_title = M.atto_title || {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
document.execCommand('formatBlock', false, node);
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -74,5 +74,7 @@ M.atto_title = M.atto_title || {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
document.execCommand('formatBlock', false, node);
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
}
|
||||
};
|
||||
|
||||
+2
@@ -30,6 +30,8 @@ M.atto_underline = M.atto_underline || {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
document.execCommand('underline', false, null);
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
};
|
||||
|
||||
M.editor_atto.add_toolbar_button(params.elementid, 'underline', params.icon, params.group, click);
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
YUI.add("moodle-atto_underline-button",function(e,t){M.atto_underline=M.atto_underline||{init:function(e){var t=function(e,t){e.preventDefault(),M.editor_atto.is_active(t)||M.editor_atto.focus(t),document.execCommand("underline",!1,null)};M.editor_atto.add_toolbar_button(e.elementid,"underline",e.icon,e.group,t)}}},"@VERSION@",{requires:["node"]});
|
||||
YUI.add("moodle-atto_underline-button",function(e,t){M.atto_underline=M.atto_underline||{init:function(e){var t=function(e,t){e.preventDefault(),M.editor_atto.is_active(t)||M.editor_atto.focus(t),document.execCommand("underline",!1,null),M.editor_atto.text_updated(t)};M.editor_atto.add_toolbar_button(e.elementid,"underline",e.icon,e.group,t)}}},"@VERSION@",{requires:["node"]});
|
||||
|
||||
+2
@@ -30,6 +30,8 @@ M.atto_underline = M.atto_underline || {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
document.execCommand('underline', false, null);
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
};
|
||||
|
||||
M.editor_atto.add_toolbar_button(params.elementid, 'underline', params.icon, params.group, click);
|
||||
|
||||
@@ -28,6 +28,8 @@ M.atto_underline = M.atto_underline || {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
document.execCommand('underline', false, null);
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
};
|
||||
|
||||
M.editor_atto.add_toolbar_button(params.elementid, 'underline', params.icon, params.group, click);
|
||||
|
||||
+2
@@ -30,6 +30,8 @@ M.atto_unlink = M.atto_unlink || {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
document.execCommand('unlink', false, null);
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
};
|
||||
|
||||
M.editor_atto.add_toolbar_button(params.elementid, 'unlink', params.icon, params.group, click);
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
YUI.add("moodle-atto_unlink-button",function(e,t){M.atto_unlink=M.atto_unlink||{init:function(e){var t=function(e,t){e.preventDefault(),M.editor_atto.is_active(t)||M.editor_atto.focus(t),document.execCommand("unlink",!1,null)};M.editor_atto.add_toolbar_button(e.elementid,"unlink",e.icon,e.group,t)}}},"@VERSION@",{requires:["node"]});
|
||||
YUI.add("moodle-atto_unlink-button",function(e,t){M.atto_unlink=M.atto_unlink||{init:function(e){var t=function(e,t){e.preventDefault(),M.editor_atto.is_active(t)||M.editor_atto.focus(t),document.execCommand("unlink",!1,null),M.editor_atto.text_updated(t)};M.editor_atto.add_toolbar_button(e.elementid,"unlink",e.icon,e.group,t)}}},"@VERSION@",{requires:["node"]});
|
||||
|
||||
Vendored
+2
@@ -30,6 +30,8 @@ M.atto_unlink = M.atto_unlink || {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
document.execCommand('unlink', false, null);
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
};
|
||||
|
||||
M.editor_atto.add_toolbar_button(params.elementid, 'unlink', params.icon, params.group, click);
|
||||
|
||||
@@ -28,6 +28,8 @@ M.atto_unlink = M.atto_unlink || {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
document.execCommand('unlink', false, null);
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
};
|
||||
|
||||
M.editor_atto.add_toolbar_button(params.elementid, 'unlink', params.icon, params.group, click);
|
||||
|
||||
+2
@@ -30,6 +30,8 @@ M.atto_unorderedlist = M.atto_unorderedlist || {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
document.execCommand('insertUnorderedList', false, null);
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
};
|
||||
|
||||
M.editor_atto.add_toolbar_button(params.elementid, 'unorderedlist', params.icon, params.group, click);
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
YUI.add("moodle-atto_unorderedlist-button",function(e,t){M.atto_unorderedlist=M.atto_unorderedlist||{init:function(e){var t=function(e,t){e.preventDefault(),M.editor_atto.is_active(t)||M.editor_atto.focus(t),document.execCommand("insertUnorderedList",!1,null)};M.editor_atto.add_toolbar_button(e.elementid,"unorderedlist",e.icon,e.group,t)}}},"@VERSION@",{requires:["node"]});
|
||||
YUI.add("moodle-atto_unorderedlist-button",function(e,t){M.atto_unorderedlist=M.atto_unorderedlist||{init:function(e){var t=function(e,t){e.preventDefault(),M.editor_atto.is_active(t)||M.editor_atto.focus(t),document.execCommand("insertUnorderedList",!1,null),M.editor_atto.text_updated(t)};M.editor_atto.add_toolbar_button(e.elementid,"unorderedlist",e.icon,e.group,t)}}},"@VERSION@",{requires:["node"]});
|
||||
|
||||
+2
@@ -30,6 +30,8 @@ M.atto_unorderedlist = M.atto_unorderedlist || {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
document.execCommand('insertUnorderedList', false, null);
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
};
|
||||
|
||||
M.editor_atto.add_toolbar_button(params.elementid, 'unorderedlist', params.icon, params.group, click);
|
||||
|
||||
@@ -28,6 +28,8 @@ M.atto_unorderedlist = M.atto_unorderedlist || {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
document.execCommand('insertUnorderedList', false, null);
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(elementid);
|
||||
};
|
||||
|
||||
M.editor_atto.add_toolbar_button(params.elementid, 'unorderedlist', params.icon, params.group, click);
|
||||
|
||||
+10
@@ -384,6 +384,16 @@ M.editor_atto = M.editor_atto || {
|
||||
M.editor_atto.filepickeroptions[params.elementid] = params.filepickeroptions;
|
||||
},
|
||||
|
||||
/**
|
||||
* The text in the contenteditable region has been updated,
|
||||
* clean and copy the buffer to the text area.
|
||||
* @param string elementid - the id of the textarea we created this editor from.
|
||||
*/
|
||||
text_updated : function(elementid) {
|
||||
var textarea = Y.one('#' + elementid);
|
||||
textarea.set('value', this.get_clean_html(elementid));
|
||||
},
|
||||
|
||||
/**
|
||||
* Remove all YUI ids from the generated HTML.
|
||||
* @param string elementid - the id of the textarea we created this editor from.
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
+10
@@ -384,6 +384,16 @@ M.editor_atto = M.editor_atto || {
|
||||
M.editor_atto.filepickeroptions[params.elementid] = params.filepickeroptions;
|
||||
},
|
||||
|
||||
/**
|
||||
* The text in the contenteditable region has been updated,
|
||||
* clean and copy the buffer to the text area.
|
||||
* @param string elementid - the id of the textarea we created this editor from.
|
||||
*/
|
||||
text_updated : function(elementid) {
|
||||
var textarea = Y.one('#' + elementid);
|
||||
textarea.set('value', this.get_clean_html(elementid));
|
||||
},
|
||||
|
||||
/**
|
||||
* Remove all YUI ids from the generated HTML.
|
||||
* @param string elementid - the id of the textarea we created this editor from.
|
||||
|
||||
+10
@@ -382,6 +382,16 @@ M.editor_atto = M.editor_atto || {
|
||||
M.editor_atto.filepickeroptions[params.elementid] = params.filepickeroptions;
|
||||
},
|
||||
|
||||
/**
|
||||
* The text in the contenteditable region has been updated,
|
||||
* clean and copy the buffer to the text area.
|
||||
* @param string elementid - the id of the textarea we created this editor from.
|
||||
*/
|
||||
text_updated : function(elementid) {
|
||||
var textarea = Y.one('#' + elementid);
|
||||
textarea.set('value', this.get_clean_html(elementid));
|
||||
},
|
||||
|
||||
/**
|
||||
* Remove all YUI ids from the generated HTML.
|
||||
* @param string elementid - the id of the textarea we created this editor from.
|
||||
|
||||
Reference in New Issue
Block a user