1
0
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:
gnosygnu
2018-11-02 09:58:55 -04:00
parent a672fd8340
commit 5721913241
6057 changed files with 1156950 additions and 0 deletions

View File

@@ -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);
}

View File

@@ -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');

View File

@@ -0,0 +1,40 @@
<!-- message div -->
<div id='xo_msg_box' style='width:100%; color:red'>&nbsp;</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'>&nbsp;</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'>&nbsp;</a>
<a class='xoimg_btn_x24 xoimg_help_tip' title='view help' href='javascript:void(0)' onclick='return xo.help.toggle("cur")'>&nbsp;</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'>&nbsp;</div>
</div>
</div>
</div>

View File

@@ -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);
}
}

View File

@@ -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'>&nbsp;</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

View File

@@ -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' >&nbsp;</span><span class='xohelp_row_text'>Show all snips</b></span></div>
<div class='xohelp_row'><span class='xoimg_help_x24 xoimg_misc_cancel'>&nbsp;</span><span class='xohelp_row_text'>Cancel search</b></span></div>
<div class='xohelp_row'><span class='xoimg_help_x24 xoimg_toggle_show'>&nbsp;</span><span class='xohelp_row_text'>Expand section</b></span></div>
<div class='xohelp_row'><span class='xoimg_help_x24 xoimg_toggle_hide'>&nbsp;</span><span class='xohelp_row_text'>Collapse section</b></span></div>
<div class='xohelp_row'><span class='xoimg_help_x24 xoimg_paging_bwd' >&nbsp;</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' >&nbsp;</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'>&nbsp;</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'>&nbsp;</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'>&nbsp;</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'>&nbsp;</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'>&nbsp;</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'>&nbsp;</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">&nbsp;</span>
<span class="oo-ui-indicatorElement-indicator oo-ui-indicator-clear">&nbsp;</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">&nbsp;</span>
<span class="oo-ui-labelElement-label">Search</span>
<span class="oo-ui-indicatorElement-indicator oo-ui-image-invert">&nbsp;</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">&nbsp;</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}}'
>&nbsp;</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'
>&nbsp;</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}}

View File

@@ -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;'
>&nbsp;</span>
<!-- HREF:page -->
<span class='xo_flex_div'><a href='/site/{{wiki}}/wiki/{{page_href}}'>{{page_name}}</a>&nbsp;(<span id='results_wiki_{{wiki}}_page_{{page_id}}_found'>{{found}}</span>&nbsp;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;'
>&nbsp;
</span>
</div>
</div>
<!-- DIV:SNIPS -->
<div id='results_wiki_{{wiki}}_page_{{page_id}}_content' style='display:{{expand_snips_style}};'></div>

View File

@@ -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>

View File

@@ -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");'
>&nbsp;</span>
<!-- HREF:wiki -->
<div class='xo_flex_div'>
<a href='/site/{{wiki}}/wiki/'>{{wiki}}</a>&nbsp;
<div
id='results_wiki_{{wiki}}_searched_div'
class='xo_flex_text'
>(<span id='results_wiki_{{wiki}}_searched'>0</span>&nbsp;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}}")'
>&nbsp;</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}}")'
>&nbsp;</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>