mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-09 15:05:50 +01:00
Fix Warnings
This commit is contained in:
@@ -4,7 +4,7 @@ $(function(){
|
|||||||
|
|
||||||
// repository url text field
|
// repository url text field
|
||||||
$('#repository-url').click(function(){
|
$('#repository-url').click(function(){
|
||||||
this.select(0, this.value.length);
|
this.select(0, this.value.length);
|
||||||
});
|
});
|
||||||
|
|
||||||
// activate tooltip
|
// activate tooltip
|
||||||
@@ -17,7 +17,7 @@ $(function(){
|
|||||||
});
|
});
|
||||||
$('.markdown-head').mouseleave(function(e){
|
$('.markdown-head').mouseleave(function(e){
|
||||||
var anchorLink = $(e.target).children('a.markdown-anchor-link');
|
var anchorLink = $(e.target).children('a.markdown-anchor-link');
|
||||||
if(anchorLink.data('active') != true){
|
if(anchorLink.data('active') !== true){
|
||||||
anchorLink.hide();
|
anchorLink.hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -39,7 +39,7 @@ function displayErrors(data){
|
|||||||
var i = 0;
|
var i = 0;
|
||||||
$.each(data, function(key, value){
|
$.each(data, function(key, value){
|
||||||
$('#error-' + key.split(".").join("_")).text(value);
|
$('#error-' + key.split(".").join("_")).text(value);
|
||||||
if(i == 0){
|
if(i === 0){
|
||||||
$('#' + key).focus();
|
$('#' + key).focus();
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
@@ -71,17 +71,15 @@ function displayErrors(data){
|
|||||||
function diffUsingJS(oldTextId, newTextId, outputId) {
|
function diffUsingJS(oldTextId, newTextId, outputId) {
|
||||||
// get the baseText and newText values from the two textboxes, and split them into lines
|
// get the baseText and newText values from the two textboxes, and split them into lines
|
||||||
var oldText = document.getElementById(oldTextId).value;
|
var oldText = document.getElementById(oldTextId).value;
|
||||||
if(oldText == ''){
|
var oldLines = [];
|
||||||
var oldLines = [];
|
if(oldText !== ''){
|
||||||
} else {
|
oldLines = difflib.stringAsLines(oldText);
|
||||||
var oldLines = difflib.stringAsLines(oldText);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var newText = document.getElementById(newTextId).value
|
var newText = document.getElementById(newTextId).value;
|
||||||
if(newText == ''){
|
var newLines = [];
|
||||||
var newLines = [];
|
if(newText !== ''){
|
||||||
} else {
|
newLines = difflib.stringAsLines(newText);
|
||||||
var newLines = difflib.stringAsLines(newText);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// create a SequenceMatcher instance that diffs the two sets of lines
|
// create a SequenceMatcher instance that diffs the two sets of lines
|
||||||
@@ -106,4 +104,4 @@ function diffUsingJS(oldTextId, newTextId, outputId) {
|
|||||||
|
|
||||||
function jqSelectorEscape(val) {
|
function jqSelectorEscape(val) {
|
||||||
return val.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]^`{|}~]/g, '\\$&');
|
return val.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]^`{|}~]/g, '\\$&');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,25 +4,25 @@ $(function(){
|
|||||||
});
|
});
|
||||||
$.each($('input[formaction]'), function(i, input){
|
$.each($('input[formaction]'), function(i, input){
|
||||||
$(input).click(function(){
|
$(input).click(function(){
|
||||||
var form = $(input).parents('form')
|
var form = $(input).parents('form');
|
||||||
$(form).attr('action', $(input).attr('formaction'))
|
$(form).attr('action', $(input).attr('formaction'));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function validate(e){
|
function validate(e){
|
||||||
var form = $(e.target);
|
var form = $(e.target);
|
||||||
$(form).find('[type=submit]').attr('disabled', 'disabled')
|
$(form).find('[type=submit]').attr('disabled', 'disabled');
|
||||||
|
|
||||||
if(form.data('validated') == true){
|
if(form.data('validated') !== true){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$.post(form.attr('action') + '/validate', $(e.target).serialize(), function(data){
|
$.post(form.attr('action') + '/validate', $(e.target).serialize(), function(data){
|
||||||
$(form).find('[type=submit]').removeAttr('disabled')
|
$(form).find('[type=submit]').removeAttr('disabled');
|
||||||
// clear all error messages
|
// clear all error messages
|
||||||
$('.error').text('');
|
$('.error').text('');
|
||||||
|
|
||||||
if($.isEmptyObject(data)){
|
if($.isEmptyObject(data)){
|
||||||
form.data('validated', true);
|
form.data('validated', true);
|
||||||
form.submit();
|
form.submit();
|
||||||
@@ -39,4 +39,4 @@ function displayErrors(data){
|
|||||||
$.each(data, function(key, value){
|
$.each(data, function(key, value){
|
||||||
$('#error-' + key.split(".").join("_")).text(value);
|
$('#error-' + key.split(".").join("_")).text(value);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user