Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
  • 2 commits
  • 4 files changed
  • 0 commit comments
  • 2 contributors
Showing with 17 additions and 5 deletions.
  1. +4 −3 book/Refresh.php
  2. +8 −0 book/mediawiki.css
  3. +1 −0 http/templates/header.php
  4. +4 −2 utils/Api.php
View
7 book/Refresh.php
@@ -36,12 +36,13 @@ protected function getI18n() {
}
protected function getEpubCssWikisource() {
+ global $wsexportConfig;
+ $content = file_get_contents($wsexportConfig['basePath'] . '/book/mediawiki.css');
try {
- $content = $this->api->get('http://' . $this->lang . '.wikisource.org/w/index.php?title=MediaWiki:Epub.css&action=raw&ctype=text/css');
- if($content != '')
- $this->setTempFileContent('epub.css', $content);
+ $content .= "\n" . $this->api->get('http://' . $this->lang . '.wikisource.org/w/index.php?title=MediaWiki:Epub.css&action=raw&ctype=text/css');
} catch(Exception $e) {
}
+ $this->setTempFileContent('epub.css', $content);
}
protected function getAboutXhtmlWikisource() {
View
8 book/mediawiki.css
@@ -0,0 +1,8 @@
+/* images */
+div.floatright { float: right; clear: right; position: relative; margin: 0.5em 0 0.8em 1.4em; }
+div.floatleft { float: left; clear: left; position: relative; margin: 0.5em 1.4em 0.8em 0; }
+.center { width: 100%; text-align: center; }
+*.center * { margin-left: auto; margin-right: auto; }
+div.tright { float: right; clear: right; margin: 0.5em 0 0.8em 1.4em; }
+div.tleft { float: left; clear: left; margin: 0.5em 1.4em 0.8em 0; }
+.small { font-size: 94%; }
View
1 http/templates/header.php
@@ -1,3 +1,4 @@
+<?php header('Content-type: text/html; charset=UTF-8'); ?>
<!DOCTYPE html>
<html lang="en">
<head>
View
6 utils/Api.php
@@ -27,8 +27,10 @@ public function __construct($lang = '', $domainName = '') {
$this->domainName = $domainName;
} elseif($this->lang == 'www' || $this->lang == '') {
$this->domainName = 'wikisource.org';
+ $this->lang = '';
} elseif($this->lang == 'wikilivres') {
$this->domainName = 'www.wikilivres.info';
+ $this->lang = '';
} else {
$this->domainName = $this->lang . '.wikisource.org';
}
@@ -88,7 +90,7 @@ public function getPageAsync($curl_async, $title, $id, &$responses) {
*/
public function wrapPage($data, $id, &$responses) {
if ($data['http_code'] != 200) {
- throw new HttpException('HTTP error: ' . $id, $data['http_code']);
+ throw new HttpException('HTTP error ' . $data['http_code'] . ' with page ' . $id . ' that return: ' . htmlentities($data['content']), $data['http_code']);
}
$content = getXhtmlFromContent($this->lang, $data['content']);
$responses[$id] = $content;
@@ -119,7 +121,7 @@ public function getImageAsync($curl_async, $url, $id, &$responses) {
*/
public function endImage($data, $id, &$responses) {
if ($data['http_code'] != 200) {
- throw new HttpException('HTTP error: ' . $id, $data['http_code']);
+ throw new HttpException('HTTP error ' . $data['http_code'] . ' with image ' . $id . ' that return: ' . htmlentities($data['content']), $data['http_code']);
}
$content = $data['content'];
$responses[$id] = $content;

No commit comments for this range

Something went wrong with that request. Please try again.