Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GSCkeRelativeUrls
#1
experimental plugin
Plugin to make ckeditor local links relative root not absolute domain.

Extend
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#2
It works! The links are now relative.

Interestingly, the text between <a> and </a> remains the link - but after I changed it to the pages title and reopened the link editing dialogue, the correct page is selected as expected. (But this is probably beyond the scope of your plugin)

Anyway: 5 stars from me and many thanks for your quick help!
Reply
#3
It appears that there is a unreported bug in config.js when editing a link.

config.js?t=EAPE:167 Uncaught ReferenceError: path is not defined

ill see what that is about
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#4
The problem with this local link cke code is once you reload a page it doesn't know what is a link is local and url link.

It will always be a url, we have to add some persistent way to id it as a page link.

it might be possible, there is some stuff ckeditor has access to, or we can use a custom protocol.

Code:
Object {
     type: "url",
     url: Object,
     target: Object,
     adv: Object,
     anchors: Array[1]
}
adv: ObjectadvCSSClasses: "class"
advId: "myid"
advName: "myname"
advRel: "relationship"
__proto__: Objectanchors: Array[1] 0: Objectid: "myid"
name: "myname"
__proto__: Objectlength: 1 __proto__: Array[0] target: Object__proto__: Objecttype: "url"
url: Objectprotocol: undefinedurl: "/dev/getsimple/hotfixes/index.php?id=new-markdown-document"
__proto__: Object__proto__: Object
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#5
(2015-01-13, 08:48:23)shawn_a Wrote: The problem with this local link cke code is once you reload a page it doesn't know what is a link is local and url link.

It will always be a url, we have to add some persistent way to id it as a page link.

Is a local link not obviosly different by NOT starting with a protocol? I.e.
  • URL: "http://<anything>" or "https://<anything>"
  • Local link: "/<anything>" or "<anything>" or "../<anything>" (plus variants)

where <anything> would be any combination of folders, slashes, and filenames.

Plus: if the local links are generated by ckeditor they could all start with the root directory ("/<anything>") - so looking for this might suffice. On the other hand: if anyone edits content in ckeditor that was created in source code mode before and contains local links of the other two variants above, you might better check for all of those, too (but might convert them to the same version).
Reply
#6
I noted this all in the github issue.
https://github.com/GetSimpleCMS/GetSimpl...ssues/1000

This is turning out to be too much work, i will be looking at established plugins for this instead.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#7
Hey there,

I have downloaded the "GSRelativeURLs" plugin, I've unzipped it in the plugins folder, I have activated it. Then I created a new page, containing an image and I saved. I have examined the xml page: contains an absolute url of the imagen:

src=\&quot;http://wwww.localhost/myweb/data/uploads/images/image2.jpg\&quot;

What did I do wrong  Huh ?

Happy New Year to all!
Reply
#8
I don't think this plugin affects images
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply




Users browsing this thread: 1 Guest(s)