MACROMEDIA DREAMWEAVER 8-DREAMWEAVER API Specifiche Pagina 240

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 692
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 239
Chapter 19240
To populate the fields in the Property inspector for the translated tag, you must parse the value of
the
orig attribute. For example, if the untranslated code is <HAPPY TIME="22"> and the Property
inspector has a field that is labeled Time, you must extract the value of the
TIME attribute from
the
orig string.
function inspectSelection() {
var currentDOM = dw.getDocumentDOM();
var currSelection = currentDOM.getSelection();
var theObj = currentDOM.offsetsToNode¬
(curSelection[0],curSelection[0]+1);
if (theObj.nodeType != Node.ELEMENT_NODE) {
return;
}
// To convert the encoded characters back to their
// original values, use the unescape() method.
var origAtt = unescape(theObj.getAttribute("ORIG"));
// Convert the string to lower case for processing
var origAttLC = origAtt.toLowerCase();
var timeStart = origAttLC.indexOf('time="');
var timeEnd = origAttLC.indexOf('"',timeStart+6);
var timeValue = origAtt.substring(timeStart+6,timeEnd);
document.layers['timelayer'].document.timeForm.timefield.¬
value = timeValue;
}
After you parse the orig attribute in order to populate the fields in the Property inspector for the
translated tag, your next step is probably to set the value of the
orig attribute if the user changes
the value in any of the fields. You might find restrictions against making changes in a locked
region. You can avoid this problem by changing the original markup and retranslating.
Vedere la pagina 239
1 2 ... 235 236 237 238 239 240 241 242 243 244 245 ... 691 692

Commenti su questo manuale

Nessun commento