Index: trunk/extensions/Wikidata/App.php |
— | — | @@ -103,8 +103,18 @@ |
104 | 104 | global $wgOut,$wgScriptPath; |
105 | 105 | $dc=wdGetDataSetContext(); |
106 | 106 | $wgOut->addScript("<script type='text/javascript' src='{$wgScriptPath}/extensions/Wikidata/OmegaWiki/suggest.js'></script>"); |
107 | | - $wgOut->addLink(array('rel'=>'stylesheet','type'=>'text/css','media'=>'screen, projection','href'=>"{$wgScriptPath}/extensions/Wikidata/OmegaWiki/suggest.css")); |
108 | | - $wgOut->addLink(array('rel'=>'stylesheet','type'=>'text/css','media'=>'screen, projection','href'=>"{$wgScriptPath}/extensions/Wikidata/OmegaWiki/tables.css")); |
| 107 | + |
| 108 | + global $wgLang; |
| 109 | + if ($wgLang->isRTL()) |
| 110 | + { |
| 111 | + $wgOut->addLink(array('rel'=>'stylesheet','type'=>'text/css','media'=>'screen, projection','href'=>"{$wgScriptPath}/extensions/Wikidata/OmegaWiki/suggest-rtl.css")); |
| 112 | + $wgOut->addLink(array('rel'=>'stylesheet','type'=>'text/css','media'=>'screen, projection','href'=>"{$wgScriptPath}/extensions/Wikidata/OmegaWiki/tables-rtl.css")); |
| 113 | + } |
| 114 | + else |
| 115 | + { |
| 116 | + $wgOut->addLink(array('rel'=>'stylesheet','type'=>'text/css','media'=>'screen, projection','href'=>"{$wgScriptPath}/extensions/Wikidata/OmegaWiki/suggest.css")); |
| 117 | + $wgOut->addLink(array('rel'=>'stylesheet','type'=>'text/css','media'=>'screen, projection','href'=>"{$wgScriptPath}/extensions/Wikidata/OmegaWiki/tables.css")); |
| 118 | + } |
109 | 119 | return true; |
110 | 120 | } |
111 | 121 | |
Index: trunk/extensions/Wikidata/OmegaWiki/tables-rtl.css |
— | — | @@ -0,0 +1,191 @@ |
| 2 | +/* |
| 3 | + Copy |
| 4 | + @import url("../../extensions/Wikidata/WiktionaryZ/tmp/tables.css"); |
| 5 | + |
| 6 | + into the appropriate stylesheets like |
| 7 | + skins/monobook/main.css |
| 8 | + skins/common/common.css |
| 9 | +*/ |
| 10 | + |
| 11 | +/* Wikidata tables */ |
| 12 | + |
| 13 | +.wiki-data-table td, .wiki-data-table th { |
| 14 | + padding-top: 0px; |
| 15 | + padding-bottom: 0px; |
| 16 | + padding-left: 2px; |
| 17 | + padding-right: 2px; |
| 18 | + margin: 0px; |
| 19 | + border: none; |
| 20 | +} |
| 21 | + |
| 22 | +.wiki-data-table th { |
| 23 | + background-color: #EEEEEE; |
| 24 | + text-align: right; |
| 25 | + vertical-align: bottom; |
| 26 | + white-space: nowrap; |
| 27 | +} |
| 28 | + |
| 29 | +.wiki-data-table th.sortable { |
| 30 | + cursor: pointer; |
| 31 | +} |
| 32 | + |
| 33 | +.wiki-data-table th.sortedUp { |
| 34 | + padding-left: 15px; |
| 35 | + background-image: url('../../../skins/common/images/sort_up.gif'); |
| 36 | + background-repeat: no-repeat; |
| 37 | + background-position: bottom left; |
| 38 | +} |
| 39 | + |
| 40 | +.wiki-data-table th.sortedDown { |
| 41 | + padding-left: 15px; |
| 42 | + |
| 43 | + background-image: url('../../../skins/common/images/sort_down.gif'); |
| 44 | + background-repeat: no-repeat; |
| 45 | + background-position: bottom left; |
| 46 | +} |
| 47 | + |
| 48 | +.wiki-data-table td.column-odd { |
| 49 | + background-color: #F6F6F6; |
| 50 | +} |
| 51 | + |
| 52 | +.wiki-data-table td.column-even { |
| 53 | + background-color: #FFFFFF; |
| 54 | +} |
| 55 | +.boolean { |
| 56 | + text-align: center; |
| 57 | +} |
| 58 | + |
| 59 | +.integer { |
| 60 | + text-align: left; |
| 61 | +} |
| 62 | + |
| 63 | +.language, .text, .short-text { |
| 64 | + text-align: right; |
| 65 | +} |
| 66 | + |
| 67 | +/*.wiki-data-table td.language { |
| 68 | + font-style: italic; |
| 69 | +}*/ |
| 70 | + |
| 71 | +.wiki-data-table td.text { |
| 72 | + padding-bottom: 4px; |
| 73 | +} |
| 74 | + |
| 75 | +.wiki-data-table td { |
| 76 | + vertical-align: top; |
| 77 | +} |
| 78 | + |
| 79 | +.wiki-data-table td.remove { |
| 80 | + text-align: center; |
| 81 | + background-color: #EEEEEE; |
| 82 | +} |
| 83 | + |
| 84 | +.wiki-data-table tr.to-be-removed td.column-odd, .wiki-data-table tr.to-be-removed td.remove { |
| 85 | + background: #FFD8C0; |
| 86 | +} |
| 87 | + |
| 88 | +.wiki-data-table tr.to-be-removed td.column-even { |
| 89 | + background: #FFE8D0; |
| 90 | +} |
| 91 | + |
| 92 | +.wiki-data-table tr.to-be-removed th { |
| 93 | + background: #FFD0B2; |
| 94 | +} |
| 95 | + |
| 96 | +.wiki-data-table th.remove, .wiki-data-table th.input-rows { |
| 97 | + font-weight: normal; |
| 98 | + padding-left: 4px; |
| 99 | + padding-right: 4px; |
| 100 | +} |
| 101 | + |
| 102 | +.wiki-data-table td .wiki-data-table td textarea, li .wiki-data-table td textarea { |
| 103 | + width: auto; |
| 104 | +} |
| 105 | + |
| 106 | +td.add { |
| 107 | + text-align: center; |
| 108 | +} |
| 109 | + |
| 110 | +/* Toggle */ |
| 111 | + |
| 112 | +.toggle { |
| 113 | + cursor: pointer; |
| 114 | + text-indent: 0px; |
| 115 | + margin: 0px; |
| 116 | + /*color: #000000; |
| 117 | + border-width: 1px; |
| 118 | + border-color: #AAAAAA; |
| 119 | + border-style: dotted; |
| 120 | + padding-left: 0px; |
| 121 | + font-size: 80%;*/ |
| 122 | +} |
| 123 | + |
| 124 | +/* Attribute list */ |
| 125 | + |
| 126 | +ul.collapsable-items { |
| 127 | + list-style: none; |
| 128 | + list-style-image: none; |
| 129 | + list-style-type: none; |
| 130 | +} |
| 131 | + |
| 132 | +.collapsable-items .toggle { |
| 133 | + margin-right: 0px; |
| 134 | + text-indent: 0px; |
| 135 | +} |
| 136 | + |
| 137 | +/* Option panel */ |
| 138 | + |
| 139 | +.option-panel { |
| 140 | + margin: 8px 4px 4px 4px; |
| 141 | + padding: 8px; |
| 142 | + border-style: solid; |
| 143 | + border-width: 1px; |
| 144 | + border-color: #AAAAAA; |
| 145 | +} |
| 146 | + |
| 147 | +.option-panel, .option-panel th, .option-panel td { |
| 148 | + background-color: #F5F5F5; |
| 149 | +} |
| 150 | + |
| 151 | +.option-panel th { |
| 152 | + padding-left: 8px; |
| 153 | + white-space: nowrap; |
| 154 | + text-align: right; |
| 155 | +} |
| 156 | + |
| 157 | +.option-panel table { |
| 158 | + width: 100%; |
| 159 | +} |
| 160 | + |
| 161 | +.option-panel td.option-field { |
| 162 | + width: 100%; |
| 163 | + padding-top: 1px; |
| 164 | + padding-bottom: 1px; |
| 165 | +} |
| 166 | + |
| 167 | +.dataset-panel { |
| 168 | + float:left; |
| 169 | + margin-right:0.5em; |
| 170 | +} |
| 171 | + |
| 172 | +.dataset-panel-heading { |
| 173 | + vertical-align: top; |
| 174 | + font-size:100%; |
| 175 | +} |
| 176 | + |
| 177 | +.dataset-panel-active { |
| 178 | + background:#f0f0f0; |
| 179 | + text-align:center; |
| 180 | + border-style:solid; |
| 181 | + border-width:1px; |
| 182 | + font-size:110%; |
| 183 | + font-weight:bold; |
| 184 | +} |
| 185 | + |
| 186 | +.dataset-panel-inactive { |
| 187 | + background:white; |
| 188 | + text-align:center; |
| 189 | + border-style:solid; |
| 190 | + border-width:1px; |
| 191 | + font-size:110%; |
| 192 | +} |
\ No newline at end of file |
Property changes on: trunk/extensions/Wikidata/OmegaWiki/tables-rtl.css |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 193 | + native |
Index: trunk/extensions/Wikidata/OmegaWiki/suggest-rtl.css |
— | — | @@ -0,0 +1,105 @@ |
| 2 | +/* |
| 3 | + Copy |
| 4 | + @import url("../../extensions/Wikidata/WiktionaryZ/tmp/suggest.css"); |
| 5 | + |
| 6 | + into the appropriate stylesheets like |
| 7 | + skins/monobook/main.css |
| 8 | + skins/common/common.css |
| 9 | +*/ |
| 10 | + |
| 11 | + |
| 12 | +/* Suggestion control */ |
| 13 | + |
| 14 | +.suggest-link { |
| 15 | + dir: rtl; |
| 16 | + padding-left: 22px; |
| 17 | + padding-right: 2px; |
| 18 | + cursor: pointer; |
| 19 | + border-width: 1px; |
| 20 | + border-style: solid; |
| 21 | + border-color: #7F9DB9; |
| 22 | + |
| 23 | + background-image: url("../Images/ArrowButtonDown1px.png"); |
| 24 | + background-repeat: no-repeat; |
| 25 | + background-position: center left; |
| 26 | +} |
| 27 | + |
| 28 | +.wiki-data-table td .suggest-link, .option-panel td .suggest-link { |
| 29 | + dir: rtl; |
| 30 | + display: block; |
| 31 | + zoom: 1; |
| 32 | + right: 0px; |
| 33 | + left: 1px; |
| 34 | + top: 1px; |
| 35 | + bottom: 0px; |
| 36 | + background-color: #FFFFFF; |
| 37 | +} |
| 38 | + |
| 39 | +/* Internet Explorer hack */ |
| 40 | +* html .suggest-link { |
| 41 | + background-image: url("../Images/ArrowButtonDown2px.png"); |
| 42 | +} |
| 43 | + |
| 44 | +/* Internet Explorer hack */ |
| 45 | +* html .wiki-data-table td .suggest-link { |
| 46 | + background-image: url("../../Images/ArrowButtonDown1px.png"); |
| 47 | +} |
| 48 | + |
| 49 | +.suggest-drop-down { |
| 50 | + /*font-size: 1em;*/ |
| 51 | + dir: rtl; |
| 52 | + font-size: 13px; |
| 53 | +} |
| 54 | + |
| 55 | +.suggest-link, .suggest-link:hover, .suggest-link:active, .suggest-link:visited { |
| 56 | + dir: rtl; |
| 57 | + color: #000000; |
| 58 | + text-decoration: none; |
| 59 | + white-space: nowrap; |
| 60 | +} |
| 61 | + |
| 62 | +td .suggest-link, td .suggest-link:hover, td .suggest-link:active, td .suggest-link:visited { |
| 63 | + dir: rtl; |
| 64 | + white-space: normal; |
| 65 | +} |
| 66 | + |
| 67 | +.suggestion-row { |
| 68 | + dir: rtl; |
| 69 | + padding: 0px; |
| 70 | + margin: 0px; |
| 71 | +} |
| 72 | + |
| 73 | +.suggestion-row.active td.column-even, .suggestion-row.active td.column-odd { |
| 74 | + /*background-color: #DDDDDD;*/ |
| 75 | + dir: rtl; |
| 76 | + background-color: #CECCF7; |
| 77 | + cursor: pointer; |
| 78 | +} |
| 79 | + |
| 80 | +.suggestion-row td { |
| 81 | + dir: rtl; |
| 82 | + padding-top: 0px; |
| 83 | + padding-bottom: 0px; |
| 84 | + padding-left: 4px; |
| 85 | + padding-right: 4px; |
| 86 | + margin-top: 0px; |
| 87 | + margin-bottom: 0px; |
| 88 | + white-space: nowrap; |
| 89 | +} |
| 90 | + |
| 91 | +.suggest-loading { |
| 92 | + dir: rtl; |
| 93 | + background-color: #DDDDDD; |
| 94 | +} |
| 95 | + |
| 96 | +.suggest-next { |
| 97 | + dir: rtl; |
| 98 | + margin-right: 2px; |
| 99 | + margin-left: 8px; |
| 100 | +} |
| 101 | + |
| 102 | +.suggest-previous { |
| 103 | + dir: rtl; |
| 104 | + margin-right: 8px; |
| 105 | + margin-left: 2px; |
| 106 | +} |
\ No newline at end of file |
Property changes on: trunk/extensions/Wikidata/OmegaWiki/suggest-rtl.css |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 107 | + native |
Index: trunk/extensions/Wikidata/OmegaWiki/forms.php |
— | — | @@ -81,7 +81,7 @@ |
82 | 82 | */ |
83 | 83 | function getSuggest($name, $query, $parameters = array(), $value=0, $label='', $displayLabelColumns = array(0), DataSet $dc=null) { |
84 | 84 | global |
85 | | - $wgScriptPath; |
| 85 | + $wgScriptPath, $wgLang; |
86 | 86 | |
87 | 87 | if(is_null($dc)) { |
88 | 88 | $dc=wdGetDataSetContext(); |
— | — | @@ -103,7 +103,24 @@ |
104 | 104 | |
105 | 105 | $result .= |
106 | 106 | '<a id="'. $name .'-suggest-link" class="suggest-link" onclick="suggestLinkClicked(event, this);" title="' . wfMsgSc("SuggestHint") . '">' . $label . '</a>' . |
107 | | - '</span>'. |
| 107 | + '</span>'; |
| 108 | + |
| 109 | + if ($wgLang->isRTL()) |
| 110 | + $result .= |
| 111 | + '<div class="suggest-drop-down" style="position: relative"><div id="'. $name .'-suggest-div" style="position: absolute; right: 0px; top: 0px; border: 1px solid #000000; display: none; background-color: white; padding: 4px">' . |
| 112 | + '<div><table>' . |
| 113 | + '<tr>' . |
| 114 | + '<td><input type="text" id="'. $name .'-suggest-text" autocomplete="off" onkeyup="suggestTextChanged(this)" style="width: 300px"></input></td>' . |
| 115 | + '<td><a id="'. $name .'-suggest-clear" href="javascript:void(0)" onclick="suggestClearClicked(event, this)">' . wfMsg('ow_suggest_clear') . '</a></td>' . |
| 116 | + '<td style="white-space: nowrap"><a id="'. $name .'-suggest-previous" href="javascript:void(0)" class="suggest-previous" onclick="suggestPreviousClicked(event, this)"><img src="'.$wgScriptPath.'/extensions/Wikidata/Images/ArrowRight.png" alt="' . wfMsg('ow_suggest_previous') . '"/> ' . wfMsg('ow_suggest_previous') . '</a></td>'. |
| 117 | + '<td style="white-space: nowrap"><a id="'. $name .'-suggest-next" href="javascript:void(0)" class="suggest-next" onclick="suggestNextClicked(event, this)">' . wfMsg('ow_suggest_next') . ' <img src="'.$wgScriptPath.'/extensions/Wikidata/Images/ArrowLeft.png" alt="' . wfMsg('ow_suggest_next') . '"/></a></td>'. |
| 118 | + '<td><a id="'. $name .'-suggest-close" href="javascript:void(0)" onclick="suggestCloseClicked(event, this)">[X]</a></td>' . |
| 119 | + '</tr>' . |
| 120 | + '</table></div>' . |
| 121 | + '<div><table id="'. $name .'-suggest-table"><tr><td></td></tr></table></div>'. |
| 122 | + '</div></div>'; |
| 123 | + else |
| 124 | + $result .= |
108 | 125 | '<div class="suggest-drop-down" style="position: relative"><div id="'. $name .'-suggest-div" style="position: absolute; left: 0px; top: 0px; border: 1px solid #000000; display: none; background-color: white; padding: 4px">' . |
109 | 126 | '<div><table>' . |
110 | 127 | '<tr>' . |