Last modified: 2013-04-05 15:21:14 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T12124, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 10124 - add selection list inside article, and then draw a different article into the article
add selection list inside article, and then draw a different article into the...
Status: RESOLVED WORKSFORME
Product: MediaWiki extensions
Classification: Unclassified
WikiLexicalData/OmegaWiki (Other open bugs)
unspecified
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
aklapper-moreinfo
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-06-03 18:09 UTC by Wiredtape
Modified: 2013-04-05 15:21 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Wiredtape 2007-06-03 18:09:45 UTC
The problem I am trying to address is topics that have multiple "choices" in them..
A good example is a Drivers License; Drivers Licenses have different laws\regulations\classes and vary by geographical locations, classes, and the type of vehicle.

The solution:
Create an extension that gives the user a selection list, once a selection is made, an xmlHttpRequest() can go and fetch the "text" relevant to that selection...

so for instance:
if I choose United States in the selection list. I will get information relevant to Drivers Licenses in the United States...

A simple extension format for this could be:

<droplist ext="drivers_license>value1,value2 etc.</droplist>

ext would define the url information for xmlhttprequest -> meaning you would combine the two strings valuex and ext and get value1_ext and that would be the name of the article for xmlhttprequest.. the values would be the selection options of course...

I don't have a lot of experience with php or ajax, but I started to write something for the extension:

----dl.js----
<script window.onload=makeList() type="text/javascript">
var x
	// Get the list of options from $list
function makeList() {
x= "<?php echo $alength;?>";
       for (i=1;i<x;i++) {
                 opt = document.getElementById('dlist');
				 newOpt=new Option("<?php echo $list[i]?>"); // 1st argument is the text to show, 2nd is the value for it if any
                 opt.options[x]=newOpt;   // adds it
               }
 
}
function incart(art) {
	var xmlHttp

xmlHttp=GetXmlHttpObject()
 if (xmlHttp==null)
  {
  alert ("Browser does not support HTTP Request")
  return
  } 
 var url="<?php echo $argv["ext"]?>
 url=url+window[art.options[SelectedIndex]];
 xmlHttp.onreadystatechange=stateChanged 
 xmlHttp.open("GET",url,true)
 xmlHttp.send(null)
 }
function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}
<form>
<select name="list" id="dlist" onchange=incart(this.options[this.selectedIndex])>
<option value="">--- choose below ---</option>
</select>
</form>
</script>

----dlist.php----
<?php
# Droplist WikiMedia extension
# Attributes that are sent to the extension include:
# Option list, and the attached url ending.

$wgExtensionFunctions[] = "wfDroplist";

function wfDroplist() {
    global $wgParser;
    # register the extension with the WikiText parser
    # the first parameter is the name of the new tag.
    # In this case it defines the tag <example> ... </example>
    # the second parameter is the callback function for
    # processing the text between the tags
    $wgParser->setHook( "droplist", "renderDroplist" );
}

# The callback function for converting the input text to HTML output
function renderDroplist( $input, $argv, &$parser ) {
    $list = explode(",",$input);
	$alength = count($list);
    **************have not continued here*************************
}
?>
Comment 1 Malafaya 2009-02-07 00:16:36 UTC
Just to make sure: does this apply to extension Wikidata?
Comment 2 Andre Klapper 2012-11-01 15:05:06 UTC
WiredTape: Which environment (setup; extension) does this refer to?
Comment 3 Malafaya 2012-11-09 14:20:40 UTC
This was set as OmegaWiki but I don't see any relation between what is presented and OmegaWiki.
Comment 4 Andre Klapper 2012-11-12 11:26:08 UTC
Malafaya: The old extension with the name "wikidata" is part of OmegaWiki.
Comment 5 Malafaya 2012-11-13 21:31:30 UTC
Sure, but the request presented by the submitter doesn't seem to have anything to do with either OmegaWiki or old Wikidata.
Comment 6 Andre Klapper 2013-04-05 15:21:14 UTC
Unfortunately closing this report as no further information has been provided.

Wiredtape: Please feel free to reopen this report if you can provide the information asked for and if this still happens. Thanks!

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links