From: Daniel W. <d...@ni...> - 2006-08-30 12:46:05
|
Firstly - Kurt, thank you for a splendid plugin. The shift+click stuff in particular is really useful. There is one problem that I notice however. This basically stems from the fact that the plugin outputs a lot of javascript within the message list body (right_main.php). On slower connections (and particularly over https) my users complain of often seeing the javascript code displayed on the page. This is obviously undesirable. Here is a sample: =============CODE===================== -1 ) && ( last_checked_message > -1 ) ){ //get index number of current element var element_index = 0; for (var i = 0; i < document.FormMsgsINBOX.elements.length; i++) { if( document.FormMsgsINBOX.elements[i].name == element ) { element_index = i; i = document.FormMsgsINBOX.elements.length + 1; } } //if we are after the last checked element, we fill from the bottom up if( element_index >= last_checked_message ){ fill_type = "bottom_up"; //see if the element before this element was checked for (var i = element_index - 1; i >= 0; i--) { if( document.FormMsgsINBOX.elements[i].type == 'checkbox' ) { if( document.FormMsgsINBOX.elements[i].checked ){ checked_before_current = 1; } i = -1; } } } //if we are before the first checked element, we fill from the top down else if( element_index <= first_checked_message ){ fill_type = "top_down"; //see if the element after this element was checked for (var i = element_index + 1; i <= document.FormMsgsINBOX.elements.length; i++) { ====================END CODE=============== Interestingly the character just before this is a ">" sign which I believe is a well known problem with javascript on some browsers (with them thinking this is closing the comment). Could I suggest that all of the js code is moved up into the head? The right_main.php file has a hook called 'generic_header'. Is this a place you could add js code to the <head> section of the page? Functions obviously do not need to be 'inline' with the body and I think this would solve the problem. This principle should apply to all plugin's writing js code - it might be an idea to add this to the plugin writing guide. Best wishes, Daniel |