f/******************************************************************************* This file uses the following conventions: - End of line character: char(10) (Unix style) - Encoding: UTF-8 (without Byte Order Mark) - Tabs: not supported - Word-wrap: not recommended DO NOT EDIT THIS FILE UNLESS INSTRUCTED The contents of this file are volatile and will change with each release. Any change you make below will be lost whenever you upgrade. If you want to make changes and preserve them between versions, add them to [[Options/Config_script]] However, the syntax itself is volatile, and future commands may be changed or deleted. There will be no backward compatibility. *******************************************************************************/ app.scripts.fail_if_unhandled = 'n'; /******************************************************************************* gui (bootup) ******************************************************************************** these values should be declared early (at the top of the file) ------------------------------------------------------------------------------*/ app.gui { kit = 'swt'; // 'swt' is the only supported value; should only be set once browser_type = 'mozilla'; // 'mozilla' or 'webkit' xul_runner_path = '~{<>bin_plat_dir<>}xulrunner'; // path should be set to xulrunner location; '~{<>bin_plat_dir<>}xulrunner' defaults to '/xowa/bin/platform_name/xulrunner' (EX: on Windows 'C:\xowa\bin\windows\xulrunner') } /******************************************************************************* files: apps ******************************************************************************** defines which apps open which files moved to /xowa/user/[USER]/app/cfg/os.gfs; DATE:2017-01-01 ------------------------------------------------------------------------------*/ app.scripts.run_file_by_type('xowa.user.os'); /******************************************************************************* files: ext_rules ******************************************************************************** - view_max: max size of file to be automatically downloaded when viewing page for most cases, alternate between 1 GB (always download) and 0 GB (never download) with the rules below, images are downloaded, but ogg, oga, ogv are not if you set oga, ogg, and ogv to 1 GB, then files of that type will be automatically downloaded when viewing the page. this will probably be a hindrance. - make_max: max size of file to be made during offline image building same as view max: use 1 GB and 0 GB these only apply to the offline image building process. they have no effect when viewing wiki articles. ------------------------------------------------------------------------------*/ app.files.ext_rules.set('img_only') { set('png' ) {make_max = '1 GB'; view_max = '1 GB';} set('jpg' ) {make_max = '1 GB'; view_max = '1 GB';} set('jpeg') {make_max = '1 GB'; view_max = '1 GB';} set('gif' ) {make_max = '1 GB'; view_max = '1 GB';} set('tif' ) {make_max = '1 GB'; view_max = '1 GB';} set('tiff') {make_max = '1 GB'; view_max = '1 GB';} set('svg' ) {make_max = '1 GB'; view_max = '1 GB';} set('djvu') {make_max = '0 GB'; view_max = '0 GB';} set('pdf' ) {make_max = '0 GB'; view_max = '0 GB';} set('mid' ) {make_max = '0 GB'; view_max = '0 GB';} set('oga' ) {make_max = '0 GB'; view_max = '0 GB';} set('ogg' ) {make_max = '0 GB'; view_max = '0 GB';} set('ogv' ) {make_max = '0 GB'; view_max = '0 GB';} set('webm') {make_max = '0 GB'; view_max = '0 GB';} set('' ) {make_max = '0 GB'; view_max = '0 GB';} // '' indicates all other files } /******************************************************************************* miscellaneous ******************************************************************************** ------------------------------------------------------------------------------*/ app.log { archive_dirs_max = 8; } app.sys_cfg.free_mem_when = '10 MB'; // empties cache when free memory is less than stated amount app.gui.html { auto_focus_id = ''; // id to auto-focus when page first loads; set to '' for no auto-focus or ' first_anchor' to focus first anchor (the non-conventional leading space is to create a unique key that would not collide with any valid ids) } /******************************************************************************* wiki init: commons ******************************************************************************** note that commons must always be set up (since other wikis refer to its repo) ------------------------------------------------------------------------------*/ /* defines repos across the application (app.files.repos) - each repo is defined with three arguments 1) key user-defined key EX: src_http_commons 2) path path to images EX: https://upload.wikimedia.org/wikipedia/commons/ 3) wiki_key name of wiki which has info on the file in its "File" namespace EX: commons.wikimedia.org - other attributes can be set on a repo fsys_: 'wnt' signifies that *, " and other invalid windows file characters in the wikimedia file name are replaced with _; necessary for windows; optional for other os's ext_rules: key to ext_rule set; see section below tarball: 'y' means that files are coming from extracted Wikimedia tarball on local hard-drive (as opposed to the online Wikimedia servers) */ app.files.repos { set('src_http_commons', 'https://upload.wikimedia.org/wikipedia/commons/' , 'commons.wikimedia.org' ).tid_('comm').ext_rules_('img_only'); //set('src_http_commons', 'W:\wikipedia\commons\' , 'commons.wikimedia.org').fsys_('wnt').tarball_('y').ext_rules_('img_only'); set('trg_file_commons', 'commons.wikimedia.org' , 'commons.wikimedia.org' ).tid_('comm').fsys_('wnt').primary_('y'); } /* defines repo-pairs for a wiki. (app.wikis.get('~{wiki_key}').files.repos) - each repo-pair is defined with two arguments 1) source_key repo_key indicating where the files are 2) target_get repo_key indicating where the files should be copied to */ app.wikis.get('commons.wikimedia.org').files.repos { add('src_http_commons', 'trg_file_commons'); } //app.wikis.get('en.wikipedia.org').files.cfg_download.redownload_('missing'); /******************************************************************************* dynamic wiki script: all wikis ******************************************************************************** builds a script that runs when a wiki is first initialized. Note that initialization occurs when the first article is retrieved from a wiki (i.e.: wiki initialization does not occur at application startup.) ------------------------------------------------------------------------------*/ app.wikis.scripts.set ( 'all_wikis' // user-defined key , 'wikipedia~wiktionary~wikisource~wikibooks~wikiversity~wikiquote~wikinews~wikivoyage~wikimedia~commons~meta~species~wikidata~wikimediafoundation~mediawiki~incubator~home~other' , /* actual script which is executed when a wiki initializes. Note the following parameter placeholders ~{wiki_key} name of the wiki EX: 'en.wikipedia.org' ~{wiki_type_name} type name of wiki EX: 'wikipedia' ~{wiki_lang} lang key of the wiki EX: 'en' */ <:[' app.wikis.get('~{wiki_key}') { files.cfg_download { // enabled = 'n'; // y=file download enabled; n=file download disabled redownload = 'none'; // none=never redownload file; missing=redownload file if file was missing before; all=redownload all files } user.name = 'Anonymous'; // set name for wiki user (appears in upper left hand corner of screen) } app.wikis.get('~{wiki_key}').html.portal { div_personal = <:["