home *** CD-ROM | disk | FTP | other *** search
- var Bloggers = window.opener.Ya.Bloggers;
-
- var BloggersWindow = {
- onLoad: function() {
- let AppInfo = window.opener.Ya.nsIYa.AppInfo;
- if (AppInfo.OS.isWindows && AppInfo.browser.isGreaterThenFx30) {
- let shadowAttribute = document.createAttribute("yashadow");
- shadowAttribute.value = "window";
- document.documentElement.attributes.setNamedItem(shadowAttribute);
- }
-
- window.sizeToContent();
-
- let position = Bloggers.savedPosition ||
- { x: screen.availLeft + screen.availWidth - window.outerWidth - 10,
- y: screen.availTop + screen.availHeight - window.outerHeight - 10 };
-
- window.moveTo(position.x, position.y);
-
- BloggersWindow.checkWindowVisible();
-
- Bloggers.refreshData(false, true);
- },
-
- onUnload: function() {
- },
-
- _visiblePixels: 40,
-
- checkWindowVisible: function() {
- let x = 0,
- y = 0;
-
- let xDiff = window.screenX + window.outerWidth - this._visiblePixels;
- if (xDiff < 0) {
- x = xDiff;
- } else {
- xDiff = window.screenX - (screen.availLeft + screen.availWidth - this._visiblePixels);
- if (xDiff > 0)
- x = xDiff;
- }
-
- let yDiff = window.screenY;
- if (yDiff < 0) {
- y = yDiff;
- } else {
- yDiff = window.screenY - (screen.availTop + screen.availHeight - this._visiblePixels);
- if (yDiff > 0)
- y = yDiff;
- }
-
- if (x == 0 && y == 0)
- return;
-
- this.handleMouseMove({x: x, y: y});
- },
-
- handleMouseMove: function(aDiff) {
- let x = window.screenX - aDiff.x;
- let y = window.screenY - aDiff.y;
-
- if (x < (-window.outerWidth + this._visiblePixels) ||
- x > (screen.availLeft + screen.availWidth - this._visiblePixels))
- aDiff.x = 0;
-
- if (y < 0 ||
- y > (screen.availTop + screen.availHeight - this._visiblePixels))
- aDiff.y = 0;
-
- if (aDiff.x == 0 && aDiff.y == 0)
- return;
-
- window.moveTo(window.screenX - aDiff.x, window.screenY - aDiff.y);
-
- Bloggers.savedPosition = {x: window.screenX, y: window.screenY};
- }
- }