trans 0.5.9 → 0.5.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3032c9af40bf488b0b564e2de8128249b2452a74
4
- data.tar.gz: 1e71d0f0993ef30889ff7aea1ecf7dd8208a6dee
3
+ metadata.gz: fdca78ff3f4ba63d7e791dec4104508360fe59f4
4
+ data.tar.gz: cedebe79f011ab686c2f7ad2d9c08aa8ee2137be
5
5
  SHA512:
6
- metadata.gz: e2814302dbc1499376dd64b67d24891525a6dfbafe9cdea454092391e3f77cf92f585d88aef680260d1e1a6e4d17a3b718ee7fcff2c88178d138026953d061f2
7
- data.tar.gz: af1f7c37663b5e1f5054b478bbbf94b4ee83ff86546f22d6a4292dd06d905ca227456fa3c7eb0b9c67f0c5787bac5e0f1869fe9dae9a0f4ef5529b8596b24121
6
+ metadata.gz: 7846fd8b4b97f1e3ac541f717ad11987d236b6f4de77a6a4299f92d42058509655240726830a3232db07c505700bcb6693e7df4bd43c03a469e433470611f82c
7
+ data.tar.gz: 3655f2323564673f04e449bc67f35eaabdcf442d205235dc2588df07d679f7d94ef2bcfa5870ea1d391aad5a37228faabc40ff46440dc64d1565c6f86520c1a2
@@ -248,28 +248,7 @@ class Tocmd::TranslatorTrans
248
248
  <script src="toc/lib/modernizr.custom.js"></script>
249
249
 
250
250
  <script type="text/javascript" src="toc/js/trans.min.js"></script>
251
- <script type="text/javascript" src="toc/toc_conf.js"></script>
252
-
253
-
254
- <SCRIPT type="text/javascript" >
255
- <!--
256
- $(document).ready(function(){
257
- var css_conf = eval(markdown_panel_style);
258
- $('#readme').css(css_conf)
259
-
260
- var conf = eval(jquery_ztree_toc_opts);
261
- $('#tree').ztree_toc(conf);
262
-
263
- new mlPushMenu( document.getElementById( 'mp-menu' ), document.getElementById( 'normal-button' ), {
264
- type : 'cover'
265
- } );
266
-
267
- var transtool_opts_conf = eval(transtool_opts);
268
- $.transtool(transtool_opts_conf);
269
- });
270
- //-->
271
- </SCRIPT>
272
-
251
+ <script type="text/javascript" src="toc/toc_conf.js"></script>
273
252
  }
274
253
 
275
254
  if destiny_dir.to_s.index('/')
data/lib/tocmd/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tocmd
2
- VERSION = "0.5.9"
2
+ VERSION = "0.5.10"
3
3
  end
data/template/README.md CHANGED
@@ -29,4 +29,10 @@
29
29
  - v0.1.0
30
30
  - 增加default state = all的选项。
31
31
 
32
+ ## 欢迎fork和反馈
32
33
 
