[Debian-islamic-commits] [thawab] 12/17: New upstream version 4.1

Shanavas M shanavas-guest at moszumanska.debian.org
Tue Jun 6 08:04:29 UTC 2017


This is an automated email from the git hooks/post-receive script.

shanavas-guest pushed a commit to branch master
in repository thawab.

commit 26c96ec6cbc3de1ce8b2aa2442c7ffc6ad217d16
Author: Shanavas M <shanvas at buroojsystems.com>
Date:   Sun Jun 4 13:16:02 2017 +0300

    New upstream version 4.1
---
 Thawab/gtkUi.py                                    |   3 +
 Thawab/shamelaUtils.py                             |  35 +-
 thawab-data/themes/default/templates/main.html     |   2 +-
 thawab-data/themes/neo/static/fx.css               |  73 +++
 thawab-data/themes/neo/static/ie-fx.css            |  17 +
 thawab-data/themes/neo/static/img/about.gif        | Bin 0 -> 1135 bytes
 thawab-data/themes/neo/static/img/book.png         | Bin 0 -> 1438 bytes
 thawab-data/themes/neo/static/img/close.gif        | Bin 0 -> 1222 bytes
 thawab-data/themes/neo/static/img/code.gif         | Bin 0 -> 1210 bytes
 thawab-data/themes/neo/static/img/external.gif     | Bin 0 -> 101 bytes
 thawab-data/themes/neo/static/img/favicon.ico      | Bin 0 -> 4822 bytes
 thawab-data/themes/neo/static/img/forum.gif        | Bin 0 -> 1146 bytes
 thawab-data/themes/neo/static/img/get_ffx.png      | Bin 0 -> 7050 bytes
 thawab-data/themes/neo/static/img/go-back.png      | Bin 0 -> 1129 bytes
 thawab-data/themes/neo/static/img/go-next.png      | Bin 0 -> 1108 bytes
 thawab-data/themes/neo/static/img/go-up.png        | Bin 0 -> 1074 bytes
 thawab-data/themes/neo/static/img/home.png         | Bin 0 -> 1874 bytes
 thawab-data/themes/neo/static/img/loading.gif      | Bin 0 -> 3474 bytes
 thawab-data/themes/neo/static/img/logo.png         | Bin 0 -> 77673 bytes
 thawab-data/themes/neo/static/img/mail.gif         | Bin 0 -> 634 bytes
 thawab-data/themes/neo/static/img/print.png        | Bin 0 -> 1253 bytes
 thawab-data/themes/neo/static/img/quote.gif        | Bin 0 -> 529 bytes
 thawab-data/themes/neo/static/img/rpm.gif          | Bin 0 -> 1144 bytes
 thawab-data/themes/neo/static/img/scrolldn.png     | Bin 0 -> 955 bytes
 thawab-data/themes/neo/static/img/scrollup.png     | Bin 0 -> 907 bytes
 thawab-data/themes/neo/static/img/search.png       | Bin 0 -> 1560 bytes
 thawab-data/themes/neo/static/img/spacer.png       | Bin 0 -> 1160 bytes
 thawab-data/themes/neo/static/img/text.png         | Bin 0 -> 1963 bytes
 thawab-data/themes/neo/static/img/tree.png         | Bin 0 -> 888 bytes
 thawab-data/themes/neo/static/img/up.gif           | Bin 0 -> 86 bytes
 .../themes/neo/static/img/valid-css-blue.gif       | Bin 0 -> 1759 bytes
 .../themes/neo/static/img/valid-xhtml10-blue.gif   | Bin 0 -> 2065 bytes
 thawab-data/themes/neo/static/main.css             | 493 +++++++++++++++++++++
 thawab-data/themes/neo/static/main.js              | 219 +++++++++
 thawab-data/themes/neo/static/manual/all.css       | 120 +++++
 .../themes/neo/static/manual/images/important.png  | Bin 0 -> 2250 bytes
 .../themes/neo/static/manual/images/note.png       | Bin 0 -> 2520 bytes
 .../themes/neo/static/manual/images/tip.png        | Bin 0 -> 2909 bytes
 .../themes/neo/static/manual/images/warning.png    | Bin 0 -> 3249 bytes
 thawab-data/themes/neo/static/manual/manual.html   | 273 ++++++++++++
 thawab-data/themes/neo/static/print.css            |   3 +
 thawab-data/themes/neo/static/th-main.js           | 153 +++++++
 thawab-data/themes/neo/static/th-view.js           | 164 +++++++
 thawab-data/themes/neo/templates/footer.html       |  19 +
 thawab-data/themes/neo/templates/layout.html       |  43 ++
 .../themes/{default => neo}/templates/main.html    |  57 +--
 thawab-data/themes/neo/templates/minisearch.html   |  25 ++
 thawab-data/themes/neo/templates/view.html         |  43 ++
 thawab-server                                      | 252 ++++++++++-
 thawab.spec                                        | 129 ++++--
 50 files changed, 2047 insertions(+), 76 deletions(-)

diff --git a/Thawab/gtkUi.py b/Thawab/gtkUi.py
index bf69320..c8d4091 100644
--- a/Thawab/gtkUi.py
+++ b/Thawab/gtkUi.py
@@ -22,6 +22,9 @@ import sys, os, os.path, time, re, sqlite3
 import shutil, tempfile
 import threading, socket
 import gettext
+import gi
+gi.require_version("Gtk", "3.0")
+gi.require_version("WebKit", "3.0")
 from gi.repository import Gtk, Gdk, GObject, WebKit, Pango, GLib
 from subprocess import Popen, PIPE
 from urllib import unquote
