Bmansurov has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/379291 )

Change subject: Remove the option to render books using OCG
......................................................................

Remove the option to render books using OCG

Bug: T171956
Change-Id: I3b037b05bdab4cd821dcff25af597657f4c778ca
---
M extension.json
M i18n/en.json
M i18n/qqq.json
D resources/selection-two-col-ltr.svg
D resources/selection-two-col-rtl.svg
M src/ElectronPdfServiceHooks.php
M src/specials/SpecialElectronPdf.php
M tests/browser/features/support/pages/selectionscreen_page.rb
M tests/browser/features/support/step_definitions/selectionscreen.rb
9 files changed, 5 insertions(+), 141 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ElectronPdfService 
refs/changes/91/379291/1

diff --git a/extension.json b/extension.json
index 80a8415..bd8d460 100644
--- a/extension.json
+++ b/extension.json
@@ -69,12 +69,6 @@
                                                "ltr": 
"resources/selection-single-col-ltr.svg",
                                                "rtl": 
"resources/selection-single-col-rtl.svg"
                                        }
-                               },
-                               "two-column-image": {
-                                       "file": {
-                                               "ltr": 
"resources/selection-two-col-ltr.svg",
-                                               "rtl": 
"resources/selection-two-col-rtl.svg"
-                                       }
                                }
                        }
                }
diff --git a/i18n/en.json b/i18n/en.json
index a9dd83e..7381317 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -9,9 +9,7 @@
        "electronPdfService-special-page-headline": "Download as PDF",
        "electronPdfService-select-layout-header": "Select a layout",
        "electronPdfService-single-column-label": "Single column",
-       "electronPdfService-two-column-label": "Two column",
        "electronPdfService-single-column-desc": "Includes tables and 
infoboxes",
-       "electronPdfService-two-column-desc": "Without tables and infoboxes",
        "electronPdfService-download-button": "Download",
        "electronPdfService-sidebar-portlet-heading": "Print/export",
        "electronPdfService-sidebar-portlet-print-text": "Download as PDF",
@@ -21,4 +19,4 @@
        "electronPDFService-warning-message": "We have technical problems with 
the function we use to create PDFs. We unfortunately have to replace it. This 
affects the styling and features of the books function. For more information 
and feedback, visit the 
[https://www.mediawiki.org/wiki/Reading/Web/PDF_Functionality project page].",
        "electronPDFService-warning-leave-feedback": "Leave feedback",
        "electronPDFService-warning-read-more": "Read more"
-}
\ No newline at end of file
+}
diff --git a/i18n/qqq.json b/i18n/qqq.json
index a0bb61b..7bbee95 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -12,9 +12,7 @@
        "electronPdfService-special-page-headline": "Title for the special 
page.",
        "electronPdfService-select-layout-header": "Header for layout 
selection.",
        "electronPdfService-single-column-label": "Label for the single column 
option.",
-       "electronPdfService-two-column-label": "Label for the two column 
option.",
        "electronPdfService-single-column-desc": "Short description for the 
single column option.",
-       "electronPdfService-two-column-desc": "Short description for the two 
column option.",
        "electronPdfService-download-button": "Label for the download 
button.\n{{Identical|Download}}",
        "electronPdfService-sidebar-portlet-heading": "Title of the portlet in 
which the link is shown.\n\n{{Identical|Print/Export}}",
        "electronPdfService-sidebar-portlet-print-text": "Text of 
print-pdf-link in sidebar.",
diff --git a/resources/selection-two-col-ltr.svg 
b/resources/selection-two-col-ltr.svg
deleted file mode 100644
index d67711b..0000000
--- a/resources/selection-two-col-ltr.svg
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<svg width="85" height="101" viewBox="0 0 85 101" 
xmlns="http://www.w3.org/2000/svg"; xmlns:xlink="http://www.w3.org/1999/xlink";>
-    <title>
-        Group 9
-    </title>
-    <defs>
-        <rect id="path-1" width="79" height="95" rx="2"/>
-        <filter x="-50%" y="-50%" width="200%" height="200%" 
filterUnits="objectBoundingBox" id="filter-2">
-            <feOffset dy="1" in="SourceAlpha" result="shadowOffsetOuter1"/>
-            <feGaussianBlur stdDeviation="1.5" in="shadowOffsetOuter1" 
result="shadowBlurOuter1"/>
-            <feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0.213881341 0" in="shadowBlurOuter1"/>
-        </filter>
-    </defs>
-    <g id="Page-1" fill="none" fill-rule="evenodd">
-        <g id="tools-explained-copy-2" transform="translate(-823 -290)">
-            <g id="Group-7" transform="translate(805 276)">
-                <g id="Group-9" transform="translate(21 16)">
-                    <g id="Rectangle-3">
-                        <use fill="#000" filter="url(#filter-2)" 
xlink:href="#path-1"/>
-                        <use fill="#FFF" xlink:href="#path-1"/>
-                    </g>
-                    <g id="Group-2" opacity=".8" transform="translate(9 19)" 
fill="#C8CCD1">
-                        <path id="Rectangle-5" d="M0 0h39v5H0z"/>
-                        <g id="Group-5" transform="translate(1 16)">
-                            <path id="Rectangle-5-Copy" d="M0 0h26.329v2H0z"/>
-                            <path id="Rectangle-5-Copy-2" d="M0 
7h26.329v2H0z"/>
-                            <path id="Rectangle-5-Copy-3" d="M0 
14h26.329v2H0z"/>
-                            <path id="Rectangle-5-Copy-17" d="M0 
21h26.329v2H0z"/>
-                            <path id="Rectangle-5-Copy-18" d="M0 
28h26.329v2H0z"/>
-                            <path id="Rectangle-5-Copy-25" d="M0 
35h26.329v2H0z"/>
-                            <path id="Rectangle-5-Copy-26" d="M0 
42h26.329v2H0z"/>
-                        </g>
-                        <g id="Group-5-Copy" transform="translate(33 16)">
-                            <path id="Rectangle-5-Copy" d="M0 0h26.329v2H0z"/>
-                            <path id="Rectangle-5-Copy-2" d="M0 
7h26.329v2H0z"/>
-                            <path id="Rectangle-5-Copy-3" d="M0 
14h26.329v2H0z"/>
-                            <path id="Rectangle-5-Copy-17" d="M0 
21h26.329v2H0z"/>
-                            <path id="Rectangle-5-Copy-18" d="M0 
28h26.329v2H0z"/>
-                            <path id="Rectangle-5-Copy-25" d="M0 
35h26.329v2H0z"/>
-                            <path id="Rectangle-5-Copy-26" d="M0 
42h26.329v2H0z"/>
-                        </g>
-                    </g>
-                </g>
-            </g>
-        </g>
-    </g>
-</svg>
diff --git a/resources/selection-two-col-rtl.svg 
b/resources/selection-two-col-rtl.svg
deleted file mode 100644
index fde68ac..0000000
--- a/resources/selection-two-col-rtl.svg
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<svg xmlns="http://www.w3.org/2000/svg"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; width="85" height="101" viewBox="0 0 
85 101" id="svg2">
-    <title id="title4">
-        Group 9
-    </title>
-    <defs id="defs6">
-        <rect id="path-1" width="79" height="95" rx="2"/>
-        <filter x="-50%" y="-50%" width="200%" height="200%" 
filterUnits="objectBoundingBox" id="filter-2">
-            <feOffset dy="1" in="SourceAlpha" result="shadowOffsetOuter1" 
id="feOffset10"/>
-            <feGaussianBlur stdDeviation="1.5" in="shadowOffsetOuter1" 
result="shadowBlurOuter1" id="feGaussianBlur12"/>
-            <feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0.213881341 0" in="shadowBlurOuter1" id="feColorMatrix14"/>
-        </filter>
-    </defs>
-    <g id="Page-1" transform="matrix(-1 0 0 1 85 0)" fill="none" 
fill-rule="evenodd">
-        <g id="tools-explained-copy-2" transform="translate(-823 -290)">
-            <g id="Group-7" transform="translate(805 276)">
-                <g id="Group-9" transform="translate(21 16)">
-                    <g id="Rectangle-3">
-                        <use xlink:href="#path-1" id="use21" width="100%" 
height="100%" fill="#000" filter="url(#filter-2)"/>
-                        <use xlink:href="#path-1" id="use23" width="100%" 
height="100%" fill="#fff"/>
-                    </g>
-                    <g id="Group-2" transform="translate(9 19)" opacity=".8" 
fill="#c8ccd1">
-                        <path id="Rectangle-5" d="M0 0h39v5H0z"/>
-                        <g id="Group-5" transform="translate(1 16)">
-                            <path id="Rectangle-5-Copy" d="M0 0h26.329v2H0z"/>
-                            <path id="Rectangle-5-Copy-2" d="M0 
7h26.329v2H0z"/>
-                            <path id="Rectangle-5-Copy-3" d="M0 
14h26.329v2H0z"/>
-                            <path id="Rectangle-5-Copy-17" d="M0 
21h26.329v2H0z"/>
-                            <path id="Rectangle-5-Copy-18" d="M0 
28h26.329v2H0z"/>
-                            <path id="Rectangle-5-Copy-25" d="M0 
35h26.329v2H0z"/>
-                            <path id="Rectangle-5-Copy-26" d="M0 
42h26.329v2H0z"/>
-                        </g>
-                        <g id="Group-5-Copy" transform="translate(33 16)">
-                            <path id="path36" d="M0 0h26.329v2H0z"/>
-                            <path id="path38" d="M0 7h26.329v2H0z"/>
-                            <path id="path40" d="M0 14h26.329v2H0z"/>
-                            <path id="path42" d="M0 21h26.329v2H0z"/>
-                            <path id="path44" d="M0 28h26.329v2H0z"/>
-                            <path id="path46" d="M0 35h26.329v2H0z"/>
-                            <path id="path48" d="M0 42h26.329v2H0z"/>
-                        </g>
-                    </g>
-                </g>
-            </g>
-        </g>
-    </g>
-</svg>
diff --git a/src/ElectronPdfServiceHooks.php b/src/ElectronPdfServiceHooks.php
index 581090b..dfcceb0 100644
--- a/src/ElectronPdfServiceHooks.php
+++ b/src/ElectronPdfServiceHooks.php
@@ -98,14 +98,13 @@
                );
        }
 
-       private static function generateSelectionScreenLink( Title $title, 
$collectionUrl ) {
+       private static function generateSelectionScreenLink( Title $title ) {
                $specialPageTitle = SpecialPage::getTitleFor( 'ElectronPdf' );
 
                return $specialPageTitle->getLocalURL(
                        [
                                'page' => $title->getPrefixedText(),
-                               'action' => 'show-selection-screen',
-                               'coll-download-url' => $collectionUrl
+                               'action' => 'show-selection-screen'
                        ]
                );
        }
diff --git a/src/specials/SpecialElectronPdf.php 
b/src/specials/SpecialElectronPdf.php
index 193240b..d83c75d 100644
--- a/src/specials/SpecialElectronPdf.php
+++ b/src/specials/SpecialElectronPdf.php
@@ -27,9 +27,6 @@
                $request = $this->getRequest();
                $parts = ( $subPage === '' ) ? [] : explode( '/', $subPage, 2 );
                $page = trim( $request->getVal( 'page', isset( $parts[0] ) ? 
$parts[0] : '' ) );
-               $collectionDownloadUrl = trim(
-                       $request->getVal( 'coll-download-url', isset( $parts[0] 
) ? $parts[0] : '' )
-               );
 
                $title = Title::newFromText( $page );
                if ( $title === null ) {
@@ -50,23 +47,17 @@
                                $stats->increment( 
'electronpdf.actionsPerWiki.' . $dbName . '.' .  $action );
                                $this->redirectToElectron( $title );
                                return;
-                       case 'redirect-to-collection':
-                               $stats->increment( 'electronpdf.action.' . 
$action );
-                               $stats->increment( 
'electronpdf.actionsPerWiki.' . $dbName . '.' .  $action );
-                               $this->redirectToCollection( 
$collectionDownloadUrl );
-                               return;
                        default:
                                $stats->increment( 
'electronpdf.action.show-selection-screen' );
                                $stats->increment( 
'electronpdf.actionsPerWiki.' . $dbName . '.show-selection-screen' );
-                               $this->showRenderModeSelectionPage( $title, 
$collectionDownloadUrl );
+                               $this->showRenderModeSelectionPage( $title );
                }
        }
 
        /**
         * @param Title $title page to download as PDF
-        * @param string $collectionDownloadUrl URL to the download page of the 
Collection extension
         */
