w2tags 0.9.59 → 0.9.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Manifest.txt CHANGED
@@ -71,6 +71,7 @@ lib\w2tags\try\public\w2\checkbox.w2erb
71
71
  lib\w2tags\try\public\w2\check_onhot.w2erb
72
72
  lib\w2tags\try\public\w2\combobox.w2erb
73
73
  lib\w2tags\try\public\w2\combo_onhot.w2erb
74
+ lib\w2tags\try\public\w2\css01.w2erb
74
75
  lib\w2tags\try\public\w2\demo.hot.html
75
76
  lib\w2tags\try\public\w2\diet.w2erb
76
77
  lib\w2tags\try\public\w2\diet1.w2erb
@@ -2,7 +2,8 @@ module W2Tags
2
2
  module Block
3
3
  module BlockHot
4
4
  def bhot_skip_initialize
5
- @key_hot= '' #key for hot
5
+ @end_hot= nil
6
+ @key_hot= '' #key for hot
6
7
  @doc_hot= [] #bhot buffer
7
8
  @bht = 99 #hot indentation block
8
9
  end
@@ -10,28 +11,44 @@ module W2Tags
10
11
  def bhot_skip
11
12
  @rgx = nil
12
13
  if(/(^[\t ]*)(!H!) *(\w+) *\n/ =~ @row;@rgx = $~)
14
+ # if current line was inside in this block
15
+ # flush as an adding hot and reinit for new hot
16
+ if @bht != 99
17
+ make_hot
18
+ end
19
+ @end_hot= nil
13
20
  @key_hot= $3.strip
14
21
  @doc_hot= [] #bhot buffer
15
22
  @bht = @spc.size
16
23
  elsif @bht!= 99
17
- if @spc.size<= @bht
18
- les= 999
19
- @doc_hot.each do |l|
20
- if l.strip!=''
21
- x=(/[^ ]/=~l)
22
- les=x if x<les
23
- end
24
- end
25
- ref =@doc_hot.collect{|l|l[les,999]}.join
26
- @tg_hot[@key_hot]= [proc {|this|ref}, nil]
27
- @bht = 99
24
+ if @spc.size<= @bht && @ron!=0
25
+ make_hot
26
+ @bht = 99
28
27
  elsif @row.strip!=''
29
- @doc_hot<< @row
28
+ if /(\<\<\/)(.+)/ =~ @row
29
+ @end_hot= $2
30
+ else
31
+ @doc_hot<< @row
32
+ end
30
33
  end
31
34
  end
32
35
  @row = '' if @bht!=99
33
36
  @bht!=99
34
37
  end
38
+
39
+ private
40
+
41
+ def make_hot
42
+ les= 999
43
+ @doc_hot.each do |l|
44
+ if l.strip!=''
45
+ x=(/[^ ]/=~l)
46
+ les=x if x<les
47
+ end
48
+ end
49
+ ref =@doc_hot.collect{|l|l[les,999]}.join
50
+ @tg_hot[@key_hot]= [proc {|this|ref}, [@end_hot]]
51
+ end
35
52
  end
36
53
  end
37
54
  end
@@ -32,7 +32,7 @@ module W2Tags
32
32
  end
33
33
  end
34
34
  elsif @plt != 99
35
- if @spc.size<= @plt
35
+ if @spc.size<= @plt && @ron!=0
36
36
  @doc_out = @doc_out + @doc_plt
37
37
  @plt = 99
38
38
  else
