// ==UserScript== // @name Vox Editing with WYSIWYG or HTML alternately // @namespace http://lowreal.net/ // @include http://www.vox.com/compose* // @include http://*.vox.com/library/post/* // @exclude http://*.vox.com/services/editor/content* // ==/UserScript== (function () { var icon = <>.toString().replace(/\s+/g, ""); var iconHover = <>.toString().replace(/\s+/g, ""); var iconActive = <>.toString().replace(/\s+/g, ""); GM_addStyle([ ".editor-toolbar a.button.command-toggle-mode {", "background: url('",icon,"');", "}", ".editor-toolbar a.button.command-toggle-mode:hover {", "background: url('",iconHover,"');", "}", ".editor-toolbar a.button.command-toggle-mode.textmode ,", ".editor-toolbar a.button.command-toggle-mode.textmode:hover {", "background: url('",iconActive,"');", "}", "#comment-editor {", "background: #fff !important;", "color: #000 !important;", "}" ].join("")); })(); location.href = "javascript:"+encodeURIComponent(uneval(function () { var toolbar = document.getElementById("compose-entry-toolbar") || document.getElementById("comment-editor-toolbar"); var button = h("ToggleMode").firstChild; toolbar.insertBefore(button, document.getElementById("restore-post")); var update = function () { setTimeout(function () { if (app.editor.mode == "textarea") { DOM.addClassName(button, "textmode"); } else { DOM.removeClassName(button, "textmode"); } } ,0); }; button.addEventListener("click", update, false); update(); function h (s) { var d = document.createElement("div"); d.innerHTML = s; return d; } }))+"()";