Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537
為發的技術文章多半含有代碼,如果沒有代碼插件,那代碼就顯的太難看了,恰好ckeditor官方提供了高亮插件,這里記錄一下如何實現。
一、下載插件及依賴工具
Code Snippet
widget
lineutils
widgetselection
二、將下載的插件解壓,并復制到帝國的ckeditor目錄下,注意是后臺的那個
默認后臺目錄:e\admin\ecmseditor\infoeditor\plugins
三、修改配置文件
配置文件路徑:e\admin\ecmseditor\infoeditor\config.js
配置文件中共有兩個工具條,一個是全功能的,一個是精簡的
在兩個工具條中添加代碼工具CodeSnippet
然后在工具條下方添加代碼工具的配置
這里我把我的發上來供大家參考
CKEDITOR.editorConfig=function( config ) { // Define changes to default configuration here. For example: // config.language='fr'; // config.uiColor='#AADC6E'; config.filebrowserImageUploadUrl=''; config.filebrowserFlashUploadUrl=arraycs[0]; config.filebrowserImageBrowseUrl=arraycs[1]; config.filebrowserFlashBrowseUrl=arraycs[1]; config.enterMode=CKEDITOR.ENTER_BR; config.shiftEnterMode=CKEDITOR.ENTER_P; config.allowedContent=true; config.font_names='宋體/宋體;黑體/黑體;仿宋/仿宋_GB2312;楷體/楷體_GB2312;隸書/隸書;幼圓/幼圓;微軟雅黑/微軟雅黑;'+ config.font_names; // Toolbar config.toolbar_full=[ { name: 'document', groups: [ 'mode', 'document', 'doctools' ], items: [ 'Source', '-', 'Preview', 'Print' ] }, { name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] }, { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ], items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl' ] }, '/', { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat', 'ecleanalltext', 'autoformat' ] }, { name: 'links', items: [ 'Link', 'Unlink', 'Anchor' ] }, { name: 'insert', items: [ 'Image', 'etranmore', 'Flash', 'etranmedia', 'etranfile', '-', 'Table', 'HorizontalRule', 'SpecialChar','CodeSnippet', 'equotetext', 'einserttime', 'einsertpage', 'einsertbr' ] }, '/', { name: 'styles', items: [ 'Styles', 'Format', 'Font', 'FontSize' ] }, { name: 'colors', items: [ 'TextColor', 'BGColor' ] }, { name: 'tools', items: [ 'ShowBlocks', 'NewPage', 'Templates' ] }, { name: 'others', items: [ '-' ] }, { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ], items: [ 'Find', 'Replace', '-', 'SelectAll', 'Maximize' ] } ]; // Toolbar config.toolbar_basic=[ { name: 'document', groups: [ 'mode', 'document', 'doctools' ], items: [ 'Source' ] }, { name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] }, { name: 'links', items: [ 'Link', 'Unlink', 'Anchor' ] }, { name: 'insert', items: [ 'Image', 'Table', 'HorizontalRule', 'SpecialChar','CodeSnippet' ] }, { name: 'tools', items: [ 'Maximize' ] }, { name: 'others', items: [ '-' ] }, '/', { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Strike', '-', 'RemoveFormat' ] }, { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ], items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote' ] }, { name: 'styles', items: [ 'Styles', 'Format' ] }, ]; config.extraPlugins='etranfile,etranmedia,etranmore,autoformat,ecleanalltext,einsertbr,einsertpage,einserttime,equotetext'; config.extraPlugins='codesnippet'; config.codeSnippet_theme='monokai_sublime'; config.toolbar='full'; };
做完以上步驟,代碼在后臺是高亮的,但是在前臺還不是高亮顯示。現在需要我們做最后一步。
將gaoliang.css以及highlight.pack.js文件上傳到網站服務器中,并在內容模板body前添加以下代碼。
<link href="[!--news.url--]skin/jxhx/css/highlight.css" rel="stylesheet"> <script src="[!--news.url--]skin/jxhx/js/highlight.pack.js" ></script> <script>hljs.initHighlightingOnLoad();</script>
其中skin/jxhx/css和skin/jxhx/js是我放置文件的路徑,可以隨意更改,路徑正確就可以。
上述所有的插件可以通過鏈接跳轉下載,css和js文件可以從我網站張扒下來,所有的文件我都進行了打包。
帝國CMS7.5版本編輯器代碼高亮設置所有插件以及文件下載,提取碼:pspl。
上一節中,我們學習了基本的環境搭建:nodeJs、npm、VSCode、AngularCli9的安裝。
如果你順利地都安裝成功了,那么我們可以開始進行系統的構建和開發了,如果我們采用TypeScript,則我們還需要安裝TypeScript支持。
本節內容中,我們會學會安裝TypeScript,然后創建一個Angular工程,并嘗試啟動。
1、使用如下命令安裝:
npm install -g typescript
-g 參數代表著該模塊是全局的。全局是相對于當前某個工程而言的。
2、安裝完成后我們可以使用 tsc 命令來執行 TypeScript 的相關代碼,以下是查看版本號:
tsc -v
3、我們可以測試一下TypeScript,建立一個app.ts 文件,內容如下。
var message:string="Hello World"
console.log(message)
TypeScript腳本文件的擴展名即.ts
后執行以下命令將 TypeScript 轉換為 JavaScript 代碼:
tsc app.ts
執行完成,當前目錄下(與 app.ts 同一目錄)就會生成一個 app.js 文件,代碼如下:
var message="Hello World";
console.log(message);
然后使用 node 命令來執行 app.js 文件,則會輸出 Hello world:
D:\>node app.js
Hello World
至此,TypeScript安裝成功。
1、我們利用AngularCli 可以方便的創建工程,僅僅需要一行命令:
ng new my-app
假設我們要在D盤,ECMS目錄下建立我們的工程ecms-web,則啟動CMD命令行,切換到D:\ECMS,然后輸入我們的命令ng new ecms-web即可,也可以,在VSCode的終端中輸入,由于要生成文件可能需要管理員權限運行命令行工具:
Microsoft Windows [版本 10.0.18363.836]
(c) 2019 Microsoft Corporation。保留所有權利。
C:\Windows\system32>d:
D:\>cd ECMS
D:\ECMS>dir
驅動器 D 中的卷沒有標簽。
卷的序列號是 9C30-21F8
D:\ECMS 的目錄
2021/03/12 14:40 <DIR> .
2021/03/12 14:40 <DIR> ..
0 個文件 0 字節
2 個目錄 48,212,746,240 可用字節
D:\ECMS>ng new ecms-web
? Would you like to add Angular routing? Yes
? Which stylesheet format would you like to use? CSS
CREATE ecms-web/angular.json (3582 bytes)
CREATE ecms-web/package.json (1252 bytes)
CREATE ecms-web/README.md (1025 bytes)
CREATE ecms-web/tsconfig.json (489 bytes)
CREATE ecms-web/tslint.json (3125 bytes)
CREATE ecms-web/.editorconfig (274 bytes)
CREATE ecms-web/.gitignore (631 bytes)
CREATE ecms-web/browserslist (429 bytes)
CREATE ecms-web/karma.conf.js (1020 bytes)
CREATE ecms-web/tsconfig.app.json (210 bytes)
CREATE ecms-web/tsconfig.spec.json (270 bytes)
CREATE ecms-web/src/favicon.ico (948 bytes)
CREATE ecms-web/src/index.html (293 bytes)
CREATE ecms-web/src/main.ts (372 bytes)
CREATE ecms-web/src/polyfills.ts (2835 bytes)
CREATE ecms-web/src/styles.css (80 bytes)
CREATE ecms-web/src/test.ts (753 bytes)
CREATE ecms-web/src/assets/.gitkeep (0 bytes)
CREATE ecms-web/src/environments/environment.prod.ts (51 bytes)
CREATE ecms-web/src/environments/environment.ts (662 bytes)
CREATE ecms-web/src/app/app-routing.module.ts (246 bytes)
CREATE ecms-web/src/app/app.module.ts (393 bytes)
CREATE ecms-web/src/app/app.component.html (25757 bytes)
CREATE ecms-web/src/app/app.component.spec.ts (1065 bytes)
CREATE ecms-web/src/app/app.component.ts (212 bytes)
CREATE ecms-web/src/app/app.component.css (0 bytes)
CREATE ecms-web/e2e/protractor.conf.js (808 bytes)
CREATE ecms-web/e2e/tsconfig.json (214 bytes)
CREATE ecms-web/e2e/src/app.e2e-spec.ts (641 bytes)
CREATE ecms-web/e2e/src/app.po.ts (301 bytes)
√ Packages installed successfully.
warning: LF will be replaced by CRLF in .editorconfig.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in .gitignore.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in README.md.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in angular.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in browserslist.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in e2e/protractor.conf.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in e2e/src/app.e2e-spec.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in e2e/src/app.po.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in e2e/tsconfig.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in karma.conf.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in package-lock.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in package.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/app/app-routing.module.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/app/app.component.html.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/app/app.component.spec.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/app/app.component.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/app/app.module.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/environments/environment.prod.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/environments/environment.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/index.html.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/main.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/polyfills.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/styles.css.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/test.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in tsconfig.app.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in tsconfig.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in tsconfig.spec.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in tslint.json.
The file will have its original line endings in your working directory
Successfully initialized git.
D:\ECMS>
以上是整個過程。
在我們輸入完命令,回車后,會有兩個選項供我們選擇:
would you like to add Angular routing?
我們輸入y,回車。
? Which stylesheet format would you like to use?
直接回車,默認選擇css。您也可以按上下箭頭鍵,選擇其他的css樣式文件格式。
然后,AngularCli 會為我們創建一個基本的包含路由的Angular工程。
2、我們啟動工程
我們進入剛剛創建的工程目錄,然后執行如下命令:
ng serve
首次運行,會提示我們是否匿名分享數據,我們輸入n,回車即可。
過程如下:
D:\ECMS>
D:\ECMS>cd ecms-web
D:\ECMS\ecms-web>dir
D:\ECMS\ecms-web 的目錄
2021/03/12 14:44 <DIR> .
2021/03/12 14:44 <DIR> ..
2021/03/12 14:43 274 .editorconfig
2021/03/12 14:43 631 .gitignore
2021/03/12 15:00 3,623 angular.json
2021/03/12 14:43 429 browserslist
2021/03/12 14:43 <DIR> e2e
2021/03/12 14:43 1,020 karma.conf.js
2021/03/12 14:44 <DIR> node_modules
2021/03/12 14:44 536,685 package-lock.json
2021/03/12 14:43 1,252 package.json
2021/03/12 14:43 1,025 README.md
2021/03/12 14:43 <DIR> src
2021/03/12 14:43 210 tsconfig.app.json
2021/03/12 14:43 489 tsconfig.json
2021/03/12 14:43 270 tsconfig.spec.json
2021/03/12 14:43 3,125 tslint.json
12 個文件 549,033 字節
5 個目錄 47,722,569,728 可用字節
D:\ECMS\ecms-web>ng serve
Compiling @angular/core : es2015 as esm2015
Compiling @angular/animations : es2015 as esm2015
Compiling @angular/compiler/testing : es2015 as esm2015
Compiling @angular/common : es2015 as esm2015
Compiling @angular/animations/browser : es2015 as esm2015
Compiling @angular/core/testing : es2015 as esm2015
Compiling @angular/platform-browser : es2015 as esm2015
Compiling @angular/common/http : es2015 as esm2015
Compiling @angular/animations/browser/testing : es2015 as esm2015
Compiling @angular/common/testing : es2015 as esm2015
Compiling @angular/router : es2015 as esm2015
Compiling @angular/forms : es2015 as esm2015
Compiling @angular/platform-browser-dynamic : es2015 as esm2015
Compiling @angular/platform-browser/testing : es2015 as esm2015
Compiling @angular/platform-browser/animations : es2015 as esm2015
Compiling @angular/common/http/testing : es2015 as esm2015
Compiling @angular/platform-browser-dynamic/testing : es2015 as esm2015
Compiling @angular/router/testing : es2015 as esm2015
chunk {main} main.js, main.js.map (main) 60.6 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 141 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.15 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 12.4 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 3.01 MB [initial] [rendered]
Date: 2021-03-12T07:01:57.529Z - Hash: 2710539518a87a75e029 - Time: 7501ms
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
: Compiled successfully.
啟動后,屏幕會提示如下內容:
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
: Compiled successfully.
此時我們打開瀏覽器輸入http://localhost:4200/,即可查看默認的頁面
我們可以看到網站的標題就是我們的工程名稱:EcmsWeb。
至此我們的基本工程已經建立起來了。
如果ng serve 啟動時提示端口已經被占用,我們使用如下命令指定端口啟動:
ng serve --port 4201
我們看一下建立的工程目錄結構
詳細介紹如下:
首層目錄:
src目錄:
這些文件和目錄,我們有個大概了解即可。隨后的開發過程中,如果用到那個,我們再詳細介紹。
本節教程,我們學習了安裝TypeScript的安裝以及驗證,然后學習了如何建立一個Angular工程,以及如何啟動和瀏覽工程。最后簡單介紹了工程的目錄結構情況。
收臺達plc模塊回收臺達觸摸屏 回收臺達PLC模塊臺達變頻器臺達觸摸屏 C2000 Plus、CH2000、MS300、MS300 IP66、ME300、VFD-E、VFD-EL、VFD-EL-W、CP2000、HES-C、MST、CSJ、MSI、AFE2000、REG2000、ASDA-A3、ASDA-B3、ASDA-A2、ASDA-A2-E、ASDA-B2、ASDA-M、ASDA-S、ECMS、ECML-S、ECML-S1606、ECML-S1608、ECML-S2003、ECML-S2004、ECML-S2005、ECML-S2504、ECML-S2506、ECML-S2508、ECML-S3204、ECML-S3206、ECML-S3208、ECML-S3505、ECML-S3506、ECML - SM16、ECML - SM20、ECML - SM25、ECML - SM32、ECML - SM35、ECM-PU381、ECM-PU382、ECM-PU383、ECM-PU384、DRVA1L7、DRS、DRS40L3、DRS60L6、DRS80LC、DRS30L3SS1BN002、DRS40L3SS1BN002、DRS60L3SS1BN002、DRS50L6SS1BN002、DRS60L6SS1BN002、DRS70L6SS1BN002、DRS60LCSS1BN002、DRS70LCSS1BN002、DRS80LCSS1BN002、DRS60H6SS1BN002、RS-AFS、RS-AFS60LA01、RS-AFS60LA02、D2V75W2BA、PMR-4V320WCAA、PMR-4V320WDAA、PMR-4V320WDGA、PMR-4V320WDBA、PMR-4V320WDCA、PMR-5V320WCAA、PMR-5V320WDAA、PMR-5V320WDGA、PMR-5V320WDBA、PMR-5V320WDCA、PJ、PJB、PJH、PJT、PJU、PJ-5V15WBNA、PJ-12V15WBNA、PJ-12V30WBNA、PJ-12V50WBNA、PJ-12V100WBNA、PJ-12V150WBNA、PJ-24V30WBNA、PJ-24V50WBNA、PJ-24V100WBNA、PJ-24V150WBNA、PJ-48V50WBNA、PJB-24V100WBNA、PJB-24V150WBNA、PJB-24V240WBNA、PJB-24V300WBNA、PJH-24V300WBBA、PJH-24V300WBCA、PJH-36V300WBBA、PJH-36V300WBCA、PJT-12V40WBAA、PJT-12V65WBAA、PJT-12V100WBAA、PJT-12V100WBBA、PJT-15V40WBAA、回收臺達變頻器回收臺達plc回收臺達驅動器回收臺達伺服,回收臺達伺服驅動器,伺服放大器,伺服電機,伺服馬達,伺服定位模塊回收臺達伺服 收購臺達驅動器 馬達 電機,鞍山常年回收臺達變頻器,收購臺達驅動器,回收臺達plc,回收臺達伺服等等臺達電子元器件常年回收回收工控自動化氣動產品,工廠拆機,設備淘汰,工程剩余貨,流水線返修器件,閑置貨全回收
交易方式:量大可上門現金交易,快遞代收款,支付寶轉賬,轉賬
回收二手西門子要求;外觀完好、物色好、外觀沒有明顯劃痕、功能正常、年份不限、數量不限、有多少要多少、
誠信交易、可上門交易、上門取貨、交易地點、時間、由你選擇、付款方式靈活、可快遞代收、‘、、
支付寶、等等付款方式任你選擇、有貨的朋友還在等什么、趕快和我聯系吧接頭暗號:180-7436-8880(V電)同號
*請認真填寫需求信息,我們會在24小時內與您取得聯系。