r94882 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94881‎ | r94882 | r94883 >
Date:11:51, 18 August 2011
Author:devayon
Status:deferred
Tags:
Comment:
modal-window for mainlabel
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/languages/SMW_Messages.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/skins/SMW_custom.css (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUIHelper.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUIHelper.php
@@ -591,11 +591,21 @@
592592 array( 'href' => 'javascript:smwRemoveMainLabel()' ) ) .
593593 '<img src="' . $smwgScriptPath . '/skins/images/close-button.png" alt="' . wfMsg( 'smw_qui_delete' ) . '">' .
594594 '</a>' .
595 - '</span>' .
 595+ '</span><strong>' .
596596 wfMsg( 'smw_qui_rescol' ) .
597 - '</span>' .
598 - '<input size="25" value="' . $mainLabelText . '" id="mainlabelvis" />' .
599 - '<input type="hidden" name="pmainlabel" value="' . $mainLabel . '" id="mainlabelhid" />' .
 597+ '</strong></span>' .
 598+ Xml::openElement( 'div',
 599+ array( 'id' => 'mainlabel-dialog',
 600+ 'title' => wfMsg( 'smw_qui_mainlabopts'),
 601+ 'class' => 'smwmainlabdialog' )
 602+ ).
 603+ '<table align="center" ><tr>'.
 604+ '<td>'. wfMsg('smw_qui_dlabel'). '</td>'.
 605+ '<td><input size="25" value="' . $mainLabelText . '" id="mainlabelvis" /></td>'.
 606+ '</tr></table>' .
 607+ '</div>'.
 608+ '<input type="hidden" name="pmainlabel" value="' . $mainLabel . '" id="mainlabelhid" /> ' .
 609+ '<a class="smwq-more" href="javascript:smw_makeMainlabelDialog()">'.wfMsg( 'smw_qui_options' ).'</a> '.
600610 '</div>';
601611 $urlArgs = array();
602612 $urlArgs['pmainlabel'] = $mainLabel;
@@ -908,9 +918,9 @@
909919 ) .
910920 '<img src="' . $smwgScriptPath . '/skins/images/close-button.png" alt="' . wfMsg( 'smw_qui_delete' ) . '">' .
911921 '</a>' .
912 - '</span>' .
 922+ '</span><strong>' .
913923 wfMsg( 'smw_qui_rescol' ) .
914 - '</span>' .
 924+ '</strong></span>' .
