2012-02-08 14:01:00 +00:00
|
|
|
//= require jquery
|
2014-03-13 23:00:52 +00:00
|
|
|
//= require jquery-migrate-min
|
2012-02-08 14:01:00 +00:00
|
|
|
//= require jquery_ujs
|
|
|
|
//= require jquery-ui
|
|
|
|
//= require autocomplete-rails
|
|
|
|
//= require vendor
|
2012-03-13 15:05:33 +00:00
|
|
|
//= require jquery.dataTables_ext
|
2012-03-01 17:33:46 +00:00
|
|
|
//= require_tree ./design
|
|
|
|
//= require_tree ./extra
|
2012-06-18 23:49:17 +01:00
|
|
|
//= require_tree ./lib
|
2012-04-09 18:11:39 +01:00
|
|
|
|
|
|
|
//= require underscore
|
2013-07-12 20:27:49 +01:00
|
|
|
|
2013-08-05 18:38:48 +01:00
|
|
|
//= require js-routes
|
2013-07-12 20:27:49 +01:00
|
|
|
// require angular
|
|
|
|
//= require unstable/angular
|
|
|
|
// require angular-resource
|
|
|
|
//= require unstable/angular-resource
|
2013-07-11 11:34:44 +01:00
|
|
|
//= require ng-rails-csrf
|
2013-07-19 13:34:55 +01:00
|
|
|
//= require angular-i18n
|
2013-07-11 11:34:44 +01:00
|
|
|
//= require_tree ./angularjs
|
2013-07-15 11:11:17 +01:00
|
|
|
//= require moment
|
2013-08-20 20:28:39 +01:00
|
|
|
|
|
|
|
// require soundmanager2
|
|
|
|
//= require soundmanager2-nodebug-jsmin
|
2013-07-12 20:27:49 +01:00
|
|
|
|
2012-03-01 17:33:46 +00:00
|
|
|
//= require_self
|
2012-02-08 14:01:00 +00:00
|
|
|
|
2012-03-03 16:03:23 +00:00
|
|
|
function disableNotifierCbx(global_cbx) {
|
|
|
|
if ($(global_cbx).attr('checked')) {
|
|
|
|
$('.notify_cbx').removeAttr('disabled');
|
|
|
|
$('.notify_cbx').each(function(i,el) { $(el).prev().removeAttr('disabled'); })
|
|
|
|
} else {
|
|
|
|
$('.notify_cbx').attr('disabled', 'disabled');
|
|
|
|
$('.notify_cbx').each(function(i,el) { $(el).prev().attr('disabled', 'disabled'); })
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$(document).ready(function() {
|
2012-04-17 14:39:14 +01:00
|
|
|
// setup all placeholders on page
|
|
|
|
$('input[placeholder], textarea[placeholder]').placeholder();
|
|
|
|
|
|
|
|
|
2012-03-03 16:03:23 +00:00
|
|
|
$('input.user_role_chbx').click(function() {
|
|
|
|
var current = $(this);
|
|
|
|
current.parent().find('input.user_role_chbx').each(function(i,el) {
|
|
|
|
if ($(el).attr('id') != current.attr('id')) {
|
2012-08-29 15:58:58 +01:00
|
|
|
$(el).removeAttr('checked');
|
2012-03-03 16:03:23 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#settings_notifier_can_notify').click(function() {
|
|
|
|
disableNotifierCbx($(this));
|
|
|
|
});
|
|
|
|
|
2014-03-13 10:09:00 +00:00
|
|
|
$('div.information > div.profile > a').on('click', function(e) {
|
2012-03-03 16:03:23 +00:00
|
|
|
e.preventDefault();
|
|
|
|
});
|
2012-03-21 10:25:30 +00:00
|
|
|
|
2014-03-13 10:09:00 +00:00
|
|
|
$('.more_activities').on('click', function(){
|
2012-03-21 10:25:30 +00:00
|
|
|
var button = $(this);
|
|
|
|
$.ajax({
|
|
|
|
type: 'GET',
|
|
|
|
url: button.attr("href"),
|
|
|
|
success: function(data){
|
|
|
|
button.fadeOut('slow').after(data);
|
|
|
|
button.remove();
|
2013-09-01 14:01:37 +01:00
|
|
|
updateTime();
|
2012-03-21 10:25:30 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
2013-02-12 16:35:14 +00:00
|
|
|
$('#description-top .git_help').click(function() {
|
2012-04-05 08:26:03 +01:00
|
|
|
$('#git_help_data').toggle();
|
|
|
|
});
|
|
|
|
|
2012-06-28 12:31:25 +01:00
|
|
|
$(".toggle_btn").click(function() {
|
|
|
|
var target = $( $(this).attr('data-target') );
|
|
|
|
//target.toggle();
|
|
|
|
if ( target.css('visibility') == 'hidden' ) {
|
|
|
|
target.css('visibility', 'visible');
|
|
|
|
} else {
|
|
|
|
target.css('visibility', 'hidden');
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
});
|
2012-08-29 15:58:58 +01:00
|
|
|
|
2012-09-21 11:31:55 +01:00
|
|
|
window.CodeMirrorRun = function(code) {
|
|
|
|
CodeMirror.runMode(code.innerHTML.replace(/&/gi, '&').replace(/</gi, '<').replace(/>/gi, '>'), code.className, code);
|
|
|
|
}
|
|
|
|
|
|
|
|
$('.md_and_cm code').each(function (code) { CodeMirrorRun(this); });
|
2013-09-01 13:06:42 +01:00
|
|
|
|
|
|
|
window.updateTime = function () {
|
|
|
|
$('.datetime_moment').each(function() {
|
|
|
|
$(this).html(moment($(this).attr('origin_datetime'), 'X').fromNow());
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
updateTime();
|
|
|
|
setInterval( updateTime, 15000 );
|
2013-09-10 18:03:00 +01:00
|
|
|
|
|
|
|
window.updatePagination = function(link) {
|
|
|
|
var page = parseInt($('.pagination .current').text());
|
|
|
|
if (link.hasClass('next_page')) {
|
|
|
|
page += 1;
|
|
|
|
} else {
|
|
|
|
if (link.hasClass('previous_page')) {
|
|
|
|
page -= 1;
|
|
|
|
} else {
|
|
|
|
page = link.text();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$('.pagination .current').html(page);
|
|
|
|
};
|
|
|
|
|
|
|
|
window.isSearchUser = null;
|
|
|
|
window.search_items = function(path, fdata, dom) {
|
|
|
|
if (window.isSearchUser != null) { window.isSearchUser.abort(); }
|
|
|
|
window.isSearchUser = $.ajax({
|
|
|
|
type: 'GET',
|
|
|
|
url: path,
|
|
|
|
data: fdata,
|
|
|
|
success: function(data) {
|
|
|
|
dom.html(data);
|
|
|
|
updateTime();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
return false;
|
|
|
|
}
|
2012-03-03 16:03:23 +00:00
|
|
|
});
|