summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--_test/tests/inc/httpclient_http.test.php50
-rw-r--r--_test/tests/inc/tar.test.php24
-rw-r--r--inc/HTTPClient.php7
-rw-r--r--inc/html.php11
-rw-r--r--inc/lang/de/lang.php2
-rw-r--r--inc/lang/en/lang.php2
-rw-r--r--inc/plugin.php6
-rw-r--r--inc/template.php32
-rw-r--r--lib/exe/css.php2
-rw-r--r--lib/exe/js.php3
-rw-r--r--lib/plugins/acl/script.js1
-rw-r--r--lib/plugins/authad/lang/pt-br/settings.php5
-rw-r--r--lib/plugins/authldap/lang/pt-br/settings.php9
-rw-r--r--lib/plugins/authmysql/lang/pt-br/settings.php1
-rw-r--r--lib/plugins/authpgsql/lang/pt-br/settings.php1
-rw-r--r--lib/plugins/config/lang/pt-br/lang.php1
-rw-r--r--lib/scripts/behaviour.js2
-rw-r--r--lib/scripts/edit.js9
-rw-r--r--lib/scripts/editor.js1
-rw-r--r--lib/scripts/helpers.js34
-rw-r--r--lib/scripts/media.js19
-rw-r--r--lib/scripts/page.js6
-rw-r--r--lib/scripts/toolbar.js29
-rw-r--r--lib/scripts/tree.js20
-rw-r--r--lib/scripts/tw-sack.js1
-rw-r--r--lib/tpl/dokuwiki/css/basic.css7
-rw-r--r--lib/tpl/dokuwiki/css/pagetools.css133
-rw-r--r--lib/tpl/dokuwiki/detail.php30
-rw-r--r--lib/tpl/dokuwiki/images/pagetools-sprite.pngbin5931 -> 11325 bytes
-rw-r--r--lib/tpl/dokuwiki/images/pagetools/00_default.pngbin0 -> 616 bytes
-rw-r--r--lib/tpl/dokuwiki/main.php32
31 files changed, 311 insertions, 169 deletions
diff --git a/_test/tests/inc/httpclient_http.test.php b/_test/tests/inc/httpclient_http.test.php
index 387eb53aa..522f0790c 100644
--- a/_test/tests/inc/httpclient_http.test.php
+++ b/_test/tests/inc/httpclient_http.test.php
@@ -215,5 +215,55 @@ class httpclient_http_test extends DokuWikiTest {
$data = $http->get('http://www.wikimatrix.org/cfeed/dokuwiki/-/-');
$this->assertTrue($data !== false, $http->error);
}
+
+ function test_postencode(){
+ $http = new HTTPClient();
+
+
+ // check simple data
+ $data = array(
+ 'öä?' => 'öä?',
+ 'foo' => 'bang'
+ );
+ $this->assertEquals(
+ '%C3%B6%C3%A4%3F=%C3%B6%C3%A4%3F&foo=bang',
+ $http->_postEncode($data),
+ 'simple'
+ );
+
+ // check first level numeric array
+ $data = array(
+ 'foo' => 'bang',
+ 'ärr' => array('ö', 'b', 'c')
+ );
+ $this->assertEquals(
+ 'foo=bang&%C3%A4rr%5B0%5D=%C3%B6&%C3%A4rr%5B1%5D=b&%C3%A4rr%5B2%5D=c',
+ $http->_postEncode($data),
+ 'onelevelnum'
+ );
+
+ // check first level associative array
+ $data = array(
+ 'foo' => 'bang',
+ 'ärr' => array('ö'=>'ä', 'b' => 'c')
+ );
+ $this->assertEquals(
+ 'foo=bang&%C3%A4rr%5B%C3%B6%5D=%C3%A4&%C3%A4rr%5Bb%5D=c',
+ $http->_postEncode($data),
+ 'onelevelassoc'
+ );
+
+
+ // check first level associative array
+ $data = array(
+ 'foo' => 'bang',
+ 'ärr' => array('ö'=>'ä', 'ä' => array('ö'=>'ä'))
+ );
+ $this->assertEquals(
+ 'foo=bang&%C3%A4rr%5B%C3%B6%5D=%C3%A4&%C3%A4rr%5B%C3%A4%5D%5B%C3%B6%5D=%C3%A4',
+ $http->_postEncode($data),
+ 'twolevelassoc'
+ );
+ }
}
//Setup VIM: ex: et ts=4 :
diff --git a/_test/tests/inc/tar.test.php b/_test/tests/inc/tar.test.php
index 28e709cc3..9801ca1e0 100644
--- a/_test/tests/inc/tar.test.php
+++ b/_test/tests/inc/tar.test.php
@@ -11,7 +11,8 @@ class Tar_TestCase extends DokuWikiTest {
public function test_createdynamic() {
$tar = new Tar();
- $dir = dirname(__FILE__).'/tar';
+ $dir = dirname(__FILE__).'/tar';
+ $tdir = ltrim($dir,'/');
$tar->create();
$tar->AddFile("$dir/testdata1.txt");
@@ -24,11 +25,17 @@ class Tar_TestCase extends DokuWikiTest {
$this->assertTrue(strpos($data, 'testcontent2') !== false, 'Content in TAR');
$this->assertTrue(strpos($data, 'testcontent3') !== false, 'Content in TAR');
- $this->assertTrue(strpos($data, "$dir/testdata1.txt") !== false, 'Path in TAR');
+ // fullpath might be too long to be stored as full path FS#2802
+ $this->assertTrue(strpos($data, "$tdir") !== false, 'Path in TAR');
+ $this->assertTrue(strpos($data, "testdata1.txt") !== false, 'File in TAR');
+
$this->assertTrue(strpos($data, 'noway/testdata2.txt') !== false, 'Path in TAR');
$this->assertTrue(strpos($data, 'another/testdata3.txt') !== false, 'Path in TAR');
- $this->assertTrue(strpos($data, "$dir/foobar/testdata2.txt") === false, 'Path not in TAR');
+ // fullpath might be too long to be stored as full path FS#2802
+ $this->assertTrue(strpos($data, "$tdir/foobar") === false, 'Path not in TAR');
+ $this->assertTrue(strpos($data, "foobar.txt") === false, 'File not in TAR');
+
$this->assertTrue(strpos($data, "foobar") === false, 'Path not in TAR');
}
@@ -42,6 +49,7 @@ class Tar_TestCase extends DokuWikiTest {
$tar = new Tar();
$dir = dirname(__FILE__).'/tar';
+ $tdir = ltrim($dir,'/');
$tmp = tempnam(sys_get_temp_dir(), 'dwtartest');
$tar->create($tmp, Tar::COMPRESS_NONE);
@@ -57,11 +65,17 @@ class Tar_TestCase extends DokuWikiTest {
$this->assertTrue(strpos($data, 'testcontent2') !== false, 'Content in TAR');
$this->assertTrue(strpos($data, 'testcontent3') !== false, 'Content in TAR');
- $this->assertTrue(strpos($data, "$dir/testdata1.txt") !== false, 'Path in TAR');
+ // fullpath might be too long to be stored as full path FS#2802
+ $this->assertTrue(strpos($data, "$tdir") !== false, 'Path in TAR');
+ $this->assertTrue(strpos($data, "testdata1.txt") !== false, 'File in TAR');
+
$this->assertTrue(strpos($data, 'noway/testdata2.txt') !== false, 'Path in TAR');
$this->assertTrue(strpos($data, 'another/testdata3.txt') !== false, 'Path in TAR');
- $this->assertTrue(strpos($data, "$dir/foobar/testdata2.txt") === false, 'Path not in TAR');
+ // fullpath might be too long to be stored as full path FS#2802
+ $this->assertTrue(strpos($data, "$tdir/foobar") === false, 'Path not in TAR');
+ $this->assertTrue(strpos($data, "foobar.txt") === false, 'File not in TAR');
+
$this->assertTrue(strpos($data, "foobar") === false, 'Path not in TAR');
@unlink($tmp);
diff --git a/inc/HTTPClient.php b/inc/HTTPClient.php
index 0d7b80cf8..3964c8fbc 100644
--- a/inc/HTTPClient.php
+++ b/inc/HTTPClient.php
@@ -806,12 +806,7 @@ class HTTPClient {
* @author Andreas Gohr <andi@splitbrain.org>
*/
function _postEncode($data){
- $url = '';
- foreach($data as $key => $val){
- if($url) $url .= '&';
- $url .= urlencode($key).'='.urlencode($val);
- }
- return $url;
+ return http_build_query($data,'','&');
}
/**
diff --git a/inc/html.php b/inc/html.php
index 53f4c45ff..614cf172c 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -854,12 +854,17 @@ function html_index($ns){
* @author Andreas Gohr <andi@splitbrain.org>
*/
function html_list_index($item){
- global $ID;
+ global $ID, $conf;
+
+ // prevent searchbots needlessly following links
+ $nofollow = ($ID != $conf['start'] || $conf['sitemap']) ? ' rel="nofollow"' : '';
+
$ret = '';
$base = ':'.$item['id'];
$base = substr($base,strrpos($base,':')+1);
if($item['type']=='d'){
- $ret .= '<a href="'.wl($ID,'idx='.rawurlencode($item['id'])).'" title="' . $item['id'] . '" class="idx_dir"><strong>';
+ // FS#2766, no need for search bots to follow namespace links in the index
+ $ret .= '<a href="'.wl($ID,'idx='.rawurlencode($item['id'])).'" title="' . $item['id'] . '" class="idx_dir"' . $nofollow . '><strong>';
$ret .= $base;
$ret .= '</strong></a>';
}else{
@@ -1492,7 +1497,7 @@ function html_edit(){
echo 'textChanged = ' . ($mod ? 'true' : 'false');
echo '/*!]]>*/</script>' . NL;
} ?>
- <div class="editBox">
+ <div class="editBox" role="application">
<div class="toolbar group">
<div id="draft__status"><?php if(!empty($INFO['draft'])) echo $lang['draftdate'].' '.dformat();?></div>
diff --git a/inc/lang/de/lang.php b/inc/lang/de/lang.php
index 329d9691a..b914f01aa 100644
--- a/inc/lang/de/lang.php
+++ b/inc/lang/de/lang.php
@@ -235,7 +235,7 @@ $lang['qb_extlink'] = 'Externer Link';
$lang['qb_hr'] = 'Horizontale Linie';
$lang['qb_ol'] = 'Nummerierter Listenpunkt';
$lang['qb_ul'] = 'Listenpunkt';
-$lang['qb_media'] = 'Bilder und andere Dateien hinzufügen';
+$lang['qb_media'] = 'Bilder und andere Dateien hinzufügen (öffnet sich in einem neuen Fenster)';
$lang['qb_sig'] = 'Unterschrift einfügen';
$lang['qb_smileys'] = 'Smileys';
$lang['qb_chars'] = 'Sonderzeichen';
diff --git a/inc/lang/en/lang.php b/inc/lang/en/lang.php
index cdad6c9a6..00e71d254 100644
--- a/inc/lang/en/lang.php
+++ b/inc/lang/en/lang.php
@@ -234,7 +234,7 @@ $lang['qb_extlink'] = 'External Link';
$lang['qb_hr'] = 'Horizontal Rule';
$lang['qb_ol'] = 'Ordered List Item';
$lang['qb_ul'] = 'Unordered List Item';
-$lang['qb_media'] = 'Add Images and other files';
+$lang['qb_media'] = 'Add Images and other files (opens in a new window)';
$lang['qb_sig'] = 'Insert Signature';
$lang['qb_smileys'] = 'Smileys';
$lang['qb_chars'] = 'Special Chars';
diff --git a/inc/plugin.php b/inc/plugin.php
index 4d3d45f62..422b82534 100644
--- a/inc/plugin.php
+++ b/inc/plugin.php
@@ -199,11 +199,7 @@ class DokuWiki_Plugin {
* @return object helper plugin object
*/
function loadHelper($name, $msg = true){
- if (!plugin_isdisabled($name)){
- $obj = plugin_load('helper',$name);
- }else{
- $obj = null;
- }
+ $obj = plugin_load('helper',$name);
if (is_null($obj) && $msg) msg("Helper plugin $name is not available or invalid.",-1);
return $obj;
}
diff --git a/inc/template.php b/inc/template.php
index b8129f914..bb5f2cd53 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -541,6 +541,7 @@ function tpl_actionlink($type, $pre = '', $suf = '', $inner = '', $return = fals
* @var string $accesskey
* @var string $id
* @var string $method
+ * @var bool $nofollow
* @var array $params
*/
extract($data);
@@ -555,10 +556,11 @@ function tpl_actionlink($type, $pre = '', $suf = '', $inner = '', $return = fals
$akey = 'accesskey="'.$accesskey.'" ';
$addTitle = ' ['.strtoupper($accesskey).']';
}
+ $rel = $nofollow ? 'rel="nofollow" ' : '';
$out = tpl_link(
$linktarget, $pre.(($inner) ? $inner : $caption).$suf,
'class="action '.$type.'" '.
- $akey.'rel="nofollow" '.
+ $akey.$rel.
'title="'.hsc($caption).$addTitle.'"', 1
);
}
@@ -595,6 +597,7 @@ function tpl_get_action($type) {
global $INFO;
global $REV;
global $ACT;
+ global $conf;
// check disabled actions and fix the badly named ones
if($type == 'history') $type = 'revisions';
@@ -604,6 +607,7 @@ function tpl_get_action($type) {
$id = $ID;
$method = 'get';
$params = array('do' => $type);
+ $nofollow = true;
switch($type) {
case 'edit':
// most complicated type - we need to decide on current action
@@ -641,6 +645,10 @@ function tpl_get_action($type) {
break;
case 'index':
$accesskey = 'x';
+ // allow searchbots to get to the sitemap from the homepage (when dokuwiki isn't providing a sitemap.xml)
+ if ($conf['start'] == $ID && !$conf['sitemap']) {
+ $nofollow = false;
+ }
break;
case 'top':
$accesskey = 't';
@@ -711,7 +719,7 @@ function tpl_get_action($type) {
return '[unknown %s type]';
break;
}
- return compact('accesskey', 'type', 'id', 'method', 'params');
+ return compact('accesskey', 'type', 'id', 'method', 'params', 'nofollow');
}
/**
@@ -764,7 +772,7 @@ function tpl_searchform($ajax = true, $autocomplete = true) {
// don't print the search form if search action has been disabled
if(!actionOK('search')) return false;
- print '<form action="'.wl().'" accept-charset="utf-8" class="search" id="dw__search" method="get"><div class="no">';
+ print '<form action="'.wl().'" accept-charset="utf-8" class="search" id="dw__search" method="get" role="search"><div class="no">';
print '<input type="hidden" name="do" value="search" />';
print '<input type="text" ';
if($ACT == 'search') print 'value="'.htmlspecialchars($QUERY).'" ';
@@ -1746,5 +1754,23 @@ function tpl_media() {
echo '</div>'.NL;
}
+/**
+ * Return useful layout classes
+ *
+ * @author Anika Henke <anika@selfthinker.org>
+ */
+function tpl_classes() {
+ global $ACT, $conf, $ID, $INFO;
+ $classes = array(
+ 'dokuwiki',
+ 'mode_'.$ACT,
+ 'tpl_'.$conf['template'],
+ $_SERVER['REMOTE_USER'] ? 'loggedIn' : '',
+ $INFO['exists'] ? '' : 'notFound',
+ ($ID == $conf['start']) ? 'home' : '',
+ );
+ return join(' ', $classes);
+}
+
//Setup VIM: ex: et ts=4 :
diff --git a/lib/exe/css.php b/lib/exe/css.php
index 1e662c64a..768c8eda4 100644
--- a/lib/exe/css.php
+++ b/lib/exe/css.php
@@ -314,7 +314,7 @@ function css_datauri($match){
$data = base64_encode(file_get_contents($local));
}
if($data){
- $url = 'data:image/'.$ext.';base64,'.$data;
+ $url = '\'data:image/'.$ext.';base64,'.$data.'\'';
}else{
$url = $base.$url;
}
diff --git a/lib/exe/js.php b/lib/exe/js.php
index 4ff48133e..06769d895 100644
--- a/lib/exe/js.php
+++ b/lib/exe/js.php
@@ -104,10 +104,13 @@ function js_out(){
// load files
foreach($files as $file){
$ismin = (substr($file,-7) == '.min.js');
+ $debugjs = ($conf['allowdebug'] && strpos($file, DOKU_INC.'lib/scripts/') !== 0);
echo "\n\n/* XXXXXXXXXX begin of ".str_replace(DOKU_INC, '', $file) ." XXXXXXXXXX */\n\n";
if($ismin) echo "\n/* BEGIN NOCOMPRESS */\n";
+ if ($debugjs) echo "\ntry {\n";
js_load($file);
+ if ($debugjs) echo "\n} catch (e) {\n logError(e, '".str_replace(DOKU_INC, '', $file)."');\n}\n";
if($ismin) echo "\n/* END NOCOMPRESS */\n";
echo "\n\n/* XXXXXXXXXX end of " . str_replace(DOKU_INC, '', $file) . " XXXXXXXXXX */\n\n";
}
diff --git a/lib/plugins/acl/script.js b/lib/plugins/acl/script.js
index c3763dc8d..0abb80d67 100644
--- a/lib/plugins/acl/script.js
+++ b/lib/plugins/acl/script.js
@@ -61,6 +61,7 @@ var dw_acl = {
*/
loadinfo: function () {
jQuery('#acl__info')
+ .attr('role', 'alert')
.html('<img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="..." />')
.load(
DOKU_BASE + 'lib/plugins/acl/ajax.php',
diff --git a/lib/plugins/authad/lang/pt-br/settings.php b/lib/plugins/authad/lang/pt-br/settings.php
index 308d122dd..56f37b75f 100644
--- a/lib/plugins/authad/lang/pt-br/settings.php
+++ b/lib/plugins/authad/lang/pt-br/settings.php
@@ -3,14 +3,15 @@
* Brazilian Portuguese language file
*
* @author Victor Westmann <victor.westmann@gmail.com>
+ * @author Frederico Guimarães <frederico@teia.bio.br>
*/
$lang['account_suffix'] = 'Sufixo de sua conta. Eg. <code>@meu.domínio.org</code>';
$lang['base_dn'] = 'Sua base DN. Eg. <code>DC=meu,DC=domínio,DC=org</code>';
$lang['domain_controllers'] = 'Uma lista de controles de domínios separada por vírgulas. Eg. <code>srv1.domínio.org,srv2.domínio.org</code>';
-$lang['admin_username'] = 'Um usuário com privilégios do Active Directory com acesso a todos os dados dos outros usuários. Opcional, mas necessário para certas ações como enviar emails de inscrição.';
+$lang['admin_username'] = 'Um usuário do Active Directory com privilégios para acessar os dados de todos os outros usuários. Opcional, mas necessário para realizar certas ações, tais como enviar mensagens de assinatura.';
$lang['admin_password'] = 'A senha do usuário acima.';
$lang['sso'] = 'Usar Single-Sign-On através do Kerberos ou NTLM?';
-$lang['real_primarygroup'] = 'Deverá o grupo real primário ser resolvido ao invés de assumir "Usuários de domínio" (mais lento) ';
+$lang['real_primarygroup'] = 'O grupo primário real deve ser resolvido ao invés de assumirmos como "Usuários do Domínio" (mais lento)';
$lang['use_ssl'] = 'Usar conexão SSL? Se usar, não habilitar TLS abaixo.';
$lang['use_tls'] = 'Usar conexão TLS? se usar, não habilitar SSL acima.';
$lang['debug'] = 'Mostrar saída adicional de depuração em mensagens de erros?';
diff --git a/lib/plugins/authldap/lang/pt-br/settings.php b/lib/plugins/authldap/lang/pt-br/settings.php
index 70b68b289..d12a9cf36 100644
--- a/lib/plugins/authldap/lang/pt-br/settings.php
+++ b/lib/plugins/authldap/lang/pt-br/settings.php
@@ -3,17 +3,18 @@
* Brazilian Portuguese language file
*
* @author Victor Westmann <victor.westmann@gmail.com>
+ * @author Frederico Guimarães <frederico@teia.bio.br>
*/
$lang['server'] = 'Seu servidor LDAP. Ou hostname (<code>localhost</code>) ou uma URL completa (<code>ldap://server.tld:389</code>)';
$lang['port'] = 'Porta LDAP do servidor se nenhuma URL completa tiver sido fornecida acima';
$lang['usertree'] = 'Onde encontrar as contas de usuários. Eg. <code>ou=Pessoas, dc=servidor, dc=tld</code>';
$lang['grouptree'] = 'Onde encontrar os grupos de usuários. Eg. <code>ou=Pessoas, dc=servidor, dc=tld</code>';
-$lang['userfilter'] = 'Filtro do LDAP para procurar por contas de usuários. Eg. <code>(&amp;(uid=%{user})(objectClass=posixAccount))</code>';
-$lang['groupfilter'] = 'Filtro do LDAP 0ara procurar por grupos. Eg. <code>(&amp;(objectClass=posixGroup)(|(gidNumber=%{gid})(memberUID=%{user})))</code>';
+$lang['userfilter'] = 'Filtro LDAP para pesquisar por contas de usuários. Ex. <code>(&amp;(uid=%{user})(objectClass=posixAccount))</code>';
+$lang['groupfilter'] = 'Filtro LDAP para pesquisar por grupos. Ex. <code>(&amp;(objectClass=posixGroup)(|(gidNumber=%{gid})(memberUID=%{user})))</code>';
$lang['version'] = 'A versão do protocolo para usar. Você talvez deva definir isto para <code>3</code>';
$lang['starttls'] = 'Usar conexões TLS?';
-$lang['referrals'] = 'Permitir referências serem seguidas?';
-$lang['deref'] = 'Como respeitar aliases ?';
+$lang['referrals'] = 'Permitir que as referências sejam seguidas?';
+$lang['deref'] = 'Como dereferenciar os aliases?';
$lang['binddn'] = 'DN de um vínculo opcional de usuário se vínculo anônimo não for suficiente. Eg. <code>cn=admin, dc=my, dc=home</code>';
$lang['bindpw'] = 'Senha do usuário acima';
$lang['userscope'] = 'Limitar escopo da busca para busca de usuário';
diff --git a/lib/plugins/authmysql/lang/pt-br/settings.php b/lib/plugins/authmysql/lang/pt-br/settings.php
index 5febedd13..8ac775b54 100644
--- a/lib/plugins/authmysql/lang/pt-br/settings.php
+++ b/lib/plugins/authmysql/lang/pt-br/settings.php
@@ -3,6 +3,7 @@
* Brazilian Portuguese language file
*
* @author Victor Westmann <victor.westmann@gmail.com>
+ * @author Frederico Guimarães <frederico@teia.bio.br>
*/
$lang['server'] = 'Seu servidor MySQL';
$lang['user'] = 'usuário MySQL';
diff --git a/lib/plugins/authpgsql/lang/pt-br/settings.php b/lib/plugins/authpgsql/lang/pt-br/settings.php
index d91e9c8e5..5ffe13465 100644
--- a/lib/plugins/authpgsql/lang/pt-br/settings.php
+++ b/lib/plugins/authpgsql/lang/pt-br/settings.php
@@ -3,6 +3,7 @@
* Brazilian Portuguese language file
*
* @author Victor Westmann <victor.westmann@gmail.com>
+ * @author Frederico Guimarães <frederico@teia.bio.br>
*/
$lang['server'] = 'Seu servidor PostgreSQL';
$lang['port'] = 'Sua porta do servidor PostgreSQL';
diff --git a/lib/plugins/config/lang/pt-br/lang.php b/lib/plugins/config/lang/pt-br/lang.php
index 795ee81c0..ee1447b4e 100644
--- a/lib/plugins/config/lang/pt-br/lang.php
+++ b/lib/plugins/config/lang/pt-br/lang.php
@@ -114,6 +114,7 @@ $lang['target____media'] = 'Parâmetro "target" para links de mídia';
$lang['target____windows'] = 'Parâmetro "target" para links do Windows';
$lang['mediarevisions'] = 'Habilitar revisões de mídias?';
$lang['refcheck'] = 'Verificação de referência da mídia';
+$lang['refshow'] = 'Número de referências de mídia a exibir';
$lang['gdlib'] = 'Versão da biblioteca "GD Lib"';
$lang['im_convert'] = 'Caminho para a ferramenta de conversão ImageMagick';
$lang['jpg_quality'] = 'Qualidade de compressão do JPG (0-100)';
diff --git a/lib/scripts/behaviour.js b/lib/scripts/behaviour.js
index f1c46bf4c..85ddf503e 100644
--- a/lib/scripts/behaviour.js
+++ b/lib/scripts/behaviour.js
@@ -5,6 +5,7 @@
* @author Adrian Lang <mail@adrianlang.de>
*/
jQuery.fn.dw_hide = function(fn) {
+ this.attr('aria-expanded', 'false');
return this.slideUp('fast', fn);
};
@@ -15,6 +16,7 @@ jQuery.fn.dw_hide = function(fn) {
* @author Adrian Lang <mail@adrianlang.de>
*/
jQuery.fn.dw_show = function(fn) {
+ this.attr('aria-expanded', 'true');
return this.slideDown('fast', fn);
};
diff --git a/lib/scripts/edit.js b/lib/scripts/edit.js
index 5a5e829bd..b1dbff683 100644
--- a/lib/scripts/edit.js
+++ b/lib/scripts/edit.js
@@ -23,7 +23,7 @@ function createToolButton(icon,label,key,id,classname){
$btn.addClass(classname);
}
- $btn.attr('title', label);
+ $btn.attr('title', label).attr('aria-controls', 'wiki__text');
if(key){
$btn.attr('title', label + ' ['+key.toUpperCase()+']')
.attr('accessKey', key);
@@ -40,6 +40,7 @@ function createToolButton(icon,label,key,id,classname){
icon = DOKU_BASE + 'lib/images/toolbar/' + icon;
}
$ico.attr('src', icon);
+ $ico.attr('alt', '');
$ico.attr('width', 16);
$ico.attr('height', 16);
$btn.append($ico);
@@ -76,6 +77,7 @@ function createPicker(id,props,edid){
function $makebutton(title) {
var $btn = jQuery(document.createElement('button'))
.addClass('pickerbutton').attr('title', title)
+ .attr('aria-controls', edid)
.bind('click', bind(pickerInsert, title, edid))
.appendTo($picker);
return $btn;
@@ -93,6 +95,7 @@ function createPicker(id,props,edid){
}
jQuery(document.createElement('img'))
.attr('src', item)
+ .attr('alt', '')
.appendTo($makebutton(key));
}else if (typeof item == 'string'){
// a list of text -> treat as text picker
@@ -132,9 +135,9 @@ function pickerInsert(text,edid){
function addBtnActionSignature($btn, props, edid) {
if(typeof SIG != 'undefined' && SIG != ''){
$btn.bind('click', bind(insertAtCarret,edid,SIG));
- return true;
+ return edid;
}
- return false;
+ return '';
}
/**
diff --git a/lib/scripts/editor.js b/lib/scripts/editor.js
index 042e34608..2c0924eb7 100644
--- a/lib/scripts/editor.js
+++ b/lib/scripts/editor.js
@@ -65,6 +65,7 @@ var dw_editor = {
], function (_, img) {
jQuery(document.createElement('IMG'))
.attr('src', DOKU_BASE+'lib/images/' + img[0] + '.gif')
+ .attr('alt', '')
.click(img[1])
.appendTo($ctl);
});
diff --git a/lib/scripts/helpers.js b/lib/scripts/helpers.js
index d6f36967d..0b32e8781 100644
--- a/lib/scripts/helpers.js
+++ b/lib/scripts/helpers.js
@@ -3,25 +3,6 @@
*/
/**
- * Very simplistic Flash plugin check, probably works for Flash 8 and higher only
- *
- * @author Andreas Gohr <andi@splitbrain.org>
- */
-function hasFlash(version){
- var ver = 0;
- try{
- if(navigator.plugins != null && navigator.plugins.length > 0){
- ver = navigator.plugins["Shockwave Flash"].description.split(' ')[2].split('.')[0];
- }else{
- ver = (new ActiveXObject("ShockwaveFlash.ShockwaveFlash"))
- .GetVariable("$version").split(' ')[1].split(',')[0];
- }
- }catch(e){ }
-
- return ver >= version;
-}
-
-/**
* A PHP-style substr_replace
*
* Supports negative start and length and omitting length, but not
@@ -68,3 +49,18 @@ function bind(fnc/*, ... */) {
static_args.concat(Aps.call(arguments, 0)));
};
}
+
+/**
+ * Report an error from a JS file to the console
+ *
+ * @param e The error object
+ * @param file The file in which the error occurred
+ */
+function logError(e, file) {
+ if (window.console && console.error) {
+ console.error('The error "%s: %s" occurred in file "%s". ' +
+ 'If this is in a plugin try updating or disabling the plugin, ' +
+ 'if this is in a template try updating the template or switching to the "dokuwiki" template.',
+ e.name, e.message, file);
+ }
+}
diff --git a/lib/scripts/media.js b/lib/scripts/media.js
index 182d5fefe..8ca21ecab 100644
--- a/lib/scripts/media.js
+++ b/lib/scripts/media.js
@@ -921,23 +921,4 @@ var dw_mediamanager = {
}
};
-// moved from helpers.js temporarily here
-/**
- * Very simplistic Flash plugin check, probably works for Flash 8 and higher only
- *
- */
-function hasFlash(version){
- var ver = 0, axo;
- try{
- if(navigator.plugins !== null && navigator.plugins.length > 0){
- ver = navigator.plugins["Shockwave Flash"].description.split(' ')[2].split('.')[0];
- }else{
- axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
- ver = axo.GetVariable("$version").split(' ')[1].split(',')[0];
- }
- }catch(e){ }
-
- return ver >= version;
-}
-
jQuery(dw_mediamanager.init);
diff --git a/lib/scripts/page.js b/lib/scripts/page.js
index 4ab0bf9b5..7b4958d82 100644
--- a/lib/scripts/page.js
+++ b/lib/scripts/page.js
@@ -62,7 +62,9 @@ dw_page = {
$fndiv = jQuery(document.createElement('div'))
.attr('id', popup_id)
.addClass('insitu-footnote JSpopup')
- .mouseleave(function () {jQuery(this).hide();});
+ .attr('aria-hidden', 'true')
+ .mouseleave(function () {jQuery(this).hide().attr('aria-hidden', 'true');})
+ .attr('role', 'tooltip');
jQuery('.dokuwiki:first').append($fndiv);
}
@@ -97,7 +99,7 @@ dw_page = {
content = content.replace(/\bid=(['"])([^"']+)\1/gi,'id="insitu__$2');
// now put the content into the wrapper
- dw_page.insituPopup(this, 'insitu__fn').html(content).show();
+ dw_page.insituPopup(this, 'insitu__fn').html(content).show().attr('aria-hidden', 'false');
},
/**
diff --git a/lib/scripts/toolbar.js b/lib/scripts/toolbar.js
index 6d75215e0..5fc4d835e 100644
--- a/lib/scripts/toolbar.js
+++ b/lib/scripts/toolbar.js
@@ -52,8 +52,13 @@ function initToolbar(tbid,edid,tb, allowblock){
// type is a init function -> execute it
actionFunc = 'addBtnAction'+val.type.charAt(0).toUpperCase()+val.type.substring(1);
if( jQuery.isFunction(window[actionFunc]) ){
- if(window[actionFunc]($btn, val, edid)){
+ var pickerid = window[actionFunc]($btn, val, edid);
+ if(pickerid !== ''){
$toolbar.append($btn);
+ $btn.attr('aria-controls', pickerid);
+ if (actionFunc === 'addBtnActionPicker') {
+ $btn.attr('aria-haspopup', 'true');
+ }
}
return;
}
@@ -190,16 +195,17 @@ function tb_autohead(btn, props, edid){
*/
function addBtnActionPicker($btn, props, edid) {
var pickerid = 'picker'+(pickercounter++);
- createPicker(pickerid, props, edid);
+ var picker = createPicker(pickerid, props, edid);
+ jQuery(picker).attr('aria-hidden', 'true');
$btn.click(
function() {
pickerToggle(pickerid,$btn);
- return false;
+ return '';
}
);
- return true;
+ return pickerid;
}
/**
@@ -215,22 +221,26 @@ function addBtnActionLinkwiz(btn, props, edid) {
dw_linkwiz.init(jQuery('#'+edid));
jQuery(btn).click(function(){
dw_linkwiz.toggle();
- return false;
+ return '';
});
- return true;
+ return 'link__wiz';
}
/**
- * Show/Hide a previosly created picker window
+ * Show/Hide a previously created picker window
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function pickerToggle(pickerid,$btn){
var $picker = jQuery('#' + pickerid),
pos = $btn.offset();
- $picker.toggleClass('a11y')
- .offset({left: pos.left+3, top: pos.top+$btn[0].offsetHeight+3});
+ if ($picker.hasClass('a11y')) {
+ $picker.removeClass('a11y').attr('aria-hidden', 'false');
+ } else {
+ $picker.addClass('a11y').attr('aria-hidden', 'true');
+ }
+ $picker.offset({left: pos.left+3, top: pos.top+$btn[0].offsetHeight+3});
}
/**
@@ -252,4 +262,5 @@ function fixtxt(str){
jQuery(function () {
initToolbar('tool__bar','wiki__text',toolbar);
+ jQuery('#tool__bar').attr('role', 'toolbar');
});
diff --git a/lib/scripts/tree.js b/lib/scripts/tree.js
index 96763053d..c4e1da3f7 100644
--- a/lib/scripts/tree.js
+++ b/lib/scripts/tree.js
@@ -14,6 +14,12 @@ jQuery.fn.dw_tree = function(overrides) {
init: function () {
this.$obj.delegate(this.toggle_selector, 'click', this,
this.toggle);
+ jQuery('ul:first', this.$obj).attr('role', 'tree');
+ jQuery('ul', this.$obj).not(':first').attr('role', 'group');
+ jQuery('li', this.$obj).attr('role', 'treeitem');
+ jQuery('li.open > ul', this.$obj).attr('aria-expanded', 'true');
+ jQuery('li.closed > ul', this.$obj).attr('aria-expanded', 'false');
+ jQuery('li.closed', this.$obj).attr('aria-live', 'assertive');
},
/**
@@ -35,8 +41,14 @@ jQuery.fn.dw_tree = function(overrides) {
$listitem = $clicky.closest('li');
$sublist = $listitem.find('ul').first();
opening = $listitem.hasClass('closed');
- $listitem.toggleClass('open closed');
dw_tree.toggle_display($clicky, opening);
+ if ($sublist.is(':visible')) {
+ $listitem.removeClass('open').addClass('closed');
+ $sublist.attr('aria-expanded', 'false');
+ } else {
+ $listitem.removeClass('closed').addClass('open');
+ $sublist.attr('aria-expanded', 'true');
+ }
// if already open, close by hiding the sublist
if (!opening) {
@@ -48,6 +60,8 @@ jQuery.fn.dw_tree = function(overrides) {
$sublist.hide();
if (typeof data !== 'undefined') {
$sublist.html(data);
+ $sublist.parent().attr('aria-busy', 'false').removeAttr('aria-live');
+ jQuery('li.closed', $sublist).attr('aria-live', 'assertive');
}
if ($listitem.hasClass('open')) {
// Only show if user didn’t close the list since starting
@@ -63,11 +77,11 @@ jQuery.fn.dw_tree = function(overrides) {
}
//prepare the new ul
- $sublist = jQuery('<ul class="idx"/>');
+ $sublist = jQuery('<ul class="idx" role="group"/>');
$listitem.append($sublist);
timeout = window.setTimeout(
- bind(show_sublist, '<li><img src="' + DOKU_BASE + 'lib/images/throbber.gif" alt="loading..." title="loading..." /></li>'), dw_tree.throbber_delay);
+ bind(show_sublist, '<li aria-busy="true"><img src="' + DOKU_BASE + 'lib/images/throbber.gif" alt="loading..." title="loading..." /></li>'), dw_tree.throbber_delay);
dw_tree.load_data(function (data) {
window.clearTimeout(timeout);
diff --git a/lib/scripts/tw-sack.js b/lib/scripts/tw-sack.js
index cc988f5be..b0e570151 100644
--- a/lib/scripts/tw-sack.js
+++ b/lib/scripts/tw-sack.js
@@ -2,6 +2,7 @@
/* ©2005 Gregory Wild-Smith */
/* www.twilightuniverse.com */
/* Software licenced under a modified X11 licence, see documentation or authors website for more details */
+/* @deprecated */
function sack(file){
this.AjaxFailedAlert = "Your browser does not support the enhanced functionality of this website, and therefore you will have an experience that differs from the intended one.\n";
diff --git a/lib/tpl/dokuwiki/css/basic.css b/lib/tpl/dokuwiki/css/basic.css
index ad04f7c41..ba263f4c5 100644
--- a/lib/tpl/dokuwiki/css/basic.css
+++ b/lib/tpl/dokuwiki/css/basic.css
@@ -357,6 +357,9 @@ progress {
box-sizing: border-box;
}
+select {
+ max-width: 100%;
+}
optgroup {
font-style: italic;
font-weight: bold;
@@ -402,7 +405,7 @@ button,
.qq-upload-button {
color: #333;
background-color: #eee;
- background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxIDEiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPgo8bGluZWFyR3JhZGllbnQgaWQ9Imc4MjQiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjAlIiB5Mj0iMTAwJSI+CjxzdG9wIHN0b3AtY29sb3I9IiNGRkZGRkYiIG9mZnNldD0iMCIvPjxzdG9wIHN0b3AtY29sb3I9IiNGNEY0RjQiIG9mZnNldD0iMC4zIi8+PHN0b3Agc3RvcC1jb2xvcj0iI0VFRUVFRSIgb2Zmc2V0PSIwLjk5Ii8+PHN0b3Agc3RvcC1jb2xvcj0iI0NDQ0NDQyIgb2Zmc2V0PSIuOTkiLz4KPC9saW5lYXJHcmFkaWVudD4KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNnODI0KSIgLz4KPC9zdmc+);
+ background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxIDEiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPgo8bGluZWFyR3JhZGllbnQgaWQ9Imc4MjQiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjAlIiB5Mj0iMTAwJSI+CjxzdG9wIHN0b3AtY29sb3I9IiNGRkZGRkYiIG9mZnNldD0iMCIvPjxzdG9wIHN0b3AtY29sb3I9IiNGNEY0RjQiIG9mZnNldD0iMC4zIi8+PHN0b3Agc3RvcC1jb2xvcj0iI0VFRUVFRSIgb2Zmc2V0PSIwLjk5Ii8+PHN0b3Agc3RvcC1jb2xvcj0iI0NDQ0NDQyIgb2Zmc2V0PSIuOTkiLz4KPC9saW5lYXJHcmFkaWVudD4KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNnODI0KSIgLz4KPC9zdmc+');
background: -moz-linear-gradient( top, #ffffff 0%, #f4f4f4 30%, #eeeeee 99%, #cccccc 99%);
background: -webkit-linear-gradient(top, #ffffff 0%, #f4f4f4 30%, #eeeeee 99%, #cccccc 99%);
background: -o-linear-gradient( top, #ffffff 0%, #f4f4f4 30%, #eeeeee 99%, #cccccc 99%);
@@ -440,7 +443,7 @@ button:focus,
.qq-upload-button:hover {
border-color: #999;
background-color: #ddd;
- background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxIDEiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPgo8bGluZWFyR3JhZGllbnQgaWQ9Imc2NzAiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjAlIiB5Mj0iMTAwJSI+CjxzdG9wIHN0b3AtY29sb3I9IiNGRkZGRkYiIG9mZnNldD0iMCIvPjxzdG9wIHN0b3AtY29sb3I9IiNGNEY0RjQiIG9mZnNldD0iMC4zIi8+PHN0b3Agc3RvcC1jb2xvcj0iI0RERERERCIgb2Zmc2V0PSIwLjk5Ii8+PHN0b3Agc3RvcC1jb2xvcj0iI0JCQkJCQiIgb2Zmc2V0PSIuOTkiLz4KPC9saW5lYXJHcmFkaWVudD4KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNnNjcwKSIgLz4KPC9zdmc+);
+ background-image:url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxIDEiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPgo8bGluZWFyR3JhZGllbnQgaWQ9Imc2NzAiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjAlIiB5Mj0iMTAwJSI+CjxzdG9wIHN0b3AtY29sb3I9IiNGRkZGRkYiIG9mZnNldD0iMCIvPjxzdG9wIHN0b3AtY29sb3I9IiNGNEY0RjQiIG9mZnNldD0iMC4zIi8+PHN0b3Agc3RvcC1jb2xvcj0iI0RERERERCIgb2Zmc2V0PSIwLjk5Ii8+PHN0b3Agc3RvcC1jb2xvcj0iI0JCQkJCQiIgb2Zmc2V0PSIuOTkiLz4KPC9saW5lYXJHcmFkaWVudD4KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNnNjcwKSIgLz4KPC9zdmc+');
background: -moz-linear-gradient( top, #ffffff 0%, #f4f4f4 30%, #dddddd 99%, #bbbbbb 99%);
background: -webkit-linear-gradient(top, #ffffff 0%, #f4f4f4 30%, #dddddd 99%, #bbbbbb 99%);
background: -o-linear-gradient( top, #ffffff 0%, #f4f4f4 30%, #dddddd 99%, #bbbbbb 99%);
diff --git a/lib/tpl/dokuwiki/css/pagetools.css b/lib/tpl/dokuwiki/css/pagetools.css
index 21e5c13ec..98e4ff1fc 100644
--- a/lib/tpl/dokuwiki/css/pagetools.css
+++ b/lib/tpl/dokuwiki/css/pagetools.css
@@ -85,7 +85,7 @@
}
#dokuwiki__pagetools ul li a:before {
- content: url(images/pagetools-sprite.png);
+ content: url(images/pagetools-sprite.png?v=2);
display: inline-block;
font-size: 0;
line-height: 0;
@@ -163,259 +163,262 @@
/*____________ all available icons in sprite ____________*/
+#dokuwiki__pagetools ul li a.edit:before {
+ margin-top: -90px;
+}
#dokuwiki__pagetools ul li a.edit {
- background-position: right 0;
+ background-position: right -90px;
}
#dokuwiki__pagetools ul li a.edit:hover,
#dokuwiki__pagetools ul li a.edit:active,
#dokuwiki__pagetools ul li a.edit:focus {
- background-position: right -45px;
+ background-position: right -135px;
}
[dir=rtl] #dokuwiki__pagetools ul li a.edit {
- background-position: left 0;
+ background-position: left -90px;
}
[dir=rtl] #dokuwiki__pagetools ul li a.edit:hover,
[dir=rtl] #dokuwiki__pagetools ul li a.edit:active,
[dir=rtl] #dokuwiki__pagetools ul li a.edit:focus {
- background-position: left -45px;
+ background-position: left -135px;
}
#dokuwiki__pagetools ul li a.create:before {
- margin-top: -90px;
+ margin-top: -180px;
}
#dokuwiki__pagetools ul li a.create {
- background-position: right -90px;
+ background-position: right -180px;
}
#dokuwiki__pagetools ul li a.create:hover,
#dokuwiki__pagetools ul li a.create:active,
#dokuwiki__pagetools ul li a.create:focus {
- background-position: right -135px;
+ background-position: right -225px;
}
[dir=rtl] #dokuwiki__pagetools ul li a.create {
- background-position: left -90px;
+ background-position: left -180px;
}
[dir=rtl] #dokuwiki__pagetools ul li a.create:hover,
[dir=rtl] #dokuwiki__pagetools ul li a.create:active,
[dir=rtl] #dokuwiki__pagetools ul li a.create:focus {
- background-position: left -135px;
+ background-position: left -225px;
}
#dokuwiki__pagetools ul li a.show {
- background-position: right -270px;
+ background-position: right -360px;
}
#dokuwiki__pagetools ul li a.show:before {
- margin-top: -270px;
+ margin-top: -360px;
}
#dokuwiki__pagetools ul li a.show:hover,
#dokuwiki__pagetools ul li a.show:active,
#dokuwiki__pagetools ul li a.show:focus {
- background-position: right -315px;
+ background-position: right -405px;
}
[dir=rtl] #dokuwiki__pagetools ul li a.show {
- background-position: left -270px;
+ background-position: left -360px;
}
[dir=rtl] #dokuwiki__pagetools ul li a.show:hover,
[dir=rtl] #dokuwiki__pagetools ul li a.show:active,
[dir=rtl] #dokuwiki__pagetools ul li a.show:focus {
- background-position: left -315px;
+ background-position: left -405px;
}
#dokuwiki__pagetools ul li a.source {
- background-position: right -360px;
+ background-position: right -450px;
}
#dokuwiki__pagetools ul li a.source:before {
- margin-top: -360px;
+ margin-top: -450px;
}
#dokuwiki__pagetools ul li a.source:hover,
#dokuwiki__pagetools ul li a.source:active,
#dokuwiki__pagetools ul li a.source:focus {
- background-position: right -405px;
+ background-position: right -495px;
}
[dir=rtl] #dokuwiki__pagetools ul li a.source {
- background-position: left -360px;
+ background-position: left -450px;
}
[dir=rtl] #dokuwiki__pagetools ul li a.source:hover,
[dir=rtl] #dokuwiki__pagetools ul li a.source:active,
[dir=rtl] #dokuwiki__pagetools ul li a.source:focus {
- background-position: left -405px;
+ background-position: left -495px;
}
#dokuwiki__pagetools ul li a.draft {
- background-position: right -180px;
+ background-position: right -270px;
}
#dokuwiki__pagetools ul li a.draft:before {
- margin-top: -180px;
+ margin-top: -270px;
}
#dokuwiki__pagetools ul li a.draft:hover,
#dokuwiki__pagetools ul li a.draft:active,
#dokuwiki__pagetools ul li a.draft:focus {
- background-position: right -225px;
+ background-position: right -315px;
}
[dir=rtl] #dokuwiki__pagetools ul li a.draft {
- background-position: left -180px;
+ background-position: left -270px;
}
[dir=rtl] #dokuwiki__pagetools ul li a.draft:hover,
[dir=rtl] #dokuwiki__pagetools ul li a.draft:active,
[dir=rtl] #dokuwiki__pagetools ul li a.draft:focus {
- background-position: left -225px;
+ background-position: left -315px;
}
#dokuwiki__pagetools ul li a.revs {
- background-position: right -540px;
+ background-position: right -630px;
}
#dokuwiki__pagetools ul li a.revs:before {
- margin-top: -540px;
+ margin-top: -630px;
}
#dokuwiki__pagetools ul li a.revs:hover,
#dokuwiki__pagetools ul li a.revs:active,
#dokuwiki__pagetools ul li a.revs:focus,
.mode_revisions #dokuwiki__pagetools ul li a.revs {
- background-position: right -585px;
+ background-position: right -675px;
}
.mode_revisions #dokuwiki__pagetools ul li a.revs:before {
- margin-top: -585px;
+ margin-top: -675px;
}
[dir=rtl] #dokuwiki__pagetools ul li a.revs {
- background-position: left -540px;
+ background-position: left -630px;
}
[dir=rtl] #dokuwiki__pagetools ul li a.revs:hover,
[dir=rtl] #dokuwiki__pagetools ul li a.revs:active,
[dir=rtl] #dokuwiki__pagetools ul li a.revs:focus,
[dir=rtl] .mode_revisions #dokuwiki__pagetools ul li a.revs {
- background-position: left -585px;
+ background-position: left -675px;
}
#dokuwiki__pagetools ul li a.backlink {
- background-position: right -630px;
+ background-position: right -720px;
}
#dokuwiki__pagetools ul li a.backlink:before {
- margin-top: -630px;
+ margin-top: -720px;
}
#dokuwiki__pagetools ul li a.backlink:hover,
#dokuwiki__pagetools ul li a.backlink:active,
#dokuwiki__pagetools ul li a.backlink:focus,
.mode_backlink #dokuwiki__pagetools ul li a.backlink {
- background-position: right -675px;
+ background-position: right -765px;
}
.mode_backlink #dokuwiki__pagetools ul li a.backlink:before {
- margin-top: -675px;
+ margin-top: -765px;
}
[dir=rtl] #dokuwiki__pagetools ul li a.backlink {
- background-position: left -630px;
+ background-position: left -720px;
}
[dir=rtl] #dokuwiki__pagetools ul li a.backlink:hover,
[dir=rtl] #dokuwiki__pagetools ul li a.backlink:active,
[dir=rtl] #dokuwiki__pagetools ul li a.backlink:focus,
[dir=rtl] .mode_backlink #dokuwiki__pagetools ul li a.backlink {
- background-position: left -675px;
+ background-position: left -765px;
}
#dokuwiki__pagetools ul li a.top {
- background-position: right -810px;
+ background-position: right -900px;
}
#dokuwiki__pagetools ul li a.top:before{
- margin-top: -810px;
+ margin-top: -900px;
}
#dokuwiki__pagetools ul li a.top:hover,
#dokuwiki__pagetools ul li a.top:active,
#dokuwiki__pagetools ul li a.top:focus {
- background-position: right -855px;
+ background-position: right -945px;
}
[dir=rtl] #dokuwiki__pagetools ul li a.top {
- background-position: left -810px;
+ background-position: left -900px;
}
[dir=rtl] #dokuwiki__pagetools ul li a.top:hover,
[dir=rtl] #dokuwiki__pagetools ul li a.top:active,
[dir=rtl] #dokuwiki__pagetools ul li a.top:focus {
- background-position: left -855px;
+ background-position: left -945px;
}
#dokuwiki__pagetools ul li a.revert {
- background-position: right -450px;
+ background-position: right -540px;
}
#dokuwiki__pagetools ul li a.revert:before {
- margin-top: -450px;
+ margin-top: -540px;
}
#dokuwiki__pagetools ul li a.revert:hover,
#dokuwiki__pagetools ul li a.revert:active,
#dokuwiki__pagetools ul li a.revert:focus,
.mode_revert #dokuwiki__pagetools ul li a.revert {
- background-position: right -495px;
+ background-position: right -585px;
}
.mode_revert #dokuwiki__pagetools ul li a.revert:before {
- margin-top: -450px;
+ margin-top: -540px;
}
[dir=rtl] #dokuwiki__pagetools ul li a.revert {
- background-position: left -450px;
+ background-position: left -540px;
}
[dir=rtl] #dokuwiki__pagetools ul li a.revert:hover,
[dir=rtl] #dokuwiki__pagetools ul li a.revert:active,
[dir=rtl] #dokuwiki__pagetools ul li a.revert:focus,
[dir=rtl] .mode_revert #dokuwiki__pagetools ul li a.revert {
- background-position: left -495px;
+ background-position: left -585px;
}
#dokuwiki__pagetools ul li a.subscribe {
- background-position: right -720px;
+ background-position: right -810px;
}
#dokuwiki__pagetools ul li a.subscribe:before {
- margin-top: -720px;
+ margin-top: -810px;
}
#dokuwiki__pagetools ul li a.subscribe:hover,
#dokuwiki__pagetools ul li a.subscribe:active,
#dokuwiki__pagetools ul li a.subscribe:focus,
.mode_subscribe #dokuwiki__pagetools ul li a.subscribe {
- background-position: right -765px;
+ background-position: right -855px;
}
.mode_subscribe #dokuwiki__pagetools ul li a.subscribe:before {
- margin-top: -765px;
+ margin-top: -855px;
}
[dir=rtl] #dokuwiki__pagetools ul li a.subscribe {
- background-position: left -720px;
+ background-position: left -810px;
}
[dir=rtl] #dokuwiki__pagetools ul li a.subscribe:hover,
[dir=rtl] #dokuwiki__pagetools ul li a.subscribe:active,
[dir=rtl] #dokuwiki__pagetools ul li a.subscribe:focus,
[dir=rtl] .mode_subscribe #dokuwiki__pagetools ul li a.subscribe {
- background-position: left -765px;
+ background-position: left -855px;
}
#dokuwiki__pagetools ul li a.mediaManager {
- background-position: right -900px;
+ background-position: right -990px;
}
#dokuwiki__pagetools ul li a.mediaManager:before {
- margin-top: -900px;
+ margin-top: -990px;
}
#dokuwiki__pagetools ul li a.mediaManager:hover,
#dokuwiki__pagetools ul li a.mediaManager:active,
#dokuwiki__pagetools ul li a.mediaManager:focus {
- background-position: right -945px;
+ background-position: right -1035px;
}
[dir=rtl] #dokuwiki__pagetools ul li a.mediaManager {
- background-position: left -900px;
+ background-position: left -990px;
}
[dir=rtl] #dokuwiki__pagetools ul li a.mediaManager:hover,
[dir=rtl] #dokuwiki__pagetools ul li a.mediaManager:active,
[dir=rtl] #dokuwiki__pagetools ul li a.mediaManager:focus {
- background-position: left -945px;
+ background-position: left -1035px;
}
#dokuwiki__pagetools ul li a.back {
- background-position: right -990px;
+ background-position: right -1080px;
}
-#dokuwiki__pagetools ul li a.back {
- margin-top: -990px;
+#dokuwiki__pagetools ul li a.back:before {
+ margin-top: -1080px;
}
#dokuwiki__pagetools ul li a.back:hover,
#dokuwiki__pagetools ul li a.back:active,
#dokuwiki__pagetools ul li a.back:focus {
- background-position: right -1035px;
+ background-position: right -1125px;
}
[dir=rtl] #dokuwiki__pagetools ul li a.back {
- background-position: left -990px;
+ background-position: left -1080px;
}
[dir=rtl] #dokuwiki__pagetools ul li a.back:hover,
[dir=rtl] #dokuwiki__pagetools ul li a.back:active,
[dir=rtl] #dokuwiki__pagetools ul li a.back:focus {
- background-position: left -1035px;
+ background-position: left -1125px;
}
diff --git a/lib/tpl/dokuwiki/detail.php b/lib/tpl/dokuwiki/detail.php
index d2ed530a3..7e46231d3 100644
--- a/lib/tpl/dokuwiki/detail.php
+++ b/lib/tpl/dokuwiki/detail.php
@@ -28,8 +28,8 @@ header('X-UA-Compatible: IE=edge,chrome=1');
<body>
<!--[if lte IE 7 ]><div id="IE7"><![endif]--><!--[if IE 8 ]><div id="IE8"><![endif]-->
- <div id="dokuwiki__site"><div id="dokuwiki__top"
- class="dokuwiki site mode_<?php echo $ACT ?>">
+ <div id="dokuwiki__site"><div id="dokuwiki__top" class="site <?php echo tpl_classes(); ?> <?php
+ echo ($showSidebar) ? 'showSidebar' : ''; ?> <?php echo ($hasSidebar) ? 'hasSidebar' : ''; ?>">
<?php include('tpl_header.php') ?>
@@ -109,16 +109,32 @@ header('X-UA-Compatible: IE=edge,chrome=1');
<h3 class="a11y"><?php echo $lang['page_tools']; ?></h3>
<div class="tools">
<ul>
- <?php // View in media manager; @todo: transfer logic to backend
+ <?php
+ $data = array();
+
+ // View in media manager; @todo: transfer logic to backend
$imgNS = getNS($IMG);
$authNS = auth_quickaclcheck("$imgNS:*");
if (($authNS >= AUTH_UPLOAD) && function_exists('media_managerURL')) {
$mmURL = media_managerURL(array('ns' => $imgNS, 'image' => $IMG));
- echo '<li><a href="'.$mmURL.'" class="mediaManager"><span>'.$lang['img_manager'].'</span></a></li>';
+ $data['mediaManager'] = '<li><a href="'.$mmURL.'" class="mediaManager"><span>'.$lang['img_manager'].'</span></a></li>';
}
- ?>
- <?php // Back to [ID]; @todo: transfer logic to backend
- echo '<li><a href="'.wl($ID).'" class="back"><span>'.$lang['img_backto'].' '.$ID.'</span></a></li>';
+
+ // Back to [ID]; @todo: transfer logic to backend
+ $data['img_backto'] = '<li><a href="'.wl($ID).'" class="back"><span>'.$lang['img_backto'].' '.$ID.'</span></a></li>';
+
+ // the page tools can be ammended through a custom plugin hook
+ // if you're deriving from this template and your design is close enough to
+ // the dokuwiki template you might want to trigger a DOKUWIKI event instead
+ // of using $conf['tpl'] here
+ $hook = 'TEMPLATE_'.strtoupper($conf['tpl']).'_PAGETOOLS_DISPLAY';
+ $evt = new Doku_Event($hook, $data);
+ if($evt->advise_before()){
+ foreach($evt->data as $k => $html) echo $html;
+ }
+ $evt->advise_after();
+ unset($data);
+ unset($evt);
?>
</ul>
</div>
diff --git a/lib/tpl/dokuwiki/images/pagetools-sprite.png b/lib/tpl/dokuwiki/images/pagetools-sprite.png
index 898f0f4a6..b6e808717 100644
--- a/lib/tpl/dokuwiki/images/pagetools-sprite.png
+++ b/lib/tpl/dokuwiki/images/pagetools-sprite.png
Binary files differ
diff --git a/lib/tpl/dokuwiki/images/pagetools/00_default.png b/lib/tpl/dokuwiki/images/pagetools/00_default.png
new file mode 100644
index 000000000..95d122e17
--- /dev/null
+++ b/lib/tpl/dokuwiki/images/pagetools/00_default.png
Binary files differ
diff --git a/lib/tpl/dokuwiki/main.php b/lib/tpl/dokuwiki/main.php
index 43a0c0da7..9e507d86d 100644
--- a/lib/tpl/dokuwiki/main.php
+++ b/lib/tpl/dokuwiki/main.php
@@ -27,9 +27,8 @@ $showSidebar = $hasSidebar && ($ACT=='show');
<body>
<!--[if lte IE 7 ]><div id="IE7"><![endif]--><!--[if IE 8 ]><div id="IE8"><![endif]-->
- <div id="dokuwiki__site"><div id="dokuwiki__top"
- class="dokuwiki site mode_<?php echo $ACT ?> <?php echo ($showSidebar) ? 'showSidebar' : '';
- ?> <?php echo ($hasSidebar) ? 'hasSidebar' : ''; ?>">
+ <div id="dokuwiki__site"><div id="dokuwiki__top" class="site <?php echo tpl_classes(); ?> <?php
+ echo ($showSidebar) ? 'showSidebar' : ''; ?> <?php echo ($hasSidebar) ? 'hasSidebar' : ''; ?>">
<?php include('tpl_header.php') ?>
@@ -75,12 +74,27 @@ $showSidebar = $hasSidebar && ($ACT=='show');
<div class="tools">
<ul>
<?php
- tpl_action('edit', 1, 'li', 0, '<span>', '</span>');
- tpl_action('revert', 1, 'li', 0, '<span>', '</span>');
- tpl_action('revisions', 1, 'li', 0, '<span>', '</span>');
- tpl_action('backlink', 1, 'li', 0, '<span>', '</span>');
- tpl_action('subscribe', 1, 'li', 0, '<span>', '</span>');
- tpl_action('top', 1, 'li', 0, '<span>', '</span>');
+ $data = array(
+ 'edit' => tpl_action('edit', 1, 'li', 1, '<span>', '</span>'),
+ 'revert' => tpl_action('revert', 1, 'li', 1, '<span>', '</span>'),
+ 'revisions' => tpl_action('revisions', 1, 'li', 1, '<span>', '</span>'),
+ 'backlink' => tpl_action('backlink', 1, 'li', 1, '<span>', '</span>'),
+ 'subscribe' => tpl_action('subscribe', 1, 'li', 1, '<span>', '</span>'),
+ 'top' => tpl_action('top', 1, 'li', 1, '<span>', '</span>')
+ );
+
+ // the page tools can be ammended through a custom plugin hook
+ // if you're deriving from this template and your design is close enough to
+ // the dokuwiki template you might want to trigger a DOKUWIKI event instead
+ // of using $conf['tpl'] here
+ $hook = 'TEMPLATE_'.strtoupper($conf['tpl']).'_PAGETOOLS_DISPLAY';
+ $evt = new Doku_Event($hook, $data);
+ if($evt->advise_before()){
+ foreach($evt->data as $k => $html) echo $html;
+ }
+ $evt->advise_after();
+ unset($data);
+ unset($evt);
?>
</ul>
</div>