915925 Xml::input( "maincol_label[$i]",
916926 '25',
917927 $mainColumnLabels[$key],
@@ -981,8 +991,8 @@
982992 '<a>' .
983993 '<img src="' . $smwgScriptPath . '/skins/images/close-button.png" alt="' . wfMsg( 'smw_qui_delete' ) . '">' .
984994 '</a>' .
985 - '</span>' .
986 - wfMsg( 'smw_qui_rescol' ) . '</span>' .
 995+ '</span><strong>' .
 996+ wfMsg( 'smw_qui_rescol' ) . '</strong></span>' .
987997 Xml::input( "maincol_label_num", '25' ) . " " .
988998 Xml::closeElement( 'div' );
989999 $hiddenMainColumn = json_encode( $hiddenMainColumn );
@@ -1049,10 +1059,18 @@
10501060 '<table align="center">' .
10511061 '<tr><td>' . $categoryHtml[0] . '</td><td>' . $categoryHtml[1] . '</td></tr>' .
10521062 '<tr><td>' . $categoryLabelHtml[0] . '</td><td>' . $categoryLabelHtml[1] . '</td></tr>' .
 1063+ '</table><br/><table align="center">'.
10531064 '<tr><td>' . $categoryYesHtml[0] . '</td><td>' . $categoryYesHtml[1] . '</td></tr>' .
10541065 '<tr><td>' . $categoryNoHtml[0] . '</td><td>' . $categoryNoHtml[1] . '</td></tr>' .
10551066 '</table>' .
10561067 Xml::closeElement( 'div' );
 1068+ $mainLabelDialogBox = Xml::openElement( 'div',
 1069+ array( 'id' => 'mainlabel-dialog',
 1070+ 'title' => wfMsg( 'smw_qui_mainlabopts'),
 1071+ 'class' => 'smwmainlabdialog' )
 1072+ ).
 1073+ Xml::inputLabel(wfMsg('smw_qui_dlabel'), '', 'd-mainlabel-label').
 1074+ Xml::closeElement('div');
10571075
10581076 $result .= '<div id="sorting_main"></div>' . "\n";
10591077 $result .= '[<a href="javascript:smw_addPropertyInstance(\'property_starter\', \'sorting_main\')">' . wfMsg( 'smw_qui_addnprop' ) . '</a>]' .
@@ -1131,6 +1149,10 @@
11321150
11331151 $javascriptText .= <<<EOT
11341152
 1153+ function smw_makeMainlabelDialog(){
 1154+ jQuery('#mainlabel-dialog').dialog("open");
 1155+ }
 1156+
11351157 function smw_makeCatDialog( cat_id ){
11361158 jQuery( '#prop-cat input' ).attr('value','');
11371159
@@ -1242,7 +1264,7 @@
12431265 }
12441266 var smw_mainLabelHidden=true;
12451267 function smw_addMainColInstance(starter_div_id, main_div_id) {
1246 - if(smw_mainLabelHidden && jQuery('.smwsort').length==1){
 1268+ if(smw_mainLabelHidden && (jQuery('.smwsort').length==1)){
12471269 jQuery('#mainlabelhid').attr('value','');
12481270 jQuery('#mainlabelvis').attr('value','');
12491271 jQuery('#smwmainlabel').show();
@@ -1293,10 +1315,27 @@
12941316 jQuery('$hiddenMainColumn').appendTo(document.body);
12951317 jQuery('$propertyDialogBox').appendTo(document.body);
12961318 jQuery('$categoryDialogBox').appendTo(document.body);
1297 - jQuery('#cat-dialog').dialog({
 1319+
 1320+ jQuery( '#mainlabel-dialog' ).dialog( {
12981321 autoOpen: false,
12991322 modal: true,
13001323 resizable: true,
 1324+ minWidth: 400,
 1325+ buttons: {
 1326+ "{$okMsg}": function(){
 1327+ jQuery('#mainlabelhid').attr('value',jQuery('#mainlabelvis').attr('value'));
 1328+ jQuery(this).dialog("close");
 1329+ },
 1330+ "{$cancelMsg}": function(){
 1331+ jQuery(this).dialog("close");
 1332+ }
 1333+ }
 1334+ } );
 1335+
 1336+ jQuery( '#cat-dialog' ).dialog( {
 1337+ autoOpen: false,
 1338+ modal: true,
 1339+ resizable: true,
13011340 minHeight: 200,
13021341 minWidth: 400,
13031342 buttons: {
@@ -1324,7 +1363,6 @@
13251364 autoOpen: false,
13261365 modal: true,
13271366 resizable: true,
1328 - minHeight: 200,
13291367 minWidth: 400,
13301368 buttons: {
13311369 "{$okMsg}": function(){
@@ -1366,10 +1404,7 @@
13671405 jQuery(document).ready(smw_property_autocomplete);
13681406 jQuery(document).ready(smw_category_autocomplete);
13691407 jQuery(document).ready(function(){
1370 - jQuery('#mainlabelvis').bind('change', function(){
1371 - jQuery('#mainlabelhid').attr('value',jQuery('#mainlabelvis').attr('value'));
1372 - });
1373 - if(jQuery('#mainlabelvis')!='') smw_mainLabelHidden=false;
 1408+ if(jQuery('#mainlabelhid')=='') smw_mainLabelHidden=true;
13741409 });
13751410 </script>
13761411
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_Messages.php
@@ -264,7 +264,7 @@
265265 'smw_qui_descorder' => 'Descending',
266266 'smw_qui_addnprop' => 'Add additional property',
267267 'smw_qui_delete' => 'Remove',
268 - 'smw_qui_rescol' => '<strong>Query Matches</strong> Label',
 268+ 'smw_qui_rescol' => 'Query Matches',
269269 'smw_qui_options' => 'options',
270270 'smw_qui_addcategory' => 'Add additional category',
271271 'smw_qui_addrescol' => 'Add main result column',
@@ -274,6 +274,7 @@
275275 'smw_qui_label' => 'Label',
276276 'smw_prp_options' => 'Property Options',
277277 'smw_qui_catopts' => 'Category Options',
 278+ 'smw_qui_mainlabopts' => 'Result Options',
278279 'smw_qui_dlabel' => 'Label:',
279280 'smw_qui_dcategory' => 'Category:',
280281 'smw_qui_dcatyes' => 'Show text when category is present:',
Index: trunk/extensions/SemanticMediaWiki/skins/SMW_custom.css
@@ -131,6 +131,9 @@
132132 }
133133
134134 /* ui buttons for QueryUI */
 135+div.smwsort{
 136+ margin-bottom: 5px;
 137+}
135138 .smwsort input, .smwsort a, .smwsort select, .smwsort checkbox{
136139 margin-left: 5px;
137140 margin-bottom: 5px;
@@ -148,18 +151,13 @@
149152 padding-left: 35px;
150153 }
151154
152 -.smwpropdialog input, .smwpropdialog select{
 155+.smwpropdialog input, .smwpropdialog select, .smwcatdialog input,
 156+.smwcatdialog select, .smwmainlabdialog input{
153157 margin-top: 10px;
154158 margin-right: 5px;
155159 margin-left: 5px;
156160 }
157161
158 -.smwcatdialog input, .smwcatdialog select{
159 - margin-top: 10px;
160 - margin-right: 5px;
161 - margin-left: 5px;
162 -}
163 -
164162 /* Query Creator */
165163 div.smwqcnavbar{
166164 padding-bottom: 5px;
@@ -173,7 +171,7 @@
174172 }
175173
176174 .smwquisortlabel{
177 - width: 15em;
 175+ width: 10em;
178176 float: left;
179177 }
180178 /* search, browse, RDF icons */

Follow-up revisions

RevisionCommit summaryAuthorDate
r94889modal window for '?' printouts, follow-up r94882devayon13:26, 18 August 2011