Code Editor¶
Click the "Script" tab to open the code editor. This editor allows to create, edit and include scripts. All linked and referenced scripts of the display are shown in the table, depending on the respective script type. Local scripts are shown in the area below.
Hint
If you open a display via or open the code editor of an existing display for the first time, the "Dou you want to save changes?" dialog may be shown when closing the code editor, even if nothing was changed. In this case, the atvise builder made some necessary internal changes. Please click Yes to confirm the dialog.
Script blocks are executed in the same order as they are listed in the editor. The order can be as follows:
Linked scripts
Referenced scripts
Embedded script
Scripts
Linked script – Refers to a node of type DisplayScript (under Library ‣ ATVISE ‣ Display Scripts or Library ‣ PROJECT ‣ Display Scripts). A double-click opens the script in a new tab for editing. A new entry in the table must be created for every linked display script. SVG code of the script:
<script atv:desc="" atv:href="" atv:name="" atv:type="text/ecmascript"/>
Hint
It is not possible to use substitutes ($abc$) or other dynamic links for linked scripts.
Referenced script block – Allows to include atvise resources or scripts from external sources (websites). A new entry in the table must be created for every referenced script. SVG code of the script:
<script atv:desc="" atv:name="" type="text/ecmascript" xlink:href=""/>
Embedded script – Is automatically created for every display. All (local) custom scripts as well as quick dynamics and simple dynamics can be edited in this area. There can only be one embedded script for each display. SVG code of the script:
<script atv:desc="" atv:name="" type="text/ecmascript"><![CDATA[]]></script>
The icons on the left side of the code indicate simple and quick dynamics defined for the display. In addition, the table on the right side can be displayed. A double-click on the respective icon or table entry opens the dialog for editing dynamics. You can add new dynamics with a right-click in the table.
Hint
Simple and quick dynamics that are nested (e.g. inside an if condition) cannot be shown. If a syntax error is detected in the script (see Messages), not all dynamics may be shown. This also applies to currently written or edited code.
Toolbar
Select in project treeThe current display is selected in the project tree.
ReloadThe editor is reloaded. Unsaved changes will be discarded after confirming via the displayed prompt.
Accept ChangesAfter changing the source code, this button will save the changes and close the script editor afterwards.
NewCreates a new empty document.
Open FileOpens the "Open File" dialog to open an existing SVG file.
PrintOpens the 'Print' dialog.
Save AsOpens the 'Save File' dialog to save the current document as an SVG file.
UndoUndo the last action. Always applies to the currently selected script block.
RedoRedo the last undone action. Always applies to the currently selected script block.
CopyCopy a marked text (and save it to the clipboard).
CutCut a marked text (and save it to the clipboard).
PastePaste the text from the clipboard.
Find and ReplaceOpens the following window to find character strings in the currently selected script block and/or replace them with other character strings.
Go to lineOpens the following window to jump to a desired line in the source code of the currently selected script block:
Select colorClicking this button will open the select color dialog. Select a color to insert its RGB code into the script editor.
Select nodeClicking this button will open the select node dialog. Select a node to insert its node ID into the script editor.
Select displayClicking this button will open the select display dialog. Select a display to insert its node ID into the script editor.
Select fontClicking this button will open the select font dialog. Select a font to insert it into the script editor.
Add inline imageDurch Klicken auf diese Schaltfläche wird das Dialogfeld "Bild auswählen" geöffnet, womit ein Bild in den Script-Block eingefügt werden kann.
Increase indentIncrease the indent on a line.
Decrease indentDecrease the indent on a line.
Wrap wordsEnables the automatic word wrap in all script blocks.
Show line numbersShows line numbers in all script blocks.
Highlight current lineHighlights the currently selected line in the current script block.
Show blanks and tabsShows blanks and tabs in all script blocks.
Show matching parenthesesShows matching parentheses in all script blocks.
Add linked scriptAdds a linked script. Click the … button to open the following dialog for selecting a display script:
Add referenced scriptAdds a referenced script. The source can be specified via the URL field.
Move currently selected script upMoves the currently selected script up (only within the same script type).
Move currently selected script downMoves the currently selected script down (only within the same script type).
Delete currently selected script blockDeletes the currently selected script block. The embedded script block cannot be deleted.