r94496 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94495‎ | r94496 | r94497 >
Date:08:35, 15 August 2011
Author:devayon
Status:deferred
Tags:
Comment:
aligned input boxes for all POs
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/skins/SMW_custom.css (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUIHelper.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialQueryCreator.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUIHelper.php
@@ -662,8 +662,8 @@
663663 * Make an element for additional properties
664664 */
665665 $result .= Html::openElement( 'div', array( 'id' => "sort_div_$i", 'class' => 'smwsort' ) );
666 - $result .= '<span class="smw-remove"><a href="javascript:removePOInstance(\'sort_div_' . $i . '\')"><img src="' . $smwgScriptPath . '/skins/images/close-button.png" alt="' . wfMsg( 'smw_qui_delete' ) . '"></a></span>';
667 - $result .= wfMsg( 'smw_qui_property' );
 666+ $result .= '<span class="smwquisortlabel"><span class="smw-remove"><a href="javascript:removePOInstance(\'sort_div_' . $i . '\')"><img src="' . $smwgScriptPath . '/skins/images/close-button.png" alt="' . wfMsg( 'smw_qui_delete' ) . '"></a></span>';
 667+ $result .= wfMsg( 'smw_qui_property' ).'</span>';
668668 $result .= Html::input( 'property[' . $i . ']', $propertyValues[$key], 'text', array( 'size' => '35', 'id' => "property$i" ) ) . "\n";
669669 $result .= Html::openElement( 'select', array( 'name' => "order[$i]" ) );
670670
@@ -709,8 +709,8 @@
710710 * Make an element for additional categories
711711 */
712712 $result .= Html::openElement( 'div', array( 'id' => "sort_div_$i", 'class' => 'smwsort' ) );
713 - $result .= '<span class="smw-remove"><a href="javascript:removePOInstance(\'sort_div_' . $i . '\')"><img src="' . $smwgScriptPath . '/skins/images/close-button.png" alt="' . wfMsg( 'smw_qui_delete' ) . '"></a></span>' .
714 - wfMsg( 'smw_qui_category' ) .
 713+ $result .= '<span class="smwquisortlabel"><span class="smw-remove"><a href="javascript:removePOInstance(\'sort_div_' . $i . '\')"><img src="' . $smwgScriptPath . '/skins/images/close-button.png" alt="' . wfMsg( 'smw_qui_delete' ) . '"></a></span>' .
 714+ wfMsg( 'smw_qui_category' ) .'</span>'.
715715 Xml::input( "category[$i]", '25', $categoryValues[$key], array( 'id' => "category$i" ) ) . " " .
716716 Html::hidden( "cat_label[$i]", $categoryLabelValues[$key], array( 'id' => "cat_label$i" ) ) .
717717 Html::hidden( "cat_yes[$i]", $categoryYesValues[$key], array( 'id' => "cat_yes$i" ) ) .
@@ -724,8 +724,8 @@
725725 * Make an element for main column
726726 */
727727 $result .= Html::openElement( 'div', array( 'id' => "sort_div_$i", 'class' => 'smwsort' ) ) .
728 - '<span class="smw-remove"><a href="javascript:removePOInstance(\'sort_div_' . $i . '\')"><img src="' . $smwgScriptPath . '/skins/images/close-button.png" alt="' . wfMsg( 'smw_qui_delete' ) . '"></a></span>' .
729 - wfMsg( 'smw_qui_rescol' ) .
 728+ '<span class="smwquisortlabel"><span class="smw-remove"><a href="javascript:removePOInstance(\'sort_div_' . $i . '\')"><img src="' . $smwgScriptPath . '/skins/images/close-button.png" alt="' . wfMsg( 'smw_qui_delete' ) . '"></a></span>' .
 729+ wfMsg( 'smw_qui_rescol' ) .'</span>'.
730730 Xml::input( "maincol_label[$i]", '20', $mainColumnLabels[$key], array ( 'id' => "maincol_label$i" ) ) . " " .
731731 Xml::closeElement( 'div' );
732732 $i++;
@@ -736,9 +736,9 @@
737737
738738 // create hidden form elements to be cloned later
739739 $hiddenProperty = Html::openElement( 'div', array( 'id' => 'property_starter', 'class' => 'smwsort', 'style' => 'display:none' ) ) .
740 - '<span class="smw-remove"><a><img src="' . $smwgScriptPath . '/skins/images/close-button.png" alt="' . wfMsg( 'smw_qui_delete' ) . '"></a></span>' .
741 - wfMsg( 'smw_qui_property' ) .
742 - Xml::input( 'property_num', '35' ) . " " .
 740+ '<span class="smwquisortlabel">'.'<span class="smw-remove"><a><img src="' . $smwgScriptPath . '/skins/images/close-button.png" alt="' . wfMsg( 'smw_qui_delete' ) . '"></a></span>' .
 741+ wfMsg( 'smw_qui_property' ).'</span>'.
 742+ Xml::input( 'property_num', '25' ) . " " .
743743 Html::openElement( 'select', array( 'name' => 'order_num' ) ) .
744744 Xml::option( wfMsg( 'smw_qui_nosort' ), 'NONE' ) .
745745 Xml::option( wfMsg( 'smw_qui_ascorder' ), 'ASC' ) .
@@ -752,8 +752,8 @@
753753 $hiddenProperty = json_encode( $hiddenProperty );
754754
755755 $hiddenCategory = Html::openElement( 'div', array( 'id' => 'category_starter', 'class' => 'smwsort', 'style' => 'display:none' ) ) .
756 - '<span class="smw-remove"><a><img src="' . $smwgScriptPath . '/skins/images/close-button.png" alt="' . wfMsg( 'smw_qui_delete' ) . '"></a></span>' .
757 - wfMsg( 'smw_qui_category' ) .
 756+ '<span class="smwquisortlabel">'.'<span class="smw-remove"><a><img src="' . $smwgScriptPath . '/skins/images/close-button.png" alt="' . wfMsg( 'smw_qui_delete' ) . '"></a></span>' .
 757+ wfMsg( 'smw_qui_category' ) .'</span>'.
758758 Xml::input( "category_num", '25' ) . " " .
759759 '<input type="hidden" name="cat_label_num" />' .
760760 '<input type="hidden" name="cat_yes_num" />' .
@@ -762,9 +762,9 @@
763763 $hiddenCategory = json_encode( $hiddenCategory );
764764
765765 $hiddenMainColumn = Html::openElement( 'div', array( 'id' => 'maincol_starter', 'class' => 'smwsort', 'style' => 'display:none' ) ) .
766 - '<span class="smw-remove"><a><img src="' . $smwgScriptPath . '/skins/images/close-button.png" alt="' . wfMsg( 'smw_qui_delete' ) . '"></a></span>' .
767 - wfMsg( 'smw_qui_rescol' ) .
768 - Xml::input( "maincol_label_num", '20' ) . " " .
 766+ '<span class="smwquisortlabel">'.'<span class="smw-remove"><a><img src="' . $smwgScriptPath . '/skins/images/close-button.png" alt="' . wfMsg( 'smw_qui_delete' ) . '"></a></span>' .
 767+ wfMsg( 'smw_qui_rescol' ) .'</span>'.
 768+ Xml::input( "maincol_label_num", '25' ) . " " .
769769 Xml::closeElement( 'div' );
770770 $hiddenMainColumn = json_encode( $hiddenMainColumn );
771771
@@ -790,9 +790,9 @@
791791 $categoryDialogBox = Xml::openElement( 'div', array( 'id' => 'cat-dialog', 'title' => wfMsg( 'smw_qui_catopts' ), 'class' => 'smwcatdialog' ) ) .
792792 '<table>' .
793793 '<tr><td>' . $categoryHtml[0] . '</td><td>' . $categoryHtml[1] . '</td></tr>' .
 794+ '<tr><td>' . $categoryLabelHtml[0] . '</td><td>' . $categoryLabelHtml[1] . '</td></tr>' .
794795 '<tr><td>' . $categoryYesHtml[0] . '</td><td>' . $categoryYesHtml[1] . '</td></tr>' .
795796 '<tr><td>' . $categoryNoHtml[0] . '</td><td>' . $categoryNoHtml[1] . '</td></tr>' .
796 - '<tr><td>' . $categoryLabelHtml[0] . '</td><td>' . $categoryLabelHtml[1] . '</td></tr>' .
797797 '</table>' .
798798 Xml::closeElement( 'div' );
799799
@@ -1062,7 +1062,19 @@
10631063 }
10641064 });
10651065 jQuery('#sort-more').click(function(){jQuery('#prop-dialog').dialog("open");});
1066 -
 1066+ jQuery('#d-category').bind('change keyup focus click',function(){
 1067+ if(jQuery(this).attr('value')==''){
 1068+ jQuery('#d-category-yes').css('visibility','hidden');
 1069+ jQuery('#d-category-no').css('visibility','hidden');
 1070+ jQuery('#cat-dialog [for="d-category-no"]').css('visibility','hidden');
 1071+ jQuery('#cat-dialog [for="d-category-yes"]').css('visibility','hidden');
 1072+ } else {
 1073+ jQuery('#d-category-yes').css('visibility','visible');
 1074+ jQuery('#d-category-no').css('visibility','visible');
 1075+ jQuery('#cat-dialog [for="d-category-no"]').css('visibility','visible');
 1076+ jQuery('#cat-dialog [for="d-category-yes"]').css('visibility','visible');
 1077+ }
 1078+ });
