מדיה ויקי:Common.js: הבדלים בין גרסאות בדף

מ תיבת משוב לפי ויקיפדיה:מזנון#Rate this page
מאין תקציר עריכה
שורה 156: שורה 156:
if (wgNamespaceNumber || wgAction!='view') return;//articles only
if (wgNamespaceNumber || wgAction!='view') return;//articles only


var feedbackBox=$('<div class="feedbackWrapper"><div class="feedbackDiv">הערות ומשוב על הערך:<hr/><form id="commentbox" method="post" action="/w/index.php?section=new&action=edit&preview=yes&title='+mw.util.wikiUrlencode('שיחה:'+wgTitle)+'"><textarea name="wpTextbox1" rows="1" cols="80" id="feedbackTextArea" placeholder="כתבו כאן הערות ומשוב על הערך...">כתבו כאן הערות ומשוב על הערך...</textarea><div><input type="submit" id="feedbackBtn" style="display:none;" value="משוב"/><input type="hidden" name="wpSummary" value="משוב"/></div></form></div></div>');
var feedbackBox=$('<div class="feedbackWrapper"><div class="feedbackDiv">הערות ומשוב על הערך:<hr/><form id="commentbox" method="post" action="/w/index.php?section=new&action=edit&preview=yes&title='+mw.util.wikiUrlencode('שיחה:'+wgTitle)+'"><textarea name="wpTextbox1" rows="1" cols="80" id="feedbackTextArea" placeholder="כתבו כאן הערות ומשוב על הערך...">כתבו כאן הערות ומשוב על הערך...</textarea><div><input type="submit" id="feedbackBtn" style="display:none;" value="משוב"/><input type="hidden" name="wpSummary" value="משוב"></div></form></div></div>');
$('#content').append(feedbackBox);
$('#content').append(feedbackBox);
var grow=function(){var rows=0;var c=this.cols;$.each(this.value.split('\n'),function(i,v){rows+=Math.floor(v.length/c)+1});this.rows=rows; this.style.height='auto';$('#feedbackBtn').toggle(this.value.length>0);};
var grow=function(){var rows=0;var c=this.cols;$.each(this.value.split('\n'),function(i,v){rows+=Math.floor(v.length/c)+1});this.rows=rows; this.style.height='auto';$('#feedbackBtn').toggle(this.value.length>0);};
שורה 162: שורה 162:
$('#feedbackTextArea').blur(grow);
$('#feedbackTextArea').blur(grow);
$('#feedbackTextArea').keyup(grow);
$('#feedbackTextArea').keyup(grow);
//sign in the end
$('#commentbox').submit(function(){if(!($('#feedbackTextArea').attr('value').indexOf('~~'+'~~')+1)) $('#feedbackTextArea').attr('value',$('#feedbackTextArea').attr('value')+' ~~'+'~~'); return true;});
var firstFocus=function(e){this.value="";$(this).unbind(e);};
$('#feedbackTextArea').focus(firstFocus);
});