Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5792 from openSUSE/bootstrap-master
Merge bootstrap master
- Loading branch information
Showing
93 changed files
with
26,147 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
app/assets/javascripts/webui/application/bento | ||
app/assets/javascripts/webui/application/cm2 | ||
app/assets/javascripts/webui2/*.min.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
function autocompleteDevelProject(sourcePath) { // jshint ignore:line | ||
$("#devel_project").autocomplete({ | ||
appendTo: '.modal-body', | ||
source: sourcePath, | ||
search: function(event, ui) { // jshint ignore:line | ||
$(this).addClass('loading-spinner'); | ||
}, | ||
response: function(event, ui) { // jshint ignore:line | ||
$(this).removeClass('loading-spinner'); | ||
}, | ||
minLength: 2}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
function updateRpmlintResult(index) { // jshint ignore:line | ||
$('#rpm'+index+'-reload').addClass('fa-spin'); | ||
$.ajax({ | ||
url: '/package/rpmlint_result', | ||
data: $('#buildresult-box').data(), | ||
success: function(data) { | ||
$('#rpm' + index + ' .result').html(data); | ||
}, | ||
error: function() { | ||
$('#rpm'+ index + ' .result').html('<p>No rpmlint results available</p>'); | ||
}, | ||
complete: function() { | ||
$('#rpm' + index + '-reload').removeClass('fa-spin'); | ||
} | ||
}); | ||
} | ||
|
||
function updateBuildResult(index) { // jshint ignore:line | ||
var ajaxDataShow = $('#buildresult-box').data(); | ||
ajaxDataShow.show_all = $('#show_all_'+index).is(':checked'); // jshint ignore:line | ||
$('#build'+index+'-reload').addClass('fa-spin'); | ||
$.ajax({ | ||
url: $('#buildresult-urls').data('buildresultUrl'), | ||
data: ajaxDataShow, | ||
success: function(data) { | ||
$('#build' + index + ' .result').html(data); | ||
}, | ||
error: function() { | ||
$('#build' + index + ' .result').html('<p>No build results available</p>'); | ||
}, | ||
complete: function() { | ||
$('#build' + index + '-reload').removeClass('fa-spin'); | ||
$('[data-toggle="popover"]').popover({ trigger: 'hover' }); | ||
} | ||
}); | ||
} | ||
|
||
function updateArchDisplay(index) { // jshint ignore:line | ||
$('.rpmlint_arch_select_' + index).hide(); | ||
$('#rpmlint_arch_select_' + index + '_' + $('#rpmlint_repo_select_' + index + ' option:selected').attr('value')).show(); | ||
updateRpmlintDisplay(index); | ||
} | ||
|
||
function updateRpmlintDisplay(index) { | ||
var ajaxDataShow = $('#rpmlin-log-' + index).data(); | ||
var repoKey = $('#rpmlint_repo_select_' + index + ' option:selected').attr('value'); | ||
ajaxDataShow.repository = $('#rpmlint_repo_select_' + index + ' option:selected').html(); | ||
ajaxDataShow.architecture = $('#rpmlint_arch_select_' + index + '_' + repoKey + ' option:selected').attr('value'); | ||
$.ajax({ | ||
url: '/package/rpmlint_log', | ||
data: ajaxDataShow, | ||
success: function (data) { | ||
$('#rpmlint_display_' + index).html(data); | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Expand the comment textarea to fit the text | ||
// as it's being typed. | ||
function sz(t) { // jshint ignore:line | ||
var a = t.value.split('\n'); | ||
var b = 1; | ||
for (var x = 0; x < a.length; x++) { | ||
if (a[x].length >= t.cols) b += Math.floor(a[x].length / t.cols); | ||
} | ||
b += a.length; | ||
if (b > t.rows) t.rows = b; | ||
} | ||
|
||
function reloadCommentBindings() { | ||
$('a.supersed_comments_link').on('click', function(){ | ||
var link = $(this).text(); | ||
$(this).text(link === 'Show outdated comments' ? 'Hide outdated comments' : 'Show outdated comments'); | ||
$(this).parent().siblings('.superseded_comments').toggle(); | ||
}); | ||
$('.togglable_comment').click(function () { | ||
var toggleid = $(this).data("toggle"); | ||
$("#" + toggleid).toggle(); | ||
$("#" + toggleid).toggleClass('d-none'); | ||
$("#" + toggleid + ' .comment_reply_body').focus(); | ||
}); | ||
|
||
// prevent duplicate comment submissions | ||
$('.comment_new').submit(function() { | ||
$(this).find('input[type="submit"]').prop('disabled', true); | ||
}); | ||
|
||
$('.comment_new').on('ajax:complete', function(event, data) { | ||
$('#comments').html(data.responseText); | ||
|
||
// as the comments get loaded again, the jQuery bindings are lost. We need to reload them. | ||
reloadCommentBindings(); | ||
}); | ||
} | ||
|
||
$(document).ready(function(){ | ||
reloadCommentBindings(); | ||
}); |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,206 @@ | ||
function updateSupersedeAndDevelPackageDisplay() { | ||
if ($('#targetproject').length > 0 && $('#targetproject')[0].value.length > 2) { | ||
if ($('#targetproject')[0].value === $('#sourceproject')[0].value) { | ||
$('#sourceupdate-display').hide(); | ||
$('#sourceupdate').prop('disabled', true); // hide 'sourceupdate' from Ruby | ||
} else { | ||
$('#sourceupdate-display').show(); | ||
$('#sourceupdate').prop('disabled', false); | ||
} | ||
$.ajax({ | ||
url: $('#targetproject').data('requests-url'), | ||
data: { | ||
project: $('#targetproject')[0].value, | ||
source_project: $('#project')[0].value, // jshint ignore:line | ||
package: $('#package')[0].value, | ||
types: 'submit', | ||
states: ['new', 'review', 'declined'] | ||
}, | ||
success: function (data) { | ||
if (data.indexOf('No requests') === -1) { | ||
$('#supersede-display').removeClass('d-none'); | ||
$('#supersede-requests').html(data); | ||
} else { | ||
$('#supersede-display').addClass('d-none'); | ||
$('#supersede-requests').html(''); | ||
} | ||
} | ||
}); | ||
$.ajax({ | ||
url: $('#targetproject').data('develpackage-url'), | ||
data: { | ||
project: $('#targetproject')[0].value, | ||
package: $('#package')[0].value | ||
}, | ||
success: function (data) { | ||
if (data.length > 0) { | ||
$('#devel-project-warning').removeClass('d-none'); | ||
$('#devel-project-name').html(data); | ||
} else { | ||
$('#devel-project-warning').addClass('d-none'); | ||
} | ||
} | ||
}); | ||
} | ||
} | ||
|
||
function setupRequestDialog() { // jshint ignore:line | ||
$('#devel-project-name').click(function () { | ||
$('#targetproject').attr('value', $('#devel-project-name').html()); | ||
}); | ||
|
||
$('#targetproject').autocomplete({ | ||
appendTo: '.modal-body', | ||
source: $('#targetproject').data('autocomplete-url'), | ||
search: function() { | ||
$(this).addClass('loading-spinner'); | ||
}, | ||
response: function() { | ||
$(this).removeClass('loading-spinner'); | ||
}, | ||
minLength: 2, | ||
select: updateSupersedeAndDevelPackageDisplay, | ||
change: updateSupersedeAndDevelPackageDisplay, | ||
max: 50 | ||
}); | ||
|
||
updateSupersedeAndDevelPackageDisplay(); | ||
} | ||
|
||
function requestAddAcceptRequestButton() { // jshint ignore:line | ||
$('#accept_request_button').click(function () { | ||
var additionalElement; | ||
|
||
/* Add some hidden elements to carry HTML form data that is found at other DOM places for design reasons. */ | ||
if ($('.submitter_is_maintainer_checkbox').size() !== 0 && | ||
$('.submitter_is_maintainer_checkbox').is(':checked')) { | ||
additionalElement = '<input id="' + $('.submitter_is_maintainer_checkbox').attr('id') + | ||
'" name="' + $('.submitter_is_maintainer_checkbox').attr('name') + | ||
'" type="hidden" value="' + $('.submitter_is_maintainer_checkbox').attr('value') + '"/>'; | ||
$('#request_handle_form p:last').append(additionalElement); | ||
} | ||
if ($('.forward_checkbox').size() !== 0 && | ||
$('.forward_checkbox').is(':checked')) { | ||
$('.forward_checkbox').each(function () { | ||
additionalElement = '<input id="' + $(this).attr('id') + | ||
'" name="' + $(this).attr('name') + | ||
'" type="hidden" value="' + $(this).attr('value') + '"/>'; | ||
$('#request_handle_form p:last').append(additionalElement); | ||
}); | ||
} | ||
}); | ||
} | ||
|
||
function requestShowReview() { // jshint ignore:line | ||
var index; | ||
$('.review_descision_link').click(function (event) { | ||
$('#review_descision_select li.selected').attr('class', ''); | ||
$(event.target).parent().attr('class', 'selected'); | ||
$('.review_descision_display').hide(); | ||
index = event.target.id.split('review_descision_link_')[1]; | ||
$('#review_descision_display_' + index).show(); | ||
return false; | ||
}); | ||
} | ||
|
||
function requestAddReviewAutocomplete() { // jshint ignore:line | ||
|
||
$('#review_type').change(function () { | ||
switch ($('#review_type option:selected').attr('value')) { | ||
case "user": | ||
{ | ||
$('#review_user_span').show(); | ||
$('#review_group_span').hide(); | ||
$('#review_project_span').hide(); | ||
$('#review_package_span').hide(); | ||
} | ||
break; | ||
case "group": | ||
{ | ||
$('#review_user_span').hide(); | ||
$('#review_group_span').show(); | ||
$('#review_project_span').hide(); | ||
$('#review_package_span').hide(); | ||
} | ||
break; | ||
case "project": | ||
{ | ||
$('#review_user_span').hide(); | ||
$('#review_group_span').hide(); | ||
$('#review_project_span').show(); | ||
$('#review_package_span').hide(); | ||
} | ||
break; | ||
case "package": | ||
{ | ||
$('#review_user_span').hide(); | ||
$('#review_group_span').hide(); | ||
$('#review_project_span').show(); | ||
$('#review_package_span').show(); | ||
} | ||
break; | ||
} | ||
}); | ||
|
||
$("#review_group").autocomplete({source: '/group/autocomplete', minChars: 2, matchCase: true, max: 50, | ||
search: function() { | ||
$(this).addClass('loading-spinner'); | ||
}, | ||
response: function() { | ||
$(this).removeClass('loading-spinner'); | ||
}}); | ||
$("#review_user").autocomplete({source: '/user/autocomplete', minChars: 2, matchCase: true, max: 50, | ||
search: function() { | ||
$(this).addClass('loading-spinner'); | ||
}, | ||
response: function() { | ||
$(this).removeClass('loading-spinner'); | ||
}}); | ||
$("#review_project").autocomplete({source: '/project/autocomplete_projects', minChars: 2, matchCase: true, max: 50, | ||
search: function() { | ||
$(this).addClass('loading-spinner'); | ||
}, | ||
response: function() { | ||
$(this).removeClass('loading-spinner'); | ||
}}); | ||
$("#review_package").autocomplete({ | ||
source: function (request, response) { | ||
$.ajax({ | ||
url: '/project/autocomplete_packages', | ||
dataType: "json", | ||
data: { | ||
term: request.term, | ||
project: $("#review_project").val() | ||
}, | ||
success: function (data) { | ||
response(data); | ||
} | ||
}); | ||
}, | ||
search: function() { | ||
$(this).addClass('loading-spinner'); | ||
}, | ||
response: function() { | ||
$(this).removeClass('loading-spinner'); | ||
}, | ||
minLength: 2, | ||
minChars: 0, | ||
matchCase: true, | ||
max: 50 | ||
}); | ||
} | ||
|
||
function setupActionLink() { // jshint ignore:line | ||
var index; | ||
$('.action_select_link').click(function (event) { | ||
$('#action_select li.selected').attr('class', ''); | ||
$(event.target).parent().attr('class', 'selected'); | ||
$('.action_display').hide(); | ||
index = event.target.id.split('action_select_link_')[1]; | ||
$('#action_display_' + index).show(); | ||
// It is necessary to refresh the CodeMirror editors after switching tabs to initialise the dimensions again. | ||
// Otherwise the editors are empty after calling show(). | ||
editors.forEach( function(editor) { editor.refresh(); }); | ||
return false; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.