34
+ 在issue提问或邮件shiren1118@126.com
35
+
36
+ ## License
37
+
38
+ this gem is released under the [MIT License](http://www.opensource.org/licenses/MIT)
@@ -0,0 +1,323 @@
1
+
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
5
+ <title>sample2</title>
6
+ <link href="toc/style/github-bf51422f4bb36427d391e4b75a1daa083c2d840e.css" media="all" rel="stylesheet" type="text/css"/>
7
+ <link href="toc/style/github2-d731afd4f624c99a4b19ad69f3083cd6d02b81d5.css" media="all" rel="stylesheet" type="text/css"/>
8
+ <link rel="stylesheet" type="text/css" href="toc/css/trans.min.css" />
9
+ </head>
10
+ <body>
11
+ <div class="container">
12
+ <!-- Push Wrapper -->
13
+ <div class="mp-pusher" id="mp-pusher">
14
+
15
+ <!-- mp-menu -->
16
+ <nav id="mp-menu" class="mp-menu">
17
+ <div class="mp-level">
18
+ <h2 class="icon icon-world" id='mp_title' style='font-size: 34;color:white;'>泰然译品</h2>
19
+ <ul>
20
+ </ul>
21
+
22
+ </div>
23
+ </nav>
24
+ <!-- /mp-menu -->
25
+
26
+ <div class="scroller"><!-- this is for emulating position fixed of the nav -->
27
+ <div class="scroller-inner">
28
+ <!-- Top Navigation -->
29
+
30
+ <div>
31
+ <div style='width:25%;'>
32
+ <ul id="tree" class="ztree" style='width:100%'>
33
+
34
+ </ul>
35
+ </div>
36
+ <div id='readme' style='width:70%;margin-left:20%;'>
37
+ <article class='markdown-body'>
38
+ <style>.highlight .hll { background-color: #ffffcc }
39
+ .highlight { background: #f0f0f0; }
40
+ .highlight .c { color: #60a0b0; font-style: italic } /* Comment */
41
+ .highlight .err { border: 1px solid #FF0000 } /* Error */
42
+ .highlight .k { color: #007020; font-weight: bold } /* Keyword */
43
+ .highlight .o { color: #666666 } /* Operator */
44
+ .highlight .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */
45
+ .highlight .cp { color: #007020 } /* Comment.Preproc */
46
+ .highlight .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */
47
+ .highlight .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */
48
+ .highlight .gd { color: #A00000 } /* Generic.Deleted */
49
+ .highlight .ge { font-style: italic } /* Generic.Emph */
50
+ .highlight .gr { color: #FF0000 } /* Generic.Error */
51
+ .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
52
+ .highlight .gi { color: #00A000 } /* Generic.Inserted */
53
+ .highlight .go { color: #888888 } /* Generic.Output */
54
+ .highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
55
+ .highlight .gs { font-weight: bold } /* Generic.Strong */
56
+ .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
57
+ .highlight .gt { color: #0044DD } /* Generic.Traceback */
58
+ .highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
59
+ .highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
60
+ .highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
61
+ .highlight .kp { color: #007020 } /* Keyword.Pseudo */
62
+ .highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
63
+ .highlight .kt { color: #902000 } /* Keyword.Type */
64
+ .highlight .m { color: #40a070 } /* Literal.Number */
65
+ .highlight .s { color: #4070a0 } /* Literal.String */
66
+ .highlight .na { color: #4070a0 } /* Name.Attribute */
67
+ .highlight .nb { color: #007020 } /* Name.Builtin */
68
+ .highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
69
+ .highlight .no { color: #60add5 } /* Name.Constant */
70
+ .highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */
71
+ .highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */
72
+ .highlight .ne { color: #007020 } /* Name.Exception */
73
+ .highlight .nf { color: #06287e } /* Name.Function */
74
+ .highlight .nl { color: #002070; font-weight: bold } /* Name.Label */
75
+ .highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
76
+ .highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */
77
+ .highlight .nv { color: #bb60d5 } /* Name.Variable */
78
+ .highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */
79
+ .highlight .w { color: #bbbbbb } /* Text.Whitespace */
80
+ .highlight .mb { color: #40a070 } /* Literal.Number.Bin */
81
+ .highlight .mf { color: #40a070 } /* Literal.Number.Float */
82
+ .highlight .mh { color: #40a070 } /* Literal.Number.Hex */
83
+ .highlight .mi { color: #40a070 } /* Literal.Number.Integer */
84
+ .highlight .mo { color: #40a070 } /* Literal.Number.Oct */
85
+ .highlight .sb { color: #4070a0 } /* Literal.String.Backtick */
86
+ .highlight .sc { color: #4070a0 } /* Literal.String.Char */
87
+ .highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
88
+ .highlight .s2 { color: #4070a0 } /* Literal.String.Double */
89
+ .highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
90
+ .highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */
91
+ .highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
92
+ .highlight .sx { color: #c65d09 } /* Literal.String.Other */
93
+ .highlight .sr { color: #235388 } /* Literal.String.Regex */
94
+ .highlight .s1 { color: #4070a0 } /* Literal.String.Single */
95
+ .highlight .ss { color: #517918 } /* Literal.String.Symbol */
96
+ .highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
97
+ .highlight .vc { color: #bb60d5 } /* Name.Variable.Class */
98
+ .highlight .vg { color: #bb60d5 } /* Name.Variable.Global */
99
+ .highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */
100
+ .highlight .il { color: #40a070 } /* Literal.Number.Integer.Long */</style>
101
+ <style>
102
+ .source{
103
+ display:none;
104
+ }
105
+
106
+ body{
107
+ font-family: Helvetica,Arial,sans-serif;
108
+ }
109
+ </style>
110
+
111
+ <h1>This is an H1</h1>
112
+
113
+ <p><button>dddd</button></p>
114
+
115
+ <div class='zh'>
116
+ display:zh china
117
+ </div>
118
+
119
+ <hr>
120
+
121
+ <div class='en '>
122
+ display:english
123
+ </div>
124
+
125
+ <h2>This is an H2</h2>
126
+
127
+ <h3>This is an H3</h3>
128
+
129
+ <h4>This is an H4</h4>
130
+
131
+ <h5>This is an H5</h5>
132
+
133
+ <h6>This is an H6</h6>
134
+
135
+ <blockquote>
136
+ <p>This is the first level of quoting.</p>
137
+
138
+ <blockquote>
139
+ <p>This is nested blockquote.</p>
140
+ </blockquote>
141
+
142
+ <p>Back to the first level.</p>
143
+ </blockquote>
144
+
145
+ <h3>Unordered List</h3>
146
+
147
+ <ul>
148
+ <li>Red</li>
149
+ <li>Green</li>
150
+ <li>Blue</li>
151
+ </ul>
152
+
153
+ <h3>Ordered List</h3>
154
+
155
+ <ol>
156
+ <li>Red</li>
157
+ <li>Green</li>
158
+ <li>Blue</li>
159
+ <li> Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
160
+ Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
161
+ viverra nec, fringilla in, laoreet vitae, risus.</li>
162
+ <li> Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
163
+ Suspendisse id sem consectetuer libero luctus adipiscing.</li>
164
+ </ol>
165
+
166
+ <p>A sample text here. And some code below:</p>
167
+ <div class="highlight"><pre><span class="kn">import</span> <span class="nn">sys</span>
168
+ <span class="kn">import</span> <span class="nn">gobject</span>
169
+ <span class="k">def</span> <span class="nf">init</span><span class="p">():</span>
170
+ <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">10</span><span class="p">):</span>
171
+ <span class="k">print</span> <span class="s">&#39;task </span><span class="si">%d</span><span class="s">, done&#39;</span> <span class="o">%</span> <span class="n">i</span>
172
+
173
+ <span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&#39;__main__&#39;</span><span class="p">:</span>
174
+ <span class="n">init</span><span class="p">()</span>
175
+ </pre></div>
176
+ <p>Inline code <code>printf()</code> here.</p>
177
+
178
+ <p>This is a link to <a href="http://google.com">Google</a>.</p>
179
+
180
+ <p><em>single asterisks</em></p>
181
+
182
+ <p><strong>double asterisks</strong></p>
183
+
184
+ <p>Create fake iPhone text conversations. Enter a conversation: Example: Dad: Your mom and I are going to divorce next month. Son: Why ? Call me please. </p>
185
+
186
+ <p>Create fake iPhone text conversations. Enter a conversation: Example: Dad: Your mom and I are going to divorce next month. Son: Why ? Call me please. </p>
187
+
188
+ <h1>This is an H1</h1>
189
+
190
+ <h2>This is an H2</h2>
191
+
192
+ <h3>This is an H3</h3>
193
+
194
+ <h3>This is an H3</h3>
195
+
196
+ <h3>This is an H3</h3>
197
+
198
+ <h4>This is an H4</h4>
199
+
200
+ <h4>This is an H4</h4>
201
+
202
+ <h2>This is an H2</h2>
203
+
204
+ <h3>This is an H3</h3>
205
+
206
+ <h4>This is an H4</h4>
207
+
208
+ <h5>This is an H5</h5>
209
+
210
+ <h6>This is an H6</h6>
211
+
212
+ <blockquote>
213
+ <p>This is the first level of quoting.</p>
214
+
215
+ <blockquote>
216
+ <p>This is nested blockquote.</p>
217
+ </blockquote>
218
+
219
+ <p>Back to the first level.</p>
220
+ </blockquote>
221
+
222
+ <h3>Unordered List</h3>
223
+
224
+ <ul>
225
+ <li>Red</li>
226
+ <li>Green</li>
227
+ <li>Blue</li>
228
+ </ul>
229
+
230
+ <h3>Ordered List</h3>
231
+
232
+ <ol>
233
+ <li>Red</li>
234
+ <li>Green</li>
235
+ <li>Blue</li>
236
+ <li> Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
237
+ Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
238
+ viverra nec, fringilla in, laoreet vitae, risus.</li>
239
+ <li> Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
240
+ Suspendisse id sem consectetuer libero luctus adipiscing.</li>
241
+ </ol>
242
+
243
+ <p>A sample text here. And some code below:</p>
244
+ <div class="highlight"><pre><span class="kn">import</span> <span class="nn">sys</span>
245
+ <span class="kn">import</span> <span class="nn">gobject</span>
246
+ <span class="k">def</span> <span class="nf">init</span><span class="p">():</span>
247
+ <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">10</span><span class="p">):</span>
248
+ <span class="k">print</span> <span class="s">&#39;task </span><span class="si">%d</span><span class="s">, done&#39;</span> <span class="o">%</span> <span class="n">i</span>
249
+
250
+ <span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&#39;__main__&#39;</span><span class="p">:</span>
251
+ <span class="n">init</span><span class="p">()</span>
252
+ </pre></div>
253
+ <p>Inline code <code>printf()</code> here.</p>
254
+
255
+ <p>This is a link to <a href="http://google.com">Google</a>.</p>
256
+
257
+ <p><em>single asterisks</em></p>
258
+
259
+ <p><strong>double asterisks</strong></p>
260
+
261
+ <p>Create fake iPhone text conversations. Enter a conversation: Example: Dad: Your mom and I are going to divorce next month. Son: Why ? Call me please. </p>
262
+
263
+ <p>Create fake iPhone text conversations. Enter a conversation: Example: Dad: Your mom and I are going to divorce next month. Son: Why ? Call me please. </p>
264
+
265
+ <h2>Table test</h2>
266
+
267
+ <p>v0.1.4</p>
268
+
269
+ <table><thead>
270
+ <tr>
271
+ <th>Keys</th>
272
+ <th>Value</th>
273
+ </tr>
274
+ </thead><tbody>
275
+ <tr>
276
+ <td>说明</td>
277
+ <td>检查用户是否已经登录</td>
278
+ </tr>
279
+ <tr>
280
+ <td>网址</td>
281
+ <td>index.php?c=mobile&amp;a=checklogin</td>
282
+ </tr>
283
+ <tr>
284
+ <td>登录</td>
285
+ <td>FALSE</td>
286
+ </tr>
287
+ <tr>
288
+ <td>参数</td>
289
+ <td>NULL</td>
290
+ </tr>
291
+ <tr>
292
+ <td>返回</td>
293
+ <td>↓↓↓↓↓↓↓↓↓↓</td>
294
+ </tr>
295
+ </tbody></table>
296
+
297
+ </article>
298
+ </div>
299
+ </div>
300
+ <div id="normal-button" class="settings-button">
301
+ <img src="toc/img/icon-cog-small.png" />
302
+ </div>
303
+
304
+
305
+ </div><!-- /scroller-inner -->
306
+ </div><!-- /scroller -->
307
+
308
+ </div><!-- /pusher -->
309
+ </div><!-- /container -->
310
+
311
+
312
+ </body>
313
+ </html>
314
+ <script src="toc/lib/jquery.js"></script>
315
+ <script src="toc/lib/jquery.ztree.all-3.5.min.js"></script>
316
+ <script src="toc/lib/modernizr.custom.js"></script>
317
+
318
+ <script type="text/javascript" src="src/classie.js"></script>
319
+ <script type="text/javascript" src="src/jquery.transtool.js"></script>
320
+ <script type="text/javascript" src="src/mlpushmenu.js"></script>
321
+ <script type="text/javascript" src="src/ztree_toc.js"></script>
322
+
323
+ <script type="text/javascript" src="toc/toc_conf.js"></script>
@@ -316,26 +316,4 @@ Suspendisse id sem consectetuer libero luctus adipiscing.</li>
316
316
  <script src="toc/lib/modernizr.custom.js"></script>
317
317
 
318
318
  <script type="text/javascript" src="toc/js/trans.min.js"></script>
319
- <script type="text/javascript" src="toc/toc_conf.js"></script>
320
-
321
- <SCRIPT type="text/javascript" >
322
- <!--
323
- $(document).ready(function(){
324
- var css_conf = eval(markdown_panel_style);
325
- $('#readme').css(css_conf)
326
-
327
- var conf = eval(jquery_ztree_toc_opts);
328
- $('#tree').ztree_toc(conf);
329
-
330
- new mlPushMenu( document.getElementById( 'mp-menu' ), document.getElementById( 'normal-button' ), {
331
- type : 'cover'
332
- } );
333
-
334
- var transtool_opts_conf = eval(transtool_opts);
335
- $.transtool(transtool_opts_conf);
336
-
337
- // $('#tree').hide()
338
- });
339
- //-->
340
- </SCRIPT>
341
-
319
+ <script type="text/javascript" src="toc/toc_conf.js"></script>
@@ -102,12 +102,31 @@
102
102
  show_preview_info_wity_type(opts, key);
103
103
  }
104
104
  }
105
+
106
+ /**
107
+ * 确定是否显示pushmenu
108
+ */
109
+ function show_push_menu(opts){
110
+ if(opts.menu_container_selector && opts.menu_trigger_selector){
111
+ var c = document.getElementById( opts.menu_container_selector.replace('#','') );
112
+ var t = document.getElementById( opts.menu_trigger_selector.replace('#','') );
113
+
114
+ new mlPushMenu( c, t , {
115
+ type : 'cover'
116
+ } );
117
+ }else{
118
+ return
119
+ }
120
+ }
105
121
 
106
122
  // Static method.
107
123
  $.transtool = function(options) {
108
124
  // Override default options with passed-in options.
109
125
  var opts = $.extend({}, $.transtool.options, options);
110
126
 
127
+ // show or hide push_menu
128
+ show_push_menu(opts);
129
+
111
130
  // 创建tooltip‘s options html
112
131
  create_tip_opts(opts);
113
132
 
@@ -132,6 +151,7 @@
132
151
  debug: false,
133
152
  mp_title:"请配置mp_title",
134
153
  toolbarselector: "#user-toolbar",
154
+ menu_container_selector:'#mp-menu',
135
155
  menu_trigger_selector:'#normal-button',
136
156
  punctuation: '.',
137
157
  states:[
@@ -53,4 +53,23 @@ var transtool_opts = {
53
53
  }
54
54
  }
55
55
  ]
56
- }
56
+ }
57
+
58
+
59
+
60
+ /**
61
+ * main方法
62
+ */
63
+ $(document).ready(function(){
64
+ var css_conf = eval(markdown_panel_style);
65
+ $('#readme').css(css_conf)
66
+
67
+ var conf = eval(jquery_ztree_toc_opts);
68
+ $('#tree').ztree_toc(conf);
69
+
70
+
71
+ var transtool_opts_conf = eval(transtool_opts);
72
+ $.transtool(transtool_opts_conf);
73
+
74
+ // $('#tree').hide()
75
+ });
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trans
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.9
4
+ version: 0.5.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - shiren1118
@@ -69,7 +69,8 @@ files:
69
69
  - template/css/zTreeStyle/img/loading.gif
70
70
  - template/css/zTreeStyle/img/zTreeStandard.gif
71
71
  - template/css/zTreeStyle/img/zTreeStandard.png
72
- - template/demo.html
72
+ - template/demo_dev.html
73
+ - template/demo_product.html
73
74
  - template/gulpfile.js
74
75
  - template/lib/jquery-1.4.4.min.js
75
76
  - template/lib/jquery.js