I am using the Froala editor in my solution to create html that is to be sent to a PDF writer. The PDF writer does not support clickable links. This means that the full url must show as text.
So what I want is to disable the possibility to add links with custom text in the editor. I want it to be generated as a clickable anchor link (url) but I want the full url to show in the text. Reason I want this to be inserted as link rather than disabling the link plugin altogether, is that it will then be visually formatted as a link by css.
I have found the setting linkText: false for the Froala editor, which hides the text field inside the insert link popup. This is basically what I want - so far so good.
The issue is that the user can "work around" this by selecting a text in the editor before clicking the link button. The text is still not shown in the link popup, but the link you create is applied to the selected text, and the link url is not shown in the text.
Is there some way I can disable this behaviour in the link plugin so that if the user has selected a text before adding the link, the text will be ignored, and the link with url as text will just be inserted after the pre-selected text?
FroalaEditor version is 4.0.11
I ended up removing the possibility to open the link popup. I removed the insertLink from toolbarButtons and quickInsertButtons. I also removed linkEdit and linkRemove from linkEditButtons.
I also have the url plugin active, so that whenever I insert a text in the editor that the Froala url plugin recognizes as a valid url, it is wrapped in an <a> tag which provides the styling for links as I want. I still have the link plugin active but with only with linkEditButtons: ['linkOpen', 'linkStyle'] to be able to open the link from the editor and select from a couple of link styles I have set up.
Related
I am working on a Chrome/FF Quantum extension, and I've run into a problem. This extension creates a floating toolbar via content script, when the user selects some text on the webpage.
The toolbar has an "Open" button. What I want to do is to open a new tab, and pass the selected text to it. If the selected text is a valid URL, it should be opened. If it's only arbitrary text, it should be passed to the default search engine of the browser. Just like when the user types into the addressbar.
So far I have a content and a background script. The content script reads the selected text and sends it to the background script with chrome.runtime.sendMessage(). In that script I've tried both the chrome.tabs.create() and the window.open() methods, but if the selection is only arbitrary text, the new tab loads with the URL of the extension itself, and attaches the text to the path part.
Is it even possible to do, or I have to use a search engine as a user setting of the extension, and build the query myself?
I have a problem regarding Wordpress/tinyMCE.
Wordpress is 4.5.2 version, and is managed by hosting, so I can not edit tinyMCE files or replace it with different version but default one.
The problem appears in front end only, while it workt normally in admin part of the WP.
When I click on "insert link" button in the toolbar, no dialog appears, and selected text gets the "a" tag, with href pointing to "_wp_link_placeholder".
TinyMCE is initialized using wp_editor() function from the PHP code.
Thanks in advance!
I have a section of a div container text that I'm trying to 'preview' another page, or at least show it when the mouse is over specific text - I don't want the actual text to be clickable since I need it to remain on the 'main' page
I've messed around using some custom CSS's to 'preview' data, locally, and provide a remote img src, but I cannot seem to find any examples to do this for a page.
You can get thumbnails of those pages that you want to show and when they hover that text you can show them that thumbnails. Tt is kind of tricking user since they are not actually seeing the page.
I am trying to figure out how the get the featured area
at http://blueoceanportfolios.com to link to webpages rather than displaying it within the featured box on the left .
This area is using JS file to display the videos on content in the featured box when different items on the menu are clicked, here is the working example :
http://www.blueoceanportfolios.com/company/
Okay ,
The problem: Loading a new webpage rather than displaying the content at featured box at the homepage of above website
Tried solutions: linking to javascript functions like onclick="window.location="http://someplace.com";" etc but still the content loads up in the featured box ,
try clicking on 2) it displays stackoverflow.com rather than loading new page.
Any suggestions ?
This:
<script type="text/javascript">
onclick="window.location="http://someplace.com";"
</script>
... is not the way to add event handlers to an element. If you want those anchors to link to a web page, put the URL in the href attribute like any normal link:
Link text
I have a text widget in my wordpress blog. Inside the text widget, i have a link. When mouse is hovered over the link, the link text shows up in the status bar.
To prevent the link text from showing in the status bar i tried using:
<a href="#" onmouseover="window.status=''" onclick="fun();return false;" > </a>
But, still the link text shows up in the status bar, when mouse is hovered over the link . i guess thats because the link is inside a text widget, so the status bar is inaccessible.
Still, is there any way to hide the link from showing up in the status bar when mouse is hovered over a link inside a text widget in wordpress ?
Thank You.
Since hackers abused this for malicious reasons, most browsers don't allow to modify the status line this way.
If you don't want status text in your status bar - don't use link, use button or span, styled as link.