Does anyone know how to disable TinyMCE alerts, and confirms. The confirm in talking about says:
This page is asking you to confirm
that you want to leave - data you have
entered may not be saved Leave Page -
Stay on Page
I've written my own stuff that detects if the page data has been change so I don;t want TinyMCE to worry. I found the function in the TinyMCE source so I'm about to overwrite it but I want to know if anyone knows a better way to accomplish this.
Thanks.
To remove the message, just disable the autosave plugin, that's what adds the onunload prompt.
Simply don't load the plugin in your TinyMCE initialization script.
As per a request I'm adding this here to show my solution which has worked great:
My solution thanks to a link provided by Madmartigan, on the TinyMCE forum. Getting rid of the autosave plugin did not work, I ended up writing this:
window.onbeforeunload = function() {};
And it got rid of the popup. Looks like it could be a bug with TinyMCE, since the init code I have I copied off their demo.
I set it as a param when initializing (autosave_ask_before_unload):
tinymce.init({
mode: 'textareas',
menubar: false,
statusbar: false,
language: 'sv_SE',
autosave_ask_before_unload: false,
...
If the problem you're having is just that the content isn't actually dirty, maybe because you replaced it programmatically, you can explicitly mark the editor as not dirty like this:
tinyMCE.activeEditor.isNotDirty = true
Neither of the above answers worked for me with Joomla 3.3.2 and JCE 2.5.11. Although this did work:
Inside the file -
components/com_jce/editor/tiny_mce/plugins/autosave/editor_plugin.js,
I changed
editor.getParam("autosave_ask_before_unload",TRUE)
to
editor.getParam("autosave_ask_before_unload",FALSE)
Apparently on autosave unload, it prompts the confirm box. This disables the unload confirm completely. From what I tested, it worked in IE, Chrome, and FF.
Related
tinymce to manage my contents. it's ok, works but there is a small thing that i a curious to know is that why tinymce changes urls by it's own. for example:
i put a link and using url like /post/post1
but whenever i check my url, tinymce makes it like: ../../../../../post/post1
however, it's ok and does not break my link, but that feels bad to see!
this also happens for images
Django:3.2.12
django-tinymce: 3.4.0
tinymce (by it's own): TinyMCE 5.10.1
Try adding to tinymce.init - convert_urls: false
I use froala editor first time and now I have problems. On the first page froala works very good, but on the second page - editor doesn't work. When I click on toolbar buttons I have noting. Text length always equals zero and placeholder doesn't hide. Please Help me to fix this problem.
<script src="/public/bower_components/froala-wysiwyg-editor/js/froala_editor.pkgd.min.js"></script>
And.
$("#page_x2j1").froalaEditor();
I ended up using this reference to do the initialization on load and everything worked great.
$.getScript("js/froala_editor.pkgd.min.js", function () {
It looks like there might be a conflict with something else on the page. It would worth checking if there aren't other JS libraries which are preventing the editor editor toolbar to work correctly.
I'm running into this weird issue with TinyMCE where selecting a text and adding a link to it without "http://" will cause the new link to append to the current URL.
Example (assume my website is www.example.com):
Now under my settings "click" will link to "www.example.com/linkexample.com". I need it to link to "http://linkexample.com" instead, without manually adding "http://" in the "Url" field in the popup.
I've been trying different solutions online but nothing seemed to work for me.
Here is the list of solutions I've tried so far, none worked for me:
TinyMCE: How to prepend 'http://' to URL if it's not there
All examples from : http://www.tinymce.com/tryit/url_conversion.php
P.S. I'm running the latest TinyMCE 4.1.7
I'm done to try this one. it's worked for me (tell me if this thing
worked for you)
Go to link plugin on tinymce (tinymce/plugins/link)
Edit this file plugin.min.js (tinymce/plugins/link/plugin.min.js)
Find www using Ctrl+F in your editor like Notepad++ or Sublime Text
You will get this code /^\s*www\./i delete www\.
Now your code become /^\s*i
Now Save it. Done
Refresh your code using TinyMCE.
Now try use linkexample.com, You will get notification to add prefix http://
Done. I hope help you out.
In version 4.x this functionality is built in. But unfortunately it's not mentioned in the documentation, it's only documented in the changelog so I would imagine this is widely unknown.
$('textarea').tinymce({
...
link_assume_external_targets: true
...
});
I actually replaced this code:
/^\s*www./i.test(e)
with
!(/^\s*(http://|https://)/i.test(e))
I want to change layout of google chrome alert box, My basic need to alert value like "Item added sucessfully" but in google chrome alert box it is good to see can it is posible google chrome alert box show like a model window in the center of screen with some effective design?
Changing built-in alert dialog box for chrome/IE/FF is not possible.
Workaround is to use jQuery alert dialog.
Same question has already been asked here and answered.
you can also see an example in jsFiddle
$("<div>Test message</div>").dialog();
you can use alert("Item added sucessfully");
i suggest you to work with fancybox http://fancybox.net/ i don't think alert can be designed.
sometimes alert can be annoying and can be disabled by the browser if popping more than once, i suggest to use something else like facnybox
Frankly it isnot possible to change the default alert box. It is set by the browser devlopers and cannot be changed on the client side. Rather try popupwindows using jquery
Popup jquery
or a custom div popup or use some jquery code after searching which ever suits you the best :)
I know the answer is two years old, but I just wanted to point out that there is a good reason why you can not style some elements including the alert. It's security issue. If the alert could be customized, then the user may be tricked into doing something that he is not expecting.
Personally I use Swal, it's great jQuery plugin and can be easily customized to any web design.
http://t4t5.github.io/sweetalert/
Here's the thing
I have this master page, and in one of its slave pages there's a couple of Excel report generators, which, when retrieving the data, they take quite an awefull time because of the ammount of the data.
Well, i'm using a simplemodal windows to show a little gif to keep the user entertained. The thing is, i want this modal to close once its done doing the work
I can close it with the ESC key, but i want it to close by itself once its done working. I already tried with this code
SimpleModal breaks ASP.Net Postbacks
but it didnt worked, maybe its cuz i'm creating an excel file from a gridview, and its writting the scripr to another buffer.
I'm thinking on having close button on the modal once the whole thing its finished, but i'd rather have it close by itself
Any idea on how i can accomplish this will be pretty much appreciated
While I can't provide much help with SimpleModal, maybe you shouldn't use a modal dialog to show a loading/progress icon. I would suggest taking a look at spin.js:
http://fgnass.github.com/spin.js/
This probably makes a little more sense for your use case, and is pretty easy to use.
Good luck!
Try appending to the .NET form, this fixes some issues with jQuery's dialog so it may help.
$("#sample").modal({
opacity:80,
overlayCss: {backgroundColor:"#fff"}
}).parent().appendTo("form");
On the "work is done", you can programatically close the dialog using:
$.modal.close();
Well, i didnt wanted to use a popup windows, but given that to create a Excel file from a gridview needs to write the html of the gridview on the buffer and execute it, it was never reaching the part where the javascript was to be written and executed, so, no other choise than send the dataSet over a Session variable into a popup windows which generate the excel file, so having somehting like a parallel work
I had a pretty ugly issue with IE8, my save dialog wasn't appearing, it worked on IE6 and IE7, as well with opera, firefox and chrome, but IE was giving a issue. Found there's a security option which that didnt allowed the save dialog to appear. For any one having a similar issue, its on Internet option -> Security -> Custom Level... -> Downloas -> Automatic Prompting for file downloads -> Need to be "Enabled"
Any way, thanks for tha help, hope this info also helps someone else!