I am unsure if this is possible...I am currently working on a VBS script which fills in a web form and uploads a file. However, the upload button is a HTML input field of type "text"...The way I am planning to approach this is to remove the attribute type="file" and replace it with type="text". Then I am planning to populate the resulting text box with my file location and click upload afterwards. This works great when done manually through the browser developer tools.
However, I am limited to use of VBScript as the solution must be supportable by my colleagues. Has anybody got any ideas?
With some determination I stumbled through and produced an answer to my own Question:
IE.Document.All.Item("testYOYO").type = "text"
IE.Document.All.Item("testYOYO").value = "testtest"
You can try:
IE.Document.getElementsByClassName("testYOYO").Item(1).removeAttribute(the Attribut)
Good Luck
I'm trying to convert a rich text on a TRichEdit component to HTML tags.I have a function for that, but it doesn't work because the text in the component is always sent on PlainText. The option PlainText on the component is set as false.
Example: *Text in RichEdit: The house is blue. When I invoke the function is sent without the bold format in the text: RTFtoHTML(RichEdit.Lines.Text).
How can I do on the component or in other side to read this text like RTF?
I have read other questions and it didn't solve my problem. Thanks for your help.
There are a few 3rd party commercial components that do this quite well such as WPTools or TRichView. Both will attempt to optimize the generated HTML using CSS styles where applicable. Both support Delphi 2010, as well as the latest version of the compiler (Delphi Seattle as of this answer).
I currently have a textarea control on a page. The user will enter text into the control. The content of the control is bespoke code.
I want to (from code) be able to apply formatting (color / bold / italic / font) to different parts of the text- very much like visual studio.
Like visual studio, and any other IDE, i dont want the user to have control over formatting the textarea- most editors i see give a control which the user can change style.
Any thoughts would be much appreciated.
I'm guessing you're talking about a WYSIWYG editor for a textarea. You should try using TinyMCE or CKEditor. These editors use a html attribute called 'contentEditable'. So by setting this attribute to true (e.g. <p contentEditable="true"></p>) they can then use the content editable javascript methods to edit it, providing an interface that calls the javascript of course. You can read a little about contentEditable and the similar attribute designMode here on WebMonkey.
I write an application and inside of HTML code I have custom tags (of course these tags are parsed on server side and end user gets them as valid HTML code). Example of custom tag usage:
<html>
<body>
...
<Gallery type="grid" title="My Gallery" />
...
</body>
</html>
1.) How can I have eclipse recognize my custom tags inside of HTML code and add syntax highlighting to them?
2.) How can I add auto-suggestions to my custom tags? For example if I type "<Gallery " press "Ctrl+Space" - in the list of available attributes it shows me "type" and "title" and if I type "<Gallery type=" press "Ctrl+Space" I would see list of available values only for tag "Gallery" and its attribute "type".
Thanks in advance!
Not really what you want, but maybe it helps you:
You can try the Aptana Plug-in for Eclipse. It allows to write your own regular expression for HTML validation, so a custom tag would be ignored by the validator.
E.g.:
.gallery.
Eclipse allows you to add simple auto-suggestions via Templates. On
Eclipse 3.7.1 (Indigo) + PHP Dev Tools (PDT) 3.0.0: Window > Preferences > Web > HTML Files > Editor > Templates
Sadly, there is no easy way: you have to roll your own parser for this, and then add both your extra elements and the base grammar (HTML) to it.
If you have your parser, you could use it to do syntax highlighting (strictly speaking, for that simple lexing is enough); and a good parser can support content assist (auto-suggestions in your terminology).
Caveats:
Creating a parser for HTML is not an easy task. Maybe by aiming at a more often used subset is feasible.
If a parser exists, the editor parts are still hard to get well.
Some help on the other hand: you could use some text editor generators to ease your work:
Eclipse IMP http://www.eclipse.org/imp/ can in theory handle any type of parser, but currently it is most optimized for LPG. The documentation is scarce, but the developers are helpful in the forums.
Xtext http://www.eclipse.org/Xtext/ got quite a hype for creating text editors for DSLs. The generated editors are quite nice out of the box, but is not the best solution for large files. Has a really helpful developer community.
EMFText http://www.emftext.org/index.php/EMFText is a lesser known entity - I don't know it in details, but I guess, it is similar to Xtext.
I know its been a long time since this Q was asked,
but I hope this might help others like myself that reach this in search of a solution.
So, When using Eclipse (Mars.1 Release (4.5.1) - and possibly earlier - I did not check).
Go to Window - Prefrences
Then in the dialog that opens go to Web - HTML Files - Editor - Validation.
On the right side:
under Ignore specified element names in validation and enter the list of custom elements you use. (e.g. Gallery,tab,tabset,my-element-directives-*)
you might also like to go under Ignore specified attribute names in validation do the same for your custom attributes.(e.g. ng-*,my-attr-directives-*)
Two things to note:
After letting eclipse do a full validation you must also close the file and reopen it to have the warnings removed from the source code.
Using this method would ignore those attributes under any element. I don't think there is a simple way to tell it to ignore some-attribute only if its a child of some-element.
I find templates are an ok alternative but let's see if we can encourage a more robust solution; please take a moment and vote for this: https://bugs.eclipse.org/bugs/show_bug.cgi?id=422584
You need to add a new HTML template.To add a new template, complete the following steps:
1) From the Window menu, select Preferences.
2) In the Preferences page, select Web and XML > HTML Files > HTML Templates.
3) Click New.
4) Enter the new template name and a brief description of the template.
5) Using the Context drop-down list, specify the context in which the template is available.
6) In the Pattern field, enter the appropriate tags, attributes, or attribute values (the content of the template) to be inserted by content assist.
7) If you want to insert a variable, click the Variable button and select the variable to be inserted. For example, the word_selection variable indicates the word that is selected at the beginning of template insertion, and the cursor variable determines where the cursor will be after the template is inserted in the HTML document.
8) Click OK to save the new template.
You can edit, remove, import, or export a template by using the same Preferences page.
Reference : http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.wst.sse.doc.user%2Ftopics%2Ftsrcedt024.html
I want to write an app that will render html using Outlook 2007/Microsoft Word 2007's html layout engine ...
I'm trying to do some research but keep coming up empty unlike with the IE HTML layout engine, for example, http://en.wikipedia.org/wiki/Trident_(layout_engine)
I just want a code name, dll location, a point in the right direction ... something ...
Thanks for your help in advance
I believe what you are looking for is the MS Word OLE component. You can basically embed Word in your application using OLE and there should be a lot of OLE documentation on MSDN.
Examples using VBA: http://support.microsoft.com/kb/237337
MS Office Developer Portal: http://msdn.microsoft.com/en-us/office