TinyMCE empty link popup - javascript

When I try to insert a link using the TinyMCE link plugin all that happens is I get an empty popup box.
It continuously tries to load:
tiny_mce/utils/mctabs.js
tiny_mce/utils/form_utils.js
tiny_mce/utils/validate.js
tiny_mce/themes/advanced/js/link.js
I've seen solutions where you need to edit a config.php file, but I only have the JS version of TinyMCE

It happens to me all the time in Opera, but not in other browsers. Try refreshing the empty popup you get and you'll probably get its contents.

Related

How can I save the content of tinyMCE before destruction? (close tab, navigate etc.)

We have a webpage which has a tinyMCE editor tied to a DB. In this webpage we have some buttons like „Help”, „Settings”, „Logout” which can 'erase' (let's use this terminology) the content of our tinyMCE editor, because these buttons open another layout(s) in which, of course, the editor is absent.
We want to trigger our „Save to Db” subsystem when the user:
Clicks anyone of buttons which destroy the editor (see above)
Destroy the tinyMCE editor by closing the tab / browser.
Destroy the tinyMCE editor by navigating somewhere else (eg. from ourSite.com to google.com)
Now we tested all the above and (of course) the content isn't saved.
How can we achieve this automatic save on destroy?
The solution must work on Chrome/Edge, Firefox and Safari.
Notes:
we tried this demo: https://fiddle.tiny.cloud/hRhaab/2 (hooking the „remove” event) but it doesn't seem to work.
an alternative popup with „The data is not saved. Do you want to continue?” is also acceptable.
the data is rather small. No images, just some text (few A4 pages at most).
in the case of buttons, we try to avoid the obvious solution by writting a DoSaveMyEditor() under each button
Any help?
You can utilize the TinyMCE Autosave plugin. It does the job by itself but saves the data to local storage. However, it can be identified by setting an autosave_prefix and then taken out of the storage and uploaded to your DB.

How to change Chrome extensions internal HTML page

I've done some looking around and couldn't find any solution to this problem.
I'm creating a Chrome extension, with a manifest that points to the opening file home-times.html. This works, though I want to redirect it internally to the other page home-welcome.html inside the extension so it loads another page INSIDE the extension.
I've read a lot of questions that refer to changing the current tab's page, though that's not what I am after.
Tests
By using the following code:
test
Opens a new tab, with the extensions page that I am trying to access in that new tab.
If I got you right, you want to change your popup innerHTML, in this case I suggest using jQuery, to change original file to the result you want.
If you just want to open new tab, with your home-welcome.html, you can do this, in your popup.js :
window.open('home-welcome.html','_blank')
If none of this is what you are looking for, can you please provide an example, I will try to help.

How to create a print dialog that displays the current web page's screenshot

I just want to know if there's easy way to create a print dialog for WordPress that outputs on the print dialogue box the actual view of a webpage. P perhaps a full page screenshot might work as long as it has the full page's height.
I tried WP-Screenshot plugin on this page. The plugin outputs a screenshot that can be printed out by adding a print dialogue plugin. However, the the height of the image produced by WP-Screenshot can't be dynamic so I guess I need to find another solution.
I can't find a plugin that has the functionality to print the current webpage with all the styles preserved in the print dialogue. So I'm thinking that screenshot might work.
Any idea or suggestions?
For printing the page and getting print dialog you can simply use window.print()
For better understanding please visit window.print()

page source doesn't have dynamic div element

I am dynamically adding the content of "div" in jquery it is added in DOM. but in view page source i can't see dynamic content of an element
<div id="pdf"></div>
("#btn").click(function(){
$("#pdf").html("ffff");
});
how can i get updated page source after made dynamic changes. it is added in DOM but page source doesn't have the content ? why ?
Thanks,
Siva
The page source is the page source - a raw text file which cannot be changed. It is hosted on the server and it's obvious you can't made any changes to it. Once you visit a web page, your browser queries to read that text file and then it parses it to the DOM. When you do any javascript/jQuery magic like adding new html elements, you do it on the DOM.
that's just normal behavior, the source is allways the original source of the page and it doesn't show changes made after page load. If you want to check the source after changes use a tool like firebug or chrome developer tools.
EDIT:
As Johannes H stated you no longer require firebug since major browsers all include developer tools.
If you use Firefox you can get the "web developer" plugin, then view "generated source". This will show the jQuery added div.
When You are viewing the page source the javascript will not run, so the dynamic elements will not be added.
To get the sources you can use your browser developer tools:
click f12
choose the top element and press copy as html.

Javascript HTML Window Print Issue

I am using window.print() Javascript function for my HTML page to print, but it inclues Page URL and date in footer by default into the print or print preview.
Any quick solution, might be some patch in JS or something?
You can't remove the headers/footers programmatically. Visit this link or this SO question

Categories