-       public function showRenderModeSelectionPage( Title $title, 
$collectionDownloadUrl ) {
+       public function showRenderModeSelectionPage( Title $title ) {
                $this->setHeaders();
 
                $out = $this->getOutput();
@@ -89,9 +80,7 @@
                                ->addClasses( [ 
'mw-electronPdfService-selection-body' ] )
                                ->appendContent(
                                        $this->getLabeledOptionField( 
'redirect-to-electron', 'single', true ),
-                                       $this->getLabeledOptionField( 
'redirect-to-collection', 'two' ),
                                        $this->getHiddenField( 'page', 
$title->getPrefixedText() ),
-                                       $this->getHiddenField( 
'coll-download-url', $collectionDownloadUrl ),
                                        new OOUI\ButtonGroupWidget( [
                                                'items' => [
                                                        new 
OOUI\ButtonInputWidget( [
@@ -240,22 +229,5 @@
                $this->getOutput()->redirect(
                        $this->getServiceUrl( $title )
                );
-       }
-
-       /**
-        * @param string $collectionDownloadUrl
-        */
-       private function redirectToCollection( $collectionDownloadUrl ) {
-               $queryString = parse_url(
-                       urldecode( $collectionDownloadUrl ),
-                       PHP_URL_QUERY
-               );
-               parse_str( $queryString, $params );
-               unset( $params['title'] );
-
-               $this->getOutput()->redirect( wfAppendQuery(
-                       SkinTemplate::makeSpecialUrl( 'Book' ),
-                       http_build_query( $params )
-               ) );
        }
 }
diff --git a/tests/browser/features/support/pages/selectionscreen_page.rb 
b/tests/browser/features/support/pages/selectionscreen_page.rb
index d2a1be0..7297478 100644
--- a/tests/browser/features/support/pages/selectionscreen_page.rb
+++ b/tests/browser/features/support/pages/selectionscreen_page.rb
@@ -3,6 +3,5 @@
 
   div(:selectionscreen_header, css: '.mw-electronPdfService-selection-header')
   radio_button(:singlecolumn_selection, css: 
'.mw-electronPdfService-selection-form [value=redirect-to-electron]')
-  radio_button(:twocolumn_selection, css: 
'.mw-electronPdfService-selection-form [value=redirect-to-collection]')
   button(:pdf_download_button, css: '.mw-electronPdfService-selection-form 
.oo-ui-buttonElement-button')
 end
diff --git a/tests/browser/features/support/step_definitions/selectionscreen.rb 
b/tests/browser/features/support/step_definitions/selectionscreen.rb
index ef05438..25019a5 100644
--- a/tests/browser/features/support/step_definitions/selectionscreen.rb
+++ b/tests/browser/features/support/step_definitions/selectionscreen.rb
@@ -5,7 +5,6 @@
 Then(/^Selection elements should be there$/) do
   on(SelectionScreenPage) do |page|
     expect(page.singlecolumn_selection_element.exists?).to be true
-    expect(page.twocolumn_selection_element.exists?).to be true
   end
 end
 
@@ -18,6 +17,5 @@
 Then(/^Single column option should be selected$/) do
   on(SelectionScreenPage) do |page|
     expect(page.singlecolumn_selection_element.attribute('checked')).to 
be_truthy
-    expect(page.twocolumn_selection_element.attribute('checked')).to be_falsey
   end
 end

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3b037b05bdab4cd821dcff25af597657f4c778ca
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ElectronPdfService
Gerrit-Branch: master
Gerrit-Owner: Bmansurov <bmansu...@wikimedia.org>

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

Reply via email to