public
Fork of giraffesoft/markaby
Description: Markaby patched to run on rails 2.0.2
Homepage: http://code.whytheluckystiff.net/markaby/
Clone URL: git://github.com/isaac/markaby.git
applied bryanstearns frameset patch from 
http://code.whytheluckystiff.net/markaby/ticket/59
dinsley (author)
Tue Jun 03 15:59:04 -0700 2008
commit  fef5f5b21f35a660ac3ea546585d75630d6c4d04
tree    9c96b85f4f31d6a952cdca6d06dc17f8e2d0ea17
parent  d3e216dedc773a3254ec0b909b429a0ba7811dbe
...
237
238
239
 
 
 
 
 
 
240
241
242
...
237
238
239
240
241
242
243
244
245
246
247
248
0
@@ -237,6 +237,12 @@ module Markaby
0
       xhtml_html(attrs, &block)
0
     end
0
 
0
+ # Builds an html tag with XHTML 1.0 Frameset doctype instead.
0
+ def xhtml_frameset(attrs = {}, &block)
0
+ self.tagset = Markaby::XHTMLFrameset
0
+ xhtml_html(attrs, &block)
0
+ end
0
+
0
     private
0
 
0
     def xhtml_html(attrs = {}, &block)
...
1
2
3
4
 
5
6
7
...
161
162
163
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
164
...
1
2
3
 
4
5
6
7
...
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
0
@@ -1,7 +1,7 @@
0
 module Markaby
0
 
0
   FORM_TAGS = [ :form, :input, :select, :textarea ]
0
- SELF_CLOSING_TAGS = [ :base, :meta, :link, :hr, :br, :param, :img, :area, :input, :col ]
0
+ SELF_CLOSING_TAGS = [ :base, :meta, :link, :hr, :br, :param, :img, :area, :input, :col, :frame ]
0
 
0
   # Common sets of attributes.
0
   AttrCore = [:id, :class, :style, :title]
0
@@ -161,4 +161,19 @@ module Markaby
0
     @self_closing = @tags & SELF_CLOSING_TAGS
0
   end
0
 
0
+ # Additional tags found in XHTML 1.0 Frameset
0
+ class XHTMLFrameset
0
+ class << self
0
+ attr_accessor :tags, :tagset, :forms, :self_closing, :doctype
0
+ end
0
+ @doctype = ['-//W3C//DTD XHTML 1.0 Frameset//EN', 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd']
0
+ @tagset = XHTMLTransitional.tagset.merge \
0
+ :frameset => AttrCore + [:rows, :cols, :onload, :onunload],
0
+ :frame => AttrCore + [:longdesc, :name, :src, :frameborder, :marginwidth, :marginheight, :noresize, :scrolling]
0
+
0
+ @tags = @tagset.keys
0
+ @forms = @tags & FORM_TAGS
0
+ @self_closing = @tags & SELF_CLOSING_TAGS
0
+ end
0
+
0
 end
...
109
110
111
 
 
 
 
 
 
 
112
113
114
...
109
110
111
112
113
114
115
116
117
118
119
120
121
0
@@ -109,6 +109,13 @@ class MarkabyTest < Test::Unit::TestCase
0
     assert doc.include?(%{<title>OKay</title>})
0
   end
0
   
0
+ def test_full_doc_frameset
0
+ doc = mab { xhtml_frameset { head { title 'OKay' } } }
0
+ assert doc =~ /^<\?xml version="1.0" encoding="UTF-8"\?>/
0
+ assert doc.include?(%{"-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">})
0
+ assert doc.include?(%{<title>OKay</title>})
0
+ end
0
+
0
   def test_root_attributes_can_be_changed
0
     doc = mab { xhtml_strict(:lang => 'fr') { head { title { 'Salut!' } } } }
0
     assert doc.include?(%{"-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">})

Comments

    No one has commented yet.