[MediaWiki-commits] [Gerrit] mediawiki...Score[master]: Create hybrid-raw mode

2017-08-13 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/371211 )

Change subject: Create hybrid-raw mode
..


Create hybrid-raw mode

When a layout or midi block is added in a non-raw score tag, the
default should be overridden. This change makes it so before adding
the default blocks, the LY code is checked to see whether it already
contains the tags.

Bug: T49616
Change-Id: I7f0a4268c3834bf6ee91cbcec19592503f87da67
---
M Score.body.php
1 file changed, 14 insertions(+), 7 deletions(-)

Approvals:
  Brion VIBBER: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/Score.body.php b/Score.body.php
index 0a6517f..818d689 100644
--- a/Score.body.php
+++ b/Score.body.php
@@ -709,6 +709,19 @@
private static function embedLilypondCode( $lilypondCode ) {
$version = self::getLilypondVersion();
 
+   // Check if parameters have already been supplied (hybrid-raw 
mode)
+   $options = "";
+   if ( !strpos( $lilypondCode, "\\layout" ) ) {
+   $options .= "\\layout { }\n";
+   }
+   if ( !strpos( $lilypondCode, "\\midi" ) ) {
+   $options .= <
Gerrit-Reviewer: Brion VIBBER 
Gerrit-Reviewer: Ebe123 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Score[master]: Create hybrid-raw mode

2017-08-10 Thread Ebe123 (Code Review)
Ebe123 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/371211 )

Change subject: Create hybrid-raw mode
..

Create hybrid-raw mode

When a layout or midi block is added in a non-raw score tag, the
default should be overridden. This change makes it so before adding
the default blocks, the LY code is checked to see whether it already
contains the tags.

Bug: T49616
Change-Id: I7f0a4268c3834bf6ee91cbcec19592503f87da67
---
M Score.body.php
1 file changed, 14 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Score 
refs/changes/11/371211/1

diff --git a/Score.body.php b/Score.body.php
index 0a6517f..12620a8 100644
--- a/Score.body.php
+++ b/Score.body.php
@@ -709,6 +709,19 @@
private static function embedLilypondCode( $lilypondCode ) {
$version = self::getLilypondVersion();
 
+   // Check if parameters have already been supplied (hybrid-raw 
mode)
+   $options = "";
+   if ( strpos( $lilypondCode, '\\layout') !== true ) {
+   $options .= "\\layout { }\n";
+   }
+   if ( strpos( $lilypondCode, '\\midi') !== true ) {
+   $options .= <

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