Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F802957
D265.id.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
Tue, Feb 25, 4:19 AM
Size
1 KB
Mime Type
text/x-diff
Expires
Wed, Feb 26, 4:19 AM (13 h, 54 m)
Engine
blob
Format
Raw Data
Handle
575823
Attached To
D265: INP-1643 - Use relative paths in "my_document" CKEditor plugin
D265.id.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