pvii productivity tools 01
- Add to Cart - $45
- Overview
- Load Handler
- Move JavaScripts
- Link JavaScripts
PVII Move JavaScripts (Move to External File)
The system contains two Commands:
JavaScript - Move to External File: Moves the existing JavaScripts on your page to an external file and creates a link to that external file on your page.
JavaScript: Import From External File: Allows you to select an existing external JavaScript file and move all of the scripts contained in that file back to your page. This will also remove the link to that file if it exists on your page.
Command 1 - JavaScript: Move to External File
Overview
The system will look at all of the JavaScripts on your page, create an external JavaScript file, then it will move the scripts from your page to the external JavaScript file. The existing scripts will be removed from your page and a link to the newly created JavaScript file will be inserted. The page will work just as before, but the scripts will now reside in the external file.
This can also be a handy way to clean up a page after a few Behavior insertions or after you've copied and pasted a few scripts. The system allows you to exclude (keep on the page) scripts that appear in the <body> section, or even in the <head> section. This is especially handy when you wish to maintain the functionality of certain scripts that require being placed in the <body> or <head> sections of the page.
In order to maintain full flexibility, as well as forward compatibility, the system allows you to select the syntax used for the link to the external file.
You can easily create a new JavaScript file or you can replace an existing external JavaScript file. The system allows you to place the new external file anywhere in your defined site.
Running the "JavaScript: Move to External File" Command
-Choose Commands --> PVII Productivity Tools --> JavaScript - Move To External File and the interface will Open
Note: The Command will be unavailable (grayed out) if there are no valid script tags on your page.

-Select the Scripts to Move Option to select which parts of the page should be scanned for existing JavaScripts that are to be moved to the external file:
- All JavaScripts on the page (the default)
- Only scripts in the <head> section
- Only scripts in the <body> section
-Set the Link Options to set the desired syntax for the link to the newly created external JavaScript file.
-Click OK to start the externalization process. The Save as External JavaScript File dialog box will open.

-Navigate to the folder you in which you'd like to save your new JavaScript file. You can use the Create New Folder icon to create a new folder anywhere within your site.
Note: You can cancel this process at any time and return to the main interface by clicking the Cancel button. You will return to the main interface without any changes being made to your page.
-Enter a name for the file in the File Name box or, if you wish to overwrite an existing file, simply select that file in the listing. The system will assure that the file is saved with a proper .js file extension, even if you specify another file extension or do not enter one at all.
Note: If you choose an existing file, the system will prompt you with an overwrite warning, click Yes if you wish to overwrite the file or No if you wish to cancel.
-Click the Save button to save the new external JavaScript file. The file will be created in the folder that you selected. The scripts will be removed from your current page and a new script tag with a link to the newly created JavaScript file will be inserted into your page. A confirmation dialog box will display:

