Coder Social home page Coder Social logo

Removing the sidebar about xowa HOT 4 CLOSED

GitterHubber avatar GitterHubber commented on September 16, 2024
Removing the sidebar

from xowa.

Comments (4)

gnosygnu avatar gnosygnu commented on September 16, 2024

Is there any config / setting in XOWA that can hide / remove the sidebar in Wikipedia from rendering in XOWA.

There isn't any setting now, but XOWA externalizes as many configurations as possible in its config files. The process is a bit complicated, but you should have full control.

In this case, you can edit the format in C:\xowa\bin\any\xowa\cfg\app\xowa.gfs . Note the following:

  • The file format is a homemade one specific to XOWA. I will change this to use Javascript / Mustache later, but for now, please bear with it.
  • This file is replaced with every release. If you make changes to it, you will need to update it after every release. You can also try to save your changes as an option under home/wiki/Help:Options/Config_script. If you're interested, let me know and I'll detail more.
  • You should make a backup of this file before you edit it so you can revert
  • The file is UTF-8 and UNIX style end-of-line characters. I'd recommend editing in Notepad++ or any other text-editor (just don't use Notepad)

With these disclaimers out of the way, please try the following:

  • Open up C:\xowa\bin\any\xowa\cfg\app\xowa.gfs
  • Search for page_read. Note that the next section is an HTML template
  • Search for the next occurence of <div id='mw-panel' class='noprint'>
  • Change this to something like <div id='mw-panel' class='noprint' style='display:none'>
  • Restart XOWA

You'll probably also want to tinker with the CSS files. Each wiki saves its css in C:\xowa\user\anonymous\wiki. For example, English Wikipedia is in C:\xowa\user\anonymous\wiki\en.wikipedia.org\html\en.wikipedia.org\html

Finally, you can always do the following to review changes

  • Open up a page
  • Click on "View HTML"
  • Copy and Paste the HTML to your text-editor
  • Save it as "C:\test.html"
  • Open it up in Firefox. The page should look exactly the same as it does in XOWA
  • Tinker with the look and feel, and make the changes to either xowa.gfs or the CSS

Hope this helps. Thanks.

from xowa.

GitterHubber avatar GitterHubber commented on September 16, 2024

Thanks for the detailed reply.

The <div id='mw-panel' class='noprint' style='display:none'>part worked well and the sidebar was removed however the content was still at its original position and there was a empty space on the left.

Apart from this I had to change the xowa_common.css, did a find for the following tags

#left-navigation
#mw-head-base
div#content
div#footer

and changed the left margin of each to 1em (it was 10 or 11em earlier)
margin-left: 1em;

and that scaled the content to fill into the empty space of the sidebar.

You can also try to save your changes as an option under home/wiki/Help:Options/Config_script. If you're interested, let me know and I'll detail more.

Would certainly be interested to know this.
Many thanks again.

from xowa.

gnosygnu avatar gnosygnu commented on September 16, 2024

Apart from this I had to change the xowa_common.css, did a find for the following tags

Cool. Thanks for documenting this.

You can also try to save your changes as an option under home/wiki/Help:Options/Config_script. If you're interested, let me know and I'll detail more.

Would certainly be interested to know this.

Sure, here are the steps:

  • Go to home/wiki/Help:Options/Config_script
  • Enter in text from the page_read section. See my example below. Note that this looks just like the xowa.gfs, except:
    • the wiki is specified as "en.wikipedia.org": app.wikis.get('en.wikipedia.org).html.article {
    • there is a closing } at the end
  • Click Save
  • Restart XOWA and go to any page in en.wikipedia.org

Basically, any "command" in xowa.gfs can be entered into the text box. Keep in mind that this feature is not guaranteed to be backward-compatible and will break someday in the future when I migrate gfs to javascript / mustache. This will probably not happen for at least several months, but it's something to be aware of.

Hope this helps.

app.wikis.get('en.wikipedia.org).html.article {
  page_read =
<:["
<!DOCTYPE html>
<html dir="~{page_lang_ltr}" class="client-js">
<head>
  <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
  <title>~{page_name} - XOWA</title>
  <link rel="shortcut icon" href="~{app_root_dir}bin/any/xowa/file/app.window/app_icon.png" />
  <link rel="stylesheet" href="~{html_css_common_path}" type="text/css">
  <link rel="stylesheet" href="~{html_css_wiki_path}" type="text/css">~{xowa_head}
  <link rel="stylesheet" href="~{app_root_dir}bin/any/xowa/html/res/src/xowa/find/xowa_find_html.css" type="text/css">
  <script src="~{app_root_dir}bin/any/xowa/html/res/src/xowa/find/xowa_find_html.js" type='text/javascript'></script>
  <style type="text/css">
    div#simpleSearch #searchButton,    
    div#simpleSearch #mw-searchButton {
      ~{<>lang.x_axis_end;<>}: 0;
      direction: ~{<>lang.dir_str;<>};
      z-index:initial;  /* reset z-index, else will show in front of popup; DATE:2015-07-31 */
    }    
    .new {!important; color:green;}
  </style>
</head>
<body class="mediawiki ~{page_lang_ltr} sitedir-~{page_lang_ltr} ~{page_body_cls} skin-vector action-submit vector-animateLayout"~{html_content_editable} spellcheck="false">
<div id="mw-page-base" class="noprint"></div>
<div id="mw-head-base" class="noprint"></div>
<div id="content" class="mw-body">~{page_indicators}~{page_pgbnr}
  <div id='xowa_err_div' class='xowa_err' style='display:none; color:red; white-space:pre; display:block; unicode-bidi:embed;'></div>~{page_heading}  
  <div id="bodyContent" class="mw-body-content">
    <div id="siteSub">From XOWA: the free, open-source, offline wiki application</div>
    <div id="contentSub" class="visible">~{page_content_sub}</div>~{page_jumpto}
    <div id="mw-content-text" lang="en" dir="~{page_lang_ltr}" class="mw-content-~{page_lang_ltr}">~{page_data}
      <div class="visualClear">
~{page_langs}<br/><br/>
        ~{page_modified_on_msg}
        <div style='float:right'>
          <ul style='-moz-column-count: 2; list-style:none;font-size:xx-small;'>
            <li>~{<>app.user.msgs.get('xowa-portal-version');<>}</li>
            <li>~{<>app.user.msgs.get('xowa-portal-build_time');<>}</li>
            <li>~{app_version}</li>
            <li>~{app_build_date}</li>
          </ul>
        </div>
        <br/>
      </div>
    </div>
  </div>
</div>

<div id="mw-head" class="noprint">
~{portal_div_personal}
~{portal_div_ns}
~{portal_div_view}
</div>

<div id='mw-panel' class='noprint' style='display:none'>
~{portal_div_logo}
~{portal_div_home}
~{portal_sidebar}
~{portal_div_xtn}
~{portal_div_wikis}
</div>
</body>
</html>
<!-- page_id=~{page_id} -->
"]:>
;
}

from xowa.

gnosygnu avatar gnosygnu commented on September 16, 2024

I'm going to mark this issue closed, as there are workarounds to remove the sidebar. Feel free to reopen if there are any further questions. Thanks.

from xowa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.