diff --git a/Thawab/shamelaUtils.py b/Thawab/shamelaUtils.py
index 330586c..9dba0a0 100644
--- a/Thawab/shamelaUtils.py
+++ b/Thawab/shamelaUtils.py
@@ -85,7 +85,7 @@ sh_digits_to_spaces_tb = {
 
 sh_normalize_tb = {
 65: 97, 66: 98, 67: 99, 68: 100, 69: 101, 70: 102, 71: 103, 72: 104, 73: 105, 74: 106, 75: 107, 76: 108, 77: 109, 78: 110, 79: 111, 80: 112, 81: 113, 82: 114, 83: 115, 84: 116, 85: 117, 86: 118, 87: 119, 88: 120, 89: 121, 90: 122,
-1569: 1575, 1570: 1575, 1571: 1575, 1572: 1575, 1573: 1575, 1574: 1575, 1577: 1607,    1609: 1575, 
+1569: 1575, 1570: 1575, 1571: 1575, 1572: 1575, 1573: 1575, 1574: 1575, 1577: 1607,    1609: 1575,
 8: 32, 1600:32, 1632: 48, 1633: 49, 1634: 50, 1635: 51, 1636: 52, 1637: 53, 1638: 54, 1639: 55, 1640: 56, 1641: 57, 1642:37, 1643:46
 }
 # TODO: remove unused variables and methods
@@ -96,7 +96,7 @@ std_shorts={
     u'B': u'رضي الله عن',
     u'C': u'رحمه الله',
     u'D': u'عز وجل',
-    u'E': u'عليه الصلاة و السلام', 
+    u'E': u'عليه الصلاة و السلام',
 }
 
 footnotes_cnd = [] # candidate, in the form of (footnote_mark, footnote_text) tuples
@@ -200,14 +200,14 @@ class ShamelaSqlite(object):
             raise TypeError
         tables = filter(lambda t: not t.isdigit(), tables)
         return tables
-    
+
     def _getTablesInBok(self):
         if self.tables:
             return self.tables
         self.tables = self._getTablesInFile(self.bok_fn)
         self.tablesFn = dict(((t,self.bok_fn) for t in self.tables))
         return self.tables
-    
+
     def _getTablesInDir(self):
         if self.tables:
             return self.tables
@@ -261,9 +261,9 @@ class ShamelaSqlite(object):
             r,e = pipe.communicate()
             print e
             r=r.replace('\r', '')
-            if pipe.returncode != 0:
-                raise TypeError
-        if self.mode=='0.7' or (e.startswith("mdb-schema: invalid option") and opts[1]=='-S'):
+            #if pipe.returncode != 0:
+                #raise TypeError
+        if self.mode=='0.7' or ((e.startswith("mdb-schema: invalid option") or e.startswith("option parsing failed: Unknown option")) and opts[1]=='-S'):
             print "MODE 0.7"
             del opts[1]
             self.mode='0.7'
@@ -520,7 +520,7 @@ class _foundShHeadingMatchItem():
         self.depth = depth
         self.fuzzy = fuzzy
         self.suffix = ''
-    
+
     def __repr__(self):
         return (u"<start = {0}, end = {1}, txt = {2}>".format(self.start,
                                                               self.end,
@@ -539,7 +539,7 @@ def _fixHeadBounds(pg_txt, found):
             f.end = f.start
             f.suffix = u'\u2026'
             if f.fuzzy >= 7:
-                #then move f.start to the last \n 
+                #then move f.start to the last \n
                 f.end = max(pg_txt[:f.end].rfind('\n'), 0)
             if i > 0:
                 f.end = max(f.end,found[i-1].end)
@@ -641,9 +641,9 @@ def shamelaImport(cursor,
                              fuzzy):
         # fuzzy is saved because it could be used later to figure whither to add newline
         # or to move start point
-        for m in headings_re.finditer(page_txt): # 
+        for m in headings_re.finditer(page_txt): #
             # NOTE: since this is not exact, make it ends at start. FIXME: it was m.end()
-            candidate = _foundShHeadingMatchItem(m.start(), m.start(), h, d, fuzzy) 
+            candidate = _foundShHeadingMatchItem(m.start(), m.start(), h, d, fuzzy)
             ii = bisect.bisect_left(found, candidate) # only check for overlaps in found[ii:]
             # skip matches that overlaps with previous headings
             if any(imap(lambda mi: mi.overlaps_with(candidate),found[ii:])):
@@ -666,11 +666,11 @@ def shamelaImport(cursor,
                 # print "found"
                 candidate = _foundShHeadingMatchItem(i+shift, i+shift+l, h, d, fuzzy)
                 # only check for overlaps in found[ii:]
-                ii = bisect.bisect_left(found, candidate) 
+                ii = bisect.bisect_left(found, candidate)
                 # skip matches that overlaps with previous headings
                 if not any(imap(lambda mi: mi.overlaps_with(candidate),found[ii:])):
                     # add the candidate to the found list
-                    bisect.insort(found, candidate) 
+                    bisect.insort(found, candidate)
                     toc_hash[page_id][j] = None
                     return True
                 # skip to i+l
@@ -689,7 +689,7 @@ def shamelaImport(cursor,
         # for each heading
         for j, ix in enumerate(l):
             h, d = toc_ls[ix][1:3]
-            # search for entire line matches 
+            # search for entire line matches
             # (exact, then only letters and digits then only letters: 1,2,3)
             # search for leading matches
             # (exact, then only letters and digits then only letters: 4,5,6)
@@ -785,9 +785,9 @@ def shamelaImport(cursor,
         del ft[:]
         return s
 
-    # step 3: walk through pages, accumulating contents    
+    # step 3: walk through pages, accumulating contents
     # NOTE: in some books id need not be unique
-    # 
+    #
     blnk_base = sh.getBLink(bkid)
     blnk = ""
     blnk_old = ""
@@ -980,7 +980,7 @@ def shamelaImport(cursor,
             last += "\n==========[\n" + \
                     pop_footers(footnotes_cnd) + \
                     "\n]==========\n"
-        
+
 
     if not started:
         raise TypeError
@@ -1017,4 +1017,3 @@ if __name__  ==  '__main__':
         n = meta['kitab']
         del ki
         shutil.move(o, os.path.join(dst, n))
-
diff --git a/thawab-data/themes/default/templates/main.html b/thawab-data/themes/default/templates/main.html
index adcbf8b..3b4b226 100644
--- a/thawab-data/themes/default/templates/main.html
+++ b/thawab-data/themes/default/templates/main.html
@@ -11,7 +11,7 @@ var script='';
   <a class="blurOnFocus" style="float:right;" href="http://www.ojuba.org/wiki/thawab/get" title="الحصول على ثواب"><img src="/_theme/img/rpm.gif"  alt="get package" /></a>
   <a class="blurOnFocus" style="float:right;" href="http://www.ojuba.org/wiki/اتصل_بنا" title="راسلنا"><img src="/_theme/img/mail.gif" alt="contact us" /></a>
   <a class="blurOnFocus" style="float:right;" href="http://www.linuxac.org/forum/forumdisplay.php?68" title="المنتدى"><img src="/_theme/img/forum.gif" alt="forum" /></a>
-  <a class="blurOnFocus" style="float:right;" href="http://git.ojuba.org/cgit/thawab/tree/" title="كود ثواب"><img src="/_theme/img/code.gif" alt="code" /></a>
+  <a class="blurOnFocus" style="float:right;" href="https://github.com/ojuba-org/thawab" title="كود ثواب"><img src="/_theme/img/code.gif" alt="code" /></a>
 %end
 
 <div id="contentheader">
diff --git a/thawab-data/themes/neo/static/fx.css b/thawab-data/themes/neo/static/fx.css
new file mode 100644
index 0000000..73b8388
--- /dev/null
+++ b/thawab-data/themes/neo/static/fx.css
@@ -0,0 +1,73 @@
+/* fx */
+
+#async_tips_div {
+	background-color:rgba(255,255,200,0.9);
+}
+
+#overlay {
+	opacity:0.7;
+}
+.showOnFocus {
+	opacity:0.4;
+}
+.showOnFocus:active, .showOnFocus:focus {
+	opacity:0.75;
+}
+.showOnFocus:hover {
+	opacity:1;
+}
+
+.blurOnFocus {
+	opacity:1.0;
+}
+.blurOnFocus:active, .showOnFocus:focus {
+	opacity:0.75;
+}
+.blurOnFocus:hover {
+	opacity:0.4;
+}
+
+#minisearch input {
+	background:rgba(255,255,255,0.6);
+}
+#absnav {
+	-webkit-border-radius:20px;
+	-moz-border-radius:20px;
+	border-radius:20px;
+	padding:0 20px;
+
+	-webkit-box-shadow:0 0 8px rgba(240,240,240,0.4);
+	-moz-box-shadow:0 0 8px 8px rgba(240,240,240,0.4);
+}
+#absnav2, #absnav3{
+	-webkit-border-radius:20px;
+	-moz-border-radius:20px;
+	border-radius:20px;
+	padding:0 20px;
+
+	-webkit-box-shadow:0 0 8px rgba(240,240,240,0.4);
+	-moz-box-shadow:0 0 8px 8px rgba(240,240,240,0.4);
+}
+#absnav3{
+	padding:0 5px;
+}
+
+#minisearch {
+	-webkit-border-bottom-left-radius:8px;
+	-moz-border-radius-bottomleft:8px;
+	border-bottom-left-radius:8px;
+	-webkit-border-bottom-right-radius:32px;
+	-moz-border-radius-bottomright:32px;
+	border-bottom-right-radius:32px;
+	padding:0 8px 2px 0;
+}
+#container{
+	-webkit-border-radius:10px;
+	-moz-border-radius:10px;
+	border-radius:10px;
+
+	/* -webkit-box-shadow:0 0 8px rgba(128,128,128,0.4); */
+	-moz-box-shadow:0 0 8px 4px rgba(128,128,128,0.4);
+}
+#absnav3 { position: fixed; }
+
diff --git a/thawab-data/themes/neo/static/ie-fx.css b/thawab-data/themes/neo/static/ie-fx.css
new file mode 100644
index 0000000..e02129c
--- /dev/null
+++ b/thawab-data/themes/neo/static/ie-fx.css
@@ -0,0 +1,17 @@
+/* fx-ie */
+#overlay {
+	filter:alpha(opacity=70);
+}
+.showOnFocus {
+	filter:alpha(opacity=50);
+}
+.showOnFocus:hover {
+	filter:alpha(opacity=100);
+}
+.blurOnFocus{
+	filter:alpha(opacity=100);
+}
+.showOnFocus:hover {
+	filter:alpha(opacity=40);
+}
+#absnav3{ display:none; }
diff --git a/thawab-data/themes/neo/static/img/about.gif b/thawab-data/themes/neo/static/img/about.gif
new file mode 100644
index 0000000..a9c8358
Binary files /dev/null and b/thawab-data/themes/neo/static/img/about.gif differ
diff --git a/thawab-data/themes/neo/static/img/book.png b/thawab-data/themes/neo/static/img/book.png
new file mode 100644
index 0000000..2ed1d07
Binary files /dev/null and b/thawab-data/themes/neo/static/img/book.png differ
diff --git a/thawab-data/themes/neo/static/img/close.gif b/thawab-data/themes/neo/static/img/close.gif
new file mode 100644
index 0000000..151c252
Binary files /dev/null and b/thawab-data/themes/neo/static/img/close.gif differ
diff --git a/thawab-data/themes/neo/static/img/code.gif b/thawab-data/themes/neo/static/img/code.gif
new file mode 100644
index 0000000..22a394d
Binary files /dev/null and b/thawab-data/themes/neo/static/img/code.gif differ
diff --git a/thawab-data/themes/neo/static/img/external.gif b/thawab-data/themes/neo/static/img/external.gif
new file mode 100644
index 0000000..fdaa851
Binary files /dev/null and b/thawab-data/themes/neo/static/img/external.gif differ
diff --git a/thawab-data/themes/neo/static/img/favicon.ico b/thawab-data/themes/neo/static/img/favicon.ico
new file mode 100644
index 0000000..cc9d95a
Binary files /dev/null and b/thawab-data/themes/neo/static/img/favicon.ico differ
diff --git a/thawab-data/themes/neo/static/img/forum.gif b/thawab-data/themes/neo/static/img/forum.gif
new file mode 100644
index 0000000..cd3af8e
Binary files /dev/null and b/thawab-data/themes/neo/static/img/forum.gif differ
diff --git a/thawab-data/themes/neo/static/img/get_ffx.png b/thawab-data/themes/neo/static/img/get_ffx.png
new file mode 100644
index 0000000..adc01a6
Binary files /dev/null and b/thawab-data/themes/neo/static/img/get_ffx.png differ
diff --git a/thawab-data/themes/neo/static/img/go-back.png b/thawab-data/themes/neo/static/img/go-back.png
new file mode 100644
index 0000000..af1b730
Binary files /dev/null and b/thawab-data/themes/neo/static/img/go-back.png differ
diff --git a/thawab-data/themes/neo/static/img/go-next.png b/thawab-data/themes/neo/static/img/go-next.png
new file mode 100644
index 0000000..01b7cf4
Binary files /dev/null and b/thawab-data/themes/neo/static/img/go-next.png differ
diff --git a/thawab-data/themes/neo/static/img/go-up.png b/thawab-data/themes/neo/static/img/go-up.png
new file mode 100644
index 0000000..b413828
Binary files /dev/null and b/thawab-data/themes/neo/static/img/go-up.png differ
diff --git a/thawab-data/themes/neo/static/img/home.png b/thawab-data/themes/neo/static/img/home.png
new file mode 100644
index 0000000..8c848bc
Binary files /dev/null and b/thawab-data/themes/neo/static/img/home.png differ
diff --git a/thawab-data/themes/neo/static/img/loading.gif b/thawab-data/themes/neo/static/img/loading.gif
new file mode 100644
index 0000000..513a3ec
Binary files /dev/null and b/thawab-data/themes/neo/static/img/loading.gif differ
diff --git a/thawab-data/themes/neo/static/img/logo.png b/thawab-data/themes/neo/static/img/logo.png
new file mode 100644
index 0000000..04ae78a
Binary files /dev/null and b/thawab-data/themes/neo/static/img/logo.png differ
diff --git a/thawab-data/themes/neo/static/img/mail.gif b/thawab-data/themes/neo/static/img/mail.gif
new file mode 100644
index 0000000..3c26f06
Binary files /dev/null and b/thawab-data/themes/neo/static/img/mail.gif differ
diff --git a/thawab-data/themes/neo/static/img/print.png b/thawab-data/themes/neo/static/img/print.png
new file mode 100644
index 0000000..eb47921
Binary files /dev/null and b/thawab-data/themes/neo/static/img/print.png differ
diff --git a/thawab-data/themes/neo/static/img/quote.gif b/thawab-data/themes/neo/static/img/quote.gif
new file mode 100644
index 0000000..aaaaa7c
Binary files /dev/null and b/thawab-data/themes/neo/static/img/quote.gif differ
diff --git a/thawab-data/themes/neo/static/img/rpm.gif b/thawab-data/themes/neo/static/img/rpm.gif
new file mode 100644
index 0000000..9354e5d
Binary files /dev/null and b/thawab-data/themes/neo/static/img/rpm.gif differ
diff --git a/thawab-data/themes/neo/static/img/scrolldn.png b/thawab-data/themes/neo/static/img/scrolldn.png
new file mode 100644
index 0000000..39209d4
Binary files /dev/null and b/thawab-data/themes/neo/static/img/scrolldn.png differ
diff --git a/thawab-data/themes/neo/static/img/scrollup.png b/thawab-data/themes/neo/static/img/scrollup.png
new file mode 100644
index 0000000..e0076e4
Binary files /dev/null and b/thawab-data/themes/neo/static/img/scrollup.png differ
diff --git a/thawab-data/themes/neo/static/img/search.png b/thawab-data/themes/neo/static/img/search.png
new file mode 100644
index 0000000..afb9588
Binary files /dev/null and b/thawab-data/themes/neo/static/img/search.png differ
diff --git a/thawab-data/themes/neo/static/img/spacer.png b/thawab-data/themes/neo/static/img/spacer.png
new file mode 100644
index 0000000..f3133d5
Binary files /dev/null and b/thawab-data/themes/neo/static/img/spacer.png differ
diff --git a/thawab-data/themes/neo/static/img/text.png b/thawab-data/themes/neo/static/img/text.png
new file mode 100644
index 0000000..07eb189
Binary files /dev/null and b/thawab-data/themes/neo/static/img/text.png differ
diff --git a/thawab-data/themes/neo/static/img/tree.png b/thawab-data/themes/neo/static/img/tree.png
new file mode 100644
index 0000000..225aca9
Binary files /dev/null and b/thawab-data/themes/neo/static/img/tree.png differ
diff --git a/thawab-data/themes/neo/static/img/up.gif b/thawab-data/themes/neo/static/img/up.gif
new file mode 100644
index 0000000..2beaedb
Binary files /dev/null and b/thawab-data/themes/neo/static/img/up.gif differ
diff --git a/thawab-data/themes/neo/static/img/valid-css-blue.gif b/thawab-data/themes/neo/static/img/valid-css-blue.gif
new file mode 100644
index 0000000..c373b2a
Binary files /dev/null and b/thawab-data/themes/neo/static/img/valid-css-blue.gif differ
diff --git a/thawab-data/themes/neo/static/img/valid-xhtml10-blue.gif b/thawab-data/themes/neo/static/img/valid-xhtml10-blue.gif
new file mode 100644
index 0000000..cee6742
Binary files /dev/null and b/thawab-data/themes/neo/static/img/valid-xhtml10-blue.gif differ
diff --git a/thawab-data/themes/neo/static/main.css b/thawab-data/themes/neo/static/main.css
new file mode 100644
index 0000000..eb0ee37
--- /dev/null
+++ b/thawab-data/themes/neo/static/main.css
@@ -0,0 +1,493 @@
+.clear {clear:both; padding-bottom:2px;}
+
+a img { border: none; }
+a[href] { text-decoration: none; color:#150;}
+a[href]:hover { text-decoration: underline; }
+a[target] { background: transparent url('img/external.gif') top left no-repeat; padding-left:12px;}
+
+body {
+  font-family: "amiri", "Liberation Sans", "KacstOne", "Simplified Naskh", "KFGQPC Uthman Taha Naskh", "ArabeyesQr", "Times New Roman", "sans", "Sans";
+	background:#ccc;
+	margin:0;padding:0;border:0;
+}
+h1, h2{
+margin:0;
+padding:0;
+color:#303030;
+}
+.clearer {
+display: block;height: 12px;
+}
+#async_tips_div {
+	display:none;
+	position: absolute;
+	background-color:#ffe;
+	left:20%;
+	margin:0; padding:3px 10px;
+	border:2px solid #aa7;
+	border:2px solid rgba(170, 170, 119, 0.6);
+}
+.match { background-color:#acf; }
+.term0 { background-color:#acf; }
+.term1 { background-color:#fca; }
+.term2 { background-color:#cfa; }
+.term3 { background-color:#fac; }
+.term4 { background-color:#afc; }
+.term5 { background-color:#caf; }
+
+
+.quran {
+  font-family: "amiri-quran", "amiri", "Simplified Naskh", "me_quran", "KFGQPC Uthman Taha Naskh", "ArabeyesQr", "Times New Roman", "Serif";
+  font-size: 150%;
+  color: #240;
+ background: linear-gradient(#fffffc,#ffc);
+padding: 4px;
+border: 1px solid #ff0;
+border-radius: 4px;
+box-shadow: 0px 0px 10px -4px #ff0;
+}
+
+blockquote {
+  border:3px dotted #aaa;
+  background:#ddd url('img/quote.gif') top left no-repeat;
+  background-color:rgba(190, 230, 190, 0.4);
+  padding:5px 50px;
+}
+
+input.search_input {
+    font-family: "amiri", "Simplified Naskh", "me_quran", "KFGQPC Uthman Taha Naskh", "ArabeyesQr", "Times New Roman", "Serif";
+padding: 3px 30px 3px 3px;
+border-radius: 0px 5px 5px 0px;
+    font-size: 12pt;
+    color: rgb(0, 0, 0);
+    border: 1px solid #56C016;
+    background: #fff url("img/search.png") no-repeat right 3px;
+    width: 576px;
+    box-shadow:  0px -3px 1px 0px #d1d1d1 inset;
+	transition: all 400ms ease-in-out;
+float: right;
+margin-top: 2px;
+}
+input:focus.search_input,
+input:hover.search_input {
+ border: 1px solid #56C016;
+}
+
+input.submit_button {
+float: left;
+height: 36px;
+border: 1px solid rgb(86, 192, 22);
+background: linear-gradient(#80f838,#64e318);
+margin: 2px -1px 0px 0px;
+width: 56px;
+border-radius: 5px 0px 0px 5px;
+color:#fff;
+text-shadow: 0px 0px 3px #255D04;
+
+font-size: 14px;
+}
+#loading {
+	display:none;
+	background:transparent url('img/loading.gif') center center no-repeat;
+	position:absolute;
+	top:16px;
+	left:8px;
+	margin:20px auto;
+	width:32px;
+	height:32px;
+}
+#logo {
+	background:transparent;
+	position:absolute;
+	top:8px;
+	right:8px;
+	height:48px;
+	font-size:24px;
+	line-height: 100%;
+	text-decoration: none;
+	vertical-align:middle;
+	margin:0;padding:0;border:0;
+}
+#logo img {border:0; vertical-align: middle;}
+#results {
+background: #A3F96F;
+color: #fff;
+overflow: hidden;
+position: fixed;
+display:none;
+top: 87px;
+left: 37px;
+width: 500px;
+height: 300px;
+margin: 0;
+padding: 0;
+border: 1px solid #56C016;
+border-top: 0;
+z-index: 1;
+}
+#nominisearch {
+	display:none;
+	text-align:right;
+	width:200px;
+	margin:0;padding:0;
+}
+
+#minisearch {
+background: linear-gradient(#9cfb63e6,#64e318e6);
+color: #fff;
+overflow: hidden;
+position: fixed;
+top: 50px;
+left: 48px;
+width: 250px;
+height: 32px;
+margin: 0;
+padding: 0;
+border: 1px solid #56C016;
+z-index: 1;
+border-radius: 2px;
+box-shadow: 0px 0px 10px -5px #170;
+}
+#minisearch form {
+	margin:0;border:0;padding:0;
+}
+#minisearch input {
+    background: #fff6;
+    width: 244px;
+    height: 26px;
+    border: 1px solid #ffffff4d;
+    margin: 1px;
+    border-radius: 2px;
+}
+
+#searchHelpDiv { display:none;}
+
+#searchHelp {
+	background:#ffffa0;
+	padding:16px;
+	-webkit-border-radius:8px;
+	-moz-border-radius:8px;
+	border-radius:8px;
+}
+#searchHelpArrow {
+	background:transparent url('img/up.gif') right top no-repeat;
+	margin:0 24px;
+	height:16px;
+	width:32px;
+}
+
+
+
+
+#container {
+	background-image: radial-gradient(circle 1000px at top,#fff 0%,#ccc 40%);
+min-height: 100vh;
+}
+
+#footer {
+background: linear-gradient(#eee,#ddd);
+color: #111;
+margin: 36px;
+text-align: left;
+height: 35px;
+text-shadow: 1px 1px 0px #ccc;
+padding: 6px;
+border: 1px solid #555;
+border-radius: 4px;
+box-shadow: 0px 0px 6px -1px #666;
+}
+#footer img {border:0;}
+#contentheaderHome {
+text-align: center;
+padding: 32px;
+}
+#contentheader {
+text-align: right;
+position: fixed;
+top: 0px;
+left: 24px;
+right: 24px;
+background: linear-gradient(#9cfb63,#64e318);
+border: 1px solid #56c016;
+border-top: none;
+border-radius: 0 0 4px 4px;
+color: #fff;
+text-shadow: 0px 0px 3px #255D04;
+padding: 4px 12px;
+font-size: 20px;
+max-height: 37px;
+overflow-x: auto;
+overflow-y: hidden;
+}
+#contentheader a, #toolbar a.button {
+color: #fff;
+text-shadow: 0px 0px 3px #255D04;
+background: linear-gradient(rgba(255, 255, 255, 0.4),#64e318);
+border: 1px solid #64e318;
+border-radius: 5px;
+padding: 0 10px;
+box-shadow: 0px 0px 5px -3px #150;
+display:inline-block;
+white-space: nowrap;
+vertical-align: top;
+}
+#contentheader a:hover, #toolbar a.button:hover{
+text-decoration: none;
+border: 1px solid rgba(17, 85, 0, 0.33);
+box-shadow: 0px 0px 3px -1px #150;
+}
+#contentheader a:active, #toolbar a.button:active{
+background: linear-gradient(#64e318,rgba(255, 255, 255, 0.4));
+}
+#contentheader a.home{
+
+}
+#contentheaderHome .logo {
+    width: 256px;
+	height: 256px;
+    cursor: pointer;
+}
+#toolbar {
+position: fixed;
+top: 46px;
+right: 35px;
+left: 35px;
+border: 1px solid #56c016;
+border-top: 0;
+background: linear-gradient(rgba(156, 251, 99, 0.9),rgba(100, 227, 24, 0.93));
+border-bottom: none;
+padding: 5px 3px;
+}
+a.inactive {
+filter: grayscale(100%);
+opacity: 0.5;
+cursor: not-allowed;
+}
+#toolbar a.button {
+margin-left: 10px;
+border-radius: 2.5px;
+box-shadow: 0px 0px 2.5px -1.5px #150;
+padding: 2px 10px;
+}
+#contentbodyHome {
+	margin:0;padding:0 16px;border:0;
+}
+#contentbody {
+background: #fff;
+margin: 74px 35px;
+border: 1px solid #56c016;
+border-radius: 0 0 4px 4px;
+padding: 0 12px;
+min-height: 100vh;
+box-shadow: 0 0px 30px -10px #150;
+}
+/* nav */
+.navtoolbar {
+	overflow:hidden;
+	width:100%;height:32px;
+	background:#acf;
+	background:rgba(240,240,255,0.4);
+	z-index:10;
+}
+
+.navtoolbar span, #searchbar span, #tailnav span{
+  float:right;
+}
+.navtoolbar span.otherside, #searchbar span.otherside, #tailnav span.otherside{
+  float:left;
+}
+
+.navtoolbar a, #tailnav a {
+  padding-right:24px;padding-left:16px;
+}
+.navtoolbar a.prevLink, #tailnav a.prevLink {
+  background:url('img/go-prev.gif') center right no-repeat;
+}
+.navtoolbar a.upLink, #tailnav a.upLink{
+background:url('img/go-up.gif') center right no-repeat;
+}
+.navtoolbar a.homeLink, #tailnav a.homeLink{
+background:url('img/go-home.gif') center right no-repeat;
+}
+.navtoolbar a.nextLink, #tailnav a.nextLink{
+background:url('img/go-next.gif') center left no-repeat;
+padding-left:24px;padding-right:16px;
+}
+#overlay {
+	display: none;
+	overflow:hidden;
+	position: absolute;
+	left:0; top:0;
+	z-index:1000;
+	background:#fff;
+}
+
+
+
+.Box {
+	border-radius: 5px;
+	margin:20px;
+	background-color:#eef7ee;
+position: relative;
+box-shadow: 0px 0px 10px -4px #150;
+}
+
+.Box h2 {
+margin: 0;
+background: linear-gradient(#80f838,#64e318);
+color: #fff;
+text-shadow: 0px 0px 3px #255D04;
+padding: 0 12px;
+border: 1px solid rgb(86, 192, 22);
+border-radius: 5px 5px 0px 0px;
+}
+.Box div.info {
+position: absolute;
+top: 10px;
+left: 10px;
+color: #150;
+opacity: 0.5;
+}
+.Box div.info:hover {
+opacity:1;
+}
+#kutubListing input {
+top: 10px;
+left: 10px;
+position: absolute;
+}
+#kutubListing ul { 
+    display:inline;
+    }
+#kutubListing ul li {
+list-style: none;
+}
+#kutubListing ul li a {
+    display:inline;
+    font-size:18px;
+	display:block;
+	float:right;
+	margin:18px 16px;
+	padding-top:64px;
+	width:130px;
+	height:50px;
+	text-align:center;
+	background: url('img/book.png') no-repeat center 8px,radial-gradient(#eef7ee,#e3f9cd);
+border: 1px solid #e3f9cd;
+border-radius: 8px;
+box-shadow: 0px 0px 5px -2px #657556;
+transition: all 400ms ease-in-out;
+}
+
+#kutubListing ul li a:hover{
+background: url('img/book.png') no-repeat center 8px,radial-gradient(#eef7ee,#bcdb9d);
+border: 1px solid #bcdb9d;
+text-decoration: none;
+}
+
+table,th,td	{
+	border:none;
+	border-collapse:collapse;
+	padding:6px;
+}
+
+table		{
+width: 96%;
+background: #666;
+border-radius: 6px;
+box-shadow: 1px 1px 10px rgba(0,0,0,0.3);
+}
+thead, tfoot	{color:white; }
+
+tbody td, tbody th{ background-color:#ddd; }
+
+tbody th { color:#222;}
+tbody td{border:1px solid #000;}
+tbody td:first-child{border-right:none;}
+tbody td:last-child{border-left:none;}
+
+tbody tr:nth-child(odd) td	{ background-color:#eee; color:#222}
+
+tfoot td, tfoot th	{border:none; font-size:130%}
+
+#SearchContainer_tab{
+overflow-y: scroll;
+height: 79vh;
+direction: rtl;
+}
+.searchItem {
+display: block;
+width: auto;
+border-radius: 3px;
+background: url("img/text.png") no-repeat scroll right 10px, #fff linear-gradient(#eef7ee,#e3f9cd) !important;
+border: 1px solid #e3f9cd;
+margin: 14px 10px 12px 8px;
+box-shadow: 0px 0px 5px -2px #657556;
+padding-right: 48px;
+transition: all 400ms ease-in-out;
+}
+.searchItem h2{
+background: transparent none repeat scroll 0% 0%;
+border: none;
+color: #150;
+text-shadow: 2px 1px 1px #ccc;
+font-weight: normal;
+padding-top: 1px;
+}
+.searchItem span{
+color: #950000;
+}
+
+.searchItem:hover {
+background: url("img/text.png") no-repeat scroll right 10px, #fff linear-gradient(#eef7ee,#bcdb9d) !important;
+border: 1px solid #bcdb9d;
+text-decoration: none  !important;
+}
+.searchItem:active {
+background: url("img/text.png") no-repeat scroll right 10px, #fff linear-gradient(#bcdb9d,#eef7ee) !important;
+border: 1px solid #bcdb9d;
+text-decoration: none  !important;
+}
+#SearchPages span {
+    display:inline;
+	float:right;
+	margin:0px;
+	text-align:center;
+	background: #def;
+	color:#777;
+	border:2px solid #acd;
+	width:42px;
+	cursor:pointer;
+}
+#SearchPages a{
+	padding:0 0.5em;
+}
+
+#SearchPages a.current{
+	background: #acf;
+	color:#000;
+}
+
+.mini table, .mini th, .mini td { padding:0; }
+.mini tbody a{
+	display:block;
+	padding:0 5px;
+	white-space:nowrap;
+	width:380px; overflow:hidden;
+}
+.mini #SearchPages span { font-size:80%; }
+
+.mini #SearchPages a{ padding:0 0.2em; }
+
+#SearchContainer.mini {
+	padding:36px 0 0 0;
+	overflow:hidden;
+}
+#rollup {
+	background: transparent url('img/close.gif')  0 0 no-repeat;
+	position:absolute;
+	width:22px;
+	height:22px;
+	left:0;
+	bottom:0;
+}
diff --git a/thawab-data/themes/neo/static/main.js b/thawab-data/themes/neo/static/main.js
new file mode 100644
index 0000000..ef23c7c
--- /dev/null
+++ b/thawab-data/themes/neo/static/main.js
@@ -0,0 +1,219 @@
+/**
+ *
+ * copyright © 2010 ojuba.org, Muayyad Saleh Alsadi
+ *
+ **/
+var klass="class";
+var animations={}, ani_c=0, init_ls=[];
+var autoscroll_dir=0, autoscroll_px=5;
+var overlay_d;
+
+function text_keyup(e, evt, func, bool) {
+    var charCode = (evt.which) ? evt.which : event.keyCode
+    if (charCode == 27) {  // catch ESC key and clear input
+        e.value = "";
+        if (bool == true) {
+            func("", true);
+        }else{
+            func("");
+        }
+        return false;
+    }
+}
+  
+// fake trim for IE
+if (!Boolean(String.prototype.trim)) {
+	String.prototype.trim = function() {
+		return this.replace(/^\s+/, '').replace(/\s+$/, '');
+	};
+}
+
+function get_url_vars() {
+	var vars = {}, i,j, e;
+	var s= document.location.search;
+	if (!s || s.length[0]==0 || s[0]!="?" ) return vars;
+	var a = s.slice(1).split('&');
+	for(i = 0; i < a.length; ++i) {
+		e = a[i].split("=",2);
+		if (e && e.length==2) vars[decodeURI(e[0])] = decodeURI(e[1]);
+	}
+	return vars;
+}
+
+function animation_loop() {
+	var i,a,fn,r;
+	for (i in animations) {
+		a=animations[i];
+		fn=a[0];
+		r=fn(a.slice(1));
+		if (r==false) delete animations[i];
+	}
+	setTimeout(animation_loop, 100);
+}
+
+function slide_down_cb(args) {
+	var o=args[0], h=args[1], px=args[2], cb=args[3];
+	var t=o.offsetHeight+px;
+	if (t>=h) t=h;
+	o.style.height=t+"px";
+	if (t==h) {
+		--ani_c;
+		if (cb) cb();
+		return false;
+	}
+	return true
+}
+
+function slide_down(o, h, px, cb) {
+	var d;
+	if (!h || h<0) h=o.offsetHeight;
+	if (!px || px<0) px=h/5.0;
+	if (px<1.0) px=1;
+	d=o.style.display;
+	o.style.display="none";
+	o.style.height=px+"px";
+	o.style.display=d;
+	animations["_"+(++ani_c)]=[slide_down_cb, o, h, px, cb];
+}
+
+function get_scroll_width() {
+	var w = window.pageXOffset || document.body.scrollLeft || document.documentElement.scrollLeft;
+	return w ? w : 0;
+}
+
+function get_scroll_height() {
+	var h = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;
+	return h ? h : 0;
+}
+
+function autoscroll_up_cb() {
+	
+	if (autoscroll_dir!=-1) return true;
+	var h=get_scroll_height(),t=h-autoscroll_px;
+	if (t<=0) {t=0; autoscroll_dir=0;}
+	window.scroll(0,t);
+	return true
+}
+function autoscroll_down_cb() {
+	if (autoscroll_dir!=1) return true;
+	var h=get_scroll_height(),t=h+autoscroll_px, hm=document.body.scrollHeight;
+	if (t>=hm) {t=hm; autoscroll_dir=0;}
+	window.scroll(0,t);
+	return true
+}
+function import_script(url){
+	var t = document.createElement("script");
+	t.type="text/javascript";
+	t.src = url;
+	document.body.appendChild(t);
+}
+function overlay_init() {
+	var d = document.createElement("div");
+	d.id="overlay";
+	d.style.width=document.documentElement.scrollWidth+"px";
+	d.style.height=document.documentElement.scrollHeight+"px";
+	document.body.appendChild(d);
+	overlay_d=d;
+	window.onresize = resize_cb;
+}
+function resize_cb() {
+	overlay_d.style.width=document.documentElement.scrollWidth+"px";;
+	overlay_d.style.height=document.documentElement.scrollHeight+"px";
+}
+
+function getAjax(url, q, success, failure) {
+	if (window.XMLHttpRequest){
+		// code for standard browsers Firefox, Chrome, Opera, Safari, and even IE7+
+		xmlhttp=new XMLHttpRequest();
+	} else {
+		// code for IE6, IE5
+		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
+	}
+	xmlhttp.onreadystatechange=function() {
+		if(xmlhttp.readyState==4) {
+			if (xmlhttp.status==200) success(xmlhttp.responseText);
+			else if (failure) failure();
+		}
+	}
+	s="";
+	for (var i in q) { s+="&"+i+"="+encodeURIComponent(q[i]); }
+	s=url+"?"+s.slice(1);
+	xmlhttp.open("GET",s,true);
+	xmlhttp.send(null);
+}
+var needs_external_json=false;
+
+var fromJson = function(t) {
+	return eval("("+t+")");
+}
+
+function getJson(url, q, success, failure) {
+	s=function(t){return success(fromJson(t));};
+	getAjax(url, q, s, failure);
+}
+
+function html_escape(s) {
+	return s.replace("&","&").replace("<","<").replace(">",">");
+}
+
+function re_escape(s) { return s.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1') }
+
+function search_entry_focus(e) {
+	e.setAttribute(klass, "search_active"+( e.getAttribute(klass) || "" ).replace("search_active","").replace("search_inactive",""));
+	if (e.value == "نص البحث") e.value = "";
+}
+function search_entry_blur(e) {
+	e.setAttribute(klass, "search_inactive"+( e.getAttribute(klass) || "" ).replace("search_active","").replace("search_inactive",""));
+	if (e.value == "") e.value = "نص البحث";
+}
+
+function rm_class(e,c) {
+  e.setAttribute(klass, ( e.getAttribute(klass) || "" ).replace(c,""));
+  return false;
+}
+
+function init_get_by_class() {
+if (document.getElementsByClassName == undefined) {
+	document.getElementsByClassName = function(className)
+	{
+		var hasClassName = new RegExp("(?:^|\\s)" + className + "(?:$|\\s)");
+		var allElements = document.getElementsByTagName("*");
+		var results = [];
+
+		var element;
+		for (var i = 0; (element = allElements[i]) != null; i++) {
+			var elementClass = element.className;
+			if (elementClass && elementClass.indexOf(className) != -1 && hasClassName.test(elementClass))
+				results.push(element);
+		}
+
+		return results;
+	}
+}
+}
+
+function init() {
+	try {
+		if (JSON) {
+			var t=JSON.parse('"t"');
+			fromJson = function(t) {
+				return JSON.parse(t);
+			}
+		} else needs_external_json=true;
+	} catch(e) {
+		needs_external_json=true;
+	}
+	init_get_by_class();
+	if (document.body.getAttribute(klass)!='body') {
+		klass="className"; /* hack for ie */
+	}
+	setTimeout(animation_loop, 100);
+	animations["_s_up"]=[autoscroll_up_cb];
+	animations["_s_dn"]=[autoscroll_down_cb];
+	overlay_init();
+	var i;
+	for (i in init_ls) init_ls[i]();
+}
+
+window.onload = init;
+
diff --git a/thawab-data/themes/neo/static/manual/all.css b/thawab-data/themes/neo/static/manual/all.css
new file mode 100644
index 0000000..508a11e
--- /dev/null
+++ b/thawab-data/themes/neo/static/manual/all.css
@@ -0,0 +1,120 @@
+.clear {clear:both; padding-bottom:2px;}
+pre, code { direction: ltr;}
+a img { border: none; }
+a[href] { text-decoration: none; color:#150;}
+a[href]:hover { text-decoration: underline; }
+a[target] { background: transparent url('../img/external.gif') top left no-repeat; padding: 0 0 0 12px;}
+
+body {
+	font-family: "amiri", "Liberation Sans", "KacstOne", "Simplified Naskh", "KFGQPC Uthman Taha Naskh", "ArabeyesQr", "Times New Roman", "sans", "Sans";
+	background:#999;
+	margin:0;padding:3em;border:0;
+}
+.export {
+	background:#fff;
+	margin:0;padding:3em;
+	border: #aaa solid 4px;
+}
+h1, h2, h3, h4 {
+	font-family: "amiri", "Liberation Sans", "KacstOne", "Simplified Naskh", "KFGQPC Uthman Taha Naskh", "ArabeyesQr", "Times New Roman", "sans", "Sans", sans-serif;
+	color: #437f22;
+	font-weight: bold;
+}
+div.toc {
+  width:30%; float:left;
+  background: #cda;
+  padding:20px;margin:10px;
+  border: #999 solid 2px;
+}
+
+div.footnotes {
+  margin: 0.5em -2em 0;
+  padding: 1em 4em 0;
+  border-top: 2px dotted #CCC
+}
+
+pre {
+  background: #cda;
+  border: #cdc solid 2px;
+  margin: 2em;
+  padding: 0.5em;
+}
+
+table {
+  margin: 2em;
+  padding:0;
+  border-collapse:collapse;
+}
+tr { padding:0; margin:0; border:0;}
+td,th {
+  border: 2px solid #999;
+  padding:2px 10px; margin:0;
+}
+th { background: #cda; }
+
+/* syntax highlighting code */
+.code .br0  { color: #66cc66; }
+.code .co1  { color: #808080; font-style: italic; }
+.code .co2  { color: #808080; font-style: italic; }
+.code .co3  { color: #808080; }
+.code .coMULTI  { color: #808080; font-style: italic; }
+.code .es0  { color: #000099; font-weight: bold; }
+.code .kw1  { color: #b1b100; }
+.code .kw2  { color: #000000; font-weight: bold; }
+.code .kw3  { color: #000066; }
+.code .kw4  { color: #993333; }
+.code .kw5  { color: #0000ff; }
+.code .me1  { color: #006600; }
+.code .me2  { color: #006600; }
+.code .nu0  { color: #cc66cc; }
+.code .re0  { color: #0000ff; }
+.code .re1  { color: #0000ff; }
+.code .re2  { color: #0000ff; }
+.code .re3  { color:#ff3333; font-weight:bold; }
+.code .re4  { color: #009999; }
+.code .st0  { color: #ff0000; }
+.code .sy0  { color: #66cc66; }
+
+/* notes */
+.noteclassic, .noteimportant, .notewarning, .notetip {
+  margin: 2em;
+  margin-left: auto;
+  margin-right: auto;
+  width: 70% !important;
+  min-height: 40px;
+  clear: both;
+  text-align: justify;
+  vertical-align: middle;
+  border-collapse: collapse;
+  border: 2px solid #999;
+  padding: 15px 60px 15px 20px;
+  background-position: right 50%;
+  background-repeat: no-repeat;
+  -moz-border-radius: 20px;
+  -khtml-border-radius: 20px;
+  border-radius: 20px;
+}
+ 
+.noteclassic {
+  /*border: 1px solid #99D;*/
+  background-color: #eef;
+  background-image: url(images/note.png);
+}
+ 
+.noteimportant {
+  /*border: 1px solid #ff0;*/
+  background-color: #ffc;
+  background-image: url(images/important.png);
+}
+ 
+.notewarning {
+  /*border: 1px solid #d99;*/
+  background-color: #fdd;
+  background-image: url(images/warning.png);
+}
+ 
+.notetip {
+  /*border: 1px solid #9d9;*/
+  background-color: #dfd;
+  background-image: url(images/tip.png);
+}
diff --git a/thawab-data/themes/neo/static/manual/images/important.png b/thawab-data/themes/neo/static/manual/images/important.png
new file mode 100644
index 0000000..dc8c8a4
Binary files /dev/null and b/thawab-data/themes/neo/static/manual/images/important.png differ
diff --git a/thawab-data/themes/neo/static/manual/images/note.png b/thawab-data/themes/neo/static/manual/images/note.png
new file mode 100644
index 0000000..df1e0a9
Binary files /dev/null and b/thawab-data/themes/neo/static/manual/images/note.png differ
diff --git a/thawab-data/themes/neo/static/manual/images/tip.png b/thawab-data/themes/neo/static/manual/images/tip.png
new file mode 100644
index 0000000..2000f20
Binary files /dev/null and b/thawab-data/themes/neo/static/manual/images/tip.png differ
diff --git a/thawab-data/themes/neo/static/manual/images/warning.png b/thawab-data/themes/neo/static/manual/images/warning.png
new file mode 100644
index 0000000..3c8a37d
Binary files /dev/null and b/thawab-data/themes/neo/static/manual/images/warning.png differ
diff --git a/thawab-data/themes/neo/static/manual/manual.html b/thawab-data/themes/neo/static/manual/manual.html
new file mode 100644
index 0000000..d93ef76
--- /dev/null
+++ b/thawab-data/themes/neo/static/manual/manual.html
@@ -0,0 +1,273 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ar"
+ lang="ar" dir="rtl">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>دليل استخدام ثواب</title>
+<link rel="stylesheet" media="all" type="text/css" href="all.css" />
+<link rel="stylesheet" media="screen" type="text/css" href="screen.css" />
+<link rel="stylesheet" media="print" type="text/css" href="print.css" />
+</head>
+<body>
+<div class="dokuwiki export">
+<!-- TOC START -->
+<div class="toc">
+<div class="tocheader toctoggle" id="toc__header">جدول المحتويات</div>
+<div id="toc__inside">
+
+<ul class="toc">
+<li class="level1"><div class="li"><span class="li"><a href="#دليل_استخدام_مكتبة_ثواب" class="toc">دليل استخدام مكتبة ثواب</a></span></div>
+<ul class="toc">
+<li class="level2"><div class="li"><span class="li"><a href="#البحث" class="toc">البحث</a></span></div>
+<ul class="toc">
+<li class="level3"><div class="li"><span class="li"><a href="#لمحة" class="toc">لمحة</a></span></div></li>
+<li class="level3"><div class="li"><span class="li"><a href="#الملخص" class="toc">الملخص</a></span></div></li>
+<li class="level3"><div class="li"><span class="li"><a href="#الاستعلامات_المتقدمة" class="toc">الاستعلامات المتقدمة</a></span></div></li>
+</ul>
+</li>
+<li class="level2"><div class="li"><span class="li"><a href="#الحصول_على_الكتب" class="toc">الحصول على الكتب</a></span></div>
+<ul class="toc">
+<li class="level3"><div class="li"><span class="li"><a href="#الاستيراد_من_الشاملة" class="toc">الاستيراد من الشاملة</a></span></div></li>
+<li class="level3"><div class="li"><span class="li"><a href="#من_موقع_أعجوبة" class="toc">من موقع أعجوبة</a></span></div></li>
+</ul>
+</li>
+<li class="level2"><div class="li"><span class="li"><a href="#إنشاء_فهرس_البحث" class="toc">إنشاء فهرس البحث</a></span></div></li>
+<li class="level2"><div class="li"><span class="li"><a href="#التخلص_من_فهرس_لا_يعمل" class="toc">التخلص من فهرس لا يعمل</a></span></div></li>
+</ul>
+</li>
+</div>
+</div>
+<!-- TOC END -->
+
+<h1 class="sectionedit1"><a name="دليل_استخدام_مكتبة_ثواب" id="دليل_استخدام_مكتبة_ثواب">دليل استخدام مكتبة ثواب</a></h1>
+<div class="level1">
+
+</div>
+<!-- EDIT1 SECTION "دليل استخدام مكتبة ثواب" [1-58] -->
+<h2 class="sectionedit2"><a name="البحث" id="البحث">البحث</a></h2>
+<div class="level2">
+
+</div>
+<!-- EDIT2 SECTION "البحث" [59-81] -->
+<h3 class="sectionedit3"><a name="لمحة" id="لمحة">لمحة</a></h3>
+<div class="level3">
+
+<p>
+تستخدم مكتبة ثواب فهرسًا لتسريع عملية البحث. الكتب غير المضافة للفهرس لا تظهر في نتائج البحث.
+</p>
+
+<p>
+عندما تفتح كتابًا ما فإن صندوق البحث الصغير في صفحة الكتاب يبحث داخل ذاك الكتاب فقط، أما الصفحة الأولى فتبحث في كل الكتب ما لم تحدّد لها مجال البحث.
+</p>
+
+<p>
+في الغالب لا تحتاج تحديد مجال البحث حيث يتم البحث في كل الكتب خلال ثانية أو أقل ولا يزيد الوقت اللازم للبحث كلما زادت حجم المكتبة كماً، والنتائج تكون مرتبة بحسب ارتباط النتيجة بالشيء الذي تبحث عنه (مثلا يعطى ورود الكلمة في العنوان وزنا أعلى من ورودها في المتن)
+</p>
+
+<p>
+يتأخر البحث عند البحث عن أمور عامة تُخرِج الكثير من النتائج (في الزمن اللازم لتقييمها وترتيبها). حاليا المكتبة تظهر أوّل 500 نتيجة فقط (يمكن إعادة ضبط هذا الرقم إن احتجنا لذلك).
+</p>
+
+<p>
+<p><div class="notetip">
+لتسريع البحث ابحث عن شيء مميز. مثلا: لا تبحث عن كلمات مثل حرف “في” بل ابحث عن كلمة مميزة.
+
+</div></p>
+</p>
+
+<p>
+البحث الموجود على الصفحة الرئيسة يقوم بالبحث في كل الكتب المفهرسة ما لم تقم بحصر مجال البحث بشكل صريح.
+</p>
+
+<p>
+<p><div class="notewarning">لا يتم البحث في الكتب غير المفهرسة.
+</div></p>
+</p>
+
+<p>
+عندما تفتح كتابًا فإنك تجد صندوق بحث مصغر في رأس الصفحة وبعكس صندوق البحث الرئيس لا يبحث هذا الصندوق إلا في الكتاب الحالي. الكلمات التي تكتبها فيه يتم تظليلها في الصفحة الحالية فور كتابتها ويتم النزول إليها لإظهارها عند النقر على زر الإدخال أي أن الإدخال له فائدتان: البحث في الصفحة الحالية والبحث في كل الكتاب الحالي.
+</p>
+
+</div>
+<!-- EDIT3 SECTION "لمحة" [82-2358] -->
+<h3 class="sectionedit4"><a name="الملخص" id="الملخص">الملخص</a></h3>
+<div class="level3">
+<div class="table sectionedit5"><table class="inline">
+	<tr class="row0">
+		<th class="col0"> الرمز </th><th class="col1"> اسم العملية </th><th class="col2"> شرح </th><th class="col3"> مثال </th><th class="col4"> معنى المثال </th>
+	</tr>
+	<tr class="row1">
+		<td class="col0"> & </td><td class="col1"> و </td><td class="col2"> تشترط تحقق ما قبلها وما بعدها معا </td><td class="col3"> كتاب & قلم </td><td class="col4"> أن يحتوي النص كلمتي “كتاب” و “قلم” </td>
+	</tr>
+	<tr class="row2">
+		<td class="col0"> &~ </td><td class="col1"> وربما </td><td class="col2"> تشترط تحقق ما قبلها ويفضل أن يتحقق ما بعدها دون اشتراط ذلك </td><td class="col3"> كتاب &~ قلم </td><td class="col4"> أن يحتوي النص كلمة “كتاب” ويفضل أن يحتوي كلمة “قلم” </td>
+	</tr>
+	<tr class="row3">
+		<td class="col0"> | </td><td class="col1"> أو </td><td class="col2"> تطابق سواء تحقق ما قبلها أو تحقق ما بعدها </td><td class="col3"> عيسى | المسيح </td><td class="col4"> أن يحتوي النص كلمة “عيسى” أو كلمة “المسيح” </td>
+	</tr>
+	<tr class="row4">
+		<td class="col0"> ! </td><td class="col1"> النفي </td><td class="col2"> تطابق إذا لم يتحقق ما بعدها </td><td class="col3"> عيسى | المسيح ! الدجال </td><td class="col4"> أن يحتوي النص كلمة “عيسى” أو كلمة “المسيح” لكن بشرط أن لا يحتوي كلمة “الدجال” </td>
+	</tr>
+	<tr class="row5">
+		<td class="col0"> * </td><td class="col1"> أي شيء </td><td class="col2"> صفر أو أكثر من الحروف </td><td class="col3"> استع* </td><td class="col4"> يمكن أن تطابق ما يبدأ ب استع مثل استعان أو استعمل …إلخ </td>
+	</tr>
+	<tr class="row6">
+		<td class="col0"> ? </td><td class="col1"> حرف واحد </td><td class="col2"> حرف واحد تماما </td><td class="col3"> ش؟ب </td><td class="col4"> يمكن أن تطابق شرب أو شنب …إلخ </td>
+	</tr>
+	<tr class="row7">
+		<td class="col0"> ^ </td><td class="col1"> قوة </td><td class="col2"> زيادة وزن الكلمة عند ترتيب النتائج </td><td class="col3"> أحمد ابن تيمية^3 </td><td class="col4"> إعطاء كلمة تيمية 3 أضعاف وزن الأخرى عند الترتيب </td>
+	</tr>
+	<tr class="row8">
+		<td class="col0"> كتاب<strong>:</strong> </td><td class="col1"> تحديد المجال </td><td class="col2"> البحث في الكتاب المذكور تاليا </td><td class="col3"> التيمم كتاب:(“صحيح البخاري” | “صحيح مسلم”) </td><td class="col4"> البحث عن التيمم في صحيح البخاري أو صحيح مسلم </td>
+	</tr>
+	<tr class="row9">
+		<td class="col0"> عنوان<strong>:</strong> </td><td class="col1"> البحث في العناوين </td><td class="col2"> حصر البحث في عناوين الأبواب </td><td class="col3"> عنوان:(بدء الوحي) </td><td class="col4"> البحث عن كلمة بدء وكلمة وحي في عناوين الأبواب </td>
+	</tr>
+</table></div>
+<!-- EDIT5 TABLE [2382-4301] -->
+<p>
+
+<p><div class="notetip">يمكنك طباعة رمز ~ الذي يأتي بعد علامة & في استعلام “وربما” عبر الضغط على زر SHIFT+Z في لوحة المفاتيح العربية QWERTY 
+</div></p>
+</p>
+
+</div>
+<!-- EDIT4 SECTION "الملخص" [2359-4514] -->
+<h3 class="sectionedit6"><a name="الاستعلامات_المتقدمة" id="الاستعلامات_المتقدمة">الاستعلامات المتقدمة</a></h3>
+<div class="level3">
+
+<p>
+عند كتابة أكثر من كلمة فإنه يتم ربطها معا ضمنيا عبر علاقة “و” (ورمزها “<strong>&</strong>”) أي أنه سيعطيك الوثائق التي تحتوي كل تلك الكلمات معا (دون اشتراط تتابع معين) مثلا عند كتابة كلمة خمر ثم مسافة ثم تحريم فإنه لن يعطيك الوثائق التي تحتوي واحدة من الكلمتين بل يجب أن ترد الكلمتين معا (أي كأنك كتبت <strong>خمر & تحريم</strong>) لكنه قد يعطيك وثائق تحتوي على عبارة “تحريم الخمر” أي بترتيب معكوس.
+</p>
+
+<p>
+يمكنك استعمال العلاقة “أو” (ورمزها “<strong>|</strong>”) حتى تشترط ورود واحدة من تلك الكلمات مثلا لو كتبت كلمة عيسى ثم | ثم المسيح فإنه لن يشترط ورود الكلمتين معا فواحدة منهما تكفي.
+</p>
+
+<p>
+يمكن نفي العمليات عبر علامة التعجب “<strong>!</strong>” وذلك لاستثناء شيء من النتائج مثلا <strong>المسيح ! الدجال</strong> تحضر الصفحات التي تحتوي كلمة المسيح لكنها في نفس الوقت <strong>لا تحتوي</strong> كلمة الدجال.
+</p>
+
+<p>
+يمكن استعمال الأقواس كما في العمليات الحسابية مثلا <strong>(المسيح | عيسى) ! الدجال</strong>.
+</p>
+
+<p>
+لاشتراط الترتيب عليك وضع علامة اقتباس مزدوجة مثلا “تحريم الخمر” وهذا يسمى البحث عن عبارة.
+</p>
+
+<p>
+يمكنك اشتراط ورود الكلمة في العنوان عبر كتابة عنوان ثم علامة <strong>:</strong> مثلا <strong>عنوان:“بدء الوحي”</strong> للبحث عن عبارة “بدء الوحي” في العنوان أما البحث عن كلمات في العنوان دون اشتراط أن تكون عبارة يمكنك كتابة <strong>عنوان:(بدء الوحي)</strong>
+</p>
+
+<p>
+<p><div class="noteimportant">
+البحث عن <strong>عنوان:بدء الوحي</strong> دون اقتباس أو أقواس تعني البحث عن عنوان به كلمة بدء أما كلمة وحي فلا يشترط أن تكون في العنوان
+
+</div></p>
+</p>
+
+<p>
+يمكنك تحديد مجال البحث عبر ذكر اسم الكتاب بعد كلمة كتاب ثم : مثلا
+</p>
+<ul>
+<li class="level1"><div class="li"> <strong>بدء الوحي كتاب:صحيح_البخاري</strong></div>
+</li>
+<li class="level1"><div class="li"> <strong>بدء الوحي كتاب:“صحيح البخاري”</strong></div>
+</li>
+</ul>
+
+<p>
+
+<p><div class="noteimportant">
+البحث عن <strong>بدء الوحي كتاب:صحيح_البخاري</strong> دون اقتباس ولا علامة تحتية _ تعني أن اسم الكتاب هو صحيح أما البخاري فهي كلمة تريد البحث عنها
+
+</div></p>
+</p>
+
+<p>
+<p><div class="notetip">
+يمكنك البحث في أكثر من كتاب عبر استعمال أو مثلا <strong>بدء الوحي (كتاب:صحيح_البخاري | كتاب:صحيح_مسلم)</strong>
+كذلك يمكنك استثناء كتاب عبر ! مثلا <strong>بدء الوحي ! كتاب:صحيح_البخاري</strong> تبحث عن بدء الوحي في أي كتاب إلا صحيح البخاري
+
+</div></p>
+</p>
+
+</div>
+<!-- EDIT6 SECTION "الاستعلامات المتقدمة" [4515-7648] -->
+<h2 class="sectionedit7"><a name="الحصول_على_الكتب" id="الحصول_على_الكتب">الحصول على الكتب</a></h2>
+<div class="level2">
+
+<p>
+قد تأتي بعض الكتب مع النظام (مثلا في نظام أعجوبة لينكس هناك عينة من الكتب المميزة تأتي مع التوزيعة) لكن 
+الكتب ليست جزء من مكتبة ثواب بل يقوم باختيارها المستخدم حيث يمكنه الحصول عليها من أكثر من مصدر.
+</p>
+
+<p>
+يمكن وضع الكتب في مجلد db داخل المجلدات الخاصة بمكتبة ثواب.
+</p>
+
+<p>
+المجلدات الخاصة بثواب هي
+</p>
+<ol>
+<li class="level1"><div class="li"> مجلد .thawab داخل المجلد البيت الخاص بالمستخدم.</div>
+</li>
+<li class="level1"><div class="li"> مجلد thawab-data المجاور للملف التنفيذي الذي يشغل ثواب</div>
+</li>
+<li class="level1"><div class="li"> مجلد thawab-data في كل من أقراص ويندوز من C إلى Z</div>
+</li>
+</ol>
+
+</div>
+<!-- EDIT7 SECTION "الحصول على الكتب" [7649-8467] -->
+<h3 class="sectionedit8"><a name="الاستيراد_من_الشاملة" id="الاستيراد_من_الشاملة">الاستيراد من الشاملة</a></h3>
+<div class="level3">
+
+<p>
+يمكن استيراد كتب الشاملة ذات الهيئة .bok والتي يمكن الحصول عليها بتصديرها من برنامج الشاملة أو
+بتنزيلها من الإنترنت <sup><a href="#fn__1" name="fnt__1" id="fnt__1" class="fn_top">1)</a></sup>.
+ويكون ذلك من خلال زر الاستيراد بالأعلى أو من خلال سحب ملفات bok وإفلاتها في برنامج ثواب، كما يمكنك إضافة الكتب عبر زر الإضافة Add وبعد الانتهاء من اختيار الكتب، اضغط الزر التحويل Convert.
+</p>
+
+</div>
+<!-- EDIT8 SECTION "الاستيراد من الشاملة" [8468-9271] -->
+<h3 class="sectionedit9"><a name="من_موقع_أعجوبة" id="من_موقع_أعجوبة">من موقع أعجوبة</a></h3>
+<div class="level3">
+
+<p>
+يمكن جلب الكتب من هذا الرابط:
+
+</p>
+<ul>
+<li class="level1"><div class="li"> <a target="_blank" href="http://www.ojuba.org/downloads/thawab/thawab-kutub/" class="urlextern" title="http://www.ojuba.org/downloads/thawab/thawab-kutub/"  rel="nofollow">http://www.ojuba.org/downloads/thawab/thawab-kutub/</a></div>
+</li>
+</ul>
+
+</div>
+<!-- EDIT9 SECTION "من موقع أعجوبة" [9272-9419] -->
+<h2 class="sectionedit10"><a name="إنشاء_فهرس_البحث" id="إنشاء_فهرس_البحث">إنشاء فهرس البحث</a></h2>
+<div class="level2">
+
+<p>
+بعد إضافة المزيد من الكتب إلى ثواب لا تكون مفهرسة مما يعني أنه لا يمكن البحث فيها. لإضافتها إلى فهرس البحث في تطبيق ثواب انقر على زر فهرس البحث Index ثم تضغط على زر دفع الكتب الجديدة queue new books كي يتم التعرف على الكتب غير الموجودة في الفهرس وإضافتها إليه.
+</p>
+
+</div>
+<!-- EDIT10 SECTION "إنشاء فهرس البحث" [9420-9914] -->
+<h2 class="sectionedit11"><a name="التخلص_من_فهرس_لا_يعمل" id="التخلص_من_فهرس_لا_يعمل">التخلص من فهرس لا يعمل</a></h2>
+<div class="level2">
+
+<p>
+إن توقف الفهرس عن العمل لأي سبب (مثل تلف الملف بسبب انقطاع التيار الكهربائي أو ترقية إصدار محرك البحث whoosh إلى إصدار أحدث غير متوافق مع الذي قبله) عليك حذف مجلد index ثم إعادة فهرسة الملفات.
+</p>
+
+</div>
+<!-- EDIT11 SECTION "التخلص من فهرس لا يعمل" [9915-] --><div class="footnotes">
+<div class="fn"><sup><a href="#fnt__1" id="fn__1" name="fn__1" class="fn_bot">1)</a></sup> 
+يمكن تنزيلها من <a target="_blank" href="http://shamela.ws/old_site" class="urlextern" title="http://shamela.ws/old_site"  rel="nofollow">موقع الشاملة الجديد</a> أو <a target="_blank" href="http://shamela.ws/old_site" class="urlextern" title="http://shamela.ws/old_site"  rel="nofollow">القديم</a> أو من <a target="_blank" href="http://islamport.com/index2.html" class="urlextern" title="http://islamport.com/index2.html"  rel="nofollow">موقع islamport</a></div>
+</div>
+</div>
+</body>
+</html>
diff --git a/thawab-data/themes/neo/static/print.css b/thawab-data/themes/neo/static/print.css
new file mode 100644
index 0000000..40001af
--- /dev/null
+++ b/thawab-data/themes/neo/static/print.css
@@ -0,0 +1,3 @@
+.noprint { display: none; }
+#wrapper, #container { background:#fff; }
+
diff --git a/thawab-data/themes/neo/static/th-main.js b/thawab-data/themes/neo/static/th-main.js
new file mode 100644
index 0000000..edfb441
--- /dev/null
+++ b/thawab-data/themes/neo/static/th-main.js
@@ -0,0 +1,153 @@
+/**
+ *
+ * copyright © 2010 ojuba.org, Muayyad Saleh Alsadi
+ *
+ **/
+var resultsPerPage=50;
+var async_tips_div, mouse_x, mouse_y;
+
+function main_search_row_factory(u, bu, r) {
+	return "<a class='searchItem' onmouseover='asynctip(this);' onmouseout='asynctip_hide(this);' target='_blank' rel='"+u+r.i+"' href='"+bu+encodeURI(r.k)+"#"+encodeURI(r.n)+"'><h2>"+ html_escape(r.t)+"</h2> <span>"+html_escape(r.k).replace(new RegExp('_', 'g'), ' ')+" - "+html_escape(r.a)+" ("+(r.y || "-")+")</span> </a>\n"
+
+  
+}
+var search_row_factory=main_search_row_factory;
+var search_done=function() {};
+
+function showSearchPage(hash, pg){
+	var j,i=(pg-1)*resultsPerPage,o,h,l;
+	var u=script+'/ajax/searchExcerpt/'+hash+'/',bu=script+'/view/';
+	/*l=document.getElementById("loading");
+	l.style.display="block";*/
+	window.scroll(100,0);
+	getJson("/json/searchResults", {h:hash,i:i,c:resultsPerPage},
+		function (d) {
+			var c=d.c,a=d.a;
+			o=document.getElementById("SearchResults");
+			h=""
+			o.innerHTML=h;
+			for (j=0;j<c;++j) {
+				r=a[j];
+				h+=search_row_factory(u, bu, r);
+			}
+			o.innerHTML=h;
+			o=document.getElementsByClassName("current");
+			for (j=0;j<o.length;++j) rm_class(o.item(j),"current");
+			o=document.getElementById("pg_"+pg);
+			if (o) o.setAttribute(klass, "current"+( o.getAttribute(klass) || "" ).replace("current",""));
+			/*l.style.display="none";  should be faded */
+		},
+		function () {
+			/*l.style.display="none";  should show error */
+		}
+	);
+	return false;
+}
+
+
+function doSearch(q, main) {
+	var i,pages,o,h;
+	
+	
+	if (main){
+	    se = document.getElementById('SearchContainer');
+	    se_t = document.getElementById('SearchContainer_tab');
+	    se.style.display="block";
+	    se_t.style.display="none";
+	}
+	if (q=="") {
+	    se.style.display="none";
+	}
+	getJson(script+"/json/search", {q:q}, 
+		function (d) {
+			document.getElementById("SearchTime").innerHTML=d.t;
+			document.getElementById("SearchRCount").innerHTML=d.c;
+			pages=-Math.floor(-d.c/resultsPerPage);
+			// +10 pages raise error !
+			if (pages > 10) { pages = 10; }
+			document.getElementById("SearchPagesCount").innerHTML=pages;
+			o=document.getElementById("SearchPages");
+			h='';
+			o.innerHTML=h;
+			if (d.c>0) {
+			for (i=1;i<=pages;++i) h+='<span><a id="pg_'+i+'" onclick="showSearchPage(\''+d.h+'\', '+i+');">'+(i)+'</a></span>';
+			o.innerHTML=h;
+			showSearchPage(d.h,1);
+			
+			if (main) {se_t.style.display="block";}
+			}
+
+			search_done();
+			document.location="#searchResults";
+		},
+		function () {
+
+			search_done();
+		}
+	);
+	return false;
+
+}
+
+function kutubFilter(q) {
+	var o=document.getElementById("kutubList");
+	var old=o.innerHTML;
+	var l=document.getElementById("loading");
+	/*l.style.display="block";*/
+	getAjax(script+"/ajax/kutub", {q:q},
+		function (d) {
+			o.innerHTML=d;
+		},
+		function () {
+			o.innerHTML=old;
+		}
+	);
+
+	return false;
+}
+
+function moveMouse(E) {
+	var e=window.event || E;
+	mouse_x=window.pageXOffset+e.clientX;
+	mouse_y=window.pageYOffset+e.clientY;
+}
+
+function asynctip(e) {
+
+	async_tips_div.style.top=(mouse_y+e.offsetHeight+5)+"px";
+	async_tips_div.innerHTML="...";
+	async_tips_div.style.display="block";
+	u=e.getAttribute('rel');
+	getAjax(u, { },
+		function (d) {
+			async_tips_div.innerHTML=d;
+
+		},
+		function () {
+			async_tips_div.style.display="none";
+
+		}
+	);
+
+}
+
+function asynctip_hide(e) {
+	async_tips_div.style.display="none";
+}
+
+function async_tips_init() {
+	var d=document.createElement("div");
+	d.id="async_tips_div";
+	d.style.width="60%";
+	d.style.display="none";
+	document.body.appendChild(d);
+	async_tips_div=d;
+
+	if (document.addEventListener) {
+		document.addEventListener('mousemove',moveMouse,false);
+	} else {
+		document.attachEvent('onmousemove',moveMouse);
+	}
+}
+init_ls.push(async_tips_init);
+
diff --git a/thawab-data/themes/neo/static/th-view.js b/thawab-data/themes/neo/static/th-view.js
new file mode 100644
index 0000000..b03ef0f
--- /dev/null
+++ b/thawab-data/themes/neo/static/th-view.js
@@ -0,0 +1,164 @@
+/**
+ *
+ * copyright © 2010 ojuba.org, Muayyad Saleh Alsadi
+ *
+ **/
+var last_highlighted="";
+var th_hash;
+function mini_search_row_factory(u, bu, r) {
+  return "<tr><td><a onmouseover='asynctip(this);' onmouseout='asynctip_hide(this);' rel='"+u+r.i+"' href='#"+encodeURI(r.n)+"'>"+ html_escape(r.t)+"</a></td><td>"+html_escape(r.r)+"</td>\n";
+}
+function mini_search_row_factory_st(u, bu, r) {
+  return "<tr><td><a onmouseover='asynctip(this);' onmouseout='asynctip_hide(this);' rel='"+u+r.i+"' href='./"+encodeURI(r.n)+".html'>"+ html_escape(r.t)+"</a></td><td>"+html_escape(r.r)+"</td>\n";
+}
+resultsPerPage=10; // defined in main.js
+search_row_factory=(is_static)?mini_search_row_factory_st:mini_search_row_factory;
+function doMiniSearch(q) {
+  doSearch(q+" كتاب:"+kitabId, false);
+}
+
+function view_cb(h) {
+	var n,b;
+	var spacer = "<img src='/_theme/img/spacer.png'/>";
+	window.scroll(0,0);
+	if (! h) h="_i0";
+	th_hash=h;
+	getJson(script+"/json/view/"+kitabUid+"/"+h, {}, 
+		function (d) {
+			document.getElementById("maincontent").innerHTML=arabic_numbers(d.content);
+			document.getElementById("subtoc").innerHTML=arabic_numbers(d.childrenLinks);
+		
+			b=spacer+ d.breadcrumbs.replace(/>/g,spacer);
+			if (d.breadcrumbs){
+			document.getElementById("breadcrumbs").innerHTML=arabic_numbers(b);}
+			else {document.getElementById("breadcrumbs").innerHTML="";}
+
+			n=document.getElementById("prevLink");
+			n.setAttribute('title', d.prevTitle);
+			if (d.prevTitle) {n.setAttribute('class', 'button');
+			 n.setAttribute('href', d.prevUrl);}
+			else {  n.setAttribute('class', 'button inactive');
+			n.setAttribute('href','javascript:void(0)'); }
+
+			n=document.getElementById("upLink");
+			n.setAttribute('title', d.upTitle);
+			if (d.upUrl != window.location.hash) {n.setAttribute('class', 'button');
+			 n.setAttribute('href', d.upUrl);}
+			else {  n.setAttribute('class', 'button inactive');
+			n.setAttribute('href','javascript:void(0)'); }
+
+
+			n=document.getElementById("nextLink");
+			n.setAttribute('title', d.nextTitle);
+			if (d.nextTitle) {n.setAttribute('class', 'button');
+			 n.setAttribute('href', d.nextUrl);}
+			else {  n.setAttribute('class', 'button inactive');
+			n.setAttribute('href','javascript:void(0)'); }
+			highlight_words(document.getElementById("maincontent"), highlighted, true);
+		},
+		function () {
+			 /* should show error */
+		}
+	);
+
+	return false;
+}
+function arabic_numbers(string) {
+/* FIX this code
+string = string.replace(/0/g,"٠");
+string = string.replace(/1/g,"١");
+string = string.replace(/2/g,"٢");
+string = string.replace(/3/g,"٣");
+string = string.replace(/4/g,"٤");
+string = string.replace(/5/g,"٥");
+string = string.replace(/6/g,"٦");
+string = string.replace(/7/g,"٧");
+string = string.replace(/8/g,"٨");
+string = string.replace(/9/g,"٩");
+*/
+return string;
+}
+function ajax_check_hash() {
+	var h=window.location.hash;
+	if (h==("#"+th_hash)) return true;
+	view_cb(h.slice(1));
+	return true;
+}
+
+var harakat="ًٌٍَُِّْـ";
+
+function highlight_word(o, w, i) {
+	w=w.trim();
+	if (w=="") return;
+	w=re_escape(w).replace(/(\\?.)/g, "$1[\-_"+harakat+"]*");
+	w="("+w+")";
+	var re = new RegExp( w, "gi");
+	a=o.innerHTML.split(/(<\/?[^>]*>)/);
+	for (j in a) {
+		s=a[j];
+		if (s && s[0]!="<") {
+			a[j]=s.replace(re, "<span class='highlight term"+i+"'>$1</span>");
+		}
+	}
+	o.innerHTML=a.join("");
+}
+
+function highlight_words(o, w, scroll) {
+	var i,a=w.split(" ");
+	highlight_words_off(o);
+	for (i in a) {
+		highlight_word(o,a[i],i);
+	}
+	if (scroll) scroll_to_first_highlighted();
+}
+
+function scroll_to_first_highlighted() {
+	a=document.getElementsByClassName("highlight");
+	for (j=0;j<a.length;++j) {
+		a[j].scrollIntoView();
+		break;
+	}
+}
+
+function highlight_words_off(o) {
+	o.innerHTML=o.innerHTML.replace(/\<span class=["']highlight term\d+['"]\>([^<>]*)<\/span>/gi, "$1");
+}
+
+var highlighting=false;
+
+function highlight_cb() {
+	if (highlighting) return true;
+	var q=document.getElementById('q').value;
+	if (q=="نص البحث") return true;
+	highlighting=true;
+	highlighted=q;
+	if (last_highlighted!=highlighted) {
+		last_highlighted=highlighted;
+		highlight_words(document.getElementById("maincontent"), highlighted, false);
+	}
+	highlighting=false;
+	return true;
+}
+
+
+function th_view_init() {
+	var l;
+	if (!is_static) {
+		l=document.location.toString();
+		loc=window.location.hash.slice(1);
+		if (loc=="") document.location=l+"#_i0";
+		else view_cb(loc);
+	}
+	/* hide mini-search if not indexed */
+	if (!is_indexed) {
+		document.getElementById("minisearch").style.display="none";
+		document.getElementById("nominisearch").style.display="block";
+	}
+	highlighted=get_url_vars()["highlight"] || "";
+	highlight_words(document.getElementById("maincontent"), highlighted, true);
+	last_highlighted=highlighted;
+}
+search_done=scroll_to_first_highlighted;
+animations["_highlight"]=[highlight_cb];
+if (!is_static) animations["_ajax_check_hash"]=[ajax_check_hash];
+init_ls.push(th_view_init);
diff --git a/thawab-data/themes/neo/templates/footer.html b/thawab-data/themes/neo/templates/footer.html
new file mode 100644
index 0000000..392963f
--- /dev/null
+++ b/thawab-data/themes/neo/templates/footer.html
@@ -0,0 +1,19 @@
+%if _r.rq.webapp._typ=='web':
+<div id="footer" class="noprint">
+<center style="display:none;">
+    <a href="http://jigsaw.w3.org/css-validator/check/referer?profile=css3&usermedium=all&warning=1&lang=en"><img
+        src="/_theme/img/valid-css-blue.gif"
+        title="Validate CSS"
+        alt="Valid XHTML 1.0 Transitional" height="31" width="88" class="showOnFocus"/></a>
+    <a href="http://validator.w3.org/check?uri=referer"><img
+        src="/_theme/img/valid-xhtml10-blue.gif"
+        title="Validate XHTML"
+        alt="Valid XHTML 1.0 Transitional" height="31" width="88" class="showOnFocus"/></a>
+</center>
+<p id="copyright" style="margin: 0px;">
+Copyright © 2010, <a href="http://www.ojuba.org">ojuba.org</a> - Muayyad Saleh Alsadi  --- 
+Neo theme by Mohamed Mohsen
+</p>
+
+</div>
+%end
diff --git a/thawab-data/themes/neo/templates/layout.html b/thawab-data/themes/neo/templates/layout.html
new file mode 100644
index 0000000..c352e39
--- /dev/null
+++ b/thawab-data/themes/neo/templates/layout.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html
+	PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<title>{{_r.title or '::'}} :: ثواب ::</title>
+<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=1" />
+<meta name="keywords" content="{{', '.join(_r.meta_keywords)}}" />
+<meta name="description" content="{{_r.meta_description}}" />
+<link rel="shortcut icon" href="/_theme/img/favicon.ico" type="image/x-icon" />
+<link rel="stylesheet" type="text/css" href="/_theme/main.css" />
+
+{{!_r.render_css_links()}}
+%if x_js_script: x_js_script()
+<script type="text/javascript" src="/_theme/main.js"></script>
+{{!_r.render_js_links('head')}}
+<!--[if lt IE 8]>
+  <link rel="stylesheet" type="text/css" media="screen" href="/_theme/ie-fx.css" />
+<![endif]-->
+<link rel="stylesheet" type="text/css" media="print" href="/_theme/print.css" />
+</head>
+<body dir="rtl" class="body">
+{{!_r.render_js_links('begin')}}
+
+
+%topnav()
+
+%if typ!="main":
+%include minisearch
+%end
+
+<div id="container">
+
+%include
+
+</div>
+
+%include footer
+
+{{!_r.render_js_links('end')}}
+</body>
+</html>
diff --git a/thawab-data/themes/default/templates/main.html b/thawab-data/themes/neo/templates/main.html
similarity index 64%
copy from thawab-data/themes/default/templates/main.html
copy to thawab-data/themes/neo/templates/main.html
index adcbf8b..0d5ab7b 100644
--- a/thawab-data/themes/default/templates/main.html
+++ b/thawab-data/themes/neo/templates/main.html
@@ -11,21 +11,24 @@ var script='';
   <a class="blurOnFocus" style="float:right;" href="http://www.ojuba.org/wiki/thawab/get" title="الحصول على ثواب"><img src="/_theme/img/rpm.gif"  alt="get package" /></a>
   <a class="blurOnFocus" style="float:right;" href="http://www.ojuba.org/wiki/اتصل_بنا" title="راسلنا"><img src="/_theme/img/mail.gif" alt="contact us" /></a>
   <a class="blurOnFocus" style="float:right;" href="http://www.linuxac.org/forum/forumdisplay.php?68" title="المنتدى"><img src="/_theme/img/forum.gif" alt="forum" /></a>
-  <a class="blurOnFocus" style="float:right;" href="http://git.ojuba.org/cgit/thawab/tree/" title="كود ثواب"><img src="/_theme/img/code.gif" alt="code" /></a>
+  <a class="blurOnFocus" style="float:right;" href="https://github.com/ojuba-org/thawab" title="كود ثواب"><img src="/_theme/img/code.gif" alt="code" /></a>
 %end
 
-<div id="contentheader">
-<h1>مكتبة ثواب - بحث ذكي وسريع في أمهات الكتب</h1>
-<a href="#search">البحث</a> | <a  href="#books">الكتب المتوفرة</a>
-</div>
-<div id="contentbody">
-<a name="search"></a><h2>البحث</h2>
-<div>
-<form action="" name="SearchForm" onsubmit="doSearch(document.getElementById('q').value, true); return false;" style="margin:0;border:0;padding:0;">
-<input id="q" class="search_inactive" name=q type="text" placeholder="نص البحث" onkeyup="text_keyup(this, event, doSearch, true);"/>
-    <a href="/_theme/manual/manual.html" target='help'>دليل الاستخدام ( البحث المتقدم )</a>
+<div id="contentheaderHome">
+
+<img class="logo" src="/_theme/img/logo.png" alt="ثواب" />
+<p>مكتبة ثواب - بحث ذكي وسريع في أمهات الكتب</p>
+<form action="" name="SearchForm" onsubmit="doSearch(document.getElementById('q').value, true); return false;" style="display: inline-block;">
+<input id="q" class="search_input" name=q type="text" placeholder="نص البحث" onkeyup="text_keyup(this, event, doSearch, true);"/>
+<input class="submit_button" type="submit" onclick="text_keyup(this, event, doSearch, true);" value="بحث"/> 
+<br/>
+<br/>
+<a href="/_theme/manual/manual.html" target='help'>دليل الاستخدام ( البحث المتقدم )</a>
 </form>
 </div>
+
+<div id="contentbodyHome">
+
 <div id="searchHelpDiv">
 <div id="searchHelpArrow"></div>
 <div id="searchHelp">
@@ -38,31 +41,35 @@ var script='';
 <a href="/_theme/manual/manual.html">دليل الاستخدام</a>
 </div>
 </div>
-
-  <div id="SearchContainer" style="display:none;">
+<a name="searchResults"></a>
+  <div id="SearchContainer" class="Box" style="display:none;">
+<h2>نتائج البحث</h2>
+<div class="info">
 تم البحث خلال   <span id="SearchTime">-</span> من الثواني وعُثر على <span id="SearchRCount">-</span> من النتائج موزعة على <span id="SearchPagesCount">-</span> من الصفحات.
+</div>
 <div id="SearchContainer_tab" style="display:none;">
-<center><table style="width:90%;">
-  <thead>
-  <tr><th colspan="5">نتائج البحث</th></tr>
-  <tr><th>اسم الكتاب</th><th>المؤلف</th><th>تاريخ</th>
-  <th>باب</th><th>التقييم</th></tr>
-  </thead>
-  <tfoot><tr><td colspan="5"><div id="SearchPages">-</div></td></tr></tfoot>
-  <tbody id="SearchResults"><tr><td colspan="5">-</td></tr></tbody>
-</table></center>
+  
+
+
+  <div id="SearchResults"></div>
+
+  <div id="SearchPages">-</div>
   </div>
   </div>
 
-<a name="books"></a><h2>الكتب المتوفرة</h2>
+<a name="books"></a>
+
+<div id="kutubListing"  class="Box" >
+<h2>الكتب المتوفرة</h2>
 <form action="" name="KutubFilterForm" onsubmit="kutubFilter(document.getElementById('kutub_q').value); return false;" style="margin:0;border:0;padding:0;">
 <!--تصفية الكتب:-->
-<center><input id="kutub_q" class="entry" type="text" placeholder="تصفية الكتب" onkeyup="text_keyup(this, event, kutubFilter);" /></center>
+<input id="kutub_q" class="entry" type="text" placeholder="تصفية الكتب" onkeyup="text_keyup(this, event, kutubFilter);" />
 </form>
-<div id="kutubListing">
+<div id="kutubList">
 <ul>
 {{!kutublinks}}
 </ul>
+</div>
 <div class="clear"></div>
 </div>
 <br/><br/>
diff --git a/thawab-data/themes/neo/templates/minisearch.html b/thawab-data/themes/neo/templates/minisearch.html
new file mode 100644
index 0000000..d240e7d
--- /dev/null
+++ b/thawab-data/themes/neo/templates/minisearch.html
@@ -0,0 +1,25 @@
+
+<div id="results" class="noprint" onmouseover="if(is_indexed && document.getElementById('q').value!='نص البحث')this.style.display='block';" onmouseout="if(document.getElementById('q').value=='نص البحث' || document.getElementById('q').value=='')this.style.display='none';">
+<div id="nominisearch">
+فضلا أضف هذا الكتاب للفهرس.
+</div>
+  <div id="SearchContainer" class="mini">
+<div style="display:none;">
+<span id="SearchTime"></span><span id="SearchRCount"></span><span id="SearchPagesCount"></span>
+</div>
+<center><table id="SearchTable" style="width:90%;">
+  <tfoot><tr><td colspan="2"><div id="SearchPages">-</div></td></tr></tfoot>
+  <tbody id="SearchResults"><tr><td colspan="2">-</td></tr></tbody>
+</table></center>
+  <div id="rollup" onclick="document.getElementById('results').style.height='22px';"></div>
+  </div>
+
+</div>
+<div id="minisearch" class="noprint">
+<!--img src="/_theme/img/search.gif" style="float:right;" alt="search" /-->
+<form action="" name="miniSearchForm" onsubmit="doMiniSearch(document.getElementById('q').value); return false;" style="margin:0;border:0;padding:0;">
+<input id="q" class="search_inactive" type="text" value="نص البحث" onfocus="search_entry_focus(this);if(is_indexed  )document.getElementById('results').style.display='block';" onblur="search_entry_blur(this);"></input>
+</form>
+</div>
+
+
diff --git a/thawab-data/themes/neo/templates/view.html b/thawab-data/themes/neo/templates/view.html
new file mode 100644
index 0000000..ff22aab
--- /dev/null
+++ b/thawab-data/themes/neo/templates/view.html
@@ -0,0 +1,43 @@
+%_r.title=title
+%_r.add_js_link('th-main.js')
+%_r.add_js_link('th-view.js')
+%def x_js_script_f():
+<script type="text/javascript">
+var script='';
+var title='{{title}}';
+var kitabId='{{kitabId}}';
+var kitabUid=encodeURI('{{kitabId}}');
+var is_indexed={{is_indexed}};
+var is_static={{is_static}};
+var highlighted="";
+</script>
+%end
+%def topnav_f():
+ 
+%end
+
+
+<div class="clearer"></div>
+<div id="contentheader">
+<div style="max-height: 37px;white-space: nowrap;">
+<a href="/" class="home"><img src="/_theme/img/home.png" alt="عودة للصفحة الرئيسية" /></a><img src="/_theme/img/spacer.png"/><a href="{{d}}_i0{{s}}">{{title}}</a>
+<div id="breadcrumbs" style="display:inline;">{{!breadcrumbs}}</div>
+</div>
+</div>
+<div id="toolbar">
+
+ <a id="prevLink" class="button" href="{{prevUrl}}" title="{{prevTitle}}"><img src="/_theme/img/go-back.png" alt="السابق" /></a>
+  <a id="upLink"  class="button" href="{{upUrl}}" title="{{upTitle}}"><img src="/_theme/img/go-up.png" alt="لأعلى" /></a>
+  <a class="button" id="nextLink" href="{{nextUrl}}" title="{{nextTitle}}"><img src="/_theme/img/go-next.png" alt="التالي" /></a>
+  <a class="button" href="javascript:window.print()" title="طباعة الصفحة"><img src="/_theme/img/print.png" alt="طباعة" /></a>
+</div>
+
+<div id="contentbody">
+<div class="clearer"></div>
+  <div id="maincontent">{{!content}}</div>
+  <div id="subtoc">{{!childrenLinks}}</div>
+
+</div>
+
+%rebase layout typ="view", topnav=topnav_f, x_js_script=x_js_script_f
+
diff --git a/thawab-server b/thawab-server
index cad4921..d3437b8 100755
--- a/thawab-server
+++ b/thawab-server
@@ -1,6 +1,252 @@
-#!/usr/bin/python2
+#! /usr/bin/python
 # -*- coding: UTF-8 -*-
+import sys, os, time, atexit, signal, shutil, tempfile, sqlite3
+from Thawab.gtkUi import launchServer
+from Thawab.shamelaUtils import ShamelaSqlite, shamelaImport
+class ThawabServer:
+	def __init__(self, pidfile):
+		self.pidfile = pidfile
+	def tprint(self, message, noend=False):
+		if not noend:
+			sys.stderr.write(message+"\n")
+		else:
+			sys.stderr.write(message+"\r")
+		
+	def daemonize(self):
+		try: 
+			pid = os.fork() 
+			if pid > 0:
+				# exit first parent
+				sys.exit(0) 
+		except OSError as err: 
+			self.tprint('fork #1 failed: {0}'.format(err))
+			sys.exit(1)
+	
+		# decouple from parent environment
+		os.chdir('/') 
+		os.setsid() 
+		os.umask(0) 
+	
+		# do second fork
+		try: 
+			pid = os.fork() 
+			if pid > 0:
 
-from Thawab.gtkUi import onlyterminal
-onlyterminal()
+				# exit from second parent
+				sys.exit(0) 
+		except OSError as err: 
+			self.tprint('fork #2 failed: {0}'.format(err))
+			sys.exit(1) 
+	
+		# redirect standard file descriptors
+		sys.stdout.flush()
+		sys.stderr.flush()
+		si = open(os.devnull, 'r')
+		so = open(os.devnull, 'a+')
+		se = open(os.devnull, 'a+')
 
+		os.dup2(si.fileno(), sys.stdin.fileno())
+		os.dup2(so.fileno(), sys.stdout.fileno())
+		os.dup2(se.fileno(), sys.stderr.fileno())
+	
+		# write pidfile
+		atexit.register(self.delpid)
+
+		pid = str(os.getpid())
+		with open(self.pidfile,'w+') as f:
+			f.write(pid + '\n')
+	
+	def delpid(self):
+		os.remove(self.pidfile)
+
+	def check_running(self):
+		# Check for a pidfile to see if the daemon already runs
+		try:
+			with open(self.pidfile,'r') as pf:
+
+				return int(pf.read().strip())
+		except IOError:
+			return None
+	
+
+			
+	def start(self):
+		"""Start the daemon."""
+		
+		if self.check_running():
+			message = "pidfile {0} already exist. " + \
+					"Server is already running?\n"
+			self.tprint(message.format(self.pidfile))
+			sys.exit(1)
+		# Start the daemon
+		self.daemonize()
+		self.run()
+
+	def stop(self):
+		"""Stop the daemon."""
+
+		# Get the pid from the pidfile
+		pid = self.check_running()
+	
+		if not pid:
+			message = "pidfile {0} does not exist. " + \
+					"Server is not running?\n"
+			self.tprint(message.format(self.pidfile))
+			return # not an error in a restart
+
+		# Try killing the daemon process	
+		try:
+			while 1:
+				os.kill(pid, signal.SIGTERM)
+				time.sleep(0.1)
+		except OSError as err:
+			e = str(err.args)
+			if e.find("No such process") > 0:
+				if os.path.exists(self.pidfile):
+					os.remove(self.pidfile)
+			else:
+				print (str(err.args))
+				sys.exit(1)
+
+	def restart(self):
+		"""Restart the daemon."""
+		self.stop()
+		self.start()
+
+	def run(self, silent=False):
+		self.th, self.port, self.server = launchServer()
+		if not silent: self.server.serve_forever()
+
+	def clean_run(self):
+		if self.check_running():
+			self.tprint("Stopping the running server")
+			self.stop()
+		self.run(True)
+		
+	def test(self):
+		self.tprint("server started successfully")
+		
+	def reindex(self):
+		self.clean_run()		
+		self.th.asyncIndexer.queueIndexNew()
+		if not self.th.asyncIndexer.started:
+			self.th.asyncIndexer.start()
+		jj = j = self.th.asyncIndexer.jobs()
+		while (j > 0 ):
+			self.tprint("Indexing ... (%d left)" % j,True)
+			j = self.th.asyncIndexer.jobs()
+		self.tprint("No indexing jobs left")
+		if j <= 0 and jj > 0:
+			self.tprint("Indexing %d jobs, Done" % jj)
+		self.server.server_close()
+		
+	def remove_index(self):
+		self.clean_run()
+		self.tprint("You will need to recreate search index in-order to search again.")
+		p = os.path.join(self.th.prefixes[0], 'index')
+		try:
+			shutil.rmtree(p)
+		except OSError:
+			self.tprint("unable to remove folder [%s]" % p)
+		else:
+			self.tprint("Done")
+		self.server.server_close()
+	
+	def remove_meta(self):
+		self.clean_run()
+		p = os.path.join(self.th.prefixes[0], 'cache', 'meta.db')
+		try:
+			os.unlink(p)
+		except OSError:
+			self.tprint("unable to remove file [%s]" % p)
+		else:
+			self.th.reconstructMetaIndexedFlags()
+			self.tprint("Done")
+	
+	def progress_cb(self, msg, p, *d, **kw):
+		self.tprint(" ** progress: [%g%% completed] %s" % (p, msg))
+        
+	def importbok(self, bok):
+		self.clean_run()
+		fh, db_fn = tempfile.mkstemp(suffix = '.sqlite', prefix = 'th_shamela_tmp')
+		f = open(db_fn, "w")
+		f.truncate(0)
+		f.close()
+		cn = sqlite3.connect(db_fn, isolation_level = None)
+		try:
+			sh = ShamelaSqlite(bok,cn,0,0, self.progress_cb)
+		except TypeError:
+			self.tprint("not a shamela file")
+			self.server.server_close()
+			return
+		except OSError:
+			self.tprint("mdbtools is not installed")
+			self.server.server_close()
+			return
+		
+		if not sh.toSqlite():
+			self.server.server_close()
+			return
+		
+		ids = sh.getBookIds()
+		
+		for j, bkid in enumerate(ids):
+			ki = self.th.mktemp()
+			c = ki.seek(-1,-1)
+			
+			m = shamelaImport(c,
+				sh,
+				bkid)
+			c.flush()
+			t_fn = os.path.join(self.th.prefixes[0],
+				'db',
+				u"".join((m['kitab'] + \
+				u"-" + \
+				m['version'] + \
+				u'.ki',)))
+			try:
+				shutil.move(ki.uri, t_fn)
+			except OSError:
+				self.tprint("unable to move converted file.") # windows can't move an opened file
+		if db_fn and os.path.exists(db_fn):
+			try:
+				os.unlink(db_fn)
+			except OSError:
+				pass
+		self.th.loadMeta()
+		self.tprint("Done")
+		self.server.server_close()
+if __name__ == "__main__":
+
+		daemon = ThawabServer('/tmp/thawab-server.pid')
+		if len(sys.argv) >= 2:
+			if 'start' == sys.argv[1]:
+					daemon.start()
+			elif 'stop' == sys.argv[1]:
+					daemon.stop()
+			elif 'restart' == sys.argv[1]:
+					daemon.restart()
+			elif 'reindex' == sys.argv[1]:
+					daemon.reindex()		
+			elif 'fix' == sys.argv[1]:
+					if sys.argv[2] == 'index':
+						daemon.remove_index()
+					elif sys.argv[2] == 'meta':
+						daemon.remove_meta()
+			elif 'importbok' == sys.argv[1] and len(sys.argv) >= 3:
+					daemon.importbok(sys.argv[2])
+			else:
+					print "Unknown command"
+					sys.exit(2)
+					sys.exit(0)
+		else:
+				print '''Thawab Server\nusage:	thawab-server [command] [file(s)] \nCommands:
+	start		starts the server 
+	stop		stops the server 
+	restart		restarts the server 
+	reindex		queues new books
+	fix index	removes search index
+	fix meta	removes meta data cache to generate a fresh one
+	importbok [file path]	imports Shamela .bok file'''
+				
+				sys.exit(2)
diff --git a/thawab.spec b/thawab.spec
index a0df9aa..cfaef43 100644
--- a/thawab.spec
+++ b/thawab.spec
@@ -1,40 +1,87 @@
 %global owner ojuba-org
-%global commit #Write commit number here
-
-Name:		thawab
-Summary:	Thawab Arabic/Islamic encyclopedia system
-URL:		http://ojuba.org/
-Version:	3.2.0
-Release:	1%{?dist}
-Source0:	https://github.com/%{owner}/%{name}/archive/%{commit}/%{name}-%{commit}.tar.gz
-License:	WAQFv2
-Group:		System Environment/Base
-BuildArch:	noarch
-Requires:	python-whoosh >= 1.7.2
-Requires:	python-okasha >= 0.2.3
-Requires:	pygobject3 >= 3.0.2
-Requires:	python
-Requires:	mdbtools
-Requires:	python-paste
-Requires:	islamic-menus
-Requires:	python-othman
-BuildRequires:	gettext
-BuildRequires:	python2-devel
-BuildRequires:	perl
+
+Name: thawab
+Summary: Arabic/Islamic encyclopedia system
+Summary(ar): نظام موسوعي عربي/إسلامي
+URL: http://ojuba.org/
+Version: 4.1
+Release: 1%{?dist}
+Source0: https://github.com/%{owner}/%{name}/archive/%{version}/%{name}-%{version}.tar.gz
+License: WAQFv2
+BuildArch: noarch
+Requires: python-whoosh >= 1.7.2
+Requires: python-okasha >= 0.2.3
+Requires: pygobject3 >= 3.0.2
+Requires: python
+Requires: mdbtools
+Requires: python-paste
+Requires: islamic-menus
+Requires: python-othman
+Requires: webkitgtk3
+BuildRequires: gettext
+BuildRequires: python2-devel
+BuildRequires: perl
+BuildRequires: ImageMagick
+BuildRequires: intltool
 
 %description
 Thawab Arabic/Islamic encyclopedia system
 
+%description -l ar
+نظام موسوعي عربي/إسلامي
+
 %prep
-%setup -q -n %{name}-%{commit}
+%autosetup -n %{name}-%{version}
 
 %build
 bash update-manual-from-site.sh
 make %{?_smp_mflags}
 
 %install
-rm -rf $RPM_BUILD_ROOT
-%makeinstall DESTDIR=$RPM_BUILD_ROOT
+%make_install
+
+
+
+
+# Register as an application to be visible in the software center
+#
+# NOTE: It would be *awesome* if this file was maintained by the upstream
+# project, translated and installed into the right place during `make install`.
+#
+# See http://www.freedesktop.org/software/appstream/docs/ for more details.
+#
+mkdir -p $RPM_BUILD_ROOT%{_datadir}/appdata
+cat > $RPM_BUILD_ROOT%{_datadir}/appdata/%{name}.appdata.xml <<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright 2017 Mosaab Alzoubi <moceap at hotmail.com> -->
+<!--
+EmailAddress: moceap at hotmail.com
+SentUpstream: 2017-2-18
+-->
+<application>
+  <id type="desktop">%{name}.desktop</id>
+  <metadata_license>CC0-1.0</metadata_license>
+  <summary>Arabic/Islamic encyclopedia system</summary>
+  <summary xml:lang="ar">نظام موسوعي عربي/إسلامي</summary>
+  <description>
+    <p>
+	Arabic/Islamic encyclopedia system.
+    </p>
+  </description>
+  <description xml:lang="ar">
+    <p>
+	نظام موسوعي عربي/إسلامي.
+    </p>
+  </description>
+  <url type="homepage">https://github.com/ojuba-org/%{name}</url>
+  <screenshots>
+    <screenshot type="default">http://ojuba.org/screenshots/%{name}.png</screenshot>
+  </screenshots>
+  <updatecontact>moceap at hotmail.com</updatecontact>
+</application>
+EOF
+
+
 
 %post
 touch --no-create %{_datadir}/icons/hicolor || :
@@ -48,11 +95,8 @@ if [ -x %{_bindir}/gtk-update-icon-cache ] ; then
 %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
 fi
 
-%clean
-rm -rf $RPM_BUILD_ROOT
-
 %files
-%defattr(-,root,root,-)
+%license waqf2-ar.pdf
 %doc waqf2-ar.pdf readme
 %{_bindir}/thawab-gtk
 %{_bindir}/thawab-server
@@ -63,8 +107,35 @@ rm -rf $RPM_BUILD_ROOT
 %{_datadir}/icons/hicolor/*/apps/*.svg
 %{_datadir}/applications/*.desktop
 %{_datadir}/locale/*/*/*.mo
+%{_datadir}/appdata/%{name}.appdata.xml
 
 %changelog
+* Mon Feb 20 2017 Mosaab Alzoubi <moceap at hotmail.com> - 4.1-1
+- Update to 4.1
+- Fixes for warnings
+
+* Sun Feb 19 2017 Mosaab Alzoubi <moceap at hotmail.com> - 4.0-1
+- Update to 4.0
+- New generation of Thqwab Server
+- New enhanced look
+- New way to Github
+- Add Appdata
+
+* Sun Nov 13 2016 Ehab El-Gedawy <ehabsas at hotmail.com> - 3.2.1-1
+- add webkitgtk3 dependancy
+
+* Tue Jul 14 2015 Mosaab Alzoubi <moceap at hotmail.com> - 3.2.0-3
+- Enhance summary
+- Remove Group tag
+- Add Arabic summary and description
+- Improve %%install section
+- Remove %%clean section
+- Remove old attr way
+- Use %%license
+
+* Tue Jul 14 2015 Mosaab Alzoubi <moceap at hotmail.com> - 3.2.0-2
+- Add some BRs
+
 * Sat Feb 14 2015  Mosaab Alzoubi <moceap at hotmail.com> - 3.2.0-1
 - Add Thawab Server.
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-islamic/packages/thawab.git



More information about the Debian-islamic-commits mailing list