tinymce execCommand behaving weird in Chrome - javascript

I got a custom button that when I click it with the editor opened, it does the following:
tinymce.execCommand(command, false, action)
command is for example "mceToogleFormat", and action can be for example "bold" to toggle a text node from normal to bold.
Weird thing is, if I press that button, it doesn't apply the bold format, and the caret goes to the beginning of the text.
Now if I run the same line of execCommand in the console, it runs perfectly... i'm really intrigued on why this isn't running during runtime with the custom button, but it's working when i write it in the console.
I upgraded the tinymce to the last version 4.1.7.
I was using 4.0.26 and the code works perfectly with it.
After debugging tinymce code and my code, i saw that the range is somehow lost when i click on my custom button.
Is there any way to solve this? Is it a focus problem? I thought about that, but... shouldn't I be losing the focus when i click in the console too? and nevertheless, that works? I can't understand this anymore, I really appreciate any help given.
(Firefox and IE 11 works as intended, only Chrome is having issues)

Related

javascript onclick is not working

I have an onclick event that works in IE and FireFox, but not in Chrome. Request your inputs on fixing this.
onclick="; var extras=actNoExtras();actHandleReturnValue(actOpenDialogEx('/SiteScope/UI/SelectTableColumns.do?tableId=rfw_monitor_report_monitor_table0_29_0'+extras, 'dialogHeight:400px;dialogWidth:450px;scroll:no;status:no;resizable:no;help:no;dialogtop=184.0;dialogleft=287.0', 'height=400,width=450,top=184.0,left=287.0,scrollbars=no,status=no,resizable=no,modal=yes','no','button.arrange.columns.table', 'true','act'), '');"
I doubt this is it, but could it be due to the extra ';' at the beginning of the code? Also what do you mean by not working. Does the dialog box not open?
In Chrome, you can press F12 and click on the Sources tab to debug your code. If there is an error, you will find an X symbol inside a red circle, along with a text regarding the error.

Chrome Inspect Element is not showing all Javascript

The current project I am working on builds a page's javascript code based on some conditions. All the code works but when I go to the Developer Tools to see it, it is not showing. Or more like it is truncated and 3 dots added at the end.
It seems to be a change with the recent update. It is extremely annoying to not be able to see everything. Does anyone know how to make it show everything? If it helps, I'm working on a mac. Thanks.
Chrome Version 42.0.2311.152 (64-bit)
If you right click on the <script> tag and select "Edit as HTML", you'll be able to access the whole script, without the hyphenation.

JQuery Mobile - history back breaks firefox

So I'm working on a big system using JQM and the problem I'm running into is that after I use a history.go(-1) to change page (with a cancel button) firefox breaks entirely. All pages on all open firefox windows and tabs no longer display correctly, and some of the UI buttons are even becoming more transparent. The page that I transition to has all coloration replaced with solid black. I don't know what to do to debug this because I don't know what's actually happening here. Could someone possibly explain what's happening to firefox?
Note: I have attempted to pick up an error message in the console, but when the firefox javascript console is open, the bug stops happening.

HTML Rich Text Editor problems with justify* commands

I'm writing a simple Rich Text Editor which is currently working perfectly in Chrome and Firefox.
Internet Explorer however, is another story. I have finally managed to get most things working in IE with work-arounds and such, but all of my justify commands do nothing.
That is, this bit of code has no effect.
iframe.contentWindow.document.execCommand('justifyRight', false, null);
This is despite all other commands (ie: bold, italic, etc) working just fine.
Any clues as to why the justify* commands are different and not working?
I have a live demo available at http://www.hazaarmvc.com/site/test
Turns out that it was simply the content inside the editor window (an iFrame) that was the problem. It was originally generated using a Mozilla editor. Due to the differences in how each browser renders it's HTML content, IE just didn't know how to apply it's version of justifyleft, etc. Working on an empty editor everything just worked as expected.
See "Internet Explorer Differences" here: https://developer.mozilla.org/en/docs/Rich-Text_Editing_in_Mozilla for an explanation of what is different.
I'm going to chalk this one up to IE just being crap.

nicEditor link problems in Chrome and Firefox

I'm using nicEdit with the "link" button. And I have different problems with Chrome and Firefox when: I don't select any text and introduce a link and a title, then click Submit Query.
In Chrome, a link with the correct URL appears but with the content "javascript:nicTemp();" (ie, that's the html between the tags).
In Firefox the results is different: nothing happens.
Does anyone have a clue of how to fix/change this behavior?
If you download the nicEdit source you'll be able to see the executed code in src/nicLink/nicLink.js
There are forks on GitHub that have this fixed, e.g.: https://github.com/danishkhan/NicEdit
I experimented the same problem with nicedit (Version 0.9 r23 released January 4th, 2009. )
when using FF6.0
Finally, when pressing link button with a selected text AND do'nt filing the link text, it works.

Categories