Adobe 65007312 Programming Guide - Page 141

document.liveUpdate, document.liveUpdateImageSize

Page 141 highlights

CHAPTER 6: Writing a Web-engine Plug-in Web HTML Live Update 141 which may need to be cleared. Your live-update function signals Lightroom about what behavior to use by returning one of these strings: X invalidateOldHTML: The browser cache is cleared, and all of the HTML pages in Lightroom's page cache are cleared. The exported JPEGs remain unchanged. The reload is deferred until the user navigates away from the currently previewed page. Return this value if the update is successful, and the change affects only the current HTML page X invalidateAllContent: The browser cache is cleared, and all of Lightroom's page caches (both HTML and resource files) are cleared. The exported JPEGs remain unchanged. The reload is deferred until the user navigates away from the currently previewed page. Return this value if the update is successful, and the change affects any referenced file, such as a JavaScript or CSS file. This is typically the default case. X failed (or any other return, or throwing an exception): Causes immediate reload, and clearing of both browser and Lightroom page caches. The exported JPEGs remain unchanged. Return this value if your function is unable to update the page. Lightroom then commands the embedded browser to reload the original page. document.liveUpdate Your HTML gallery can implement this function to respond to a change made in Lightroom to the appearance (CSS styling), or a Lightroom update to the fixed strings for the gallery. (Do not use it for changes to strings associated with a particular image, such as the image name or other metadata; a change of this kind always causes a reload.) Your function manipulates the web page objects using JavaScript calls; typically, it locates the document node and alters the page appearance or content to reflect the change made to the data values. The function should return a result that indicates whether the update was successful. The prototype is: document.liveUpdate = function( path, newValue, cssId, property ) { var result = "failed"; // JavaScript implementation goes here return result; } path newValue cssId property A dot-separated path to the node in the appearance portion of your galleryInfo.lrweb file. The new value (such as "ffffff" for the color white). The corresponding cssId for the node (such as 'body'). The CSS property that is changing on this node (such as 'margin'). document.liveUpdateImageSize Implement a separate function for live update of image size. This function is called repeatedly while the mouse is held down on the image size slider. As soon as the mouse is released, a full reload of the page occurs, flushing all caches and invalidating all JPEGs.

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187
  • 188
  • 189
  • 190
  • 191
  • 192
  • 193
  • 194
  • 195
  • 196
  • 197
  • 198
  • 199
  • 200
  • 201
  • 202
  • 203
  • 204

C
HAPTER
6: Writing a Web-engine Plug-in
Web HTML Live Update
141
which may need to be cleared. Your live-update function signals Lightroom about what behavior to use by
returning one of these strings:
X
invalidateOldHTML
: The browser cache is cleared, and all of the HTML pages in Lightroom's page
cache are cleared. The exported JPEGs remain unchanged. The reload is deferred until the user
navigates away from the currently previewed page.
Return this value if the update is successful, and the change affects only the current HTML page
X
invalidateAllContent
: The browser cache is cleared, and all of Lightroom's page caches (both
HTML and resource files) are cleared. The exported JPEGs remain unchanged. The reload is deferred
until the user navigates away from the currently previewed page.
Return this value if the update is successful, and the change affects any referenced file, such as a
JavaScript or CSS file. This is typically the default case.
X
failed
(or any other return, or throwing an exception): Causes immediate reload, and clearing of both
browser and Lightroom page caches. The exported JPEGs remain unchanged.
Return this value if your function is unable to update the page. Lightroom then commands the
embedded browser to reload the original page.
document.liveUpdate
Your HTML gallery can implement this function to respond to a change made in Lightroom to the
appearance (CSS styling), or a Lightroom update to the fixed strings for the gallery. (Do
not
use it for
changes to strings associated with a particular image, such as the image name or other metadata; a
change of this kind always causes a reload.)
Your function manipulates the web page objects using JavaScript calls; typically, it locates the document
node and alters the page appearance or content to reflect the change made to the data values. The
function should return a result that indicates whether the update was successful.
The prototype is:
document.liveUpdate = function(
path
,
newValue
,
cssId
,
property
) {
var result = "failed";
// JavaScript implementation goes here
return result;
}
document.liveUpdateImageSize
Implement a separate function for live update of image size. This function is called repeatedly while the
mouse is held down on the image size slider. As soon as the mouse is released, a full reload of the page
occurs, flushing all caches and invalidating all JPEGs.
path
A dot-separated path to the node in the
appearance
portion of your
galleryInfo.lrweb
file.
newValue
The new value (such as
"ffffff"
for the color white).
cssId
The corresponding
cssId
for the node (such as
'body'
).
property
The CSS property that is changing on this node (such as
'margin'
).