r29739 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r29738‎ | r29739 | r29740 >
Date:13:48, 14 January 2008
Author:thomasv
Status:old
Tags:
Comment:
use \{\{\!\}\} instead of pipe inside parameters
Modified paths:
  • /trunk/extensions/ProofreadPage/proofread_index.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ProofreadPage/proofread_index.js
@@ -41,6 +41,8 @@
4242 str = str + '<tr><td>'+param_label+': </td>';
4343
4444 value = findparam(params,param_name);
 45+ value = value.replace(/\{\{!\}\}/g,'|');
 46+
4547 if(m[2]) size=m[2]; else size="1";
4648 if(size=="1") {
4749 str = str + '<td><input name="'+param_name+'" size=60 value="'+value+'"/></td></tr>';
@@ -78,8 +80,12 @@
7981 for(i=0;i<index_attributes.length;i++){
8082 m = index_attributes[i].split('|');
8183 param_name = m[0];
 84+
8285 value = form.elements[param_name].value;
83 - value = value.replace('\n|','\n\\|');
 86+ value = value.replace(/\|/g,'{{!}}');
 87+ //not for links!
 88+ value = value.replace(/\[\[(.*?)\{\{!\}\}(.*?)\]\]/g,'[[$1|$2]]');
 89+
8490 result = result + "\n|"+param_name+"="+value;
8591 }
8692 result = result + "\n}}";

Status & tagging log