r81941 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81940‎ | r81941 | r81942 >
Date:09:13, 11 February 2011
Author:wikibhasha.msr
Status:deferred
Tags:
Comment:
adding check, if the usage snippet already exist dont add the same to summary field
Modified paths:
  • /trunk/extensions/WikiBhasha/src/js/core/paneManagement.js (modified) (history)

Diff [purge]

Index: trunk/extensions/WikiBhasha/src/js/core/paneManagement.js
@@ -186,10 +186,12 @@
187187 var composedContent = new String(wbPublishDisplayPane.getWikiTextareaElement().val());
188188 var summeryContent = new String(wbPublishDisplayPane.getWikiSummeryFieldElement().val());
189189
190 - //insert the snippet to the summery field'.
191 - summeryContent = wbGlobalSettings.snippet + " " + summeryContent;
192 - // update the summery field content with the snippet.
193 - wbPublishDisplayPane.getWikiSummeryFieldElement().val(summeryContent);
 190+ if(summeryContent.length > 0 && !(summeryContent.indexOf(wbGlobalSettings.snippet) > -1) ){
 191+ //insert the snippet to the summery field'.
 192+ summeryContent = wbGlobalSettings.snippet + " " + summeryContent;
 193+ // update the summery field content with the snippet.
 194+ wbPublishDisplayPane.getWikiSummeryFieldElement().val(summeryContent);
 195+ }
194196
195197 // call the method to check and insert the interwiki link
196198 composedContent = wbPublishDisplayPane.insertInterWikiLink(composedContent);

Status & tagging log