@@ -26,7 +26,7 @@ module W2Tags
26
26
  if(/(^[\t ]*)(-#)([^\n]*)\n/ =~ @row;@rgx = $~)
27
27
  @rmk = @spc.size #@plt = 99
28
28
  elsif @rmk !=99
29
- @rmk = 99 if @spc.size <= @rmk
29
+ @rmk = 99 if @spc.size <= @rmk && @ron!=0
30
30
  #p "remrk> #{@rgx[3].strip}" if @dbg[:parse]
31
31
  end
32
32
  @row = '' if @rmk!=99
@@ -11,13 +11,14 @@ module W2Tags
11
11
  def sass_skip
12
12
  @rgx = nil
13
13
  if(/(^[\t ]*)(~~~) *\n/ =~ @row;@rgx = $~)
14
- @row = ''
15
14
  @sas = @spc.size
16
15
  @doc_sas = [[' '*@sas,"<style>\n"].join]
17
16
  @key_sas = [] #sass indentation
18
17
  @nms_sas = [0,""]
18
+ @row = ''
19
+ auto_close
19
20
  elsif @sas!= 99
20
- if @spc.size<= @sas
21
+ if @spc.size<= @sas && @ron!=0
21
22
  @doc_sas<< "#{' '*@key_sas[-1][0]}}\n"
22
23
  @doc_sas<< @doc_sas[0].gsub("<style>","</style>")
23
24
  @doc_out = @doc_out + @doc_sas
@@ -33,11 +34,11 @@ module W2Tags
33
34
 
34
35
  def sass_parser
35
36
  spc= @spc.size
36
- if(/(^[\t ]*)(:[\w\-]+) *\n/ =~ @row;@rgx = $~)
37
- @nms_sas= [spc,[$1,$2[1,99],"-"].join]
38
- elsif(/(^[\t ]*)(:[\w\-]+) +([^\n]+)\n/ =~ @row;@rgx = $~)
37
+ if(/(^[\t ]*)([\w\-]+)\: *\n/ =~ @row;@rgx = $~)
38
+ @nms_sas= [spc,[$1,$2,"-"].join]
39
+ elsif(/(^[\t ]*)([\w\-]+\:) +([^\n]+)\n/ =~ @row;@rgx = $~)
39
40
  nms= @nms_sas[0]!=0 && @nms_sas[0]<spc ? @nms_sas[1] : $1
40
- @doc_sas << [nms,$2[1,99],":",$3,";\n"].join
41
+ @doc_sas << [nms,$2,$3,";\n"].join
41
42
  else
42
43
  old_spc= nil
43
44
  if @key_sas!=[]
data/lib/w2tags/parser.rb CHANGED
@@ -35,7 +35,8 @@ module W2Tags
35
35
  @hot = 'hot' #source of file hot
36
36
  @src_path= '' #path for source file
37
37
  @silent = false #for test
38
-
38
+
39
+ @ron = 0 #strip current source line if size it empty or not
39
40
  @spc = '' #current begining space of current source line
40
41
  @ind = ' ' #indentation size
41
42
  @row = 'row' #current source line
@@ -371,6 +372,7 @@ module W2Tags
371
372
  #must continue with current column (indent).
372
373
  def parse_spc
373
374
  @spc = @row[/(^[ \t]+)/,1].to_s #sometime result is nil
375
+ @ron = @row.strip.size
374
376
  end
375
377
 
376
378
  #do the translation from the params inside function like:
@@ -789,7 +791,7 @@ module W2Tags
789
791
  if @spc.size <= sz
790
792
  ed = multi_end(nil).rstrip
791
793
  p "AutE:#{ed}#{@row}" if @dbg[:parse]
792
- @doc_out += [ed,@row]
794
+ @doc_out += [ed,"\n",@row]
793
795
  @row = ''
794
796
  true
795
797
  end
@@ -801,6 +803,7 @@ module W2Tags
801
803
  #it try to check the indentation to auto_close the line.
802
804
  def parse_all
803
805
  #check for skipping the block using add on module...
806
+ parse_spc
804
807
  if @skiper.select{|f|send(f)}.length>0
805
808
  p "skip > #{@row}" if @dbg[:parse]
806
809
  else
@@ -7,9 +7,14 @@
7
7
  //ACCORDION BUTTON ACTION
8
8
  $('div.accordionButton').live('click',function() {
9
9
  var prn = $(this).parent();
10
- prn.find('>div.accordionContent').slideUp('normal');
11
- prn.find('>div.accordionButton.open').removeClass('open');
12
- $(this).addClass('open').next().slideDown('normal');
10
+ var crn = $(this);
11
+ if(crn.hasClass('open')){
12
+ crn.removeClass('open').next().slideUp('normal');
13
+ } else {
14
+ prn.find('>div.accordionContent').slideUp('normal');
15
+ prn.find('>div.accordionButton.open').removeClass('open');
16
+ $(this).addClass('open').next().slideDown('normal');
17
+ }
13
18
  });
14
19
  });
