ปัญหา Joomla 1.5 com_media upload Error Object doesn't support Javascript
เพราะ ใช้ mootools 1.2.4 + Ajax ทำให้ มีผลกับ com_media กับ IE ที่ Frontpage
วิธีแก้ Object doesn't support
ต้องเขียน function ตอนที่คลิกรูปเพื่อใส่รูปลงใน text editor ใหม่
administrator\components\com_media\views\images\tmpl\dufault.php
โค้ด: เลือกทั้งหมด
// เพิ่ม function javascript นี้ลงไป
function insertImage(editor)
{
extra = '';
// Get the image tag field information
var url = document.getElementById("f_url").value; // $("f_url");
var alt = document.getElementById("f_alt").value;; // $("f_alt");
var align = document.getElementById("f_align").value;; //$("f_align");
var title = document.getElementById("f_title").value;; //$("f_title");
var caption = document.getElementById("f_title").value;; // $("f_caption");
if (url != '') {
// Set alt attribute
if (alt != '') {
extra = extra + 'alt="'+alt+'" ';
} else {
extra = extra + 'alt="" ';
}
// Set align attribute
if (align != '') {
extra = extra + 'align="'+align+'" ';
}
// Set align attribute
if (title != '') {
extra = extra + 'title="'+title+'" ';
}
// Set align attribute
if (caption != '') {
extra = extra + 'class="caption" ';
}
var tag = "<img src=\""+url+"\" "+extra+"/>";
}
window.parent.jInsertEditorText(tag, editor);
window.parent.document.getElementById('sbox-window').close();
return false;
}
โค้ด: เลือกทั้งหมด
<button type="button" onclick="insertImage('<?php echo $_GET['e_name'];?>')"><?php echo JText::_('Insert') ?></button>