syntaxhighlight.js ( 文件浏览 )
- keepall 发布于 2016-12-09 21:19
- 浏览次数:440
- 下载次数: 4
- 下载需 10 积分
-
- 侵权举报
/* * Syntax Highlighter 2.0 plugin for FCKEditor * ======================== * Copyright (C) 2008 Darren James * Email : darren.james@gmail.com * URL : http://www.psykoptic.com/blog/ * * NOTE: * ======================== * This plugin will add or edit a formatted <pre> tag for FCKEditor * To see results on the front end of your website * You will need to install SyntaxHighlighter 2.0.x from * http://alexgorbatchev.com/wiki/SyntaxHighlighter * * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program. If not, see <http:*www.gnu.org/licenses/>. * This program comes with ABSOLUTELY NO WARRANTY. */ var version = "2.1.0"; var dialog = window.parent; // IE7 needs this var oEditor = window.parent.InnerDialogLoaded(); var FCK = oEditor.FCK; var FCKLang = oEditor.FCKLang; var FCKConfig = oEditor.FCKConfig; var FCKTools = oEditor.FCKTools; var FCKBrowserInfo = oEditor.FCKBrowserInfo; // default syntax object function CodeSyntax() { var oCodeSyntax = new Object(); oCodeSyntax.Code = oContainerPre.innerHTML; oCodeSyntax.Advanced = false; oCodeSyntax.Gutter = false; oCodeSyntax.NoControls = false; oCodeSyntax.Collapse = false; oCodeSyntax.Firstline = 0; oCodeSyntax.Showcolumns = false; oCodeSyntax.Highlight = null; return oCodeSyntax; } var oContainerPre = FCK.Selection.MoveToAncestorNode('PRE'); var oCodeSyntax = null; // ---------------------- // populate our oCodeSyntax object if (oContainerPre) { if (oContainerPre.tagName == 'PRE' && GetAttribute(oContainerPre, 'title') == 'code') { var CodeSettings = GetAttribute(oContainerPre, 'class', ''); if (CodeSettings.length > 0) { // found valid code snippet, populate our CodeSyntax object oCodeSyntax = new CodeSyntax(); if (CodeSettings.indexOf(";") > -1) { // advanced options set oCodeSyntax.Advanced = true; oCodeSyntax.Lang = CodeSettings.substring(CodeSettings.indexOf(":") + 1, CodeSettings.indexOf(";")).replace(/^\s+|\s+$/g, ""); if (CodeSettings.indexOf("gutter") > -1) oCodeSyntax.Gutter = true; if (CodeSettings.indexOf("toolbar") > -1) oCodeSyntax.NoControls = true; if (CodeSettings.indexOf("collapse") > -[!==More==!]
...
展开> <收缩
Sponsored links
源码文件列表
温馨提示: 点击源码文件名可预览文件内容哦 ^_^ Sponsored links