I have a plug in in the old FCKEditor I would like to rebuild. I saw an example that leveraged the iFrame code. The I've got the button defined and working, I get the dialog, but I cannot figure out how to get the selected text/html into the dialog so I can manipulate it.
My plug in is an approximaiton of the MS File dialog box. When the user clicks on a file that is listed (or an html page in the list) my code updates the link text box with the URL to be used in the HREF property... I cannot find anything that will tell me how to get selected text from the editor and replace it with the edited code once my dialog does it's work... Any suggestions? I am intermediate with this so if you post code please comment on what's happening so I can understand. Thanks.
Seems my cookies got cleared.... Here is an update. I use the following code:
CKEDITOR.instances.editor1.insertHtml('<a href=\x22www.google.com\x22>'
CKEDITOR.instances.editor1.getSelection().getNative() + '</a>');
I get the appropriate code pasted into the CKEditor instance on FireFox, but on IE (6.0 here at the office) it posts [object Object] and the source URL displays:
[object Object]
Is there some issue i am missing? I am on CKE3.0 and will be downloading 3.01 but their changelog did not seem to have anything related to this so I am not sure if this is a bug or not.
Related
Today, I open my website which use CKEditor.
I encounter a strange behavior. In any page that has CKEditor, jquery click event listener seems to not work.
This is odd. I have try to open the same website in chrome and firefox 32 with no problem.
I even try to visit CKEditor website to make sure that this problem is not caused by my script.
And I can ensure that the problem is occurred exactly as in my website. CKEditor has javascript based menu, if you click "Full featured" link, the element on the left-side should be changed with respective element. But it doesn't response as it should be. (Just for the record, this website also works fine in chrome and firefox 32)
I have also use firebug to find any helping-error-message, but I can't find any error message there.
I am sure this must be firefox's bug. Hopefully they will fix this in firefox 34.
However, does anybody experience the same problem? Is there any workaround for this?
UPDATE : Seems that this problem is caused by plugin (firePHP or fireQuery). Look at the comments for more information.
This is a real 2%er but here goes, I have created a winform in VS2010 with Gecko 2.0.1-0.10 (latest release) webbrowser control, I am using a touch screen to navigate. Sometimes when clicking a hyperlink it will select text rather than navigate, on the DomMouseUp event I want to check to see if there is selected text, if so I want to see if it is a hyperlink and if it is, where that hyperlink goes to. I had a mess around with GeckoSelection but nothing looked obvious. I am looking for a way to see if what is selected within the web browser is a hyperlink, any thoughts?
I've worked it out : for anyone interested in such things, use DomFocus on the gecko control:
m_strInnerHtml = geckSel.ActiveElement.Parent.InnerHtml.ToString();
That will give you the innerhtml of the selected item, from here you can extract the href tag and get the url, navigate to it, hey presto :)
Update: An even better solution is to use (in DomFocus again)
m_strInnerHtml = geckoWebBrowser.Document.ActiveElement.GetAttribute("href");
This will return the actual hyperlink address, one thing to watch out for however is if you're on google for example and select the "Advertising" hyperlink at the bottom of the page, it may return "/advertisingpage/" which must be appended to the original url. Clicking a hyperlink away from google will return the full address however.
Very good behavior gives this call:
m_strInnerHtml = geckoWebBrowser1.Url.AbsoluteUri()
I am playing with MarkdownDeep .Net/Javascipt Edition for an MVC 3 application. Added it via NuGet. The page renders Markdown sharp box just fine. However I get a weird jump to top of page behavior if any of the icons on the markdown sharp toolbar are clicked. I googled and didn't find anyone else having this issue.
Any thoughts? The script file and css are being loaded properly - no errors in Chrome console.
Have you checked that the microsoft ajax scripts are included in the page and that the web.config file is configured to use it? Try something simple like a ajax.beginform to see if it posts the page or if it calls an ajax post.
I am using WATIN Version(1.3.0)
I am in a situation that when i click on a node ,a Wizard appear. That wizard contain several controls(checkboxes,buttons and TextFields) and it has many screens(when next button is pressed , the next screen appear) but i am unable to handle it. I have apply the following techniques but failed
I have used ie.HtmlDialog but exception appear
I have grab the internal iframe (which is the main frame) but its HTMLDocument contains nothing. Where as i contain HTML when i look into it using IE8 Developer Tool
I have tried to use mshtml.HTMLDocuemntClass but failed
Wizard has url but unable to grab it by url
Unable to grab it by using ie.Form
Please HELP !!!
Thankx in Advance
Is the wizard held in an update panel or anything that is AJAX enabled? if this is then WatiN will not realise that the page has actually refreshed and will therefore not be able to find some of the elements it is looking for
Paul
I am creating a Firefox extension that is somewhat similar to Firebug. There is a panel (or vbox) at the bottom of the browser that allows users to specify colors to certain Html elements. When they click the OK button, I would like these colors to get updated on the current web page.
I have my JavaScript working when I click the button (i am just throwing an alert), however when I change that JavaScript to change the css or styles of an element (by either using document.getElementById or jquery), nothing changes.
Is there something with Firefox extensions that I am missing? Any help is appreciated.
Let me know if you have any questions. Thanks
https://developer.mozilla.org/en/Extension_Frequently_Asked_Questions#Accessing_the_document_of_a_webpage_doesn%27t_work
You want content.document.getElementById() and similarly for every other construct you use.