04.05.2015 Views

Perforce 2013.1 Javascript API for Visual Tools

Perforce 2013.1 Javascript API for Visual Tools

Perforce 2013.1 Javascript API for Visual Tools

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

JavaScript <strong>API</strong> Methods<br />

Utility Functions<br />

Method<br />

encodeForHTML(str)<br />

encodeForHTMLAttribute(str)<br />

encodeForJavaScript(str)<br />

setWebKitDeveloperExtrasEnabled(bool)<br />

getImage(imagename)<br />

getImageNames()<br />

getSelection<br />

setP4VErrorDialogEnabled(true|false)<br />

setSelection(selList[,function(callback)]<br />

Map<br />

Description<br />

Encodes characters to prevent XSS<br />

attacks injected into dynamic data. For<br />

details, see “Preventing Cross-Site<br />

Scripting (XSS) Attacks” on page 25.<br />

Enables or disables the Inspect item in<br />

the context menu, which displays the<br />

WebKit WebInspector <strong>for</strong> debugging.<br />

Returns a string containing the<br />

specified P4V image in HTML<br />

embedded <strong>for</strong>mat. Use the names<br />

returned by getImageNames().<br />

Returns a string array containing a list<br />

of images used by P4V to indicate file<br />

type and status. For consistency with<br />

P4V, use these images in your<br />

applications.<br />

Returns a list of the folders and files<br />

that are currently selected in the depot<br />

pane.<br />

Enable/disable display of server<br />

errors in popups. (By default, server<br />

errors are displayed in popups.<br />

Specify true to enable, false to<br />

disable.<br />

Given a list of paths and files, selects<br />

them in the depot pane and, if<br />

specified, executes the optional<br />

callback function.<br />

Enables you to construct an optimized<br />

workspace mapping <strong>for</strong> a client<br />

workspace specification that your<br />

application creates or modifies.<br />

32 <strong>Per<strong>for</strong>ce</strong> <strong>2013.1</strong> JavaScript <strong>API</strong> <strong>for</strong> <strong>Visual</strong> <strong>Tools</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!