15
20
  $(function(){
@@ -0,0 +1,13 @@
1
+ ~~~
2
+ #main
3
+ width: 90%
4
+ p
5
+ border:
6
+ style: solid
7
+ width: 1px
8
+ color: #00f
9
+ a,b
10
+ text-decoration: none
11
+ font-weight: bold
12
+ a:hover
13
+ text-decoration: underline
@@ -1,44 +1,44 @@
1
1
  <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
2
2
  <html>
3
- <head>
4
- <META http-equiv=Content-Type content="text/html; charset=windows-1252">
5
- <title>Exported from Notepad++</title>
6
- <style type="text/css">
7
- body{margin:0;}
8
- span {
9
- font-family: 'Inconsolata';
10
- font-size: 10pt;
11
- color: #FFFFFF;
12
- }
13
- .sc0 {
14
- }
15
- .sc4 {
16
- color: #FF0000;
17
- }
18
- .sc5 {
19
- font-size: 11pt;
20
- font-weight: bold;
21
- text-decoration: underline;
22
- color: #FF8040;
23
- }
24
- .sc6 {
25
- font-size: 9pt;
26
- font-weight: bold;
27
- text-decoration: underline;
28
- color: #FFFF00;
29
- }
30
- .sc7 {
31
- color: #FFFF00;
32
- }
33
- .sc10 {
34
- font-weight: bold;
35
- color: #80FFFF;
36
- }
37
- .sc11 {
38
- }
39
- </style>
40
- </head>
41
- <body>
3
+ <head>
4
+ <META http-equiv=Content-Type content="text/html; charset=windows-1252">
5
+ <title>Exported from Notepad++</title>
6
+ <style type="text/css">
7
+ body{margin:0;}
8
+ span {
9
+ font-family: 'Inconsolata';
10
+ font-size: 10pt;
11
+ color: #FFFFFF;
12
+ }
13
+ .sc0 {
14
+ }
15
+ .sc4 {
16
+ color: #FF0000;
17
+ }
18
+ .sc5 {
19
+ font-size: 11pt;
20
+ font-weight: bold;
21
+ text-decoration: underline;
22
+ color: #FF8040;
23
+ }
24
+ .sc6 {
25
+ font-size: 9pt;
26
+ font-weight: bold;
27
+ text-decoration: underline;
28
+ color: #FFFF00;
29
+ }
30
+ .sc7 {
31
+ color: #FFFF00;
32
+ }
33
+ .sc10 {
34
+ font-weight: bold;
35
+ color: #80FFFF;
36
+ }
37
+ .sc11 {
38
+ }
39
+ </style>
40
+ </head>
41
+ <body>
42
42
  <div style="width:600px;height:535px;overflow:auto;float: left; white-space: pre; line-height: 1; background: #000000; "><span class="sc5">&gt;&gt;_nav</span><span class="sc0">
43
43
  </span><span class="sc6">%ul</span><span class="sc10">$#</span><span class="sc0">
44
44
  </span><span class="sc6">-itm</span><span class="sc10">$.</span><span class="sc0"> </span><span class="sc10">$*</span><span class="sc0">
@@ -69,5 +69,9 @@ span {
69
69
  </span><span class="sc6">%label</span><span class="sc10">{</span><span class="sc11">for</span><span class="sc10">=</span><span class="sc11">"</span><span class="sc10">*#</span><span class="sc11">"</span><span class="sc10">}</span><span class="sc0"> </span><span class="sc10">$</span><span class="sc4">0</span><span class="sc11">&lt;</span><span class="sc0">
70
70
  </span><span class="sc6">%textarea</span><span class="sc10">$$</span><span class="sc0">
71
71
 
72
- </span></div></body>
72
+ </span></div>
73
+ <script type="text/javascript">
74
+ window.parent.hideIndicator();
75
+ </script>
76
+ </body>
73
77
  </html>
@@ -164,5 +164,9 @@ span {
164
164
  &lt;&lt;/
165
165
  %&gt;</span><span class="sc0">
166
166
 
167
- </span></div></body>
167
+ </span></div>
168
+ <script type="text/javascript">
169
+ window.parent.hideIndicator();
170
+ </script>
171
+ </body>
168
172
  </html>
@@ -56,5 +56,9 @@ span {
56
56
  </span><span class="sc5">&gt;&gt;_content_for</span><span class="sc0">
57
57
  </span><span class="sc6">-</span><span class="sc0"> </span><span class="sc11">content_for</span><span class="sc0"> </span><span class="sc10">$*</span><span class="sc0"> </span><span class="sc11">do</span><span class="sc0">
58
58
  </span><span class="sc6">-end</span><span class="sc0">
59
- </span></div></body>
59
+ </span></div>
60
+ <script type="text/javascript">
61
+ window.parent.hideIndicator();
62
+ </script>
63
+ </body>
60
64
  </html>
@@ -112,5 +112,9 @@ span {
112
112
 
113
113
  </span><span class="sc5">&gt;&gt;post</span><span class="sc0">
114
114
  </span><span class="sc6">%form</span><span class="sc10">$:$#.</span><span class="sc11">lelouch</span><span class="sc10">.*.{*</span><span class="sc11">@method</span><span class="sc10">=</span><span class="sc11">"post"</span><span class="sc10">~</span><span class="sc7">action</span><span class="sc10">=</span><span class="sc11">"</span><span class="sc10">$</span><span class="sc4">0</span><span class="sc11">"</span><span class="sc10">~}</span><span class="sc0">
115
- </span></div></body>
115
+ </span></div>
116
+ <script type="text/javascript">
117
+ window.parent.hideIndicator();
118
+ </script>
119
+ </body>
116
120
  </html>
@@ -34,5 +34,9 @@ span {
34
34
 
35
35
  </span><span class="sc5">&gt;&gt;finallize</span><span class="sc0">
36
36
  </span><span class="sc8">,/</span><span class="sc0">
37
- </span></div></body>
37
+ </span></div>
38
+ <script type="text/javascript">
39
+ window.parent.hideIndicator();
40
+ </script>
41
+ </body>
38
42
  </html>
@@ -47,5 +47,9 @@ span {
47
47
  </span><span class="sc16">@result</span><span class="sc10">=</span><span class="sc0"> </span><span class="sc11">W2</span><span class="sc10">.</span><span class="sc11">parse_line</span><span class="sc10">(</span><span class="sc6">"%initialize\n"</span><span class="sc10">&lt;&lt;</span><span class="sc11">params</span><span class="sc10">[</span><span class="sc14">:input</span><span class="sc10">]).</span><span class="sc11">join</span><span class="sc10">(</span><span class="sc7">''</span><span class="sc10">)</span><span class="sc0">
48
48
  </span><span class="sc11">erb</span><span class="sc0"> </span><span class="sc14">:index</span><span class="sc0">
49
49
  </span><span class="sc5">end</span><span class="sc0">
50
- </span></div></body>
50
+ </span></div>
51
+ <script type="text/javascript">
52
+ window.parent.hideIndicator();
53
+ </script>
54
+ </body>
51
55
  </html>
@@ -82,6 +82,10 @@ td.i2{
82
82
  <a href="#" class="load" loc="layout1">Table</a>
83
83
  <a href="#" class="load" loc="layout2">Div</a>
84
84
  </div>
85
+ <div class="accordionButton" >Css</div>
86
+ <div class="accordionContent">
87
+ <a href="#" class="load" loc="css01">Css 1</a>
88
+ </div>
85
89
  </div>
86
90
  <div class="accordionButton" >Demo Index Html</div>
87
91
  <div class="accordionContent">
@@ -175,13 +179,16 @@ $(function(){
175
179
  });
176
180
 
177
181
  $('a.load').live('click',function(){
182
+ $('#load').show();
178
183
  var loc= "/w2/"+$(this).attr('loc')+".w2erb";
179
184
  $.get(loc, function(data){
180
185
  editor1.setCode(data);
186
+ $('#load').hide();
181
187
  });
182
188
  });
183
189
 
184
190
  $('a.load2').live('click',function(){
191
+ $('#load').show();
185
192
  var src= '/w2/'+$(this).attr('loc')+'.hot.html'
186
193
  $('#ifr').attr('src',src);
187
194
  $('td.i2').hide();
@@ -10,6 +10,11 @@
10
10
  <script type="text/javascript" src="/javascripts/jquery.js" > </script>
11
11
  <script type="text/javascript" src="/javascripts/jquery.cluetip.js" > </script>
12
12
  <script type="text/javascript" src="/javascripts/jquery.live.accordion.js" > </script>
13
+ <script type="text/javascript">
14
+ function hideIndicator(){
15
+ $('#load').hide();
16
+ }
17
+ </script>
13
18
  </head>
14
19
  <body>
15
20
  <%= yield %>
data/tasks/setup.rb CHANGED
@@ -17,7 +17,7 @@ PROJ = OpenStruct.new(
17
17
  :authors => 'Widi Harsojo',
18
18
  :email => 'wharsojo@gmail.com',
19
19
  :url => "\000",
20
- :version => ENV['VERSION'] || '0.9.59',
20
+ :version => ENV['VERSION'] || '0.9.60',
21
21
  :exclude => %w(tmp$ bak$ ~$ CVS \.svn/ \.git/ ^pkg/),
22
22
  :release_name => ENV['RELEASE'],
23
23
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: w2tags
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.59
4
+ version: 0.9.60
5
5
  platform: ruby
6
6
  authors:
7
7
  - widi harsojo
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-16 00:00:00 +07:00
12
+ date: 2009-12-11 00:00:00 +07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -91,6 +91,7 @@ files:
91
91
  - lib\w2tags\try\public\w2\check_onhot.w2erb
92
92
  - lib\w2tags\try\public\w2\combobox.w2erb
93
93
  - lib\w2tags\try\public\w2\combo_onhot.w2erb
94
+ - lib\w2tags\try\public\w2\css01.w2erb
94
95
  - lib\w2tags\try\public\w2\demo.hot.html
95
96
  - lib\w2tags\try\public\w2\diet.w2erb
96
97
  - lib\w2tags\try\public\w2\diet1.w2erb