1 //<script type="text/javascript">
5 showdiff : function(tx, part, target) {
6 var d = $('#' + target)[0];
7 if (d.getAttribute('current') == tx+'?'+part) {
9 d.setAttribute('current', '') ;
12 d.innerHTML = ' Loading...';
14 d.setAttribute('current', tx+'?'+part) ;
17 $('#' + target).load( ABSWEB + 'jschangeset.php' + tx + '?part=' + part );
37 function show_comment_form()
42 //viewblock.css('position', view_pos);
43 //viewblock.css('top', view_off.top);
44 $("#comment-submit-buttons").hide();
45 $(".mtrack-make-comment").hide();
50 $("#update-issue-desc").show()
51 $("#comment-container").show();
52 // what's this about...
53 $("#edit-comment-parent").append($("#comment-area"));
54 $("#comment-area").show();
60 //edit_off = editblock.offset();
61 //edit_pos = editblock.css('position');
62 $("#description").focus();
67 function show_edit_form()
69 //view_off = viewblock.offset();
70 //view_pos = viewblock.css('position');
73 // viewblock.css('position', view_pos);
74 // viewblock.css('top', view_off.top);
77 $("#issue-desc").hide();
78 $("#comment-submit-buttons").hide();
79 $(".mtrack-make-comment").hide();
80 $("#comment-container").hide();
83 $("#update-issue-desc").show()
84 $("#edit-issue-desc").show();
85 //$("#edit-comment-parent").append($("#comment-area"));
87 //$("#comment-area").show();
89 $("#description").focus();
92 //edit_off = editblock.offset();
93 //edit_pos = editblock.css('position');
99 function cancel_form_changes()
102 document.location.href = document.location.href;
106 //editblock.css('position', edit_pos);
107 //editblock.css('top', edit_off.top);
111 $("#tktedit").each(function(){
115 // notify asm select of change
116 $("select[multiple]").change();
117 $("#edit-issue-desc").hide();
118 $("#update-issue-desc").hide()
119 $("#original-comment-parent").append($("#comment-area"));
120 $("#comment-submit-buttons").show();
123 $("#comment-area").hide();
124 $(".mtrack-make-comment").show();
126 $("#issue-desc").show();
134 function compute_floats() // disabled at present..
137 if ($(viewblock).is(':visible')) {
138 view_off = viewblock.offset();
139 if ($(this).scrollTop() > view_off.top) {
140 viewblock.css('position', 'fixed');
141 viewblock.css('top', '0px');
142 viewblock.addClass('button-float-floating');
144 viewblock.css('position', view_pos);
145 viewblock.css('top', view_off.top);
146 viewblock.removeClass('button-float-floating');
149 if ($(editblock).is(':visible')) {
150 edit_off = editblock.offset();
151 if ($(this).scrollTop() > edit_off.top) {
152 editblock.css('position', 'fixed');
153 editblock.css('top', '0px');
154 editblock.addClass('button-float-floating');
155 } else if ($(this).scrollTop() < edit_off.top + editblock.height() - $(this).height()) {
156 editblock.css('position', 'fixed');
157 editblock.css('top', $(this).height() - editblock.outerHeight());
158 editblock.addClass('button-float-floating');
160 editblock.css('position', edit_pos);
161 editblock.css('top', edit_off.top);
162 editblock.removeClass('button-float-floating');
168 var mtrack_ticked_loaded = false;
169 $(document).ready(function()
172 if (mtrack_ticked_loaded) {
175 mtrack_ticked_loaded = true;
177 viewblock = $('#tkt-view-button-block');
178 editblock = $('#tkt-edit-button-block');
180 if (typeof(tid) == 'undefined') {
181 return; // not a ticket page..
188 $('#tkt-edit-button-block .mtrack-edit-cancel').hide();
190 // $(window).scroll(function () {
197 $('#events-list').load( baseURL + '/Events/' + tid, function() {
198 $('abbr.timeinterval').timeago();
199 $('.ticketchangeinfo').hide();
201 $('.ticketevent-expand').click(function() {
202 var n = this.id.split('-').pop();
203 var target = "[id='ticketchangeinfo-" + n + "']";
204 var loadit = $(target).is(":hidden") && !$(target)[0].getAttribute('loaded');
207 $(target).toggle(100);
210 if (loadit && n.match(/\./)) {
212 $(target)[0].innerHTML = ' Loading...';
214 $(target)[0].setAttribute('loaded', 'true');
215 $(target).load( baseURL + '/Changeset/' + this.title + '?nowrap=1');
223 // load the watchers..
232 $(".mtrack-edit-desc").click(
240 $("input[type=radio]").click(
242 if (this.value == 'fixed') {
243 $("#changelog-container").show();
245 $("#changelog-container").hide();
250 $(":input").change(function() {
255 $("textarea").keyup(function() {
256 // This is here because IE doesn't seem to reliably trigger the
257 // change event with textareas
263 $("#confirmCancelDialog").dialog({
269 'Discard': function() {
270 $(this).dialog('close');
271 cancel_form_changes();
274 $(this).dialog('close');
279 $("#noCommentDialog").dialog({
286 $(this).dialog('close');
287 $("#comment").focus();
291 $("#noSummaryDialog").dialog({
298 $(this).dialog('close');
299 $("#summary").focus();
305 $(".mtrack-edit-cancel").click(
308 $("#confirmCancelDialog").dialog('open');
311 return cancel_form_changes();
317 $(".mtrack-make-comment").click(
320 $("#comment").focus();
325 $(".mtrack-button-submit").click(function(){
328 if ($("#summary").val() == '') {
330 $("#summary").addClass('error');
331 $("#noSummaryDialog").dialog('open');
336 if (formChanged == false && $("#comment").val() == '') {
337 $("#comment").addClass('error');
338 $("#noCommentDialog").dialog('open');
346 $("#comment").keydown(function(){
347 $("#comment").removeClass('error');
350 $("#summary").keydown(function(){
351 $("#summary").removeClass('error');
354 if (issue_tid_null) {
355 $("#summary").focus();
358 $('#button-show-overflow').click(function() {
359 $('#show-overflow').hide('blind');
360 $('#ticketcommentsoverflow').show('clip');