MACROMEDIA DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER Specifikace Strana 414

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 504
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 413
414 Components
getCodeViewDropCode()
Availability
Dreamweaver MX.
Description
This function gets the code that is dragged and dropped in Code view from the Components
panel or the code that is cut, copied, or pasted from the Components panel.
Arguments
componentRec
The componentRec argument is an object.
Returns
The string that contains the code for the component.
Example
The following example identifies the code for a common web service:
function getCodeViewDropCode(componentRec)
{
var codeToDrop="";
if (componentRec)
{
if (componentRec.objectType=="Class")
{
codeToDrop =¬
dw.getExtDataValue("webservices_constructor","insertText");
codeToDrop =¬
codeToDrop.replace(RegExp("@@Id@@","g"),componentRec.name);
codeToDrop =¬
codeToDrop.replace(RegExp("@@Class@@","g"),componentRec.name);
}
else if (componentRec.objectType=="Method")
{
codeToDrop = componentRec.dropCode;
}
if(componentRec.dropCode)
{
codeToDrop = componentRec.dropCode;
}
else
{
codeToDrop = componentRec.name;
}
}
return codeToDrop;
}
Zobrazit stránku 413
1 2 ... 409 410 411 412 413 414 415 416 417 418 419 ... 503 504

Komentáře k této Příručce

Žádné komentáře