📄 kupustart.js
字号:
/***************************************************************************** * * Copyright (c) 2003-2004 Kupu Contributors. All rights reserved. * * This software is distributed under the terms of the Kupu * License. See LICENSE.txt for license text. For a list of Kupu * Contributors see CREDITS.txt. * *****************************************************************************/// $Id: kupustart.js,v 1.1 2005/03/26 20:31:36 svieujot Exp $function startKupu() { // initialize the editor, initKupu groks 1 arg, a reference to the iframe var frame = document.getElementById('kupu-editor'); var kupu = initKupu(frame); // this makes the editor's content_changed attribute set according to changes // in a textarea or input (registering onchange, see saveOnPart() for more // details) kupu.registerContentChanger(document.getElementById('kupu-editor-textarea')); // let's register saveOnPart(), to ask the user if he wants to save when // leaving after editing if (kupu.getBrowserName() == 'IE') { // IE supports onbeforeunload, so let's use that addEventHandler(window, 'beforeunload', saveOnPart); } else { // some versions of Mozilla support onbeforeunload (starting with 1.7) // so let's try to register and if it fails fall back on onunload var re = /rv:([0-9\.]+)/ var match = re.exec(navigator.userAgent) if (match[1] && parseFloat(match[1]) > 1.6) { addEventHandler(window, 'beforeunload', saveOnPart); } else { addEventHandler(window, 'unload', saveOnPart); }; }; // and now we can initialize... kupu.initialize(); return kupu;};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -