I want to add a new input text box("image Caption") to "Image Properties" dialog window in CKEditor that gives my user to enter the "image caption" along with existed "URL" and "Alt Text".Is there any way i can do that.
I was able successfully add the input text box by using the following guides in the ckeditor(www.ckeditor.com) website itself.Very Useful.
Guide: http://docs.cksource.com/CKEditor_3.x/Howto/Editing_Dialog_Windows
API: http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.html
Sample: http://nightly.ckeditor.com/7491/_samples/api_dialog.html
Related
I'm new to apple scripting and I'm trying to copy two image from a folder and paste into outlook mail body, below is the code I have written so far to compose mail and I need help in pasting two images in the mail body.
I don't want it to be an attachment file, image needs to be pasted in mail body itself.
tell application "Microsoft Outlook"
activate
set theSubject to "Subject"
set theContent to "This is my content"
set theAttachmentFile to "XXXXX"
set sendToAddress to "abc"
set msg to make new outgoing message with properties {subject:theSubject, content:theContent} -> I'm missing something here
with properties {file:theAttachmentFile}
open msg
end tell
So in case if someone is struggling with this same question. I would like to answer what I implemented.
Compose your mail body content in html format and use img tag for inserting images in your mail body.
I have an Upload file option in Umbraco 7, the problem I have is if the remove checkbox is ticked and you click publish to remove the file, my code below catches the upload field as empty and display my custom error message.
if (string.IsNullOrEmpty(urlForFileUpload))
{
e.CancelOperation(new EventMessage("Error", "Please select an Excel file before publishing",EventMessageType.Error));
}
Does anyone know what gets passed to the server so that I can check for it and not display my error message if the checkbox is ticked?
--------------------CancelOperation---------------
You don't need an event handler to check that. Just make the field mandatory:
Folks,
I am having an interesting problem. I have some javascript on the webpage which opens a popup window when clicked. I am trying to find the title of the window so that I can click on that, the window has the following two buttons "Cancel" and "Save File". Here is what I am doing in my ruby code:
#windows = #browser.windows #this should return an array, so #windows is an array
p #windows[1] #output of this is #<Watir::Window:0x115c796cc located=true>
puts "This is the title of the second window---->"+#windows[1].title #this puts blank
The problem that I am seeing is why does my windows object does not have any variables when I print it out using p #windows[1] also why is the title not printed when I do #windows[1].title. My goal is click on the "Download the file" button of the popup window
This is the piece of HTML that I have:
<td>
<a onclick="window.open(this.href);return false;" href="/search/searches/1563/exports/1017">6175-1017-20120418181521-karnire.eml.zip</a>
</td>
The other thing that I tried is doing something like this in my code:
#windows = #browser.windows
#browser.window(:title => #windows[1].title).use do
#browser.button(:value => "Save File").click
end
for the above I get an error like this:
Unable to locate window "{639686d9-4641-aa41-bf6f-3ba89659d921}" (Selenium::WebDriver::Error::NoSuchWindowError)
I'd start with the information provided here on the watir-webdriver blog
if that does not work, then try looking at the watir-wiki page on file downloads?
It's a little dated (not having been updated in a year, also using autoit not rautomation) but it might be enough to get you going.
It might be that Watir isn't waiting for the window to load. Try putting a sleep(10) after the click.
I can add a new item for the folders right click menu using registry:
HKEY_CLASSES_ROOT\folder\shell\Your item name
But i don't know how to set a icon for created item like this :
May somebody help me?
To create a custom context menu with an icon when clicking on a folder follow these steps:
Under HKEY_CLASSES_ROOT\folder\shell\ create a new key: "MyContextMenu"
Under HKEY_CLASSES_ROOT\folder\shell\MyContextMenu edit the (Default) key to specify the text to show in the context menu: MyMenu
To execute a command when the menu is chosen add a new key name "Command" and set the commmand to execute in it's (Default) value. For instance: cmd.exe
Now to set the icon you add a new string value name Icon and set it's value to the *.ico you want to show or you can reference an ico that is embedded in a dll using [name of the dll],[icon number] A lot of the default windows icons are in imageres.dll. So for this example set the value to: c:\windows\system32\imageres.dll,10
There is a nice tool called iconviewer that you can use to examine icons in dlls. After you install it you can right click a dll, open it's properties and an extra tab with it's icons will be added to the propery pages
You should to add iconpath in this key for showing when the user clicked right button.
Try to write key OpenWithProgIds, and then create value with name (path) of your application.
Example for recycle:
TRegistry *key=new TRegistry(KEY_ALL_ACCESS);
key->RootKey=HKEY_LOCAL_MACHINE;
key->OpenKey("Software\\Classes\\CLSID\\{645FF040-5081-101B-9F08-00AA002F954E}\\shell", false);
key->OpenKey("Prog_name", true);
key->WriteString("Icon", ExtractFileDir(Application->ExeName)+"\\icon_prog.ico");
key->OpenKey("command", true);
key->WriteString("", ExtractFileDir(Application->ExeName)+"\\Program.exe");
key->CloseKey();
I'm trying to save the full content of the current static web page, using the code from Show IE "Save As" dialog using Watin
So here it is:
IE ie = new IE("http://localhost");
// more code
//I expect out.html is the output file
FileDownloadHandler fileDownloadHandler = new FileDownloadHandler("out.html");
//I expect this line to popup the save as dialog box, but nothing happens
ie.AddDialogHandler(fileDownloadHandler);
//the program is blocked at this line, as it can't click anywhere
ie.Link("startDownloadLinkId").Click();
fileDownloadHandler.WaitUntilFileDownloadDialogIsHandled(15);
fileDownloadHandler.WaitUntilDownloadCompleted(200);
I also tried the code below, but it doesn't save all the page:
System.IO.StreamWriter file = new System.IO.StreamWriter("output.html");
file.Write(ie.Html);
Again, I need to save the webpage from Watin, and the result to be the same as saving it manually.
Thanks!
Here is how I do it:
File.WriteAllText("myfile.html",
(myIE.InternetExplorer as SHDocVw.InternetExplorer).Document.documentElement.outerHtml);
Assumes myIE is a WatiN IE element, of course.
If you're ever having difficulty finding how to do something with WatiN, I often find it helpful to google how to do it with an "Internet Explorer COM object". WatiN wraps the object, but it is exposed and able to be accessed!
Cheers!
Try to parse the html with html agility pack and save it, there are additional abilities that you can use...
using HtmlAgilityPack;
var htmldoc = new HtmlDocument();
htmldoc.LoadHtml(ie.Html);
htmldoc.Save(stream);
Link to agility pack