Work with code snippets, Insert a code snippet, Create a code snippet – Adobe Dreamweaver CC 2015 User Manual
Page 391: Edit or delete a code snippet, Add or edit a keyboard shortcut for a snippet
384
Coding
Last updated 6/3/2015
4
Click OK.
The summary dialog provides a summary of extractions. Review the extractions and click OK.
5
Save the page.
Dreamweaver creates a SpryDOMUtils.js file, as well as another file that contains the extracted JavaScript.
Dreamweaver saves the SpryDOMUtils.js file in a SpryAssets folder in your site, and saves the other file at the same
level as the page from which you extracted the JavaScript. Don’t forget to upload both of these dependent files to your
web server when you upload the original page.
Work with code snippets
Code snippets let you store content for quick reuse. You can create, insert, edit, or delete snippets of HTML, JavaScript,
CFML, ASP, PHP, and more. You can also manage and share your code snippets with team members. Some predefined
snippets that you can use as a starting point are available.
Insert a code snippet
1
Place the insertion point where you want to insert the code snippet, or select code to wrap a snippet around.
2
In the Snippets panel (Window > Snippets), double-click the snippet.
You can also right-click (Windows) or Control-click (Macintosh) the snippet, and then select Insert from the pop-up
menu.
Create a code snippet
1
In the Snippets panel, click the New Snippet icon at the bottom of the panel.
2
Enter a name for the snippet.
Note: Snippet names can’t contain characters that are invalid in filenames, such as slashes(/ or \), special characters, or
double quotes (“).
3
(Optional) Enter a text description of the snippet. This makes it easier for other team members to use the snippet.
4
(Optional) Select a Preview Type: Code or Design.
Design
Renders the code and displays it in the Preview pane of the Snippets panel.
Code
Displays the code in the Preview pane.
5
Click OK.
Edit or delete a code snippet
❖
In the Snippets panel, select a snippet, and click the Edit Snippet button or the Remove button at the bottom of the
panel.
Create code snippet folders and manage code snippets
1
In the Snippets panel, click the New Snippet Folder button at the bottom of the panel.
2
Drag snippets to the new folder or other folders, as desired.
Add or edit a keyboard shortcut for a snippet
1
In the Snippets panel, right-click (Windows) or Control-click (Macintosh) and select Edit Keyboard Shortcuts.
The Keyboard Shortcuts Editor appears.