All Projects → joakin → context-cards

joakin / context-cards

Licence: other
Wikipedia page previews for any site

Programming Languages

elm
856 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects
Makefile
30231 projects

Projects that are alternatives of or similar to context-cards

WikimediaUI-Style-Guide
Wikimedia Design Style Guide with user interface focus, authored by Wikimedia Foundation Design team.
Stars: ✭ 93 (+220.69%)
Mutual labels:  wikipedia, wikimedia
linkcount
Web program to see the number of links to a page in any Wikimedia project.
Stars: ✭ 26 (-10.34%)
Mutual labels:  wikipedia, wikimedia
pageviews
Pageviews Analysis tool for Wikimedia Foundation wikis
Stars: ✭ 95 (+227.59%)
Mutual labels:  wikipedia, wikimedia
DiscordWikiBot
Discord bot for Wikimedia projects and MediaWiki wiki sites
Stars: ✭ 30 (+3.45%)
Mutual labels:  wikipedia, wikimedia
Mediawiki
🌻 The collaborative editing software that runs Wikipedia. Mirror from https://gerrit.wikimedia.org/g/mediawiki/core. See https://mediawiki.org/wiki/Developer_access for contributing.
Stars: ✭ 2,752 (+9389.66%)
Mutual labels:  wikipedia, wikimedia
Spell4Wiki
Spell4Wiki is a mobile application to record and upload audio for Wiktionary words to Wikimedia commons. Also act as a Wiki-Dictionary.
Stars: ✭ 17 (-41.38%)
Mutual labels:  wikipedia, wikimedia
xtools
A suite of tools to analyze page, user and project data of MediaWiki websites
Stars: ✭ 78 (+168.97%)
Mutual labels:  wikipedia, wikimedia
ratewithscience
Rate things on arbitrary scales using big data and science!
Stars: ✭ 42 (+44.83%)
Mutual labels:  wikipedia
video-cut-tool
Wikimedia Tool to Trim Online Videos in Wikimedia Commons. https://commons.wikimedia.org/wiki/Commons:VideoCutTool
Stars: ✭ 27 (-6.9%)
Mutual labels:  wikimedia
photo-spider-scrapy
10 photo website spiders, 10 个国外图库的 scrapy 爬虫代码
Stars: ✭ 17 (-41.38%)
Mutual labels:  wikimedia
wikiapi
JavaScript MediaWiki API for node.js
Stars: ✭ 28 (-3.45%)
Mutual labels:  wikipedia
pageviews.js
A lightweight JavaScript client library for the Wikimedia Pageviews API for Wikipedia and various of its sister projects for Node.js and the browser.
Stars: ✭ 24 (-17.24%)
Mutual labels:  wikipedia
small-open-datasets
A collection of automatically-updated, ready-to-use and open-licensed datasets
Stars: ✭ 32 (+10.34%)
Mutual labels:  wikipedia
semantic-document-relations
Implementation, trained models and result data for the paper "Pairwise Multi-Class Document Classification for Semantic Relations between Wikipedia Articles"
Stars: ✭ 21 (-27.59%)
Mutual labels:  wikipedia
wikicrush
Processor scripts for Wikipedia dumps to crush them into a dense binary format that is easy to pathfind with.
Stars: ✭ 46 (+58.62%)
Mutual labels:  wikipedia
CiteUnseen
https://en.wikipedia.org/wiki/User:SuperHamster/CiteUnseen
Stars: ✭ 13 (-55.17%)
Mutual labels:  wikipedia
quickwiki
🌐 A Google Chrome extension that allows users to preview articles on Wikipedia and other wikis.
Stars: ✭ 18 (-37.93%)
Mutual labels:  wikipedia
whatis
WhatIs.this: simple entity resolution through Wikipedia
Stars: ✭ 18 (-37.93%)
Mutual labels:  wikipedia
TWLight
Library Card Platform for The Wikipedia Library
Stars: ✭ 55 (+89.66%)
Mutual labels:  wikipedia
Word2Vec-on-Wikipedia-Corpus
利用wikipedia中英文的語料訓練Word2vec模型
Stars: ✭ 18 (-37.93%)
Mutual labels:  wikipedia

Wikipedia Context Cards

Get Wikipedia page previews on any page!

English Wikipedia Vorticism preview

See some live examples at https://joakin.github.io/context-cards, or check our UI tests for examples of many previews.

How to use

Include the library in your page:

https://unpkg.com/context-cards/dist/context-cards.js

Mark some links with data-wiki-title and data-wiki-lang.

<ul>
  <li>
    <a href="#" data-wiki-lang="en" data-wiki-title="Cake">Cake</a>
  </li>
  <li>
    <a href="#" data-wiki-lang="ca" data-wiki-title="Pastís">Pastís</a>
  </li>
</ul>

Those links should show the previews now on hover and focus!

Right to left languages: previews and content

If you add a link with a language that is right to left, the preview content will automatically show up appropriately (example).

If the content of your page is right to left, and you have the dir attribute set on any of the parent elements of the link, or the link itself, then things should work fine by default, by positioning the card anchored to the bottom right of your link.

If you are doing something strange with your content and don't have those attributes, you can manually add dir="rtl" to the link and the card will work as intended.

Dynamic content

Sometimes you have content that loads later on the page, and is not there on DOMContentLoaded. If that is the case, you will need to tell context cards to refresh the links so that it can bind its interactions as needed.

When including the script in the page, context cards binds itself to window.ContextCards. If you need to tell it to refresh the links and search for new ones, you can call ContextCards.bindLinks(). That should appropriately bind the event handlers for the new links marked with the data attributes mentioned above.

Self hosting the script file

If you don't want to use a npm CDN like unpkg, you can always get the script file for the popups from the npm package after installing it, in the dist/context-cards.js file.

Another alternative is getting it from this git repo. The file you can include is always in dist/context-cards.js, and you can get it from the master branch, or from the git tags which match the npm versions.

Credits

Based on the original work on Extension:Popups.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].