From 93c667f039ffc19ed47e3eb381a3771e96c24711 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Sun, 28 Jun 2015 00:36:09 +0200 Subject: Add option to populate a gallery. If set, a new section of the given page is created with a gallery of the uploaded files. - add MediaWikiApi.appendToPage and MediaWikiInterface.addToGallery - require target file name to be set when calling MediaWikiInterface.uploadFile - calculate file name in MediaWikiExportServiceProvider.processRenderedPhotos insted of in ..., store it and pass it to MediaWikiInterface.addToGallery - add the gallery option to the export dialog in MediaWikiExportServiceProvider - update messages Fix #24. --- mediawiki.lrdevplugin/MediaWikiApi.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'mediawiki.lrdevplugin/MediaWikiApi.lua') diff --git a/mediawiki.lrdevplugin/MediaWikiApi.lua b/mediawiki.lrdevplugin/MediaWikiApi.lua index e54e973..3b1723d 100755 --- a/mediawiki.lrdevplugin/MediaWikiApi.lua +++ b/mediawiki.lrdevplugin/MediaWikiApi.lua @@ -175,6 +175,19 @@ function MediaWikiApi.getEditToken() return xml.tokens.edittoken end +function MediaWikiApi.appendToPage(page, section, text, comment) + local arguments = { + action = 'edit', + title = page, + section = 'new', + sectiontitle = section, + text = text, + summary = comment, + token = MediaWikiApi.getEditToken(), + } + MediaWikiApi.performRequest(arguments) +end + function MediaWikiApi.existsFile(fileName) local arguments = { action = 'query', -- cgit v1.2.1