ontopia-tldr 0.0.1-java → 0.0.2-java

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  = Revision history for ontopia-tldr
4
4
 
5
+ == 0.0.2 [2013-10-24]
6
+
7
+ * Only show sample link when sample present.
8
+ * Added alternative filter implementation.
9
+ * Updated README.
10
+
5
11
  == 0.0.1 [2013-07-30]
6
12
 
7
13
  * Birthday :-)
data/README CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  == VERSION
4
4
 
5
- This documentation refers to ontopia-tldr version 0.0.1
5
+ This documentation refers to ontopia-tldr version 0.0.2
6
6
 
7
7
 
8
8
  == DESCRIPTION
@@ -68,7 +68,8 @@ Then put the following snippet in Apache's VirtualHost configuration:
68
68
  RackBaseURI /tldr
69
69
  <Directory /var/www/tldr>
70
70
  Options -MultiViews
71
- PassengerAppRoot /srv/tldr # <-- This (non-standard) line is important
71
+ PassengerAppRoot /srv/tldr # <-- This (non-standard) line is important
72
+ PassengerRuby /usr/local/jruby/bin/jruby # <-- And this one sets the Ruby interpreter to JRuby
72
73
  </Directory>
73
74
  </VirtualHost>
74
75
 
@@ -1,4 +1,4 @@
1
- var _sample = {};
1
+ var _sample = {}, _style;
2
2
 
3
3
  function sample(name) {
4
4
  var element = document.getElementsByName(name)[0];
@@ -8,7 +8,7 @@ function sample(name) {
8
8
  }
9
9
  }
10
10
 
11
- function filter(value, name) {
11
+ function filter1(value, name) {
12
12
  var ul = document.getElementById(name);
13
13
  if (ul) {
14
14
  var lis = ul.getElementsByTagName('li');
@@ -22,3 +22,15 @@ function filter(value, name) {
22
22
  }
23
23
  }
24
24
  }
25
+
26
+ /* http://redotheweb.com/2013/05/15/client-side-full-text-search-in-css.html */
27
+ function filter2(value, name) {
28
+ if (!_style) {
29
+ _style = document.createElement('style');
30
+ document.head.appendChild(_style);
31
+ }
32
+
33
+ _style.innerHTML = value ? '#' + name + ' li:not([data-index*="' + value.toLowerCase() + '"]) { display: none; }' : '';
34
+ }
35
+
36
+ var filter = filter1;
@@ -28,7 +28,7 @@ module Ontopia
28
28
 
29
29
  MAJOR = 0
30
30
  MINOR = 0
31
- TINY = 1
31
+ TINY = 2
32
32
 
33
33
  class << self
34
34
 
@@ -13,13 +13,13 @@
13
13
  <table>
14
14
  <tr>
15
15
  <td colspan="2">
16
- <strong><%=h settings.title_query %></strong> [<a href="javascript:sample('q')">sample</a>]:<br />
16
+ <strong><%=h settings.title_query %></strong><%= sample_link('q') %>:<br />
17
17
  <textarea name="q" rows="10" cols="50"><%=h @query %></textarea>
18
18
  </td>
19
19
  </tr>
20
20
  <tr>
21
21
  <td colspan="2">
22
- <strong><%=h settings.title_rules %></strong> [<a href="javascript:sample('r')">sample</a>]:<br />
22
+ <strong><%=h settings.title_rules %></strong><%= sample_link('r') %>:<br />
23
23
  <textarea name="r" rows="10" cols="50"><%=h @rules %></textarea>
24
24
  </td>
25
25
  </tr>
data/lib/ontopia/tldr.rb CHANGED
@@ -301,13 +301,16 @@ select $TYPE, $TOPIC from
301
301
 
302
302
  def render_topics(topics = @topics)
303
303
  _ul(topics.sort, id: :topics) { |topic|
304
- _li(link_to_topic(topic), ' (', settings.topic_index[topic].size, ')')
304
+ _li(link_to_topic(topic),
305
+ ' (', settings.topic_index[topic].size, ')',
306
+ 'data-index' => topic_to_s(topic).downcase)
305
307
  }
306
308
  end
307
309
 
308
310
  def render_documents(documents = @documents)
309
311
  _ul(documents.sort_by { |k,| k }, id: :documents) { |id, doc|
310
- _li(link_to_document(id, doc))
312
+ _li(link_to_document(id, doc),
313
+ 'data-index' => doc_to_s(id, doc).downcase)
311
314
  }
312
315
  end
313
316
 
@@ -348,6 +351,12 @@ select $TYPE, $TOPIC from
348
351
  _a(doc_to_s(id, doc), href: url("/document/#{h(id)}"))
349
352
  end
350
353
 
354
+ def sample_link(name)
355
+ if settings.tolog_sample[name]
356
+ %Q{ [#{_a(:sample, href: "javascript:sample('#{name}')")}]}
357
+ end
358
+ end
359
+
351
360
  def _a(*args)
352
361
  _tag(:a, *args)
353
362
  end
metadata CHANGED
@@ -2,14 +2,14 @@
2
2
  name: ontopia-tldr
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.1
5
+ version: 0.0.2
6
6
  platform: java
7
7
  authors:
8
8
  - Jens Wille
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-30 00:00:00.000000000 Z
12
+ date: 2013-10-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -103,14 +103,21 @@ files:
103
103
  homepage: http://github.com/blackwinter/ontopia-tldr
104
104
  licenses:
105
105
  - AGPL
106
- post_install_message:
106
+ post_install_message: |2+
107
+
108
+ ontopia-tldr-0.0.2 [2013-10-24]:
109
+
110
+ * Only show sample link when sample present.
111
+ * Added alternative filter implementation.
112
+ * Updated README.
113
+
107
114
  rdoc_options:
108
115
  - --charset
109
116
  - UTF-8
110
117
  - --line-numbers
111
118
  - --all
112
119
  - --title
113
- - ontopia-tldr Application documentation (v0.0.1)
120
+ - ontopia-tldr Application documentation (v0.0.2)
114
121
  - --main
115
122
  - README
116
123
  require_paths: