aboutsummaryrefslogtreecommitdiff
path: root/mediawiki.lrdevplugin/MediaWikiApi.lua
diff options
context:
space:
mode:
authorRobin Krahl <me@robin-krahl.de>2015-06-28 00:36:09 +0200
committerRobin Krahl <me@robin-krahl.de>2015-06-28 00:36:09 +0200
commit93c667f039ffc19ed47e3eb381a3771e96c24711 (patch)
tree98cf6b4a5f879db7046db69ed27fd46c7a1c022d /mediawiki.lrdevplugin/MediaWikiApi.lua
parenta673ab08731494f4541f2c9a70ccd3695b747624 (diff)
downloadLrMediaWiki-93c667f039ffc19ed47e3eb381a3771e96c24711.tar.gz
LrMediaWiki-93c667f039ffc19ed47e3eb381a3771e96c24711.tar.bz2
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.
Diffstat (limited to 'mediawiki.lrdevplugin/MediaWikiApi.lua')
-rwxr-xr-xmediawiki.lrdevplugin/MediaWikiApi.lua13
1 files changed, 13 insertions, 0 deletions
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',