r94893 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94892‎ | r94893 | r94894 >
Date:13:54, 18 August 2011
Author:devayon
Status:deferred
Tags:
Comment:
follow-up r94889
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUIHelper.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUIHelper.php
@@ -941,6 +941,7 @@
942942 // END: create form elements already submitted earlier via form
943943
944944 // create hidden form elements to be cloned later
 945+ //property
945946 $hiddenProperty = Html::openElement( 'div',
946947 array( 'id' => 'property_starter',
947948 'style' => 'display:none' )
@@ -967,7 +968,7 @@
968969 Html::hidden( 'prop_limit_num', '' ) .
969970 Xml::closeElement( 'div' );
970971 $hiddenProperty = json_encode( $hiddenProperty );
971 -
 972+ //category
972973 $hiddenCategory = Html::openElement( 'div',
973974 array( 'id' => 'category_starter',
974975 'style' => 'display:none' )
@@ -985,7 +986,7 @@
986987 '<input type="hidden" name="cat_no_num" />' .
987988 Xml::closeElement( 'div' );
988989 $hiddenCategory = json_encode( $hiddenCategory );
989 -
 990+ // For '?' printouts
990991 $hiddenMainColumn = Html::openElement( 'div',
991992 array( 'id' => 'maincol_starter',
992993 'style' => 'display:none' )
@@ -1001,6 +1002,7 @@
10021003 Xml::closeElement( 'div' );
10031004 $hiddenMainColumn = json_encode( $hiddenMainColumn );
10041005
 1006+ //Create dialog-boxes
10051007 // create dialogbox for Property options
10061008 $propertyHtml = Xml::inputLabelSep( wfMsg( 'smw_qui_prop' ),
10071009 '',
@@ -1121,13 +1123,6 @@
11221124 } );
11231125 }
11241126
1125 - function smwRemoveMainLabel(){
1126 - jQuery( '#mainlabelhid' ).attr( 'value', '-' );
1127 - jQuery( '#mainlabelvis' ).attr( 'value', '' );
1128 - jQuery( '#smwmainlabel' ).hide();
1129 - smw_mainLabelHidden = true;
1130 - }
1131 -
11321127 function smw_category_autocomplete(){
11331128 jQuery( '[name*="category"]' ).autocomplete( {
11341129 minLength: 2,
@@ -1162,6 +1157,13 @@
11631158 jQuery('#mainlabel-dialog').dialog("open");
11641159 }
11651160
 1161+ function smwRemoveMainLabel(){
 1162+ jQuery( '#mainlabelhid' ).attr( 'value', '-' );
 1163+ jQuery( '#mainlabelvis' ).attr( 'value', '' );
 1164+ jQuery( '#smwmainlabel' ).hide();
 1165+ }
 1166+
 1167+
11661168 function smw_makeQueryMatchesDialog( qm_id ){
11671169 qmLabel=jQuery('#maincol_label'+qm_id).attr('value');
11681170 jQuery('#d-mainres-label').attr('value', qmLabel);
@@ -1278,13 +1280,14 @@
12791281 num_elements++;
12801282 smw_category_autocomplete();
12811283 }
1282 - var smw_mainLabelHidden=true;
 1284+
12831285 function smw_addMainColInstance(starter_div_id, main_div_id) {
1284 - if(smw_mainLabelHidden && (jQuery('.smwsort').length==1)){
 1286+ if( (jQuery('#smwmainlabel').css('display')=='none')
 1287+ && (jQuery('.smwsort').length==1)
 1288+ ){
12851289 jQuery('#mainlabelhid').attr('value','');
12861290 jQuery('#mainlabelvis').attr('value','');
12871291 jQuery('#smwmainlabel').show();
1288 - smw_mainLabelHidden=false;
12891292 } else {
12901293 if( jQuery( '.smwsort' ).length > smwgQPrintoutLimit ){
12911294 return;
@@ -1308,6 +1311,11 @@
13091312 children[x].name = children[x].name.replace(/_num/, '[' + num_elements + ']');
13101313 }
13111314 }
 1315+ //Create 'options' link
 1316+ var more_button =document.createElement('span');
 1317+ more_button.innerHTML = ' <a class="smwq-more" href="javascript:smw_makeQueryMatchesDialog(\'' + num_elements + '\')">{$optionsMsg}</a> ';
 1318+ more_button.id = 'more'+num_elements;
 1319+ new_div.appendChild(more_button);
13121320
13131321 //Add the new instance
13141322 main_div.appendChild(new_div);
@@ -1438,9 +1446,6 @@
14391447
14401448 jQuery(document).ready(smw_property_autocomplete);
14411449 jQuery(document).ready(smw_category_autocomplete);
1442 - jQuery(document).ready(function(){
1443 - if(jQuery('#mainlabelhid')=='') smw_mainLabelHidden=true;
1444 - });
14451450 </script>
14461451
14471452 EOT;

Past revisions this follows-up on

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