@HistoryBuff all of what you propose should be doable. That last one is very similar in concept to “create new here”. I tried a tagging option quickly with tm-add-tag, but that didn’t quite work. I may try a few other things and see…
I had already changed the js tiddler as you had told.
Is this similar to the clone viewtoolbar button functionality?
Another custom function I added to my context menu is adding links [[]]. But since this add in uses search and replace, there might be multiple instances of the selected word, which might limit the usefulness.
I have also used this add in for adding strex macro by telmiger and also my experimental cloze macro.
What I am looking for is similar to the clone button, but what I would like is to be able to create a new tiddler with the tag preset to Railroads and a couple of other fields prepopulated with fixed values. These would not be dependent on the tiddler I was right clicking in. I could create a toolbar button to do this, but thought it might be convenient to have it available from a right click. Upon reflection, it might be good to also be able to have the title of that new railroad tiddler be whatever text I currently have highlighted.
So is it basically possible to almost add any button to the context menu that I could add to either the page toolbar or view toolbar? That would be enormously convenient.
I think this prevents Selecting texts on the mobile. Or maybe this is the bug in the main Plugin… @ahanniga Where is the Github repository of your plug in? I can try pr for it.
I mean hide the gray items in view template, as long as they can’t be clicked. And only show them when they can be clicked. Maybe this has to be done in the main context menu plugin?
Oh I see, I think it can be done.
In the current implementation, I wanted to signal to the user when options were not available because of transclusions.
I can just as easily hide the options which will be friendlier to mobile users…
After upgrading to 5.3.0 or 5.3.1, the context menu is showing a bug.
The icons are not displayed, instead /parameter (size"22pt") is seen. Check the below image and wiki - https://context-menu-bug.tiddlyhost.com/
I think there was some change related to images or icon with 5.3.0 which might be causing this. Also it must be corrected in the main context menu plug in mostly. Since @ahanniga has not been active in this forum for some time, @fastfreddy can you take a look at this ?
this line in my overrriden $:/plugins/ahanniga/context-menu/ContextListener.js probably needs to be adjusted. I’ll see if I can figure it out with Tones’ pointer.
thanks @buggyj ; didn’t manage to make your proposal work (it still may very well be valid)…
@arunnbabu81 : this modification to $:/plugins/ahanniga/context-menu/ContextListener.js fixes the icon issues; not sure if there is a better way yet; will try to release a new version before too long; I’d like to test if this change is backwards compatible…
I have released 0.2.9 which addresses compatibility with 5.3.0/5.3.1 at @arunnbabu81’s request, as well as a new configuration option to hide disabled menu items completely (best for small screens) at @linonetwo’s request.
I need your help for another bug I have come acros when using context menu plug in with multicolumn plug in.
Internal javascript error is seen when I right click to access the context menu if the multicolumn layout is activated (no issues while using the context menu plug in with multicolumn plug in installed but multicolumn layout not activated)
I’ll try to take a look in the next few days; there seems to be an issue with this function:
//used when storing text values from tiddler in context menu HTML
var sanitize = function (string) {
const map = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
"'": ''',
"/": '/',
};
const reg = /[&<>"'/]/ig;
return string.replace(reg, (match) => (map[match]));
};
I am guessing from the call at the end of this sequence:
//Streams node compatibility
//nearest DOM element that contains this attribute [data-node-title]
const node = event.target.closest("[data-node-title]");
const nodeTitle = node && node.dataset["nodeTitle"];
//regular logic if the event was not on a Streams node
targ = nodeTitle || event.currentTarget.getAttribute("data-tiddler-title"); //based on the div attribute in view template that contains currentTiddler
const tiddlerText=$tw.wiki.getTiddlerText(targ);
const sTarg = sanitize(targ);
It may be struggling to find a target for the context menu… which could very well be the case in this MCL layout.
Can you try and install Streams on your demo wiki (and populating a few Stream nodes instead of/in addition to the tiddler’s main body)? It would be interesting to see if the logic to find a target works in MCL when Stream nodes are present.