1/** 2 * Anything Popup 3 * Copyright (C) 2011 - 2022 www.gopiplus.com 4 * http://www.gopiplus.com/work/2012/05/25/wordpress-popup-plugin-anything-popup/ 5 * 6 * This program is free software: you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation, either version 3 of the License, or 9 * (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program. If not, see <http://www.gnu.org/licenses/>. 18 */ 19 20var AnythingPopup_Box=null; 21 22function AnythingPopup_OpenForm(AnythingPopup_BoxContainer_Id,AnythingPopup_BoxContainerBody_Id,AnythingPopup_BoxContainerFooter_Id,AnythingPopup_Width,AnythingPopup_Height) 23{ 24 var bgdiv = document.getElementById(AnythingPopup_BoxContainerFooter_Id); 25 bgdiv.style.display="block"; 26 27 var formdiv = document.getElementById(AnythingPopup_BoxContainer_Id); 28 formdiv.style.display="block"; 29 30 var pt = window.center({width:AnythingPopup_Width,height:AnythingPopup_Height}); 31 32 var left = 0; 33 var top = 0; 34 if(screen.width > AnythingPopup_Width) 35 { 36 left = pt.x; 37 top = pt.y; 38 } 39 else 40 { 41 left = 10; 42 top = 10; 43 } 44 45 formdiv.style.top = top + "px"; 46 formdiv.style.left = left + "px"; 47 48 //formdiv.style.top = pt.y + "px"; 49 //formdiv.style.left = pt.x + "px"; 50 51 //formdiv.style.top = "200px"; 52 //formdiv.style.left = "550px"; 53 54 formdiv.handlerobj = new AnythingPopup_Move(formdiv); 55 56 var containerdiv = document.getElementById(AnythingPopup_BoxContainerBody_Id); 57 if(containerdiv && containerdiv.SavedInnerHTML) 58 { 59 containerdiv.innerHTML = containerdiv.SavedInnerHTML; 60 } 61 62} 63 64function AnythingPopup_HideForm(AnythingPopup_BoxContainer_Id,AnythingPopup_BoxContainerFooter_Id) 65{ 66 var formdiv = document.getElementById(AnythingPopup_BoxContainer_Id); 67 formdiv.style.display="none"; 68 69 var bgdiv = document.getElementById(AnythingPopup_BoxContainerFooter_Id); 70 bgdiv.style.display="none"; 71} 72 73function AnythingPopup_Move(div_obj) 74{ 75 var _div_obj = div_obj; 76 //div_obj.handlerobj = this; 77 78 var downposX = 0; 79 var downposY = 0; 80 var dragging = false; 81 82 this.isIE = false; 83 this.isNS = false; 84 85 86 this.Init = function() 87 { 88 if (navigator.userAgent.indexOf("MSIE") >= 0 || 89 navigator.userAgent.indexOf("Opera") >= 0) 90 { 91 this.isIE = true; 92 } 93 else 94 { 95 this.isNS = true; 96 } 97 } 98 99 100 _div_obj.onmousedown = function(event) 101 { 102 var x=0; 103 var y=0; 104 105 _this = this.handlerobj; 106 107 if (_this.isIE) 108 { 109 x = window.event.clientX + 110 document.documentElement.scrollLeft + 111 document.body.scrollLeft; 112 113 y = window.event.clientY + 114 document.documentElement.scrollTop + 115 document.body.scrollTop; 116 } 117 else 118 { 119 x = event.clientX + window.scrollX; 120 y = event.clientY + window.scrollY; 121 } 122 123 var top = parseInt(this.style.top, 10); 124 125 var client_y = y - top; 126 if(!(client_y>0 && client_y<30)) 127 { 128 return; 129 } 130 131 _this.cursorStartX = x; 132 _this.cursorStartY = y; 133 _this.divStartX = parseInt(this.style.left, 10); 134 _this.divStartY = top; 135 136 if (this.handlerobj.isIE) 137 { 138 document.attachEvent("onmousemove", _this.onmousemove); 139 document.attachEvent("onmouseup", _this.onmouseup); 140 window.event.cancelBubble = true; 141 window.event.returnValue = false; 142 } 143 else 144 { 145 document.addEventListener("mousemove", _this.onmousemove, true); 146 document.addEventListener("mouseup", _this.onmouseup, true); 147 event.preventDefault(); 148 } 149 150 AnythingPopup_Box = _this; 151 _this._div_obj = this; 152 153 } 154 155 this.onmousemove = function(event) 156 { 157 _this = AnythingPopup_Box; 158 159 var x = 0; 160 var y = 0; 161 162 163 if (_this.isIE) 164 { 165 x = window.event.clientX + document.documentElement.scrollLeft 166 + document.body.scrollLeft; 167 y = window.event.clientY + document.documentElement.scrollTop 168 + document.body.scrollTop; 169 } 170 else 171 { 172 x = event.clientX + window.scrollX; 173 y = event.clientY + window.scrollY; 174 } 175 176 _this._div_obj.style.left = (_this.divStartX + x - _this.cursorStartX) + "px";
177 _this._div_obj.style.top = (_this.divStartY + y - _this.cursorStartY) + "px"; 178 179 if (_this.isIE) 180 { 181 window.event.cancelBubble = true; 182 window.event.returnValue = false; 183 } 184 else 185 { 186 event.preventDefault(); 187 } 188 } 189 190 this.onmouseup = function() 191 { 192 _this = AnythingPopup_Box; 193 if (_this.isIE) 194 { 195 document.detachEvent("onmousemove", _this.onmousemove); 196 document.detachEvent("onmouseup", _this.onmouseup); 197 } 198 else 199 { 200 document.removeEventListener("mousemove", _this.onmousemove, true); 201 document.removeEventListener("mouseup", _this.onmouseup, true); 202 } 203 AnythingPopup_Box = null; 204 205 } 206 207 this.Init(); 208} 209 210window.size = function() 211{ 212 var w = 0; 213 var h = 0; 214 215 if(!window.innerWidth) 216 { 217 if(!(document.documentElement.clientWidth == 0)) 218 { 219 w = document.documentElement.clientWidth; 220 h = document.documentElement.clientHeight; 221 } 222 else 223 { 224 w = document.body.clientWidth; 225 h = document.body.clientHeight; 226 } 227 } 228 else 229 { 230 w = window.innerWidth; 231 h = window.innerHeight; 232 } 233 return {width:w,height:h}; 234} 235 236window.center = function() 237{ 238 var hWnd = (arguments[0] != null) ? arguments[0] : {width:0,height:0}; 239 240 var _x = 0; 241 var _y = 0; 242 var offsetX = 0; 243 var offsetY = 0; 244 245 if(!window.pageYOffset) 246 { 247 if(!(document.documentElement.scrollTop == 0)) 248 { 249 offsetY = document.documentElement.scrollTop; 250 offsetX = document.documentElement.scrollLeft; 251 } 252 else 253 { 254 offsetY = document.body.scrollTop; 255 offsetX = document.body.scrollLeft; 256 } 257 } 258 else 259 { 260 offsetX = window.pageXOffset; 261 offsetY = window.pageYOffset; 262 } 263 264 _x = ((this.size().width-hWnd.width)/2)+offsetX; 265 _y = ((this.size().height-hWnd.height)/2)+offsetY; 266 _x = ((this.size().width-hWnd.width)/2); 267 _y = ((this.size().height-hWnd.height)/2); 268 269 return{x:_x,y:_y}; 270}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.