JSe7en

          2012年5月7日 #

          Google JavaScript 編碼規范指南中文版

               摘要: JavaScript 語言規范變量link▽聲明變量必須加上 var 關鍵字.Decision:當你沒有寫 var, 變量就會暴露在全局上下文中, 這樣很可能會和現有變量沖突. 另外, 如果沒有加上, 很難明確該變量的作用域是什么, 變量也很可能像在局部作用域中, 很輕易地泄漏到 Document 或者 Window 中, 所以務必用 var&n...  閱讀全文

          posted @ 2012-05-07 17:51 jse7en 閱讀(1090) | 評論 (0)編輯 收藏

          2012年4月23日 #

          MyEclipse8.6打開JSP文件出錯

          在myeclipse8.6中打開一個JSP文件時彈出: Could not open the editor: Argument not valid

           

          解決辦法:右鍵你的jsp頁面。選擇open with 再選擇 MyEclipse jsp editor 就可以了。
          更改默認的打開方式:
          選擇 window-->preferences-->General-->Editors-->File Associations -->(在右邊上面的框中選擇jsp)-->(然后在下面的框中選擇MyEclipse jsp editor )-->點default就可以了。

          posted @ 2012-04-23 10:13 jse7en 閱讀(362) | 評論 (0)編輯 收藏

          2012年4月15日 #

          ckeditor 精簡與詳細配置方法

          ckeditor 精簡與詳細配置方法

          一.ckeditor 3.0.1精簡

          精簡前:4.52M   精簡后:853K
          1.刪除_samples和_source文件夾,分別為示例文件和未壓縮源程序
          2.刪除lang文件夾下除zh-cn.js,en.js下的所有語言文件.根據需要刪除
          3.刪除根目錄下的changes.html(更新列表),install.html(安裝指向),license.html(使用許可).
          4.刪除skins目錄下不需要的皮膚.我一般用V2(簡單.樸素) //如果只保留V2則必須在config.js中指定皮膚

          二.ckeditor 3.0.1相關文件配置路徑
          1./ckeditor.js   核心文件,調用需加載
          2./config.js     配置文件,參數配置均在此完成
          3./plugins/smiley/images 表情符號.

          三.ckeditor應用(.net環境)
             1.引用js腳本
             <script type=”text/javascript” src=”ckeditor/ckeditor.js”></script>
             2.將相應的控件替換成編輯器代碼
             <asp:TextBox ID=”TextBox1″ runat=”server” Rows=”10″ TextMode=”MultiLine”></asp:TextBox>
             <script type=”text/javascript”>CKEDITOR.replace(‘TextBox1′)</script>

          四.ckeditor配置(config.js配置文件)
               config.js參數說明

          //當提交包含有此編輯器的表單時,是否自動更新元素內的數據
          config.autoUpdateElement = true

          //編輯器的z-index值
          config.baseFloatZIndex = 10000

          //設置是使用絕對目錄還是相對目錄,為空為相對目錄
          config.baseHref = ”

          //設置快捷鍵 從上往下依次是:獲取焦點,元素焦點,文本菜單,撤銷,重做,重做,鏈接,粗體,斜體,下劃線
          config.keystrokes =
          [
              [ CKEDITOR.ALT + 121 /*F10*/, 'toolbarFocus' ],
              [ CKEDITOR.ALT + 122 /*F11*/, 'elementsPathFocus' ],

              [ CKEDITOR.SHIFT + 121 /*F10*/, 'contextMenu' ],

              [ CKEDITOR.CTRL + 90 /*Z*/, 'undo' ],
              [ CKEDITOR.CTRL + 89 /*Y*/, 'redo' ],
              [ CKEDITOR.CTRL + CKEDITOR.SHIFT + 90 /*Z*/, 'redo' ],

              [ CKEDITOR.CTRL + 76 /*L*/, 'link' ],

              [ CKEDITOR.CTRL + 66 /*B*/, 'bold' ],
              [ CKEDITOR.CTRL + 73 /*I*/, 'italic' ],
              [ CKEDITOR.CTRL + 85 /*U*/, 'underline' ],

              [ CKEDITOR.ALT + 109 /*-*/, 'toolbarCollapse' ]
          ]   

          //設置快捷鍵 可能與瀏覽器快捷鍵沖突 plugins/keystrokes/plugin.js.
          config.blockedKeystrokes =
          [
              CKEDITOR.CTRL + 66 /*B*/,
              CKEDITOR.CTRL + 73 /*I*/,
              CKEDITOR.CTRL + 85 /*U*/
          ]   

          //設置編輯內元素的背景色的取值 plugins/colorbutton/plugin.js.
          config.colorButton_backStyle =
              {
                  element : ‘span’,
                  styles : { ‘background-color’ : ‘#(color)’ }
              }

          //設置前景色的取值 plugins/colorbutton/plugin.js
          config.colorButton_colors = ’000,800000,8B4513,2F4F4F,008080,000080,4B0082,696969,B22222,A52A2A,DAA520,006400,40E0D0,0000CD,800080,808080,F00,FF8C00,FFD700,008000,0FF,00F,EE82EE,A9A9A9,FFA07A,FFA500,FFFF00,00FF00,AFEEEE,ADD8E6,DDA0DD,D3D3D3,FFF0F5,FAEBD7,FFFFE0,F0FFF0,F0FFFF,F0F8FF,E6E6FA,FFF’

          //是否在選擇顏色時顯示“其它顏色”選項 plugins/colorbutton/plugin.js
          config.colorButton_enableMore = false

          //區塊的前景色默認值設置 plugins/colorbutton/plugin.js
          config.colorButton_foreStyle =
              {
                  element : ‘span’,
                  styles : { ‘color’ : ‘#(color)’ }
              };

          //所需要添加的CSS文件 在此添加 可使用相對路徑和網站的絕對路徑
          config.contentsCss = ‘./contents.css’;

          //文字方向
          config.contentsLangDirection = ‘rtl’;//從左到右

          //CKeditor的配置文件 若不想配置 留空即可
          CKEDITOR.replace( ‘myfiled’, { customConfig : ‘./config.js’ } );

          //界面的語言配置 設置為’zh-cn’即可
          config.defaultLanguage = ‘en’;

          //界面編輯框的背景色 plugins/dialog/plugin.js
          config.dialog_backgroundCoverColor = ‘#fffefd’; //可設置參考
          config.dialog_backgroundCoverColor = ‘white’ //默認

          //背景的不透明度 數值應該在:0.0~1.0 之間 plugins/dialog/plugin.js
          config.dialog_backgroundCoverOpacity = 0.5

          //移動或者改變元素時 邊框的吸附距離 單位:像素 plugins/dialog/plugin.js
          config.dialog_magnetDistance = 20;

          //是否拒絕本地拼寫檢查和提示 默認為拒絕 目前僅firefox和safari支持 plugins/wysiwygarea/plugin.js.
          config.disableNativeSpellChecker = true

          //進行表格編輯功能 如:添加行或列 目前僅firefox支持 plugins/wysiwygarea/plugin.js
          config.disableNativeTableHandles = true; //默認為不開啟

          //是否開啟 圖片和表格 的改變大小的功能 config.disableObjectResizing = true;
          config.disableObjectResizing = false //默認為開啟

          //設置HTML文檔類型
          config.docType = ‘<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “
          http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>’

          //是否對編輯區域進行渲染 plugins/editingblock/plugin.js
          config.editingBlock = true

          //編輯器中回車產生的標簽
          config.enterMode = CKEDITOR.ENTER_P //可選:CKEDITOR.ENTER_BR或CKEDITOR.ENTER_DIV

          //是否使用HTML實體進行輸出 plugins/entities/plugin.js
          config.entities = true

          //定義更多的實體 plugins/entities/plugin.js
          config.entities_additional = ‘#39′ //其中#代替了&

          //是否轉換一些難以顯示的字符為相應的HTML字符 plugins/entities/plugin.js
          config.entities_greek = true

          //是否轉換一些拉丁字符為HTML plugins/entities/plugin.js
          config.entities_latin = true;

          //是否轉換一些特殊字符為ASCII字符 如:”This is Chinese: 漢語.”轉換為:”This is Chinese: 漢語.”
          plugins/entities/plugin.js
          config.entities_processNumerical = false

          //添加新組件
          config.extraPlugins = ‘myplugin’; //非默認 僅示例

          //使用搜索時的高亮色 plugins/find/plugin.js
          config.find_highlight =
              {
                  element : ‘span’,
                  styles : { ‘background-color’ : ‘#ff0′, ‘color’ : ‘#00f’ }
              };

          //默認的字體名 plugins/font/plugin.js
          config.font_defaultLabel = ‘Arial’;

          //字體編輯時的字符集 可以添加常用的中文字符:宋體、楷體、黑體等 plugins/font/plugin.js
          config.font_names = ‘Arial;Times New Roman;Verdana’;

          //文字的默認式樣 plugins/font/plugin.js
          config.font_style =
              {
                  element   : ‘span’,
                  styles   : { ‘font-family’ : ‘#(family)’ },
                  overrides : [ { element : 'font', attributes : { 'face' : null } } ]
              };

          //字體默認大小 plugins/font/plugin.js
          config.fontSize_defaultLabel = ’12px’;

          //字體編輯時可選的字體大小 plugins/font/plugin.js
          config.fontSize_sizes =’8/8px;9/9px;10/10px;11/11px;12/12px;14/14px;16/16px;18/18px;20/20px;22/22px;24/24px;26/26px;28/28px;36/36px;48/48px;72/72px’

          //設置字體大小時 使用的式樣 plugins/font/plugin.js
          config.fontSize_style =
              {
                  element   : ‘span’,
                  styles   : { ‘font-size’ : ‘#(size)’ },
                  overrides : [ { element : 'font', attributes : { 'size' : null } } ]
              };

          //是否強制復制來的內容去除格式 plugins/pastetext/plugin.js
          config.forcePasteAsPlainText =false //不去除

          //是否強制用“&”來代替“&amp;”plugins/htmldataprocessor/plugin.js
          config.forceSimpleAmpersand = false;

          //對address標簽進行格式化 plugins/format/plugin.js
          config.format_address = { element : ‘address’, attributes : { class : ‘styledAddress’ } };

          //對DIV標簽自動進行格式化 plugins/format/plugin.js
          config.format_div = { element : ‘div’, attributes : { class : ‘normalDiv’ } };

          //對H1標簽自動進行格式化 plugins/format/plugin.js
          config.format_h1 = { element : ‘h1′, attributes : { class : ‘contentTitle1′ } };

          //對H2標簽自動進行格式化 plugins/format/plugin.js
          config.format_h2 = { element : ‘h2′, attributes : { class : ‘contentTitle2′ } };

          //對H3標簽自動進行格式化 plugins/format/plugin.js
          config.format_h1 = { element : ‘h3′, attributes : { class : ‘contentTitle3′ } };

          //對H4標簽自動進行格式化 plugins/format/plugin.js
          config.format_h1 = { element : ‘h4′, attributes : { class : ‘contentTitle4′ } };

          //對H5標簽自動進行格式化 plugins/format/plugin.js
          config.format_h1 = { element : ‘h5′, attributes : { class : ‘contentTitle5′ } };

          //對H6標簽自動進行格式化 plugins/format/plugin.js
          config.format_h1 = { element : ‘h6′, attributes : { class : ‘contentTitle6′ } };

          //對P標簽自動進行格式化 plugins/format/plugin.js
          config.format_p = { element : ‘p’, attributes : { class : ‘normalPara’ } };

          //對PRE標簽自動進行格式化 plugins/format/plugin.js
          config.format_pre = { element : ‘pre’, attributes : { class : ‘code’ } };

          //用分號分隔的標簽名字 在工具欄上顯示 plugins/format/plugin.js
          config.format_tags = ‘p;h1;h2;h3;h4;h5;h6;pre;address;div’

          //是否使用完整的html編輯模式 如使用,其源碼將包含:<html><body></body></html>等標簽
          config.fullPage = false

          //編輯器的高度
          config.height = 200

          //是否忽略段落中的空字符 若不忽略 則字符將以“”表示 plugins/wysiwygarea/plugin.js
          config.ignoreEmptyParagraph = true

          //在清除圖片屬性框中的鏈接屬性時 是否同時清除兩邊的<a>標簽 plugins/image/plugin.js
          config.image_removeLinkByEmptyURL = true

          //界面的現實語言 可選擇”zh-cn”
          config.language = true

          //一組用逗號分隔的標簽名稱,顯示在左下角的層次嵌套中 plugins/menu/plugin.js.
          config.menu_groups =’clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea’

          //顯示子菜單時的延遲,單位:ms plugins/menu/plugin.js
          config.menu_subMenuDelay = 400;

          //當執行“新建”命令時,編輯器中的內容 plugins/newpage/plugin.js
          config.newpage_html=”"

          //當從word里復制文字進來時,是否進行文字的格式化去除 plugins/pastefromword/plugin.js
          config.pasteFromWordIgnoreFontFace = true; //默認為忽略格式

          //是否使用<h1><h2>等標簽修飾或者代替從word文檔中粘貼過來的內容 plugins/pastefromword/plugin.js
          config.pasteFromWordKeepsStructure = false;

          //從word中粘貼內容時是否移除格式 plugins/pastefromword/plugin.js
          config.pasteFromWordRemoveStyle = false

          //對應后臺語言的類型來對輸出的HTML內容進行格式化
          config.protectedSource.push( /<?[sS]*??>/g );   // PHP Code
          config.protectedSource.push( //g );   // ASP Code
          config.protectedSource.push( /(]+>[s|S]*?</asp:[^>]+>)|(]+/>)/gi );   // ASP.Net Code
          默認為空

          //是否允許改變大小 plugins/resize/plugin.js
          config.resize_enabled = true

          //改變大小的最大高度 plugins/resize/plugin.js
          config.resize_maxHeight = 3000;

          //改變大小的最大寬度 plugins/resize/plugin.js
          config.resize_maxWidth = 3000;

          //改變大小的最小高度 plugins/resize/plugin.js
          config.resize_minHeight = 250;

          //改變大小的最小寬度 plugins/resize/plugin.js
          config.resize_minWidth = 750;

          //當輸入:shift+Enter是插入的標簽
          config.shiftEnterMode = CKEDITOR.ENTER_P;//可選:CKEDITOR.ENTER_BR或CKEDITOR.ENTER_DIV

          //可選界面包
          config.skin = ‘default’;

          //可選的表情替代字符 plugins/smiley/plugin.js.
          config.smiley_descriptions = [
              ':)', ':(', ';)', ':D', ':/', ':P',
              '', '', '', '', '', '',
              '', ';(', '', '', '', '',
              '', ':kiss', '' ];

          //對應的表情圖片 plugins/smiley/plugin.js
          config.smiley_images = [
              'regular_smile.gif','sad_smile.gif','wink_smile.gif','teeth_smile.gif','confused_smile.gif','tounge_smile.gif',
              'embaressed_smile.gif','omg_smile.gif','whatchutalkingabout_smile.gif','angry_smile.gif','angel_smile.gif','shades_smile.gif',
              'devil_smile.gif','cry_smile.gif','lightbulb.gif','thumbs_down.gif','thumbs_up.gif','heart.gif',
              'broken_heart.gif','kiss.gif','envelope.gif'];

          //表情的地址 plugins/smiley/plugin.js
          config.smiley_path = ‘plugins/smiley/images/’

          //頁面載入時,編輯框是否立即獲得焦點 plugins/editingblock/plugin.js plugins/editingblock/plugin.js.
          config.startupFocus = false

          //載入時,以何種方式編輯 源碼和所見即所得 “source”和”wysiwyg” plugins/editingblock/plugin.js.
          config.startupMode =’wysiwyg’

          //載入時,是否顯示框體的邊框 plugins/showblocks/plugin.js
          config.startupOutlineBlocks = false

          //是否載入樣式文件 plugins/stylescombo/plugin.js.
          config.stylesCombo_stylesSet = ‘default’;
          //以下為可選
          config.stylesCombo_stylesSet = ‘mystyles’;
          config.stylesCombo_stylesSet = ‘mystyles:/editorstyles/styles.js’;
          config.stylesCombo_stylesSet = ‘mystyles:http://www.example.com/editorstyles/styles.js’;

          //起始的索引值
          config.tabIndex =0

          //當用戶鍵入TAB時,編輯器走過的空格數,(&nbsp;) 當值為0時,焦點將移出編輯框 plugins/tab/plugin.js
          config.tabSpaces = 0

          //默認使用的模板 plugins/templates/plugin.js.
          config.templates = ‘default’

          //用逗號分隔的模板文件plugins/templates/plugin.js.
          config.templates_files =[ 'plugins/templates/templates/default.js' ]

          //當使用模板時,“編輯內容將被替換”框是否選中 plugins/templates/plugin.js
          config.templates_replaceContent = true;

          //主題
          config.theme = ‘default’;

          //使用的工具欄 plugins/toolbar/plugin.js
          config.toolbar = ‘Full’

          這將配合:
          config.toolbar_Full =
          [
              ['Source','-','Save','NewPage','Preview','-','Templates'],
              ['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'],
              ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
              ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],
              ‘/’,
              ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
              ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
              ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
              ['Link','Unlink','Anchor'],
              ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'],
              ‘/’,
              ['Styles','Format','Font','FontSize'],
          ['TextColor','BGColor']
          ];

          //工具欄是否可以被收縮 plugins/toolbar/plugin.js.
          config.toolbarCanCollapse = true

          //工具欄的位置 plugins/toolbar/plugin.js
          config.toolbarLocation = ‘top’;//可選:bottom

          //工具欄默認是否展開 plugins/toolbar/plugin.js
          config.toolbarStartupExpanded = true;

          //撤銷的記錄步數 plugins/undo/plugin.js
          config.undoStackSize =20

          //編輯器的寬度 plugins/undo/plugin.js
          config.width = “”

          插入圖片

          CKEDITOR.instances.content.insertHtml(“<img src=…>”);

          設置值、取值

          設置值

          CKEDITOR.instances.content.setData(“千一網絡”); // content 就是前面 CKEDITOR.replace 的第一個參數值

          var editor = CKEDITOR.replace(“content”);
          editor.setData(“千一網絡”);

          設置編輯器皮膚、寬高

          <textarea cols=”90″ rows=”10″ id=”content” name=”content”>cftea</textarea>
          <script type=”text/javascript” src=”ckeditor/ckeditor.js”></script>
          <script type=”text/javascript”>
          <!–
              CKEDITOR.replace(“content”,
                {
                    skin: “kama”, width:700, height:300
                });
          //–>
          </script>

          例子

                          <asp:TextBox ID=”txtContent” runat=”server” TextMode=”MultiLine”></asp:TextBox>

                          <script type=”text/javascript”>
                                          <!–
                                          CKEDITOR.replace(‘<%= txtContent.ClientID %>’,
                                          {
                                          toolbar : ‘Product’,
                                          width:’580px’,
                                          toolbarStartupExpanded:false
                                          }
                                          );
                                          // –>
                          </script>

          轉載自:http://www.chhua.com/web-note827

          posted @ 2012-04-15 10:36 jse7en 閱讀(313) | 評論 (0)編輯 收藏

          2012年4月14日 #

          Java上CKEditor集成指南

               摘要: Java上CKEditor集成指南內容系統需求安裝添加客戶端CKEditor添加標簽庫(ckeditor-Java-core)使用maven2沒有Maven頁面上使用標簽更換選擇的textarea元素更換所有的textarea元素創建一個CKEditor實例常見的標記屬性basePathconfig新的CKEditor 3.6工具欄語法timestampinitializedevent例如:glo...  閱讀全文

          posted @ 2012-04-14 21:23 jse7en 閱讀(2365) | 評論 (2)編輯 收藏

          僅列出標題  
          主站蜘蛛池模板: 罗山县| 收藏| 城固县| 襄城县| 永城市| 湖州市| 资阳市| 太原市| 寿光市| 平乐县| 会同县| 探索| 庐江县| 潜江市| 资兴市| 三台县| 彭州市| 稻城县| 天峨县| 岳阳市| 贵州省| 营山县| 垦利县| 本溪市| 土默特左旗| 洛隆县| 巩义市| 兴和县| 西吉县| 竹溪县| 新晃| 柳州市| 佛学| 武平县| 大英县| 房山区| 桦甸市| 筠连县| 礼泉县| 容城县| 虞城县|