Adobe 65007312 - Photoshop Lightroom Programmer's Manual page 143

Mac
Hide thumbs Also See for 65007312 - Photoshop Lightroom:
Table of Contents

Advertisement

C
6: Writing a Web-engine Plug-in
HAPTER
To call from JavaScript into Lightroom, invoke the
using this syntax:
callCallback( "callback_name", param1, param2, ... );
For example, to call the in-place-edit callback defined in the sample implementation, the JavaScript makes
this call:
callCallback( 'inPlaceEdit', target, bounds.x, bounds.y, bounds.width, bounds.height,
font.fontFamily, font.fontSize, imageID )
Lightroom provides these callback functions that can be invoked from JavaScript using
showInPhotoBin = function( id )
setActiveImageSize = function( size )
inPlaceEdit = function( target, x, y,
width, height, fontFamily, fontSize )
updateModel = function( key, value )
fetchURL = function( url, callbackName )
Specifying in-place edit
Your JavaScript code can call
arguments:
target
x, y
width, height
fontFamily
fontSize
The JavaScript file
clickTarget()
page DOM, and uses it to call the
inPlaceEdit()
string
The dot-path identifier of a metadata property defined in your model,
such as "metadata.siteTitle.value"
number
The bounds of the element on the web page, in pixels. These coordinates
are used to position the edit text window that is temporarily
superimposed on the web page.
string
The font family to use for the edit.
number
The font point size.
also provides an easier way to implement in-place edit, by using the
live_update.js
function. This function gets the bounds and font information for a particular node in the
inPlaceEdit()
function defined in
callCallback()
Reveals a photo in the filmstrip whose
value matches the given
Tells Lightroom which of the sizes is currently being
displayed on screen. Use the same string labels that
you provided in the
galleryInfo.lrweb
Edits a text field at given coordinates on the screen.
See
"Specifying in-place edit" on page
Alters the data model for the given dot-separated key
path.
Downloads the contents of a given URL and returns it
as a string. This is an asynchronous operation.When
the operation is complete, the result string is passed
to the callback.
Implement the referenced callback function in the
object.
document
directly, using
callCallback()
function.
Web HTML Live Update 143
live_update.js
callCallback()
id_global
value.
id
section of the
photoSizes
file.
143.
. You must provide these
,
:

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Photoshop lightroom sdk 3.0

Table of Contents