source: extensions/Autosize/js/autosizeDetect.js @ 18949

Last change on this file since 18949 was 18735, checked in by cljosse, 12 years ago

[extensions] Autosize fix compatibility with 2.4 (option marge bottom)

File size: 2.1 KB
Line 
1
2function on_load() {
3  var myWidth = 0, myHeight = 0, myImgWidth =0,  myImgHeight = 0;
4  if (typeof (window.innerWidth) == 'number') {
5    //Non-IE
6    myWidth = window.innerWidth;
7    myHeight = window.innerHeight;
8  } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
9    //IE 6+ in 'standards compliant mode'
10    myWidth = document.documentElement.clientWidth;
11    myHeight = document.documentElement.clientHeight;
12  } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
13    //IE 4 compatible
14    myWidth = document.body.clientWidth;
15    myHeight = document.body.clientHeight;
16  }
17  windowWidth =parseInt( myWidth);
18  windowHeight = parseInt(myHeight);
19
20  theImageRight = 2;
21  theImageLeft=261;
22  theImageMargeWidth=0;
23
24  theImageTop =73;
25  theImageBottom = 0;
26  theImageMargeHeight=0;
27  jQuery.cookie('windowHeight', myHeight, { path: COOKIE_PATH  });
28  jQuery.cookie('windowWidth', myWidth, { path: COOKIE_PATH });
29
30  jQuery.cookie('theImageRight', theImageRight, { path: COOKIE_PATH  });
31  jQuery.cookie('theImageLeft',theImageLeft, { path: COOKIE_PATH  });
32  jQuery.cookie('theImageMargeWidth',theImageMargeWidth, { path: COOKIE_PATH  });
33
34  jQuery.cookie('theImageTop',theImageTop, { path: COOKIE_PATH  });
35  jQuery.cookie('theImageBottom',theImageBottom, { path: COOKIE_PATH  });
36  jQuery.cookie('theImageMargeHeight', theImageMargeHeight, { path: COOKIE_PATH });
37/*
38  theImageWidth = windowWidth - theImageRight - theImageLeft - theImageMargeWidth;
39  theImageHeight = windowHeight - theImageTop - theImageBottom - theImageMargeHeight;
40  jQuery.cookie('theImageHeight', theImageHeight, { path: COOKIE_PATH });
41  jQuery.cookie('theImageWidth', theImageWidth, { path: COOKIE_PATH });
42  jQuery.cookie('theMainImageHeight', theMainImageHeight, { path: COOKIE_PATH });
43  jQuery.cookie('theMainImage', theMainImageWidth, { path: COOKIE_PATH });
44*/
45
46  jQuery.cookie('autosize_reload', "ok", { path: COOKIE_PATH });
47 
48 document.location.reload(false); // from cache
49
50}
Note: See TracBrowser for help on using the repository browser.