mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
Res: Add resources from xowa_app_windows_64_v4.5.26.1810
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
.cur_head_text {
|
||||
width: calc(100% - 108px);
|
||||
}
|
||||
.cur_head_btns {
|
||||
width: 108px;
|
||||
}
|
||||
|
||||
/* Detail Tbl */
|
||||
.cur_data_row {
|
||||
padding: 4px 0px 4px;
|
||||
}
|
||||
.cur_data_row label {
|
||||
display: inline-block;
|
||||
width: 90px;
|
||||
margin: 0px 4px 0px 10px;
|
||||
vertical-align: top;
|
||||
align-self: flex-start;
|
||||
-webkit-align-self: flex-start;
|
||||
|
||||
font-weight: bold;
|
||||
}
|
||||
.cur_data_row label::after {
|
||||
content: ":";
|
||||
}
|
||||
.cur_data_input {
|
||||
display: inline-block;
|
||||
width: calc(100% - 140px);
|
||||
}
|
||||
.cur_data_icon {
|
||||
margin-left: 7px;
|
||||
}
|
||||
.files_table th {
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
.files_table_url, .files_table_size, .files_table_md5 {
|
||||
border-bottom: 1px solid #ddd;
|
||||
padding: 4px;
|
||||
}
|
||||
.files_table_url {
|
||||
}
|
||||
.files_table_size {
|
||||
text-align:right;
|
||||
padding:0px 25px 0px 25px; /* use padding to add space between left and right cols */
|
||||
}
|
||||
.files_table_md5 {
|
||||
font-family:Courier New;
|
||||
}
|
||||
input[readonly]
|
||||
{
|
||||
background-color:#eff0f1;
|
||||
border:1px solid #ddd;
|
||||
}
|
||||
|
||||
.cur_actions_row {
|
||||
display: inline-block;
|
||||
margin: 0px 4px 0px 10px;
|
||||
vertical-align: top;
|
||||
align-self: flex-start;
|
||||
-webkit-align-self: flex-start;
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
(function (xo) {
|
||||
xo.wiki_directory = new function() {
|
||||
this.item_send = function(proc, args) {
|
||||
try {xo.server.send_by_bridge('wiki.directory.item', proc, args);}
|
||||
catch (err) {alert(err);}
|
||||
}
|
||||
this.get_elem_val = function(id) {
|
||||
var elem = document.getElementById(id);
|
||||
return elem == null ? null : elem.value;
|
||||
}
|
||||
this.item__save = function() {
|
||||
xo.wiki_directory.notify__clear();
|
||||
var data =
|
||||
{
|
||||
id: this.get_elem_val('id_lbl')
|
||||
, domain: this.get_elem_val('domain_box')
|
||||
, name: this.get_elem_val('name_box')
|
||||
, dir: this.get_elem_val('dir_box')
|
||||
, mainpage: this.get_elem_val('mainpage_box')
|
||||
};
|
||||
xo.wiki_directory.item_send('save', data);
|
||||
}
|
||||
this.item__delete = function() {
|
||||
var data =
|
||||
{
|
||||
id: this.get_elem_val('id_lbl')
|
||||
, domain: this.get_elem_val('domain_box')
|
||||
};
|
||||
xo.wiki_directory.item_send('delete', data);
|
||||
}
|
||||
this.item__reindex_search = function() {
|
||||
xo.notify.elem_anchor = '#cur_help_div'; // moved here b/c of report of crash when New personal wiki is opened
|
||||
xo.wiki_directory.item_send('reindex_search', {domain:this.get_elem_val('domain_box')});
|
||||
}
|
||||
|
||||
this.io_cmd__select = function() {
|
||||
// call xowa to launch file_dialog
|
||||
var file_path = xowa_exec('scripts_exec', 'app.gui.kit.ask_dir("Please select a folder");');
|
||||
if (file_path == null || file_path == '') return; // nothing selected; exit
|
||||
|
||||
// update val
|
||||
var elem = document.getElementById('dir_box');
|
||||
elem.value = file_path;
|
||||
}
|
||||
|
||||
this.notify__clear = function() {
|
||||
var elem = document.getElementById('xo_msg_box');
|
||||
elem.innerHTML = "";
|
||||
}
|
||||
this.notify__recv = function(msg_str) {
|
||||
try {
|
||||
var msg = JSON.parse(msg_str);
|
||||
var elem_id = msg.elem_id;
|
||||
if (!elem_id) elem_id = 'xo_msg_box';
|
||||
var msg_text = msg.msg_text;
|
||||
|
||||
var elem = document.getElementById(elem_id);
|
||||
elem.innerHTML = elem.textContent + msg_text;
|
||||
return true;
|
||||
} catch (err) {
|
||||
alert(err);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}(window.xo = window.xo || {}));
|
||||
@@ -0,0 +1,82 @@
|
||||
<div id='xo_msg_box' style='width:100%; color:red'>
|
||||
</div>
|
||||
<div id='cur_help_div' class='xohelp_div'>
|
||||
<div id='cur_help_msg' class='xohelp_msg'>
|
||||
<b>Info</b>
|
||||
<div>
|
||||
<div class='xohelp_row'><span class='xohelp_bullet'> </span><span class='xohelp_row_text'><b>Domain</b>: Domain of your wiki. Used for the URL bar. For example: <code>wiki.me.org</code>. Cannot be changed after wiki is created</span></div>
|
||||
<div class='xohelp_row'><span class='xohelp_bullet'> </span><span class='xohelp_row_text'><b>Name</b>: Friendly name for the wiki. Shown in list of wikis. For example: <code>My wiki</code></span></div>
|
||||
<div class='xohelp_row'><span class='xohelp_bullet'> </span><span class='xohelp_row_text'><b>Folder</b>: Folder for the wiki. A file with the domain name will be created in the folder: For example: <code>C:\personal\wiki.me.org</code>. Note that this will create a file called <code>C:\personal\wiki.me.org\wiki.me.org.xowa</code></span></div>
|
||||
<div class='xohelp_row'><span class='xohelp_bullet'> </span><span class='xohelp_row_text'><b>Main Page</b>: The default start page for the wiki. For example, entering in <code>wiki.me.org</code> will navigate directly to <code>Main_Page</code>. Cannot be changed after wiki is created</span></div>
|
||||
For more info, see <a href='/site/home/wiki/App/Personal_wikis/New_wiki'>the new wiki help page</a>
|
||||
</div>
|
||||
<b>Buttons</b>
|
||||
<div>
|
||||
{{#mode_is_new}}
|
||||
<div class='xohelp_row'><span class='xoimg_help_x24 xoimg_list_save'> </span><span class='xohelp_row_text'>Creates the wiki</span></div>
|
||||
{{/mode_is_new}}
|
||||
{{^mode_is_new}}
|
||||
<div class='xohelp_row'><span class='xoimg_help_x24 xoimg_list_save'> </span><span class='xohelp_row_text'>Saves the current settings</span></div>
|
||||
<div class='xohelp_row'><span class='xoimg_help_x24 xoimg_list_delete'> </span><span class='xohelp_row_text'>Deletes the wiki from the list. Note that the file itself will not be deleted.</span></div>
|
||||
{{/mode_is_new}}
|
||||
</div>
|
||||
{{^mode_is_new}}
|
||||
<b>Commands</b>
|
||||
<div>
|
||||
<div class='xohelp_row'><span class='xohelp_bullet'> </span><span class='xohelp_row_text'>Reindex pages for search bar. See <a href='/site/home/wiki/App/Personal_wikis/Search'>the search help page</a></span></div>
|
||||
</div>
|
||||
{{/mode_is_new}}
|
||||
</div>
|
||||
</div>
|
||||
<div class='main_body' id='main_body'>
|
||||
<div class='xotbl_head_row'>
|
||||
<div class='xotbl_head_text cur_head_text'>
|
||||
{{#mode_is_new}}Create a wiki{{/mode_is_new}}
|
||||
{{^mode_is_new}}Edit the wiki{{/mode_is_new}}
|
||||
</div>
|
||||
<a class='xoimg_btn_x24 xoimg_list_save' title='save changes' href='javascript:void(0)' accesskey='s'
|
||||
onclick='xo.wiki_directory.item__save();'> </a>
|
||||
{{^mode_is_new}}
|
||||
<a class='xoimg_btn_x24 xoimg_list_delete' title='remove wiki' href='javascript:void(0)'
|
||||
data_alertify_msg='Please confirm that you wish to remove the wiki from your list<br/>Note that the file itself will not be deleted'
|
||||
data_alertify_ok='Remove'
|
||||
data_alertify_cancel='Cancel'
|
||||
data_alertify_func='xo.wiki_directory.item__delete();'
|
||||
onclick='return xo.alertify.confirm_func(this);'> </a>
|
||||
{{/mode_is_new}}
|
||||
<a class='xoimg_btn_x24 xoimg_help_tip' title='view help' href='javascript:void(0)' onclick='return xo.help.toggle("cur")'> </a>
|
||||
</div>
|
||||
<div class="xotbl_data_row cur_data_row">
|
||||
<label>Domain</label>
|
||||
<input id='domain_box' type='text' accesskey='d' value='{{domain}}' class='cur_data_input'{{#mode_is_new}} placeholder='Enter a domain (For example: wiki.me.org)'{{/mode_is_new}}{{^mode_is_new}} readonly{{/mode_is_new}}></input>
|
||||
<input id='id_lbl' type='hidden' value='{{id}}'></span>
|
||||
</div>
|
||||
<div class="xotbl_data_row cur_data_row">
|
||||
<label>Name</label>
|
||||
<input id='name_box' type='text' value='{{name}}' class='cur_data_input'{{#mode_is_new}} placeholder='Enter a name (For example: My wiki)'{{/mode_is_new}}></input>
|
||||
</div>
|
||||
<div class="xotbl_data_row cur_data_row">
|
||||
<label>Folder</label>
|
||||
<input id='dir_box' type='text' value='{{dir}}' class='cur_data_input'{{#mode_is_new}} placeholder='Enter a folder (For example: C:\personal\wiki.me.org). You can also click on the wrench at the far-right'{{/mode_is_new}}></input>
|
||||
<span class="xoimg_btn_x16 xoimg_app_configure cur_data_icon" onclick='xo.wiki_directory.io_cmd__select();'> </span>
|
||||
</div>
|
||||
<div class="xotbl_data_row cur_data_row">
|
||||
<label>Main Page</label>
|
||||
<input id='mainpage_box' type='text' value='{{mainpage}}' class='cur_data_input'{{#mode_is_new}} placeholder='Enter the name for the Main Page. (For example: Main_Page)'{{/mode_is_new}}{{^mode_is_new}} readonly{{/mode_is_new}}></input>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
{{^mode_is_new}}
|
||||
<div class='main_body' id='other_body'>
|
||||
<div class='xotbl_head_row'>
|
||||
<div class='xotbl_head_text cur_head_text'>
|
||||
Other actions
|
||||
</div>
|
||||
</div>
|
||||
<div class="xotbl_data_row">
|
||||
<div class='cur_actions_row'>
|
||||
<a class='' title='reindex' href='javascript:void(0)' accesskey='f' onclick='return xo.wiki_directory.item__reindex_search();'>Reindex pages for search bar</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/mode_is_new}}
|
||||
@@ -0,0 +1,476 @@
|
||||
Welcome to your personal wiki!
|
||||
|
||||
Personal wikis are new and will be in continual development! If you encounter issues, please report them through the [[xowa.home:Help/Feedback|Feedback page]].
|
||||
|
||||
== Quick start ==
|
||||
=== Editing this page ===
|
||||
* Switch to edit mode by pressing <code>Edit</code> near the top-right of the page
|
||||
* Edit the text by typing directly in the text box. For this example, enter <code>Hello, world!</code> at the top of the text box.
|
||||
* Save the page by pressing the <code>Save page</code> button at the bottom of the text box
|
||||
|
||||
Congratulations! You should see <code>Hello, world!</code> at the top of the page
|
||||
|
||||
=== Creating a new page ===
|
||||
* Navigate to a page by entering a page title in the url bar. For this example, enter <code>Test</code>.
|
||||
* A blank page will open in edit mode. Enter in some text in the text box. For this example, enter <code>Some text for the page</code>
|
||||
* Save the page.
|
||||
|
||||
Congratulations! You have just created a new page called <code>Test</code>
|
||||
|
||||
=== Linking to a page ===
|
||||
* Switch to edit mode.
|
||||
* Enter a link by entering text into the text box. For this example, use <code><nowiki>[[Test]]</nowiki></code>.
|
||||
* Save the page. The word <code><nowiki>Test</nowiki></code> will show and be highlighted in blue.
|
||||
* Click on the <code>Test</code> link. The <code>Test</code> page will open.
|
||||
|
||||
Congratulations! You have just linked to a page called <code>Test</code>
|
||||
|
||||
== Basic editing ==
|
||||
The best place to start is Wikipedia's guide for editing: https://en.wikipedia.org/wiki/Help:Getting_started
|
||||
|
||||
The table below is provided for reference. Note the following columns:
|
||||
* '''function''': the name of the function
|
||||
* '''example''': an example of the function as shown in HTML
|
||||
* '''wikitext''': the actual wikitext used to render the function
|
||||
* '''html''': an alternative way of rendering the same wikitext, but only with html.
|
||||
|
||||
=== HTML tags ===
|
||||
Most HTML tags are available.
|
||||
* '''HTML tags can be used as an alternative to wikitext.''': For example, <i>italicized text</i> can also be shown with <code><nowiki><i>italicized text</i></nowiki>
|
||||
* '''HTML tags are needed for other functions.''': For example, the following have no wikitext equivalent <code><nowiki><u>underline</u></nowiki></code>, <code><nowiki><s>strikethru</s></nowiki></code>, etc..
|
||||
|
||||
However, there are some notable exceptions:
|
||||
* '''anchor tags are not allowed''': Any <code><a></code> will be rendered literally. Instead, use an internal / external link. For example, <code><nowiki>[[Test]]</nowiki></code>
|
||||
* '''image tags are not allowed''': Any <code><img></code> will be rendered literally. Instead, use an internal link in the file namespace. For example, <code><nowiki>[[File:Image.png]]</nowiki></code>
|
||||
* '''javascript / events are not allowed''': All javascript and "onevent" blocks are removed.
|
||||
|
||||
{|class=wikitable style="background:white"
|
||||
|-
|
||||
! function
|
||||
! example
|
||||
! wikitext
|
||||
! html
|
||||
|-
|
||||
| italics
|
||||
| ''italicized text''
|
||||
| <code><nowiki>''italicized text''</nowiki></code>
|
||||
| <code><nowiki><i>italicized text</<i></nowiki></code>
|
||||
|-
|
||||
| bold
|
||||
| '''bold text'''
|
||||
| <code><nowiki>'''bold text'''</nowiki></code>
|
||||
| <code><nowiki><b>bold text</<b></nowiki></code>
|
||||
|-
|
||||
| bold and italics
|
||||
| '''''bold and italicized text'''''
|
||||
| <code><nowiki>'''''bold and italicized text'''''</nowiki></code>
|
||||
| <code><nowiki><b><i>bold and italicized text</i></b></nowiki></code>
|
||||
|-
|
||||
| underline
|
||||
| <u>underlined text</u>
|
||||
| <code><nowiki>N/A</nowiki></code>
|
||||
| <code><nowiki><u>underlined text</u></nowiki></code>
|
||||
|-
|
||||
| strike-thru
|
||||
| <s>strike-thru text</s>
|
||||
| <code><nowiki>N/A</nowiki></code>
|
||||
| <code><nowiki><s>strike-thru text</s></nowiki></code>
|
||||
|-
|
||||
| color
|
||||
| <span style='color:green'>colored text</span>
|
||||
| <code><nowiki>N/A</nowiki></code>
|
||||
| <code><nowiki><span style='color:green'>colored text</span></nowiki></code>
|
||||
|-
|
||||
| external url: url only
|
||||
| http://xowa.org
|
||||
| <code><nowiki>http://xowa.org</nowiki></code>
|
||||
| <code>N/A</code>
|
||||
|-
|
||||
| external url: url with name
|
||||
| [http://xowa.org xowa web site]
|
||||
| <code><nowiki>[http://xowa.org xowa web site]</nowiki></code>
|
||||
| <code>N/A</code>
|
||||
|-
|
||||
| external url: numbered
|
||||
| [http://xowa.org]
|
||||
| <code><nowiki>[http://xowa.org]</nowiki></code>
|
||||
| <code>N/A</code>
|
||||
|-
|
||||
| internal url: page only
|
||||
| [[Test]]
|
||||
| <code><nowiki>[[Test]]</nowiki></code>
|
||||
| <code>N/A</code>
|
||||
|-
|
||||
| internal url: page with name
|
||||
| [[Test|My test page]]
|
||||
| <code><nowiki>[[Test|My test page]]</nowiki></code>
|
||||
| <code>N/A</code>
|
||||
|-
|
||||
| paragraph<br/>
|
||||
|
|
||||
para 1
|
||||
|
||||
para 2
|
||||
|
|
||||
<pre>
|
||||
para 1
|
||||
|
||||
para 2
|
||||
</pre>
|
||||
<ref group='basics'>enter a completely blank line between paragraphs</ref>
|
||||
|
|
||||
<pre>
|
||||
<p>para 1</p>
|
||||
<p>para 2</p>
|
||||
</pre>
|
||||
|-
|
||||
| preformatted blocks
|
||||
|
|
||||
line 1
|
||||
line 2
|
||||
|
|
||||
<pre>
|
||||
line 1
|
||||
line 2
|
||||
</pre>
|
||||
<ref group='basics'>start a line with a space</ref>
|
||||
|
|
||||
<pre>
|
||||
<pre>
|
||||
line 1
|
||||
para 2
|
||||
</pre>
|
||||
</pre>
|
||||
|-
|
||||
| list: bulleted
|
||||
|
|
||||
* a
|
||||
** aa
|
||||
*** aaa
|
||||
* b
|
||||
* c
|
||||
** cc
|
||||
|
|
||||
<pre>
|
||||
* a
|
||||
** aa
|
||||
*** aaa
|
||||
* b
|
||||
* c
|
||||
** cc
|
||||
</pre>
|
||||
|
|
||||
<pre>
|
||||
<ul>
|
||||
<li>a
|
||||
<ul>
|
||||
<li>aa
|
||||
<ul>
|
||||
<li>aaa</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>b</li>
|
||||
<li>c
|
||||
<ul>
|
||||
<li>cc
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</pre>
|
||||
</pre>
|
||||
|-
|
||||
| list: numbered
|
||||
|
|
||||
# a
|
||||
## aa
|
||||
### aaa
|
||||
# b
|
||||
# c
|
||||
## cc
|
||||
|
|
||||
<pre>
|
||||
# a
|
||||
## aa
|
||||
### aaa
|
||||
# b
|
||||
# c
|
||||
## cc
|
||||
</pre>
|
||||
|
|
||||
<pre>
|
||||
<ol>
|
||||
<li>a
|
||||
<ol>
|
||||
<li>aa
|
||||
<ol>
|
||||
<li>aaa</li>
|
||||
</ol>
|
||||
</li>
|
||||
</ol>
|
||||
</li>
|
||||
<li>b</li>
|
||||
<li>c
|
||||
<ol>
|
||||
<li>cc
|
||||
</li>
|
||||
</ol>
|
||||
</li>
|
||||
</ol>
|
||||
</pre>
|
||||
|-
|
||||
| header
|
||||
|
|
||||
=== Basic editing: Test Level a3 ===
|
||||
==== Basic editing: Test Level a4 ====
|
||||
===== Basic editing: Test Level a5 =====
|
||||
=== Basic editing: Test Level b3 ===
|
||||
=== Basic editing: Test Level c3 ===
|
||||
==== Basic editing: Test Level c4 ====
|
||||
|
|
||||
<pre>
|
||||
=== Basic editing: Test Level a3 ===
|
||||
==== Basic editing: Test Level a4 ====
|
||||
===== Basic editing: Test Level a5 =====
|
||||
=== Basic editing: Test Level b3 ===
|
||||
=== Basic editing: Test Level c3 ===
|
||||
==== Basic editing: Test Level c4 ====
|
||||
</pre>
|
||||
|
|
||||
<pre>
|
||||
<h3> Basic editing: Test Level a3 </h3>
|
||||
<h4> Basic editing: Test Level a4 </h4>
|
||||
<h5> Basic editing: Test Level a5 </h5>
|
||||
<h3> Basic editing: Test Level b3 </h3>
|
||||
<h3> Basic editing: Test Level c3 </h3>
|
||||
<h4> Basic editing: Test Level c4 </h4>
|
||||
</pre>
|
||||
|-
|
||||
| table
|
||||
|
|
||||
{|class=wikitable
|
||||
|+ caption
|
||||
|-
|
||||
! header a
|
||||
! header b
|
||||
|-
|
||||
| cell 1a
|
||||
| cell 1b
|
||||
|-
|
||||
| cell 2a
|
||||
| cell 2b
|
||||
|}
|
||||
|
|
||||
<pre>
|
||||
{|class=wikitable
|
||||
|+ caption
|
||||
|-
|
||||
! header a
|
||||
! header b
|
||||
|-
|
||||
| cell 1a
|
||||
| cell 1b
|
||||
|-
|
||||
| cell 2a
|
||||
| cell 2b
|
||||
|}
|
||||
</pre>
|
||||
|
|
||||
<pre>
|
||||
<table class="wikitable">
|
||||
<caption>caption</caption>
|
||||
<tr>
|
||||
<th>header a</th>
|
||||
<th>header b</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>cell 1a</td>
|
||||
<td>cell 1b</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>cell 2a</td>
|
||||
<td>cell 2b</td>
|
||||
</tr>
|
||||
</table>
|
||||
</pre>
|
||||
|}
|
||||
|
||||
=== Notes for Basics editing ===
|
||||
<references group='basics'>
|
||||
</references>
|
||||
|
||||
== Advanced editing ==
|
||||
=== Category ===
|
||||
Categories are supported. As a basic example, try the following:
|
||||
* Edit this page
|
||||
* Add the following text: <code><nowiki>[[Category:Test]]</nowiki></code>
|
||||
* Scroll down to the bottom of the page. You will see a <code><nowiki>Categories</nowiki></code> section and <code><nowiki>Test</nowiki></code> listed
|
||||
* Navigate to <code><nowiki>Category:Test</nowiki></code>. You will see the Main page listed
|
||||
|
||||
For more info, see https://en.wikipedia.org/wiki/Help:Category
|
||||
|
||||
=== Images ===
|
||||
Images are supported, but the process is slightly complicated due to the set-up of third-party software.
|
||||
|
||||
Here is a broad overview:
|
||||
* Set up imagemagick and inkscape on your machine. For more instructions, see http://xowa.org/home/wiki/App/Wiki_types/Wikia.com#Part_3c:_Setup_Imagemagick_and_Inkscape
|
||||
* Place your images in your wiki directory. Assuming your wiki is set up in <code>C:\your_wiki</code>, then you need to copy an image to <code>C:\your_wiki\file\orig</code>. As an example, do the following:
|
||||
** Download the image from <code><nowiki>https://upload.wikimedia.org/wikipedia/commons/9/97/The_Earth_seen_from_Apollo_17.jpg</nowiki></code>
|
||||
** Move the image to <code>C:\your_wiki\file\orig\The_Earth_seen_from_Apollo_17.jpg</nowiki></code>
|
||||
** Edit the page, and add the following text: <code><nowiki>[[File:The_Earth_seen_from_Apollo_17.jpg]]</nowiki></code>
|
||||
* Preview the page. You should see the image.
|
||||
|
||||
For more info, see https://en.wikipedia.org/wiki/Wikipedia:Picture_tutorial
|
||||
|
||||
=== Table of contents ===
|
||||
Table of contents (TOC) are automatically generated by XOWA if you have 4 headers (a header being something like <code><nowiki>== header ==</nowiki></code>)
|
||||
|
||||
If you have less than 4 headers, you can force a TOC by adding <code><nowiki>__TOC__</nowiki></code>
|
||||
|
||||
=== Math ===
|
||||
LaT<sub>E</sub>X formatting is available. For example, the following is the formula for the Pythagorean theorem: <math>a^2 + b^2 = c^2</math>
|
||||
|
||||
=== References ===
|
||||
Wikipedia-style references are supported. For example, this is a simple reference: <ref>Test footnote</ref>.
|
||||
|
||||
Note that you can hover over the reference number to get a tooltip preview
|
||||
|
||||
=== Sortable tables ===
|
||||
Wikipedia-style sortable tables are supported.
|
||||
|
||||
{|class='wikitable sortable'
|
||||
|-
|
||||
! String
|
||||
! Int
|
||||
! Date - months
|
||||
|-
|
||||
| c
|
||||
| 3
|
||||
| Mar 1 2012
|
||||
|-
|
||||
| b
|
||||
| 22
|
||||
| Feb 2 2011
|
||||
|-
|
||||
| a
|
||||
| 111
|
||||
| Jan 3 2010
|
||||
|}
|
||||
|
||||
=== Collapsible tables ===
|
||||
Wikipedia-style collapsible tables are supported.
|
||||
{| class="wikitable collapsible"
|
||||
! Data
|
||||
|-
|
||||
| A
|
||||
|-
|
||||
| B
|
||||
|-
|
||||
| C
|
||||
|}
|
||||
|
||||
=== More ===
|
||||
Other features are supported, including Tabviews, Timelines, Graphs, Hieroglyphics and Musical scores. For examples, see [[xowa.home:Diagnostics]]
|
||||
|
||||
== Expert editing ==
|
||||
=== Magic words ===
|
||||
Most magic words are supported, such as <code><nowiki>{{CURRENTTIME}}</nowiki></code> and <code><nowiki>{{lc:string}}</nowiki></code>. For more info, see https://en.wikipedia.org/wiki/Help:Magic_words
|
||||
|
||||
=== Parser functions ===
|
||||
Most parser functions are supported, such as <code><nowiki>{{#expr:2 + 2}}</nowiki></code>. For more info, see https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions
|
||||
|
||||
=== Templates ===
|
||||
Templates are supported, such as <code><nowiki>{{my_template|arg_1|arg_2|etc...}}</nowiki></code>. For more info, see https://en.wikipedia.org/wiki/Help:A_quick_guide_to_templates
|
||||
|
||||
Here's a brief example:
|
||||
* Create a page called <code>Template:Test</code> with the text <code><nowiki>Hello, from Template:Test -- {{{1|empty}}}</nowiki></code>
|
||||
* Edit any other page (like the <code>Main_Page</code>) and enter <code><nowiki>{{Test|argument 1}}</nowiki></code> in the text box.
|
||||
* Preview or Save the page. You will see <code>Hello, from Template:Test -- argument 1</code>
|
||||
|
||||
=== Modules ===
|
||||
Modules are supported, such as <code><nowiki>{{#invoke:my_module|my_function|arg_1|arg_2|etc...}}</nowiki></code>. For more info, see https://en.wikipedia.org/wiki/Wikipedia:Lua
|
||||
|
||||
Here's a brief example:
|
||||
* Create a page called <code>Module:Test</code> with the following text
|
||||
<pre>
|
||||
local p = {}
|
||||
|
||||
function p.test( frame )
|
||||
return "Hello from Module:Test -- " .. frame.args[1];
|
||||
end
|
||||
|
||||
return p
|
||||
</pre>
|
||||
* Edit any other page (like the <code>Main_Page</code>) and enter <code><nowiki>{{#invoke:Test|test|argument 1}}</nowiki></code> in the text box.
|
||||
* Preview or Save the page. You will see <code>Hello from Module:Test -- argument 1</code>
|
||||
|
||||
== Developer editing ==
|
||||
<table class="metadata plainlinks ambox ambox-delete" style="">
|
||||
<tr>
|
||||
<td class="mbox-empty-cell">
|
||||
</td>
|
||||
<td class="mbox-text" style="">
|
||||
<span class="mbox-text-span">
|
||||
NOTE: The techniques in this section may change in future versions.
|
||||
|
||||
If you use any of the editing techniques here, please check back occasionally to see if anything has changed.
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
=== CSS ===
|
||||
XOWA stores the CSS for each wiki in <code>/xowa/user/anonymous/wiki/your_wiki_name/html</code>. For example, if you're on Windows and your wiki is named <code>test</code>, then the CSS would be at <code>C:\xowa\user\anonymous\wiki\test\html\xowa_common.css</code>
|
||||
|
||||
Note that the upper-lefthand icon is also stored there as <code>logo.png</code>
|
||||
|
||||
You can change these files and XOWA will not overwrite them. However, as with any file, please make sure you always keep backups.
|
||||
|
||||
=== Page template ===
|
||||
XOWA stores the page template in <code>/xowa/bin/any/xowa/cfg/app/xowa.gfs</code>. The actual template is marked in a section called <code>page_read</code>.
|
||||
|
||||
Please note the following about changing the page:
|
||||
* The file is replaced on every application update. If you make updates to the file, they will be lost.
|
||||
** If you find that you need to edit this file, please contact me, and I will add a feature to make it configurable in a future release. Really, these instructions are only provided for users who want to experiment.
|
||||
* The file uses a custom language specific to XOWA called gfs. Always backup the file when making changes. If you make an invalid change, XOWA will not start
|
||||
* The file is only loaded at application start. Any changes will require a restart of the app
|
||||
|
||||
=== Scripting ===
|
||||
XOWA allows custom hooks through Javascript or Lua. For detailed instructions see [[xowa.home:App/Xtn/Scripting]]
|
||||
|
||||
== Keyboard shortcuts ==
|
||||
For a full list, see [[xowa.home:Special:XowaCfg?grp=xowa.gui.shortcuts]]
|
||||
{|class='wikitable'
|
||||
|-
|
||||
| <b>Alt + Shift + E</b> || Edit the page. Switches to edit mode
|
||||
|-
|
||||
| <b>Ctrl + S</b> || Quick save the page. Stays in edit mode
|
||||
|-
|
||||
| <b>Alt + Shift + P</b> || Preview the page. Stays in edit mode
|
||||
|-
|
||||
| <b>Alt + Shift + S</b> || Save the page. Switches to read mode
|
||||
|-
|
||||
| <b>Ctrl + F</b> || Find text in the page
|
||||
|-
|
||||
|
|
||||
<b>Ctrl + L</b> or <br/>
|
||||
<b>Alt + D</b> || Focus the URL bar
|
||||
|-
|
||||
| <b>Ctrl + T</b> || New tab
|
||||
|-
|
||||
| <b>Ctrl + Tab</b> || Switch to next tab
|
||||
|-
|
||||
| <b>Ctrl + Shift + Tab</b> || Switch to previous tab
|
||||
|-
|
||||
| <b>Ctrl + W</b> || Close tab
|
||||
|}
|
||||
|
||||
== Useful links ==
|
||||
* Wikipedia's guide for editing: https://en.wikipedia.org/wiki/Help:Getting_started
|
||||
* XOWA page on personal wikis: [[xowa.home:App/Personal wikis]]
|
||||
* XOWA help page: [[xowa.home:Help/Contents|Contents page]]
|
||||
|
||||
== Notes ==
|
||||
<references/>
|
||||
@@ -0,0 +1,12 @@
|
||||
.cur_head_text {
|
||||
width: calc(100% - 40px);
|
||||
}
|
||||
.cur_head_btns {
|
||||
width: 40px;
|
||||
}
|
||||
|
||||
.domain_name {
|
||||
display: inline-block;
|
||||
width: calc(100% - 64px);
|
||||
padding: 0px 0px 0px 10px;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
(function (xo) {
|
||||
xo.wiki_directory = new function() {
|
||||
this.send = function(proc, args) {
|
||||
try {
|
||||
xo.server.send_by_bridge('wiki.directory.list', proc, args);
|
||||
} catch (err) {
|
||||
alert(err);
|
||||
}
|
||||
}
|
||||
|
||||
this.import_wiki = function() {
|
||||
try {
|
||||
// call xowa to launch file_dialog
|
||||
var url = xowa_exec('scripts_exec', 'app.gui.kit.ask_file("Please select an .xowa file", "*.xowa");');
|
||||
if (url == null || url == '') return; // nothing selected; exit
|
||||
|
||||
xo.notify.elem_anchor = '#main_body';
|
||||
xo.wiki_directory.send('import_wiki', {'url':url});
|
||||
} catch (err) {
|
||||
alert(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
}(window.xo = window.xo || {}));
|
||||
@@ -0,0 +1,34 @@
|
||||
<div id='cur_help_div' class='xohelp_div'>
|
||||
<div id='cur_help_msg' class='xohelp_msg'>
|
||||
<b>Buttons</b>
|
||||
<div>
|
||||
<div class='xohelp_row'><span class='xoimg_help_x24 xoimg_list_add'> </span><span class='xohelp_row_text'>Create a new wiki</span></div>
|
||||
<div class='xohelp_row'><span class='xoimg_help_x24 xoimg_doc_import'> </span><span class='xohelp_row_text'>Import an existing wiki</span></div>
|
||||
<div class='xohelp_row'><span class='xoimg_help_x24 xoimg_doc_open'> </span><span class='xohelp_row_text'>Open the wiki</span></div>
|
||||
<div class='xohelp_row'><span class='xoimg_help_x24 xoimg_app_configure'> </span><span class='xohelp_row_text'>Configure wiki settings</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='main_body' id='main_body'>
|
||||
<div class='list_tbl'>
|
||||
<div class='xotbl_head_row'>
|
||||
<div class='xotbl_head_text cur_head_text'>List</div>
|
||||
<div class='xotbl_head_btns cur_head_btns'>
|
||||
<a class='xoimg_btn_x24 xoimg_list_add' title='add a new wiki' href='/site/home/wiki/Special:XowaWikiItem'> </a>
|
||||
<a class='xoimg_btn_x24 xoimg_doc_import' title='import an existing wiki' href='' onclick='return xo.wiki_directory.import_wiki()' accesskey='i'> </a>
|
||||
<a class='xoimg_btn_x24 xoimg_help_tip' title='view help' href='javascript:void(0)' onclick='return xo.help.toggle("cur")'> </a>
|
||||
</div>
|
||||
</div>
|
||||
{{#itms}}
|
||||
<div class="xotbl_data_row flex_div">
|
||||
<a class='domain_name ' title='open' href='/site/{{domain}}/wiki/{{mainpage}}'>{{name}}</a>
|
||||
<div>
|
||||
<a class='xoimg_btn_x24 xoimg_doc_open' title='open' href='/site/{{domain}}/wiki/{{mainpage}}'> </a>
|
||||
</div>
|
||||
<div>
|
||||
<a class='xoimg_btn_x24 xoimg_app_configure' title='configure' href='/site/home/wiki/Special:XowaWikiItem?domain={{domain}}'> </a>
|
||||
</div>
|
||||
</div>
|
||||
{{/itms}}
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,20 @@
|
||||
.cur_data_row {
|
||||
padding: 4px 0px 4px;
|
||||
}
|
||||
.cur_data_row label {
|
||||
display: inline-block;
|
||||
width: 120px;
|
||||
margin: 0px 4px 0px 10px;
|
||||
vertical-align: top !important; /* !important needed else label will default to bottom b/c of element.style */
|
||||
align-self: flex-start;
|
||||
-webkit-align-self: flex-start;
|
||||
|
||||
font-weight: bold;
|
||||
}
|
||||
.cur_data_row label::after {
|
||||
content: ":";
|
||||
}
|
||||
.cur_data_input {
|
||||
display: inline-block;
|
||||
width: calc(100% - 170px);
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
(function (xo) {
|
||||
xo.fulltext_indexer = new function() {
|
||||
this.send = function(proc, args) {
|
||||
try {xo.server.send_by_bridge('xowa.wiki.fulltext.indexer', proc, args);}
|
||||
catch (err) {alert(err);}
|
||||
}
|
||||
this.index = function() {
|
||||
try {
|
||||
var data =
|
||||
{ wikis: xo.elem.get_val_or_null('wikis_box')
|
||||
, ns_ids: xo.elem.get_val_or_null('ns_ids_box')
|
||||
, idx_opt: xo.elem.selectbox__selected_get("idx_opt")
|
||||
};
|
||||
xo.fulltext_indexer.send('index', data);
|
||||
document.getElementById('index_btn').focus();
|
||||
} catch (err) {
|
||||
alert(err);
|
||||
}
|
||||
}
|
||||
this.index_keydown = function(e) {
|
||||
if(e.keyCode === 13){
|
||||
e.preventDefault(); // Ensure it is only this code that runs
|
||||
xo.fulltext_indexer.index();
|
||||
}
|
||||
}
|
||||
this.status__note__recv = function(msg) {return xo.fulltext_indexer.status__note(JSON.parse(msg));}
|
||||
this.status__note = function(msg) {
|
||||
try {
|
||||
var note = msg.note;
|
||||
|
||||
xowa.js.doc.elem_append_above('note_last_div'
|
||||
, "<div style='width:100%'>"
|
||||
+ " <div>"
|
||||
+ note
|
||||
+ " </div>"
|
||||
+ "</div>"
|
||||
);
|
||||
} catch (err) {
|
||||
alert(err);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
this.status__prog__recv = function(msg) {return xo.fulltext_indexer.status__prog(JSON.parse(msg));}
|
||||
this.status__prog = function(msg) {
|
||||
try {
|
||||
var prog = msg.prog;
|
||||
|
||||
var prog_div = document.getElementById('prog_div');
|
||||
prog_div.textContent = prog;
|
||||
} catch (err) {
|
||||
alert(err);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}(window.xo = window.xo || {}));
|
||||
xo.notify.elem_anchor = '#main_div';
|
||||
document.getElementById("wikis_box").focus();
|
||||
xo.elem.selectbox__selected_set('idx_opt');
|
||||
@@ -0,0 +1,40 @@
|
||||
<!-- message div -->
|
||||
<div id='xo_msg_box' style='width:100%; color:red'> </div>
|
||||
|
||||
<!-- help div -->
|
||||
<div id='cur_help_div' class='xohelp_div'>
|
||||
<div id='cur_help_msg' class='xohelp_msg'>
|
||||
<div>
|
||||
<div class='xohelp_row'><span class='xoimg_help_x24 xoimg_media_play'> </span><span class='xohelp_row_text'>Run index</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- main div -->
|
||||
<div id='main_div' style='width:100%'>
|
||||
<div class='cur_data_row' style='height:40px'>
|
||||
<label style='vertical-align:middle'>Index</label>
|
||||
<input id='wikis_box' type='text' value='{{wikis}}' style='width:80%' onkeydown='xo.fulltext_indexer.index_keydown(event)' accesskey="m" placeholder='Enter a wiki domain (For example: en.wikipedia.org)'></input>
|
||||
<a class='xoimg_btn_x24 xoimg_media_play' title='index' href='javascript:void(0)' onclick='return xo.fulltext_indexer.index()' id='index_btn'> </a>
|
||||
<a class='xoimg_btn_x24 xoimg_help_tip' title='view help' href='javascript:void(0)' onclick='return xo.help.toggle("cur")'> </a>
|
||||
</div>
|
||||
<div class='cur_data_row'>
|
||||
<label style='vertical-align:middle'>Namespaces</label>
|
||||
<input id='ns_ids_box' type='text' value='{{ns_ids}}' style='width:80%' onkeydown='xo.fulltext_indexer.index_keydown(event)' placeholder='Enter a list of namespaces to index (For example: 0|4|14)'></input>
|
||||
</div>
|
||||
<div class='cur_data_row'>
|
||||
<label style='vertical-align:middle'>Index options</label>
|
||||
<select id='idx_opt' name='idx_opt' size='4' data-select-selected='{{idx_opt}}'>
|
||||
<option value='d'>Documents</option>
|
||||
<option value='df'>Documents / Frequencies</option>
|
||||
<option value='dfp'>Documents / Frequencies / Positions</option>
|
||||
<option value='dfpo'>Documents / Frequencies / Positions / Offsets</option>
|
||||
</select>
|
||||
</div>
|
||||
<div id='status_div' style='width:100%'>
|
||||
<div id='prog_div'></div>
|
||||
<div id='note_div'>
|
||||
<div id='note_last_div'> </div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,191 @@
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* HELP */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
.xo_help_div {
|
||||
margin-left:6px
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* SEARCH */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
.xo_search_box {
|
||||
padding-right: 10px !important; /* DRD:else indicator will not be to far right */
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* OPTIONS */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
.xo_options_div {
|
||||
background-color:#f8f9fa; /* gray background */
|
||||
border:1px solid #c8ccd1; /* border */
|
||||
|
||||
/* margin / padding */
|
||||
margin-top:10px;
|
||||
margin-bottom:-8px;
|
||||
padding:4px;
|
||||
}
|
||||
.xo_options_divider {
|
||||
/* taken from mediawiki stylesheet via inspect element */
|
||||
clear: both;
|
||||
border-bottom: 1px solid #eaecf0;
|
||||
padding-top: 0.5em;
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
.xo_options_ul {
|
||||
/* remove bullet and margins */
|
||||
padding: 0;
|
||||
margin: 0 !important;
|
||||
list-style: none !important; /* DRD: !important to overide default element css */
|
||||
}
|
||||
.xo_options_ul > li > div > label {
|
||||
margin-left: 10px;
|
||||
width:120px;
|
||||
}
|
||||
.xo_options_ul .xo_options_ipt {
|
||||
width:calc(100% - 140px);
|
||||
}
|
||||
.xo_options_ul input {
|
||||
/* DRD:needed else will be gray */
|
||||
background-color:white;
|
||||
border:1px solid #ddd;
|
||||
padding:2px;
|
||||
}
|
||||
.xo_options_toggle_div {
|
||||
margin: 0px 4px 0px 4px;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* RESULTS:WIKI */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
.xo_results_wiki_div {
|
||||
background-color:rgb(187,187,255);
|
||||
padding:2px
|
||||
}
|
||||
.xo_results_wiki_toggle {
|
||||
margin:0 6px 0 6px;
|
||||
}
|
||||
.xo_results_wiki_paging_div {
|
||||
margin-left: 10px;
|
||||
}
|
||||
.xo_results_wiki_paging_btn {
|
||||
margin:0px 10px 0px 10px
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* RESULTS:PAGE */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
.xo_results_page_div {
|
||||
background-color:#d5ffd5;
|
||||
}
|
||||
.xo_results_page_toggle {
|
||||
margin:0 6px 0 8px;
|
||||
}
|
||||
.xo_results_page_ellipsis {
|
||||
align-self: flex-end;
|
||||
-webkit-align-self: flex-end;
|
||||
|
||||
display: inline-block;
|
||||
width: 16px; height: 13px; min-width: 16px; min-height: 13px; background-size: 16px 13px;
|
||||
background-repeat: no-repeat; background-position: center bottom;
|
||||
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* RESULTS:SNIP */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* add border between snips */
|
||||
.xo_results_snip_div:first-child {
|
||||
border-top: 1px solid #ddd;
|
||||
}
|
||||
.xo_results_snip_div {
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
.xo_results_line_num {
|
||||
align-self: flex-start; /* vertically align at top */
|
||||
-webkit-align-self: flex-start;
|
||||
margin:1px 7px 1px 11px; /* top/bottom to give some space around border; */
|
||||
|
||||
/* standardize code across platforms (from Chrome / inspect) */
|
||||
color: #000;
|
||||
background-color: #f8f9fa;
|
||||
border: 1px solid #eaecf0;
|
||||
border-radius: 2px;
|
||||
padding: 1px 4px;
|
||||
}
|
||||
.snip_highlight {
|
||||
font-weight: bold; /* emulate Special:Search */
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* PULSE */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
.search_cxl_pulse {
|
||||
animation: search_cxl_pulse 2s linear infinite;
|
||||
-ms-animation: search_cxl_pulse 2s linear infinite;
|
||||
-moz-animation: search_cxl_pulse 2s linear infinite;
|
||||
-webkit-animation: search_cxl_pulse 2s linear infinite;
|
||||
|
||||
/* make circle */
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
@keyframes "search_cxl_pulse" {
|
||||
0% {
|
||||
opacity: 1;
|
||||
background-color:rgba(0,255,0,1.0);
|
||||
}
|
||||
50% {
|
||||
opacity: .1;
|
||||
background-color:rgba(255,255,255,1.0);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
background-color:rgba(0,255,0,1.0);
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes search_cxl_pulse {
|
||||
0% {
|
||||
opacity: 1;
|
||||
background-color:rgba(0,255,0,1.0);
|
||||
}
|
||||
50% {
|
||||
opacity: .1;
|
||||
background-color:rgba(255,255,255,1.0);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
background-color:rgba(0,255,0,1.0);
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes "search_cxl_pulse" {
|
||||
0% {
|
||||
opacity: 1;
|
||||
background-color:rgba(0,255,0,1.0);
|
||||
}
|
||||
50% {
|
||||
opacity: .1;
|
||||
background-color:rgba(255,255,255,1.0);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
background-color:rgba(0,255,0,1.0);
|
||||
}
|
||||
}
|
||||
|
||||
@-ms-keyframes "search_cxl_pulse" {
|
||||
0% {
|
||||
opacity: 1;
|
||||
background-color:rgba(0,255,0,1.0);
|
||||
}
|
||||
50% {
|
||||
opacity: .1;
|
||||
background-color:rgba(255,255,255,1.0);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
background-color:rgba(0,255,0,1.0);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,453 @@
|
||||
(function (xo) {
|
||||
xo.fulltext_searcher = new function() {
|
||||
//{ SECTION:util
|
||||
this.send = function(proc, args) {
|
||||
args.page_guid = xo_page_guid;
|
||||
try {xo.server.send_by_bridge('xowa.wiki.fulltext.searcher', proc, args);}
|
||||
catch (err) {alert(err);}
|
||||
}
|
||||
|
||||
this.alerts_enabled = false;
|
||||
this.handle_err = function(s) {
|
||||
if (this.alerts_enabled) {
|
||||
alert(s);
|
||||
}
|
||||
else {
|
||||
console.log(s);
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
//{ SECTION:document.onload
|
||||
this.loaded = false;
|
||||
this.onload = function(evt) {
|
||||
// onload fires multiple times on drd; only run once
|
||||
if (this.loaded) return;
|
||||
this.loaded = true;
|
||||
|
||||
// init notify anchor; focus search_btn
|
||||
xo.notify.elem_anchor = '#main_div';
|
||||
xo.elem.get('search_txt').focus();
|
||||
|
||||
// run search
|
||||
var query = xo.elem.get_val_or_null('search_txt');
|
||||
if (query && query.length > 0) {
|
||||
this.search_run();
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
//{ SECTION:search_run
|
||||
this.search_is_running = false;
|
||||
this.search_run = function() {
|
||||
/*
|
||||
* runs search automatically when page is loaded
|
||||
* uses data from doc_elems...
|
||||
** visible; EX: search_txt
|
||||
** hidden; EX: qarg_wikis
|
||||
* Doc_elems are filled in when page is generated from...
|
||||
** query args; EX: &wikis=a|b
|
||||
** cfg; EX: xowa.addon.search.fulltext.special.show_all_snips
|
||||
|
||||
Note that code is involved b/c
|
||||
* need to have each search generate its own url b/c...
|
||||
** http_server
|
||||
** moving bwd / fwd through history)
|
||||
* want to minimize unnecessary qargs based on ...
|
||||
** implied scope; EX: &wikis=en.wikipedia.org when current wiki is en.wikipedia.org
|
||||
** cfg; EX: &show_all_snips=1
|
||||
*/
|
||||
try {
|
||||
// get search_text
|
||||
var search_text = xo.elem.get_val_or_null('search_txt');
|
||||
search_text = search_text.replace(/ /g, "_"); // replace " " with "_"; this replacement is done automatically in drd.WebView, but is done manually here with swt.swtbrowser for consistency
|
||||
|
||||
// get data specified by user
|
||||
var msg =
|
||||
{ search: xo.elem.get_val_or_null('search_txt')
|
||||
, cur_wiki: xo.elem.get_val_or_null('cur_wiki')
|
||||
};
|
||||
|
||||
// get data specified by qargs
|
||||
this.search_run__add_qarg_data(msg, this.qarg_keys);
|
||||
|
||||
// clear results; activate cancel; focus search box
|
||||
this.results__clear();
|
||||
this.search_cxl__show(true);
|
||||
xo.elem.get('search_btn').focus();
|
||||
|
||||
// send msg
|
||||
this.send('search_run', msg);
|
||||
this.search_is_running = true;
|
||||
} catch (err) {
|
||||
this.handle_err(err);
|
||||
}
|
||||
}
|
||||
this.search_run__add_qarg_data = function(msg, keys) {
|
||||
// adds qarg data to search_run msg
|
||||
var len = keys.length;
|
||||
for (var i = 0; i < len; i++) {
|
||||
var key = 'qarg_' + keys[i];
|
||||
msg[key] = xo.elem.get_val_or_null(key); // relies on msg.key == elem.id
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
//{ SECTION:search_redirect
|
||||
this.qarg_keys = ['wikis', 'ns_ids', 'limits', 'offsets', 'expand_pages', 'expand_snips', 'show_all_snips'];
|
||||
this.search_redirect = function() {
|
||||
// redirects to new search page with new query args when search is pressed
|
||||
try {
|
||||
// get search_text
|
||||
var search_text = xo.elem.get_val_or_null('search_txt');
|
||||
|
||||
// if search_text has changed, reset offsets; EX: on 21-40 of 'earth'; changing search to 'moon' should start from 1, not 21
|
||||
if (search_text !== xo.elem.get_val_or_null('qarg_search')) {
|
||||
xo.elem.get('qarg_offsets').value = '0';
|
||||
}
|
||||
|
||||
// build url
|
||||
var path_prefix = xowa.app.mode == 'http_server'
|
||||
? '/'
|
||||
: '/site/';
|
||||
var url = path_prefix + xo.elem.get_val_or_null('cur_wiki') + '/wiki/Special:XowaSearch?search=' + search_text;
|
||||
var len = this.qarg_keys.length;
|
||||
for (var i = 0; i < len; i++) {
|
||||
url = this.search_redirect__add_to_url(url, this.qarg_keys[i]);
|
||||
}
|
||||
|
||||
// redirect
|
||||
window.navigate_to(url);
|
||||
} catch (err) {
|
||||
this.handle_err(err);
|
||||
}
|
||||
}
|
||||
this.search_redirect__add_to_url = function(url, key) {
|
||||
// only add qarg to url if it's been specified by user
|
||||
// get qarg / dflt values
|
||||
var qarg_val = xo.elem.get_val_or_null('qarg_' + key);
|
||||
var dflt_val = xo.elem.get_val_or_null('dflt_' + key);
|
||||
|
||||
// if qarg === dflt, return url
|
||||
if (qarg_val === dflt_val) {
|
||||
return url;
|
||||
}
|
||||
// else, qarg changed; append it to url
|
||||
else {
|
||||
return url + '&' + key + '=' + qarg_val;
|
||||
}
|
||||
}
|
||||
this.search_keydown = function(e) {
|
||||
if(e.keyCode === 13){
|
||||
e.preventDefault(); // squash further notifications
|
||||
this.search_redirect();
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
//{ SECTION:search_cxl
|
||||
this.search_cxl = function() {
|
||||
if (this.search_is_running) {
|
||||
this.send('search_cxl', {page_guid: xo.elem.get_val_or_null('page_guid')});
|
||||
xo.elem.get('search_cxl_msg').style.display = 'block';
|
||||
}
|
||||
}
|
||||
this.search_cxl__show = function(show) {
|
||||
if (show) {
|
||||
xo.elem.get('search_cxl_btn').classList.add('search_cxl_pulse');
|
||||
}
|
||||
else {
|
||||
xo.elem.get('search_cxl_btn').classList.remove('search_cxl_pulse');
|
||||
xo.elem.get('search_cxl_msg').style.display = 'none';
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
//{ SECTION:paging
|
||||
this.paging_fwd = function(wiki) {this.paging_dir(wiki, true);}
|
||||
this.paging_bwd = function(wiki) {this.paging_dir(wiki, false);}
|
||||
this.paging_dir = function(wiki, fwd) {
|
||||
try {
|
||||
// get wiki_idx for wiki from qarg_wikis; needed for offset / limit; EX: wikis=a|b offsets=0|20
|
||||
var wiki_idx = -1;
|
||||
var qarg_wikis_str = xo.elem.get_val_or_null('qarg_wikis');
|
||||
var qarg_wikis_ary = qarg_wikis_str.split('|');
|
||||
var qarg_wikis_len = qarg_wikis_ary.length;
|
||||
for (var i = 0; i < qarg_wikis_len; i++) {
|
||||
var qarg_wiki = qarg_wikis_ary[i];
|
||||
if (wiki === qarg_wiki) {
|
||||
wiki_idx = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (wiki_idx == -1) {
|
||||
this.handle_err('could not find wiki_idx; wiki=' + wiki + ' qargs=' + qarg_wikis_str);
|
||||
return;
|
||||
}
|
||||
|
||||
// get offset / limit
|
||||
var limit = this.paging_dir__get_val_or_0th(wiki_idx, 'qarg_limits');
|
||||
var old_offset = this.paging_dir__get_val_or_0th(wiki_idx, 'qarg_offsets');
|
||||
|
||||
// calc new_offset
|
||||
var new_offset = old_offset + limit * (fwd ? 1 : -1);
|
||||
if (new_offset < 0) {
|
||||
new_offset = 0; // handle negative offsets; EX: old_offset=20 -> limit changed to 30 -> new_offset=-10 -> new_offset=0
|
||||
if (old_offset == 0) // ignore noops at BOS; EX: old_offset=0 -> limit changed to 30 -> new_offset = -30 -> new_offset=0 -> don't reload page since new_offset = old_offset
|
||||
return;
|
||||
}
|
||||
|
||||
// set it and redirect
|
||||
this.paging_dir__set_val('qarg_offsets', wiki_idx, qarg_wikis_len, new_offset);
|
||||
this.search_redirect();
|
||||
} catch (err) {
|
||||
this.handle_err(err);
|
||||
}
|
||||
}
|
||||
this.paging_dir__get_val_or_0th = function(wiki_idx, key) {
|
||||
// get ary; EX: offset=0|20
|
||||
var ary = xo.elem.get_val_or_null(key).split('|');
|
||||
var ary_len = ary.length;
|
||||
|
||||
// get nth val based on wiki_idx
|
||||
var rv = wiki_idx < ary_len
|
||||
? ary[wiki_idx] // nth exists; EX: wikis=a|b offsets=0 wiki=a -> wiki_idx=0 -> return i
|
||||
: ary[ary_len - 1] // nth missing; EX: wikis=a|b offsets=0 wiki=b -> wiki_idx=1 -> return nth
|
||||
;
|
||||
return parseInt(rv);
|
||||
}
|
||||
this.paging_dir__set_val = function(key, wiki_idx, wikis_len, val) {
|
||||
// get ary; EX: offset=0|20
|
||||
var ary = xo.elem.get_val_or_null(key).split('|');
|
||||
var ary_len = ary.length;
|
||||
var s = '';
|
||||
|
||||
// concat new_val by iterating over old_val
|
||||
for (var i = 0; i < wikis_len; i++) {
|
||||
var item = '';
|
||||
// item is cur_wiki; use it
|
||||
if (i == wiki_idx) {
|
||||
item = val.toString();
|
||||
}
|
||||
else {
|
||||
// item is other_wiki; use nth if available, or else 0th
|
||||
item = i < ary_len ? ary[i] : ary[0];
|
||||
}
|
||||
if (i != 0) s+= '|';
|
||||
s += item;
|
||||
}
|
||||
|
||||
// set new val
|
||||
var elem = document.getElementById(key);
|
||||
elem.value = s;
|
||||
}
|
||||
//}
|
||||
|
||||
//{ SECTION:results
|
||||
//{ SECTION:results_misc
|
||||
this.results__clear = function() {
|
||||
var elem = xo.elem.get('results_wikis');
|
||||
elem.innerHTML = "<div id='results_wikis_last'> </div>";
|
||||
}
|
||||
this.results__done__recv = function(msg) {return this.results__done(JSON.parse(msg));}
|
||||
this.results__done = function(msg) {
|
||||
this.search_cxl__show(false);
|
||||
this.search_is_running = false;
|
||||
return true;
|
||||
}
|
||||
//}
|
||||
|
||||
//{ SECTION:add procs
|
||||
this.results__wiki__add__recv = function(msg) {return this.results__wiki__add(JSON.parse(msg));}
|
||||
this.results__wiki__add = function(msg) {
|
||||
try {
|
||||
// set expand_pages vars
|
||||
var expand_pages = msg.expand_pages;
|
||||
msg.expand_pages_icon = expand_pages ? 'xoimg_toggle_hide' : 'xoimg_toggle_show';
|
||||
msg.expand_pages_style = expand_pages ? 'block' : 'none';
|
||||
|
||||
// create wiki-grp elem
|
||||
var div = xo.elem.make('results_wikis', 'div');
|
||||
xo.tmpl.fmt('xofts.wiki', div, msg);
|
||||
|
||||
// hide '(searching ###)' if lucene (only show for wikitext searches)
|
||||
if (msg.type_is_lucene) {
|
||||
elem = document.getElementById("results_wiki_" + msg.wiki + "_searched_div");
|
||||
elem.style.display = 'none';
|
||||
}
|
||||
} catch (err) {
|
||||
this.handle_err(err + " proc=results__wiki__add; msg=" + JSON.stringify(msg));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
this.results__page__add__recv = function(msg) {return this.results__page__add(JSON.parse(msg));}
|
||||
this.results__page__add = function(msg) {
|
||||
try {
|
||||
// get vars
|
||||
var wiki = msg.wiki;
|
||||
|
||||
// get vars for href.page
|
||||
var page_ttl = msg.page_ttl;
|
||||
msg.page_href = page_ttl.replace(/\'/g, '%27'); // escape apos, else will break "href=''"
|
||||
msg.page_name = page_ttl.replace(/_/g, " "); // replace _ for display purposes
|
||||
|
||||
// set expand_snips vars
|
||||
var expand_snips = msg.expand_snips;
|
||||
msg.expand_snips_icon = expand_snips ? 'xoimg_toggle_hide' : 'xoimg_toggle_show';
|
||||
msg.expand_snips_style = expand_snips ? 'block' : 'none';
|
||||
|
||||
// create wiki_div html
|
||||
var wiki_div_key = "results_wiki_" + wiki + "_content";
|
||||
// wiki_div sometimes doesn't exist when (a) XOWA-desktop is first starting; and (b) restoring a Search in 1st tab; if it doesn't exist, create it
|
||||
if (!xo.elem.get(wiki_div_key)) {
|
||||
this.results__wiki__add({wiki: wiki});
|
||||
}
|
||||
var div = xo.elem.make(wiki_div_key, 'div');
|
||||
xo.tmpl.fmt('xofts.page', div, msg);
|
||||
|
||||
// publish elem_add event for popups
|
||||
var page_elem_key = 'results_wiki_' + wiki + '_page_' + msg.page_id;
|
||||
var page_elem = xo.elem.get(page_elem_key);
|
||||
xo.elem.elem_add__pub(page_elem);
|
||||
} catch (err) {
|
||||
this.handle_err(err + " proc=results__page__add; msg=" + JSON.stringify(msg));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
this.results__line__add__recv = function(msg) {return this.results__line__add(JSON.parse(msg));}
|
||||
this.results__line__add = function(msg) {
|
||||
try {
|
||||
// make page_div key
|
||||
var wiki = msg.wiki;
|
||||
var page_id = msg.page_id;
|
||||
var div_key = 'results_wiki_' + wiki + '_page_' + page_id + '_content';
|
||||
|
||||
// generate html
|
||||
var div = xo.elem.make(div_key, 'div');
|
||||
xo.tmpl.fmt('xofts.snip', div, msg);
|
||||
} catch (err) {
|
||||
this.handle_err(err + " msg=" + JSON.stringify(msg));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
//}
|
||||
|
||||
//{ SECTION:update procs
|
||||
this.results__wiki__update__recv = function(msg) {return this.results__wiki__update(JSON.parse(msg));}
|
||||
this.results__wiki__update = function(msg) {
|
||||
try {
|
||||
elem = document.getElementById("results_wiki_" + msg.wiki + "_searched");
|
||||
elem.textContent = msg.searched;
|
||||
|
||||
} catch (err) {
|
||||
this.handle_err(err + " proc=results__wiki__update msg=" + JSON.stringify(msg));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
this.results__page__update__recv = function(msg) {return this.results__page__update(JSON.parse(msg));}
|
||||
this.results__page__update = function(msg) {
|
||||
try {
|
||||
var wiki = msg.wiki;
|
||||
var page_id = msg.page_id;
|
||||
var found = msg.found;
|
||||
var show_all_snips = msg.show_all_snips;
|
||||
|
||||
var elem = document.getElementById("results_wiki_" + wiki + "_page_" + page_id + "_found");
|
||||
elem.textContent = found;
|
||||
|
||||
if (found > 1 && !show_all_snips) {
|
||||
var elem = document.getElementById('results_wiki_' + wiki + '_page_' + page_id + '_rest');
|
||||
elem.style.display = 'initial';
|
||||
}
|
||||
} catch (err) {
|
||||
this.handle_err(err + " msg=" + JSON.stringify(msg));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
//}
|
||||
//}
|
||||
|
||||
//{ SECTION:snips_show_all
|
||||
this.snips_show_all = function(qry_id, wiki, page_id) {
|
||||
try {
|
||||
// hide snips_show_allbutton
|
||||
var elem = document.getElementById('results_wiki_' + wiki + '_page_' + page_id + '_rest');
|
||||
elem.style.display = 'none';
|
||||
|
||||
// always expand toggle_page indicator
|
||||
this.show_div
|
||||
( xo.elem.get('results_wiki_' + wiki + '_page_' + page_id + '_content')
|
||||
, xo.elem.get('results_wiki_' + wiki + '_page_' + page_id + '_img')
|
||||
, true
|
||||
);
|
||||
|
||||
// remove focus to button
|
||||
document.activeElement.blur();
|
||||
|
||||
// send message
|
||||
var data =
|
||||
{ qry_id: qry_id
|
||||
, wiki: wiki
|
||||
, page_id: page_id
|
||||
};
|
||||
this.send('snips_show_all', data);
|
||||
} catch (err) {
|
||||
this.handle_err(err);
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
//{ SECTION:options_save
|
||||
this.options_save = function() {
|
||||
try {
|
||||
this.send('options_save',
|
||||
{ 'expand_options': xo.elem.get('xo_options_list_container').style.display === 'block'
|
||||
});
|
||||
} catch (err) {
|
||||
this.handle_err(err);
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
//{ SECTION:toggle_div
|
||||
this.toggle_div = function(div_id, img_id) {
|
||||
var div_elem = document.getElementById(div_id);
|
||||
var img_elem = document.getElementById(img_id);
|
||||
var show = div_elem.style.display === "block";
|
||||
return this.show_div(div_elem, img_elem, !show);
|
||||
}
|
||||
this.show_div = function(div_elem, img_elem, show) {
|
||||
if (show) {
|
||||
div_elem.style.display = "block";
|
||||
img_elem.classList.remove("xoimg_toggle_show");
|
||||
img_elem.classList.add ("xoimg_toggle_hide");
|
||||
}
|
||||
else {
|
||||
div_elem.style.display = "none";
|
||||
img_elem.classList.remove("xoimg_toggle_hide");
|
||||
img_elem.classList.add ("xoimg_toggle_show");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
//}
|
||||
}
|
||||
}(window.xo = window.xo || {}));
|
||||
/*
|
||||
TOMBSTONE: onload does not work on droid where WM overrides onload
|
||||
if(window.onload) {
|
||||
var onload_old = window.onload;
|
||||
var onload_new = function(evt) {
|
||||
onload_old(evt);
|
||||
xo.fulltext_searcher.onload(evt);
|
||||
};
|
||||
window.onload = onload_new;
|
||||
} else {
|
||||
window.onload = xo.fulltext_searcher.onload;
|
||||
}
|
||||
*/
|
||||
window.onbeforeunload = function(event) {
|
||||
xo.fulltext_searcher.search_cxl();
|
||||
};
|
||||
setTimeout(function() { // wait for mustache to load files async
|
||||
xo.fulltext_searcher.onload({});
|
||||
}, 0); // was 400
|
||||
@@ -0,0 +1,236 @@
|
||||
<!-- help div -->
|
||||
{{#disabled}}
|
||||
<div>
|
||||
<p>Full-text search is not available</p>
|
||||
|
||||
<p>Please download a full-text search index for your wiki from Download Central</p>
|
||||
|
||||
<p>For more info, see <a href='http://xowa.org/home/wiki/App/Full-text_search/Lucene/Search_indexes/Getting'>http://xowa.org/home/wiki/App/Full-text_search/Lucene/Search_indexes/Getting</a></p>
|
||||
</div>
|
||||
{{/disabled}}
|
||||
{{^disabled}}
|
||||
<div class='xo_flex_div'>
|
||||
<div id='cur_help_div' class='xohelp_div'>
|
||||
<div id='cur_help_msg' class='xohelp_msg'>
|
||||
<b>Buttons</b>
|
||||
<div class='xohelp_row'><span class='xoimg_help_x24 xoimg_ellipsis' > </span><span class='xohelp_row_text'>Show all snips</b></span></div>
|
||||
<div class='xohelp_row'><span class='xoimg_help_x24 xoimg_misc_cancel'> </span><span class='xohelp_row_text'>Cancel search</b></span></div>
|
||||
<div class='xohelp_row'><span class='xoimg_help_x24 xoimg_toggle_show'> </span><span class='xohelp_row_text'>Expand section</b></span></div>
|
||||
<div class='xohelp_row'><span class='xoimg_help_x24 xoimg_toggle_hide'> </span><span class='xohelp_row_text'>Collapse section</b></span></div>
|
||||
<div class='xohelp_row'><span class='xoimg_help_x24 xoimg_paging_bwd' > </span><span class='xohelp_row_text'>Retrieve next page of results</b></span></div>
|
||||
<div class='xohelp_row'><span class='xoimg_help_x24 xoimg_paging_fwd' > </span><span class='xohelp_row_text'>Retrieve previous page of results</b></span></div>
|
||||
<b>Options</b>
|
||||
<div>
|
||||
<div class='xohelp_row'><span class='xohelp_bullet'> </span><span class='xohelp_row_text'><b>Wikis</b>: List wikis to search using a pipe (|) character; EX: <code>en.wikipedia.org|simple.wikipedia.org</code></span></div>
|
||||
<div class='xohelp_row'><span class='xohelp_bullet'> </span><span class='xohelp_row_text'><b>Namespaces</b>: List namespaces to search using a comma character; EX: <code>0,4</code> </span></div>
|
||||
<div class='xohelp_row'><span class='xohelp_bullet'> </span><span class='xohelp_row_text'><b>Results per page</b>: List number of results per page; EX: <code>50</code> </span></div>
|
||||
<div class='xohelp_row'><span class='xohelp_bullet'> </span><span class='xohelp_row_text'><b>Expand pages</b>: Expand pages sections when retrieving results. If 'n', pages will be collapsed; if 'y', pages will be expanded </span></div>
|
||||
<div class='xohelp_row'><span class='xohelp_bullet'> </span><span class='xohelp_row_text'><b>Expand snips</b>: Expand snips sections when retrieving results. If 'n', snips will be collapsed; if 'y', snips will be expanded </span></div>
|
||||
<div class='xohelp_row'><span class='xohelp_bullet'> </span><span class='xohelp_row_text'><b>Show all snips</b>: Show all snips when retrieving results. If 'n', only the first snip will show; if 'y', all snips will show</span></div>
|
||||
</div>
|
||||
<b>Advanced notes</b>
|
||||
<div style='margin-left:15px'>
|
||||
For multiple wikis, options can be specified per wiki using the pipe character.<br/>
|
||||
For example:<br/>
|
||||
* If <code>Wikis</code> is <code>en.wikipedia.org|simple.wikipedia.org</code><br/>
|
||||
* And <code>Results per page</code> is <code>20|10</code><br/>
|
||||
* Then <code>en.wikipedia.org</code> will retrieve <code>20</code> results per page and <code>simple.wikipedia.org</code> will retrieve <code>10</code> results per page
|
||||
</div>
|
||||
{{^app_is_drd}}
|
||||
For more info, see <a href='/site/home/wiki/App/Full-text_search'>App/Full-text_search</a>
|
||||
{{/app_is_drd}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- DIV:main -->
|
||||
<div id='search_cxl_msg' style='display:none'>
|
||||
Canceling. Please wait...
|
||||
</div>
|
||||
<div id='main_div'>
|
||||
<div class="xo_flex_div oo-ui-fieldLayout-field">
|
||||
|
||||
<!-- DIV:search_text -->
|
||||
<div
|
||||
id="searchText"
|
||||
class="xo_flex_div oo-ui-widget oo-ui-widget-enabled oo-ui-inputWidget oo-ui-iconElement oo-ui-textInputWidget oo-ui-textInputWidget-type-text oo-ui-indicatorElement mw-widget-titleWidget oo-ui-lookupElement mw-widget-titleInputWidget mw-widget-searchInputWidget oo-ui-textInputWidget-type-search"
|
||||
data-ooui="" aria-disabled="false"
|
||||
>
|
||||
<input
|
||||
id="search_txt"
|
||||
placeholder="Enter search words (For example: earth)"
|
||||
accesskey="m"
|
||||
onkeydown="xo.fulltext_searcher.search_keydown(event)"
|
||||
value="{{qarg_search}}"
|
||||
class="oo-ui-inputWidget-input xo_search_box"
|
||||
autocapitalize="off"
|
||||
|
||||
name="search"
|
||||
type="search"
|
||||
aria-disabled="false"
|
||||
tabindex="0"
|
||||
/>
|
||||
<span class="oo-ui-iconElement-icon oo-ui-icon-search xoimg_search"> </span>
|
||||
<span class="oo-ui-indicatorElement-indicator oo-ui-indicator-clear"> </span>
|
||||
</div>
|
||||
|
||||
<!-- DIV:search_btn -->
|
||||
<div
|
||||
class="xo_flex_div oo-ui-widget oo-ui-widget-enabled oo-ui-flaggedElement-progressive oo-ui-flaggedElement-primary oo-ui-inputWidget oo-ui-buttonElement oo-ui-buttonElement-framed oo-ui-labelElement oo-ui-buttonInputWidget"
|
||||
aria-disabled="false"
|
||||
>
|
||||
<button
|
||||
id="search_btn"
|
||||
onclick="return xo.fulltext_searcher.search_redirect()"
|
||||
class="oo-ui-inputWidget-input oo-ui-buttonElement-button"
|
||||
value="" aria-disabled="false" tabindex="0" type="submit"
|
||||
>
|
||||
<span class="oo-ui-iconElement-icon oo-ui-image-invert"> </span>
|
||||
<span class="oo-ui-labelElement-label">Search</span>
|
||||
<span class="oo-ui-indicatorElement-indicator oo-ui-image-invert"> </span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- DIV:search_cxl_btn -->
|
||||
<div class='xo_flex_div'>
|
||||
<div id="search_cxl_btn" style="opacity: 0.25;" class="xo_imgbtn_x24 xoimg_misc_cancel" title="cancel" onclick="xo.fulltext_searcher.search_cxl()"></div>
|
||||
</div>
|
||||
|
||||
<!-- DIV:help_btn -->
|
||||
<div class='xo_flex_div xo_help_div'>
|
||||
<span onclick='return xo.help.toggle("cur")' title="view help" class="xo_imgbtn_x20 xoimg_help_tip"> </span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- DIV:options_btn -->
|
||||
<div class="xo_options_div mw-search-profile-tabs">
|
||||
|
||||
<!-- DIV:options header -->
|
||||
<div class='xo_flex_div'>
|
||||
<div
|
||||
class='xo_options_toggle_div'
|
||||
onclick='xo.fulltext_searcher.toggle_div("xo_options_list_container", "xo_options_img"); xo.fulltext_searcher.options_save();'
|
||||
>
|
||||
<span
|
||||
id='xo_options_img'
|
||||
class='xo_imgbtn_x20 {{#expand_options}}xoimg_toggle_hide{{/expand_options}}{{^expand_options}}xoimg_toggle_show{{/expand_options}}'
|
||||
> </span>
|
||||
</div>
|
||||
<div class='xo_flex_text'>Options</div>
|
||||
|
||||
<div class='xo_flex_text'>
|
||||
|
||||
<a href='/wiki/Special:XowaCfg?grp=xowa.addon.fulltext_search' title='go to options page'>
|
||||
<span
|
||||
id='xo_options_cog'
|
||||
class='xo_imgbtn_x20 xoimg_cog'
|
||||
style='margin-left:10px'
|
||||
> </span>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- DIV:options list -->
|
||||
<div id='xo_options_list_container' class='xo_options_list_container' style='display:{{#expand_options}}block{{/expand_options}}{{^expand_options}}none{{/expand_options}}'>
|
||||
<div class='xo_options_divider'></div>
|
||||
<ul class='xo_options_ul'>
|
||||
<li>
|
||||
<div class='xo_flex_div'>
|
||||
<label>Wikis</label>
|
||||
<input
|
||||
type="text"
|
||||
onkeydown="xo.fulltext_searcher.search_keydown(event)"
|
||||
id="qarg_wikis"
|
||||
value="{{qarg_wikis}}"
|
||||
placeholder="Enter wikis separated by a pipe (For example: home|wiki.me.org)"
|
||||
autocapitalize="off"
|
||||
/>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class='xo_flex_div'>
|
||||
<label>Namespaces</label>
|
||||
<input
|
||||
type="text"
|
||||
onkeydown="xo.fulltext_searcher.search_keydown(event)"
|
||||
id="qarg_ns_ids"
|
||||
value="{{qarg_ns_ids}}"
|
||||
placeholder="Enter namespaces separated by a pipe (For example: 0|4)"
|
||||
/>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class='xo_flex_div'>
|
||||
<label>Results per page</label>
|
||||
<input
|
||||
type="text"
|
||||
onkeydown="xo.fulltext_searcher.search_keydown(event)"
|
||||
id="qarg_limits"
|
||||
value="{{qarg_limits}}"
|
||||
placeholder="Enter number of pages to show per search (For example: 100)"
|
||||
/>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class='xo_flex_div'>
|
||||
<label>Expand pages</label>
|
||||
<input
|
||||
type="text"
|
||||
onkeydown="xo.fulltext_searcher.search_keydown(event)"
|
||||
id="qarg_expand_pages"
|
||||
value="{{qarg_expand_pages}}"
|
||||
placeholder="Enter y to expand; n to collapse"
|
||||
autocapitalize="off"
|
||||
/>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class='xo_flex_div'>
|
||||
<label>Expand snips</label>
|
||||
<input
|
||||
type="text"
|
||||
onkeydown="xo.fulltext_searcher.search_keydown(event)"
|
||||
id="qarg_expand_snips"
|
||||
value="{{qarg_expand_snips}}"
|
||||
placeholder="Enter y to expand; n to collapse"
|
||||
autocapitalize="off"
|
||||
/>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class='xo_flex_div'>
|
||||
<label>Show all snips</label>
|
||||
<input
|
||||
type="text"
|
||||
onkeydown="xo.fulltext_searcher.search_keydown(event)"
|
||||
id="qarg_show_all_snips"
|
||||
value="{{qarg_show_all_snips}}"
|
||||
placeholder="Enter y to show all snips; n to show first only"
|
||||
autocapitalize="off"
|
||||
/>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- DIV:wikis_list -->
|
||||
<div id='results_wikis'></div>
|
||||
</div>
|
||||
|
||||
<!-- DIV:hidden inputs -->
|
||||
<div>
|
||||
<input type='hidden' id='page_guid' value='{{page_guid}}'></input>
|
||||
<input type='hidden' id='qarg_search' value='{{qarg_search}}'></input>
|
||||
<input type='hidden' id='qarg_offsets' value='{{qarg_offsets}}'></input>
|
||||
<input type='hidden' id='cur_wiki' value='{{cur_wiki}}'></input>
|
||||
<input type='hidden' id='dflt_wikis' value='{{dflt_wikis}}'></input>
|
||||
<input type='hidden' id='dflt_ns_ids' value='{{dflt_ns_ids}}'></input>
|
||||
<input type='hidden' id='dflt_limits' value='{{dflt_limits}}'></input>
|
||||
<input type='hidden' id='dflt_offsets' value='{{dflt_offsets}}'></input>
|
||||
<input type='hidden' id='dflt_expand_pages' value='{{dflt_expand_pages}}'></input>
|
||||
<input type='hidden' id='dflt_expand_snips' value='{{dflt_expand_snips}}'></input>
|
||||
<input type='hidden' id='dflt_show_all_snips' value='{{dflt_show_all_snips}}'></input>
|
||||
</div>
|
||||
{{/disabled}}
|
||||
@@ -0,0 +1,30 @@
|
||||
<div
|
||||
id='results_wiki_{{wiki}}_page_{{page_id}}'
|
||||
class='xo_flex_div;'
|
||||
>
|
||||
<!-- DIV:page results -->
|
||||
<div class='xo_flex_div xo_results_page_div'>
|
||||
|
||||
<!-- TOGGLE:page -->
|
||||
<span
|
||||
id="results_wiki_{{wiki}}_page_{{page_id}}_img"
|
||||
class='xo_imgbtn_x20 {{expand_snips_icon}} xo_results_page_toggle'
|
||||
onclick='xo.fulltext_searcher.toggle_div("results_wiki_{{wiki}}_page_{{page_id}}_content", "results_wiki_{{wiki}}_page_{{page_id}}_img"); return false;'
|
||||
> </span>
|
||||
|
||||
<!-- HREF:page -->
|
||||
<span class='xo_flex_div'><a href='/site/{{wiki}}/wiki/{{page_href}}'>{{page_name}}</a> (<span id='results_wiki_{{wiki}}_page_{{page_id}}_found'>{{found}}</span> found)</span>
|
||||
|
||||
<!-- BTN:get_snips -->
|
||||
<span
|
||||
id='results_wiki_{{wiki}}_page_{{page_id}}_rest'
|
||||
class='xoimg_ellipsis xo_results_page_ellipsis'
|
||||
onclick='xo.fulltext_searcher.snips_show_all("{{query_id}}", "{{wiki}}", "{{page_id}}");'
|
||||
style='display:none;'
|
||||
>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- DIV:SNIPS -->
|
||||
<div id='results_wiki_{{wiki}}_page_{{page_id}}_content' style='display:{{expand_snips_style}};'></div>
|
||||
@@ -0,0 +1,12 @@
|
||||
<div
|
||||
id='results_wiki_{{wiki}}_page_{{page_id}}_line_{{line}}'
|
||||
class='xo_flex_div xo_results_snip_div'
|
||||
>
|
||||
<!-- TEXT:line_num -->
|
||||
<div class='xo_results_line_num'>
|
||||
{{line}}
|
||||
</div>
|
||||
|
||||
<!-- TEXT:line_html -->
|
||||
<div>{{{html}}}</div>
|
||||
</div>
|
||||
@@ -0,0 +1,47 @@
|
||||
<div id='results_wiki_{{wiki}}'>
|
||||
<div class='xo_flex_div xo_results_wiki_div'>
|
||||
<!-- TOGGLE:wiki -->
|
||||
<span
|
||||
id="results_wiki_{{wiki}}_img"
|
||||
class='xo_imgbtn_x20 {{expand_pages_icon}} xo_results_wiki_toggle'
|
||||
onclick='xo.fulltext_searcher.toggle_div("results_wiki_{{wiki}}_content", "results_wiki_{{wiki}}_img");'
|
||||
> </span>
|
||||
|
||||
<!-- HREF:wiki -->
|
||||
<div class='xo_flex_div'>
|
||||
<a href='/site/{{wiki}}/wiki/'>{{wiki}}</a>
|
||||
<div
|
||||
id='results_wiki_{{wiki}}_searched_div'
|
||||
class='xo_flex_text'
|
||||
>(<span id='results_wiki_{{wiki}}_searched'>0</span> searched)
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- DIV:results -->
|
||||
<div class='xo_flex_div xo_results_wiki_paging_div'>
|
||||
|
||||
<!-- BTN:paging_bwd -->
|
||||
<span
|
||||
id="results_wiki_{{wiki}}_bwd"
|
||||
class='xo_imgbtn_x20 xoimg_paging_bwd xo_results_wiki_paging_btn'
|
||||
onclick='xo.fulltext_searcher.paging_bwd("{{wiki}}")'
|
||||
> </span>
|
||||
|
||||
<!-- TEXT:results; EX: "Results: 1 of 10" -->
|
||||
<div class='xo_flex_div'>
|
||||
Results: <div style='text-align:center;width:40px'>{{rng_bgn}}</div> - <div style='text-align:center;width:40px'>{{rng_end}}</div>
|
||||
</div>
|
||||
|
||||
<!-- BTN:paging_fwd -->
|
||||
<span
|
||||
id="results_wiki_{{wiki}}_fwd"
|
||||
class='xo_imgbtn_x20 xoimg_paging_fwd xo_results_wiki_paging_btn'
|
||||
onclick='xo.fulltext_searcher.paging_fwd("{{wiki}}")'
|
||||
> </span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- DIV:page list -->
|
||||
<div id='results_wiki_{{wiki}}_content' style='display:{{expand_pages_style}};'></div>
|
||||
</div>
|
||||
<div style='clear:both;display:none;'></div>
|
||||
38
res/bin/any/xowa/addon/wiki/import/bin/xow_import.css
vendored
Normal file
38
res/bin/any/xowa/addon/wiki/import/bin/xow_import.css
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
.cur_head_text {
|
||||
width: calc(100% - 72px);
|
||||
|
||||
/* handle long paths */
|
||||
font-size: 1em !important;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
.cur_head_btns {
|
||||
width: 72px;
|
||||
}
|
||||
.fsys_go_up_offset {
|
||||
margin-top: -4px; /* nudge icon up to align with help */
|
||||
}
|
||||
|
||||
.cur_data_row {
|
||||
height: 50px;
|
||||
}
|
||||
.cur_link_btn {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.fsys_dir_txt {
|
||||
display: inline-block;
|
||||
align-self: center;
|
||||
}
|
||||
.fsys_fil_txt {
|
||||
display: inline-block;
|
||||
align-self: center;
|
||||
}
|
||||
.fsys_meta_txt {
|
||||
display: block;
|
||||
color: #828282;
|
||||
font-family: monospace;
|
||||
font-size: .8em;
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
<div class='main_div'>
|
||||
<div id='cur_help_div' class='xohelp_div'>
|
||||
<div id='cur_help_msg' class='xohelp_msg'>
|
||||
<div>
|
||||
<b>Quick start</b>
|
||||
<div>
|
||||
<div class='xohelp_row'><span class='xohelp_bullet'> </span><span class='xohelp_row_text'>Navigate to the directory containing the XOWA wiki. For example, choose 'storage' -> 'CARD-NAME' -> 'xowa' -> 'wiki' -> 'en.wikipedia.org'</span></div>
|
||||
</div>
|
||||
<b>Buttons</b>
|
||||
<div>
|
||||
<div class='xohelp_row'><span class='xoimg_help_x24 xoimg_fsys_go_up'> </span><span class='xohelp_row_text'>Go up to the parent folder</span></div>
|
||||
{{#dir_cmd_exists}}
|
||||
<div class='xohelp_row'><span class='xoimg_help_x24 xoimg_misc_ok'> </span><span class='xohelp_row_text'>Select current folder</span></div>
|
||||
{{/dir_cmd_exists}}
|
||||
<div class='xohelp_row'><span class='xoimg_help_x24 xoimg_fsys_dir'> </span><span class='xohelp_row_text'>Open the folder</span></div>
|
||||
<div class='xohelp_row'><span class='xoimg_help_x24 xoimg_xowa'> </span><span class='xohelp_row_text'>Import the XOWA wiki</span></div>
|
||||
<div class='xohelp_row'><span class='xoimg_help_x24 xoimg_fsys_fil_blank'> </span><span class='xohelp_row_text'>Does nothing. Indicates the file is unselectable</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='xotbl_head_row'>
|
||||
<div class='xotbl_head_text cur_head_text'>{{path}}</div>
|
||||
<div class='xotbl_head_btns cur_head_btns'>
|
||||
<a class='xoimg_btn_x24 xoimg_fsys_go_up fsys_go_up_offset' href="/site/home/wiki/Special:XowaFileBrowser?path={{owner_dir_enc}}{{dir_cmd_arg}}"> </a>
|
||||
{{#dir_cmd_exists}}
|
||||
<a class='xoimg_btn_x24 xoimg_misc_ok fsys_go_up_offset' href="/site/home/wiki/Special:XowaFileBrowser?path={{path_enc}}{{dir_cmd_arg}}&selected=1"> </a>
|
||||
{{/dir_cmd_exists}}
|
||||
<a class='xoimg_btn_x24 xoimg_help_tip' href='javascript:void(0)' onclick='return xo.help.toggle("cur")' title='view help'> </a>
|
||||
</div>
|
||||
</div>
|
||||
{{#subs}}
|
||||
<div class='xotbl_data_row cur_data_row'>
|
||||
{{#is_dir}}
|
||||
<a
|
||||
class="link_btn_y cur_link_btn"
|
||||
href="/site/home/wiki/Special:XowaFileBrowser?path={{path_enc}}{{dir_cmd_arg}}"
|
||||
>
|
||||
<span class='xoimg_btn_x24 xoimg_fsys_dir'> </span>
|
||||
<span class='fsys_dir_txt'>{{name}}</span>
|
||||
</a>
|
||||
{{/is_dir}}
|
||||
{{^is_dir}}
|
||||
{{#is_core_xowa}}
|
||||
<a
|
||||
class="link_btn_y cur_link_btn"
|
||||
href='/site/home/wiki/Special:XowaWikis?cmd=add&file={{path_enc}}'
|
||||
>
|
||||
<span class='xoimg_btn_x24 xoimg_xowa'> </span>
|
||||
<span class='fsys_fil_txt'>
|
||||
<span>{{name}}</span>
|
||||
<span class='fsys_meta_txt'>{{date}} [{{size}}]</span>
|
||||
</span>
|
||||
</a>
|
||||
{{/is_core_xowa}}
|
||||
{{^is_core_xowa}}
|
||||
<div class="link_btn_n cur_link_btn">
|
||||
<span class='xoimg_btn_x24 xoimg_fsys_fil_blank'> </span>
|
||||
<span class='fsys_fil_txt'>
|
||||
<span>{{name}}</span>
|
||||
<span class='fsys_meta_txt'>{{date}} [{{size}}]</span>
|
||||
</span>
|
||||
</div>
|
||||
{{/is_core_xowa}}
|
||||
{{/is_dir}}
|
||||
</div>
|
||||
{{/subs}}
|
||||
</div>
|
||||
56
res/bin/any/xowa/addon/wiki/import/test/xow_import.test.html
Normal file
56
res/bin/any/xowa/addon/wiki/import/test/xow_import.test.html
Normal file
@@ -0,0 +1,56 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
|
||||
<!--
|
||||
NOTE: this page loads local files
|
||||
- Chrome is the easiest browser for local files; Use "chrome.exe --disable-web-security"
|
||||
- Change C:/xowa/ to wherever it is on your system
|
||||
-->
|
||||
<!-- base -->
|
||||
<base href="file:///C:/xowa/" target="_blank">
|
||||
|
||||
<!-- css -->
|
||||
<link type="text/css" rel="stylesheet" href="bin/any/xowa/html/res/lib/alertify/themes/alertify.core.css">
|
||||
<link type="text/css" rel="stylesheet" href="bin/any/xowa/html/res/lib/alertify/themes/alertify.bootstrap.css">
|
||||
<link type="text/css" rel="stylesheet" href="bin/any/xowa/html/res/src/xowa/xocss/core/xocss_core-0.0.1.css">
|
||||
<link type="text/css" rel="stylesheet" href="bin/any/xowa/html/res/src/xowa/xocss/core/xoimg_core-0.0.1.css">
|
||||
<link type="text/css" rel="stylesheet" href="bin/any/xowa/html/res/src/xowa/xocss/help/xohelp-0.0.1.css">
|
||||
<link type="text/css" rel="stylesheet" href="bin/any/xowa/addon/wiki/import/bin/xow_import.css">
|
||||
|
||||
<!-- js -->
|
||||
<script type="text/javascript" src="bin/any/xowa/html/res/lib/alertify/lib/alertify-0.3.11.js"></script>
|
||||
<script type="text/javascript" src="bin/any/xowa/html/res/lib/alertify/lib/xo-alertify-0.0.1.js"></script>
|
||||
<script type="text/javascript" src="bin/any/xowa/html/res/lib/mustache/mustache-2.2.1.js"></script>
|
||||
<script type="text/javascript" src="bin/any/xowa/html/res/lib/jquery/jquery-1.11.3.js"></script>
|
||||
<script type="text/javascript" src="bin/any/xowa/html/res/src/xowa/xocss/help/xohelp-0.0.1.js"></script>
|
||||
|
||||
<!-- mustache -->
|
||||
<script type="text/html" id="templates"></script>
|
||||
<script type="text/javascript">
|
||||
window.view = {
|
||||
path : '/storage/sdcard1/xowa/wiki/',
|
||||
owner_dir_enc : 'owner',
|
||||
subs:
|
||||
[
|
||||
{is_dir:true , is_core_xowa:false, path_enc: 'a', name:'en.wikipedia.org'},
|
||||
{is_dir:true , is_core_xowa:false, path_enc: 'b', name:'simple.wikipedia.org'},
|
||||
{is_dir:false, is_core_xowa:true , path_enc: 'c', name:'simple.wikipedia.org-file-user.xowa' , date:'2015-12-20', size:'56 KB'},
|
||||
{is_dir:false, is_core_xowa:false, path_enc: 'd', name:'simple.wikipedia.org-file-user1.xowa', date:'2015-12-20', size:'56 KB'},
|
||||
{is_dir:false, is_core_xowa:false, path_enc: 'd', name:'simple.wikipedia.org-file-user2.xowa', date:'2015-12-20', size:'56 KB'},
|
||||
{is_dir:false, is_core_xowa:false, path_enc: 'd', name:'simple.wikipedia.org-file-user3.xowa', date:'2015-12-20', size:'56 KB'},
|
||||
],
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
$("#templates").load("bin/any/xowa/addon/wiki/import/bin/xow_import.mustache.html", function(response_txt, status_txt, xhr){
|
||||
var template = response_txt;
|
||||
var output = Mustache.render(template, window.view);
|
||||
document.getElementById('main').innerHTML = output;
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="main"></div>
|
||||
</body>
|
||||
</html>
|
||||
28
res/bin/any/xowa/addon/wiki/registry/info/bin/xow_info.css
Normal file
28
res/bin/any/xowa/addon/wiki/registry/info/bin/xow_info.css
Normal file
@@ -0,0 +1,28 @@
|
||||
.cur_head_text {
|
||||
width: calc(100% - 83px);
|
||||
}
|
||||
.cur_head_btns {
|
||||
width: 72px;
|
||||
}
|
||||
|
||||
/* Detail Tbl */
|
||||
.cur_data_row {
|
||||
padding: 4px 0px 4px;
|
||||
}
|
||||
.cur_data_row label {
|
||||
display: inline-block;
|
||||
width: 50px;
|
||||
margin: 0px 4px 0px 10px;
|
||||
vertical-align: top;
|
||||
align-self: flex-start;
|
||||
-webkit-align-self: flex-start;
|
||||
|
||||
font-weight: bold;
|
||||
}
|
||||
.cur_data_row label::after {
|
||||
content: ":";
|
||||
}
|
||||
.cur_data_row span {
|
||||
display: inline-block;
|
||||
width: calc(100% - 70px);
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<div class='main_div'>
|
||||
{{#wiki_info}}
|
||||
<div id='cur_help_div' class='xohelp_div'>
|
||||
<div id='cur_help_msg' class='xohelp_msg'>
|
||||
<div>
|
||||
<div class='xohelp_row'><span class='xoimg_help_x24 xoimg_list_delete'> </span><span class='xohelp_row_text'>Delete the wiki and all its files</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='xotbl_head_row'>
|
||||
<div class='xotbl_head_text cur_head_text'>Details</div>
|
||||
<div class='xotbl_head_btns cur_head_btns'>
|
||||
<a class='xoimg_btn_x24 xoimg_list_delete' title='delete wiki' href='javascript:void(0)'
|
||||
data_alertify_msg='Are you sure you want to delete {{wiki_domain}}?<br/>({{wiki_size}} will be deleted!)'
|
||||
data_alertify_ok='Delete'
|
||||
data_alertify_cancel='Cancel'
|
||||
data_alertify_href='/site/home/wiki/Special:XowaWikiInfo?cmd=delete&wiki={{wiki_domain}}'
|
||||
onclick='return xo.alertify.confirm_href(this);'>
|
||||
</a>
|
||||
<a class='xoimg_btn_x24 xoimg_help_tip' title='view help' href='javascript:void(0)' onclick='return xo.help.toggle("cur")'> </a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="xotbl_data_row cur_data_row">
|
||||
<label>Wiki</label>
|
||||
<span>{{wiki_domain}}</span>
|
||||
</div>
|
||||
<div class="xotbl_data_row cur_data_row">
|
||||
<label>Date</label>
|
||||
<span>{{wiki_date}}</span>
|
||||
</div>
|
||||
<div class="xotbl_data_row cur_data_row">
|
||||
<label>Path</label>
|
||||
<span>{{wiki_dir}}</span>
|
||||
</div>
|
||||
<div class="xotbl_data_row cur_data_row">
|
||||
<label>Size</label>
|
||||
<span>{{wiki_size}}</span>
|
||||
</div>
|
||||
{{/wiki_info}}
|
||||
</div>
|
||||
@@ -0,0 +1,51 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
|
||||
<!--
|
||||
NOTE: this page loads local files
|
||||
- Chrome is the easiest browser for local files; Use "chrome.exe --disable-web-security"
|
||||
- Change C:/xowa/ to wherever it is on your system
|
||||
-->
|
||||
<!-- base -->
|
||||
<base href="file:///C:/xowa/" target="_blank">
|
||||
|
||||
<!-- css -->
|
||||
<link type="text/css" rel="stylesheet" href="bin/any/xowa/html/res/lib/alertify/themes/alertify.core.css">
|
||||
<link type="text/css" rel="stylesheet" href="bin/any/xowa/html/res/lib/alertify/themes/alertify.bootstrap.css">
|
||||
<link type="text/css" rel="stylesheet" href="bin/any/xowa/html/res/src/xowa/xocss/core/xocss_core-0.0.1.css">
|
||||
<link type="text/css" rel="stylesheet" href="bin/any/xowa/html/res/src/xowa/xocss/core/xoimg_core-0.0.1.css">
|
||||
<link type="text/css" rel="stylesheet" href="bin/any/xowa/html/res/src/xowa/xocss/help/xohelp-0.0.1.css">
|
||||
<link type="text/css" rel="stylesheet" href="bin/any/xowa/addon/wiki/registry/info/bin/xow_info.css">
|
||||
|
||||
<!-- js -->
|
||||
<script type="text/javascript" src="bin/any/xowa/html/res/lib/alertify/lib/alertify-0.3.11.js"></script>
|
||||
<script type="text/javascript" src="bin/any/xowa/html/res/lib/alertify/lib/xo-alertify-0.0.1.js"></script>
|
||||
<script type="text/javascript" src="bin/any/xowa/html/res/lib/mustache/mustache-2.2.1.js"></script>
|
||||
<script type="text/javascript" src="bin/any/xowa/html/res/lib/jquery/jquery-1.11.3.js"></script>
|
||||
<script type="text/javascript" src="bin/any/xowa/html/res/src/xowa/xocss/help/xohelp-0.0.1.js"></script>
|
||||
|
||||
<!-- mustache -->
|
||||
<script type="text/html" id="templates"></script>
|
||||
<script type="text/javascript">
|
||||
window.view = {
|
||||
wiki_info :
|
||||
{
|
||||
wiki_domain : 'en.wikipedia.org'
|
||||
, wiki_date : '2016-06-01'
|
||||
, wiki_dir : 'C:\\xowa\\wiki\\en.wikipedia.org'
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
$("#templates").load("bin/any/xowa/addon/wiki/registry/info/bin/xow_info.mustache.html", function(response_txt, status_txt, xhr){
|
||||
var template = response_txt;
|
||||
var output = Mustache.render(template, window.view);
|
||||
document.getElementById('main').innerHTML = output;
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="main"></div>
|
||||
</body>
|
||||
</html>
|
||||
29
res/bin/any/xowa/addon/wiki/registry/list/bin/xow_list.css
Normal file
29
res/bin/any/xowa/addon/wiki/registry/list/bin/xow_list.css
Normal file
@@ -0,0 +1,29 @@
|
||||
/* head row */
|
||||
.cur_head_text {
|
||||
width: calc(100% - 113px);
|
||||
}
|
||||
.cur_head_btns {
|
||||
width: 112px;
|
||||
}
|
||||
|
||||
/* wiki row */
|
||||
.cur_data_row {
|
||||
height: 44px;
|
||||
width: 100%;
|
||||
}
|
||||
.wiki_link_btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: calc(100% - 36px);
|
||||
height: 100%;
|
||||
}
|
||||
.wiki_domain {
|
||||
display: inline-block;
|
||||
width: calc(100% - 136px);
|
||||
}
|
||||
.wiki_date {
|
||||
display: inline-block;
|
||||
width: 100px;
|
||||
|
||||
text-align: center;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<div class='main_div'>
|
||||
<div id='cur_help_div' class='xohelp_div'>
|
||||
<div id='cur_help_msg' class='xohelp_msg'>
|
||||
<div>
|
||||
<div class='xohelp_row'><span class='xoimg_help_x24 xoimg_fsys_dir'> </span><span class='xohelp_row_text'>Import wikis from your device or SD card using a file browser</span></div>
|
||||
<div class='xohelp_row'><span class='xoimg_help_x24 xoimg_inet_download'> </span><span class='xohelp_row_text'>Download wikis from archive.org</span></div>
|
||||
<div class='xohelp_row'><span class='xoimg_help_x24 xoimg_xowa'> </span><span class='xohelp_row_text'>Open the wiki and go to its Main Page</span></div>
|
||||
<div class='xohelp_row'><span class='xoimg_help_x24 xoimg_help_info'> </span><span class='xohelp_row_text'>View more information about the wiki</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='xotbl_head_row'>
|
||||
<div class='xotbl_head_text cur_head_text'>Wikis</div>
|
||||
<div class='xotbl_head_btns cur_head_btns'>
|
||||
<a class='xoimg_btn_x24 xoimg_fsys_dir' title='add wiki' href="/wiki/Special:XowaFileBrowser?path={{import_root}}"> </a>
|
||||
<a class='xoimg_btn_x24 xoimg_inet_download' title='download' href="/wiki/Special:XowaDownloadCentral"> </a>
|
||||
<a class='xoimg_btn_x24 xoimg_help_tip' title='view help' href='javascript:void(0)' onclick='return xo.help.toggle("cur")'> </a>
|
||||
</div>
|
||||
</div>
|
||||
{{#subs}}
|
||||
<div class="xotbl_data_row cur_data_row">
|
||||
<a class="link_btn_y wiki_link_btn" href="/site/{{domain}}/wiki/">
|
||||
<span class='xoimg_btn_x24 xoimg_xowa'> </span>
|
||||
<span class='wiki_domain'>{{domain}}</span>
|
||||
<span class='wiki_date'>{{date}}</span>
|
||||
</a>
|
||||
<a class='xoimg_btn_x24 xoimg_help_info' href="/wiki/Special:XowaWikiInfo?wiki={{domain}}" title="info"> </a>
|
||||
</div>
|
||||
{{/subs}}
|
||||
</div>
|
||||
@@ -0,0 +1,51 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
|
||||
<!--
|
||||
NOTE: this page loads local files
|
||||
- Chrome is the easiest browser for local files; Use "chrome.exe --disable-web-security"
|
||||
- Change C:/xowa/ to wherever it is on your system
|
||||
-->
|
||||
<!-- base -->
|
||||
<base href="file:///C:/xowa/" target="_blank">
|
||||
|
||||
<!-- css -->
|
||||
<link type="text/css" rel="stylesheet" href="bin/any/xowa/html/res/lib/alertify/themes/alertify.core.css">
|
||||
<link type="text/css" rel="stylesheet" href="bin/any/xowa/html/res/lib/alertify/themes/alertify.bootstrap.css">
|
||||
<link type="text/css" rel="stylesheet" href="bin/any/xowa/html/res/src/xowa/xocss/core/xocss_core-0.0.1.css">
|
||||
<link type="text/css" rel="stylesheet" href="bin/any/xowa/html/res/src/xowa/xocss/core/xoimg_core-0.0.1.css">
|
||||
<link type="text/css" rel="stylesheet" href="bin/any/xowa/html/res/src/xowa/xocss/help/xohelp-0.0.1.css">
|
||||
<link type="text/css" rel="stylesheet" href="bin/any/xowa/addon/wiki/registry/list/bin/xow_list.css">
|
||||
|
||||
<!-- js -->
|
||||
<script type="text/javascript" src="bin/any/xowa/html/res/lib/alertify/lib/alertify-0.3.11.js"></script>
|
||||
<script type="text/javascript" src="bin/any/xowa/html/res/lib/alertify/lib/xo-alertify-0.0.1.js"></script>
|
||||
<script type="text/javascript" src="bin/any/xowa/html/res/lib/mustache/mustache-2.2.1.js"></script>
|
||||
<script type="text/javascript" src="bin/any/xowa/html/res/lib/jquery/jquery-1.11.3.js"></script>
|
||||
<script type="text/javascript" src="bin/any/xowa/html/res/src/xowa/xocss/help/xohelp-0.0.1.js"></script>
|
||||
|
||||
<!-- mustache -->
|
||||
<script type="text/html" id="templates"></script>
|
||||
<script type="text/javascript">
|
||||
window.view = {
|
||||
import_root:'/wiki/A',
|
||||
subs:
|
||||
[
|
||||
{date:'2016-03-06', domain:'en.wikipedia.org'},
|
||||
{date:'2016-03-05', domain:'simple.wikipedia.org'},
|
||||
],
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
$("#templates").load("bin/any/xowa/addon/wiki/registry/list/bin/xow_list.mustache.html", function(response_txt, status_txt, xhr){
|
||||
var template = response_txt;
|
||||
var output = Mustache.render(template, window.view);
|
||||
document.getElementById('main').innerHTML = output;
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="main"></div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user