This option allows you to add a custom callback function for execCommand handling. This enables you to override internal command functions in TinyMCE. The example below shows how the mceLink and mceImage are overridden.
Use the addCommand method instead.
Example of usage of the execcommand_callback option:
function myCustomExecCommandHandler(editor_id, elm, command, user_interface, value) {
var linkElm, imageElm, inst;
switch (command) {
case "mceLink":
inst = tinyMCE.getInstanceById(editor_id);
linkElm = tinyMCE.getParentElement(inst.selection.getFocusElement(), "a");
if (linkElm)
alert("Link dialog has been overriden. Found link href: " + tinyMCE.getAttrib(linkElm, "href"));
else
alert("Link dialog has been overriden.");
return true;
case "mceImage":
inst = tinyMCE.getInstanceById(editor_id);
imageElm = tinyMCE.getParentElement(inst.selection.getFocusElement(), "img");
if (imageElm)
alert("Image dialog has been overriden. Found image src: " + tinyMCE.getAttrib(imageElm, "src"));
else
alert("Image dialog has been overriden.");
return true;
}
return false; // Pass to next handler in chain
}
tinyMCE.init({
...
execcommand_callback : "myCustomExecCommandHandler"
});
An additional note: if you have URL processing rules, you may wish to apply these to the HREF of the attribute you're using, as follows (getFocusElement should be replaced by getNode in 3.xx):
var linkRef = (linkElm) ? tinyMCE.getAttrib(linkElm, "href") : '';
if (linkRef != '')
linkRef = tinyMCE.convertURL(linkRef, inst.selection.getFocusElement(), false);
| TinyMCE Create plugin 3.x < Lùi | Tiếp theo > Tạo hiệu ứng trình duyệt chuyển động xoay tròn |
|---|
Tin mới hơn:
- 21/04/2010 10:16 - 5 Online Rich Text Editors built using jQuery
- 06/01/2010 14:45 - Viết ứng dụng (gadget) OpenSocial
- 06/01/2010 11:27 - jQuery Navigation
- 07/12/2009 00:00 - Lập trình JavaScript - Đếm ngược số ngày
- 22/09/2009 16:34 - TinyMCE Create plugin 3.x
Tin cũ hơn:
- 29/06/2009 19:47 - Tạo hiệu ứng trình duyệt chuyển động xoay tròn
- 16/06/2009 08:32 - Tạo YAHOO Shortcuts bằng Javascript
- 26/05/2009 22:49 - Tạo quảng cáo hiển thị ở góc màn hình bằng javascript
- 24/05/2009 17:05 - Bật Window Popup với Javascript
- 16/05/2009 10:12 - Tắt chức năng chuột phải bằng Javascript
Download Game bóng đá PES8 Việt Nam
Tải game bóng đá FiFa 09
Tải game Dragon ball Z - 7 viên ngọc rồng
Tải Game Bóng Đá Pro Evolution Soccer 6 Việt Nam
Download PES 2011 patch Việt Nam PESVN
Tải Game Bóng Đá FIFA 2009 RIP 1 CD
Download Pro Evolution Soccer 2011
Download Game THE SIMS 3
Tải Game bóng đá PES 2009
Download PES 2011 demo
Thay đổi màn hình đăng nhập Windows 7 bằng tay
Một số hàm hay dùng trong JavaScript
Kiểm soát hoàn toàn trỏ chuột bằng bàn phím với NeatMouse
Choáng với concept của Windows Phone 8
Những đặc điểm ưu việt của Windows Phone
Ứng dụng gọi điện VoIP Viber sắp có mặt trên Windows Phone
Game Diablo 3 sắp có mặt trên Windows Phone Marketplace
37 trang css & xhtml web template miễn phí tuyệt đẹp
Những điều cơ bản cần biết về bàn phím chơi game - Gaming Keyboard
L.A. Noire: The Complete Edition - THETA [Full ISO/Action/2011] [13.37GB]
Download 7554 demo
Download Game PC, cập nhật liên tục (torrent)
PES 2012 ra mắt bản mở rộng đầu tiên vào 11/10
PES2012 - Full version - Ngôn ngữ và bình luận tiếng Anh
PES2012 - Blurry disable làm mịn đồ họa
PES 2011 PATCH 4.1 - TRANSFER UPDATE - RELEASED
Bộ sưu tập free PrestaShop Themes phần 3
Bộ sưu tập theme Prestashop miễn phí phần 2
Top 10 Free PrestaShop Themes
Download Prestashop 1.5
Download PrestaShop 1.4
Bổ sung Memcached vào PrestaShop 1.4
Hướng dẫn tích hợp Ngân Lượng vào PrestaShop
Sửa lỗi invalid carrier or no carrier selected trong PrestaShop
Cài đặt PrestaShop
Thiết kế giao diện PrestaShop Theme
Hướng dẫn cài đặt themes trong PrestaShop
Hướng dẫn cách thêm ngôn ngữ cho PrestaShop
Bộ sưu tập Giao diện Premium PrestaShop Themes chuyên nghiệp
Giới thiệu về website thương mại điện tử 2.0 Prestashop
Java mobile game - Kung Fu Panda cho di động
Hacker đang ngắm nghía mặt trận di động
20 sản phẩm hứa hẹn 'hot' nhất trong năm 2010


