Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
/**
* Name: GoogleSpreadsheet
* Author: Caburum
* Description: Allows intergration with Google Spreadsheets
*/
mw.hook('wikipage.content').add(function($content) {
if (!$content) return;
$content.find('.googlespreadsheet').each(function() {
var $this = $(this),
chartId = $this.attr('data-chart-oid');
$this.html($('<iframe>', {
src: 'https://docs.google.com/spreadsheets/d/e/' + encodeURIComponent($this.attr('data-spreadsheet-id')) +
(chartId ? ('/pubchart?format=interactive&oid=' + encodeURIComponent(chartId))
: ('/pubhtml?widget=' + encodeURIComponent($this.attr('data-widget') || true))),
css: {
width: 'inherit',
height: 'inherit',
border: 0,
},
}));
});
});