<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://vanipedia.org/w/index.php?action=history&amp;feed=atom&amp;title=MediaWiki%3AUpdateLinks.js</id>
	<title>MediaWiki:UpdateLinks.js - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://vanipedia.org/w/index.php?action=history&amp;feed=atom&amp;title=MediaWiki%3AUpdateLinks.js"/>
	<link rel="alternate" type="text/html" href="https://vanipedia.org/w/index.php?title=MediaWiki:UpdateLinks.js&amp;action=history"/>
	<updated>2026-11-16T12:59:38Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://vanipedia.org/w/index.php?title=MediaWiki:UpdateLinks.js&amp;diff=352&amp;oldid=prev</id>
		<title>Eivind: New page:  $(document).ready(function() {   //Update links pointing to vanisource with terms found in spans with class=&quot;terms&quot;   //get terms from &lt;span class=&quot;terms&quot; and sanitize them   terms = &quot;&quot;; ...</title>
		<link rel="alternate" type="text/html" href="https://vanipedia.org/w/index.php?title=MediaWiki:UpdateLinks.js&amp;diff=352&amp;oldid=prev"/>
		<updated>2008-03-17T14:36:32Z</updated>

		<summary type="html">&lt;p&gt;New page:  $(document).ready(function() {   //Update links pointing to vanisource with terms found in spans with class=&amp;quot;terms&amp;quot;   //get terms from &amp;lt;span class=&amp;quot;terms&amp;quot; and sanitize them   terms = &amp;quot;&amp;quot;; ...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
$(document).ready(function() {&lt;br /&gt;
  //Update links pointing to vanisource with terms found in spans with class=&amp;quot;terms&amp;quot;&lt;br /&gt;
  //get terms from &amp;lt;span class=&amp;quot;terms&amp;quot; and sanitize them&lt;br /&gt;
  terms = &amp;quot;&amp;quot;;&lt;br /&gt;
  if ($(&amp;#039;span.terms&amp;#039;).length) {&lt;br /&gt;
    $(&amp;#039;span.terms&amp;#039;).each(function () {&lt;br /&gt;
      text = $(this).text().replace(/&amp;quot;/g, &amp;quot;&amp;quot;);&lt;br /&gt;
      text = text.replace(/(\w+) {2,}(\w+)/g, &amp;quot;$1 $2&amp;quot;);&lt;br /&gt;
      text = text.replace(/^\ {0,}/m, &amp;quot;&amp;quot;);&lt;br /&gt;
      text = text.replace(/\ {0,}$/m, &amp;quot;&amp;quot;); &lt;br /&gt;
      terms += text+&amp;#039;+&amp;#039;;&lt;br /&gt;
    });&lt;br /&gt;
  } else { terms = wgTitle; }&lt;br /&gt;
  //serach in the body for any anchor &amp;lt;a with a attribute href pointing to Vanisource&lt;br /&gt;
  //and append the terms to be passed to Vanisource for highlighting&lt;br /&gt;
  //Define function to append terms&lt;br /&gt;
  append_terms = function() {&lt;br /&gt;
    class_this = $(this).attr(&amp;#039;class&amp;#039;);&lt;br /&gt;
    //alert(class_this);&lt;br /&gt;
    //Check if class has been already defined with this same routine (if we have been here), the terms have already been appended&lt;br /&gt;
    if(class_this != &amp;#039;selected&amp;#039;){&lt;br /&gt;
      search_str1 = this.href+&amp;#039;?terms=&amp;#039;+terms;&lt;br /&gt;
      $(this).attr({href: search_str1, class: &amp;#039;selected&amp;#039;});&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  //Now bind it onclick&lt;br /&gt;
  $(&amp;#039;#bodyContent a[@href*=&amp;quot;vanisource.org&amp;quot;]&amp;#039;).not( $(&amp;#039;#bodyContent a[@href*=&amp;quot;edit&amp;quot;]&amp;#039;) ).click(append_terms);&lt;br /&gt;
    &lt;br /&gt;
});&lt;/div&gt;</summary>
		<author><name>Eivind</name></author>
	</entry>
</feed>