Envato Marketplace CKEditor Support

This is a userscript to add the CKEditor to Envato comment and edit forms.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name            Envato Marketplace CKEditor Support
// @author          Adrian Moerchen
// @homepage        https://github.com/scrobbleme/Envato-CKEditor-Support
// @supportURL      https://github.com/scrobbleme/Envato-CKEditor-Support
// @contributionURL   http://codecanyon.net/user/scrobbleme/portfolio?ref=scrobbleme
// @namespace       scrobble.me
// @date            2014-12-14
// @version         1.1.0
// @include         http://activeden.net*
// @include         http://audiojungle.net*
// @include         http://themeforest.net*
// @include         http://videohive.net*
// @include         http://graphicriver.net*
// @include         http://3docean.net*
// @include         http://codecanyon.net*
// @include         http://photodune.net*
// @grant           none
// @description This is a userscript to add the CKEditor to Envato comment and edit forms.
// ==/UserScript==

var head = document.getElementsByTagName("head")[0];
var script_to_load = document.createElement('script');

script_to_load.setAttribute('src', location.protocol + '//cdn.ckeditor.com/4.4.6/standard/ckeditor.js');
script_to_load.onload = function () {
    var selector = '#description, #item_comment_content, #thread_message_content, .js-comment-new-reply-field';
    var editors = document.querySelectorAll(selector);
    for (var i = 0; i < editors.length; i++) {
        CKEDITOR.replace(editors[i]);
    }
};
head.appendChild(script_to_load);

style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = "a.cke_button {height: 25px !important; background: transparent !important;}";
head.appendChild(style);