-Click OK to close the interface. As the message in the dialog box indicates, you should save the page (File-Save) to preserve the changes that have been made to your current page.
The Interface
Scripts to Move
The Scripts to Move selection allows you to determine which parts of the page should be scanned for existing JavaScripts that are to be moved to the external file:
All JavaScripts on the page
This is the default option. The entire page will be scanned and any JavaScripts found will be moved to the external file.
Only scripts in the <head> tag
Choose this option if you wish to restrict the scan to just the <head> section of the page. Scripts elsewhere on the page will not be moved to the external file (they will remain on the page, unaffected). Some scripts, because of their interaction with page elements, require that they be placed within the <body> tag to work properly. This option allows you to preserve those scripts while still externalizing scripts found in the <head> section.
Only scripts in the <body> section
Choose this option if you wish to restrict the scan to just the <body> section of the page. Scripts elsewhere on the page will not be moved to the external file (they will remain on the page, unaffected). This option allows you to preserve scripts located in the <head> section, while externalizing scripts found in the <body> section.
Link Options
Link options allow you to select the syntax for the link to the newly created external JavaScript file. You can choose to include the language attribute, the type attribute, both the language and type attributes, or no attributes. These attributes describe the scripting language being used in the file, which in this case is JavaScript. Prior to HTML 4, the language attribute was the accepted way to tell the browser what scripting language was being used. HTML 4 introduced the type attribute and deprecated the language attribute. The type attribute is now the standard means of setting the scripting language and is the only attribute that should be used with a strict HTML or XHTML DOCTYPE. To provide full compatibility and flexibility, we have included the option to allow you to include the attribute of your choice.
The link tag will be created as follows:
No options checked:
This will produce a script tag with minimal syntax:
<script src="menu3.js"></script>
Use language option checked:
This will produce a script tag with just the language attribute defined:
<script language="JavaScript" src="menu3.js"></script>
Use type option checked:
This will produce a script tag with the type attribute defined:
<script type="text/javascript" src="menu3.js"></script>
Both options checked:
This will produce a script tag with both the language and type attributes defined:
<script language="JavaScript" type="text/javascript" src="menu3.js"></script>
Use language="JavaScript"
Check this box if you wish to declare the language attribute in your script tag. This attribute is deprecated in HTML 4 but is still widely used. The language attribute is also understood by many older browsers and can be safely used to provide backward compatibility to version 3 and lower browsers. The language attribute will not validate with an HTML 4.01 or XHTML DOCTYPE.
Use type="text/javascript"
Check this box if you wish to declare the type attribute in your script tag. The type attribute replaces the language attribute in HTML 4 and should normally be used to provide full future compatibility. The type attribute will validate with a strict or transitional HTML4.01 or XHTML DOCTYPE.
The Interface Control Buttons
OK
Once you have selected the desired options, click OK to start the externalization process.
Cancel
Click the Cancel button to close the interface without making any changes to your page.
Help
Click the Help button to open the associated Help File in your browser. The page can remain open for easy reference while you continue working with the extension interface.
Command 2 - JavaScript: Import From External File
Overview
There are times when you may wish to import (or restore) externalized JavaScripts back to your page. This may be necessary when you wish to work with, or modify certain Dreamweaver extensions -- or when you simply wish to add more scripts to an external file. You will also want to import scripts back to a page if you wish to apply a script update to one or more Dreamweaver behaviors.
The JavaScript: Import From External File interface presents you with a complete list of all the JavaScripts files that are currently within your defined Dreamweaver site. The listing is presented in a relative path format to allow you to easily identify them. Simply select one of the listed files and click OK. The scripts contained in that file are immediately restored back to your page. If the page contains a link to that file, the link is naturally removed.
You can Import and Externalize as many times as you like. This makes it convenient to add additional behaviors or scripts to a page. When your modifications are done, choose Commands --> PVII Productivity Tools --> JavaScript - Move To External File by PVII to save the revised scripts in the original JavaScript file or even in a new one.
In order to maintain full flexibility and forward compatibility, the system also allows you to select the syntax used for the newly created script tag that contains the imported scripts.
Running the "JavaScript: Import From External File" Command
- Choose Commands --> PVII Productivity Tools --> JavaScript - Import from External File by PVII to open the interface.
- Select the JavaScript file from which you wish to import the scripts.
- Set the options you desire.
- Click OK to import the scripts to your page.
The Interface
The JavaScript -Import from External File by PVII interface allows you to quickly and easily import the scripts from any existing JavaScript file located in your defined Dreamweaver site.

Files
The Files box presents a listing of all of the JavaScript files (files with the .js file extension) that exist within your defined Dreamweaver site. Each file is listed using the relative path from your current document, including folder names, to make identification of the various files very easy.
Note: The first line will always read "Select a JavaScript File to Link.." and serves as a reminder to select one of the files in the listing. On extremely large sites (sites with hundreds of folders or JavaScript files) the listing may take a bit of time to display. In this case, you'll see a message stating: Stand By... scanning site for JavaScript files in your site... and the list box may even disappear momentarily. This is normal... Dreamweaver is being asked to do a lot of work. Be patient, the box will populate soon... ready for use.
Select (click) the file from which you wish to import the scripts, set the options, then click OK to import the scripts.
Options
Link options allow you to select the syntax for the link to the newly created external JavaScript file. The options for the Import From External File system are the same as for the Move To External File system explained above.
The Interface Control Buttons
OK
Once you have selected the desired options and the external JavaScript file, click OK to start the import process. A confirmation dialog box will display. As the message in the dialog box indicates, you should save the page (File-Save) to preserve the changes that have been made to your current page.
Cancel
Click the Cancel button to close the interface without making any changes to your page.
Help
Click the Help button to open the associated Help File in your browser. The page can remain open for easy reference while you continue working with the extension interface.
