Werdna has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/199591

Change subject: Make Parsoid work with multiwiki.
......................................................................

Make Parsoid work with multiwiki.

The implementation is not ideal: I could not figure out how to loop over 
defined wikis.
But at least VisualEditor now works on multiwiki setups

Change-Id: Ia553d4f8d7aa3cab53656755d119bd5d9d989295
---
M puppet/modules/mediawiki/templates/parsoid.localsettings.js.erb
M puppet/modules/role/templates/ve-config.php.erb
2 files changed, 18 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/91/199591/1

diff --git a/puppet/modules/mediawiki/templates/parsoid.localsettings.js.erb 
b/puppet/modules/mediawiki/templates/parsoid.localsettings.js.erb
index ec668d2..a9f626d 100644
--- a/puppet/modules/mediawiki/templates/parsoid.localsettings.js.erb
+++ b/puppet/modules/mediawiki/templates/parsoid.localsettings.js.erb
@@ -3,7 +3,23 @@
  * This file is managed by Puppet.
  */
 exports.setup = function( parsoidConfig ) {
-    parsoidConfig.setInterwiki( 'localhost', '<%= 
scope["mediawiki::server_url"] %>/w/api.php' );
+    <%-
+      # XXX: I wish I could think of a better way to do this
+      `alldbs`.split("\n").each do |db|
+        wikiname = db[0..-5]
+        if wikiname != '' then
+          # XXX I should be reading the resource config but I can't
+          # figure out how
+          server_url = 'http://' +
+            wikiname +
+            scope["mediawiki::multiwiki::base_domain"] +
+            scope["port_fragment"]
+        else
+          server_url = scope["mediawiki::server_url"]
+        end
+    -%>
+    parsoidConfig.setInterwiki( '<%=db%>', '<%=server_url%>/w/api.php' );
+    <%- end %>
     parsoidConfig.usePHPPreProcessor = <%= @use_php_preprocessor %>;
     parsoidConfig.useSelser = <%= @use_selser %>;
     <%- if @allow_cors -%>
diff --git a/puppet/modules/role/templates/ve-config.php.erb 
b/puppet/modules/role/templates/ve-config.php.erb
index dac002b..74b6f6b 100644
--- a/puppet/modules/role/templates/ve-config.php.erb
+++ b/puppet/modules/role/templates/ve-config.php.erb
@@ -2,3 +2,4 @@
 $wgVisualEditorNamespaces = array( NS_MAIN, NS_USER );
 $wgDefaultUserOptions['visualeditor-enable'] = 1;
 $wgVisualEditorParsoidURL = 'http://localhost:<%= 
scope['mediawiki::parsoid::port'] %>';
+$wgVisualEditorParsoidPrefix = $wgDBname;

-- 
To view, visit https://gerrit.wikimedia.org/r/199591
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia553d4f8d7aa3cab53656755d119bd5d9d989295
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Werdna <agarr...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to