diff options
25 files changed, 465 insertions, 197 deletions
diff --git a/.travis.yml b/.travis.yml index 79eea48b7..93867162c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,4 +9,4 @@ notifications: - "chat.freenode.net#dokuwiki" on_success: change on_failure: change -script: cd _test && phpunit --stderr +script: cd _test && phpunit --verbose --stderr diff --git a/_test/core/TestRequest.php b/_test/core/TestRequest.php index 0a54910ed..060e37d28 100644 --- a/_test/core/TestRequest.php +++ b/_test/core/TestRequest.php @@ -44,13 +44,18 @@ class TestRequest { * @return TestResponse the resulting output of the request */ public function execute($uri='/doku.php') { + global $INPUT; + global $ID; + global $INFO; + // save old environment $server = $_SERVER; $session = $_SESSION; $get = $_GET; $post = $_POST; $request = $_REQUEST; - + $input = $INPUT; + // prepare the right URI $this->setUri($uri); @@ -74,6 +79,7 @@ class TestRequest { // now execute dokuwiki and grep the output header_remove(); ob_start('ob_start_callback'); + $INPUT = new Input(); include(DOKU_INC.$this->script); ob_end_flush(); @@ -89,6 +95,7 @@ class TestRequest { $_GET = $get; $_POST = $post; $_REQUEST = $request; + $INPUT = $input; return $response; } diff --git a/_test/tests/inc/httpclient_http.test.php b/_test/tests/inc/httpclient_http.test.php index 43dd4478f..3446e1184 100644 --- a/_test/tests/inc/httpclient_http.test.php +++ b/_test/tests/inc/httpclient_http.test.php @@ -1,15 +1,22 @@ <?php +require_once (__DIR__ . '/httpclient_mock.php'); + class httpclient_http_test extends DokuWikiTest { protected $server = 'http://httpbin.org'; + /** * @group internet */ function test_simpleget(){ - $http = new HTTPClient(); + $http = new HTTPMockClient(); $data = $http->get($this->server.'/get?foo=bar'); - $this->assertFalse($data === false, 'HTTP response'); + if($http->noconnection()) { + $this->markTestSkipped('connection timed out'); + return; + } + $this->assertFalse($data === false, 'HTTP response '.$http->error); $resp = json_decode($data, true); $this->assertTrue(is_array($resp), 'JSON response'); $this->assertArrayHasKey('args',$resp); @@ -20,9 +27,13 @@ class httpclient_http_test extends DokuWikiTest { * @group internet */ function test_dget(){ - $http = new HTTPClient(); + $http = new HTTPMockClient(); $data = $http->dget($this->server.'/get',array('foo'=>'bar')); - $this->assertFalse($data === false, 'HTTP response'); + if($http->noconnection()) { + $this->markTestSkipped('connection timed out'); + return; + } + $this->assertFalse($data === false, 'HTTP response '.$http->error); $resp = json_decode($data, true); $this->assertTrue(is_array($resp), 'JSON response'); $this->assertArrayHasKey('args',$resp); @@ -33,9 +44,13 @@ class httpclient_http_test extends DokuWikiTest { * @group internet */ function test_gzip(){ - $http = new HTTPClient(); + $http = new HTTPMockClient(); $data = $http->get($this->server.'/gzip'); - $this->assertFalse($data === false, 'HTTP response'); + if($http->noconnection()) { + $this->markTestSkipped('connection timed out'); + return; + } + $this->assertFalse($data === false, 'HTTP response '.$http->error); $resp = json_decode($data, true); $this->assertTrue(is_array($resp), 'JSON response'); $this->assertArrayHasKey('gzipped',$resp); @@ -46,9 +61,13 @@ class httpclient_http_test extends DokuWikiTest { * @group internet */ function test_simplepost(){ - $http = new HTTPClient(); + $http = new HTTPMockClient(); $data = $http->post($this->server.'/post',array('foo'=>'bar')); - $this->assertFalse($data === false, 'HTTP response'); + if($http->noconnection()) { + $this->markTestSkipped('connection timed out'); + return; + } + $this->assertFalse($data === false, 'HTTP response '.$http->error); $resp = json_decode($data, true); $this->assertTrue(is_array($resp), 'JSON response'); $this->assertArrayHasKey('form',$resp); @@ -59,9 +78,13 @@ class httpclient_http_test extends DokuWikiTest { * @group internet */ function test_redirect(){ - $http = new HTTPClient(); + $http = new HTTPMockClient(); $data = $http->get($this->server.'/redirect/3'); - $this->assertFalse($data === false, 'HTTP response'); + if($http->noconnection()) { + $this->markTestSkipped('connection timed out'); + return; + } + $this->assertFalse($data === false, 'HTTP response '.$http->error); $resp = json_decode($data, true); $this->assertTrue(is_array($resp), 'JSON response'); $this->assertArrayHasKey('url',$resp); @@ -72,9 +95,13 @@ class httpclient_http_test extends DokuWikiTest { * @group internet */ function test_relredirect(){ - $http = new HTTPClient(); + $http = new HTTPMockClient(); $data = $http->get($this->server.'/relative-redirect/3'); - $this->assertFalse($data === false, 'HTTP response'); + if($http->noconnection()) { + $this->markTestSkipped('connection timed out'); + return; + } + $this->assertFalse($data === false, 'HTTP response '.$http->error); $resp = json_decode($data, true); $this->assertTrue(is_array($resp), 'JSON response'); $this->assertArrayHasKey('url',$resp); @@ -85,9 +112,13 @@ class httpclient_http_test extends DokuWikiTest { * @group internet */ function test_redirectfail(){ - $http = new HTTPClient(); + $http = new HTTPMockClient(); $data = $http->get($this->server.'/redirect/5'); - $this->assertTrue($data === false, 'HTTP response'); + if($http->noconnection()) { + $this->markTestSkipped('connection timed out'); + return; + } + $this->assertTrue($data === false, 'HTTP response '.$http->error); $this->assertEquals('Maximum number of redirects exceeded',$http->error); } @@ -95,11 +126,19 @@ class httpclient_http_test extends DokuWikiTest { * @group internet */ function test_cookies(){ - $http = new HTTPClient(); + $http = new HTTPMockClient(); $http->get($this->server.'/cookies/set/foo/bar'); + if($http->noconnection()) { + $this->markTestSkipped('connection timed out'); + return; + } $this->assertEquals(array('foo' => 'bar'), $http->cookies); $data = $http->get($this->server.'/cookies'); - $this->assertFalse($data === false, 'HTTP response'); + if($http->noconnection()) { + $this->markTestSkipped('connection timed out'); + return; + } + $this->assertFalse($data === false, 'HTTP response '.$http->error); $resp = json_decode($data, true); $this->assertTrue(is_array($resp), 'JSON response'); $this->assertArrayHasKey('cookies',$resp); @@ -110,9 +149,13 @@ class httpclient_http_test extends DokuWikiTest { * @group internet */ function test_teapot(){ - $http = new HTTPClient(); + $http = new HTTPMockClient(); $data = $http->get($this->server.'/status/418'); - $this->assertTrue($data === false, 'HTTP response'); + if($http->noconnection()) { + $this->markTestSkipped('connection timed out'); + return; + } + $this->assertTrue($data === false, 'HTTP response '.$http->error); $this->assertEquals(418,$http->status); } @@ -120,18 +163,26 @@ class httpclient_http_test extends DokuWikiTest { * @group internet */ function test_maxbody(){ - $http = new HTTPClient(); + $http = new HTTPMockClient(); $http->max_bodysize = 250; // this should abort completely $data = $http->get($this->server.'/stream/30'); - $this->assertTrue($data === false, 'HTTP response'); + if($http->noconnection()) { + $this->markTestSkipped('connection timed out'); + return; + } + $this->assertTrue($data === false, 'HTTP response '.$http->error); // this should read just the needed bytes $http->max_bodysize_abort = false; $http->keep_alive = false; $data = $http->get($this->server.'/stream/30'); - $this->assertFalse($data === false, 'HTTP response'); + if($http->noconnection()) { + $this->markTestSkipped('connection timed out'); + return; + } + $this->assertFalse($data === false, 'HTTP response '.$http->error); /* should read no more than max_bodysize+1 */ $this->assertLessThanOrEqual(251,strlen($data)); } @@ -140,24 +191,36 @@ class httpclient_http_test extends DokuWikiTest { * @group internet */ function test_maxbodyok(){ - $http = new HTTPClient(); + $http = new HTTPMockClient(); $http->max_bodysize = 500*1024; $data = $http->get($this->server.'/stream/5'); - $this->assertTrue($data !== false, 'HTTP response'); + if($http->noconnection()) { + $this->markTestSkipped('connection timed out'); + return; + } + $this->assertTrue($data !== false, 'HTTP response '.$http->error); $http->max_bodysize_abort = false; $data = $http->get($this->server.'/stream/5'); - $this->assertTrue($data !== false, 'HTTP response'); + if($http->noconnection()) { + $this->markTestSkipped('connection timed out'); + return; + } + $this->assertTrue($data !== false, 'HTTP response '.$http->error); } /** * @group internet */ function test_basicauth(){ - $http = new HTTPClient(); + $http = new HTTPMockClient(); $http->user = 'user'; $http->pass = 'pass'; $data = $http->get($this->server.'/basic-auth/user/pass'); - $this->assertFalse($data === false, 'HTTP response'); + if($http->noconnection()) { + $this->markTestSkipped('connection timed out'); + return; + } + $this->assertFalse($data === false, 'HTTP response '.$http->error); $resp = json_decode($data, true); $this->assertTrue(is_array($resp), 'JSON response'); $this->assertEquals(array('authenticated'=>true,'user'=>'user'), $resp); @@ -167,11 +230,15 @@ class httpclient_http_test extends DokuWikiTest { * @group internet */ function test_basicauthfail(){ - $http = new HTTPClient(); + $http = new HTTPMockClient(); $http->user = 'user'; $http->pass = 'invalid'; $data = $http->get($this->server.'/basic-auth/user/pass'); - $this->assertTrue($data === false, 'HTTP response'); + if($http->noconnection()) { + $this->markTestSkipped('connection timed out'); + return; + } + $this->assertTrue($data === false, 'HTTP response '.$http->error); $this->assertEquals(401,$http->status); } @@ -179,10 +246,10 @@ class httpclient_http_test extends DokuWikiTest { * @group internet */ function test_timeout(){ - $http = new HTTPClient(); + $http = new HTTPMockClient(); $http->timeout = 5; $data = $http->get($this->server.'/delay/10'); - $this->assertTrue($data === false, 'HTTP response'); + $this->assertTrue($data === false, 'HTTP response '.$http->error); $this->assertEquals(-100,$http->status); } @@ -190,9 +257,13 @@ class httpclient_http_test extends DokuWikiTest { * @group internet */ function test_headers(){ - $http = new HTTPClient(); + $http = new HTTPMockClient(); $data = $http->get($this->server.'/response-headers?baz=&foo=bar'); - $this->assertFalse($data === false, 'HTTP response'); + if($http->noconnection()) { + $this->markTestSkipped('connection timed out'); + return; + } + $this->assertFalse($data === false, 'HTTP response '.$http->error); $resp = json_decode($data, true); $this->assertTrue(is_array($resp), 'JSON response'); $this->assertArrayHasKey('baz',$http->resp_headers); @@ -204,9 +275,13 @@ class httpclient_http_test extends DokuWikiTest { * @group internet */ function test_chunked(){ - $http = new HTTPClient(); + $http = new HTTPMockClient(); $data = $http->get('http://whoopdedo.org/cgi-bin/chunked/2550'); - $this->assertFalse($data === false, 'HTTP response'); + if($http->noconnection()) { + $this->markTestSkipped('connection timed out'); + return; + } + $this->assertFalse($data === false, 'HTTP response '.$http->error); $this->assertEquals(2550,strlen($data)); } @@ -216,13 +291,17 @@ class httpclient_http_test extends DokuWikiTest { * @group internet */ function test_wikimatrix(){ - $http = new HTTPClient(); + $http = new HTTPMockClient(); $data = $http->get('http://www.wikimatrix.org/cfeed/dokuwiki/-/-'); - $this->assertTrue($data !== false, $http->error); + if($http->noconnection()) { + $this->markTestSkipped('connection timed out'); + return; + } + $this->assertTrue($data !== false, 'HTTP response '.$http->error); } function test_postencode(){ - $http = new HTTPClient(); + $http = new HTTPMockClient(); // check simple data diff --git a/_test/tests/inc/httpclient_http_proxy.test.php b/_test/tests/inc/httpclient_http_proxy.test.php index 4aa039fcc..c44dc7ed7 100644 --- a/_test/tests/inc/httpclient_http_proxy.test.php +++ b/_test/tests/inc/httpclient_http_proxy.test.php @@ -1,5 +1,7 @@ <?php +require_once (__DIR__ . '/httpclient_mock.php'); + class httpclient_http_proxy_test extends DokuWikiTest { protected $url = 'http://test.dokuwiki.org/README'; @@ -7,7 +9,7 @@ class httpclient_http_proxy_test extends DokuWikiTest { * @group internet */ function test_simpleget(){ - $http = new HTTPClient(); + $http = new HTTPMockClient(); // proxy provided by Andrwe Lord Weber <dokuwiki@andrwe.org> $http->proxy_host = 'proxy.andrwe.org'; $http->proxy_port = 8080; @@ -16,5 +18,4 @@ class httpclient_http_proxy_test extends DokuWikiTest { $this->assertFalse($data === false, 'HTTP response '.$http->error); $this->assertTrue(strpos($data,'DokuWiki') !== false, 'response content'); } - }
\ No newline at end of file diff --git a/_test/tests/inc/httpclient_https_proxy.test.php b/_test/tests/inc/httpclient_https_proxy.test.php index aca3b3be2..9402e91af 100644 --- a/_test/tests/inc/httpclient_https_proxy.test.php +++ b/_test/tests/inc/httpclient_https_proxy.test.php @@ -12,4 +12,19 @@ class httpclient_https_proxy_test extends httpclient_http_proxy_test { } parent::setUp(); } + + /** + * @group internet + */ + function test_connectfail(){ + $http = new HTTPMockClient(); + // proxy provided by Andrwe Lord Weber <dokuwiki@andrwe.org> + $http->proxy_host = 'proxy.andrwe.org'; + $http->proxy_port = 8080; + + // the proxy accepts connections to dokuwiki.org only - the connect call should fail + $data = $http->get('https://www.google.com'); + $this->assertFalse($data); + $this->assertEquals(-150, $http->status); + } }
\ No newline at end of file diff --git a/_test/tests/inc/httpclient_mock.php b/_test/tests/inc/httpclient_mock.php new file mode 100644 index 000000000..038045c8b --- /dev/null +++ b/_test/tests/inc/httpclient_mock.php @@ -0,0 +1,46 @@ +<?php +/** + * Class HTTPMockClient + * + * Does not really mock the client, it still does real connections but will retry failed connections + * to work around shaky connectivity. + */ +class HTTPMockClient extends HTTPClient { + protected $tries; + + /** + * Sets shorter timeout + */ + function __construct() { + parent::__construct(); + $this->timeout = 8; // slightly faster timeouts + } + + /** + * Returns true if the connection timed out + * + * @return bool + */ + function noconnection() { + return ($this->tries === 0); + } + + /** + * Retries sending the request multiple times + * + * @param string $url + * @param string $data + * @param string $method + * @return bool + */ + function sendRequest($url, $data = '', $method = 'GET') { + $this->tries = 2; // configures the number of retries + $return = false; + while($this->tries) { + $return = parent::sendRequest($url, $data, $method); + if($this->status != -100) break; + $this->tries--; + } + return $return; + } +}
\ No newline at end of file diff --git a/_test/tests/inc/mailer.test.php b/_test/tests/inc/mailer.test.php index 4541d9906..50d282864 100644 --- a/_test/tests/inc/mailer.test.php +++ b/_test/tests/inc/mailer.test.php @@ -191,7 +191,10 @@ class mailer_test extends DokuWikiTest { // ask message lint if it is okay $html = new HTTPClient(); $results = $html->post('http://tools.ietf.org/tools/msglint/msglint', array('msg'=>$msg)); - $this->assertTrue($results !== false); + if($results === false) { + $this->markTestSkipped('no response from validator'); + return; + } // parse the result lines $lines = explode("\n", $results); diff --git a/_test/tests/test/basic.test.php b/_test/tests/test/basic.test.php index 86acef935..0639f0c5a 100644 --- a/_test/tests/test/basic.test.php +++ b/_test/tests/test/basic.test.php @@ -33,7 +33,7 @@ class InttestsBasicTest extends DokuWikiTest { $response = $request->execute(); $this->assertTrue( - strpos($response->getContent(), 'DokuWiki') >= 0, + strpos($response->getContent(), 'DokuWiki') !== false, 'DokuWiki was not a word in the output' ); } @@ -60,7 +60,7 @@ class InttestsBasicTest extends DokuWikiTest { $this->assertEquals('wiki:dokuwiki', $request->getPost('id')); // output check - $this->assertTrue(strpos($response->getContent(), 'Andreas Gohr') >= 0); + $this->assertTrue(strpos($response->getContent(), 'Andreas Gohr') !== false); } function testPostGet() { @@ -84,7 +84,7 @@ class InttestsBasicTest extends DokuWikiTest { $this->assertEquals('wiki:dokuwiki', $request->getGet('id')); // output check - $this->assertTrue(strpos($response->getContent(), 'Andreas Gohr') >= 0); + $this->assertTrue(strpos($response->getContent(), 'Andreas Gohr') !== false); } function testGet() { @@ -116,7 +116,7 @@ class InttestsBasicTest extends DokuWikiTest { $this->assertEquals('bar', $request->getGet('test')); // output check - $this->assertTrue(strpos($response->getContent(), 'Andreas Gohr') >= 0); + $this->assertTrue(strpos($response->getContent(), 'Andreas Gohr') !== false); } function testScripts() { @@ -168,5 +168,13 @@ class InttestsBasicTest extends DokuWikiTest { $response = new TestResponse('',array_slice($this->some_headers,0,-2)); // slice off the last two headers to leave no status header $this->assertNull($response->getStatusCode()); } + + function testINPUT() { + $request = new TestRequest(); + $response = $request->get(array('id' => 'mailinglist'), '/doku.php'); + + // output check + $this->assertTrue(strpos($response->getContent(), 'Netiquette') !== false); + } } diff --git a/inc/HTTPClient.php b/inc/HTTPClient.php index 96954fb47..de3a16830 100644 --- a/inc/HTTPClient.php +++ b/inc/HTTPClient.php @@ -254,7 +254,13 @@ class HTTPClient { } // add SSL stream prefix if needed - needs SSL support in PHP - if($port == 443 || $this->proxy_ssl) $server = 'ssl://'.$server; + if($port == 443 || $this->proxy_ssl) { + if(!in_array('ssl', stream_get_transports())) { + $this->status = -200; + $this->error = 'This PHP version does not support SSL - cannot connect to server'; + } + $server = 'ssl://'.$server; + } // prepare headers $headers = $this->headers; @@ -304,11 +310,18 @@ class HTTPClient { } // try establish a CONNECT tunnel for SSL - if($this->_ssltunnel($socket, $request_url)){ - // no keep alive for tunnels - $this->keep_alive = false; - // tunnel is authed already - if(isset($headers['Proxy-Authentication'])) unset($headers['Proxy-Authentication']); + try { + if($this->_ssltunnel($socket, $request_url)){ + // no keep alive for tunnels + $this->keep_alive = false; + // tunnel is authed already + if(isset($headers['Proxy-Authentication'])) unset($headers['Proxy-Authentication']); + } + } catch (HTTPClientException $e) { + $this->status = $e->getCode(); + $this->error = $e->getMessage(); + fclose($socket); + return false; } // keep alive? @@ -363,7 +376,7 @@ class HTTPClient { // get Status if (!preg_match('/^HTTP\/(\d\.\d)\s*(\d+).*?\n/', $r_headers, $m)) - throw new HTTPClientException('Server returned bad answer'); + throw new HTTPClientException('Server returned bad answer '.$r_headers); $this->status = $m[2]; @@ -526,6 +539,7 @@ class HTTPClient { * * @param resource &$socket * @param string &$requesturl + * @throws HTTPClientException when a tunnel is needed but could not be established * @return bool true if a tunnel was established */ function _ssltunnel(&$socket, &$requesturl){ @@ -559,7 +573,8 @@ class HTTPClient { return true; } } - return false; + + throw new HTTPClientException('Failed to establish secure proxy connection', -150); } /** diff --git a/inc/lang/bn/lang.php b/inc/lang/bn/lang.php index 5d9ee59a0..94a3fbb12 100644 --- a/inc/lang/bn/lang.php +++ b/inc/lang/bn/lang.php @@ -117,3 +117,13 @@ $lang['js']['mediadisplayimg'] = 'ছবিটি দেখান'; $lang['js']['mediadisplaylnk'] = 'শুধুমাত্র লিঙ্ক দেখান'; $lang['js']['mediasmall'] = 'ক্ষুদ্র সংস্করণ'; $lang['js']['mediamedium'] = 'মাধ্যম সংস্করণ'; +$lang['js']['medialarge'] = 'বড় সংস্করণ'; +$lang['js']['mediaoriginal'] = 'আসল সংস্করণ'; +$lang['js']['medialnk'] = 'বিস্তারিত পৃষ্ঠায় লিংক'; +$lang['js']['mediadirect'] = 'মূল সরাসরি লিঙ্ক'; +$lang['js']['medianolnk'] = 'কোনো লিঙ্ক নাই'; +$lang['js']['medianolink'] = 'ইমেজ লিঙ্ক কোরো না'; +$lang['js']['medialeft'] = 'বাম দিকে ইমেজ সারিবদ্ধ কর'; +$lang['js']['mediaright'] = 'ডান দিকে ইমেজ সারিবদ্ধ কর'; +$lang['js']['mediacenter'] = 'মাঝখানে ইমেজ সারিবদ্ধ কর'; +$lang['js']['medianoalign'] = 'কোনো সারিবদ্ধ করা প্রয়োজন নেই'; diff --git a/inc/lang/en/lang.php b/inc/lang/en/lang.php index 17a75803f..cbdef8661 100644 --- a/inc/lang/en/lang.php +++ b/inc/lang/en/lang.php @@ -224,7 +224,7 @@ $lang['both_changes'] = 'Both pages and media files'; $lang['qb_bold'] = 'Bold Text'; $lang['qb_italic'] = 'Italic Text'; $lang['qb_underl'] = 'Underlined Text'; -$lang['qb_code'] = 'Code Text'; +$lang['qb_code'] = 'Monospaced Text'; $lang['qb_strike'] = 'Strike-through Text'; $lang['qb_h1'] = 'Level 1 Headline'; $lang['qb_h2'] = 'Level 2 Headline'; diff --git a/inc/lang/hu-formal/admin.txt b/inc/lang/hu-formal/admin.txt new file mode 100644 index 000000000..b661bfb17 --- /dev/null +++ b/inc/lang/hu-formal/admin.txt @@ -0,0 +1,3 @@ +===== Beállítások ===== + +Alább találja a DokuWiki-ben elérhető beállítási lehetőségek listáját.
\ No newline at end of file diff --git a/inc/lang/hu-formal/adminplugins.txt b/inc/lang/hu-formal/adminplugins.txt new file mode 100644 index 000000000..b077521fb --- /dev/null +++ b/inc/lang/hu-formal/adminplugins.txt @@ -0,0 +1 @@ +===== További bővítmények =====
\ No newline at end of file diff --git a/inc/lang/hu-formal/backlinks.txt b/inc/lang/hu-formal/backlinks.txt new file mode 100644 index 000000000..437eb2e25 --- /dev/null +++ b/inc/lang/hu-formal/backlinks.txt @@ -0,0 +1,3 @@ +====== Hivatkozások ====== + +Mindazon oldalak listája, amelyek az aktuális oldalra hivatkoznak.
\ No newline at end of file diff --git a/inc/lang/hu-formal/conflict.txt b/inc/lang/hu-formal/conflict.txt new file mode 100644 index 000000000..6718d67e6 --- /dev/null +++ b/inc/lang/hu-formal/conflict.txt @@ -0,0 +1,5 @@ +====== Újabb változat érhető el ====== + +Az Ön által szerkesztett oldalnak már egy újabb változata érhető el. Ez akkor fordulhat elő, ha egy másik felhasználó módosította a dokumtemot, mialatt Ön is szerkesztette azt. + +Vizsgálja meg az alább látható eltéréseket, majd döntse el, melyik változatot tartja meg. Ha a "Mentés" gombot választja, az Ön verziója mentődik el. Kattintson a "Mégsem" gombra a jelenlegi változat megtartásához.
\ No newline at end of file diff --git a/inc/lang/hu-formal/denied.txt b/inc/lang/hu-formal/denied.txt new file mode 100644 index 000000000..97abd632a --- /dev/null +++ b/inc/lang/hu-formal/denied.txt @@ -0,0 +1,3 @@ +====== Hozzáférés megtadadva ====== + +Sajnáljuk, de nincs joga a folytatáshoz. Talán elfelejtett bejelentkezni?
\ No newline at end of file diff --git a/inc/lang/hu-formal/diff.txt b/inc/lang/hu-formal/diff.txt new file mode 100644 index 000000000..f922a504a --- /dev/null +++ b/inc/lang/hu-formal/diff.txt @@ -0,0 +1,3 @@ +====== Eltérések ====== + +Az oldal két változata közötti különbségek az alábbiak.
\ No newline at end of file diff --git a/inc/lang/hu-formal/draft.txt b/inc/lang/hu-formal/draft.txt new file mode 100644 index 000000000..9233eacad --- /dev/null +++ b/inc/lang/hu-formal/draft.txt @@ -0,0 +1,5 @@ +===== Piszkozatot találtam ===== + +Az Ön ezen az oldalon végzett utolsó szerkesztési művelete helytelenül fejeződött be. A DokuWiki automatikusan elmentett egy piszkozatot az Ön munkája során. Alább láthatók az utolsó munkafázis mentett adatai. + +Kérjük, döntse el, hogy //helyreállítja-e// a befejezetlen módosításokat, vagy //törli// az automatikusan mentett piszkozatot, vagy //megszakítja// a szerkesztési folyamatot.
\ No newline at end of file diff --git a/inc/lang/hu-formal/edit.txt b/inc/lang/hu-formal/edit.txt new file mode 100644 index 000000000..08f648ba6 --- /dev/null +++ b/inc/lang/hu-formal/edit.txt @@ -0,0 +1 @@ +Módosítsa az oldalt, majd kattintson a "Mentés" gombra. A wiki-szintaxishoz nézze meg a [[wiki:syntax|szintaxis]] oldalt. Kérjük, csak akkor módosítsa az oldalt, ha **tökéletesíteni**, **javítani** tudja. Amennyiben szeretne kipróbálni ezt-azt, a [[playground:playground|játszótéren]] megtanulhatja az első lépéseket.
\ No newline at end of file diff --git a/inc/lang/hu-formal/editrev.txt b/inc/lang/hu-formal/editrev.txt new file mode 100644 index 000000000..2eca33c7a --- /dev/null +++ b/inc/lang/hu-formal/editrev.txt @@ -0,0 +1,2 @@ +**A dokumentum egy korábbi változatát töltötte be!** Ha az oldalt elmenti, akkor egy új változat jön létre belőle. +----
\ No newline at end of file diff --git a/inc/lang/hu-formal/index.txt b/inc/lang/hu-formal/index.txt new file mode 100644 index 000000000..0f2b18fd2 --- /dev/null +++ b/inc/lang/hu-formal/index.txt @@ -0,0 +1,3 @@ +====== Oldaltérkép (tartalom) ====== + +Az összes elérhető oldal [[doku>namespaces|névterek]] szerint rendezett oldaltérképe.
\ No newline at end of file diff --git a/inc/lang/hu-formal/lang.php b/inc/lang/hu-formal/lang.php new file mode 100644 index 000000000..a98bdc0d3 --- /dev/null +++ b/inc/lang/hu-formal/lang.php @@ -0,0 +1,27 @@ +<?php + +/** + * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) + * + * @author Marina Vladi <deldadam@gmail.com> + */ +$lang['encoding'] = 'utf-8'; +$lang['direction'] = 'ltr'; +$lang['doublequoteopening'] = '„'; +$lang['doublequoteclosing'] = '”'; +$lang['singlequoteopening'] = '‚'; +$lang['singlequoteclosing'] = '’'; +$lang['apostrophe'] = '’'; +$lang['btn_edit'] = 'Oldal módosítása'; +$lang['btn_source'] = 'Forrás megtekintése'; +$lang['btn_show'] = 'Oldal megtekintése'; +$lang['btn_create'] = 'Oldal létrehozása'; +$lang['btn_search'] = 'Keresés'; +$lang['btn_save'] = 'Mentés'; +$lang['btn_preview'] = 'Előnézet'; +$lang['btn_top'] = 'Oldal tetejére'; +$lang['btn_newer'] = '<< újabb'; +$lang['btn_older'] = 'régebbi >>'; +$lang['btn_revs'] = 'Korábbi változatok'; +$lang['btn_recent'] = 'Legújabb változások'; +$lang['btn_upload'] = 'Feltöltés'; diff --git a/inc/toolbar.php b/inc/toolbar.php index b588d4477..d8d2f209b 100644 --- a/inc/toolbar.php +++ b/inc/toolbar.php @@ -56,7 +56,7 @@ function toolbar_JSdefines($varname){ 'type' => 'format', 'title' => $lang['qb_code'], 'icon' => 'mono.png', - 'key' => 'c', + 'key' => 'm', 'open' => "''", 'close' => "''", 'block' => false diff --git a/lib/scripts/behaviour.js b/lib/scripts/behaviour.js index 85ddf503e..6b46add07 100644 --- a/lib/scripts/behaviour.js +++ b/lib/scripts/behaviour.js @@ -109,7 +109,7 @@ var dw_behaviour = { * @author Michael Klier <chi@chimeric.de> */ checkWindowsShares: function() { - if(!LANG.nosmblinks || typeof(document.all) !== 'undefined') { + if(!LANG.nosmblinks || navigator.userAgent.match(/(Trident|MSIE)/)) { // No warning requested or none necessary return; } diff --git a/lib/scripts/qsearch.js b/lib/scripts/qsearch.js index e5cc73b49..95c632e45 100644 --- a/lib/scripts/qsearch.js +++ b/lib/scripts/qsearch.js @@ -6,165 +6,193 @@ * @author Adrian Lang <lang@cosmocode.de> * @author Michal Rezler <m.rezler@centrum.cz> */ +jQuery.fn.dw_qsearch = function (overrides) { -var dw_qsearch = { - - $inObj: null, - $outObj: null, - timer: null, - curRequest: null, - - /** - * initialize the quick search - * - * Attaches the event handlers - * - * @param input element (jQuery selector/DOM obj) - * @param output element (jQuery selector/DOM obj) - */ - init: function (input, output) { - var do_qsearch; - - dw_qsearch.$inObj = jQuery(input); - dw_qsearch.$outObj = jQuery(output); - - // objects found? - if (dw_qsearch.$inObj.length === 0 || - dw_qsearch.$outObj.length === 0) { - return; - } + var dw_qsearch = { - // attach eventhandler to search field - do_qsearch = function () { - // abort any previous request - if (dw_qsearch.curRequest != null) { - dw_qsearch.curRequest.abort(); - } - var value = dw_qsearch.$inObj.val(); - if (value === '') { - dw_qsearch.clear_results(); + output: '#qsearch__out', + + $inObj: this, + $outObj: null, + timer: null, + curRequest: null, + + /** + * initialize the quick search + * + * Attaches the event handlers + * + */ + init: function () { + var do_qsearch; + + dw_qsearch.$outObj = jQuery(dw_qsearch.output); + + // objects found? + if (dw_qsearch.$inObj.length === 0 || + dw_qsearch.$outObj.length === 0) { return; } - dw_qsearch.curRequest = jQuery.post( - DOKU_BASE + 'lib/exe/ajax.php', - { - call: 'qsearch', - q: encodeURI(value) - }, - dw_qsearch.onCompletion, - 'html' - ); - }; - dw_qsearch.$inObj.keyup( - function() { - if(dw_qsearch.timer){ - window.clearTimeout(dw_qsearch.timer); - dw_qsearch.timer = null; + // attach eventhandler to search field + do_qsearch = function () { + // abort any previous request + if (dw_qsearch.curRequest != null) { + dw_qsearch.curRequest.abort(); } - dw_qsearch.timer = window.setTimeout(do_qsearch, 500); - } - ); - - // attach eventhandler to output field - dw_qsearch.$outObj.click(dw_qsearch.clear_results); - }, - - /** - * Empty and hide the output div - */ - clear_results: function(){ - dw_qsearch.$outObj.hide(); - dw_qsearch.$outObj.text(''); - }, - - /** - * Callback. Reformat and display the results. - * - * Namespaces are shortened here to keep the results from overflowing - * or wrapping - * - * @param data The result HTML - */ - onCompletion: function(data) { - var max, $links, too_big; - - dw_qsearch.curRequest = null; - - if (data === '') { - dw_qsearch.clear_results(); - return; - } - - dw_qsearch.$outObj - .html(data) - .show() - .css('white-space', 'nowrap'); - - // disable overflow during shortening - dw_qsearch.$outObj.find('li').css('overflow', 'visible'); - - $links = dw_qsearch.$outObj.find('a'); - max = dw_qsearch.$outObj[0].clientWidth; // maximum width allowed (but take away paddings below) - if(document.documentElement.dir === 'rtl'){ - max -= parseInt(dw_qsearch.$outObj.css('padding-left')); - too_big = function (l) { return l.offsetLeft < 0; }; - }else{ - max -= parseInt(dw_qsearch.$outObj.css('padding-right')); - too_big = function (l) { return l.offsetWidth + l.offsetLeft > max; }; - } - - $links.each(function () { - var start, length, replace, nsL, nsR, eli, runaway; + var value = dw_qsearch.getSearchterm(); + if (value === '') { + dw_qsearch.clear_results(); + return; + } + dw_qsearch.curRequest = jQuery.post( + DOKU_BASE + 'lib/exe/ajax.php', + { + call: 'qsearch', + q: encodeURI(value) + }, + dw_qsearch.onCompletion, + 'html' + ); + }; + + dw_qsearch.$inObj.keyup( + function () { + if (dw_qsearch.timer) { + window.clearTimeout(dw_qsearch.timer); + dw_qsearch.timer = null; + } + dw_qsearch.timer = window.setTimeout(do_qsearch, 500); + } + ); - if (!too_big(this)) { + // attach eventhandler to output field + dw_qsearch.$outObj.click(dw_qsearch.clear_results); + }, + + /** + * Read search term from input + */ + getSearchterm: function() { + return dw_qsearch.$inObj.val(); + }, + + /** + * Empty and hide the output div + */ + clear_results: function () { + dw_qsearch.$outObj.hide(); + dw_qsearch.$outObj.text(''); + }, + + /** + * Callback. Reformat and display the results. + * + * Namespaces are shortened here to keep the results from overflowing + * or wrapping + * + * @param data The result HTML + */ + onCompletion: function (data) { + var max, $links, too_big; + + dw_qsearch.curRequest = null; + + if (data === '') { + dw_qsearch.clear_results(); return; } - // make IE's innerText available to W3C conform browsers - if(this.textContent){ - this.__defineGetter__('innerText', function(){ return this.textContent }); - this.__defineSetter__('innerText', function(val){ this.textContent = val }); + dw_qsearch.$outObj + .html(data) + .show() + .css('white-space', 'nowrap'); + + // disable overflow during shortening + dw_qsearch.$outObj.find('li').css('overflow', 'visible'); + + $links = dw_qsearch.$outObj.find('a'); + max = dw_qsearch.$outObj[0].clientWidth; // maximum width allowed (but take away paddings below) + if (document.documentElement.dir === 'rtl') { + max -= parseInt(dw_qsearch.$outObj.css('padding-left')); + too_big = function (l) { + return l.offsetLeft < 0; + }; + } else { + max -= parseInt(dw_qsearch.$outObj.css('padding-right')); + too_big = function (l) { + return l.offsetWidth + l.offsetLeft > max; + }; } - nsL = this.innerText.indexOf('('); - nsR = this.innerText.indexOf(')'); - eli = 0; - runaway = 0; - - while((nsR - nsL > 3) && too_big(this) && runaway++ < 500) { - if(eli !== 0){ - // elipsis already inserted - if( (eli - nsL) > (nsR - eli) ){ - // cut left - start = eli - 2; - length = 2; - }else{ - // cut right - start = eli + 1; - length = 1; - } - replace = ''; - }else{ - // replace middle with ellipsis - start = Math.floor( nsL + ((nsR-nsL)/2) ); - length = 1; - replace = '…'; + $links.each(function () { + var start, length, replace, nsL, nsR, eli, runaway; + + if (!too_big(this)) { + return; + } + + // make IE's innerText available to W3C conform browsers + if (this.textContent) { + this.__defineGetter__('innerText', function () { + return this.textContent + }); + this.__defineSetter__('innerText', function (val) { + this.textContent = val + }); } - this.innerText = substr_replace(this.innerText, - replace, start, length); - eli = this.innerText.indexOf('…'); nsL = this.innerText.indexOf('('); nsR = this.innerText.indexOf(')'); - } - }); + eli = 0; + runaway = 0; + + while ((nsR - nsL > 3) && too_big(this) && runaway++ < 500) { + if (eli !== 0) { + // elipsis already inserted + if ((eli - nsL) > (nsR - eli)) { + // cut left + start = eli - 2; + length = 2; + } else { + // cut right + start = eli + 1; + length = 1; + } + replace = ''; + } else { + // replace middle with ellipsis + start = Math.floor(nsL + ((nsR - nsL) / 2)); + length = 1; + replace = '…'; + } + this.innerText = substr_replace(this.innerText, + replace, start, length); - // reenable overflow - dw_qsearch.$outObj.find('li').css('overflow', 'hidden').css('text-overflow','ellipsis'); + eli = this.innerText.indexOf('…'); + nsL = this.innerText.indexOf('('); + nsR = this.innerText.indexOf(')'); + } + }); + + // reenable overflow + dw_qsearch.$outObj.find('li').css('overflow', 'hidden').css('text-overflow', 'ellipsis'); + } + + + }; + + jQuery.extend(dw_qsearch, overrides); + + if (!overrides.deferInit) { + dw_qsearch.init(); } + + return dw_qsearch; }; jQuery(function () { - dw_qsearch.init('#qsearch__in','#qsearch__out'); + jQuery('#qsearch__in').dw_qsearch({ + output: '#qsearch__out' + }); }); |