10671079 });
10681080
10691081 jQuery(document).ready(smw_property_autocomplete);
Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialQueryCreator.php
@@ -87,7 +87,7 @@
8888 // Main query and format options
8989 $result .= $this->getQueryFormBox();
9090 // sorting and prinouts
91 - $result .= '<div class="smw-qc-sortbox" style="padding-left:10px;">' . $this->getPoSortFormBox() . '</div>';
 91+ $result .= '<div class="smwqcsortbox">' . $this->getPoSortFormBox() . '</div>';
9292 // additional options
9393 //START: show|hide additional options
9494 $result .= '<div class="smwqcformatas"><strong>'.wfMsg('smw_ask_format_as').'</strong>';
Index: trunk/extensions/SemanticMediaWiki/skins/SMW_custom.css
@@ -139,9 +139,15 @@
140140 span.smw-remove a img{
141141 text-decoration: none;
142142 margin-right: 5px;
143 - vertical-align: -3px;
 143+ vertical-align: -0.25em;
 144+ margin-left: -30px;
 145+
144146 }
145147
 148+div.smwqcsortbox{
 149+ padding-left: 35px;
 150+}
 151+
146152 .smwpropdialog input, .smwpropdialog select{
147153 margin-top: 10px;
148154 margin-right: 5px;
@@ -165,6 +171,11 @@
166172 margin-top: 15px;
167173 margin-bottom: 0px;
168174 }
 175+
 176+.smwquisortlabel{
 177+ width: 12em;
 178+ float: left;
 179+}
169180 /* search, browse, RDF icons */
170181
171182 span.smwsearchicon { /*FIXME: this was only used for Factbox docu, should be removed from code*/