Giter Club home page Giter Club logo

script.wikipedia's Introduction

Wikipedia Scripted Window

Create the following xml dialog in your skin

script-wikipedia.xml
<?xml version="1.0" encoding="UTF-8"?>
<window type="dialog">
    <defaultcontrol always="true">9902</defaultcontrol>
    <controls>
        <!-- CONTENT GOES HERE -->
    </controls>
</window>

Required Controls

ID Type Description
9901 label Title of the Wikipedia article
9902 list List of sections containing the table of contents. Scrolling the list changes text loaded in the section textbox 9903. Clicking a listitem opens a select dialog for page links in the section
9903 textbox Textbox with the text of the section focused in 9902
9904 textbox Creative commons attribution label. REQUIRED! You MUST display this text as per Wikipedia licensing requirements
9905 image Creative commons licence logo. The license logo is optional as long as you display the attribution label
61 scrollbar Page control for section textbox. Clicking the scrollbar will pop-up select dialog for page links in the section

Window Properties

Property Description
Window.Property(Backdrop) First result found on wikimedia commons for search term with landscape aspect. Not always accurate but can be useful to use in place of background fanart. This image is aliased to Window(Home).Property(Wikipedia.Backdrop) if you need to use it in a window underneath the dialog.
Window.Property(Image) If the current section has an image, the first image will be added to this property. Otherwise it gets the first image for the page
Window.Property(ImageText) The alt text for the image which is displayed on wikipedia for vision impaired users or when the image does not load

Changing Tag Formatting

HTML tag text formatting can be modified using a skin string.

Example: Change all <a href=> hyperlinks to red Skin.SetString(Wikipedia.Format.Link,[COLOR=red]{}[/COLOR])

The {} curly braces will be replaced with the text between the HTML tags

Skin String Affected HTML Tags
Wikipedia.Format.Link <a href=>
Wikipedia.Format.Bold <hx> <b> <th> and class:mw-headline
Wikipedia.Format.Emphasis <em> <i>
Wikipedia.Format.Superscript <sup>

Opening / Searching

RunScript(script.wikipedia,wikipedia=SEARCHTERM)

Searches wikipedia for the search term and provides a select dialog for user to select from results.

Optionally can add a tmdb_type=TYPE param to tailor the search for more relevant results
Optionally can add a xml_file=FILENAME param to use alternate skin template
Optionally can add a language=CODE param to set language with two letter ISO 639-1 code

Supported language codes: it de fr es en

RunScript(script.wikipedia,wikipedia=Alien,tmdb_type=movie,language=en)
RunScript(script.wikipedia,wikipedia=Chernobyl,tmdb_type=tv,language=en)
RunScript(script.wikipedia,wikipedia=Matt Smith,tmdb_type=person,language=en)

script.wikipedia's People

Contributors

jurialmunkey avatar olavinto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

jirkoun olavinto

script.wikipedia's Issues

Creative commons attribution label and licence logo issues

  1. When using a label control for the attribution label (ID=9904) the list (ID=9902) and image (Window.Property(Image)) won't display. Only a textbox works.
  2. Although the licence logo (ID=9905) is meant to be optional not displaying it causes the whole script to be empty.

Default language

Hello,

thank you for this simple, but great addon!
Would it be possible to add an entry in the add-on settings, which controls the default language?

Something like:
Default language 'english':
RunScript(script.wikipedia,wikipedia=Alien,tmdb_type=movie) --> returns result in english
RunScript(script.wikipedia,wikipedia=Alien,tmdb_type=movie,language=fr) --> returns result in french

Pass currently playing artist as search term

I am trying to pass the artist currently playing artist as search term in my keymap using

RunScript(script.wikipedia,wikipedia=$INFO[MusicPlayer.Artist])

which doesn't work, neither when I am in the music OSD nor on the home screen - what am I doing wrong?

Open keyboard to enter search-term

Is it possible to extend the add-on so that the virtual keyboard opens when you click on the addon icon resp. when you run the addon by calling it via RunScript(script.wikipedia) (or maybe something like RunScript(script.wikipedia, search=True))
, and after you entered a search term, the search is carried out?

[Bug] Close wikipedia dialog

I found a small bug. When I start wikipedia by pressing the button I created, a window opens with a selection of content that I want to select.
fffff
When I select content a wikipedia dialog opens.
ggffg
However, if I don't select anything but turn off the dialog that appears with a selection of content, the wikipedia window appears for a moment. It's actually like closing a wikipedia window that wasn't even open.
qqq

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.