Javascript example tutorial (19) Use HoTMetal (1)

Source: Internet
Author: User

HotMetal PRO 6.0 is a powerful and easy-to-use website editing and publishing tool. In this tutorial, we use javascript in HotMetal. In HotMetal, JavaScript Supports rich resources and Objects Based on HotMetal. It contains several new objects, such as the object accessing the DOM. In addition, HotMetal supports ActiveX controls. These controls and Windows Script support make HotMetal an indispensable and powerful development environment for JavaScript designers.

In this tutorial, you will learn:

How to add a connection macro for the button;

How to add a button to a menu bar;

What kind of resources are suitable for script writing;

How to compile a script in the document format;

How to write a script to check the Last modified Date;

How to compile a script for saving the module;

How to identify all predefined macros;

Okay. We will introduce them one by one from the next page.

Use Javascript in HoTMetal

1. How to add a connection macro for the button:

HotMetal supports scripts through macros. Macros can be called using toolbar buttons and other methods, which will be involved in subsequent tutorials. All HotMetal macros should be stored in a single file, such as hotmetal. mcr. This file is in the macro folder SoftQuad \ HotMetal PRO 6.0. If you have installed HoTMetal PRO 6.0 in the default directory C, your Macro file is in C: \ Program Files \ SoftQuad \ HoTMetaL PRO 6.0 \ Macros \ hotmetal. in mcr. Note that the file extension is. mcr, but it cannot be edited in the HoTMetal environment. You can use any text editor to edit it, such as Notepad. HotMetal PRO 6.0 installed around 20 predefined macros for users. You can browse them through the hotmetl. mcr file. You can also find them by selecting Macros (macro) on the tool menu.

One way to allow macros is to create a toolbar button and connect it to a macro. Click the button to trigger the execution of the macro-defined script. When you select a toolbar from the attempt menu, you will see the 1 dialog box.



(Figure 1)

The first tag (Toolbars) in the figure allows you to add, delete, and operate toolbar. Because we do not want to change any toolbar, we do not use this label for the moment. Click the button label and select "Application Macros" from the category bar. Note that the new text dialog box appears on the right, as shown in figure 2:



(Figure 2)

The first macro in the list box is "Apply Layout to Document .". Let's install a button for it to the Standard toolbar.
First, select an image for the button. When you click the select image button, you can select an image from multiple color palette. Once you click one of them, you will get a window of 3:



(Figure 3)

In this example, select a yellow smiley image, as shown in Figure 4:



(Figure 4)

Drag the smiling face icon to the Standard toolbar or other toolbar. Close the toolbar and Menu customization dialog box. This is the new button that appears in the Standard toolbar or other toolbar you choose. Below is the Extended Standard toolbar view, as shown in Figure 5:



(Figure 5)

Now let's try this macro. Open an HTML file. For simplicity, select about.htm in D: \ Program Files \ SoftQuad \ HoTMetaL PRO 6.0 \ Tutorial \ samples \ lesson1. Click the HoTMetaL PRO 6.0's HTML Source View tag, move it to the right with spaces in front of them, and then click the smiley button in. This is why the source program automatically changes to reflect the layout definition described in the Custom dialog box. Then you will see the source code return to its original surface format.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.