J3 Issue ?
avatar tonypartridge
tonypartridge
22 Aug 2017

So when you link to menu items etc, if you highlight text and link it doesn't work at all.

So you have to insert the menu item and then you need to change the text. This is a slow process.

Can we make it so when text is highlighted and then insert menu is used the text is just linked?

avatar tonypartridge tonypartridge - open - 22 Aug 2017
avatar joomla-cms-bot joomla-cms-bot - change - 22 Aug 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 22 Aug 2017
avatar mbabker
mbabker - comment - 22 Aug 2017

That requires making it a TinyMCE plugin if I'm not mistaken, not our generic "extended editor" plugin.

avatar brianteeman
brianteeman - comment - 22 Aug 2017

Are you really talking about tinymce or the xtd-editor plugin - i am confused

Maybe a screencap will help to explain

avatar franz-wohlkoenig franz-wohlkoenig - change - 22 Aug 2017
Category com_plugins
avatar franz-wohlkoenig franz-wohlkoenig - change - 22 Aug 2017
Status New Discussion
avatar tonypartridge
tonypartridge - comment - 22 Aug 2017

Sorry yes, it is the Button - Menu Plugin. Its a bit confusing now given someone has merged buttons into the toolbar you assume / think it's part of the toolbar not a button.

avatar tonypartridge
tonypartridge - comment - 22 Aug 2017

But fundamentally it should work like the tinymce built in link plugin. From what I can see of the code we would just need to pass in the highlighted text into the data attrib for when we click the menu item in the list. But I can't fathom out how the link/code is generated from the button yet. Anyone fancy the challenge.. a JS dev should be able to do it fairly quickly ;-)

avatar coolcat-creations
coolcat-creations - comment - 12 Sep 2017
  • it doesn´t work at the first time for me, i have to open it again and the second time the link is placed then.
avatar tonypartridge
tonypartridge - comment - 12 Sep 2017

Its a very non user friendly system at present.

avatar Fedik
Fedik - comment - 17 Sep 2017

@mbabker are right, it require making the plugin specifically to TinyMCE

xtd-editor plugin are general thing

avatar tonypartridge
tonypartridge - comment - 18 Sep 2017

Soo... who has the skillz to do it? is this a Dimitris area ;-). Ideally, it should work exactly like the Link linking.

avatar dgt41
dgt41 - comment - 18 Sep 2017

@tonypartridge @Fedik the code for the core buttons as tinyMCE plugins already exists: https://github.com/joomla/joomla-cms/pull/7152/files

The missing part is extending the PHP API for the XTD_Buttons so they can return also the tinyMCE plugin path

avatar Fedik
Fedik - comment - 18 Sep 2017

The missing part is extending the PHP API for the XTD_Buttons so they can return also the tinyMCE plugin path

no need new API, just include plugin script, see Example of loading the plugin from another URL

only problem, that XTD_Buttons should check whether they loaded by tinyMCE editor

avatar tonypartridge
tonypartridge - comment - 24 Mar 2018

@dgt41 @Fedik JS isn't my forte... could one off you kinda persons take a look? :D

avatar brianteeman brianteeman - change - 25 Mar 2018
Labels Added: J3 Issue
avatar brianteeman brianteeman - labeled - 25 Mar 2018
avatar dgrammatiko
dgrammatiko - comment - 15 Aug 2018

@tonypartridge @wilsonge @Fedik I'm gonna introduce one more method to our Joomla.Editors API:

getSelection() { /* return the current selection */ }

Then every XTD Button could call this method, get the text do any fancy stuff and then return using the method replaceSelection

For the editor none the API will look like:

		const that = this;
		/** Register Editor */
		Joomla.editors.instances[that.childNodes[0].id] = {
			'id': that.childNodes[0].id,
			'element':  that,
			'getValue': () => { return that.childNodes[0].value; },
			'setValue': (text) => { return that.childNodes[0].value = text; },
			'getSelection' : () => {
				// obtain the index of the first selected character
				var start = that.childNodes[0].selectionStart;
				// obtain the index of the last selected character
				var finish = that.childNodes[0].selectionEnd;
				// obtain the selected text
				return that.childNodes[0].value.substring(start, finish);
			},
			'replaceSelection': (text) => { return that.insertAtCursor(text); },
			'onSave': () => {}
		};

Similar but easier implementation for tinyMCE and code mirror should be applied

avatar Fedik
Fedik - comment - 16 Aug 2018

@dgrammatiko that could work ?

avatar joomla-cms-bot joomla-cms-bot - change - 3 Dec 2018
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2018-12-03 20:01:20
Closed_By joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 3 Dec 2018
avatar Quy Quy - change - 3 Dec 2018
Closed_Date 2018-12-03 20:01:20 2018-12-03 20:01:21
Closed_By joomla-cms-bot Quy
avatar joomla-cms-bot
joomla-cms-bot - comment - 3 Dec 2018

Set to "closed" on behalf of @Quy by The JTracker Application at issues.joomla.org/joomla-cms/17665

avatar Quy
Quy - comment - 3 Dec 2018

Please test PR #23224


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17665.

Add a Comment

Login with GitHub to post a comment