Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1098761
D265.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Aug 14, 5:37 AM
Size
1 KB
Mime Type
text/x-diff
Expires
Fri, Aug 15, 5:37 AM (4 h, 6 m)
Engine
blob
Format
Raw Data
Handle
709340
Attached To
D265: INP-1643 - Use relative paths in "my_document" CKEditor plugin
D265.diff
View Options
Index: branches/5.2.x/core/ckeditor/plugins/my_document/dialogs/document.js
===================================================================
--- branches/5.2.x/core/ckeditor/plugins/my_document/dialogs/document.js
+++ branches/5.2.x/core/ckeditor/plugins/my_document/dialogs/document.js
@@ -18,6 +18,17 @@
}
};
+ var makeRelativeUrl = function ($url) {
+ if ( $url.indexOf(':/') == -1 && path.slice(0, 2) != '//' ) {
+ return $url;
+ }
+
+ var $link = document.createElement('a');
+
+ $link.href = $url;
+
+ return $link.pathname;
+ };
var parseLink = function( editor ) {
var retval = {
@@ -343,7 +354,7 @@
this.commitContent( data );
var $filename = data.documentUrl.slice(data.documentUrl.lastIndexOf('\/') + 1);
- var $icon_url = CKEDITOR.basePath.split('/');
+ var $icon_url = makeRelativeUrl(CKEDITOR.basePath).split('/');
$icon_url.splice($icon_url.length - 3); // remove "/core/ckeditor/"
$icon_url = $icon_url.join('/') + editor.config.documentIconsUrl;
@@ -371,4 +382,4 @@
};
}
-);
\ No newline at end of file
+);
Event Timeline
Log In to Comment