XFormsObject.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. XFormsObject.prototype = new XFormsControl;
  2. function XFormsObject (strParentId, strAlert, strHelp, strHint, strAccesskey, strClass, strClassId, bDisabled, strId, nNavindex, strStyle, strTag, strVisibility, strUserDefineAttrib)
  3. {
  4. if (!strId)
  5. {
  6. return;
  7. }
  8. XFormsControl.call(this, strParentId, strAlert, strHelp, strHint, strAccesskey, strClass, bDisabled, strId, nNavindex, strStyle, strTag, strVisibility, strUserDefineAttrib);
  9. /**
  10. * attribute
  11. */
  12. this.attribute["clsid"] = strClassId;
  13. };
  14. XFormsObject.prototype.init = function ()
  15. {
  16. XFormsControl.prototype.init.call(this);
  17. // TODO Chrome, FireFox에서 flash 동작이 안되서 추가시킴 2011.03.08. 박현우
  18. if (!is_ie)
  19. {
  20. var heControl = this.m_heControl;
  21. var strValuePath = "";
  22. for (var i=0; i<heControl.childNodes.length; i++)
  23. {
  24. var heChild = heControl.childNodes.item(i);
  25. strValuePath = heChild.getAttribute("value");
  26. if ("" != strValuePath)
  27. {
  28. break;
  29. }
  30. }
  31. var heEmbedTag = document.createElement("embed");
  32. heEmbedTag.src = strValuePath;
  33. heEmbedTag.width = heControl.style.width;
  34. heEmbedTag.height = heControl.style.height;
  35. this.m_heControl.appendChild(heEmbedTag);
  36. }
  37. this.resizeControl();
  38. eval(this.id + "= "+this.id+".m_heControl;");
  39. };
  40. XFormsObject.prototype.setAttribute = function (strAttribute, strValue)
  41. {
  42. XFormsControl.prototype.setAttribute.call(this, strAttribute, strValue);
  43. switch (strAttribute)
  44. {
  45. case "clsid" :
  46. {
  47. break;
  48. }
  49. }
  50. };
  51. XFormsObject.createAttribute = function (xnHtmlNode, clAttribute)
  52. {
  53. xnHtmlNode = XFormsControl.createAttribute(xnHtmlNode, clAttribute);
  54. return xnHtmlNode;
  55. };