Index: trunk/extensions/ProofreadPage/ProofreadPage.php |
— | — | @@ -32,10 +32,6 @@ |
33 | 33 | $wgSpecialPages['IndexPages'] = 'ProofreadPages'; |
34 | 34 | $wgSpecialPageGroups['IndexPages'] = 'pages'; |
35 | 35 | |
36 | | - |
37 | | -# Allows for extracting text from djvu files. To enable, set to 'djvutxt' or similar |
38 | | -$wgDjvutxt = null; |
39 | | - |
40 | 36 | # Bump the version number every time you change proofread.js |
41 | 37 | $wgProofreadPageVersion = 24; |
42 | 38 | |
— | — | @@ -1095,12 +1091,11 @@ |
1096 | 1092 | } |
1097 | 1093 | |
1098 | 1094 | |
1099 | | -/* preload Djvu Text */ |
| 1095 | +/* Preload text layer from multipage formats */ |
1100 | 1096 | function pr_preloadText( $textbox1, $mTitle ) { |
1101 | | - global $wgDjvuTxt; |
1102 | 1097 | |
1103 | 1098 | $page_namespace = pr_page_ns(); |
1104 | | - if ( $wgDjvuTxt && preg_match( "/^$page_namespace:(.*?)\/([0-9]*)$/", $mTitle->getPrefixedText(), $m ) ) { |
| 1099 | + if ( preg_match( "/^$page_namespace:(.*?)\/([0-9]*)$/", $mTitle->getPrefixedText(), $m ) ) { |
1105 | 1100 | $imageTitle = Title::makeTitleSafe( NS_IMAGE, $m[1] ); |
1106 | 1101 | if ( !$imageTitle ) { |
1107 | 1102 | return true; |
— | — | @@ -1108,14 +1103,11 @@ |
1109 | 1104 | |
1110 | 1105 | $image = wfFindFile( $imageTitle ); |
1111 | 1106 | if ( $image && $image->exists() ) { |
1112 | | - $mime = $image->getMimeType(); |
1113 | | - if( $mime == 'image/vnd.djvu' /*|| $mime == 'application/pdf'*/ ) { |
1114 | | - $text = $image->handler->getPageText($image, $m[2]); |
1115 | | - if ( $text ) { |
1116 | | - $text = preg_replace( "/(\\\\n)/", "\n", $text ); |
1117 | | - $text = preg_replace( "/(\\\\\d*)/", "", $text ); |
1118 | | - $textbox1 = $text; |
1119 | | - } |
| 1107 | + $text = $image->handler->getPageText($image, $m[2]); |
| 1108 | + if ( $text ) { |
| 1109 | + $text = preg_replace( "/(\\\\n)/", "\n", $text ); |
| 1110 | + $text = preg_replace( "/(\\\\\d*)/", "", $text ); |
| 1111 | + $textbox1 = $text; |
1120 | 1112 | } |
1121 | 1113 | } |
1122 | 1114 | } |