Defining Messages From A Previewed Page To Lightroom - Adobe 65007312 - Photoshop Lightroom Programmer's Manual

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

Advertisement

C
6: Writing a Web-engine Plug-in
HAPTER
This function must locate the image using
appropriate DOM methods.
The function has this prototype:
document.liveUpdateImageSize = function( imageID, width, height ) {
// your code here
return "invalidateAllContent";
}
imageID
width
height
If unable to perform the live update, return
as it can while the mouse is dragged.
Example live-update implementation
The Lightroom SDK includes the source code for the default HTML web engine, which includes an example
implementation of
project, you must construct your data model to match the names used in the JavaScript.
For any gallery text fields, you must place an
The
id
galleryInfo.lrweb
For example, in the default HTML gallery, the site title is in an
like this:
<h1 onclick="clickTarget( this, 'siteTitle.text' ); "
id="metadata.siteTitle.value"
class="textColor">
$model.metadata.siteTitle.value
</h1>
Notice that the
["metadata.siteTitle.value"] = "Site Title",
N
: This example implementation issues a reload for compound
OTE
"
#myId.myClass

Defining messages from a previewed page to Lightroom

Lightroom provides a callback mechanism whereby JavaScript code running in the previewed page can
communicate with Lightroom. The implementation differs slightly in Mac OS and in Windows, but the
example
assumes that you are including
The unique identifier of the image.
The new image width in pixels.
The new image height in pixels.
document.liveUpdate()
value must match the dot-separated path to the corresponding model value defined in the
file.
is the same as the path in the
id
". Create unique classes for such cases to avoid the reload.
implements a wrapper function which hides this difference. This discussion
live_update.js
live_update.js
document.getElementById()
. In this case, Lightroom reloads the browser as often
"failed"
in the file
live_update.js
attribute on the immediately enclosing element.
id
element. In the template source file it looks
h1
definition in the
model
in your web-engine folder.
Web HTML Live Update 142
, and set its dimensions using
. To include this file in your
galleryInfo.lrweb
values, such as
cssID
file:

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Photoshop lightroom sdk 3.0

Table of Contents