1 // For Firefox < 3.6, which doesn't support document.readyState
2 // verify that document.readyState is undefined
3 // verify that document.addEventListener is there
4 // these two conditions are basically telling us
5 // we are using Firefox < 3.6
6 /*if(document.readyState == null && document.addEventListener){
7 // on DOMContentLoaded event, supported since ages
8 document.addEventListener("DOMContentLoaded", function DOMContentLoaded(){
9 // remove the listener itself
10 document.removeEventListener("DOMContentLoaded", DOMContentLoaded, false);
11 // assign readyState as complete
12 document.readyState = "complete";
14 // set readyState = loading or interactive
15 // it does not really matter for this purpose
16 document.readyState = "loading";
19 document.addEventListener('DOMContentLoaded', function(){
21 if(typeof window.AjaxUpload != "undefined") {
22 var uploader = new window.AjaxUpload(
23 window.imageUploadButton,
24 { action: 'wall_upload/'+window.nickname,
26 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
27 onComplete: function(file,response) {
28 var currentText = $(window.jotId).val();
29 $(window.jotId).val(currentText + response);
30 $('#profile-rotator').hide();
35 if(document.getElementById('wall-file-upload') != null) {
36 var file_uploader = new window.AjaxUpload(
38 { action: 'wall_attach/'+window.nickname,
40 onSubmit: function(file,ext) { $('#profile-rotator').show(); },
41 onComplete: function(file,response) {
42 var currentText = $(window.jotId).val();
43 $(window.jotId).val(currentText + response);
44 $('#profile-rotator').hide();
53 function confirmDelete(f) {
54 response = confirm(window.delItem);
55 if(response && typeof f == 'function') {
61 function changeHref(elemId, url) {
62 elem = document.getElementById(elemId);
66 function remove(elemId) {
67 elem = document.getElementById(elemId);
68 elem.parentNode.removeChild(elem);
71 function openClose(el) {}
73 // It's better to separate Javascript from the HTML, but the wall_thread
74 // items require more work to find since they contain the item ID in the id field
75 //document.getElementById('photo-album-edit-drop').onclick = function(){return confirmDelete(function(){remove('photo-album-edit-form-confirm');});}
76 //document.getElementById('photo-edit-delete-button').onclick = function(){return confirmDelete(function(){remove('photo-edit-form-confirm');});}