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?
Labels |
Added:
?
|
Are you really talking about tinymce or the xtd-editor plugin - i am confused
Maybe a screencap will help to explain
Category | ⇒ | com_plugins |
Status | New | ⇒ | Discussion |
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.
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 ;-)
Its a very non user friendly system at present.
Soo... who has the skillz to do it? is this a Dimitris area ;-). Ideally, it should work exactly like the Link linking.
@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
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
Labels |
Added:
J3 Issue
|
@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
@dgrammatiko that could work
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-12-03 20:01:20 |
Closed_By | ⇒ | joomla-cms-bot |
Closed_Date | 2018-12-03 20:01:20 | ⇒ | 2018-12-03 20:01:21 |
Closed_By | joomla-cms-bot | ⇒ | Quy |
Set to "closed" on behalf of @Quy by The JTracker Application at issues.joomla.org/joomla-cms/17665
Please test PR #23224
That requires making it a TinyMCE plugin if I'm not mistaken, not our generic "extended editor" plugin.