5 $('.filter').change(function() {
6 document.filter[this.name].value = this.value;
7 document.filter.submit();
10 $('.check-filter').change(function() {
11 document.filter[this.name].value = this.checked ? '1' : '';
12 document.filter.submit();
15 $('.text-filter').each(function() {
17 $(inp).parent().submit(function() {
18 document.filter[inp.name].value = inp.value;
19 document.filter.submit();
25 $('.autoslug-source').change(function() {
26 $('.autoslug').attr('value', slugify(this.value));
30 var nowTemp = new Date();
31 var now = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), nowTemp.getDate(), 0, 0, 0, 0);
33 $('.datepicker-field').each(function() {
34 var checkout = $(this).datepicker({
37 onRender: function(date) {
38 return date.valueOf() < now.valueOf() ? 'disabled' : '';
40 }).on('changeDate', function(ev) {
42 }).data('datepicker');
46 $("select").change(function() {
47 var helpdiv = $(this).next();
48 if (helpdiv.hasClass('help-text')) {
49 var helptext = $("option:selected", this).attr('data-help');
50 helpdiv.html($("option:selected", this).attr('data-help') || '');
60 var first_reset = true;
62 if (start) $(start).popover('hide');
65 tutorial = $.makeArray($('[data-toggle="tutorial"]').sort(
66 function(a, b) {return $(a).attr('data-tutorial') < $(b).attr('data-tutorial') ? -1 : 1}
70 $.each(tutorial, function(i, e) {
71 var but = (i < tutorial.length - 1) ? '>>' : 'OK';
75 template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div><div><a class="btn btn-default tutorial-off" href="#-" id="tutoff'+i+'">×</a><a style="float:right" class="btn btn-default tutorial-next" href="#-" id="nt'+i+'">' + but + '</a></div></div>'
76 }).on('shown.bs.popover', function () {
77 if (!$(e).data('tut-yet')) {
78 $("#tutoff"+i).on('click', tutoff);
79 $("#nt"+i).on('click', tut);
80 $(e).data('tut-yet', 'yes');
83 //$(start).on('hide.bs.popover', tut);
90 sessionStorage.setItem("tutorial", "on");
92 $('#tutModal').modal('show');
96 if (start) $(start).popover('hide');
98 sessionStorage.removeItem("tutorial");
102 if (start) $(start).popover('hide');
103 if (tutorial.length) {
104 start = tutorial.shift();
105 $(start).popover('show');
106 //~ if (!$(start).data('tut-yet')) {
107 //~ $(".popover .tutorial-off").on('click', tutoff);
108 //~ $(".popover .tutorial-next").on('click', tut);
109 //~ $(start).data('tut-yet', 'yes');
117 $('#tutModal').on('hidden.bs.modal', tut);
119 if (sessionStorage.getItem("tutorial") == "on" && $("#tuton").length == 0) {
123 $("#tuton").on('click', tuton);