Update to Drupal 8.0.0-rc3. For more information, see https://www.drupal.org/node/2608078
This commit is contained in:
parent
6419a031d7
commit
4afb23bbd3
124
composer.lock
generated
124
composer.lock
generated
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"hash": "8c9fdf621ce53640f24b24749e59717c",
|
||||
"hash": "2be29019515c847055593ea41b88475d",
|
||||
"content-hash": "f38613812a285c03a1a18458384fe0b1",
|
||||
"packages": [
|
||||
{
|
||||
|
@ -2004,7 +2004,7 @@
|
|||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/wikimedia/composer-merge-plugin/zipball/47bb3388cfeae41a38087ac8465a7d08fa92ea2e",
|
||||
"url": "https://api.github.com/repos/wikimedia/composer-merge-plugin/zipball/6196fdb001faf681f92db2ae10abafb5815affde",
|
||||
"reference": "47bb3388cfeae41a38087ac8465a7d08fa92ea2e",
|
||||
"shasum": ""
|
||||
},
|
||||
|
@ -2585,6 +2585,124 @@
|
|||
],
|
||||
"time": "2015-08-29 16:16:56"
|
||||
},
|
||||
{
|
||||
"name": "jcalderonzumba/gastonjs",
|
||||
"version": "dev-master",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jcalderonzumba/gastonjs.git",
|
||||
"reference": "5e231b4df98275c404e1371fc5fadd34f6a121ad"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/jcalderonzumba/gastonjs/zipball/5e231b4df98275c404e1371fc5fadd34f6a121ad",
|
||||
"reference": "5e231b4df98275c404e1371fc5fadd34f6a121ad",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"guzzlehttp/guzzle": "~5.0|~6.0",
|
||||
"php": ">=5.4"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~4.6",
|
||||
"silex/silex": "~1.2",
|
||||
"symfony/phpunit-bridge": "~2.7",
|
||||
"symfony/process": "~2.1"
|
||||
},
|
||||
"type": "phantomjs-api",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.1.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Zumba\\GastonJS\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Juan Francisco Calderón Zumba",
|
||||
"email": "juanfcz@gmail.com",
|
||||
"homepage": "http://github.com/jcalderonzumba"
|
||||
}
|
||||
],
|
||||
"description": "PhantomJS API based server for webpage automation",
|
||||
"homepage": "https://github.com/jcalderonzumba/gastonjs",
|
||||
"keywords": [
|
||||
"api",
|
||||
"automation",
|
||||
"browser",
|
||||
"headless",
|
||||
"phantomjs"
|
||||
],
|
||||
"time": "2015-10-07 11:40:41"
|
||||
},
|
||||
{
|
||||
"name": "jcalderonzumba/mink-phantomjs-driver",
|
||||
"version": "dev-master",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jcalderonzumba/MinkPhantomJSDriver.git",
|
||||
"reference": "10d7c48c9a4129463052321b52450d98983c4332"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/jcalderonzumba/MinkPhantomJSDriver/zipball/10d7c48c9a4129463052321b52450d98983c4332",
|
||||
"reference": "10d7c48c9a4129463052321b52450d98983c4332",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"behat/mink": "~1.6",
|
||||
"jcalderonzumba/gastonjs": "~1.0",
|
||||
"php": ">=5.4",
|
||||
"twig/twig": "~1.8"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~4.6",
|
||||
"silex/silex": "~1.2",
|
||||
"symfony/css-selector": "~2.1",
|
||||
"symfony/phpunit-bridge": "~2.7",
|
||||
"symfony/process": "~2.3"
|
||||
},
|
||||
"type": "mink-driver",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "0.4.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Zumba\\Mink\\Driver\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Juan Francisco Calderón Zumba",
|
||||
"email": "juanfcz@gmail.com",
|
||||
"homepage": "http://github.com/jcalderonzumba"
|
||||
}
|
||||
],
|
||||
"description": "PhantomJS driver for Mink framework",
|
||||
"homepage": "http://mink.behat.org/",
|
||||
"keywords": [
|
||||
"ajax",
|
||||
"browser",
|
||||
"headless",
|
||||
"javascript",
|
||||
"phantomjs",
|
||||
"testing"
|
||||
],
|
||||
"time": "2015-10-05 18:24:44"
|
||||
},
|
||||
{
|
||||
"name": "mikey179/vfsStream",
|
||||
"version": "v1.6.0",
|
||||
|
@ -3672,6 +3790,8 @@
|
|||
"composer/semver": 0,
|
||||
"behat/mink": 0,
|
||||
"behat/mink-goutte-driver": 0,
|
||||
"jcalderonzumba/gastonjs": 20,
|
||||
"jcalderonzumba/mink-phantomjs-driver": 20,
|
||||
"mikey179/vfsstream": 0,
|
||||
"phpunit/phpunit": 0,
|
||||
"symfony/css-selector": 0
|
||||
|
|
|
@ -49,6 +49,7 @@ maintainer. Current subsystem maintainers for Drupal 8:
|
|||
Ajax system
|
||||
- Alex Bronstein 'effulgentsia' https://www.drupal.org/u/effulgentsia
|
||||
- Earl Miles 'merlinofchaos' https://www.drupal.org/u/merlinofchaos
|
||||
- Tim Plunkett 'tim.plunkett' https://www.drupal.org/u/tim.plunkett
|
||||
|
||||
Asset library system
|
||||
- ?
|
||||
|
|
|
@ -64,8 +64,8 @@ following the instructions in the INTRODUCTION section at the top of this file:
|
|||
Enable the "Put site into maintenance mode" checkbox and save the
|
||||
configuration.
|
||||
|
||||
3. Remove all old core files and directories, except for the 'sites' directory
|
||||
and any custom files you added elsewhere.
|
||||
3. Remove the 'core' and 'vendor' directories. Also remove all of the files
|
||||
in the top-level directory, except any that you added manually.
|
||||
|
||||
If you made modifications to files like .htaccess, composer.json, or
|
||||
robots.txt you will need to re-apply them from your backup, after the new
|
||||
|
|
27
core/assets/vendor/ckeditor/CHANGES.md
vendored
27
core/assets/vendor/ckeditor/CHANGES.md
vendored
|
@ -1,6 +1,33 @@
|
|||
CKEditor 4 Changelog
|
||||
====================
|
||||
|
||||
## CKEditor 4.5.4
|
||||
|
||||
New Features:
|
||||
|
||||
* [#13632](http://dev.ckeditor.com/ticket/13632): Introduce error logging mechanism.
|
||||
* [#13730](http://dev.ckeditor.com/ticket/13730): Switch to the new error logging mechanism.
|
||||
|
||||
Fixed Issues:
|
||||
|
||||
* [#9856](http://dev.ckeditor.com/ticket/9856): Fixed: Cannot use the native context menu together with the [Div Editing Area](http://ckeditor.com/addon/divarea) plugin. Thanks to [Mark Wade](https://github.com/mark-wade)!
|
||||
* [#12733](http://dev.ckeditor.com/ticket/12733): [IE9+] Fixed: Radio button `onChange` does not work. Thanks to [Iliya Kostadinov](https://github.com/iliyakostadinov)!
|
||||
* [#13142](http://dev.ckeditor.com/ticket/13142): [Edge] Fixed: *Ctrl+A* and then *Backspace* result in an empty `<div>` element.
|
||||
* [#13599](http://dev.ckeditor.com/ticket/13599): Fixed: Cross-editor drag and drop of an inline widget results in error/artifacts.
|
||||
* [#13640](http://dev.ckeditor.com/ticket/13640): [IE] Fixed: Dropping a widget outside the `<body>` element is not handled correctly.
|
||||
* [#13533](http://dev.ckeditor.com/ticket/13533): Fixed: No progress during upload.
|
||||
* [#13680](http://dev.ckeditor.com/ticket/13680): Fixed: The parser should allow the `<h1-6>` element to be a child of the `<summary>` element.
|
||||
* [#11724](http://dev.ckeditor.com/ticket/11724): [Touch devices] Fixed: Drop-downs often hide right after opening them.
|
||||
* [#13690](http://dev.ckeditor.com/ticket/13690): Fixed: Copying content from IE to Chrome adds an extra paragraph.
|
||||
* [#13284](http://dev.ckeditor.com/ticket/13284): Fixed: Cannot drag and drop a widget if the text caret is placed just after the widget instance.
|
||||
* [#13516](http://dev.ckeditor.com/ticket/13516): Fixed: CKEditor removes empty HTML5 anchors without the `name` attribute.
|
||||
* [#13765](http://dev.ckeditor.com/ticket/13765): [Safari 9] Fixed: Problems with rendering samples.
|
||||
|
||||
Other Changes:
|
||||
|
||||
* [#11725](http://dev.ckeditor.com/ticket/11725): Marked [`CKEDITOR.env.mobile`](http://docs.ckeditor.com/#!/api/CKEDITOR.env-property-mobile) as deprecated. The reason is that it is no longer clear what "mobile" means.
|
||||
* [#13737](http://dev.ckeditor.com/ticket/13737): Upgraded [Bender.js](https://github.com/benderjs/benderjs) to 0.4.1.
|
||||
|
||||
## CKEditor 4.5.3
|
||||
|
||||
New Features:
|
||||
|
|
11
core/assets/vendor/ckeditor/build-config.js
vendored
11
core/assets/vendor/ckeditor/build-config.js
vendored
|
@ -5,6 +5,15 @@
|
|||
* CKEditor again. Alternatively, use the "build.sh" script to build it locally.
|
||||
* If you do so, be sure to pass it the "-s" flag. So: "sh build.sh -s".
|
||||
*
|
||||
* If you are developing or debugging CKEditor plugins, you may want to work
|
||||
* against an unoptimized (unminified) CKEditor build. To do so, you have two
|
||||
* options:
|
||||
* 1. Upload build-config.js to http://ckeditor.com/builder and choose the
|
||||
* "Source (Big N'Slow)" option when downloading.
|
||||
* 2. Use the "build.sh" script to build it locally, with one additional flag:
|
||||
* "sh build.sh -s --leave-js-unminified".
|
||||
* Then, replace this directory (core/assets/vendor/ckeditor) with your build.
|
||||
*
|
||||
* NOTE:
|
||||
* This file is not used by CKEditor, you may remove it.
|
||||
* Changing this file will not change your CKEditor configuration.
|
||||
|
@ -35,7 +44,7 @@ var CKBUILDER_CONFIG = {
|
|||
'adapters',
|
||||
'config.js',
|
||||
'contents.css',
|
||||
'Gruntfile.js',
|
||||
'gruntfile.js',
|
||||
'styles.js',
|
||||
'samples',
|
||||
'skins/moono/readme.md'
|
||||
|
|
2066
core/assets/vendor/ckeditor/ckeditor.js
vendored
2066
core/assets/vendor/ckeditor/ckeditor.js
vendored
File diff suppressed because it is too large
Load diff
2
core/assets/vendor/ckeditor/lang/eu.js
vendored
2
core/assets/vendor/ckeditor/lang/eu.js
vendored
File diff suppressed because one or more lines are too long
2
core/assets/vendor/ckeditor/lang/ug.js
vendored
2
core/assets/vendor/ckeditor/lang/ug.js
vendored
File diff suppressed because one or more lines are too long
|
@ -2,9 +2,9 @@
|
|||
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||
*/
|
||||
CKEDITOR.dialog.add("a11yHelp",function(j){var a=j.lang.a11yhelp,l=CKEDITOR.tools.getNextId(),e={8:a.backspace,9:a.tab,13:a.enter,16:a.shift,17:a.ctrl,18:a.alt,19:a.pause,20:a.capslock,27:a.escape,33:a.pageUp,34:a.pageDown,35:a.end,36:a.home,37:a.leftArrow,38:a.upArrow,39:a.rightArrow,40:a.downArrow,45:a.insert,46:a["delete"],91:a.leftWindowKey,92:a.rightWindowKey,93:a.selectKey,96:a.numpad0,97:a.numpad1,98:a.numpad2,99:a.numpad3,100:a.numpad4,101:a.numpad5,102:a.numpad6,103:a.numpad7,104:a.numpad8,
|
||||
CKEDITOR.dialog.add("a11yHelp",function(l){var a=l.lang.a11yhelp,n=CKEDITOR.tools.getNextId(),e={8:a.backspace,9:a.tab,13:a.enter,16:a.shift,17:a.ctrl,18:a.alt,19:a.pause,20:a.capslock,27:a.escape,33:a.pageUp,34:a.pageDown,35:a.end,36:a.home,37:a.leftArrow,38:a.upArrow,39:a.rightArrow,40:a.downArrow,45:a.insert,46:a["delete"],91:a.leftWindowKey,92:a.rightWindowKey,93:a.selectKey,96:a.numpad0,97:a.numpad1,98:a.numpad2,99:a.numpad3,100:a.numpad4,101:a.numpad5,102:a.numpad6,103:a.numpad7,104:a.numpad8,
|
||||
105:a.numpad9,106:a.multiply,107:a.add,109:a.subtract,110:a.decimalPoint,111:a.divide,112:a.f1,113:a.f2,114:a.f3,115:a.f4,116:a.f5,117:a.f6,118:a.f7,119:a.f8,120:a.f9,121:a.f10,122:a.f11,123:a.f12,144:a.numLock,145:a.scrollLock,186:a.semiColon,187:a.equalSign,188:a.comma,189:a.dash,190:a.period,191:a.forwardSlash,192:a.graveAccent,219:a.openBracket,220:a.backSlash,221:a.closeBracket,222:a.singleQuote};e[CKEDITOR.ALT]=a.alt;e[CKEDITOR.SHIFT]=a.shift;e[CKEDITOR.CTRL]=a.ctrl;var f=[CKEDITOR.ALT,CKEDITOR.SHIFT,
|
||||
CKEDITOR.CTRL],m=/\$\{(.*?)\}/g,p=function(){var a=j.keystrokeHandler.keystrokes,g={},c;for(c in a)g[a[c]]=c;return function(a,c){var b;if(g[c]){b=g[c];for(var h,i,k=[],d=0;d<f.length;d++)i=f[d],h=b/f[d],1<h&&2>=h&&(b-=i,k.push(e[i]));k.push(e[b]||String.fromCharCode(b));b=k.join("+")}else b=a;return b}}();return{title:a.title,minWidth:600,minHeight:400,contents:[{id:"info",label:j.lang.common.generalTab,expand:!0,elements:[{type:"html",id:"legends",style:"white-space:normal;",focus:function(){this.getElement().focus()},
|
||||
html:function(){for(var e='<div class="cke_accessibility_legend" role="document" aria-labelledby="'+l+'_arialbl" tabIndex="-1">%1</div><span id="'+l+'_arialbl" class="cke_voice_label">'+a.contents+" </span>",g=[],c=a.legend,j=c.length,f=0;f<j;f++){for(var b=c[f],h=[],i=b.items,k=i.length,d=0;d<k;d++){var n=i[d],o=n.legend.replace(m,p);o.match(m)||h.push("<dt>%1</dt><dd>%2</dd>".replace("%1",n.name).replace("%2",o))}g.push("<h1>%1</h1><dl>%2</dl>".replace("%1",b.name).replace("%2",h.join("")))}return e.replace("%1",
|
||||
g.join(""))}()+'<style type="text/css">.cke_accessibility_legend{width:600px;height:400px;padding-right:5px;overflow-y:auto;overflow-x:hidden;}.cke_browser_quirks .cke_accessibility_legend,{height:390px}.cke_accessibility_legend *{white-space:normal;}.cke_accessibility_legend h1{font-size: 20px;border-bottom: 1px solid #AAA;margin: 5px 0px 15px;}.cke_accessibility_legend dl{margin-left: 5px;}.cke_accessibility_legend dt{font-size: 13px;font-weight: bold;}.cke_accessibility_legend dd{margin:10px}</style>'}]}],
|
||||
CKEDITOR.CTRL],p=/\$\{(.*?)\}/g,t=function(){var a=l.keystrokeHandler.keystrokes,g={},c;for(c in a)g[a[c]]=c;return function(a,c){var b;if(g[c]){b=g[c];for(var h,k,m=[],d=0;d<f.length;d++)k=f[d],h=b/f[d],1<h&&2>=h&&(b-=k,m.push(e[k]));m.push(e[b]||String.fromCharCode(b));b=m.join("+")}else b=a;return b}}();return{title:a.title,minWidth:600,minHeight:400,contents:[{id:"info",label:l.lang.common.generalTab,expand:!0,elements:[{type:"html",id:"legends",style:"white-space:normal;",focus:function(){this.getElement().focus()},
|
||||
html:function(){for(var e='\x3cdiv class\x3d"cke_accessibility_legend" role\x3d"document" aria-labelledby\x3d"'+n+'_arialbl" tabIndex\x3d"-1"\x3e%1\x3c/div\x3e\x3cspan id\x3d"'+n+'_arialbl" class\x3d"cke_voice_label"\x3e'+a.contents+" \x3c/span\x3e",g=[],c=a.legend,l=c.length,f=0;f<l;f++){for(var b=c[f],h=[],k=b.items,m=k.length,d=0;d<m;d++){var q=k[d],r=q.legend.replace(p,t);r.match(p)||h.push("\x3cdt\x3e%1\x3c/dt\x3e\x3cdd\x3e%2\x3c/dd\x3e".replace("%1",q.name).replace("%2",r))}g.push("\x3ch1\x3e%1\x3c/h1\x3e\x3cdl\x3e%2\x3c/dl\x3e".replace("%1",
|
||||
b.name).replace("%2",h.join("")))}return e.replace("%1",g.join(""))}()+'\x3cstyle type\x3d"text/css"\x3e.cke_accessibility_legend{width:600px;height:400px;padding-right:5px;overflow-y:auto;overflow-x:hidden;}.cke_browser_quirks .cke_accessibility_legend,{height:390px}.cke_accessibility_legend *{white-space:normal;}.cke_accessibility_legend h1{font-size: 20px;border-bottom: 1px solid #AAA;margin: 5px 0px 15px;}.cke_accessibility_legend dl{margin-left: 5px;}.cke_accessibility_legend dt{font-size: 13px;font-weight: bold;}.cke_accessibility_legend dd{margin:10px}\x3c/style\x3e'}]}],
|
||||
buttons:[CKEDITOR.dialog.cancelButton]}});
|
|
@ -7,4 +7,4 @@ CKEDITOR.plugins.setLang("a11yhelp","ko",{title:"접근성 설명",contents:"도
|
|||
{name:"편집기 요소 경로 막대",legend:"${elementsPathFocus}를 눌러서 요소 경로 막대를 탐색할 수 있습니다. 다음 요소로 이동하려면 TAB 키 또는 오른쪽 화살표 키를 누릅니다. SHIFT+TAB 키 또는 왼쪽 화살표 키를 누르면 이전 버튼으로 이동할 수 있습니다. 스페이스 키나 ENTER 키를 누르면 편집기의 해당 항목을 선택합니다."}]},{name:"명령",items:[{name:" 명령 실행 취소",legend:"${undo} 누르시오"},{name:" 명령 다시 실행",legend:"${redo} 누르시오"},{name:" 굵게 명령",legend:"${bold} 누르시오"},{name:" 기울임 꼴 명령",legend:"${italic} 누르시오"},{name:" 밑줄 명령",legend:"${underline} 누르시오"},{name:" 링크 명령",legend:"${link} 누르시오"},{name:" 툴바 줄이기 명령",legend:"${toolbarCollapse} 누르시오"},
|
||||
{name:" 이전 포커스 공간 접근 명령",legend:"탈자 기호(^) 이전에 ${accessPreviousSpace} 를 누르면, 접근 불가능하면서 가장 가까운 포커스 영역에 접근합니다. 예를 들면, 두 인접한 HR 요소가 있습니다. 키 조합을 반복해서 멀리있는 포커스 영역들에 도달할 수 있습니다."},{name:"다음 포커스 공간 접근 명령",legend:"탈자 기호(^) 다음에 ${accessNextSpace} 를 누르면, 접근 불가능하면서 가장 가까운 포커스 영역에 접근합니다. 예를 들면, 두 인접한 HR 요소가 있습니다. 키 조합을 반복해서 멀리있는 포커스 영역들에 도달할 수 있습니다. "},{name:" 접근성 도움말",legend:"${a11yHelp} 누르시오"}]}],backspace:"Backspace 키",tab:"탭 키",enter:"엔터 키",shift:"시프트 키",ctrl:"컨트롤 키",alt:"알트 키",pause:"일시정지 키",capslock:"캡스 록 키",
|
||||
escape:"이스케이프 키",pageUp:"페이지 업 키",pageDown:"페이지 다운 키",end:"엔드 키",home:"홈 키",leftArrow:"왼쪽 화살표 키",upArrow:"위쪽 화살표 키",rightArrow:"오른쪽 화살표 키",downArrow:"아래쪽 화살표 키",insert:"인서트 키","delete":"삭제 키",leftWindowKey:"왼쪽 윈도우 키",rightWindowKey:"오른쪽 윈도우 키",selectKey:"셀렉트 키",numpad0:"숫자 패드 0 키",numpad1:"숫자 패드 1 키",numpad2:"숫자 패드 2 키",numpad3:"숫자 패드 3 키",numpad4:"숫자 패드 4 키",numpad5:"숫자 패드 5 키",numpad6:"숫자 패드 6 키",numpad7:"숫자 패드 7 키",numpad8:"숫자 패드 8 키",numpad9:"숫자 패드 9 키",multiply:"곱셈(*) 키",add:"덧셈(+) 키",subtract:"뺄셈(-) 키",
|
||||
decimalPoint:"온점(.) 키",divide:"나눗셈(/) 키",f1:"F1 키",f2:"F2 키",f3:"F3 키",f4:"F4 키",f5:"F5 키",f6:"F6 키",f7:"F7 키",f8:"F8 키",f9:"F9 키",f10:"F10 키",f11:"F11 키",f12:"F12 키",numLock:"Num Lock 키",scrollLock:"Scroll Lock 키",semiColon:"세미콜론(;) 키",equalSign:"등호(=) 키",comma:"쉼표(,) 키",dash:"대시(-) 키",period:"온점(.) 키",forwardSlash:"슬래시(/) 키",graveAccent:"억음 악센트(`) 키",openBracket:"브라켓 열기([) 키",backSlash:"역슬래시(\\\\) 키",closeBracket:"브라켓 닫기(]) 키",singleQuote:"외 따옴표(') 키"});
|
||||
decimalPoint:"온점(.) 키",divide:"나눗셈(/) 키",f1:"F1 키",f2:"F2 키",f3:"F3 키",f4:"F4 키",f5:"F5 키",f6:"F6 키",f7:"F7 키",f8:"F8 키",f9:"F9 키",f10:"F10 키",f11:"F11 키",f12:"F12 키",numLock:"Num Lock 키",scrollLock:"Scroll Lock 키",semiColon:"세미콜론(;) 키",equalSign:"등호(\x3d) 키",comma:"쉼표(,) 키",dash:"대시(-) 키",period:"온점(.) 키",forwardSlash:"슬래시(/) 키",graveAccent:"억음 악센트(`) 키",openBracket:"브라켓 열기([) 키",backSlash:"역슬래시(\\\\) 키",closeBracket:"브라켓 닫기(]) 키",singleQuote:"외 따옴표(') 키"});
|
|
@ -8,4 +8,4 @@ legend:"Inside a dialog, press TAB to navigate to the next dialog element, press
|
|||
{name:"فەرمانەکان",items:[{name:"پووچکردنەوەی فەرمان",legend:"کلیك ${undo}"},{name:"هەڵگەڕانەوەی فەرمان",legend:"کلیك ${redo}"},{name:"فەرمانی دەقی قەڵەو",legend:"کلیك ${bold}"},{name:"فەرمانی دەقی لار",legend:"کلیك ${italic}"},{name:"فەرمانی ژێرهێڵ",legend:"کلیك ${underline}"},{name:"فەرمانی بهستەر",legend:"کلیك ${link}"},{name:"شاردەنەوەی تووڵامراز",legend:"کلیك ${toolbarCollapse}"},{name:"چوونەناو سەرنجدانی پێشوی فەرمانی بۆشایی",legend:"کلیک ${accessPreviousSpace} to access the closest unreachable focus space before the caret, for example: two adjacent HR elements. Repeat the key combination to reach distant focus spaces."},
|
||||
{name:"چوونەناو سەرنجدانی داهاتووی فەرمانی بۆشایی",legend:"کلیک ${accessNextSpace} to access the closest unreachable focus space after the caret, for example: two adjacent HR elements. Repeat the key combination to reach distant focus spaces."},{name:"دەستپێگەیشتنی یارمەتی",legend:"کلیك ${a11yHelp}"}]}],backspace:"Backspace",tab:"Tab",enter:"Enter",shift:"Shift",ctrl:"Ctrl",alt:"Alt",pause:"Pause",capslock:"Caps Lock",escape:"Escape",pageUp:"Page Up",pageDown:"Page Down",end:"End",home:"Home",leftArrow:"Left Arrow",
|
||||
upArrow:"Up Arrow",rightArrow:"Right Arrow",downArrow:"Down Arrow",insert:"Insert","delete":"Delete",leftWindowKey:"پەنجەرەی چەپ",rightWindowKey:"پەنجەرەی ڕاست",selectKey:"Select",numpad0:"Numpad 0",numpad1:"1",numpad2:"2",numpad3:"3",numpad4:"4",numpad5:"5",numpad6:"6",numpad7:"7",numpad8:"8",numpad9:"9",multiply:"*",add:"+",subtract:"-",decimalPoint:".",divide:"/",f1:"F1",f2:"F2",f3:"F3",f4:"F4",f5:"F5",f6:"F6",f7:"F7",f8:"F8",f9:"F9",f10:"F10",f11:"F11",f12:"F12",numLock:"Num Lock",scrollLock:"Scroll Lock",
|
||||
semiColon:";",equalSign:"=",comma:",",dash:"-",period:".",forwardSlash:"/",graveAccent:"`",openBracket:"[",backSlash:"\\\\",closeBracket:"}",singleQuote:"'"});
|
||||
semiColon:";",equalSign:"\x3d",comma:",",dash:"-",period:".",forwardSlash:"/",graveAccent:"`",openBracket:"[",backSlash:"\\\\",closeBracket:"}",singleQuote:"'"});
|
|
@ -2,10 +2,11 @@
|
|||
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||
*/
|
||||
CKEDITOR.plugins.setLang("a11yhelp","ug",{title:"قوشۇمچە چۈشەندۈرۈش",contents:"ياردەم مەزمۇنى. بۇ سۆزلەشكۈنى ياپماقچى بولسىڭىز ESC نى بېسىڭ.",legend:[{name:"ئادەتتىكى",items:[{name:"قورال بالداق تەھرىر",legend:"${toolbarFocus} بېسىلسا قورال بالداققا يېتەكلەيدۇ، TAB ياكى SHIFT+TAB ئارقىلىق قورال بالداق گۇرۇپپىسى تاللىنىدۇ، ئوڭ سول يا ئوقتا توپچا تاللىنىدۇ، بوشلۇق ياكى Enter كۇنۇپكىسىدا تاللانغان توپچىنى قوللىنىدۇ."},{name:"تەھرىرلىگۈچ سۆزلەشكۈسى",legend:"Inside a dialog, press TAB to navigate to the next dialog element, press SHIFT+TAB to move to the previous dialog element, press ENTER to submit the dialog, press ESC to cancel the dialog. When a dialog has multiple tabs, the tab list can be reached either with ALT+F10 or with TAB as part of the dialog tabbing order. With tab list focused, move to the next and previous tab with RIGHT and LEFT ARROW, respectively."},
|
||||
CKEDITOR.plugins.setLang("a11yhelp","ug",{title:"قوشۇمچە چۈشەندۈرۈش",contents:"ياردەم مەزمۇنى. بۇ سۆزلەشكۈنى ياپماقچى بولسىڭىز ESC نى بېسىڭ.",legend:[{name:"ئادەتتىكى",items:[{name:"قورال بالداق تەھرىر",legend:"${toolbarFocus} بېسىلسا قورال بالداققا يېتەكلەيدۇ، TAB ياكى SHIFT+TAB ئارقىلىق قورال بالداق گۇرۇپپىسى تاللىنىدۇ، ئوڭ سول يا ئوقتا توپچا تاللىنىدۇ، بوشلۇق ياكى Enter كۇنۇپكىسىدا تاللانغان توپچىنى قوللىنىدۇ."},{name:"تەھرىرلىگۈچ سۆزلەشكۈسى",legend:"سۆزلەشكۈدە TAB كۇنۇپكىسىدا كېيىنكى سۆز بۆلىكىگە يۆتكىلىدۇ، SHIFT+TAB بىرىكمە كۇنۇپكىسىدا ئالدىنقى سۆز بۆلىكىگە يۆتكىلىدۇ، ENTER كۇنۇپكىسىدا سۆزلەشكۈنى تاپشۇرىدۇ، ESC كۇنۇپكىسى سۆزلەشكۈدىن ۋاز كېچىدۇ. كۆپ بەتكۈچلۈك سۆزلەشكۈگە نىسبەتەن، ALT+F10 دا بەتكۈچ تىزىمىغا يۆتكەيدۇ. ئاندىن TAB كۇنۇپكىسى ياكى ئوڭ يا ئوق كۇنۇپكىسى كېيىنكى بەتكۈچكە يۆتكەيدۇ؛SHIFT+ TAB كۇنۇپكىسى ياكى سول يا ئوق كۇنۇپكىسى ئالدىنقى بەتكۈچكە يۆتكەيدۇ. بوشلۇق كۇنۇپكىسى ياكى ENTER كۇنۇپكىسى بەتكۈچنى تاللايدۇ."},
|
||||
{name:"تەھرىرلىگۈچ تىل مۇھىت تىزىملىكى",legend:"${contextMenu} ياكى ئەپ كۇنۇپكىسىدا تىل مۇھىت تىزىملىكىنى ئاچىدۇ. ئاندىن TAB ياكى ئاستى يا ئوق كۇنۇپكىسىدا كېيىنكى تىزىملىك تۈرىگە يۆتكەيدۇ؛ SHIFT+TAB ياكى ئۈستى يا ئوق كۇنۇپكىسىدا ئالدىنقى تىزىملىك تۈرىگە يۆتكەيدۇ. بوشلۇق ياكى ENTER كۇنۇپكىسىدا تىزىملىك تۈرىنى تاللايدۇ. بوشلۇق، ENTER ياكى ئوڭ يا ئوق كۇنۇپكىسىدا تارماق تىزىملىكنى ئاچىدۇ. قايتىش تىزىملىكىگە ESC ياكى سول يا ئوق كۇنۇپكىسى ئىشلىتىلىدۇ. ESC كۇنۇپكىسىدا تىل مۇھىت تىزىملىكى تاقىلىدۇ."},{name:"تەھرىرلىگۈچ تىزىمى",
|
||||
legend:"تىزىم قۇتىسىدا، كېيىنكى تىزىم تۈرىگە يۆتكەشتە TAB ياكى ئاستى يا ئوق كۇنۇپكىسى ئىشلىتىلىدۇ. ئالدىنقى تىزىم تۈرىگە يۆتكەشتە SHIFT+TAB ياكى ئۈستى يا ئوق كۇنۇپكىسى ئىشلىتىلىدۇ. بوشلۇق ياكى ENTER كۇنۇپكىسىدا تىزىم تۈرىنى تاللايدۇ.ESC كۇنۇپكىسىدا تىزىم قۇتىسىنى يىغىدۇ."},{name:"تەھرىرلىگۈچ ئېلېمېنت يول بالداق",legend:"${elementsPathFocus} بېسىلسا ئېلېمېنت يول بالداققا يېتەكلەيدۇ، TAB ياكى ئوڭ يا ئوقتا كېيىنكى ئېلېمېنت تاللىنىدۇ، SHIFT+TAB ياكى سول يا ئوقتا ئالدىنقى ئېلېمېنت تاللىنىدۇ، بوشلۇق ياكى Enter كۇنۇپكىسىدا تەھرىرلىگۈچتىكى ئېلېمېنت تاللىنىدۇ."}]},
|
||||
{name:"بۇيرۇق",items:[{name:"بۇيرۇقتىن يېنىۋال",legend:"${undo} نى بېسىڭ"},{name:"قايتىلاش بۇيرۇقى",legend:"${redo} نى بېسىڭ"},{name:"توملىتىش بۇيرۇقى",legend:"${bold} نى بېسىڭ"},{name:"يانتۇ بۇيرۇقى",legend:"${italic} نى بېسىڭ"},{name:"ئاستى سىزىق بۇيرۇقى",legend:"${underline} نى بېسىڭ"},{name:"ئۇلانما بۇيرۇقى",legend:"${link} نى بېسىڭ"},{name:"قورال بالداق قاتلاش بۇيرۇقى",legend:"${toolbarCollapse} نى بېسىڭ"},{name:"ئالدىنقى فوكۇس نۇقتىسىنى زىيارەت قىلىدىغان بۇيرۇق",legend:"${accessPreviousSpace} بېسىپ ^ بەلگىسىگە ئەڭ يېقىن زىيارەت قىلغىلى بولمايدىغان فوكۇس نۇقتا رايونىنىڭ ئالدىنى زىيارەت قىلىدۇ، مەسىلەن: ئۆز ئارا قوشنا ئىككى HR ئېلېمېنت. بۇ بىرىكمە كۇنۇپكا تەكرارلانسا يىراقتىكى فوكۇس نۇقتا رايونىغا يەتكىلى بولىدۇ."},
|
||||
{name:"كېيىنكى فوكۇس نۇقتىسىنى زىيارەت قىلىدىغان بۇيرۇق",legend:"${accessNextSpace} بېسىپ ^ بەلگىسىگە ئەڭ يېقىن زىيارەت قىلغىلى بولمايدىغان فوكۇس نۇقتا رايونىنىڭ كەينىنى زىيارەت قىلىدۇ، مەسىلەن: ئۆز ئارا قوشنا ئىككى HR ئېلېمېنت. بۇ بىرىكمە كۇنۇپكا تەكرارلانسا يىراقتىكى فوكۇس نۇقتا رايونىغا يەتكىلى بولىدۇ."},{name:"توسالغۇسىز لايىھە چۈشەندۈرۈشى",legend:"${a11yHelp} نى بېسىڭ"}]}],backspace:"Backspace",tab:"Tab",enter:"Enter",shift:"Shift",ctrl:"Ctrl",alt:"Alt",pause:"Pause",capslock:"Caps Lock",escape:"Escape",
|
||||
pageUp:"Page Up",pageDown:"Page Down",end:"End",home:"Home",leftArrow:"Left Arrow",upArrow:"Up Arrow",rightArrow:"Right Arrow",downArrow:"Down Arrow",insert:"Insert","delete":"Delete",leftWindowKey:"Left Windows key",rightWindowKey:"Right Windows key",selectKey:"Select key",numpad0:"Numpad 0",numpad1:"Numpad 1",numpad2:"Numpad 2",numpad3:"Numpad 3",numpad4:"Numpad 4",numpad5:"Numpad 5",numpad6:"Numpad 6",numpad7:"Numpad 7",numpad8:"Numpad 8",numpad9:"Numpad 9",multiply:"Multiply",add:"Add",subtract:"Subtract",
|
||||
decimalPoint:"Decimal Point",divide:"Divide",f1:"F1",f2:"F2",f3:"F3",f4:"F4",f5:"F5",f6:"F6",f7:"F7",f8:"F8",f9:"F9",f10:"F10",f11:"F11",f12:"F12",numLock:"Num Lock",scrollLock:"Scroll Lock",semiColon:"Semicolon",equalSign:"Equal Sign",comma:"Comma",dash:"Dash",period:"Period",forwardSlash:"Forward Slash",graveAccent:"Grave Accent",openBracket:"Open Bracket",backSlash:"Backslash",closeBracket:"Close Bracket",singleQuote:"Single Quote"});
|
||||
pageUp:"Page Up",pageDown:"Page Down",end:"End",home:"Home",leftArrow:"سول يا ئوق",upArrow:"ئۈستى يا ئوق",rightArrow:"ئوڭ يا ئوق",downArrow:"ئاستى يا ئوق",insert:"قىستۇر","delete":"ئۆچۈر",leftWindowKey:"سول Windows كۇنۇپكىسى",rightWindowKey:"ئوڭ Windows كۇنۇپكىسى",selectKey:"تاللاش كۇنۇپكىسى",numpad0:"سان تاختا 0",numpad1:"سان تاختا 1",numpad2:"سان تاختا 2",numpad3:"سان تاختا 3",numpad4:"سان تاختا 4",numpad5:"سان تاختا 5",numpad6:"سان تاختا 6",numpad7:"سان تاختا 7",numpad8:"سان تاختا 8",numpad9:"سان تاختا 9",
|
||||
multiply:"يۇلتۇز كۇنۇپكىسى",add:"قوشۇش",subtract:"ئېلىش",decimalPoint:"كەسىر چېكىت",divide:"بۆلۈش",f1:"F1",f2:"F2",f3:"F3",f4:"F4",f5:"F5",f6:"F6",f7:"F7",f8:"F8",f9:"F9",f10:"F10",f11:"F11",f12:"F12",numLock:"سان قۇلۇپ كۇنۇپكىسى",scrollLock:"سۈرگۈچ قۇلۇپ كۇنۇپكىسى",semiColon:"چېكىتلىك پەش",equalSign:"تەڭلىك بەلگىسى",comma:"پەش",dash:"سىزىقچە",period:"چېكىت",forwardSlash:"سولغا يانتۇ سىزىق",graveAccent:"ئۇرغۇ بەلگىسى",openBracket:"ئېچىلغان تىرناق",backSlash:"ئوڭغا يانتۇ سىزىق",closeBracket:"يېپىلغان تىرناق",
|
||||
singleQuote:"يالاڭ پەش"});
|
|
@ -2,6 +2,6 @@
|
|||
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||
*/
|
||||
CKEDITOR.dialog.add("about",function(a){var a=a.lang.about,b=CKEDITOR.getUrl(CKEDITOR.plugins.get("about").path+"dialogs/"+(CKEDITOR.env.hidpi?"hidpi/":"")+"logo_ckeditor.png");return{title:CKEDITOR.env.ie?a.dlgTitle:a.title,minWidth:390,minHeight:230,contents:[{id:"tab1",label:"",title:"",expand:!0,padding:0,elements:[{type:"html",html:'<style type="text/css">.cke_about_container{color:#000 !important;padding:10px 10px 0;margin-top:5px}.cke_about_container p{margin: 0 0 10px;}.cke_about_container .cke_about_logo{height:81px;background-color:#fff;background-image:url('+
|
||||
b+");"+(CKEDITOR.env.hidpi?"background-size:163px 58px;":"")+'background-position:center; background-repeat:no-repeat;margin-bottom:10px;}.cke_about_container a{cursor:pointer !important;color:#00B2CE !important;text-decoration:underline !important;}</style><div class="cke_about_container"><div class="cke_about_logo"></div><p>CKEditor '+CKEDITOR.version+" (revision "+CKEDITOR.revision+')<br><a target="_blank" href="http://ckeditor.com/">http://ckeditor.com</a></p><p>'+a.help.replace("$1",'<a target="_blank" href="http://docs.ckeditor.com/user">'+
|
||||
a.userGuide+"</a>")+"</p><p>"+a.moreInfo+'<br><a target="_blank" href="http://ckeditor.com/about/license">http://ckeditor.com/about/license</a></p><p>'+a.copy.replace("$1",'<a target="_blank" href="http://cksource.com/">CKSource</a> - Frederico Knabben')+"</p></div>"}]}],buttons:[CKEDITOR.dialog.cancelButton]}});
|
||||
CKEDITOR.dialog.add("about",function(a){a=a.lang.about;var b=CKEDITOR.getUrl(CKEDITOR.plugins.get("about").path+"dialogs/"+(CKEDITOR.env.hidpi?"hidpi/":"")+"logo_ckeditor.png");return{title:CKEDITOR.env.ie?a.dlgTitle:a.title,minWidth:390,minHeight:230,contents:[{id:"tab1",label:"",title:"",expand:!0,padding:0,elements:[{type:"html",html:'\x3cstyle type\x3d"text/css"\x3e.cke_about_container{color:#000 !important;padding:10px 10px 0;margin-top:5px}.cke_about_container p{margin: 0 0 10px;}.cke_about_container .cke_about_logo{height:81px;background-color:#fff;background-image:url('+
|
||||
b+");"+(CKEDITOR.env.hidpi?"background-size:163px 58px;":"")+'background-position:center; background-repeat:no-repeat;margin-bottom:10px;}.cke_about_container a{cursor:pointer !important;color:#00B2CE !important;text-decoration:underline !important;}\x3c/style\x3e\x3cdiv class\x3d"cke_about_container"\x3e\x3cdiv class\x3d"cke_about_logo"\x3e\x3c/div\x3e\x3cp\x3eCKEditor '+CKEDITOR.version+" (revision "+CKEDITOR.revision+')\x3cbr\x3e\x3ca target\x3d"_blank" href\x3d"http://ckeditor.com/"\x3ehttp://ckeditor.com\x3c/a\x3e\x3c/p\x3e\x3cp\x3e'+
|
||||
a.help.replace("$1",'\x3ca target\x3d"_blank" href\x3d"http://docs.ckeditor.com/user"\x3e'+a.userGuide+"\x3c/a\x3e")+"\x3c/p\x3e\x3cp\x3e"+a.moreInfo+'\x3cbr\x3e\x3ca target\x3d"_blank" href\x3d"http://ckeditor.com/about/license"\x3ehttp://ckeditor.com/about/license\x3c/a\x3e\x3c/p\x3e\x3cp\x3e'+a.copy.replace("$1",'\x3ca target\x3d"_blank" href\x3d"http://cksource.com/"\x3eCKSource\x3c/a\x3e - Frederico Knabben')+"\x3c/p\x3e\x3c/div\x3e"}]}],buttons:[CKEDITOR.dialog.cancelButton]}});
|
|
@ -2,10 +2,10 @@
|
|||
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||
*/
|
||||
CKEDITOR.dialog.add("paste",function(c){function h(a){var b=new CKEDITOR.dom.document(a.document),f=b.getBody(),d=b.getById("cke_actscrpt");d&&d.remove();f.setAttribute("contenteditable",!0);if(CKEDITOR.env.ie&&8>CKEDITOR.env.version)b.getWindow().on("blur",function(){b.$.selection.empty()});b.on("keydown",function(a){var a=a.data,b;switch(a.getKeystroke()){case 27:this.hide();b=1;break;case 9:case CKEDITOR.SHIFT+9:this.changeFocus(1),b=1}b&&a.preventDefault()},this);c.fire("ariaWidget",new CKEDITOR.dom.element(a.frameElement));
|
||||
CKEDITOR.dialog.add("paste",function(c){function h(a){var b=new CKEDITOR.dom.document(a.document),f=b.getBody(),d=b.getById("cke_actscrpt");d&&d.remove();f.setAttribute("contenteditable",!0);if(CKEDITOR.env.ie&&8>CKEDITOR.env.version)b.getWindow().on("blur",function(){b.$.selection.empty()});b.on("keydown",function(a){a=a.data;var b;switch(a.getKeystroke()){case 27:this.hide();b=1;break;case 9:case CKEDITOR.SHIFT+9:this.changeFocus(1),b=1}b&&a.preventDefault()},this);c.fire("ariaWidget",new CKEDITOR.dom.element(a.frameElement));
|
||||
b.getWindow().getFrame().removeCustomData("pendingFocus")&&f.focus()}var e=c.lang.clipboard;c.on("pasteDialogCommit",function(a){a.data&&c.fire("paste",{type:"auto",dataValue:a.data,method:"paste",dataTransfer:CKEDITOR.plugins.clipboard.initPasteDataTransfer()})},null,null,1E3);return{title:e.title,minWidth:CKEDITOR.env.ie&&CKEDITOR.env.quirks?370:350,minHeight:CKEDITOR.env.quirks?250:245,onShow:function(){this.parts.dialog.$.offsetHeight;this.setupContent();this.parts.title.setHtml(this.customTitle||
|
||||
e.title);this.customTitle=null},onLoad:function(){(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)&&"rtl"==c.lang.dir&&this.parts.contents.setStyle("overflow","hidden")},onOk:function(){this.commitContent()},contents:[{id:"general",label:c.lang.common.generalTab,elements:[{type:"html",id:"securityMsg",html:'<div style="white-space:normal;width:340px">'+e.securityMsg+"</div>"},{type:"html",id:"pasteMsg",html:'<div style="white-space:normal;width:340px">'+e.pasteMsg+"</div>"},{type:"html",id:"editing_area",
|
||||
style:"width:100%;height:100%",html:"",focus:function(){var a=this.getInputElement(),b=a.getFrameDocument().getBody();!b||b.isReadOnly()?a.setCustomData("pendingFocus",1):b.focus()},setup:function(){var a=this.getDialog(),b='<html dir="'+c.config.contentsLangDirection+'" lang="'+(c.config.contentsLanguage||c.langCode)+'"><head><style>body{margin:3px;height:95%;word-break:break-all;}</style></head><body><script id="cke_actscrpt" type="text/javascript">window.parent.CKEDITOR.tools.callFunction('+CKEDITOR.tools.addFunction(h,
|
||||
a)+",this);<\/script></body></html>",f=CKEDITOR.env.air?"javascript:void(0)":CKEDITOR.env.ie&&!CKEDITOR.env.edge?"javascript:void((function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+'})())"':"",d=CKEDITOR.dom.element.createFromHtml('<iframe class="cke_pasteframe" frameborder="0" allowTransparency="true" src="'+f+'" aria-label="'+e.pasteArea+'" aria-describedby="'+a.getContentElement("general","pasteMsg").domId+'"></iframe>');d.on("load",function(a){a.removeListener();
|
||||
a=d.getFrameDocument();a.write(b);c.focusManager.add(a.getBody());CKEDITOR.env.air&&h.call(this,a.getWindow().$)},a);d.setCustomData("dialog",a);a=this.getElement();a.setHtml("");a.append(d);if(CKEDITOR.env.ie&&!CKEDITOR.env.edge){var g=CKEDITOR.dom.element.createFromHtml('<span tabindex="-1" style="position:absolute" role="presentation"></span>');g.on("focus",function(){setTimeout(function(){d.$.contentWindow.focus()})});a.append(g);this.focus=function(){g.focus();this.fire("focus")}}this.getInputElement=
|
||||
function(){return d};CKEDITOR.env.ie&&(a.setStyle("display","block"),a.setStyle("height",d.$.offsetHeight+2+"px"))},commit:function(){var a=this.getDialog().getParentEditor(),b=this.getInputElement().getFrameDocument().getBody(),c=b.getBogus(),d;c&&c.remove();d=b.getHtml();setTimeout(function(){a.fire("pasteDialogCommit",d)},0)}}]}]}});
|
||||
e.title);this.customTitle=null},onLoad:function(){(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)&&"rtl"==c.lang.dir&&this.parts.contents.setStyle("overflow","hidden")},onOk:function(){this.commitContent()},contents:[{id:"general",label:c.lang.common.generalTab,elements:[{type:"html",id:"securityMsg",html:'\x3cdiv style\x3d"white-space:normal;width:340px"\x3e'+e.securityMsg+"\x3c/div\x3e"},{type:"html",id:"pasteMsg",html:'\x3cdiv style\x3d"white-space:normal;width:340px"\x3e'+e.pasteMsg+"\x3c/div\x3e"},
|
||||
{type:"html",id:"editing_area",style:"width:100%;height:100%",html:"",focus:function(){var a=this.getInputElement(),b=a.getFrameDocument().getBody();!b||b.isReadOnly()?a.setCustomData("pendingFocus",1):b.focus()},setup:function(){var a=this.getDialog(),b='\x3chtml dir\x3d"'+c.config.contentsLangDirection+'" lang\x3d"'+(c.config.contentsLanguage||c.langCode)+'"\x3e\x3chead\x3e\x3cstyle\x3ebody{margin:3px;height:95%;word-break:break-all;}\x3c/style\x3e\x3c/head\x3e\x3cbody\x3e\x3cscript id\x3d"cke_actscrpt" type\x3d"text/javascript"\x3ewindow.parent.CKEDITOR.tools.callFunction('+
|
||||
CKEDITOR.tools.addFunction(h,a)+",this);\x3c/script\x3e\x3c/body\x3e\x3c/html\x3e",f=CKEDITOR.env.air?"javascript:void(0)":CKEDITOR.env.ie&&!CKEDITOR.env.edge?"javascript:void((function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+'})())"':"",d=CKEDITOR.dom.element.createFromHtml('\x3ciframe class\x3d"cke_pasteframe" frameborder\x3d"0" allowTransparency\x3d"true" src\x3d"'+f+'" aria-label\x3d"'+e.pasteArea+'" aria-describedby\x3d"'+a.getContentElement("general",
|
||||
"pasteMsg").domId+'"\x3e\x3c/iframe\x3e');d.on("load",function(a){a.removeListener();a=d.getFrameDocument();a.write(b);c.focusManager.add(a.getBody());CKEDITOR.env.air&&h.call(this,a.getWindow().$)},a);d.setCustomData("dialog",a);a=this.getElement();a.setHtml("");a.append(d);if(CKEDITOR.env.ie&&!CKEDITOR.env.edge){var g=CKEDITOR.dom.element.createFromHtml('\x3cspan tabindex\x3d"-1" style\x3d"position:absolute" role\x3d"presentation"\x3e\x3c/span\x3e');g.on("focus",function(){setTimeout(function(){d.$.contentWindow.focus()})});
|
||||
a.append(g);this.focus=function(){g.focus();this.fire("focus")}}this.getInputElement=function(){return d};CKEDITOR.env.ie&&(a.setStyle("display","block"),a.setStyle("height",d.$.offsetHeight+2+"px"))},commit:function(){var a=this.getDialog().getParentEditor(),b=this.getInputElement().getFrameDocument().getBody(),c=b.getBogus(),d;c&&c.remove();d=b.getHtml();setTimeout(function(){a.fire("pasteDialogCommit",d)},0)}}]}]}});
|
|
@ -2,13 +2,13 @@
|
|||
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||
*/
|
||||
CKEDITOR.dialog.add("image2",function(i){function z(){var a=this.getValue().match(A);(a=!!(a&&0!==parseInt(a[1],10)))||alert(c["invalid"+CKEDITOR.tools.capitalize(this.id)]);return a}function K(){function a(a,b){d.push(j.once(a,function(a){for(var j;j=d.pop();)j.removeListener();b(a)}))}var j=p.createElement("img"),d=[];return function(d,b,c){a("load",function(){var a=B(j);b.call(c,j,a.width,a.height)});a("error",function(){b(null)});a("abort",function(){b(null)});j.setAttribute("src",(t.baseHref||
|
||||
"")+d+"?"+Math.random().toString(16).substring(2))}}function C(){var a=this.getValue();q(!1);a!==u.data.src?(D(a,function(a,d,b){q(!0);if(!a)return k(!1);g.setValue(!1===i.config.image2_prefillDimensions?0:d);h.setValue(!1===i.config.image2_prefillDimensions?0:b);r=d;s=b;k(E.checkHasNaturalRatio(a))}),l=!0):l?(q(!0),g.setValue(m),h.setValue(n),l=!1):q(!0)}function F(){if(e){var a=this.getValue();if(a&&(a.match(A)||k(!1),"0"!==a)){var b="width"==this.id,d=m||r,c=n||s,a=b?Math.round(c*(a/d)):Math.round(d*
|
||||
(a/c));isNaN(a)||(b?h:g).setValue(a)}}}function k(a){if(f){if("boolean"==typeof a){if(v)return;e=a}else if(a=g.getValue(),v=!0,(e=!e)&&a)a*=n/m,isNaN(a)||h.setValue(Math.round(a));f[e?"removeClass":"addClass"]("cke_btn_unlocked");f.setAttribute("aria-checked",e);CKEDITOR.env.hc&&f.getChild(0).setHtml(e?CKEDITOR.env.ie?"■":"▣":CKEDITOR.env.ie?"□":"▢")}}function q(a){a=a?"enable":"disable";g[a]();h[a]()}var A=/(^\s*(\d+)(px)?\s*$)|^$/i,G=CKEDITOR.tools.getNextId(),H=CKEDITOR.tools.getNextId(),b=i.lang.image2,
|
||||
c=i.lang.common,L=(new CKEDITOR.template('<div><a href="javascript:void(0)" tabindex="-1" title="'+b.lockRatio+'" class="cke_btn_locked" id="{lockButtonId}" role="checkbox"><span class="cke_icon"></span><span class="cke_label">'+b.lockRatio+'</span></a><a href="javascript:void(0)" tabindex="-1" title="'+b.resetSize+'" class="cke_btn_reset" id="{resetButtonId}" role="button"><span class="cke_label">'+b.resetSize+"</span></a></div>")).output({lockButtonId:G,resetButtonId:H}),E=CKEDITOR.plugins.image2,
|
||||
t=i.config,w=i.widgets.registered.image.features,B=E.getNatural,p,u,I,D,m,n,r,s,l,e,v,f,o,g,h,x,y=!(!t.filebrowserImageBrowseUrl&&!t.filebrowserBrowseUrl),J=[{id:"src",type:"text",label:c.url,onKeyup:C,onChange:C,setup:function(a){this.setValue(a.data.src)},commit:function(a){a.setData("src",this.getValue())},validate:CKEDITOR.dialog.validate.notEmpty(b.urlMissing)}];y&&J.push({type:"button",id:"browse",style:"display:inline-block;margin-top:14px;",align:"center",label:i.lang.common.browseServer,
|
||||
hidden:!0,filebrowser:"info:src"});return{title:b.title,minWidth:250,minHeight:100,onLoad:function(){p=this._.element.getDocument();D=K()},onShow:function(){u=this.widget;I=u.parts.image;l=v=e=!1;x=B(I);r=m=x.width;s=n=x.height},contents:[{id:"info",label:b.infoTab,elements:[{type:"vbox",padding:0,children:[{type:"hbox",widths:["100%"],children:J}]},{id:"alt",type:"text",label:b.alt,setup:function(a){this.setValue(a.data.alt)},commit:function(a){a.setData("alt",this.getValue())}},{type:"hbox",widths:["25%",
|
||||
"25%","50%"],requiredContent:w.dimension.requiredContent,children:[{type:"text",width:"45px",id:"width",label:c.width,validate:z,onKeyUp:F,onLoad:function(){g=this},setup:function(a){this.setValue(a.data.width)},commit:function(a){a.setData("width",this.getValue())}},{type:"text",id:"height",width:"45px",label:c.height,validate:z,onKeyUp:F,onLoad:function(){h=this},setup:function(a){this.setValue(a.data.height)},commit:function(a){a.setData("height",this.getValue())}},{id:"lock",type:"html",style:"margin-top:18px;width:40px;height:20px;",
|
||||
onLoad:function(){function a(a){a.on("mouseover",function(){this.addClass("cke_btn_over")},a);a.on("mouseout",function(){this.removeClass("cke_btn_over")},a)}var b=this.getDialog();f=p.getById(G);o=p.getById(H);f&&(b.addFocusable(f,4+y),f.on("click",function(a){k();a.data&&a.data.preventDefault()},this.getDialog()),a(f));o&&(b.addFocusable(o,5+y),o.on("click",function(a){if(l){g.setValue(r);h.setValue(s)}else{g.setValue(m);h.setValue(n)}a.data&&a.data.preventDefault()},this),a(o))},setup:function(a){k(a.data.lock)},
|
||||
commit:function(a){a.setData("lock",e)},html:L}]},{type:"hbox",id:"alignment",requiredContent:w.align.requiredContent,children:[{id:"align",type:"radio",items:[[c.alignNone,"none"],[c.alignLeft,"left"],[c.alignCenter,"center"],[c.alignRight,"right"]],label:c.align,setup:function(a){this.setValue(a.data.align)},commit:function(a){a.setData("align",this.getValue())}}]},{id:"hasCaption",type:"checkbox",label:b.captioned,requiredContent:w.caption.requiredContent,setup:function(a){this.setValue(a.data.hasCaption)},
|
||||
commit:function(a){a.setData("hasCaption",this.getValue())}}]},{id:"Upload",hidden:!0,filebrowser:"uploadButton",label:b.uploadTab,elements:[{type:"file",id:"upload",label:b.btnUpload,style:"height:40px"},{type:"fileButton",id:"uploadButton",filebrowser:"info:src",label:b.btnUpload,"for":["Upload","upload"]}]}]}});
|
||||
CKEDITOR.dialog.add("image2",function(k){function D(){var a=this.getValue().match(E);(a=!(!a||0===parseInt(a[1],10)))||alert(c["invalid"+CKEDITOR.tools.capitalize(this.id)]);return a}function O(){function a(a,b){d.push(l.once(a,function(a){for(var l;l=d.pop();)l.removeListener();b(a)}))}var l=t.createElement("img"),d=[];return function(d,b,c){a("load",function(){var a=F(l);b.call(c,l,a.width,a.height)});a("error",function(){b(null)});a("abort",function(){b(null)});l.setAttribute("src",(x.baseHref||
|
||||
"")+d+"?"+Math.random().toString(16).substring(2))}}function G(){var a=this.getValue();u(!1);a!==y.data.src?(H(a,function(a,d,b){u(!0);if(!a)return m(!1);g.setValue(!1===k.config.image2_prefillDimensions?0:d);h.setValue(!1===k.config.image2_prefillDimensions?0:b);v=d;w=b;m(I.checkHasNaturalRatio(a))}),n=!0):n?(u(!0),g.setValue(p),h.setValue(q),n=!1):u(!0)}function J(){if(e){var a=this.getValue();if(a&&(a.match(E)||m(!1),"0"!==a)){var b="width"==this.id,d=p||v,c=q||w,a=b?Math.round(a/d*c):Math.round(a/
|
||||
c*d);isNaN(a)||(b?h:g).setValue(a)}}}function m(a){if(f){if("boolean"==typeof a){if(z)return;e=a}else a=g.getValue(),z=!0,(e=!e)&&a&&(a*=q/p,isNaN(a)||h.setValue(Math.round(a)));f[e?"removeClass":"addClass"]("cke_btn_unlocked");f.setAttribute("aria-checked",e);CKEDITOR.env.hc&&f.getChild(0).setHtml(e?CKEDITOR.env.ie?"■":"▣":CKEDITOR.env.ie?"□":"▢")}}function u(a){a=a?"enable":"disable";g[a]();h[a]()}var E=/(^\s*(\d+)(px)?\s*$)|^$/i,K=CKEDITOR.tools.getNextId(),L=CKEDITOR.tools.getNextId(),b=k.lang.image2,
|
||||
c=k.lang.common,P=(new CKEDITOR.template('\x3cdiv\x3e\x3ca href\x3d"javascript:void(0)" tabindex\x3d"-1" title\x3d"'+b.lockRatio+'" class\x3d"cke_btn_locked" id\x3d"{lockButtonId}" role\x3d"checkbox"\x3e\x3cspan class\x3d"cke_icon"\x3e\x3c/span\x3e\x3cspan class\x3d"cke_label"\x3e'+b.lockRatio+'\x3c/span\x3e\x3c/a\x3e\x3ca href\x3d"javascript:void(0)" tabindex\x3d"-1" title\x3d"'+b.resetSize+'" class\x3d"cke_btn_reset" id\x3d"{resetButtonId}" role\x3d"button"\x3e\x3cspan class\x3d"cke_label"\x3e'+
|
||||
b.resetSize+"\x3c/span\x3e\x3c/a\x3e\x3c/div\x3e")).output({lockButtonId:K,resetButtonId:L}),I=CKEDITOR.plugins.image2,x=k.config,A=k.widgets.registered.image.features,F=I.getNatural,t,y,M,H,p,q,v,w,n,e,z,f,r,g,h,B,C=!(!x.filebrowserImageBrowseUrl&&!x.filebrowserBrowseUrl),N=[{id:"src",type:"text",label:c.url,onKeyup:G,onChange:G,setup:function(a){this.setValue(a.data.src)},commit:function(a){a.setData("src",this.getValue())},validate:CKEDITOR.dialog.validate.notEmpty(b.urlMissing)}];C&&N.push({type:"button",
|
||||
id:"browse",style:"display:inline-block;margin-top:14px;",align:"center",label:k.lang.common.browseServer,hidden:!0,filebrowser:"info:src"});return{title:b.title,minWidth:250,minHeight:100,onLoad:function(){t=this._.element.getDocument();H=O()},onShow:function(){y=this.widget;M=y.parts.image;n=z=e=!1;B=F(M);v=p=B.width;w=q=B.height},contents:[{id:"info",label:b.infoTab,elements:[{type:"vbox",padding:0,children:[{type:"hbox",widths:["100%"],children:N}]},{id:"alt",type:"text",label:b.alt,setup:function(a){this.setValue(a.data.alt)},
|
||||
commit:function(a){a.setData("alt",this.getValue())}},{type:"hbox",widths:["25%","25%","50%"],requiredContent:A.dimension.requiredContent,children:[{type:"text",width:"45px",id:"width",label:c.width,validate:D,onKeyUp:J,onLoad:function(){g=this},setup:function(a){this.setValue(a.data.width)},commit:function(a){a.setData("width",this.getValue())}},{type:"text",id:"height",width:"45px",label:c.height,validate:D,onKeyUp:J,onLoad:function(){h=this},setup:function(a){this.setValue(a.data.height)},commit:function(a){a.setData("height",
|
||||
this.getValue())}},{id:"lock",type:"html",style:"margin-top:18px;width:40px;height:20px;",onLoad:function(){function a(a){a.on("mouseover",function(){this.addClass("cke_btn_over")},a);a.on("mouseout",function(){this.removeClass("cke_btn_over")},a)}var b=this.getDialog();f=t.getById(K);r=t.getById(L);f&&(b.addFocusable(f,4+C),f.on("click",function(a){m();a.data&&a.data.preventDefault()},this.getDialog()),a(f));r&&(b.addFocusable(r,5+C),r.on("click",function(a){n?(g.setValue(v),h.setValue(w)):(g.setValue(p),
|
||||
h.setValue(q));a.data&&a.data.preventDefault()},this),a(r))},setup:function(a){m(a.data.lock)},commit:function(a){a.setData("lock",e)},html:P}]},{type:"hbox",id:"alignment",requiredContent:A.align.requiredContent,children:[{id:"align",type:"radio",items:[[c.alignNone,"none"],[c.alignLeft,"left"],[c.alignCenter,"center"],[c.alignRight,"right"]],label:c.align,setup:function(a){this.setValue(a.data.align)},commit:function(a){a.setData("align",this.getValue())}}]},{id:"hasCaption",type:"checkbox",label:b.captioned,
|
||||
requiredContent:A.caption.requiredContent,setup:function(a){this.setValue(a.data.hasCaption)},commit:function(a){a.setData("hasCaption",this.getValue())}}]},{id:"Upload",hidden:!0,filebrowser:"uploadButton",label:b.uploadTab,elements:[{type:"file",id:"upload",label:b.btnUpload,style:"height:40px"},{type:"fileButton",id:"uploadButton",filebrowser:"info:src",label:b.btnUpload,"for":["Upload","upload"]}]}]}});
|
|
@ -2,31 +2,31 @@
|
|||
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||
*/
|
||||
(function(){function y(a){for(var a=a.toUpperCase(),c=z.length,b=0,f=0;f<c;++f)for(var d=z[f],e=d[1].length;a.substr(0,e)==d[1];a=a.substr(e))b+=d[0];return b}function A(a){for(var a=a.toUpperCase(),c=B.length,b=1,f=1;0<a.length;f*=c)b+=B.indexOf(a.charAt(a.length-1))*f,a=a.substr(0,a.length-1);return b}var C=CKEDITOR.htmlParser.fragment.prototype,o=CKEDITOR.htmlParser.element.prototype;C.onlyChild=o.onlyChild=function(){var a=this.children;return 1==a.length&&a[0]||null};o.removeAnyChildWithName=
|
||||
function(a){for(var c=this.children,b=[],f,d=0;d<c.length;d++)f=c[d],f.name&&(f.name==a&&(b.push(f),c.splice(d--,1)),b=b.concat(f.removeAnyChildWithName(a)));return b};o.getAncestor=function(a){for(var c=this.parent;c&&(!c.name||!c.name.match(a));)c=c.parent;return c};C.firstChild=o.firstChild=function(a){for(var c,b=0;b<this.children.length;b++)if(c=this.children[b],a(c)||c.name&&(c=c.firstChild(a)))return c;return null};o.addStyle=function(a,c,b){var f="";if("string"==typeof c)f+=a+":"+c+";";else{if("object"==
|
||||
typeof a)for(var d in a)a.hasOwnProperty(d)&&(f+=d+":"+a[d]+";");else f+=a;b=c}this.attributes||(this.attributes={});a=this.attributes.style||"";a=(b?[f,a]:[a,f]).join(";");this.attributes.style=a.replace(/^;+|;(?=;)/g,"")};o.getStyle=function(a){var c=this.attributes.style;if(c)return c=CKEDITOR.tools.parseCssText(c,1),c[a]};CKEDITOR.dtd.parentOf=function(a){var c={},b;for(b in this)-1==b.indexOf("$")&&this[b][a]&&(c[b]=1);return c};var D=/^(?:\b0[^\s]*\s*){1,4}$/,x={ol:{decimal:/\d+/,"lower-roman":/^m{0,4}(cm|cd|d?c{0,3})(xc|xl|l?x{0,3})(ix|iv|v?i{0,3})$/,
|
||||
"upper-roman":/^M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$/,"lower-alpha":/^[a-z]+$/,"upper-alpha":/^[A-Z]+$/},ul:{disc:/[l\u00B7\u2002]/,circle:/[\u006F\u00D8]/,square:/[\u006E\u25C6]/}},z=[[1E3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]],B="ABCDEFGHIJKLMNOPQRSTUVWXYZ",s=0,t=null,w,E=CKEDITOR.plugins.pastefromword={utils:{createListBulletMarker:function(a,c){var b=new CKEDITOR.htmlParser.element("cke:listbullet");
|
||||
b.attributes={"cke:listsymbol":a[0]};b.add(new CKEDITOR.htmlParser.text(c));return b},isListBulletIndicator:function(a){if(/mso-list\s*:\s*Ignore/i.test(a.attributes&&a.attributes.style))return!0},isContainingOnlySpaces:function(a){var c;return(c=a.onlyChild())&&/^(:?\s| )+$/.test(c.value)},resolveList:function(a){var c=a.attributes,b;if((b=a.removeAnyChildWithName("cke:listbullet"))&&b.length&&(b=b[0]))return a.name="cke:li",c.style&&(c.style=E.filters.stylesFilter([["text-indent"],["line-height"],
|
||||
[/^margin(:?-left)?$/,null,function(a){a=a.split(" ");a=CKEDITOR.tools.convertToPx(a[3]||a[1]||a[0]);!s&&(null!==t&&a>t)&&(s=a-t);t=a;c["cke:indent"]=s&&Math.ceil(a/s)+1||1}],[/^mso-list$/,null,function(a){a=a.split(" ");if(!(2>a.length)){var b=Number(a[0].match(/\d+/)),a=Number(a[1].match(/\d+/));1==a&&(b!==w&&(c["cke:reset"]=1),w=b);c["cke:indent"]=a}}]])(c.style,a)||""),c["cke:indent"]||(t=0,c["cke:indent"]=1),CKEDITOR.tools.extend(c,b.attributes),!0;w=t=s=null;return!1},getStyleComponents:function(){var a=
|
||||
CKEDITOR.dom.element.createFromHtml('<div style="position:absolute;left:-9999px;top:-9999px;"></div>',CKEDITOR.document);CKEDITOR.document.getBody().append(a);return function(c,b,f){a.setStyle(c,b);for(var c={},b=f.length,d=0;d<b;d++)c[f[d]]=a.getStyle(f[d]);return c}}(),listDtdParents:CKEDITOR.dtd.parentOf("ol")},filters:{flattenList:function(a,c){var c="number"==typeof c?c:1,b=a.attributes,f;switch(b.type){case "a":f="lower-alpha";break;case "1":f="decimal"}for(var d=a.children,e,i=0;i<d.length;i++)if(e=
|
||||
d[i],e.name in CKEDITOR.dtd.$listItem){var j=e.attributes,g=e.children,l=g[0],h=g[g.length-1];l.attributes&&(l.attributes.style&&-1<l.attributes.style.indexOf("mso-list"))&&(e.attributes.style=l.attributes.style,l.replaceWithChildren());h.name in CKEDITOR.dtd.$list&&(a.add(h,i+1),--g.length||d.splice(i--,1));e.name="cke:li";b.start&&!i&&(j.value=b.start);E.filters.stylesFilter([["tab-stops",null,function(a){(a=a.match(/0$|\d+\.?\d*\w+/))&&(t=CKEDITOR.tools.convertToPx(a[0]))}],1==c?["mso-list",null,
|
||||
function(a){a=a.split(" ");a=Number(a[0].match(/\d+/));a!==w&&(j["cke:reset"]=1);w=a}]:null])(j.style);j["cke:indent"]=c;j["cke:listtype"]=a.name;j["cke:list-style-type"]=f}else if(e.name in CKEDITOR.dtd.$list){arguments.callee.apply(this,[e,c+1]);d=d.slice(0,i).concat(e.children).concat(d.slice(i+1));a.children=[];e=0;for(g=d.length;e<g;e++)a.add(d[e]);d=a.children}delete a.name;b["cke:list"]=1},assembleList:function(a){for(var c=a.children,b,f,d,e,i,j,a=[],g,l,h,m,k,p,n=0;n<c.length;n++)if(b=c[n],
|
||||
"cke:li"==b.name)if(b.name="li",f=b.attributes,h=(h=f["cke:listsymbol"])&&h.match(/^(?:[(]?)([^\s]+?)([.)]?)$/),m=k=p=null,f["cke:ignored"])c.splice(n--,1);else{f["cke:reset"]&&(j=e=i=null);d=Number(f["cke:indent"]);d!=e&&(l=g=null);if(h){if(l&&x[l][g].test(h[1]))m=l,k=g;else for(var q in x)for(var u in x[q])if(x[q][u].test(h[1]))if("ol"==q&&/alpha|roman/.test(u)){if(g=/roman/.test(u)?y(h[1]):A(h[1]),!p||g<p)p=g,m=q,k=u}else{m=q;k=u;break}!m&&(m=h[2]?"ol":"ul")}else m=f["cke:listtype"]||"ol",k=f["cke:list-style-type"];
|
||||
l=m;g=k||("ol"==m?"decimal":"disc");k&&k!=("ol"==m?"decimal":"disc")&&b.addStyle("list-style-type",k);if("ol"==m&&h){switch(k){case "decimal":p=Number(h[1]);break;case "lower-roman":case "upper-roman":p=y(h[1]);break;case "lower-alpha":case "upper-alpha":p=A(h[1])}b.attributes.value=p}if(j){if(d>e)a.push(j=new CKEDITOR.htmlParser.element(m)),j.add(b),i.add(j);else{if(d<e){e-=d;for(var r;e--&&(r=j.parent);)j=r.parent}j.add(b)}c.splice(n--,1)}else a.push(j=new CKEDITOR.htmlParser.element(m)),j.add(b),
|
||||
c[n]=j;i=b;e=d}else j&&(j=e=i=null);for(n=0;n<a.length;n++)if(j=a[n],q=j.children,g=g=void 0,u=j.children.length,r=g=void 0,c=/list-style-type:(.*?)(?:;|$)/,e=CKEDITOR.plugins.pastefromword.filters.stylesFilter,g=j.attributes,!c.exec(g.style)){for(i=0;i<u;i++)if(g=q[i],g.attributes.value&&Number(g.attributes.value)==i+1&&delete g.attributes.value,g=c.exec(g.attributes.style))if(g[1]==r||!r)r=g[1];else{r=null;break}if(r){for(i=0;i<u;i++)g=q[i].attributes,g.style&&(g.style=e([["list-style-type"]])(g.style)||
|
||||
"");j.addStyle("list-style-type",r)}}w=t=s=null},falsyFilter:function(){return!1},stylesFilter:function(a,c){return function(b,f){var d=[];(b||"").replace(/"/g,'"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(b,e,g){e=e.toLowerCase();"font-family"==e&&(g=g.replace(/["']/g,""));for(var l,h,m,k=0;k<a.length;k++)if(a[k]&&(b=a[k][0],l=a[k][1],h=a[k][2],m=a[k][3],e.match(b)&&(!l||g.match(l)))){e=m||e;c&&(h=h||g);"function"==typeof h&&(h=h(g,f,e));h&&h.push&&(e=h[0],h=h[1]);"string"==
|
||||
typeof h&&d.push([e,h]);return}!c&&d.push([e,g])});for(var e=0;e<d.length;e++)d[e]=d[e].join(":");return d.length?d.join(";")+";":!1}},elementMigrateFilter:function(a,c){return a?function(b){var f=c?(new CKEDITOR.style(a,c))._.definition:a;b.name=f.element;CKEDITOR.tools.extend(b.attributes,CKEDITOR.tools.clone(f.attributes));b.addStyle(CKEDITOR.style.getStyleText(f));f.attributes&&f.attributes["class"]&&(b.classWhiteList=" "+f.attributes["class"]+" ")}:function(){}},styleMigrateFilter:function(a,
|
||||
c){var b=this.elementMigrateFilter;return a?function(f,d){var e=new CKEDITOR.htmlParser.element(null),i={};i[c]=f;b(a,i)(e);e.children=d.children;d.children=[e];e.filter=function(){};e.parent=d}:function(){}},bogusAttrFilter:function(a,c){if(-1==c.name.indexOf("cke:"))return!1},applyStyleFilter:null},getRules:function(a,c){var b=CKEDITOR.dtd,f=CKEDITOR.tools.extend({},b.$block,b.$listItem,b.$tableContent),d=a.config,e=this.filters,i=e.falsyFilter,j=e.stylesFilter,g=e.elementMigrateFilter,l=CKEDITOR.tools.bind(this.filters.styleMigrateFilter,
|
||||
this.filters),h=this.utils.createListBulletMarker,m=e.flattenList,k=e.assembleList,p=this.utils.isListBulletIndicator,n=this.utils.isContainingOnlySpaces,q=this.utils.resolveList,u=function(a){a=CKEDITOR.tools.convertToPx(a);return isNaN(a)?a:a+"px"},r=this.utils.getStyleComponents,t=this.utils.listDtdParents,o=!1!==d.pasteFromWordRemoveFontStyles,s=!1!==d.pasteFromWordRemoveStyles;return{elementNames:[[/meta|link|script/,""]],root:function(a){a.filterChildren(c);k(a)},elements:{"^":function(a){var c;
|
||||
CKEDITOR.env.gecko&&(c=e.applyStyleFilter)&&c(a)},$:function(a){var v=a.name||"",e=a.attributes;v in f&&e.style&&(e.style=j([[/^(:?width|height)$/,null,u]])(e.style)||"");if(v.match(/h\d/)){a.filterChildren(c);if(q(a))return;g(d["format_"+v])(a)}else if(v in b.$inline)a.filterChildren(c),n(a)&&delete a.name;else if(-1!=v.indexOf(":")&&-1==v.indexOf("cke")){a.filterChildren(c);if("v:imagedata"==v){if(v=a.attributes["o:href"])a.attributes.src=v;a.name="img";return}delete a.name}v in t&&(a.filterChildren(c),
|
||||
k(a))},style:function(a){if(CKEDITOR.env.gecko){var a=(a=a.onlyChild().value.match(/\/\* Style Definitions \*\/([\s\S]*?)\/\*/))&&a[1],c={};a&&(a.replace(/[\n\r]/g,"").replace(/(.+?)\{(.+?)\}/g,function(a,b,F){for(var b=b.split(","),a=b.length,d=0;d<a;d++)CKEDITOR.tools.trim(b[d]).replace(/^(\w+)(\.[\w-]+)?$/g,function(a,b,d){b=b||"*";d=d.substring(1,d.length);d.match(/MsoNormal/)||(c[b]||(c[b]={}),d?c[b][d]=F:c[b]=F)})}),e.applyStyleFilter=function(a){var b=c["*"]?"*":a.name,d=a.attributes&&a.attributes["class"];
|
||||
b in c&&(b=c[b],"object"==typeof b&&(b=b[d]),b&&a.addStyle(b,!0))})}return!1},p:function(a){if(/MsoListParagraph/i.exec(a.attributes["class"])||a.getStyle("mso-list")&&!a.getStyle("mso-list").match(/^(none|skip)$/i)){var b=a.firstChild(function(a){return a.type==CKEDITOR.NODE_TEXT&&!n(a.parent)});(b=b&&b.parent)&&b.addStyle("mso-list","Ignore")}a.filterChildren(c);q(a)||(d.enterMode==CKEDITOR.ENTER_BR?(delete a.name,a.add(new CKEDITOR.htmlParser.element("br"))):g(d["format_"+(d.enterMode==CKEDITOR.ENTER_P?
|
||||
"p":"div")])(a))},div:function(a){var c=a.onlyChild();if(c&&"table"==c.name){var b=a.attributes;c.attributes=CKEDITOR.tools.extend(c.attributes,b);b.style&&c.addStyle(b.style);c=new CKEDITOR.htmlParser.element("div");c.addStyle("clear","both");a.add(c);delete a.name}},td:function(a){a.getAncestor("thead")&&(a.name="th")},ol:m,ul:m,dl:m,font:function(a){if(p(a.parent))delete a.name;else{a.filterChildren(c);var b=a.attributes,d=b.style,e=a.parent;"font"==e.name?(CKEDITOR.tools.extend(e.attributes,a.attributes),
|
||||
d&&e.addStyle(d),delete a.name):(d=(d||"").split(";"),b.color&&("#000000"!=b.color&&d.push("color:"+b.color),delete b.color),b.face&&(d.push("font-family:"+b.face),delete b.face),b.size&&(d.push("font-size:"+(3<b.size?"large":3>b.size?"small":"medium")),delete b.size),a.name="span",a.addStyle(d.join(";")))}},span:function(a){if(p(a.parent))return!1;a.filterChildren(c);if(n(a))return delete a.name,null;if(p(a)){var b=a.firstChild(function(a){return a.value||"img"==a.name}),e=(b=b&&(b.value||"l."))&&
|
||||
b.match(/^(?:[(]?)([^\s]+?)([.)]?)$/);if(e)return b=h(e,b),(a=a.getAncestor("span"))&&/ mso-hide:\s*all|display:\s*none /.test(a.attributes.style)&&(b.attributes["cke:ignored"]=1),b}if(e=(b=a.attributes)&&b.style)b.style=j([["line-height"],[/^font-family$/,null,!o?l(d.font_style,"family"):null],[/^font-size$/,null,!o?l(d.fontSize_style,"size"):null],[/^color$/,null,!o?l(d.colorButton_foreStyle,"color"):null],[/^background-color$/,null,!o?l(d.colorButton_backStyle,"color"):null]])(e,a)||"";b.style||
|
||||
delete b.style;CKEDITOR.tools.isEmpty(b)&&delete a.name;return null},b:g(d.coreStyles_bold),i:g(d.coreStyles_italic),u:g(d.coreStyles_underline),s:g(d.coreStyles_strike),sup:g(d.coreStyles_superscript),sub:g(d.coreStyles_subscript),a:function(a){var b=a.attributes;b.name&&b.name.match(/ole_link\d+/i)?delete a.name:b.href&&b.href.match(/^file:\/\/\/[\S]+#/i)&&(b.href=b.href.replace(/^file:\/\/\/[^#]+/i,""))},"cke:listbullet":function(a){a.getAncestor(/h\d/)&&!d.pasteFromWordNumberedHeadingToList&&
|
||||
delete a.name}},attributeNames:[[/^onmouse(:?out|over)/,""],[/^onload$/,""],[/(?:v|o):\w+/,""],[/^lang/,""]],attributes:{style:j(s?[[/^list-style-type$/,null],[/^margin$|^margin-(?!bottom|top)/,null,function(a,b,c){if(b.name in{p:1,div:1}){b="ltr"==d.contentsLangDirection?"margin-left":"margin-right";if("margin"==c)a=r(c,a,[b])[b];else if(c!=b)return null;if(a&&!D.test(a))return[b,a]}return null}],[/^clear$/],[/^border.*|margin.*|vertical-align|float$/,null,function(a,b){if("img"==b.name)return a}],
|
||||
[/^width|height$/,null,function(a,b){if(b.name in{table:1,td:1,th:1,img:1})return a}]]:[[/^mso-/],[/-color$/,null,function(a){if("transparent"==a)return!1;if(CKEDITOR.env.gecko)return a.replace(/-moz-use-text-color/g,"transparent")}],[/^margin$/,D],["text-indent","0cm"],["page-break-before"],["tab-stops"],["display","none"],o?[/font-?/]:null],s),width:function(a,c){if(c.name in b.$tableContent)return!1},border:function(a,c){if(c.name in b.$tableContent)return!1},"class":function(a,b){return b.classWhiteList&&
|
||||
-1!=b.classWhiteList.indexOf(" "+a+" ")?a:!1},bgcolor:i,valign:s?i:function(a,b){b.addStyle("vertical-align",a);return!1}},comment:!CKEDITOR.env.ie?function(a,b){var c=a.match(/<img.*?>/),d=a.match(/^\[if !supportLists\]([\s\S]*?)\[endif\]$/);return d?(d=(c=d[1]||c&&"l.")&&c.match(/>(?:[(]?)([^\s]+?)([.)]?)</),h(d,c)):CKEDITOR.env.gecko&&c?(c=CKEDITOR.htmlParser.fragment.fromHtml(c[0]).children[0],(d=(d=(d=b.previous)&&d.value.match(/<v:imagedata[^>]*o:href=['"](.*?)['"]/))&&d[1])&&(c.attributes.src=
|
||||
d),c):!1}:i}}},G=function(){this.dataFilter=new CKEDITOR.htmlParser.filter};G.prototype={toHtml:function(a){var a=CKEDITOR.htmlParser.fragment.fromHtml(a),c=new CKEDITOR.htmlParser.basicWriter;a.writeHtml(c,this.dataFilter);return c.getHtml(!0)}};CKEDITOR.cleanWord=function(a,c){a=a.replace(/<!\[([^\]]*?)\]>/g,"<\!--[$1]--\>");CKEDITOR.env.gecko&&(a=a.replace(/(<\!--\[if[^<]*?\])--\>([\S\s]*?)<\!--(\[endif\]--\>)/gi,"$1$2$3"));CKEDITOR.env.webkit&&(a=a.replace(/(class="MsoListParagraph[^>]+><\!--\[if !supportLists\]--\>)([^<]+<span[^<]+<\/span>)(<\!--\[endif\]--\>)/gi,
|
||||
"$1<span>$2</span>$3"));var b=new G,f=b.dataFilter;f.addRules(CKEDITOR.plugins.pastefromword.getRules(c,f));c.fire("beforeCleanWord",{filter:f});try{a=b.toHtml(a)}catch(d){c.showNotification(c.lang.pastefromword.error)}a=a.replace(/cke:.*?".*?"/g,"");a=a.replace(/style=""/g,"");return a=a.replace(/<span>/g,"")}})();
|
||||
(function(){function C(a){a=a.toUpperCase();for(var c=D.length,b=0,f=0;f<c;++f)for(var d=D[f],e=d[1].length;a.substr(0,e)==d[1];a=a.substr(e))b+=d[0];return b}function E(a){a=a.toUpperCase();for(var c=1,b=1;0<a.length;b*=26)c+="ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(a.charAt(a.length-1))*b,a=a.substr(0,a.length-1);return c}var F=CKEDITOR.htmlParser.fragment.prototype,r=CKEDITOR.htmlParser.element.prototype;F.onlyChild=r.onlyChild=function(){var a=this.children;return 1==a.length&&a[0]||null};r.removeAnyChildWithName=
|
||||
function(a){for(var c=this.children,b=[],f,d=0;d<c.length;d++)f=c[d],f.name&&(f.name==a&&(b.push(f),c.splice(d--,1)),b=b.concat(f.removeAnyChildWithName(a)));return b};r.getAncestor=function(a){for(var c=this.parent;c&&(!c.name||!c.name.match(a));)c=c.parent;return c};F.firstChild=r.firstChild=function(a){for(var c,b=0;b<this.children.length;b++)if(c=this.children[b],a(c)||c.name&&(c=c.firstChild(a)))return c;return null};r.addStyle=function(a,c,b){var f="";if("string"==typeof c)f+=a+":"+c+";";else{if("object"==
|
||||
typeof a)for(var d in a)a.hasOwnProperty(d)&&(f+=d+":"+a[d]+";");else f+=a;b=c}this.attributes||(this.attributes={});a=this.attributes.style||"";a=(b?[f,a]:[a,f]).join(";");this.attributes.style=a.replace(/^;+|;(?=;)/g,"")};r.getStyle=function(a){var c=this.attributes.style;if(c)return c=CKEDITOR.tools.parseCssText(c,1),c[a]};CKEDITOR.dtd.parentOf=function(a){var c={},b;for(b in this)-1==b.indexOf("$")&&this[b][a]&&(c[b]=1);return c};var G=/^(?:\b0[^\s]*\s*){1,4}$/,B={ol:{decimal:/\d+/,"lower-roman":/^m{0,4}(cm|cd|d?c{0,3})(xc|xl|l?x{0,3})(ix|iv|v?i{0,3})$/,
|
||||
"upper-roman":/^M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$/,"lower-alpha":/^[a-z]+$/,"upper-alpha":/^[A-Z]+$/},ul:{disc:/[l\u00B7\u2002]/,circle:/[\u006F\u00D8]/,square:/[\u006E\u25C6]/}},D=[[1E3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]],w=0,x=null,A,H=CKEDITOR.plugins.pastefromword={utils:{createListBulletMarker:function(a,c){var b=new CKEDITOR.htmlParser.element("cke:listbullet");b.attributes={"cke:listsymbol":a[0]};
|
||||
b.add(new CKEDITOR.htmlParser.text(c));return b},isListBulletIndicator:function(a){if(/mso-list\s*:\s*Ignore/i.test(a.attributes&&a.attributes.style))return!0},isContainingOnlySpaces:function(a){var c;return(c=a.onlyChild())&&/^(:?\s| )+$/.test(c.value)},resolveList:function(a){var c=a.attributes,b;if((b=a.removeAnyChildWithName("cke:listbullet"))&&b.length&&(b=b[0]))return a.name="cke:li",c.style&&(c.style=H.filters.stylesFilter([["text-indent"],["line-height"],[/^margin(:?-left)?$/,null,function(a){a=
|
||||
a.split(" ");a=CKEDITOR.tools.convertToPx(a[3]||a[1]||a[0]);!w&&null!==x&&a>x&&(w=a-x);x=a;c["cke:indent"]=w&&Math.ceil(a/w)+1||1}],[/^mso-list$/,null,function(a){a=a.split(" ");if(!(2>a.length)){var b=Number(a[0].match(/\d+/));a=Number(a[1].match(/\d+/));1==a&&(b!==A&&(c["cke:reset"]=1),A=b);c["cke:indent"]=a}}]])(c.style,a)||""),c["cke:indent"]||(x=0,c["cke:indent"]=1),CKEDITOR.tools.extend(c,b.attributes),!0;A=x=w=null;return!1},getStyleComponents:function(){var a=CKEDITOR.dom.element.createFromHtml('\x3cdiv style\x3d"position:absolute;left:-9999px;top:-9999px;"\x3e\x3c/div\x3e',
|
||||
CKEDITOR.document);CKEDITOR.document.getBody().append(a);return function(c,b,f){a.setStyle(c,b);c={};b=f.length;for(var d=0;d<b;d++)c[f[d]]=a.getStyle(f[d]);return c}}(),listDtdParents:CKEDITOR.dtd.parentOf("ol")},filters:{flattenList:function(a,c){c="number"==typeof c?c:1;var b=a.attributes,f;switch(b.type){case "a":f="lower-alpha";break;case "1":f="decimal"}for(var d=a.children,e,k=0;k<d.length;k++)if(e=d[k],e.name in CKEDITOR.dtd.$listItem){var l=e.attributes,g=e.children,n=g[0],h=g[g.length-1];
|
||||
n.attributes&&n.attributes.style&&-1<n.attributes.style.indexOf("mso-list")&&(e.attributes.style=n.attributes.style,n.replaceWithChildren());h.name in CKEDITOR.dtd.$list&&(a.add(h,k+1),--g.length||d.splice(k--,1));e.name="cke:li";b.start&&!k&&(l.value=b.start);H.filters.stylesFilter([["tab-stops",null,function(a){(a=a.match(/0$|\d+\.?\d*\w+/))&&(x=CKEDITOR.tools.convertToPx(a[0]))}],1==c?["mso-list",null,function(a){a=a.split(" ");a=Number(a[0].match(/\d+/));a!==A&&(l["cke:reset"]=1);A=a}]:null])(l.style);
|
||||
l["cke:indent"]=c;l["cke:listtype"]=a.name;l["cke:list-style-type"]=f}else if(e.name in CKEDITOR.dtd.$list){arguments.callee.apply(this,[e,c+1]);d=d.slice(0,k).concat(e.children).concat(d.slice(k+1));a.children=[];e=0;for(g=d.length;e<g;e++)a.add(d[e]);d=a.children}delete a.name;b["cke:list"]=1},assembleList:function(a){var c=a.children,b,f,d,e,k,l;a=[];for(var g,n,h,p,m,t,q=0;q<c.length;q++)if(b=c[q],"cke:li"==b.name)if(b.name="li",f=b.attributes,h=(h=f["cke:listsymbol"])&&h.match(/^(?:[(]?)([^\s]+?)([.)]?)$/),
|
||||
p=m=t=null,f["cke:ignored"])c.splice(q--,1);else{f["cke:reset"]&&(l=e=k=null);d=Number(f["cke:indent"]);d!=e&&(n=g=null);if(h){if(n&&B[n][g].test(h[1]))p=n,m=g;else for(var u in B)for(var y in B[u])if(B[u][y].test(h[1]))if("ol"==u&&/alpha|roman/.test(y)){if(g=/roman/.test(y)?C(h[1]):E(h[1]),!t||g<t)t=g,p=u,m=y}else{p=u;m=y;break}!p&&(p=h[2]?"ol":"ul")}else p=f["cke:listtype"]||"ol",m=f["cke:list-style-type"];n=p;g=m||("ol"==p?"decimal":"disc");m&&m!=("ol"==p?"decimal":"disc")&&b.addStyle("list-style-type",
|
||||
m);if("ol"==p&&h){switch(m){case "decimal":t=Number(h[1]);break;case "lower-roman":case "upper-roman":t=C(h[1]);break;case "lower-alpha":case "upper-alpha":t=E(h[1])}b.attributes.value=t}if(l){if(d>e)a.push(l=new CKEDITOR.htmlParser.element(p)),l.add(b),k.add(l);else{if(d<e){e-=d;for(var v;e--&&(v=l.parent);)l=v.parent}l.add(b)}c.splice(q--,1)}else a.push(l=new CKEDITOR.htmlParser.element(p)),l.add(b),c[q]=l;k=b;e=d}else l&&(l=e=k=null);for(q=0;q<a.length;q++)if(l=a[q],u=l.children,g=g=void 0,y=l.children.length,
|
||||
v=g=void 0,c=/list-style-type:(.*?)(?:;|$)/,e=CKEDITOR.plugins.pastefromword.filters.stylesFilter,g=l.attributes,!c.exec(g.style)){for(k=0;k<y;k++)if(g=u[k],g.attributes.value&&Number(g.attributes.value)==k+1&&delete g.attributes.value,g=c.exec(g.attributes.style))if(g[1]!=v&&v){v=null;break}else v=g[1];if(v){for(k=0;k<y;k++)g=u[k].attributes,g.style&&(g.style=e([["list-style-type"]])(g.style)||"");l.addStyle("list-style-type",v)}}A=x=w=null},falsyFilter:function(){return!1},stylesFilter:function(a,
|
||||
c){return function(b,f){var d=[];(b||"").replace(/"/g,'"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(b,e,g){e=e.toLowerCase();"font-family"==e&&(g=g.replace(/["']/g,""));for(var n,h,p,m=0;m<a.length;m++)if(a[m]&&(b=a[m][0],n=a[m][1],h=a[m][2],p=a[m][3],e.match(b)&&(!n||g.match(n)))){e=p||e;c&&(h=h||g);"function"==typeof h&&(h=h(g,f,e));h&&h.push&&(e=h[0],h=h[1]);"string"==typeof h&&d.push([e,h]);return}!c&&d.push([e,g])});for(var e=0;e<d.length;e++)d[e]=d[e].join(":");return d.length?
|
||||
d.join(";")+";":!1}},elementMigrateFilter:function(a,c){return a?function(b){var f=c?(new CKEDITOR.style(a,c))._.definition:a;b.name=f.element;CKEDITOR.tools.extend(b.attributes,CKEDITOR.tools.clone(f.attributes));b.addStyle(CKEDITOR.style.getStyleText(f));f.attributes&&f.attributes["class"]&&(b.classWhiteList=" "+f.attributes["class"]+" ")}:function(){}},styleMigrateFilter:function(a,c){var b=this.elementMigrateFilter;return a?function(f,d){var e=new CKEDITOR.htmlParser.element(null),k={};k[c]=f;
|
||||
b(a,k)(e);e.children=d.children;d.children=[e];e.filter=function(){};e.parent=d}:function(){}},bogusAttrFilter:function(a,c){if(-1==c.name.indexOf("cke:"))return!1},applyStyleFilter:null},getRules:function(a,c){var b=CKEDITOR.dtd,f=CKEDITOR.tools.extend({},b.$block,b.$listItem,b.$tableContent),d=a.config,e=this.filters,k=e.falsyFilter,l=e.stylesFilter,g=e.elementMigrateFilter,n=CKEDITOR.tools.bind(this.filters.styleMigrateFilter,this.filters),h=this.utils.createListBulletMarker,p=e.flattenList,m=
|
||||
e.assembleList,t=this.utils.isListBulletIndicator,q=this.utils.isContainingOnlySpaces,u=this.utils.resolveList,y=function(a){a=CKEDITOR.tools.convertToPx(a);return isNaN(a)?a:a+"px"},v=this.utils.getStyleComponents,x=this.utils.listDtdParents,r=!1!==d.pasteFromWordRemoveFontStyles,w=!1!==d.pasteFromWordRemoveStyles;return{elementNames:[[/meta|link|script/,""]],root:function(a){a.filterChildren(c);m(a)},elements:{"^":function(a){var c;CKEDITOR.env.gecko&&(c=e.applyStyleFilter)&&c(a)},$:function(a){var z=
|
||||
a.name||"",e=a.attributes;z in f&&e.style&&(e.style=l([[/^(:?width|height)$/,null,y]])(e.style)||"");if(z.match(/h\d/)){a.filterChildren(c);if(u(a))return;g(d["format_"+z])(a)}else if(z in b.$inline)a.filterChildren(c),q(a)&&delete a.name;else if(-1!=z.indexOf(":")&&-1==z.indexOf("cke")){a.filterChildren(c);if("v:imagedata"==z){if(z=a.attributes["o:href"])a.attributes.src=z;a.name="img";return}delete a.name}z in x&&(a.filterChildren(c),m(a))},style:function(a){if(CKEDITOR.env.gecko){a=(a=a.onlyChild().value.match(/\/\* Style Definitions \*\/([\s\S]*?)\/\*/))&&
|
||||
a[1];var c={};a&&(a.replace(/[\n\r]/g,"").replace(/(.+?)\{(.+?)\}/g,function(a,b,I){b=b.split(",");a=b.length;for(var d=0;d<a;d++)CKEDITOR.tools.trim(b[d]).replace(/^(\w+)(\.[\w-]+)?$/g,function(a,b,d){b=b||"*";d=d.substring(1,d.length);d.match(/MsoNormal/)||(c[b]||(c[b]={}),d?c[b][d]=I:c[b]=I)})}),e.applyStyleFilter=function(a){var b=c["*"]?"*":a.name,d=a.attributes&&a.attributes["class"];b in c&&(b=c[b],"object"==typeof b&&(b=b[d]),b&&a.addStyle(b,!0))})}return!1},p:function(a){if(/MsoListParagraph/i.exec(a.attributes["class"])||
|
||||
a.getStyle("mso-list")&&!a.getStyle("mso-list").match(/^(none|skip)$/i)){var b=a.firstChild(function(a){return a.type==CKEDITOR.NODE_TEXT&&!q(a.parent)});(b=b&&b.parent)&&b.addStyle("mso-list","Ignore")}a.filterChildren(c);u(a)||(d.enterMode==CKEDITOR.ENTER_BR?(delete a.name,a.add(new CKEDITOR.htmlParser.element("br"))):g(d["format_"+(d.enterMode==CKEDITOR.ENTER_P?"p":"div")])(a))},div:function(a){var c=a.onlyChild();if(c&&"table"==c.name){var b=a.attributes;c.attributes=CKEDITOR.tools.extend(c.attributes,
|
||||
b);b.style&&c.addStyle(b.style);c=new CKEDITOR.htmlParser.element("div");c.addStyle("clear","both");a.add(c);delete a.name}},td:function(a){a.getAncestor("thead")&&(a.name="th")},ol:p,ul:p,dl:p,font:function(a){if(t(a.parent))delete a.name;else{a.filterChildren(c);var b=a.attributes,d=b.style,e=a.parent;"font"==e.name?(CKEDITOR.tools.extend(e.attributes,a.attributes),d&&e.addStyle(d),delete a.name):(d=(d||"").split(";"),b.color&&("#000000"!=b.color&&d.push("color:"+b.color),delete b.color),b.face&&
|
||||
(d.push("font-family:"+b.face),delete b.face),b.size&&(d.push("font-size:"+(3<b.size?"large":3>b.size?"small":"medium")),delete b.size),a.name="span",a.addStyle(d.join(";")))}},span:function(a){if(t(a.parent))return!1;a.filterChildren(c);if(q(a))return delete a.name,null;if(t(a)){var b=a.firstChild(function(a){return a.value||"img"==a.name}),e=(b=b&&(b.value||"l."))&&b.match(/^(?:[(]?)([^\s]+?)([.)]?)$/);if(e)return b=h(e,b),(a=a.getAncestor("span"))&&/ mso-hide:\s*all|display:\s*none /.test(a.attributes.style)&&
|
||||
(b.attributes["cke:ignored"]=1),b}if(e=(b=a.attributes)&&b.style)b.style=l([["line-height"],[/^font-family$/,null,r?null:n(d.font_style,"family")],[/^font-size$/,null,r?null:n(d.fontSize_style,"size")],[/^color$/,null,r?null:n(d.colorButton_foreStyle,"color")],[/^background-color$/,null,r?null:n(d.colorButton_backStyle,"color")]])(e,a)||"";b.style||delete b.style;CKEDITOR.tools.isEmpty(b)&&delete a.name;return null},b:g(d.coreStyles_bold),i:g(d.coreStyles_italic),u:g(d.coreStyles_underline),s:g(d.coreStyles_strike),
|
||||
sup:g(d.coreStyles_superscript),sub:g(d.coreStyles_subscript),a:function(a){var b=a.attributes;b.name&&b.name.match(/ole_link\d+/i)?delete a.name:b.href&&b.href.match(/^file:\/\/\/[\S]+#/i)&&(b.href=b.href.replace(/^file:\/\/\/[^#]+/i,""))},"cke:listbullet":function(a){a.getAncestor(/h\d/)&&!d.pasteFromWordNumberedHeadingToList&&delete a.name}},attributeNames:[[/^onmouse(:?out|over)/,""],[/^onload$/,""],[/(?:v|o):\w+/,""],[/^lang/,""]],attributes:{style:l(w?[[/^list-style-type$/,null],[/^margin$|^margin-(?!bottom|top)/,
|
||||
null,function(a,b,c){if(b.name in{p:1,div:1}){b="ltr"==d.contentsLangDirection?"margin-left":"margin-right";if("margin"==c)a=v(c,a,[b])[b];else if(c!=b)return null;if(a&&!G.test(a))return[b,a]}return null}],[/^clear$/],[/^border.*|margin.*|vertical-align|float$/,null,function(a,b){if("img"==b.name)return a}],[/^width|height$/,null,function(a,b){if(b.name in{table:1,td:1,th:1,img:1})return a}]]:[[/^mso-/],[/-color$/,null,function(a){if("transparent"==a)return!1;if(CKEDITOR.env.gecko)return a.replace(/-moz-use-text-color/g,
|
||||
"transparent")}],[/^margin$/,G],["text-indent","0cm"],["page-break-before"],["tab-stops"],["display","none"],r?[/font-?/]:null],w),width:function(a,c){if(c.name in b.$tableContent)return!1},border:function(a,c){if(c.name in b.$tableContent)return!1},"class":function(a,b){return b.classWhiteList&&-1!=b.classWhiteList.indexOf(" "+a+" ")?a:!1},bgcolor:k,valign:w?k:function(a,b){b.addStyle("vertical-align",a);return!1}},comment:CKEDITOR.env.ie?k:function(a,b){var c=a.match(/<img.*?>/),d=a.match(/^\[if !supportLists\]([\s\S]*?)\[endif\]$/);
|
||||
return d?(d=(c=d[1]||c&&"l.")&&c.match(/>(?:[(]?)([^\s]+?)([.)]?)</),h(d,c)):CKEDITOR.env.gecko&&c?(c=CKEDITOR.htmlParser.fragment.fromHtml(c[0]).children[0],(d=(d=(d=b.previous)&&d.value.match(/<v:imagedata[^>]*o:href=['"](.*?)['"]/))&&d[1])&&(c.attributes.src=d),c):!1}}}},J=function(){this.dataFilter=new CKEDITOR.htmlParser.filter};J.prototype={toHtml:function(a){a=CKEDITOR.htmlParser.fragment.fromHtml(a);var c=new CKEDITOR.htmlParser.basicWriter;a.writeHtml(c,this.dataFilter);return c.getHtml(!0)}};
|
||||
CKEDITOR.cleanWord=function(a,c){a=a.replace(/<!\[([^\]]*?)\]>/g,"\x3c!--[$1]--\x3e");CKEDITOR.env.gecko&&(a=a.replace(/(\x3c!--\[if[^<]*?\])--\x3e([\S\s]*?)\x3c!--(\[endif\]--\x3e)/gi,"$1$2$3"));CKEDITOR.env.webkit&&(a=a.replace(/(class="MsoListParagraph[^>]+>\x3c!--\[if !supportLists\]--\x3e)([^<]+<span[^<]+<\/span>)(\x3c!--\[endif\]--\x3e)/gi,"$1\x3cspan\x3e$2\x3c/span\x3e$3"));var b=new J,f=b.dataFilter;f.addRules(CKEDITOR.plugins.pastefromword.getRules(c,f));c.fire("beforeCleanWord",{filter:f});
|
||||
try{a=b.toHtml(a)}catch(d){c.showNotification(c.lang.pastefromword.error)}a=a.replace(/cke:.*?".*?"/g,"");a=a.replace(/style=""/g,"");return a=a.replace(/<span>/g,"")}})();
|
|
@ -3,7 +3,7 @@
|
|||
For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||
*/
|
||||
CKEDITOR.plugins.setLang("specialchar","fr",{euro:"Symbole Euro",lsquo:"Guillemet simple ouvrant",rsquo:"Guillemet simple fermant",ldquo:"Guillemet double ouvrant",rdquo:"Guillemet double fermant",ndash:"Tiret haut",mdash:"Tiret cadratin",iexcl:"Point d'exclamation inversé",cent:"Symbole Cent",pound:"Symbole Livre Sterling",curren:"Symbole monétaire",yen:"Symbole Yen",brvbar:"Barre verticale scindée",sect:"Section",uml:"Tréma",copy:"Symbole Copyright",ordf:"Indicateur ordinal féminin",laquo:"Guillemet français ouvrant",
|
||||
not:"Crochet de négation",reg:"Marque déposée",macr:"Macron",deg:"Degré",sup2:"Exposant 2",sup3:"\\tExposant 3",acute:"Accent aigu",micro:"Omicron",para:"Paragraphe",middot:"Point médian",cedil:"Cédille",sup1:"\\tExposant 1",ordm:"Indicateur ordinal masculin",raquo:"Guillemet français fermant",frac14:"Un quart",frac12:"Un demi",frac34:"Trois quarts",iquest:"Point d'interrogation inversé",Agrave:"A majuscule accent grave",Aacute:"A majuscule accent aigu",Acirc:"A majuscule accent circonflexe",Atilde:"A majuscule avec caron",
|
||||
not:"Crochet de négation",reg:"Marque déposée",macr:"Macron",deg:"Degré",sup2:"Exposant 2",sup3:"Exposant 3",acute:"Accent aigu",micro:"Omicron",para:"Paragraphe",middot:"Point médian",cedil:"Cédille",sup1:"Exposant 1",ordm:"Indicateur ordinal masculin",raquo:"Guillemet français fermant",frac14:"Un quart",frac12:"Un demi",frac34:"Trois quarts",iquest:"Point d'interrogation inversé",Agrave:"A majuscule accent grave",Aacute:"A majuscule accent aigu",Acirc:"A majuscule accent circonflexe",Atilde:"A majuscule avec caron",
|
||||
Auml:"A majuscule tréma",Aring:"A majuscule avec un rond au-dessus",AElig:"Æ majuscule ligaturés",Ccedil:"C majuscule cédille",Egrave:"E majuscule accent grave",Eacute:"E majuscule accent aigu",Ecirc:"E majuscule accent circonflexe",Euml:"E majuscule tréma",Igrave:"I majuscule accent grave",Iacute:"I majuscule accent aigu",Icirc:"I majuscule accent circonflexe",Iuml:"I majuscule tréma",ETH:"Lettre majuscule islandaise ED",Ntilde:"N majuscule avec caron",Ograve:"O majuscule accent grave",Oacute:"O majuscule accent aigu",
|
||||
Ocirc:"O majuscule accent circonflexe",Otilde:"O majuscule avec caron",Ouml:"O majuscule tréma",times:"Multiplication",Oslash:"O majuscule barré",Ugrave:"U majuscule accent grave",Uacute:"U majuscule accent aigu",Ucirc:"U majuscule accent circonflexe",Uuml:"U majuscule tréma",Yacute:"Y majuscule accent aigu",THORN:"Lettre islandaise Thorn majuscule",szlig:"Lettre minuscule allemande s dur",agrave:"a minuscule accent grave",aacute:"a minuscule accent aigu",acirc:"a minuscule accent circonflexe",atilde:"a minuscule avec caron",
|
||||
auml:"a minuscule tréma",aring:"a minuscule avec un rond au-dessus",aelig:"æ minuscule ligaturés",ccedil:"c minuscule cédille",egrave:"e minuscule accent grave",eacute:"e minuscule accent aigu",ecirc:"e minuscule accent circonflexe",euml:"e minuscule tréma",igrave:"i minuscule accent grave",iacute:"i minuscule accent aigu",icirc:"i minuscule accent circonflexe",iuml:"i minuscule tréma",eth:"Lettre minuscule islandaise ED",ntilde:"n minuscule avec caron",ograve:"o minuscule accent grave",oacute:"o minuscule accent aigu",
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||
*/
|
||||
CKEDITOR.dialog.add("specialchar",function(i){var e,l=i.lang.specialchar,k=function(c){var b,c=c.data?c.data.getTarget():new CKEDITOR.dom.element(c);if("a"==c.getName()&&(b=c.getChild(0).getHtml()))c.removeClass("cke_light_background"),e.hide(),c=i.document.createElement("span"),c.setHtml(b),i.insertText(c.getText())},m=CKEDITOR.tools.addFunction(k),j,g=function(c,b){var a,b=b||c.data.getTarget();"span"==b.getName()&&(b=b.getParent());if("a"==b.getName()&&(a=b.getChild(0).getHtml())){j&&d(null,j);
|
||||
var f=e.getContentElement("info","htmlPreview").getElement();e.getContentElement("info","charPreview").getElement().setHtml(a);f.setHtml(CKEDITOR.tools.htmlEncode(a));b.getParent().addClass("cke_light_background");j=b}},d=function(c,b){b=b||c.data.getTarget();"span"==b.getName()&&(b=b.getParent());"a"==b.getName()&&(e.getContentElement("info","charPreview").getElement().setHtml(" "),e.getContentElement("info","htmlPreview").getElement().setHtml(" "),b.getParent().removeClass("cke_light_background"),
|
||||
j=void 0)},n=CKEDITOR.tools.addFunction(function(c){var c=new CKEDITOR.dom.event(c),b=c.getTarget(),a;a=c.getKeystroke();var f="rtl"==i.lang.dir;switch(a){case 38:if(a=b.getParent().getParent().getPrevious())a=a.getChild([b.getParent().getIndex(),0]),a.focus(),d(null,b),g(null,a);c.preventDefault();break;case 40:if(a=b.getParent().getParent().getNext())if((a=a.getChild([b.getParent().getIndex(),0]))&&1==a.type)a.focus(),d(null,b),g(null,a);c.preventDefault();break;case 32:k({data:c});c.preventDefault();
|
||||
CKEDITOR.dialog.add("specialchar",function(k){var e,n=k.lang.specialchar,m=function(c){var b;c=c.data?c.data.getTarget():new CKEDITOR.dom.element(c);"a"==c.getName()&&(b=c.getChild(0).getHtml())&&(c.removeClass("cke_light_background"),e.hide(),c=k.document.createElement("span"),c.setHtml(b),k.insertText(c.getText()))},p=CKEDITOR.tools.addFunction(m),l,g=function(c,b){var a;b=b||c.data.getTarget();"span"==b.getName()&&(b=b.getParent());if("a"==b.getName()&&(a=b.getChild(0).getHtml())){l&&d(null,l);
|
||||
var f=e.getContentElement("info","htmlPreview").getElement();e.getContentElement("info","charPreview").getElement().setHtml(a);f.setHtml(CKEDITOR.tools.htmlEncode(a));b.getParent().addClass("cke_light_background");l=b}},d=function(c,b){b=b||c.data.getTarget();"span"==b.getName()&&(b=b.getParent());"a"==b.getName()&&(e.getContentElement("info","charPreview").getElement().setHtml("\x26nbsp;"),e.getContentElement("info","htmlPreview").getElement().setHtml("\x26nbsp;"),b.getParent().removeClass("cke_light_background"),
|
||||
l=void 0)},q=CKEDITOR.tools.addFunction(function(c){c=new CKEDITOR.dom.event(c);var b=c.getTarget(),a;a=c.getKeystroke();var f="rtl"==k.lang.dir;switch(a){case 38:if(a=b.getParent().getParent().getPrevious())a=a.getChild([b.getParent().getIndex(),0]),a.focus(),d(null,b),g(null,a);c.preventDefault();break;case 40:(a=b.getParent().getParent().getNext())&&(a=a.getChild([b.getParent().getIndex(),0]))&&1==a.type&&(a.focus(),d(null,b),g(null,a));c.preventDefault();break;case 32:m({data:c});c.preventDefault();
|
||||
break;case f?37:39:if(a=b.getParent().getNext())a=a.getChild(0),1==a.type?(a.focus(),d(null,b),g(null,a),c.preventDefault(!0)):d(null,b);else if(a=b.getParent().getParent().getNext())(a=a.getChild([0,0]))&&1==a.type?(a.focus(),d(null,b),g(null,a),c.preventDefault(!0)):d(null,b);break;case f?39:37:(a=b.getParent().getPrevious())?(a=a.getChild(0),a.focus(),d(null,b),g(null,a),c.preventDefault(!0)):(a=b.getParent().getParent().getPrevious())?(a=a.getLast().getChild(0),a.focus(),d(null,b),g(null,a),c.preventDefault(!0)):
|
||||
d(null,b)}});return{title:l.title,minWidth:430,minHeight:280,buttons:[CKEDITOR.dialog.cancelButton],charColumns:17,onLoad:function(){for(var c=this.definition.charColumns,b=i.config.specialChars,a=CKEDITOR.tools.getNextId()+"_specialchar_table_label",f=['<table role="listbox" aria-labelledby="'+a+'" style="width: 320px; height: 100%; border-collapse: separate;" align="center" cellspacing="2" cellpadding="2" border="0">'],d=0,g=b.length,h,e;d<g;){f.push('<tr role="presentation">');for(var j=0;j<c;j++,
|
||||
d++){if(h=b[d]){h instanceof Array?(e=h[1],h=h[0]):(e=h.replace("&","").replace(";","").replace("#",""),e=l[e]||h);var k="cke_specialchar_label_"+d+"_"+CKEDITOR.tools.getNextNumber();f.push('<td class="cke_dark_background" style="cursor: default" role="presentation"><a href="javascript: void(0);" role="option" aria-posinset="'+(d+1)+'"',' aria-setsize="'+g+'"',' aria-labelledby="'+k+'"',' class="cke_specialchar" title="',CKEDITOR.tools.htmlEncode(e),'" onkeydown="CKEDITOR.tools.callFunction( '+n+
|
||||
', event, this )" onclick="CKEDITOR.tools.callFunction('+m+', this); return false;" tabindex="-1"><span style="margin: 0 auto;cursor: inherit">'+h+'</span><span class="cke_voice_label" id="'+k+'">'+e+"</span></a>")}else f.push('<td class="cke_dark_background"> ');f.push("</td>")}f.push("</tr>")}f.push("</tbody></table>",'<span id="'+a+'" class="cke_voice_label">'+l.options+"</span>");this.getContentElement("info","charContainer").getElement().setHtml(f.join(""))},contents:[{id:"info",label:i.lang.common.generalTab,
|
||||
title:i.lang.common.generalTab,padding:0,align:"top",elements:[{type:"hbox",align:"top",widths:["320px","90px"],children:[{type:"html",id:"charContainer",html:"",onMouseover:g,onMouseout:d,focus:function(){var c=this.getElement().getElementsByTag("a").getItem(0);setTimeout(function(){c.focus();g(null,c)},0)},onShow:function(){var c=this.getElement().getChild([0,0,0,0,0]);setTimeout(function(){c.focus();g(null,c)},0)},onLoad:function(c){e=c.sender}},{type:"hbox",align:"top",widths:["100%"],children:[{type:"vbox",
|
||||
align:"top",children:[{type:"html",html:"<div></div>"},{type:"html",id:"charPreview",className:"cke_dark_background",style:"border:1px solid #eeeeee;font-size:28px;height:40px;width:70px;padding-top:9px;font-family:'Microsoft Sans Serif',Arial,Helvetica,Verdana;text-align:center;",html:"<div> </div>"},{type:"html",id:"htmlPreview",className:"cke_dark_background",style:"border:1px solid #eeeeee;font-size:14px;height:20px;width:70px;padding-top:2px;font-family:'Microsoft Sans Serif',Arial,Helvetica,Verdana;text-align:center;",
|
||||
html:"<div> </div>"}]}]}]}]}]}});
|
||||
d(null,b)}});return{title:n.title,minWidth:430,minHeight:280,buttons:[CKEDITOR.dialog.cancelButton],charColumns:17,onLoad:function(){for(var c=this.definition.charColumns,b=k.config.specialChars,a=CKEDITOR.tools.getNextId()+"_specialchar_table_label",f=['\x3ctable role\x3d"listbox" aria-labelledby\x3d"'+a+'" style\x3d"width: 320px; height: 100%; border-collapse: separate;" align\x3d"center" cellspacing\x3d"2" cellpadding\x3d"2" border\x3d"0"\x3e'],d=0,g=b.length,h,e;d<g;){f.push('\x3ctr role\x3d"presentation"\x3e');
|
||||
for(var l=0;l<c;l++,d++){if(h=b[d]){h instanceof Array?(e=h[1],h=h[0]):(e=h.replace("\x26","").replace(";","").replace("#",""),e=n[e]||h);var m="cke_specialchar_label_"+d+"_"+CKEDITOR.tools.getNextNumber();f.push('\x3ctd class\x3d"cke_dark_background" style\x3d"cursor: default" role\x3d"presentation"\x3e\x3ca href\x3d"javascript: void(0);" role\x3d"option" aria-posinset\x3d"'+(d+1)+'"',' aria-setsize\x3d"'+g+'"',' aria-labelledby\x3d"'+m+'"',' class\x3d"cke_specialchar" title\x3d"',CKEDITOR.tools.htmlEncode(e),
|
||||
'" onkeydown\x3d"CKEDITOR.tools.callFunction( '+q+', event, this )" onclick\x3d"CKEDITOR.tools.callFunction('+p+', this); return false;" tabindex\x3d"-1"\x3e\x3cspan style\x3d"margin: 0 auto;cursor: inherit"\x3e'+h+'\x3c/span\x3e\x3cspan class\x3d"cke_voice_label" id\x3d"'+m+'"\x3e'+e+"\x3c/span\x3e\x3c/a\x3e")}else f.push('\x3ctd class\x3d"cke_dark_background"\x3e\x26nbsp;');f.push("\x3c/td\x3e")}f.push("\x3c/tr\x3e")}f.push("\x3c/tbody\x3e\x3c/table\x3e",'\x3cspan id\x3d"'+a+'" class\x3d"cke_voice_label"\x3e'+
|
||||
n.options+"\x3c/span\x3e");this.getContentElement("info","charContainer").getElement().setHtml(f.join(""))},contents:[{id:"info",label:k.lang.common.generalTab,title:k.lang.common.generalTab,padding:0,align:"top",elements:[{type:"hbox",align:"top",widths:["320px","90px"],children:[{type:"html",id:"charContainer",html:"",onMouseover:g,onMouseout:d,focus:function(){var c=this.getElement().getElementsByTag("a").getItem(0);setTimeout(function(){c.focus();g(null,c)},0)},onShow:function(){var c=this.getElement().getChild([0,
|
||||
0,0,0,0]);setTimeout(function(){c.focus();g(null,c)},0)},onLoad:function(c){e=c.sender}},{type:"hbox",align:"top",widths:["100%"],children:[{type:"vbox",align:"top",children:[{type:"html",html:"\x3cdiv\x3e\x3c/div\x3e"},{type:"html",id:"charPreview",className:"cke_dark_background",style:"border:1px solid #eeeeee;font-size:28px;height:40px;width:70px;padding-top:9px;font-family:'Microsoft Sans Serif',Arial,Helvetica,Verdana;text-align:center;",html:"\x3cdiv\x3e\x26nbsp;\x3c/div\x3e"},{type:"html",
|
||||
id:"htmlPreview",className:"cke_dark_background",style:"border:1px solid #eeeeee;font-size:14px;height:20px;width:70px;padding-top:2px;font-family:'Microsoft Sans Serif',Arial,Helvetica,Verdana;text-align:center;",html:"\x3cdiv\x3e\x26nbsp;\x3c/div\x3e"}]}]}]}]}]}});
|
|
@ -2,20 +2,20 @@
|
|||
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||
*/
|
||||
(function(){function r(a){for(var e=0,l=0,k=0,m,g=a.$.rows.length;k<g;k++){m=a.$.rows[k];for(var d=e=0,c,b=m.cells.length;d<b;d++)c=m.cells[d],e+=c.colSpan;e>l&&(l=e)}return l}function o(a){return function(){var e=this.getValue(),e=!!(CKEDITOR.dialog.validate.integer()(e)&&0<e);e||(alert(a),this.select());return e}}function n(a,e){var l=function(g){return new CKEDITOR.dom.element(g,a.document)},n=a.editable(),m=a.plugins.dialogadvtab;return{title:a.lang.table.title,minWidth:310,minHeight:CKEDITOR.env.ie?
|
||||
310:280,onLoad:function(){var g=this,a=g.getContentElement("advanced","advStyles");if(a)a.on("change",function(){var a=this.getStyle("width",""),b=g.getContentElement("info","txtWidth");b&&b.setValue(a,!0);a=this.getStyle("height","");(b=g.getContentElement("info","txtHeight"))&&b.setValue(a,!0)})},onShow:function(){var g=a.getSelection(),d=g.getRanges(),c,b=this.getContentElement("info","txtRows"),h=this.getContentElement("info","txtCols"),p=this.getContentElement("info","txtWidth"),f=this.getContentElement("info",
|
||||
"txtHeight");"tableProperties"==e&&((g=g.getSelectedElement())&&g.is("table")?c=g:0<d.length&&(CKEDITOR.env.webkit&&d[0].shrink(CKEDITOR.NODE_ELEMENT),c=a.elementPath(d[0].getCommonAncestor(!0)).contains("table",1)),this._.selectedElement=c);c?(this.setupContent(c),b&&b.disable(),h&&h.disable()):(b&&b.enable(),h&&h.enable());p&&p.onChange();f&&f.onChange()},onOk:function(){var g=a.getSelection(),d=this._.selectedElement&&g.createBookmarks(),c=this._.selectedElement||l("table"),b={};this.commitContent(b,
|
||||
c);if(b.info){b=b.info;if(!this._.selectedElement)for(var h=c.append(l("tbody")),e=parseInt(b.txtRows,10)||0,f=parseInt(b.txtCols,10)||0,i=0;i<e;i++)for(var j=h.append(l("tr")),k=0;k<f;k++)j.append(l("td")).appendBogus();e=b.selHeaders;if(!c.$.tHead&&("row"==e||"both"==e)){j=new CKEDITOR.dom.element(c.$.createTHead());h=c.getElementsByTag("tbody").getItem(0);h=h.getElementsByTag("tr").getItem(0);for(i=0;i<h.getChildCount();i++)f=h.getChild(i),f.type==CKEDITOR.NODE_ELEMENT&&!f.data("cke-bookmark")&&
|
||||
(f.renameNode("th"),f.setAttribute("scope","col"));j.append(h.remove())}if(null!==c.$.tHead&&!("row"==e||"both"==e)){j=new CKEDITOR.dom.element(c.$.tHead);h=c.getElementsByTag("tbody").getItem(0);for(k=h.getFirst();0<j.getChildCount();){h=j.getFirst();for(i=0;i<h.getChildCount();i++)f=h.getChild(i),f.type==CKEDITOR.NODE_ELEMENT&&(f.renameNode("td"),f.removeAttribute("scope"));h.insertBefore(k)}j.remove()}if(!this.hasColumnHeaders&&("col"==e||"both"==e))for(j=0;j<c.$.rows.length;j++)f=new CKEDITOR.dom.element(c.$.rows[j].cells[0]),
|
||||
f.renameNode("th"),f.setAttribute("scope","row");if(this.hasColumnHeaders&&!("col"==e||"both"==e))for(i=0;i<c.$.rows.length;i++)j=new CKEDITOR.dom.element(c.$.rows[i]),"tbody"==j.getParent().getName()&&(f=new CKEDITOR.dom.element(j.$.cells[0]),f.renameNode("td"),f.removeAttribute("scope"));b.txtHeight?c.setStyle("height",b.txtHeight):c.removeStyle("height");b.txtWidth?c.setStyle("width",b.txtWidth):c.removeStyle("width");c.getAttribute("style")||c.removeAttribute("style")}if(this._.selectedElement)try{g.selectBookmarks(d)}catch(m){}else a.insertElement(c),
|
||||
setTimeout(function(){var g=new CKEDITOR.dom.element(c.$.rows[0].cells[0]),b=a.createRange();b.moveToPosition(g,CKEDITOR.POSITION_AFTER_START);b.select()},0)},contents:[{id:"info",label:a.lang.table.title,elements:[{type:"hbox",widths:[null,null],styles:["vertical-align:top"],children:[{type:"vbox",padding:0,children:[{type:"text",id:"txtRows","default":3,label:a.lang.table.rows,required:!0,controlStyle:"width:5em",validate:o(a.lang.table.invalidRows),setup:function(a){this.setValue(a.$.rows.length)},
|
||||
commit:k},{type:"text",id:"txtCols","default":2,label:a.lang.table.columns,required:!0,controlStyle:"width:5em",validate:o(a.lang.table.invalidCols),setup:function(a){this.setValue(r(a))},commit:k},{type:"html",html:" "},{type:"select",id:"selHeaders",requiredContent:"th","default":"",label:a.lang.table.headers,items:[[a.lang.table.headersNone,""],[a.lang.table.headersRow,"row"],[a.lang.table.headersColumn,"col"],[a.lang.table.headersBoth,"both"]],setup:function(a){var d=this.getDialog();d.hasColumnHeaders=
|
||||
!0;for(var c=0;c<a.$.rows.length;c++){var b=a.$.rows[c].cells[0];if(b&&"th"!=b.nodeName.toLowerCase()){d.hasColumnHeaders=!1;break}}null!==a.$.tHead?this.setValue(d.hasColumnHeaders?"both":"row"):this.setValue(d.hasColumnHeaders?"col":"")},commit:k},{type:"text",id:"txtBorder",requiredContent:"table[border]","default":a.filter.check("table[border]")?1:0,label:a.lang.table.border,controlStyle:"width:3em",validate:CKEDITOR.dialog.validate.number(a.lang.table.invalidBorder),setup:function(a){this.setValue(a.getAttribute("border")||
|
||||
(function(){function v(a){for(var f=0,n=0,m=0,p,e=a.$.rows.length;m<e;m++){p=a.$.rows[m];for(var d=f=0,c,b=p.cells.length;d<b;d++)c=p.cells[d],f+=c.colSpan;f>n&&(n=f)}return n}function r(a){return function(){var f=this.getValue(),f=!!(CKEDITOR.dialog.validate.integer()(f)&&0<f);f||(alert(a),this.select());return f}}function q(a,f){var n=function(e){return new CKEDITOR.dom.element(e,a.document)},q=a.editable(),p=a.plugins.dialogadvtab;return{title:a.lang.table.title,minWidth:310,minHeight:CKEDITOR.env.ie?
|
||||
310:280,onLoad:function(){var e=this,a=e.getContentElement("advanced","advStyles");if(a)a.on("change",function(){var a=this.getStyle("width",""),b=e.getContentElement("info","txtWidth");b&&b.setValue(a,!0);a=this.getStyle("height","");(b=e.getContentElement("info","txtHeight"))&&b.setValue(a,!0)})},onShow:function(){var e=a.getSelection(),d=e.getRanges(),c,b=this.getContentElement("info","txtRows"),h=this.getContentElement("info","txtCols"),t=this.getContentElement("info","txtWidth"),g=this.getContentElement("info",
|
||||
"txtHeight");"tableProperties"==f&&((e=e.getSelectedElement())&&e.is("table")?c=e:0<d.length&&(CKEDITOR.env.webkit&&d[0].shrink(CKEDITOR.NODE_ELEMENT),c=a.elementPath(d[0].getCommonAncestor(!0)).contains("table",1)),this._.selectedElement=c);c?(this.setupContent(c),b&&b.disable(),h&&h.disable()):(b&&b.enable(),h&&h.enable());t&&t.onChange();g&&g.onChange()},onOk:function(){var e=a.getSelection(),d=this._.selectedElement&&e.createBookmarks(),c=this._.selectedElement||n("table"),b={};this.commitContent(b,
|
||||
c);if(b.info){b=b.info;if(!this._.selectedElement)for(var h=c.append(n("tbody")),f=parseInt(b.txtRows,10)||0,g=parseInt(b.txtCols,10)||0,k=0;k<f;k++)for(var l=h.append(n("tr")),m=0;m<g;m++)l.append(n("td")).appendBogus();f=b.selHeaders;if(!c.$.tHead&&("row"==f||"both"==f)){l=new CKEDITOR.dom.element(c.$.createTHead());h=c.getElementsByTag("tbody").getItem(0);h=h.getElementsByTag("tr").getItem(0);for(k=0;k<h.getChildCount();k++)g=h.getChild(k),g.type!=CKEDITOR.NODE_ELEMENT||g.data("cke-bookmark")||
|
||||
(g.renameNode("th"),g.setAttribute("scope","col"));l.append(h.remove())}if(null!==c.$.tHead&&"row"!=f&&"both"!=f){l=new CKEDITOR.dom.element(c.$.tHead);h=c.getElementsByTag("tbody").getItem(0);for(m=h.getFirst();0<l.getChildCount();){h=l.getFirst();for(k=0;k<h.getChildCount();k++)g=h.getChild(k),g.type==CKEDITOR.NODE_ELEMENT&&(g.renameNode("td"),g.removeAttribute("scope"));h.insertBefore(m)}l.remove()}if(!this.hasColumnHeaders&&("col"==f||"both"==f))for(l=0;l<c.$.rows.length;l++)g=new CKEDITOR.dom.element(c.$.rows[l].cells[0]),
|
||||
g.renameNode("th"),g.setAttribute("scope","row");if(this.hasColumnHeaders&&"col"!=f&&"both"!=f)for(k=0;k<c.$.rows.length;k++)l=new CKEDITOR.dom.element(c.$.rows[k]),"tbody"==l.getParent().getName()&&(g=new CKEDITOR.dom.element(l.$.cells[0]),g.renameNode("td"),g.removeAttribute("scope"));b.txtHeight?c.setStyle("height",b.txtHeight):c.removeStyle("height");b.txtWidth?c.setStyle("width",b.txtWidth):c.removeStyle("width");c.getAttribute("style")||c.removeAttribute("style")}if(this._.selectedElement)try{e.selectBookmarks(d)}catch(p){}else a.insertElement(c),
|
||||
setTimeout(function(){var e=new CKEDITOR.dom.element(c.$.rows[0].cells[0]),b=a.createRange();b.moveToPosition(e,CKEDITOR.POSITION_AFTER_START);b.select()},0)},contents:[{id:"info",label:a.lang.table.title,elements:[{type:"hbox",widths:[null,null],styles:["vertical-align:top"],children:[{type:"vbox",padding:0,children:[{type:"text",id:"txtRows","default":3,label:a.lang.table.rows,required:!0,controlStyle:"width:5em",validate:r(a.lang.table.invalidRows),setup:function(e){this.setValue(e.$.rows.length)},
|
||||
commit:m},{type:"text",id:"txtCols","default":2,label:a.lang.table.columns,required:!0,controlStyle:"width:5em",validate:r(a.lang.table.invalidCols),setup:function(e){this.setValue(v(e))},commit:m},{type:"html",html:"\x26nbsp;"},{type:"select",id:"selHeaders",requiredContent:"th","default":"",label:a.lang.table.headers,items:[[a.lang.table.headersNone,""],[a.lang.table.headersRow,"row"],[a.lang.table.headersColumn,"col"],[a.lang.table.headersBoth,"both"]],setup:function(e){var a=this.getDialog();
|
||||
a.hasColumnHeaders=!0;for(var c=0;c<e.$.rows.length;c++){var b=e.$.rows[c].cells[0];if(b&&"th"!=b.nodeName.toLowerCase()){a.hasColumnHeaders=!1;break}}null!==e.$.tHead?this.setValue(a.hasColumnHeaders?"both":"row"):this.setValue(a.hasColumnHeaders?"col":"")},commit:m},{type:"text",id:"txtBorder",requiredContent:"table[border]","default":a.filter.check("table[border]")?1:0,label:a.lang.table.border,controlStyle:"width:3em",validate:CKEDITOR.dialog.validate.number(a.lang.table.invalidBorder),setup:function(a){this.setValue(a.getAttribute("border")||
|
||||
"")},commit:function(a,d){this.getValue()?d.setAttribute("border",this.getValue()):d.removeAttribute("border")}},{id:"cmbAlign",type:"select",requiredContent:"table[align]","default":"",label:a.lang.common.align,items:[[a.lang.common.notSet,""],[a.lang.common.alignLeft,"left"],[a.lang.common.alignCenter,"center"],[a.lang.common.alignRight,"right"]],setup:function(a){this.setValue(a.getAttribute("align")||"")},commit:function(a,d){this.getValue()?d.setAttribute("align",this.getValue()):d.removeAttribute("align")}}]},
|
||||
{type:"vbox",padding:0,children:[{type:"hbox",widths:["5em"],children:[{type:"text",id:"txtWidth",requiredContent:"table{width}",controlStyle:"width:5em",label:a.lang.common.width,title:a.lang.common.cssLengthTooltip,"default":a.filter.check("table{width}")?500>n.getSize("width")?"100%":500:0,getValue:q,validate:CKEDITOR.dialog.validate.cssLength(a.lang.common.invalidCssLength.replace("%1",a.lang.common.width)),onChange:function(){var a=this.getDialog().getContentElement("advanced","advStyles");a&&
|
||||
a.updateStyle("width",this.getValue())},setup:function(a){this.setValue(a.getStyle("width"))},commit:k}]},{type:"hbox",widths:["5em"],children:[{type:"text",id:"txtHeight",requiredContent:"table{height}",controlStyle:"width:5em",label:a.lang.common.height,title:a.lang.common.cssLengthTooltip,"default":"",getValue:q,validate:CKEDITOR.dialog.validate.cssLength(a.lang.common.invalidCssLength.replace("%1",a.lang.common.height)),onChange:function(){var a=this.getDialog().getContentElement("advanced","advStyles");
|
||||
a&&a.updateStyle("height",this.getValue())},setup:function(a){(a=a.getStyle("height"))&&this.setValue(a)},commit:k}]},{type:"html",html:" "},{type:"text",id:"txtCellSpace",requiredContent:"table[cellspacing]",controlStyle:"width:3em",label:a.lang.table.cellSpace,"default":a.filter.check("table[cellspacing]")?1:0,validate:CKEDITOR.dialog.validate.number(a.lang.table.invalidCellSpacing),setup:function(a){this.setValue(a.getAttribute("cellSpacing")||"")},commit:function(a,d){this.getValue()?d.setAttribute("cellSpacing",
|
||||
this.getValue()):d.removeAttribute("cellSpacing")}},{type:"text",id:"txtCellPad",requiredContent:"table[cellpadding]",controlStyle:"width:3em",label:a.lang.table.cellPad,"default":a.filter.check("table[cellpadding]")?1:0,validate:CKEDITOR.dialog.validate.number(a.lang.table.invalidCellPadding),setup:function(a){this.setValue(a.getAttribute("cellPadding")||"")},commit:function(a,d){this.getValue()?d.setAttribute("cellPadding",this.getValue()):d.removeAttribute("cellPadding")}}]}]},{type:"html",align:"right",
|
||||
html:""},{type:"vbox",padding:0,children:[{type:"text",id:"txtCaption",requiredContent:"caption",label:a.lang.table.caption,setup:function(a){this.enable();a=a.getElementsByTag("caption");if(0<a.count()){var a=a.getItem(0),d=a.getFirst(CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT));d&&!d.equals(a.getBogus())?(this.disable(),this.setValue(a.getText())):(a=CKEDITOR.tools.trim(a.getText()),this.setValue(a))}},commit:function(e,d){if(this.isEnabled()){var c=this.getValue(),b=d.getElementsByTag("caption");
|
||||
if(c)0<b.count()?(b=b.getItem(0),b.setHtml("")):(b=new CKEDITOR.dom.element("caption",a.document),d.getChildCount()?b.insertBefore(d.getFirst()):b.appendTo(d)),b.append(new CKEDITOR.dom.text(c,a.document));else if(0<b.count())for(c=b.count()-1;0<=c;c--)b.getItem(c).remove()}}},{type:"text",id:"txtSummary",bidi:!0,requiredContent:"table[summary]",label:a.lang.table.summary,setup:function(a){this.setValue(a.getAttribute("summary")||"")},commit:function(a,d){this.getValue()?d.setAttribute("summary",
|
||||
this.getValue()):d.removeAttribute("summary")}}]}]},m&&m.createAdvancedTab(a,null,"table")]}}var q=CKEDITOR.tools.cssLength,k=function(a){var e=this.id;a.info||(a.info={});a.info[e]=this.getValue()};CKEDITOR.dialog.add("table",function(a){return n(a,"table")});CKEDITOR.dialog.add("tableProperties",function(a){return n(a,"tableProperties")})})();
|
||||
{type:"vbox",padding:0,children:[{type:"hbox",widths:["5em"],children:[{type:"text",id:"txtWidth",requiredContent:"table{width}",controlStyle:"width:5em",label:a.lang.common.width,title:a.lang.common.cssLengthTooltip,"default":a.filter.check("table{width}")?500>q.getSize("width")?"100%":500:0,getValue:u,validate:CKEDITOR.dialog.validate.cssLength(a.lang.common.invalidCssLength.replace("%1",a.lang.common.width)),onChange:function(){var a=this.getDialog().getContentElement("advanced","advStyles");a&&
|
||||
a.updateStyle("width",this.getValue())},setup:function(a){a=a.getStyle("width");this.setValue(a)},commit:m}]},{type:"hbox",widths:["5em"],children:[{type:"text",id:"txtHeight",requiredContent:"table{height}",controlStyle:"width:5em",label:a.lang.common.height,title:a.lang.common.cssLengthTooltip,"default":"",getValue:u,validate:CKEDITOR.dialog.validate.cssLength(a.lang.common.invalidCssLength.replace("%1",a.lang.common.height)),onChange:function(){var a=this.getDialog().getContentElement("advanced",
|
||||
"advStyles");a&&a.updateStyle("height",this.getValue())},setup:function(a){(a=a.getStyle("height"))&&this.setValue(a)},commit:m}]},{type:"html",html:"\x26nbsp;"},{type:"text",id:"txtCellSpace",requiredContent:"table[cellspacing]",controlStyle:"width:3em",label:a.lang.table.cellSpace,"default":a.filter.check("table[cellspacing]")?1:0,validate:CKEDITOR.dialog.validate.number(a.lang.table.invalidCellSpacing),setup:function(a){this.setValue(a.getAttribute("cellSpacing")||"")},commit:function(a,d){this.getValue()?
|
||||
d.setAttribute("cellSpacing",this.getValue()):d.removeAttribute("cellSpacing")}},{type:"text",id:"txtCellPad",requiredContent:"table[cellpadding]",controlStyle:"width:3em",label:a.lang.table.cellPad,"default":a.filter.check("table[cellpadding]")?1:0,validate:CKEDITOR.dialog.validate.number(a.lang.table.invalidCellPadding),setup:function(a){this.setValue(a.getAttribute("cellPadding")||"")},commit:function(a,d){this.getValue()?d.setAttribute("cellPadding",this.getValue()):d.removeAttribute("cellPadding")}}]}]},
|
||||
{type:"html",align:"right",html:""},{type:"vbox",padding:0,children:[{type:"text",id:"txtCaption",requiredContent:"caption",label:a.lang.table.caption,setup:function(a){this.enable();a=a.getElementsByTag("caption");if(0<a.count()){a=a.getItem(0);var d=a.getFirst(CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT));d&&!d.equals(a.getBogus())?(this.disable(),this.setValue(a.getText())):(a=CKEDITOR.tools.trim(a.getText()),this.setValue(a))}},commit:function(e,d){if(this.isEnabled()){var c=this.getValue(),
|
||||
b=d.getElementsByTag("caption");if(c)0<b.count()?(b=b.getItem(0),b.setHtml("")):(b=new CKEDITOR.dom.element("caption",a.document),d.getChildCount()?b.insertBefore(d.getFirst()):b.appendTo(d)),b.append(new CKEDITOR.dom.text(c,a.document));else if(0<b.count())for(c=b.count()-1;0<=c;c--)b.getItem(c).remove()}}},{type:"text",id:"txtSummary",bidi:!0,requiredContent:"table[summary]",label:a.lang.table.summary,setup:function(a){this.setValue(a.getAttribute("summary")||"")},commit:function(a,d){this.getValue()?
|
||||
d.setAttribute("summary",this.getValue()):d.removeAttribute("summary")}}]}]},p&&p.createAdvancedTab(a,null,"table")]}}var u=CKEDITOR.tools.cssLength,m=function(a){var f=this.id;a.info||(a.info={});a.info[f]=this.getValue()};CKEDITOR.dialog.add("table",function(a){return q(a,"table")});CKEDITOR.dialog.add("tableProperties",function(a){return q(a,"tableProperties")})})();
|
|
@ -2,16 +2,16 @@
|
|||
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||
*/
|
||||
CKEDITOR.dialog.add("cellProperties",function(g){function d(a){return function(b){for(var c=a(b[0]),d=1;d<b.length;d++)if(a(b[d])!==c){c=null;break}"undefined"!=typeof c&&(this.setValue(c),CKEDITOR.env.gecko&&("select"==this.type&&!c)&&(this.getInputElement().$.selectedIndex=-1))}}function j(a){if(a=l.exec(a.getStyle("width")||a.getAttribute("width")))return a[2]}var h=g.lang.table,c=h.cell,e=g.lang.common,i=CKEDITOR.dialog.validate,l=/^(\d+(?:\.\d+)?)(px|%)$/,f={type:"html",html:" "},m="rtl"==
|
||||
g.lang.dir,k=g.plugins.colordialog;return{title:c.title,minWidth:CKEDITOR.env.ie&&CKEDITOR.env.quirks?450:410,minHeight:CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?230:220,contents:[{id:"info",label:c.title,accessKey:"I",elements:[{type:"hbox",widths:["40%","5%","40%"],children:[{type:"vbox",padding:0,children:[{type:"hbox",widths:["70%","30%"],children:[{type:"text",id:"width",width:"100px",label:e.width,validate:i.number(c.invalidWidth),onLoad:function(){var a=this.getDialog().getContentElement("info",
|
||||
"widthType").getElement(),b=this.getInputElement(),c=b.getAttribute("aria-labelledby");b.setAttribute("aria-labelledby",[c,a.$.id].join(" "))},setup:d(function(a){var b=parseInt(a.getAttribute("width"),10),a=parseInt(a.getStyle("width"),10);return!isNaN(a)?a:!isNaN(b)?b:""}),commit:function(a){var b=parseInt(this.getValue(),10),c=this.getDialog().getValueOf("info","widthType")||j(a);isNaN(b)?a.removeStyle("width"):a.setStyle("width",b+c);a.removeAttribute("width")},"default":""},{type:"select",id:"widthType",
|
||||
label:g.lang.table.widthUnit,labelStyle:"visibility:hidden","default":"px",items:[[h.widthPx,"px"],[h.widthPc,"%"]],setup:d(j)}]},{type:"hbox",widths:["70%","30%"],children:[{type:"text",id:"height",label:e.height,width:"100px","default":"",validate:i.number(c.invalidHeight),onLoad:function(){var a=this.getDialog().getContentElement("info","htmlHeightType").getElement(),b=this.getInputElement(),c=b.getAttribute("aria-labelledby");b.setAttribute("aria-labelledby",[c,a.$.id].join(" "))},setup:d(function(a){var b=
|
||||
parseInt(a.getAttribute("height"),10),a=parseInt(a.getStyle("height"),10);return!isNaN(a)?a:!isNaN(b)?b:""}),commit:function(a){var b=parseInt(this.getValue(),10);isNaN(b)?a.removeStyle("height"):a.setStyle("height",CKEDITOR.tools.cssLength(b));a.removeAttribute("height")}},{id:"htmlHeightType",type:"html",html:"<br />"+h.widthPx}]},f,{type:"select",id:"wordWrap",label:c.wordWrap,"default":"yes",items:[[c.yes,"yes"],[c.no,"no"]],setup:d(function(a){var b=a.getAttribute("noWrap");if("nowrap"==a.getStyle("white-space")||
|
||||
b)return"no"}),commit:function(a){"no"==this.getValue()?a.setStyle("white-space","nowrap"):a.removeStyle("white-space");a.removeAttribute("noWrap")}},f,{type:"select",id:"hAlign",label:c.hAlign,"default":"",items:[[e.notSet,""],[e.alignLeft,"left"],[e.alignCenter,"center"],[e.alignRight,"right"],[e.alignJustify,"justify"]],setup:d(function(a){var b=a.getAttribute("align");return a.getStyle("text-align")||b||""}),commit:function(a){var b=this.getValue();b?a.setStyle("text-align",b):a.removeStyle("text-align");
|
||||
a.removeAttribute("align")}},{type:"select",id:"vAlign",label:c.vAlign,"default":"",items:[[e.notSet,""],[e.alignTop,"top"],[e.alignMiddle,"middle"],[e.alignBottom,"bottom"],[c.alignBaseline,"baseline"]],setup:d(function(a){var b=a.getAttribute("vAlign"),a=a.getStyle("vertical-align");switch(a){case "top":case "middle":case "bottom":case "baseline":break;default:a=""}return a||b||""}),commit:function(a){var b=this.getValue();b?a.setStyle("vertical-align",b):a.removeStyle("vertical-align");a.removeAttribute("vAlign")}}]},
|
||||
f,{type:"vbox",padding:0,children:[{type:"select",id:"cellType",label:c.cellType,"default":"td",items:[[c.data,"td"],[c.header,"th"]],setup:d(function(a){return a.getName()}),commit:function(a){a.renameNode(this.getValue())}},f,{type:"text",id:"rowSpan",label:c.rowSpan,"default":"",validate:i.integer(c.invalidRowSpan),setup:d(function(a){if((a=parseInt(a.getAttribute("rowSpan"),10))&&1!=a)return a}),commit:function(a){var b=parseInt(this.getValue(),10);b&&1!=b?a.setAttribute("rowSpan",this.getValue()):
|
||||
a.removeAttribute("rowSpan")}},{type:"text",id:"colSpan",label:c.colSpan,"default":"",validate:i.integer(c.invalidColSpan),setup:d(function(a){if((a=parseInt(a.getAttribute("colSpan"),10))&&1!=a)return a}),commit:function(a){var b=parseInt(this.getValue(),10);b&&1!=b?a.setAttribute("colSpan",this.getValue()):a.removeAttribute("colSpan")}},f,{type:"hbox",padding:0,widths:["60%","40%"],children:[{type:"text",id:"bgColor",label:c.bgColor,"default":"",setup:d(function(a){var b=a.getAttribute("bgColor");
|
||||
return a.getStyle("background-color")||b}),commit:function(a){this.getValue()?a.setStyle("background-color",this.getValue()):a.removeStyle("background-color");a.removeAttribute("bgColor")}},k?{type:"button",id:"bgColorChoose","class":"colorChooser",label:c.chooseColor,onLoad:function(){this.getElement().getParent().setStyle("vertical-align","bottom")},onClick:function(){g.getColorFromDialog(function(a){a&&this.getDialog().getContentElement("info","bgColor").setValue(a);this.focus()},this)}}:f]},f,
|
||||
{type:"hbox",padding:0,widths:["60%","40%"],children:[{type:"text",id:"borderColor",label:c.borderColor,"default":"",setup:d(function(a){var b=a.getAttribute("borderColor");return a.getStyle("border-color")||b}),commit:function(a){this.getValue()?a.setStyle("border-color",this.getValue()):a.removeStyle("border-color");a.removeAttribute("borderColor")}},k?{type:"button",id:"borderColorChoose","class":"colorChooser",label:c.chooseColor,style:(m?"margin-right":"margin-left")+": 10px",onLoad:function(){this.getElement().getParent().setStyle("vertical-align",
|
||||
CKEDITOR.dialog.add("cellProperties",function(g){function d(a){return function(b){for(var c=a(b[0]),d=1;d<b.length;d++)if(a(b[d])!==c){c=null;break}"undefined"!=typeof c&&(this.setValue(c),CKEDITOR.env.gecko&&"select"==this.type&&!c&&(this.getInputElement().$.selectedIndex=-1))}}function l(a){if(a=n.exec(a.getStyle("width")||a.getAttribute("width")))return a[2]}var h=g.lang.table,c=h.cell,e=g.lang.common,k=CKEDITOR.dialog.validate,n=/^(\d+(?:\.\d+)?)(px|%)$/,f={type:"html",html:"\x26nbsp;"},p="rtl"==
|
||||
g.lang.dir,m=g.plugins.colordialog;return{title:c.title,minWidth:CKEDITOR.env.ie&&CKEDITOR.env.quirks?450:410,minHeight:CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?230:220,contents:[{id:"info",label:c.title,accessKey:"I",elements:[{type:"hbox",widths:["40%","5%","40%"],children:[{type:"vbox",padding:0,children:[{type:"hbox",widths:["70%","30%"],children:[{type:"text",id:"width",width:"100px",label:e.width,validate:k.number(c.invalidWidth),onLoad:function(){var a=this.getDialog().getContentElement("info",
|
||||
"widthType").getElement(),b=this.getInputElement(),c=b.getAttribute("aria-labelledby");b.setAttribute("aria-labelledby",[c,a.$.id].join(" "))},setup:d(function(a){var b=parseInt(a.getAttribute("width"),10);a=parseInt(a.getStyle("width"),10);return isNaN(a)?isNaN(b)?"":b:a}),commit:function(a){var b=parseInt(this.getValue(),10),c=this.getDialog().getValueOf("info","widthType")||l(a);isNaN(b)?a.removeStyle("width"):a.setStyle("width",b+c);a.removeAttribute("width")},"default":""},{type:"select",id:"widthType",
|
||||
label:g.lang.table.widthUnit,labelStyle:"visibility:hidden","default":"px",items:[[h.widthPx,"px"],[h.widthPc,"%"]],setup:d(l)}]},{type:"hbox",widths:["70%","30%"],children:[{type:"text",id:"height",label:e.height,width:"100px","default":"",validate:k.number(c.invalidHeight),onLoad:function(){var a=this.getDialog().getContentElement("info","htmlHeightType").getElement(),b=this.getInputElement(),c=b.getAttribute("aria-labelledby");b.setAttribute("aria-labelledby",[c,a.$.id].join(" "))},setup:d(function(a){var b=
|
||||
parseInt(a.getAttribute("height"),10);a=parseInt(a.getStyle("height"),10);return isNaN(a)?isNaN(b)?"":b:a}),commit:function(a){var b=parseInt(this.getValue(),10);isNaN(b)?a.removeStyle("height"):a.setStyle("height",CKEDITOR.tools.cssLength(b));a.removeAttribute("height")}},{id:"htmlHeightType",type:"html",html:"\x3cbr /\x3e"+h.widthPx}]},f,{type:"select",id:"wordWrap",label:c.wordWrap,"default":"yes",items:[[c.yes,"yes"],[c.no,"no"]],setup:d(function(a){var b=a.getAttribute("noWrap");if("nowrap"==
|
||||
a.getStyle("white-space")||b)return"no"}),commit:function(a){"no"==this.getValue()?a.setStyle("white-space","nowrap"):a.removeStyle("white-space");a.removeAttribute("noWrap")}},f,{type:"select",id:"hAlign",label:c.hAlign,"default":"",items:[[e.notSet,""],[e.alignLeft,"left"],[e.alignCenter,"center"],[e.alignRight,"right"],[e.alignJustify,"justify"]],setup:d(function(a){var b=a.getAttribute("align");return a.getStyle("text-align")||b||""}),commit:function(a){var b=this.getValue();b?a.setStyle("text-align",
|
||||
b):a.removeStyle("text-align");a.removeAttribute("align")}},{type:"select",id:"vAlign",label:c.vAlign,"default":"",items:[[e.notSet,""],[e.alignTop,"top"],[e.alignMiddle,"middle"],[e.alignBottom,"bottom"],[c.alignBaseline,"baseline"]],setup:d(function(a){var b=a.getAttribute("vAlign");a=a.getStyle("vertical-align");switch(a){case "top":case "middle":case "bottom":case "baseline":break;default:a=""}return a||b||""}),commit:function(a){var b=this.getValue();b?a.setStyle("vertical-align",b):a.removeStyle("vertical-align");
|
||||
a.removeAttribute("vAlign")}}]},f,{type:"vbox",padding:0,children:[{type:"select",id:"cellType",label:c.cellType,"default":"td",items:[[c.data,"td"],[c.header,"th"]],setup:d(function(a){return a.getName()}),commit:function(a){a.renameNode(this.getValue())}},f,{type:"text",id:"rowSpan",label:c.rowSpan,"default":"",validate:k.integer(c.invalidRowSpan),setup:d(function(a){if((a=parseInt(a.getAttribute("rowSpan"),10))&&1!=a)return a}),commit:function(a){var b=parseInt(this.getValue(),10);b&&1!=b?a.setAttribute("rowSpan",
|
||||
this.getValue()):a.removeAttribute("rowSpan")}},{type:"text",id:"colSpan",label:c.colSpan,"default":"",validate:k.integer(c.invalidColSpan),setup:d(function(a){if((a=parseInt(a.getAttribute("colSpan"),10))&&1!=a)return a}),commit:function(a){var b=parseInt(this.getValue(),10);b&&1!=b?a.setAttribute("colSpan",this.getValue()):a.removeAttribute("colSpan")}},f,{type:"hbox",padding:0,widths:["60%","40%"],children:[{type:"text",id:"bgColor",label:c.bgColor,"default":"",setup:d(function(a){var b=a.getAttribute("bgColor");
|
||||
return a.getStyle("background-color")||b}),commit:function(a){this.getValue()?a.setStyle("background-color",this.getValue()):a.removeStyle("background-color");a.removeAttribute("bgColor")}},m?{type:"button",id:"bgColorChoose","class":"colorChooser",label:c.chooseColor,onLoad:function(){this.getElement().getParent().setStyle("vertical-align","bottom")},onClick:function(){g.getColorFromDialog(function(a){a&&this.getDialog().getContentElement("info","bgColor").setValue(a);this.focus()},this)}}:f]},f,
|
||||
{type:"hbox",padding:0,widths:["60%","40%"],children:[{type:"text",id:"borderColor",label:c.borderColor,"default":"",setup:d(function(a){var b=a.getAttribute("borderColor");return a.getStyle("border-color")||b}),commit:function(a){this.getValue()?a.setStyle("border-color",this.getValue()):a.removeStyle("border-color");a.removeAttribute("borderColor")}},m?{type:"button",id:"borderColorChoose","class":"colorChooser",label:c.chooseColor,style:(p?"margin-right":"margin-left")+": 10px",onLoad:function(){this.getElement().getParent().setStyle("vertical-align",
|
||||
"bottom")},onClick:function(){g.getColorFromDialog(function(a){a&&this.getDialog().getContentElement("info","borderColor").setValue(a);this.focus()},this)}}:f]}]}]}]}],onShow:function(){this.cells=CKEDITOR.plugins.tabletools.getSelectedCells(this._.editor.getSelection());this.setupContent(this.cells)},onOk:function(){for(var a=this._.editor.getSelection(),b=a.createBookmarks(),c=this.cells,d=0;d<c.length;d++)this.commitContent(c[d]);this._.editor.forceNextSelectionCheck();a.selectBookmarks(b);this._.editor.selectionChange()},
|
||||
onLoad:function(){var a={};this.foreach(function(b){b.setup&&b.commit&&(b.setup=CKEDITOR.tools.override(b.setup,function(c){return function(){c.apply(this,arguments);a[b.id]=b.getValue()}}),b.commit=CKEDITOR.tools.override(b.commit,function(c){return function(){a[b.id]!==b.getValue()&&c.apply(this,arguments)}}))})}}});
|
|
@ -34,6 +34,8 @@
|
|||
"require-dev": {
|
||||
"behat/mink": "~1.6",
|
||||
"behat/mink-goutte-driver": "~1.2",
|
||||
"jcalderonzumba/gastonjs": "^1.1@dev",
|
||||
"jcalderonzumba/mink-phantomjs-driver": "dev-master#10d7c48c9a4129463052321b52450d98983c4332",
|
||||
"mikey179/vfsStream": "~1.2",
|
||||
"phpunit/phpunit": "~4.8",
|
||||
"symfony/css-selector": "2.7.*"
|
||||
|
@ -88,6 +90,7 @@
|
|||
"drupal/help": "self.version",
|
||||
"drupal/history": "self.version",
|
||||
"drupal/image": "self.version",
|
||||
"drupal/inline_form_errors": "self.version",
|
||||
"drupal/language": "self.version",
|
||||
"drupal/link": "self.version",
|
||||
"drupal/locale": "self.version",
|
||||
|
|
|
@ -24,10 +24,10 @@ classList:
|
|||
|
||||
ckeditor:
|
||||
remote: https://github.com/ckeditor/ckeditor-dev
|
||||
version: "4.5.3"
|
||||
version: "4.5.4"
|
||||
license:
|
||||
name: GNU-GPL-2.0-or-later
|
||||
url: https://github.com/ckeditor/ckeditor-dev/blob/4.5.3/LICENSE.md
|
||||
url: https://github.com/ckeditor/ckeditor-dev/blob/4.5.4/LICENSE.md
|
||||
gpl-compatible: true
|
||||
js:
|
||||
assets/vendor/ckeditor/ckeditor.js: { preprocess: false, minified: true }
|
||||
|
@ -145,6 +145,7 @@ drupal.date:
|
|||
dependencies:
|
||||
- core/drupal
|
||||
- core/modernizr
|
||||
- core/jquery.once
|
||||
- core/jquery.ui.datepicker
|
||||
|
||||
drupal.debounce:
|
||||
|
|
|
@ -496,10 +496,37 @@ services:
|
|||
arguments: ['@theme_handler', '@config.factory', '@config.installer', '@module_handler', '@config.manager', '@asset.css.collection_optimizer', '@router.builder', '@logger.channel.default', '@state']
|
||||
entity.manager:
|
||||
class: Drupal\Core\Entity\EntityManager
|
||||
arguments: ['@container.namespaces', '@module_handler', '@cache.discovery', '@language_manager', '@string_translation', '@class_resolver', '@typed_data_manager', '@keyvalue', '@event_dispatcher']
|
||||
parent: container.trait
|
||||
# @todo Remove this tag in https://www.drupal.org/node/2549143.
|
||||
tags:
|
||||
- { name: plugin_manager_cache_clear }
|
||||
entity_type.manager:
|
||||
class: Drupal\Core\Entity\EntityTypeManager
|
||||
arguments: ['@container.namespaces', '@module_handler', '@cache.discovery', '@string_translation', '@class_resolver']
|
||||
parent: container.trait
|
||||
tags:
|
||||
- { name: plugin_manager_cache_clear }
|
||||
entity_type.repository:
|
||||
class: Drupal\Core\Entity\EntityTypeRepository
|
||||
arguments: ['@entity_type.manager']
|
||||
entity_type.bundle.info:
|
||||
class: Drupal\Core\Entity\EntityTypeBundleInfo
|
||||
arguments: ['@entity_type.manager', '@language_manager', '@module_handler', '@typed_data_manager', '@cache.discovery']
|
||||
entity.repository:
|
||||
class: Drupal\Core\Entity\EntityRepository
|
||||
arguments: ['@entity_type.manager', '@language_manager']
|
||||
entity_display.repository:
|
||||
class: Drupal\Core\Entity\EntityDisplayRepository
|
||||
arguments: ['@entity_type.manager', '@module_handler', '@cache.discovery', '@language_manager']
|
||||
entity_field.manager:
|
||||
class: Drupal\Core\Entity\EntityFieldManager
|
||||
arguments: ['@entity_type.manager', '@entity_type.bundle.info', '@entity_display.repository', '@typed_data_manager', '@language_manager', '@keyvalue', '@module_handler', '@cache.discovery']
|
||||
entity_type.listener:
|
||||
class: Drupal\Core\Entity\EntityTypeListener
|
||||
arguments: ['@entity_type.manager', '@entity_field.manager', '@event_dispatcher', '@entity.last_installed_schema.repository']
|
||||
entity_bundle.listener:
|
||||
class: Drupal\Core\Entity\EntityBundleListener
|
||||
arguments: ['@entity_type.manager', '@entity_type.bundle.info', '@entity_field.manager', '@module_handler']
|
||||
entity_route_subscriber:
|
||||
class: Drupal\Core\EventSubscriber\EntityRouteProviderSubscriber
|
||||
arguments: ['@entity.manager']
|
||||
|
@ -508,6 +535,15 @@ services:
|
|||
entity.definition_update_manager:
|
||||
class: Drupal\Core\Entity\EntityDefinitionUpdateManager
|
||||
arguments: ['@entity.manager']
|
||||
entity.last_installed_schema.repository:
|
||||
class: Drupal\Core\Entity\EntityLastInstalledSchemaRepository
|
||||
arguments: ['@keyvalue']
|
||||
field_storage_definition.listener:
|
||||
class: Drupal\Core\Field\FieldStorageDefinitionListener
|
||||
arguments: ['@entity_type.manager', '@event_dispatcher', '@entity.last_installed_schema.repository', '@entity_field.manager']
|
||||
field_definition.listener:
|
||||
class: Drupal\Core\Field\FieldDefinitionListener
|
||||
arguments: ['@entity_type.manager', '@entity_field.manager', '@keyvalue', '@cache.discovery']
|
||||
entity.form_builder:
|
||||
class: Drupal\Core\Entity\EntityFormBuilder
|
||||
arguments: ['@entity.manager', '@form_builder']
|
||||
|
@ -1424,7 +1460,7 @@ services:
|
|||
class: Drupal\Core\Asset\AssetDumper
|
||||
library.discovery:
|
||||
class: Drupal\Core\Asset\LibraryDiscovery
|
||||
arguments: ['@library.discovery.collector', '@cache_tags.invalidator']
|
||||
arguments: ['@library.discovery.collector']
|
||||
library.discovery.collector:
|
||||
class: Drupal\Core\Asset\LibraryDiscoveryCollector
|
||||
arguments: ['@cache.discovery', '@lock', '@library.discovery.parser', '@theme.manager']
|
||||
|
|
|
@ -200,7 +200,6 @@ function drupal_get_filename($type, $name, $filename = NULL) {
|
|||
|
||||
// Profiles are converted into modules in system_rebuild_module_data().
|
||||
// @todo Remove false-exposure of profiles as modules.
|
||||
$original_type = $type;
|
||||
if ($type == 'profile') {
|
||||
$type = 'module';
|
||||
}
|
||||
|
@ -258,56 +257,39 @@ function drupal_get_path($type, $name) {
|
|||
/**
|
||||
* Translates a string to the current language or to a given language.
|
||||
*
|
||||
* The t() function serves two purposes. First, at run-time it translates
|
||||
* user-visible text into the appropriate language. Second, various mechanisms
|
||||
* that figure out what text needs to be translated work off t() -- the text
|
||||
* inside t() calls is added to the database of strings to be translated.
|
||||
* These strings are expected to be in English, so the first argument should
|
||||
* always be in English. To enable a fully-translatable site, it is important
|
||||
* that all human-readable text that will be displayed on the site or sent to
|
||||
* a user is passed through the t() function, or a related function. See the
|
||||
* @link https://www.drupal.org/node/322729 Localization API @endlink pages for
|
||||
* more information, including recommendations on how to break up or not
|
||||
* break up strings for translation.
|
||||
* In order for strings to be localized, make them available in one of the ways
|
||||
* supported by the
|
||||
* @link https://www.drupal.org/node/322729 Localization API @endlink. When
|
||||
* possible, use the \Drupal\Core\StringTranslation\StringTranslationTrait
|
||||
* $this->t(). Otherwise create a new
|
||||
* \Drupal\Core\StringTranslation\TranslatableMarkup object directly.
|
||||
*
|
||||
* @section sec_translating_vars Translating Variables
|
||||
* You should never use t() to translate variables, such as calling t($text)
|
||||
* unless the text that the variable holds has been passed through t()
|
||||
* elsewhere (e.g., $text is one of several translated literal strings in an
|
||||
* array). It is especially important never to call t($user_text) where
|
||||
* $user_text is some text that a user entered - doing that can lead to
|
||||
* cross-site scripting and other security problems. However, you can use
|
||||
* variable substitution in your string, to put variable text such as user
|
||||
* names or link URLs into translated text. Variable substitution looks like
|
||||
* this:
|
||||
* @code
|
||||
* $text = t("@name's blog", array('@name' => $account->getDisplayName()));
|
||||
* @endcode
|
||||
* Basically, you can put variables like @name into your string, and t() will
|
||||
* substitute their sanitized values at translation time. (See the
|
||||
* Localization API pages referenced above and the documentation of
|
||||
* \Drupal\Component\Utility\SafeMarkup::format() for details about how to
|
||||
* define variables in your string.). Translators can then rearrange the string
|
||||
* as necessary for the language (e.g., in Spanish, it might be "blog de
|
||||
* @name").
|
||||
* See \Drupal\Core\StringTranslation\TranslatableMarkup::__construct() for
|
||||
* important security information and usage guidelines.
|
||||
*
|
||||
* @param $string
|
||||
* A string containing the English string to translate.
|
||||
* @param $args
|
||||
* An associative array of replacements to make after translation. Based
|
||||
* on the first character of the key, the value is escaped and/or themed.
|
||||
* See \Drupal\Component\Utility\SafeMarkup::format() for details.
|
||||
* @param $options
|
||||
* An associative array of additional options, with the following elements:
|
||||
* - 'langcode' (defaults to the current language): The language code to
|
||||
* @param string $string
|
||||
* A string containing the English text to translate.
|
||||
* @param array $args
|
||||
* (optional) An associative array of replacements to make after translation.
|
||||
* Based on the first character of the key, the value is escaped and/or
|
||||
* themed. See
|
||||
* \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for
|
||||
* details.
|
||||
* @param array $options
|
||||
* (optional) An associative array of additional options, with the following
|
||||
* elements:
|
||||
* - 'langcode' (defaults to the current language): A language code, to
|
||||
* translate to a language other than what is used to display the page.
|
||||
* - 'context' (defaults to the empty context): The context the source string
|
||||
* belongs to.
|
||||
*
|
||||
* @return
|
||||
* The translated string.
|
||||
* @return \Drupal\Core\StringTranslation\TranslatableMarkup
|
||||
* An object that, when cast to a string, returns the translated string.
|
||||
*
|
||||
* @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat()
|
||||
* @see \Drupal\Core\StringTranslation\StringTranslationTrait::t()
|
||||
* @see \Drupal\Core\StringTranslation\TranslatableMarkup::__construct()
|
||||
*
|
||||
* @see \Drupal\Component\Utility\SafeMarkup::format()
|
||||
* @ingroup sanitization
|
||||
*/
|
||||
function t($string, array $args = array(), array $options = array()) {
|
||||
|
@ -349,7 +331,7 @@ function format_string($string, array $args) {
|
|||
* @param $text
|
||||
* The text to check.
|
||||
*
|
||||
* @return
|
||||
* @return bool
|
||||
* TRUE if the text is valid UTF-8, FALSE if not.
|
||||
*
|
||||
* @see \Drupal\Component\Utility\Unicode::validateUtf8()
|
||||
|
@ -582,7 +564,7 @@ function _drupal_exception_handler($exception) {
|
|||
catch (\Throwable $error) {
|
||||
_drupal_exception_handler_additional($exception, $error);
|
||||
}
|
||||
// In order to be compatibile with PHP 5 we also catch regular Exceptions.
|
||||
// In order to be compatible with PHP 5 we also catch regular Exceptions.
|
||||
catch (\Exception $exception2) {
|
||||
_drupal_exception_handler_additional($exception, $exception2);
|
||||
}
|
||||
|
@ -998,7 +980,7 @@ function _drupal_shutdown_function() {
|
|||
catch (\Throwable $error) {
|
||||
_drupal_shutdown_function_handle_exception($error);
|
||||
}
|
||||
// In order to be compatibile with PHP 5 we also catch regular Exceptions.
|
||||
// In order to be compatible with PHP 5 we also catch regular Exceptions.
|
||||
catch (\Exception $exception) {
|
||||
_drupal_shutdown_function_handle_exception($exception);
|
||||
}
|
||||
|
|
|
@ -884,6 +884,10 @@ function drupal_render(&$elements, $is_recursive_call = FALSE) {
|
|||
* @return string|\Drupal\Component\Render\MarkupInterface
|
||||
* The rendered HTML of all children of the element.
|
||||
*
|
||||
* @deprecated in Drupal 8.0.x and will be removed before 9.0.0. Avoid early
|
||||
* rendering when possible or loop through the elements and render them as
|
||||
* they are available.
|
||||
*
|
||||
* @see drupal_render()
|
||||
*/
|
||||
function drupal_render_children(&$element, $children_keys = NULL) {
|
||||
|
|
|
@ -156,7 +156,7 @@ function file_default_scheme() {
|
|||
* The normalized URI.
|
||||
*/
|
||||
function file_stream_wrapper_uri_normalize($uri) {
|
||||
$scheme = file_uri_scheme($uri);
|
||||
$scheme = \Drupal::service('file_system')->uriScheme($uri);
|
||||
|
||||
if (file_stream_wrapper_valid_scheme($scheme)) {
|
||||
$target = file_uri_target($uri);
|
||||
|
@ -199,7 +199,7 @@ function file_create_url($uri) {
|
|||
// file server.
|
||||
\Drupal::moduleHandler()->alter('file_url', $uri);
|
||||
|
||||
$scheme = file_uri_scheme($uri);
|
||||
$scheme = \Drupal::service('file_system')->uriScheme($uri);
|
||||
|
||||
if (!$scheme) {
|
||||
// Allow for:
|
||||
|
@ -266,7 +266,6 @@ function file_url_transform_relative($file_url) {
|
|||
// Unfortunately, we pretty much have to duplicate Symfony's
|
||||
// Request::getHttpHost() method because Request::getPort() may return NULL
|
||||
// instead of a port number.
|
||||
$http_host = '';
|
||||
$request = \Drupal::request();
|
||||
$host = $request->getHost();
|
||||
$scheme = $request->getScheme();
|
||||
|
@ -300,7 +299,7 @@ function file_url_transform_relative($file_url) {
|
|||
* otherwise.
|
||||
*/
|
||||
function file_prepare_directory(&$directory, $options = FILE_MODIFY_PERMISSIONS) {
|
||||
if (!file_stream_wrapper_valid_scheme(file_uri_scheme($directory))) {
|
||||
if (!file_stream_wrapper_valid_scheme(\Drupal::service('file_system')->uriScheme($directory))) {
|
||||
// Only trim if we're not dealing with a stream.
|
||||
$directory = rtrim($directory, '/\\');
|
||||
}
|
||||
|
@ -349,7 +348,7 @@ function file_ensure_htaccess() {
|
|||
* if one is already present. Defaults to FALSE.
|
||||
*/
|
||||
function file_save_htaccess($directory, $private = TRUE, $force_overwrite = FALSE) {
|
||||
if (file_uri_scheme($directory)) {
|
||||
if (\Drupal::service('file_system')->uriScheme($directory)) {
|
||||
$htaccess_path = file_stream_wrapper_uri_normalize($directory . '/.htaccess');
|
||||
}
|
||||
else {
|
||||
|
@ -407,7 +406,7 @@ function file_htaccess_lines($private = TRUE) {
|
|||
*/
|
||||
function file_valid_uri($uri) {
|
||||
// Assert that the URI has an allowed scheme. Bare paths are not allowed.
|
||||
$uri_scheme = file_uri_scheme($uri);
|
||||
$uri_scheme = \Drupal::service('file_system')->uriScheme($uri);
|
||||
if (!file_stream_wrapper_valid_scheme($uri_scheme)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -210,7 +210,6 @@ function drupal_get_database_types() {
|
|||
* @endcode
|
||||
* gets dumped as:
|
||||
* @code
|
||||
* $config_directories['active'] = 'config_hash/active';
|
||||
* $config_directories['sync'] = 'config_hash/sync'
|
||||
* @endcode
|
||||
*/
|
||||
|
@ -524,8 +523,7 @@ function drupal_install_config_directories() {
|
|||
* Ensures that the config directory exists and is writable, or can be made so.
|
||||
*
|
||||
* @param string $type
|
||||
* Type of config directory to return. Drupal core provides 'active' and
|
||||
* 'sync'.
|
||||
* Type of config directory to return. Drupal core provides 'sync'.
|
||||
*
|
||||
* @return bool
|
||||
* TRUE if the config directory exists and is writable.
|
||||
|
|
|
@ -10,18 +10,18 @@ use Drupal\Component\Utility\UrlHelper;
|
|||
/**
|
||||
* Returns the current page being requested for display within a pager.
|
||||
*
|
||||
* @param $element
|
||||
* An optional integer to distinguish between multiple pagers on one page.
|
||||
* @param int $element
|
||||
* (optional) An integer to distinguish between multiple pagers on one page.
|
||||
*
|
||||
* @return
|
||||
* The number of the current requested page, within the pager represented by
|
||||
* $element. This is determined from the URL query parameter
|
||||
* \Drupal::request()->query->get('page'), or 0 by default. Note that this
|
||||
* number may differ from the actual page being displayed. For example, if a
|
||||
* search for "example text" brings up three pages of results, but a users
|
||||
* visits search/node/example+text?page=10, this function will return 10, even
|
||||
* though the default pager implementation adjusts for this and still displays
|
||||
* the third page of search results at that URL.
|
||||
* @return int
|
||||
* The number of the current requested page, within the pager represented by
|
||||
* $element. This is determined from the URL query parameter
|
||||
* \Drupal::request()->query->get('page'), or 0 by default. Note that this
|
||||
* number may differ from the actual page being displayed. For example, if a
|
||||
* search for "example text" brings up three pages of results, but a user
|
||||
* visits search/node/example+text?page=10, this function will return 10,
|
||||
* even though the default pager implementation adjusts for this and still
|
||||
* displays the third page of search results at that URL.
|
||||
*
|
||||
* @see pager_default_initialize()
|
||||
*/
|
||||
|
@ -35,11 +35,11 @@ function pager_find_page($element = 0) {
|
|||
}
|
||||
|
||||
/**
|
||||
* Initializes a pager for _theme('pager').
|
||||
* Initializes a pager.
|
||||
*
|
||||
* This function sets up the necessary global variables so that future calls
|
||||
* to _theme('pager') will render a pager that correctly corresponds to the
|
||||
* items being displayed.
|
||||
* This function sets up the necessary global variables so that the render
|
||||
* system will correctly process #type 'pager' render arrays to output pagers
|
||||
* that correspond to the items being displayed.
|
||||
*
|
||||
* If the items being displayed result from a database query performed using
|
||||
* Drupal's database API, and if you have control over the construction of the
|
||||
|
@ -54,7 +54,7 @@ function pager_find_page($element = 0) {
|
|||
* However, if you are using a different method for generating the items to be
|
||||
* paged through, then you should call this function in preparation.
|
||||
*
|
||||
* The following example shows how this function can be used in a page callback
|
||||
* The following example shows how this function can be used in a controller
|
||||
* that invokes an external datastore with an SQL-like syntax:
|
||||
* @code
|
||||
* // First find the total number of items and initialize the pager.
|
||||
|
@ -63,21 +63,22 @@ function pager_find_page($element = 0) {
|
|||
* $num_per_page = \Drupal::config('mymodule.settings')->get('num_per_page');
|
||||
* $page = pager_default_initialize($total, $num_per_page);
|
||||
*
|
||||
* // Next, retrieve and display the items for the current page.
|
||||
* // Next, retrieve the items for the current page and put them into a
|
||||
* // render array.
|
||||
* $offset = $num_per_page * $page;
|
||||
* $result = mymodule_select("SELECT * FROM data " . $where . " LIMIT %d, %d", $offset, $num_per_page)->fetchAll();
|
||||
* $output = drupal_render(
|
||||
* $render = [];
|
||||
* $render[] = [
|
||||
* '#theme' => 'mymodule_results',
|
||||
* '#result' => $result,
|
||||
* );
|
||||
* ];
|
||||
*
|
||||
* // Finally, display the pager controls, and return.
|
||||
* $pager = array('#type' => 'pager');
|
||||
* $output .= drupal_render($pager);
|
||||
* return $output;
|
||||
* // Finally, add the pager to the render array, and return.
|
||||
* $render[] = ['#type' => 'pager'];
|
||||
* return $render;
|
||||
* @endcode
|
||||
*
|
||||
* A second example involves a page callback that invokes an external search
|
||||
* A second example involves a controller that invokes an external search
|
||||
* service where the total number of matching results is provided as part of
|
||||
* the returned set (so that we do not need a separate query in order to obtain
|
||||
* this information). Here, we call pager_find_page() to calculate the desired
|
||||
|
@ -95,28 +96,27 @@ function pager_find_page($element = 0) {
|
|||
* // Now that we have the total number of results, initialize the pager.
|
||||
* pager_default_initialize($result->total, $num_per_page);
|
||||
*
|
||||
* // Display the search results.
|
||||
* $search_results = array(
|
||||
* // Create a render array with the search results.
|
||||
* $render = [];
|
||||
* $render[] = [
|
||||
* '#theme' => 'search_results',
|
||||
* '#results' => $result->data,
|
||||
* '#type' => 'remote',
|
||||
* );
|
||||
* $output = drupal_render($search_results);
|
||||
* ];
|
||||
*
|
||||
* // Finally, display the pager controls, and return.
|
||||
* $pager = array('#type' => 'pager');
|
||||
* $output .= drupal_render($pager);
|
||||
* return $output;
|
||||
* // Finally, add the pager to the render array, and return.
|
||||
* $render[] = ['#type' => 'pager'];
|
||||
* return $render;
|
||||
* @endcode
|
||||
*
|
||||
* @param $total
|
||||
* The total number of items to be paged.
|
||||
* @param $limit
|
||||
* The number of items the calling code will display per page.
|
||||
* @param $element
|
||||
* An optional integer to distinguish between multiple pagers on one page.
|
||||
* @param int $total
|
||||
* The total number of items to be paged.
|
||||
* @param int $limit
|
||||
* The number of items the calling code will display per page.
|
||||
* @param int $element
|
||||
* (optional) An integer to distinguish between multiple pagers on one page.
|
||||
*
|
||||
* @return
|
||||
* @return int
|
||||
* The number of the current page, within the pager represented by $element.
|
||||
* This is determined from the URL query parameter
|
||||
* \Drupal::request()->query->get('page), or 0 by default. However, if a page
|
||||
|
@ -140,7 +140,7 @@ function pager_default_initialize($total, $limit, $element = 0) {
|
|||
/**
|
||||
* Compose a URL query parameter array for pager links.
|
||||
*
|
||||
* @return
|
||||
* @return array
|
||||
* A URL query parameter array that consists of all components of the current
|
||||
* page request except for those pertaining to paging.
|
||||
*/
|
||||
|
@ -284,18 +284,23 @@ function template_preprocess_pager(&$variables) {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get the query parameter array of a pager link.
|
||||
* Gets the URL query parameter array of a pager link.
|
||||
*
|
||||
* Adds or adjusts the 'page' parameter to make sure that, following the link,
|
||||
* the requested $page for the given $element is displayed.
|
||||
* The 'page' parameter is a comma-delimited string, where each value is the
|
||||
* target page for the corresponding pager $element.
|
||||
* Adds to or adjusts the 'page' URL query parameter so that if you follow the
|
||||
* link, you'll get page $index for pager $element on the page.
|
||||
*
|
||||
* The 'page' URL query parameter is a comma-delimited string, where each value
|
||||
* is the target content page for the corresponding pager $element. For
|
||||
* instance, if we have 5 pagers on a single page, and we want to have a link
|
||||
* to a page that should display the 6th content page for the 3rd pager, and
|
||||
* the 1st content page for all the other pagers, then the URL query will look
|
||||
* like this: ?page=0,0,5,0,0 (page numbering starts at zero).
|
||||
*
|
||||
* @param array $query
|
||||
* An associative array of query parameters to add to.
|
||||
* @param integer $element
|
||||
* An associative array of URL query parameters to add to.
|
||||
* @param int $element
|
||||
* An integer to distinguish between multiple pagers on one page.
|
||||
* @param integer $index
|
||||
* @param int $index
|
||||
* The index of the target page, for the given element, in the pager array.
|
||||
*
|
||||
* @return array
|
||||
|
|
|
@ -863,9 +863,6 @@ function template_preprocess_image(&$variables) {
|
|||
* rows.
|
||||
*/
|
||||
function template_preprocess_table(&$variables) {
|
||||
$is_sticky = !empty($variables['sticky']);
|
||||
$is_responsive = !empty($variables['responsive']);
|
||||
|
||||
// Format the table columns:
|
||||
if (!empty($variables['colgroups'])) {
|
||||
foreach ($variables['colgroups'] as &$colgroup) {
|
||||
|
|
|
@ -81,7 +81,7 @@ class Drupal {
|
|||
/**
|
||||
* The current system version.
|
||||
*/
|
||||
const VERSION = '8.0.0-rc2';
|
||||
const VERSION = '8.0.0-rc3';
|
||||
|
||||
/**
|
||||
* Core API compatibility.
|
||||
|
@ -120,9 +120,9 @@ class Drupal {
|
|||
/**
|
||||
* Returns the currently active global container.
|
||||
*
|
||||
* @throws \Drupal\Core\DependencyInjection\ContainerNotInitializedException
|
||||
*
|
||||
* @return \Symfony\Component\DependencyInjection\ContainerInterface|null
|
||||
*
|
||||
* @throws \Drupal\Core\DependencyInjection\ContainerNotInitializedException
|
||||
*/
|
||||
public static function getContainer() {
|
||||
if (static::$container === NULL) {
|
||||
|
@ -150,6 +150,7 @@ class Drupal {
|
|||
*
|
||||
* @param string $id
|
||||
* The ID of the service to retrieve.
|
||||
*
|
||||
* @return mixed
|
||||
* The specified service.
|
||||
*/
|
||||
|
@ -517,6 +518,10 @@ class Drupal {
|
|||
* @see \Drupal\Core\Url
|
||||
* @see \Drupal\Core\Url::fromRoute()
|
||||
* @see \Drupal\Core\Url::fromUri()
|
||||
*
|
||||
* @deprecated as of Drupal 8.0.x, will be removed before Drupal 9.0.0.
|
||||
* Instead create a \Drupal\Core\Url object directly, for example using
|
||||
* Url::fromRoute().
|
||||
*/
|
||||
public static function url($route_name, $route_parameters = array(), $options = array(), $collect_bubbleable_metadata = FALSE) {
|
||||
return static::getContainer()->get('url_generator')->generateFromRoute($route_name, $route_parameters, $options, $collect_bubbleable_metadata);
|
||||
|
|
|
@ -26,7 +26,7 @@ class MockFileFinder implements ClassFinderInterface {
|
|||
protected $filename;
|
||||
|
||||
/**
|
||||
* Implements Doctrine\Common\Reflection\ClassFinderInterface::findFile().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function findFile($class) {
|
||||
return $this->filename;
|
||||
|
|
|
@ -71,7 +71,7 @@ class ContainerAwareEventDispatcher implements EventDispatcherInterface {
|
|||
/**
|
||||
* Constructs a container aware event dispatcher.
|
||||
*
|
||||
* @param \Symfony\Component\EventDispatcher\IntrospectableContainerInterface $container
|
||||
* @param \Symfony\Component\DependencyInjection\IntrospectableContainerInterface $container
|
||||
* The service container.
|
||||
* @param array $listeners
|
||||
* A nested array of listener definitions keyed by event name and priority.
|
||||
|
|
|
@ -27,7 +27,7 @@ class PoMemoryWriter implements PoWriterInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Component\Gettext\PoWriterInterface::writeItem().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function writeItem(PoItem $item) {
|
||||
if (is_array($item->getSource())) {
|
||||
|
@ -39,7 +39,7 @@ class PoMemoryWriter implements PoWriterInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Component\Gettext\PoWriterInterface::writeItems().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function writeItems(PoReaderInterface $reader, $count = -1) {
|
||||
$forever = $count == -1;
|
||||
|
|
|
@ -103,21 +103,21 @@ class PoStreamReader implements PoStreamInterface, PoReaderInterface {
|
|||
private $_errors;
|
||||
|
||||
/**
|
||||
* Implements Drupal\Component\Gettext\PoMetadataInterface::getLangcode().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getLangcode() {
|
||||
return $this->_langcode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Component\Gettext\PoMetadataInterface::setLangcode().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setLangcode($langcode) {
|
||||
$this->_langcode = $langcode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Component\Gettext\PoMetadataInterface::getHeader().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getHeader() {
|
||||
return $this->_header;
|
||||
|
@ -132,14 +132,14 @@ class PoStreamReader implements PoStreamInterface, PoReaderInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Component\Gettext\PoStreamInterface::getURI().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getURI() {
|
||||
return $this->_uri;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Component\Gettext\PoStreamInterface::setURI().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setURI($uri) {
|
||||
$this->_uri = $uri;
|
||||
|
@ -180,7 +180,7 @@ class PoStreamReader implements PoStreamInterface, PoReaderInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Component\Gettext\PoReaderInterface::readItem().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function readItem() {
|
||||
// Clear out the last item.
|
||||
|
|
|
@ -74,7 +74,7 @@ class PoStreamWriter implements PoWriterInterface, PoStreamInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Component\Gettext\PoStreamInterface::open().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function open() {
|
||||
// Open in write mode. Will overwrite the stream if it already exists.
|
||||
|
@ -123,14 +123,14 @@ class PoStreamWriter implements PoWriterInterface, PoStreamInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Component\Gettext\PoWriterInterface::writeItem().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function writeItem(PoItem $item) {
|
||||
$this->write($item);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Component\Gettext\PoWriterInterface::writeItems().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function writeItems(PoReaderInterface $reader, $count = -1) {
|
||||
$forever = $count == -1;
|
||||
|
@ -153,7 +153,7 @@ class PoStreamWriter implements PoWriterInterface, PoStreamInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Component\Gettext\PoStreamInterface::setURI().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setURI($uri) {
|
||||
$this->_uri = $uri;
|
||||
|
|
|
@ -46,6 +46,11 @@ abstract class SecuredRedirectResponse extends RedirectResponse {
|
|||
protected function fromResponse(RedirectResponse $response) {
|
||||
$this->setProtocolVersion($response->getProtocolVersion());
|
||||
$this->setCharset($response->getCharset());
|
||||
// Cookies are separate from other headers and have to be copied over
|
||||
// directly.
|
||||
foreach ($response->headers->getCookies() as $cookie) {
|
||||
$this->headers->setCookie($cookie);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -34,14 +34,14 @@ class FileReadOnlyStorage implements PhpStorageInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Component\PhpStorage\PhpStorageInterface::exists().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function exists($name) {
|
||||
return file_exists($this->getFullPath($name));
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Component\PhpStorage\PhpStorageInterface::load().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function load($name) {
|
||||
// The FALSE returned on failure is enough for the caller to handle this,
|
||||
|
@ -50,14 +50,14 @@ class FileReadOnlyStorage implements PhpStorageInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Component\PhpStorage\PhpStorageInterface::save().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function save($name, $code) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Component\PhpStorage\PhpStorageInterface::delete().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function delete($name) {
|
||||
return FALSE;
|
||||
|
@ -71,14 +71,14 @@ class FileReadOnlyStorage implements PhpStorageInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Component\PhpStorage\PhpStorageInterface::writeable().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
function writeable() {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Component\PhpStorage\PhpStorageInterface::deleteAll().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function deleteAll() {
|
||||
return FALSE;
|
||||
|
|
|
@ -33,14 +33,14 @@ class FileStorage implements PhpStorageInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Component\PhpStorage\PhpStorageInterface::exists().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function exists($name) {
|
||||
return file_exists($this->getFullPath($name));
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Component\PhpStorage\PhpStorageInterface::load().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function load($name) {
|
||||
// The FALSE returned on failure is enough for the caller to handle this,
|
||||
|
@ -49,7 +49,7 @@ class FileStorage implements PhpStorageInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Component\PhpStorage\PhpStorageInterface::save().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function save($name, $code) {
|
||||
$path = $this->getFullPath($name);
|
||||
|
@ -183,7 +183,7 @@ EOF;
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Component\PhpStorage\PhpStorageInterface::delete().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function delete($name) {
|
||||
$path = $this->getFullPath($name);
|
||||
|
@ -201,14 +201,14 @@ EOF;
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Component\PhpStorage\PhpStorageInterface::writeable().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function writeable() {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Component\PhpStorage\PhpStorageInterface::deleteAll().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function deleteAll() {
|
||||
return $this->unlink($this->directory);
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace Drupal\Component\PhpStorage;
|
|||
class MTimeProtectedFileStorage extends MTimeProtectedFastFileStorage {
|
||||
|
||||
/**
|
||||
* Implements Drupal\Component\PhpStorage\PhpStorageInterface::load().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function load($name) {
|
||||
if (($filename = $this->checkFile($name)) !== FALSE) {
|
||||
|
@ -47,7 +47,7 @@ class MTimeProtectedFileStorage extends MTimeProtectedFastFileStorage {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Component\PhpStorage\PhpStorageInterface::exists().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function exists($name) {
|
||||
return $this->checkFile($name) !== FALSE;
|
||||
|
|
|
@ -44,7 +44,7 @@ class Context implements ContextInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements \Drupal\Component\Plugin\Context\ContextInterface::getContextValue().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getContextValue() {
|
||||
// Support optional contexts.
|
||||
|
@ -71,14 +71,14 @@ class Context implements ContextInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements \Drupal\Component\Plugin\Context\ContextInterface::getContextDefinition().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getContextDefinition() {
|
||||
return $this->contextDefinition;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements \Drupal\Component\Plugin\Context\ContextInterface::getConstraints().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getConstraints() {
|
||||
if (empty($this->contextDefinition['class'])) {
|
||||
|
@ -88,7 +88,7 @@ class Context implements ContextInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements \Drupal\Component\Plugin\Context\ContextInterface::validate().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function validate() {
|
||||
$validator = Validation::createValidatorBuilder()
|
||||
|
|
|
@ -33,22 +33,22 @@ interface ContextAwarePluginInterface extends PluginInspectionInterface {
|
|||
* @param string $name
|
||||
* The name of the context in the plugin definition.
|
||||
*
|
||||
* @throws \Drupal\Component\Plugin\Exception\PluginException
|
||||
* If the requested context is not defined.
|
||||
*
|
||||
* @return \Drupal\Component\Plugin\Context\ContextDefinitionInterface.
|
||||
* The definition against which the context value must validate.
|
||||
*
|
||||
* @throws \Drupal\Component\Plugin\Exception\PluginException
|
||||
* If the requested context is not defined.
|
||||
*/
|
||||
public function getContextDefinition($name);
|
||||
|
||||
/**
|
||||
* Gets the defined contexts.
|
||||
*
|
||||
* @throws \Drupal\Component\Plugin\Exception\PluginException
|
||||
* If contexts are defined but not set.
|
||||
*
|
||||
* @return array
|
||||
* The set context objects.
|
||||
*
|
||||
* @throws \Drupal\Component\Plugin\Exception\PluginException
|
||||
* If contexts are defined but not set.
|
||||
*/
|
||||
public function getContexts();
|
||||
|
||||
|
@ -58,11 +58,11 @@ interface ContextAwarePluginInterface extends PluginInspectionInterface {
|
|||
* @param string $name
|
||||
* The name of the context in the plugin definition.
|
||||
*
|
||||
* @throws \Drupal\Component\Plugin\Exception\PluginException
|
||||
* If the requested context is not set.
|
||||
*
|
||||
* @return \Drupal\Component\Plugin\Context\ContextInterface
|
||||
* The context object.
|
||||
*
|
||||
* @throws \Drupal\Component\Plugin\Exception\PluginException
|
||||
* If the requested context is not set.
|
||||
*/
|
||||
public function getContext($name);
|
||||
|
||||
|
@ -81,11 +81,11 @@ interface ContextAwarePluginInterface extends PluginInspectionInterface {
|
|||
* @param string $name
|
||||
* The name of the context in the plugin configuration.
|
||||
*
|
||||
* @throws \Drupal\Component\Plugin\Exception\PluginException
|
||||
* If the requested context is not set.
|
||||
*
|
||||
* @return mixed
|
||||
* The currently set context value.
|
||||
*
|
||||
* @throws \Drupal\Component\Plugin\Exception\PluginException
|
||||
* If the requested context is not set.
|
||||
*/
|
||||
public function getContextValue($name);
|
||||
|
||||
|
@ -108,11 +108,11 @@ interface ContextAwarePluginInterface extends PluginInspectionInterface {
|
|||
* The value to set the context to. The value has to validate against the
|
||||
* provided context definition.
|
||||
*
|
||||
* @throws \Drupal\Component\Plugin\Exception\PluginException
|
||||
* If the value does not pass validation.
|
||||
*
|
||||
* @return \Drupal\Component\Plugin\ContextAwarePluginInterface.
|
||||
* A context aware plugin object for chaining.
|
||||
*
|
||||
* @throws \Drupal\Component\Plugin\Exception\PluginException
|
||||
* If the value does not pass validation.
|
||||
*/
|
||||
public function setContextValue($name, $value);
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\Component\Plugin\PluginDefinitionInterface.
|
||||
* Contains \Drupal\Component\Plugin\Definition\PluginDefinitionInterface.
|
||||
*/
|
||||
|
||||
namespace Drupal\Component\Plugin\Definition;
|
||||
|
|
|
@ -16,7 +16,7 @@ class StaticDiscovery implements DiscoveryInterface {
|
|||
use DiscoveryCachedTrait;
|
||||
|
||||
/**
|
||||
* Implements Drupal\Component\Plugin\Discovery\DiscoveryInterface::getDefinitions().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getDefinitions() {
|
||||
if (!$this->definitions) {
|
||||
|
|
|
@ -52,7 +52,7 @@ class StaticDiscoveryDecorator extends StaticDiscovery {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Component\Plugin\Discovery\DiscoveryInterface::getDefinitions().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getDefinitions() {
|
||||
if (isset($this->registerDefinitions)) {
|
||||
|
|
|
@ -51,7 +51,7 @@ class DefaultFactory implements FactoryInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Component\Plugin\Factory\FactoryInterface::createInstance().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function createInstance($plugin_id, array $configuration = array()) {
|
||||
$plugin_definition = $this->discovery->getDefinition($plugin_id);
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace Drupal\Component\Plugin\Factory;
|
|||
class ReflectionFactory extends DefaultFactory {
|
||||
|
||||
/**
|
||||
* Implements Drupal\Component\Plugin\Factory\FactoryInterface::createInstance().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function createInstance($plugin_id, array $configuration = array()) {
|
||||
$plugin_definition = $this->discovery->getDefinition($plugin_id);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Contains Drupal\Component\Render\FormattableMarkup.
|
||||
* Contains \Drupal\Component\Render\FormattableMarkup.
|
||||
*/
|
||||
|
||||
namespace Drupal\Component\Render;
|
||||
|
@ -65,7 +65,7 @@ use Drupal\Component\Utility\UrlHelper;
|
|||
* @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup
|
||||
* @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat()
|
||||
*/
|
||||
class FormattableMarkup implements MarkupInterface {
|
||||
class FormattableMarkup implements MarkupInterface, \Countable {
|
||||
|
||||
/**
|
||||
* The arguments to replace placeholders with.
|
||||
|
@ -223,7 +223,6 @@ class FormattableMarkup implements MarkupInterface {
|
|||
break;
|
||||
|
||||
case '%':
|
||||
default:
|
||||
// Similarly to @, escape non-safe values. Also, add wrapping markup
|
||||
// in order to render as a placeholder. Not for use within attributes,
|
||||
// per the warning above about
|
||||
|
@ -231,6 +230,16 @@ class FormattableMarkup implements MarkupInterface {
|
|||
// due to the wrapping markup.
|
||||
$args[$key] = '<em class="placeholder">' . static::placeholderEscape($value) . '</em>';
|
||||
break;
|
||||
|
||||
default:
|
||||
// We do not trigger an error for placeholder that start with an
|
||||
// alphabetic character.
|
||||
if (!ctype_alpha($key[0])) {
|
||||
// We trigger an error as we may want to introduce new placeholders
|
||||
// in the future without breaking backward compatibility.
|
||||
trigger_error('Invalid placeholder: ' . $key, E_USER_ERROR);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ use Drupal\Component\Utility\Unicode;
|
|||
*
|
||||
* @ingroup sanitization
|
||||
*/
|
||||
class HtmlEscapedText implements MarkupInterface {
|
||||
class HtmlEscapedText implements MarkupInterface, \Countable {
|
||||
|
||||
/**
|
||||
* The string to escape.
|
||||
|
|
|
@ -41,6 +41,13 @@ class Crypt {
|
|||
$bytes .= openssl_random_pseudo_bytes($missing_bytes);
|
||||
}
|
||||
|
||||
// If OpenSSL is not available, we can use mcrypt. On Windows, this will
|
||||
// transparently pull from CryptGenRandom. On Unix-based systems, it will
|
||||
// read from /dev/urandom as expected.
|
||||
elseif (function_exists(('mcrypt_create_iv')) && defined('MCRYPT_DEV_URANDOM')) {
|
||||
$bytes .= mcrypt_create_iv($count, MCRYPT_DEV_URANDOM);
|
||||
}
|
||||
|
||||
// Else, read directly from /dev/urandom, which is available on many *nix
|
||||
// systems and is considered cryptographically secure.
|
||||
elseif ($fh = @fopen('/dev/urandom', 'rb')) {
|
||||
|
@ -125,6 +132,49 @@ class Crypt {
|
|||
return str_replace(['+', '/', '='], ['-', '_', ''], $hash);
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares strings in constant time.
|
||||
*
|
||||
* @param string $known_string
|
||||
* The expected string.
|
||||
* @param string $user_string
|
||||
* The user supplied string to check.
|
||||
*
|
||||
* @return bool
|
||||
* Returns TRUE when the two strings are equal, FALSE otherwise.
|
||||
*/
|
||||
public static function hashEquals($known_string, $user_string) {
|
||||
if (function_exists('hash_equals')) {
|
||||
return hash_equals($known_string, $user_string);
|
||||
}
|
||||
else {
|
||||
// Backport of hash_equals() function from PHP 5.6
|
||||
// @see https://github.com/php/php-src/blob/PHP-5.6/ext/hash/hash.c#L739
|
||||
if (!is_string($known_string)) {
|
||||
trigger_error(sprintf("Expected known_string to be a string, %s given", gettype($known_string)), E_USER_WARNING);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!is_string($user_string)) {
|
||||
trigger_error(sprintf("Expected user_string to be a string, %s given", gettype($user_string)), E_USER_WARNING);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
$known_len = strlen($known_string);
|
||||
if ($known_len !== strlen($user_string)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// This is security sensitive code. Do not optimize this for speed.
|
||||
$result = 0;
|
||||
for ($i = 0; $i < $known_len; $i++) {
|
||||
$result |= (ord($known_string[$i]) ^ ord($user_string[$i]));
|
||||
}
|
||||
|
||||
return $result === 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a URL-safe, base64 encoded string of highly randomized bytes.
|
||||
*
|
||||
|
|
|
@ -155,11 +155,11 @@ class AccessManager implements AccessManagerInterface {
|
|||
* @param \Drupal\Component\Utility\ArgumentsResolverInterface $arguments_resolver
|
||||
* The parametrized arguments resolver instance.
|
||||
*
|
||||
* @throws \Drupal\Core\Access\AccessException
|
||||
* Thrown when the access check returns an invalid value.
|
||||
*
|
||||
* @return \Drupal\Core\Access\AccessResultInterface
|
||||
* The access result.
|
||||
*
|
||||
* @throws \Drupal\Core\Access\AccessException
|
||||
* Thrown when the access check returns an invalid value.
|
||||
*/
|
||||
protected function performCheck($service_id, ArgumentsResolverInterface $arguments_resolver) {
|
||||
$callable = $this->checkProvider->loadCheck($service_id);
|
||||
|
|
|
@ -148,6 +148,16 @@ class AjaxResponseAttachmentsProcessor implements AttachmentsResponseProcessorIn
|
|||
$css_assets = $this->assetResolver->getCssAssets($assets, $optimize_css);
|
||||
list($js_assets_header, $js_assets_footer) = $this->assetResolver->getJsAssets($assets, $optimize_js);
|
||||
|
||||
// First, AttachedAssets::setLibraries() ensures duplicate libraries are
|
||||
// removed: it converts it to a set of libraries if necessary. Second,
|
||||
// AssetResolver::getJsSettings() ensures $assets contains the final set of
|
||||
// JavaScript settings. AttachmentsResponseProcessorInterface also mandates
|
||||
// that the response it processes contains the final attachment values, so
|
||||
// update both the 'library' and 'drupalSettings' attachments accordingly.
|
||||
$attachments['library'] = $assets->getLibraries();
|
||||
$attachments['drupalSettings'] = $assets->getSettings();
|
||||
$response->setAttachments($attachments);
|
||||
|
||||
// Render the HTML to load these files, and add AJAX commands to insert this
|
||||
// HTML in the page. Settings are handled separately, afterwards.
|
||||
$settings = [];
|
||||
|
|
|
@ -42,7 +42,7 @@ class CloseDialogCommand implements CommandInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements \Drupal\Core\Ajax\CommandInterface::render().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function render() {
|
||||
return array(
|
||||
|
|
|
@ -54,7 +54,7 @@ class SetDialogOptionCommand implements CommandInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements \Drupal\Core\Ajax\CommandInterface::render().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function render() {
|
||||
return array(
|
||||
|
|
|
@ -39,7 +39,7 @@ class ArchiverManager extends DefaultPluginManager {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides \Drupal\Component\Plugin\PluginManagerBase::createInstance().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function createInstance($plugin_id, array $configuration = array()) {
|
||||
$plugin_definition = $this->getDefinition($plugin_id);
|
||||
|
@ -48,7 +48,7 @@ class ArchiverManager extends DefaultPluginManager {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements \Drupal\Core\PluginManagerInterface::getInstance().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getInstance(array $options) {
|
||||
$filepath = $options['filepath'];
|
||||
|
|
|
@ -334,6 +334,9 @@ class AssetResolver implements AssetResolverInterface {
|
|||
// Allow modules and themes to alter the JavaScript settings.
|
||||
$this->moduleHandler->alter('js_settings', $settings, $assets);
|
||||
$this->themeManager->alter('js_settings', $settings, $assets);
|
||||
// Update the $assets object accordingly, so that it reflects the final
|
||||
// settings.
|
||||
$assets->setSettings($settings);
|
||||
$settings_as_inline_javascript = [
|
||||
'type' => 'setting',
|
||||
'group' => JS_SETTING,
|
||||
|
|
|
@ -69,6 +69,8 @@ interface AssetResolverInterface {
|
|||
*
|
||||
* @param \Drupal\Core\Asset\AttachedAssetsInterface $assets
|
||||
* The assets attached to the current response.
|
||||
* Note that this object is modified to reflect the final JavaScript
|
||||
* settings assets.
|
||||
* @param bool $optimize
|
||||
* Whether to apply the JavaScript asset collection optimizer, to return
|
||||
* optimized JavaScript asset collections rather than an unoptimized ones.
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
namespace Drupal\Core\Asset;
|
||||
|
||||
use Drupal\Core\Cache\CacheCollectorInterface;
|
||||
use Drupal\Core\Cache\CacheTagsInvalidatorInterface;
|
||||
|
||||
/**
|
||||
* Discovers available asset libraries in Drupal.
|
||||
|
@ -22,13 +21,6 @@ class LibraryDiscovery implements LibraryDiscoveryInterface {
|
|||
*/
|
||||
protected $collector;
|
||||
|
||||
/**
|
||||
* The cache tag invalidator.
|
||||
*
|
||||
* @var \Drupal\Core\Cache\CacheTagsInvalidatorInterface
|
||||
*/
|
||||
protected $cacheTagInvalidator;
|
||||
|
||||
/**
|
||||
* The final library definitions, statically cached.
|
||||
*
|
||||
|
@ -44,16 +36,9 @@ class LibraryDiscovery implements LibraryDiscoveryInterface {
|
|||
*
|
||||
* @param \Drupal\Core\Cache\CacheCollectorInterface $library_discovery_collector
|
||||
* The library discovery cache collector.
|
||||
* @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tag_invalidator
|
||||
* The cache tag invalidator.
|
||||
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
|
||||
* The module handler.
|
||||
* @param \Drupal\Core\Theme\ThemeManagerInterface $theme_manager
|
||||
* The theme manager.
|
||||
*/
|
||||
public function __construct(CacheCollectorInterface $library_discovery_collector, CacheTagsInvalidatorInterface $cache_tag_invalidator) {
|
||||
public function __construct(CacheCollectorInterface $library_discovery_collector) {
|
||||
$this->collector = $library_discovery_collector;
|
||||
$this->cacheTagInvalidator = $cache_tag_invalidator;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -64,7 +49,6 @@ class LibraryDiscovery implements LibraryDiscoveryInterface {
|
|||
$libraries = $this->collector->get($extension);
|
||||
$this->libraryDefinitions[$extension] = [];
|
||||
foreach ($libraries as $name => $definition) {
|
||||
$library_name = "$extension/$name";
|
||||
$this->libraryDefinitions[$extension][$name] = $definition;
|
||||
}
|
||||
}
|
||||
|
@ -84,7 +68,6 @@ class LibraryDiscovery implements LibraryDiscoveryInterface {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
public function clearCachedDefinitions() {
|
||||
$this->cacheTagInvalidator->invalidateTags(['library_info']);
|
||||
$this->libraryDefinitions = [];
|
||||
$this->collector->clear();
|
||||
}
|
||||
|
|
|
@ -88,7 +88,6 @@ class LibraryDiscoveryCollector extends CacheCollector {
|
|||
return $this->storage[$key];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the library definitions for a given extension.
|
||||
*
|
||||
|
@ -172,4 +171,13 @@ class LibraryDiscoveryCollector extends CacheCollector {
|
|||
}
|
||||
return $library_definition;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function reset() {
|
||||
parent::reset();
|
||||
$this->cid = NULL;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\Core\Plugin\Block\PageTitleBlock.
|
||||
* Contains \Drupal\Core\Block\Plugin\Block\PageTitleBlock.
|
||||
*/
|
||||
|
||||
namespace Drupal\Core\Block\Plugin\Block;
|
||||
|
|
|
@ -74,7 +74,7 @@ class BackendChain implements CacheBackendInterface, CacheTagsInvalidatorInterfa
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::get().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get($cid, $allow_invalid = FALSE) {
|
||||
foreach ($this->backends as $index => $backend) {
|
||||
|
@ -94,7 +94,7 @@ class BackendChain implements CacheBackendInterface, CacheTagsInvalidatorInterfa
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::getMultiple().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getMultiple(&$cids, $allow_invalid = FALSE) {
|
||||
$return = array();
|
||||
|
@ -125,7 +125,7 @@ class BackendChain implements CacheBackendInterface, CacheTagsInvalidatorInterfa
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::set().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function set($cid, $data, $expire = Cache::PERMANENT, array $tags = array()) {
|
||||
foreach ($this->backends as $backend) {
|
||||
|
@ -143,7 +143,7 @@ class BackendChain implements CacheBackendInterface, CacheTagsInvalidatorInterfa
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::delete().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function delete($cid) {
|
||||
foreach ($this->backends as $backend) {
|
||||
|
@ -152,7 +152,7 @@ class BackendChain implements CacheBackendInterface, CacheTagsInvalidatorInterfa
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::deleteMultiple().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function deleteMultiple(array $cids) {
|
||||
foreach ($this->backends as $backend) {
|
||||
|
@ -161,7 +161,7 @@ class BackendChain implements CacheBackendInterface, CacheTagsInvalidatorInterfa
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::deleteAll().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function deleteAll() {
|
||||
foreach ($this->backends as $backend) {
|
||||
|
@ -170,7 +170,7 @@ class BackendChain implements CacheBackendInterface, CacheTagsInvalidatorInterfa
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::invalidate().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function invalidate($cid) {
|
||||
foreach ($this->backends as $backend) {
|
||||
|
@ -179,7 +179,7 @@ class BackendChain implements CacheBackendInterface, CacheTagsInvalidatorInterfa
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::invalidateMultiple().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function invalidateMultiple(array $cids) {
|
||||
foreach ($this->backends as $backend) {
|
||||
|
@ -188,7 +188,7 @@ class BackendChain implements CacheBackendInterface, CacheTagsInvalidatorInterfa
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::invalidateTags().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function invalidateTags(array $tags) {
|
||||
foreach ($this->backends as $backend) {
|
||||
|
@ -199,7 +199,7 @@ class BackendChain implements CacheBackendInterface, CacheTagsInvalidatorInterfa
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::invalidateAll().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function invalidateAll() {
|
||||
foreach ($this->backends as $backend) {
|
||||
|
@ -208,7 +208,7 @@ class BackendChain implements CacheBackendInterface, CacheTagsInvalidatorInterfa
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::garbageCollection().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function garbageCollection() {
|
||||
foreach ($this->backends as $backend) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\Core\Cache\CacheableResponse.
|
||||
* Contains \Drupal\Core\Cache\CacheableJsonResponse.
|
||||
*/
|
||||
|
||||
namespace Drupal\Core\Cache;
|
||||
|
|
|
@ -61,7 +61,7 @@ class DatabaseBackend implements CacheBackendInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::get().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get($cid, $allow_invalid = FALSE) {
|
||||
$cids = array($cid);
|
||||
|
@ -70,7 +70,7 @@ class DatabaseBackend implements CacheBackendInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::getMultiple().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getMultiple(&$cids, $allow_invalid = FALSE) {
|
||||
$cid_mapping = array();
|
||||
|
@ -240,14 +240,14 @@ class DatabaseBackend implements CacheBackendInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::delete().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function delete($cid) {
|
||||
$this->deleteMultiple(array($cid));
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::deleteMultiple().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function deleteMultiple(array $cids) {
|
||||
$cids = array_values(array_map(array($this, 'normalizeCid'), $cids));
|
||||
|
@ -270,7 +270,7 @@ class DatabaseBackend implements CacheBackendInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::deleteAll().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function deleteAll() {
|
||||
try {
|
||||
|
@ -287,14 +287,14 @@ class DatabaseBackend implements CacheBackendInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::invalidate().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function invalidate($cid) {
|
||||
$this->invalidateMultiple(array($cid));
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::invalidateMultiple().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function invalidateMultiple(array $cids) {
|
||||
$cids = array_values(array_map(array($this, 'normalizeCid'), $cids));
|
||||
|
@ -313,7 +313,7 @@ class DatabaseBackend implements CacheBackendInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::invalidateAll().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function invalidateAll() {
|
||||
try {
|
||||
|
@ -327,7 +327,7 @@ class DatabaseBackend implements CacheBackendInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::garbageCollection().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function garbageCollection() {
|
||||
try {
|
||||
|
|
|
@ -34,7 +34,7 @@ class MemoryBackend implements CacheBackendInterface, CacheTagsInvalidatorInterf
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::get().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get($cid, $allow_invalid = FALSE) {
|
||||
if (isset($this->cache[$cid])) {
|
||||
|
@ -46,7 +46,7 @@ class MemoryBackend implements CacheBackendInterface, CacheTagsInvalidatorInterf
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::getMultiple().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getMultiple(&$cids, $allow_invalid = FALSE) {
|
||||
$ret = array();
|
||||
|
@ -104,7 +104,7 @@ class MemoryBackend implements CacheBackendInterface, CacheTagsInvalidatorInterf
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::set().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function set($cid, $data, $expire = Cache::PERMANENT, array $tags = array()) {
|
||||
assert('\Drupal\Component\Assertion\Inspector::assertAllStrings($tags)', 'Cache Tags must be strings.');
|
||||
|
@ -130,28 +130,28 @@ class MemoryBackend implements CacheBackendInterface, CacheTagsInvalidatorInterf
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::delete().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function delete($cid) {
|
||||
unset($this->cache[$cid]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::deleteMultiple().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function deleteMultiple(array $cids) {
|
||||
$this->cache = array_diff_key($this->cache, array_flip($cids));
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::deleteAll().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function deleteAll() {
|
||||
$this->cache = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::invalidate().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function invalidate($cid) {
|
||||
if (isset($this->cache[$cid])) {
|
||||
|
@ -160,7 +160,7 @@ class MemoryBackend implements CacheBackendInterface, CacheTagsInvalidatorInterf
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::invalidateMultiple().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function invalidateMultiple(array $cids) {
|
||||
foreach ($cids as $cid) {
|
||||
|
@ -180,7 +180,7 @@ class MemoryBackend implements CacheBackendInterface, CacheTagsInvalidatorInterf
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::invalidateAll().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function invalidateAll() {
|
||||
foreach ($this->cache as $cid => $item) {
|
||||
|
@ -189,7 +189,7 @@ class MemoryBackend implements CacheBackendInterface, CacheTagsInvalidatorInterf
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::garbageCollection()
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function garbageCollection() {
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ class MemoryCounterBackend extends MemoryBackend {
|
|||
protected $counter = array();
|
||||
|
||||
/**
|
||||
* Implements \Drupal\Core\Cache\CacheBackendInterface::get().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get($cid, $allow_invalid = FALSE) {
|
||||
$this->increaseCounter(__FUNCTION__, $cid);
|
||||
|
@ -34,7 +34,7 @@ class MemoryCounterBackend extends MemoryBackend {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements \Drupal\Core\Cache\CacheBackendInterface::set().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function set($cid, $data, $expire = Cache::PERMANENT, array $tags = array()) {
|
||||
$this->increaseCounter(__FUNCTION__, $cid);
|
||||
|
@ -42,7 +42,7 @@ class MemoryCounterBackend extends MemoryBackend {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements \Drupal\Core\Cache\CacheBackendInterface::delete().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function delete($cid) {
|
||||
$this->increaseCounter(__FUNCTION__, $cid);
|
||||
|
|
|
@ -31,21 +31,21 @@ class NullBackend implements CacheBackendInterface {
|
|||
public function __construct($bin) {}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::get().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get($cid, $allow_invalid = FALSE) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::getMultiple().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getMultiple(&$cids, $allow_invalid = FALSE) {
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::set().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function set($cid, $data, $expire = Cache::PERMANENT, array $tags = array()) {}
|
||||
|
||||
|
@ -55,37 +55,37 @@ class NullBackend implements CacheBackendInterface {
|
|||
public function setMultiple(array $items = array()) {}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::delete().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function delete($cid) {}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::deleteMultiple().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function deleteMultiple(array $cids) {}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::deleteAll().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function deleteAll() {}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::invalidate().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function invalidate($cid) {}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::invalidateMultiple().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function invalidateMultiple(array $cids) {}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::invalidateAll().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function invalidateAll() {}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Cache\CacheBackendInterface::garbageCollection().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function garbageCollection() {}
|
||||
|
||||
|
|
80
core/lib/Drupal/Core/Cache/UseCacheBackendTrait.php
Normal file
80
core/lib/Drupal/Core/Cache/UseCacheBackendTrait.php
Normal file
|
@ -0,0 +1,80 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\Core\Cache\UseCacheBackendTrait.
|
||||
*/
|
||||
|
||||
namespace Drupal\Core\Cache;
|
||||
|
||||
/**
|
||||
* Provides methods to use a cache backend while respecting a 'use caches' flag.
|
||||
*/
|
||||
trait UseCacheBackendTrait {
|
||||
|
||||
/**
|
||||
* Cache backend instance.
|
||||
*
|
||||
* @var \Drupal\Core\Cache\CacheBackendInterface
|
||||
*/
|
||||
protected $cacheBackend;
|
||||
|
||||
/**
|
||||
* Flag whether caches should be used or skipped.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $useCaches = TRUE;
|
||||
|
||||
/**
|
||||
* Fetches from the cache backend, respecting the use caches flag.
|
||||
*
|
||||
* @param string $cid
|
||||
* The cache ID of the data to retrieve.
|
||||
*
|
||||
* @return object|false
|
||||
* The cache item or FALSE on failure.
|
||||
*
|
||||
* @see \Drupal\Core\Cache\CacheBackendInterface::get()
|
||||
*/
|
||||
protected function cacheGet($cid) {
|
||||
if ($this->useCaches && $this->cacheBackend) {
|
||||
return $this->cacheBackend->get($cid);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stores data in the persistent cache, respecting the use caches flag.
|
||||
*
|
||||
* @param string $cid
|
||||
* The cache ID of the data to store.
|
||||
* @param mixed $data
|
||||
* The data to store in the cache.
|
||||
* Some storage engines only allow objects up to a maximum of 1MB in size to
|
||||
* be stored by default. When caching large arrays or similar, take care to
|
||||
* ensure $data does not exceed this size.
|
||||
* @param int $expire
|
||||
* One of the following values:
|
||||
* - CacheBackendInterface::CACHE_PERMANENT: Indicates that the item should
|
||||
* not be removed unless it is deleted explicitly.
|
||||
* - A Unix timestamp: Indicates that the item will be considered invalid
|
||||
* after this time, i.e. it will not be returned by get() unless
|
||||
* $allow_invalid has been set to TRUE. When the item has expired, it may
|
||||
* be permanently deleted by the garbage collector at any time.
|
||||
* @param array $tags
|
||||
* An array of tags to be stored with the cache item. These should normally
|
||||
* identify objects used to build the cache item, which should trigger
|
||||
* cache invalidation when updated. For example if a cached item represents
|
||||
* a node, both the node ID and the author's user ID might be passed in as
|
||||
* tags. For example array('node' => array(123), 'user' => array(92)).
|
||||
*
|
||||
* @see \Drupal\Core\Cache\CacheBackendInterface::set()
|
||||
*/
|
||||
protected function cacheSet($cid, $data, $expire = Cache::PERMANENT, array $tags = []) {
|
||||
if ($this->cacheBackend && $this->useCaches) {
|
||||
$this->cacheBackend->set($cid, $data, $expire, $tags);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\Core\Command\DbDumpCommand.
|
||||
* Contains \Drupal\Core\Command\DbImportCommand.
|
||||
*/
|
||||
|
||||
namespace Drupal\Core\Command;
|
||||
|
|
|
@ -31,6 +31,8 @@ class Composer {
|
|||
'fabpot/goutte' => ['Goutte/Tests'],
|
||||
'guzzlehttp/promises' => ['tests'],
|
||||
'guzzlehttp/psr7' => ['tests'],
|
||||
'jcalderonzumba/gastonjs' => ['docs', 'examples', 'tests'],
|
||||
'jcalderonzumba/mink-phantomjs-driver' => ['tests'],
|
||||
'masterminds/html5' => ['test'],
|
||||
'mikey179/vfsStream' => ['src/test'],
|
||||
'phpdocumentor/reflection-docblock' => ['tests'],
|
||||
|
|
|
@ -65,7 +65,7 @@ class ConditionManager extends DefaultPluginManager implements ExecutableManager
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Executable\ExecutableManagerInterface::execute().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function execute(ExecutableInterface $condition) {
|
||||
$result = $condition->evaluate();
|
||||
|
|
|
@ -55,7 +55,7 @@ class CachedStorage implements StorageInterface, StorageCacheInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Config\StorageInterface::exists().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function exists($name) {
|
||||
// The cache would read in the entire data (instead of only checking whether
|
||||
|
@ -65,7 +65,7 @@ class CachedStorage implements StorageInterface, StorageCacheInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Config\StorageInterface::read().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function read($name) {
|
||||
$cache_key = $this->getCacheKey($name);
|
||||
|
@ -123,7 +123,7 @@ class CachedStorage implements StorageInterface, StorageCacheInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Config\StorageInterface::write().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function write($name, array $data) {
|
||||
if ($this->storage->write($name, $data)) {
|
||||
|
@ -137,7 +137,7 @@ class CachedStorage implements StorageInterface, StorageCacheInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Config\StorageInterface::delete().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function delete($name) {
|
||||
// If the cache was the first to be deleted, another process might start
|
||||
|
@ -151,7 +151,7 @@ class CachedStorage implements StorageInterface, StorageCacheInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Config\StorageInterface::rename().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function rename($name, $new_name) {
|
||||
// If the cache was the first to be deleted, another process might start
|
||||
|
@ -166,14 +166,14 @@ class CachedStorage implements StorageInterface, StorageCacheInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Config\StorageInterface::encode().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function encode($data) {
|
||||
return $this->storage->encode($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Config\StorageInterface::decode().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function decode($raw) {
|
||||
return $this->storage->decode($raw);
|
||||
|
@ -215,7 +215,7 @@ class CachedStorage implements StorageInterface, StorageCacheInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Config\StorageInterface::deleteAll().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function deleteAll($prefix = '') {
|
||||
// If the cache was the first to be deleted, another process might start
|
||||
|
|
|
@ -111,25 +111,26 @@ class ConfigFactory implements ConfigFactoryInterface, EventSubscriberInterface
|
|||
}
|
||||
else {
|
||||
// If the configuration object does not exist in the configuration
|
||||
// storage, create a new object and add it to the static cache.
|
||||
$cache_key = $this->getConfigCacheKey($name, $immutable);
|
||||
$this->cache[$cache_key] = $this->createConfigObject($name, $immutable);
|
||||
// storage, create a new object.
|
||||
$config = $this->createConfigObject($name, $immutable);
|
||||
|
||||
if ($immutable) {
|
||||
// Get and apply any overrides.
|
||||
$overrides = $this->loadOverrides(array($name));
|
||||
if (isset($overrides[$name])) {
|
||||
$this->cache[$cache_key]->setModuleOverride($overrides[$name]);
|
||||
$config->setModuleOverride($overrides[$name]);
|
||||
}
|
||||
// Apply any settings.php overrides.
|
||||
if (isset($GLOBALS['config'][$name])) {
|
||||
$this->cache[$cache_key]->setSettingsOverride($GLOBALS['config'][$name]);
|
||||
$config->setSettingsOverride($GLOBALS['config'][$name]);
|
||||
}
|
||||
}
|
||||
|
||||
$this->propagateConfigOverrideCacheability($cache_key, $name);
|
||||
foreach ($this->configFactoryOverrides as $override) {
|
||||
$config->addCacheableDependency($override->getCacheableMetadata($name));
|
||||
}
|
||||
|
||||
return $this->cache[$cache_key];
|
||||
return $config;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -454,10 +454,10 @@ class ConfigImporter {
|
|||
/**
|
||||
* Imports the changelist to the target storage.
|
||||
*
|
||||
* @throws \Drupal\Core\Config\ConfigException
|
||||
*
|
||||
* @return \Drupal\Core\Config\ConfigImporter
|
||||
* The ConfigImporter instance.
|
||||
*
|
||||
* @throws \Drupal\Core\Config\ConfigException
|
||||
*/
|
||||
public function import() {
|
||||
if ($this->hasUnprocessedConfigurationChanges()) {
|
||||
|
@ -828,10 +828,10 @@ class ConfigImporter {
|
|||
* @param string $name
|
||||
* The name of the configuration to process.
|
||||
*
|
||||
* @throws \Drupal\Core\Config\ConfigImporterException
|
||||
*
|
||||
* @return bool
|
||||
* TRUE is to continue processing, FALSE otherwise.
|
||||
*
|
||||
* @throws \Drupal\Core\Config\ConfigImporterException
|
||||
*/
|
||||
protected function checkOp($collection, $op, $name) {
|
||||
if ($op == 'rename') {
|
||||
|
@ -939,13 +939,13 @@ class ConfigImporter {
|
|||
* @param string $name
|
||||
* The name of the configuration to process.
|
||||
*
|
||||
* @throws \Drupal\Core\Entity\EntityStorageException
|
||||
* Thrown if the data is owned by an entity type, but the entity storage
|
||||
* does not support imports.
|
||||
*
|
||||
* @return bool
|
||||
* TRUE if the configuration was imported as a configuration entity. FALSE
|
||||
* otherwise.
|
||||
*
|
||||
* @throws \Drupal\Core\Entity\EntityStorageException
|
||||
* Thrown if the data is owned by an entity type, but the entity storage
|
||||
* does not support imports.
|
||||
*/
|
||||
protected function importInvokeOwner($collection, $op, $name) {
|
||||
// Renames are handled separately.
|
||||
|
@ -989,14 +989,14 @@ class ConfigImporter {
|
|||
* The rename configuration name, as provided by
|
||||
* \Drupal\Core\Config\StorageComparer::createRenameName().
|
||||
*
|
||||
* @throws \Drupal\Core\Entity\EntityStorageException
|
||||
* Thrown if the data is owned by an entity type, but the entity storage
|
||||
* does not support imports.
|
||||
*
|
||||
* @return bool
|
||||
* TRUE if the configuration was imported as a configuration entity. FALSE
|
||||
* otherwise.
|
||||
*
|
||||
* @throws \Drupal\Core\Entity\EntityStorageException
|
||||
* Thrown if the data is owned by an entity type, but the entity storage
|
||||
* does not support imports.
|
||||
*
|
||||
* @see \Drupal\Core\Config\ConfigImporter::createRenameName()
|
||||
*/
|
||||
protected function importInvokeRename($collection, $rename_name) {
|
||||
|
|
|
@ -67,7 +67,7 @@ class DatabaseStorage implements StorageInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Config\StorageInterface::exists().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function exists($name) {
|
||||
try {
|
||||
|
@ -247,7 +247,7 @@ class DatabaseStorage implements StorageInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Config\StorageInterface::encode().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function encode($data) {
|
||||
return serialize($data);
|
||||
|
|
|
@ -111,7 +111,7 @@ abstract class ConfigEntityBase extends Entity implements ConfigEntityInterface
|
|||
protected $trustedData = FALSE;
|
||||
|
||||
/**
|
||||
* Overrides Entity::__construct().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __construct(array $values, $entity_type) {
|
||||
parent::__construct($values, $entity_type);
|
||||
|
|
|
@ -138,7 +138,7 @@ class ConfigEntityStorage extends EntityStorageBase implements ConfigEntityStora
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Entity\EntityStorageInterface::deleteRevision().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function deleteRevision($revision_id) {
|
||||
return NULL;
|
||||
|
|
|
@ -20,7 +20,7 @@ use Drupal\Core\Entity\Query\QueryException;
|
|||
class Condition extends ConditionBase {
|
||||
|
||||
/**
|
||||
* Implements \Drupal\Core\Entity\Query\ConditionInterface::compile().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function compile($configs) {
|
||||
$and = strtoupper($this->conjunction) == 'AND';
|
||||
|
@ -86,14 +86,14 @@ class Condition extends ConditionBase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements \Drupal\Core\Entity\Query\ConditionInterface::exists().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function exists($field, $langcode = NULL) {
|
||||
return $this->condition($field, NULL, 'IS NOT NULL', $langcode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements \Drupal\Core\Entity\Query\ConditionInterface::notExists().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function notExists($field, $langcode = NULL) {
|
||||
return $this->condition($field, NULL, 'IS NULL', $langcode);
|
||||
|
|
|
@ -80,7 +80,7 @@ class Query extends QueryBase implements QueryInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements \Drupal\Core\Entity\Query\QueryInterface::execute().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function execute() {
|
||||
// Load the relevant config records.
|
||||
|
|
|
@ -80,7 +80,7 @@ class FileStorage implements StorageInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Config\StorageInterface::exists().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function exists($name) {
|
||||
return file_exists($this->getFilePath($name));
|
||||
|
@ -146,7 +146,7 @@ class FileStorage implements StorageInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Config\StorageInterface::delete().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function delete($name) {
|
||||
if (!$this->exists($name)) {
|
||||
|
@ -160,7 +160,7 @@ class FileStorage implements StorageInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Config\StorageInterface::rename().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function rename($name, $new_name) {
|
||||
$status = @rename($this->getFilePath($name), $this->getFilePath($new_name));
|
||||
|
@ -171,14 +171,14 @@ class FileStorage implements StorageInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Config\StorageInterface::encode().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function encode($data) {
|
||||
return Yaml::encode($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Config\StorageInterface::decode().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function decode($raw) {
|
||||
$data = Yaml::decode($raw);
|
||||
|
@ -190,7 +190,7 @@ class FileStorage implements StorageInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Config\StorageInterface::listAll().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function listAll($prefix = '') {
|
||||
$dir = $this->getCollectionDirectory();
|
||||
|
@ -216,7 +216,7 @@ class FileStorage implements StorageInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Config\StorageInterface::deleteAll().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function deleteAll($prefix = '') {
|
||||
$success = TRUE;
|
||||
|
|
|
@ -129,7 +129,7 @@ class InstallStorage extends FileStorage {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Config\StorageInterface::listAll().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function listAll($prefix = '') {
|
||||
$names = array_keys($this->getAllFolders());
|
||||
|
|
|
@ -24,70 +24,70 @@ namespace Drupal\Core\Config;
|
|||
class NullStorage implements StorageInterface {
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Config\StorageInterface::exists().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function exists($name) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Config\StorageInterface::read().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function read($name) {
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Config\StorageInterface::readMultiple().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function readMultiple(array $names) {
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Config\StorageInterface::write().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function write($name, array $data) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Config\StorageInterface::delete().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function delete($name) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Config\StorageInterface::rename().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function rename($name, $new_name) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Config\StorageInterface::encode().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function encode($data) {
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Config\StorageInterface::decode().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function decode($raw) {
|
||||
return $raw;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Config\StorageInterface::listAll().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function listAll($prefix = '') {
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\Config\StorageInterface::deleteAll().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function deleteAll($prefix = '') {
|
||||
return FALSE;
|
||||
|
|
|
@ -115,7 +115,7 @@ abstract class ArrayElement extends Element implements \IteratorAggregate, Typed
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements IteratorAggregate::getIterator();
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getIterator() {
|
||||
return new \ArrayIterator($this->getElements());
|
||||
|
|
|
@ -45,11 +45,11 @@ interface TypedConfigInterface extends TraversableTypedDataInterface {
|
|||
* elements can be get using multiple dot delimited names, for example,
|
||||
* 'page.front'.
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
* If an invalid property name is given.
|
||||
*
|
||||
* @return \Drupal\Core\TypedData\TypedDataInterface
|
||||
* The property object.
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
* If an invalid property name is given.
|
||||
*/
|
||||
public function get($name);
|
||||
|
||||
|
|
|
@ -60,7 +60,6 @@ class TitleResolver implements TitleResolverInterface {
|
|||
if (($raw_parameters = $request->attributes->get('_raw_variables'))) {
|
||||
foreach ($raw_parameters->all() as $key => $value) {
|
||||
$args['@' . $key] = $value;
|
||||
$args['!' . $key] = $value;
|
||||
$args['%' . $key] = $value;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,9 @@ use Drupal\Component\Utility\Unicode;
|
|||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* MySQL implementation of \Drupal\Core\Database\Connection.
|
||||
*/
|
||||
class Connection extends DatabaseConnection {
|
||||
|
||||
/**
|
||||
|
@ -33,6 +36,16 @@ class Connection extends DatabaseConnection {
|
|||
*/
|
||||
const UNSUPPORTED_CHARSET = 2019;
|
||||
|
||||
/**
|
||||
* Driver-specific error code for "Unknown character set" error.
|
||||
*/
|
||||
const UNKNOWN_CHARSET = 1115;
|
||||
|
||||
/**
|
||||
* SQLSTATE error code for "Syntax error or access rule violation".
|
||||
*/
|
||||
const SQLSTATE_SYNTAX_ERROR = 42000;
|
||||
|
||||
/**
|
||||
* Flag to indicate if the cleanup function in __destruct() should run.
|
||||
*
|
||||
|
|
|
@ -9,4 +9,7 @@ namespace Drupal\Core\Database\Driver\mysql;
|
|||
|
||||
use Drupal\Core\Database\Query\Delete as QueryDelete;
|
||||
|
||||
/**
|
||||
* MySQL implementation of \Drupal\Core\Database\Query\Delete.
|
||||
*/
|
||||
class Delete extends QueryDelete { }
|
||||
|
|
|
@ -9,6 +9,9 @@ namespace Drupal\Core\Database\Driver\mysql;
|
|||
|
||||
use Drupal\Core\Database\Query\Insert as QueryInsert;
|
||||
|
||||
/**
|
||||
* MySQL implementation of \Drupal\Core\Database\Query\Insert.
|
||||
*/
|
||||
class Insert extends QueryInsert {
|
||||
|
||||
public function execute() {
|
||||
|
|
|
@ -71,7 +71,7 @@ class Tasks extends InstallTasks {
|
|||
}
|
||||
catch (\Exception $e) {
|
||||
// Detect utf8mb4 incompability.
|
||||
if ($e->getCode() == Connection::UNSUPPORTED_CHARSET) {
|
||||
if ($e->getCode() == Connection::UNSUPPORTED_CHARSET || ($e->getCode() == Connection::SQLSTATE_SYNTAX_ERROR && $e->errorInfo[1] == Connection::UNKNOWN_CHARSET)) {
|
||||
$this->fail(t('Your MySQL server and PHP MySQL driver must support utf8mb4 character encoding. Make sure to use a database system that supports this (such as MySQL/MariaDB/Percona 5.5.3 and up), and that the utf8mb4 character set is compiled in. See the <a href=":documentation" target="_blank">MySQL documentation</a> for more information.', array(':documentation' => 'https://dev.mysql.com/doc/refman/5.0/en/cannot-initialize-character-set.html')));
|
||||
$info = Database::getConnectionInfo();
|
||||
$info_copy = $info;
|
||||
|
|
|
@ -9,4 +9,7 @@ namespace Drupal\Core\Database\Driver\mysql;
|
|||
|
||||
use Drupal\Core\Database\Query\Merge as QueryMerge;
|
||||
|
||||
/**
|
||||
* MySQL implementation of \Drupal\Core\Database\Query\Merge.
|
||||
*/
|
||||
class Merge extends QueryMerge { }
|
||||
|
|
|
@ -19,6 +19,9 @@ use Drupal\Component\Utility\Unicode;
|
|||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* MySQL implementation of \Drupal\Core\Database\Schema.
|
||||
*/
|
||||
class Schema extends DatabaseSchema {
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,4 +9,7 @@ namespace Drupal\Core\Database\Driver\mysql;
|
|||
|
||||
use Drupal\Core\Database\Query\Select as QuerySelect;
|
||||
|
||||
/**
|
||||
* MySQL implementation of \Drupal\Core\Database\Query\Select.
|
||||
*/
|
||||
class Select extends QuerySelect { }
|
||||
|
|
|
@ -9,4 +9,7 @@ namespace Drupal\Core\Database\Driver\mysql;
|
|||
|
||||
use Drupal\Core\Database\Transaction as DatabaseTransaction;
|
||||
|
||||
/**
|
||||
* MySQL implementation of \Drupal\Core\Database\Transaction.
|
||||
*/
|
||||
class Transaction extends DatabaseTransaction { }
|
||||
|
|
|
@ -9,4 +9,7 @@ namespace Drupal\Core\Database\Driver\mysql;
|
|||
|
||||
use Drupal\Core\Database\Query\Truncate as QueryTruncate;
|
||||
|
||||
/**
|
||||
* MySQL implementation of \Drupal\Core\Database\Query\Truncate.
|
||||
*/
|
||||
class Truncate extends QueryTruncate { }
|
||||
|
|
|
@ -9,4 +9,7 @@ namespace Drupal\Core\Database\Driver\mysql;
|
|||
|
||||
use Drupal\Core\Database\Query\Update as QueryUpdate;
|
||||
|
||||
/**
|
||||
* MySQL implementation of \Drupal\Core\Database\Query\Update.
|
||||
*/
|
||||
class Update extends QueryUpdate { }
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace Drupal\Core\Database\Driver\mysql;
|
|||
use Drupal\Core\Database\Query\Upsert as QueryUpsert;
|
||||
|
||||
/**
|
||||
* Implements the Upsert query for the MySQL database driver.
|
||||
* MySQL implementation of \Drupal\Core\Database\Query\Upsert.
|
||||
*/
|
||||
class Upsert extends QueryUpsert {
|
||||
|
||||
|
|
|
@ -16,6 +16,9 @@ use Drupal\Core\Database\DatabaseNotFoundException;
|
|||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* PostgreSQL implementation of \Drupal\Core\Database\Connection.
|
||||
*/
|
||||
class Connection extends DatabaseConnection {
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,6 +9,9 @@ namespace Drupal\Core\Database\Driver\pgsql;
|
|||
|
||||
use Drupal\Core\Database\Query\Delete as QueryDelete;
|
||||
|
||||
/**
|
||||
* PostgreSQL implementation of \Drupal\Core\Database\Query\Delete.
|
||||
*/
|
||||
class Delete extends QueryDelete {
|
||||
|
||||
/**
|
||||
|
|
|
@ -15,6 +15,9 @@ use Drupal\Core\Database\Query\Insert as QueryInsert;
|
|||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* PostgreSQL implementation of \Drupal\Core\Database\Query\Insert.
|
||||
*/
|
||||
class Insert extends QueryInsert {
|
||||
|
||||
public function execute() {
|
||||
|
|
|
@ -9,4 +9,7 @@ namespace Drupal\Core\Database\Driver\pgsql;
|
|||
|
||||
use Drupal\Core\Database\Query\Merge as QueryMerge;
|
||||
|
||||
/**
|
||||
* PostgreSQL implementation of \Drupal\Core\Database\Query\Merge.
|
||||
*/
|
||||
class Merge extends QueryMerge { }
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace Drupal\Core\Database\Driver\pgsql;
|
|||
use Drupal\Core\Database\Query\Upsert as QueryUpsert;
|
||||
|
||||
/**
|
||||
* Implements the native Upsert query for the PostgreSQL database driver.
|
||||
* PostgreSQL implementation of native \Drupal\Core\Database\Query\Upsert.
|
||||
*
|
||||
* @see http://www.postgresql.org/docs/9.5/static/sql-insert.html#SQL-ON-CONFLICT
|
||||
*/
|
||||
|
|
|
@ -17,6 +17,9 @@ use Drupal\Core\Database\Schema as DatabaseSchema;
|
|||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* PostgreSQL implementation of \Drupal\Core\Database\Schema.
|
||||
*/
|
||||
class Schema extends DatabaseSchema {
|
||||
|
||||
/**
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Reference in a new issue