Browse Source

* Added Meta, Link and Script methods to THTMLWriter
* Fixed typo Attrubute - Attribute

git-svn-id: trunk@10469 -

joost 17 years ago
parent
commit
eb34e7b96d
2 changed files with 39 additions and 2 deletions
  1. 2 2
      packages/fcl-xml/src/htmlelements.pp
  2. 37 0
      packages/fcl-xml/src/htmlwriter.pp

+ 2 - 2
packages/fcl-xml/src/htmlelements.pp

@@ -51,8 +51,8 @@ type
     property ElementTag : THTMLElementTag read FElementTag write FElementTag;
     property TagName : DOMString read GetTagName;
     property NodeName : DOMstring read GetTagName;
-    property AttrubuteNames [index:integer] : DOMString read GetAttributeName;
-    property AttrubuteValues [index:integer] : DOMString read GetAttributeValue;
+    property AttributeNames [index:integer] : DOMString read GetAttributeName;
+    property AttributeValues [index:integer] : DOMString read GetAttributeValue;
   end;
   THTMLElementClass = class of THTMLCustomELement;
 

+ 37 - 0
packages/fcl-xml/src/htmlwriter.pp

@@ -62,6 +62,10 @@ type
     function FormButton (aname, caption, aOnClick: DOMstring) : THTML_Input;
     function FormHidden (aname, aValue: DOMstring) : THTML_Input;
     function FormFile (aname, aValue:DOMstring) : THTML_Input;
+    { Other usefull links to elements }
+    function Meta (aname, ahtpequiv,acontent: DOMString) : THTML_meta;
+    function Link (arel, ahref, athetype, amedia: DOMString) : THTML_link;
+    function Script (s, athetype, asrc: DOMString) : THTML_script;
     {$i wtagsintf.inc}
     property Document : THTMLDocument read FDocument write SetDocument;
     property CurrentElement : THTMLCustomElement read FCurrentElement write SetCurrentElement;
@@ -353,6 +357,39 @@ begin
     end;
 end;
 
+function THTMLwriter.Meta(aname, ahtpequiv, acontent: DOMString): THTML_meta;
+begin
+  result := tagmeta;
+  with result do
+    begin
+    name := aname;
+    httpequiv := ahtpequiv;
+    content := acontent;
+    end;
+end;
+
+function THTMLwriter.Link(arel, ahref, athetype, amedia: DOMString): THTML_link;
+begin
+  result := taglink;
+  with result do
+    begin
+    rel := arel;
+    href := ahref;
+    thetype := athetype;
+    media := amedia;
+    end;
+end;
+
+function THTMLwriter.Script(s, athetype, asrc: DOMString): THTML_script;
+begin
+  result := tagscript(s);
+  with result do
+    begin
+    thetype := athetype;
+    src := asrc;
+    end;
+end;
+
 {$i wtagsimpl.inc}
 
 end.