-
Notifications
You must be signed in to change notification settings - Fork 306
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
04fc368
commit b306190
Showing
10 changed files
with
1,345 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
## Wikipedia Scripted Window | ||
Create the following xml dialog in your skin | ||
|
||
``` | ||
script-wikipedia.xml | ||
``` | ||
|
||
```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 | label | 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 | ||
|
||
``` | ||
RunScript(script.wikipedia,wikipedia=Alien,tmdb_type=movie) | ||
RunScript(script.wikipedia,wikipedia=Chernobyl,tmdb_type=tv) | ||
RunScript(script.wikipedia,wikipedia=Matt Smith,tmdb_type=person) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<addon id="script.wikipedia" | ||
version="0.0.4" | ||
name="Wikipedia" | ||
provider-name="jurialmunkey"> | ||
<requires> | ||
<import addon="xbmc.python" version="3.0.0"/> | ||
<import addon="script.module.beautifulsoup4" version="4.9.3" /> | ||
<import addon="script.module.jurialmunkey" version="0.1.1" /> | ||
</requires> | ||
<extension point="xbmc.python.script" library="resources/script.py" /> | ||
<extension point="xbmc.addon.metadata"> | ||
<summary lang="en_GB">Access Wikipedia via Kodi</summary> | ||
<description lang="en_GB">Access Wikipedia via Kodi</description> | ||
<license>GPL-3.0-or-later</license> | ||
<assets> | ||
<icon>icon.png</icon> | ||
<fanart>fanart.jpg</fanart> | ||
</assets> | ||
</extension> | ||
</addon> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions
27
script.wikipedia/resources/language/resource.language.en_gb/strings.po
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# XBMC Media Center language file | ||
# Addon Name: Skin Variables | ||
# Addon id: script.skinvariables | ||
# Addon Provider: jurialmunkey | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: XBMC-Addons\n" | ||
"Report-Msgid-Bugs-To: [email protected]\n" | ||
"POT-Creation-Date: 2014-10-26 17:05+0000\n" | ||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language-Team: LANGUAGE\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"Language: en\n" | ||
"Plural-Forms: nplurals=2; plural=(n != 1)\n" | ||
|
||
#: /resources/lib/api.py | ||
msgctxt "#32001" | ||
msgid "Text from Wikipedia under CC BY-SA 3.0 license." | ||
msgstr "" | ||
|
||
#: /resources/lib/api.py | ||
msgctxt "#32000" | ||
msgid "Unable to parse information in this section" | ||
msgstr "" |
Oops, something went wrong.