1/** 2 * Anything Popup 3 * Copyright (C) 2011 - 2016 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 formdiv.style.top = pt.y + "px"; 33 formdiv.style.left = pt.x + "px"; 34 35 //formdiv.style.top = "200px"; 36 //formdiv.style.left = "550px"; 37 38 formdiv.handlerobj = new AnythingPopup_Move(formdiv); 39 40 var containerdiv = document.getElementById(AnythingPopup_BoxContainerBody_Id); 41 if(containerdiv && containerdiv.SavedInnerHTML) 42 { 43 containerdiv.innerHTML = containerdiv.SavedInnerHTML; 44 } 45 46} 47 48function AnythingPopup_HideForm(AnythingPopup_BoxContainer_Id,AnythingPopup_BoxContainerFooter_Id) 49{ 50 var formdiv = document.getElementById(AnythingPopup_BoxContainer_Id); 51 formdiv.style.display="none"; 52 53 var bgdiv = document.getElementById(AnythingPopup_BoxContainerFooter_Id); 54 bgdiv.style.display="none"; 55} 56 57function AnythingPopup_Move(div_obj) 58{ 59 var _div_obj = div_obj; 60 //div_obj.handlerobj = this; 61 62 var downposX = 0; 63 var downposY = 0; 64 var dragging = false; 65 66 this.isIE = false; 67 this.isNS = false; 68 69 70 this.Init = function() 71 { 72 if (navigator.userAgent.indexOf("MSIE") >= 0 || 73 navigator.userAgent.indexOf("Opera") >= 0) 74 { 75 this.isIE = true; 76 } 77 else 78 { 79 this.isNS = true; 80 } 81 } 82 83 84 _div_obj.onmousedown = function(event) 85 { 86 var x=0; 87 var y=0; 88 89 _this = this.handlerobj; 90 91 if (_this.isIE) 92 { 93 x = window.event.clientX + 94 document.documentElement.scrollLeft + 95 document.body.scrollLeft; 96 97 y = window.event.clientY + 98 document.documentElement.scrollTop + 99 document.body.scrollTop; 100 } 101 else 102 { 103 x = event.clientX + window.scrollX; 104 y = event.clientY + window.scrollY; 105 } 106 107 var top = parseInt(this.style.top, 10); 108 109 var client_y = y - top; 110 if(!(client_y>0 && client_y<30)) 111 { 112 return; 113 } 114 115 _this.cursorStartX = x; 116 _this.cursorStartY = y; 117 _this.divStartX = parseInt(this.style.left, 10); 118 _this.divStartY = top; 119 120 if (this.handlerobj.isIE) 121 { 122 document.attachEvent("onmousemove", _this.onmousemove); 123 document.attachEvent("onmouseup", _this.onmouseup); 124 window.event.cancelBubble = true; 125 window.event.returnValue = false; 126 } 127 else 128 { 129 document.addEventListener("mousemove", _this.onmousemove, true); 130 document.addEventListener("mouseup", _this.onmouseup, true); 131 event.preventDefault(); 132 } 133 134 AnythingPopup_Box = _this; 135 _this._div_obj = this; 136 137 } 138 139 this.onmousemove = function(event) 140 { 141 _this = AnythingPopup_Box; 142 143 var x = 0; 144 var y = 0; 145 146 147 if (_this.isIE) 148 { 149 x = window.event.clientX + document.documentElement.scrollLeft 150 + document.body.scrollLeft; 151 y = window.event.clientY + document.documentElement.scrollTop 152 + document.body.scrollTop; 153 } 154 else 155 { 156 x = event.clientX + window.scrollX; 157 y = event.clientY + window.scrollY; 158 } 159 160 _this._div_obj.style.left = (_this.divStartX + x - _this.cursorStartX) + "px";
161 _this._div_obj.style.top = (_this.divStartY + y - _this.cursorStartY) + "px"; 162 163 if (_this.isIE) 164 { 165 window.event.cancelBubble = true; 166 window.event.returnValue = false; 167 } 168 else 169 { 170 event.preventDefault(); 171 } 172 } 173 174 this.onmouseup = function() 175 { 176 _this = AnythingPopup_Box; 177 if (_this.isIE) 178 { 179 document.detachEvent("onmousemove", _this.onmousemove); 180 document.detachEvent("onmouseup", _this.onmouseup); 181 } 182 else 183 { 184 document.removeEventListener("mousemove", _this.onmousemove, true); 185 document.removeEventListener("mouseup", _this.onmouseup, true); 186 } 187 AnythingPopup_Box = null; 188 189 } 190 191 this.Init(); 192} 193 194window.size = function() 195{ 196 var w = 0; 197 var h = 0; 198 199 if(!window.innerWidth) 200 { 201 if(!(document.documentElement.clientWidth == 0)) 202 { 203 w = document.documentElement.clientWidth; 204 h = document.documentElement.clientHeight; 205 } 206 else 207 { 208 w = document.body.clientWidth; 209 h = document.body.clientHeight; 210 } 211 } 212 else 213 { 214 w = window.innerWidth; 215 h = window.innerHeight; 216 } 217 return {width:w,height:h}; 218} 219 220window.center = function() 221{ 222 var hWnd = (arguments[0] != null) ? arguments[0] : {width:0,height:0}; 223 224 var _x = 0; 225 var _y = 0; 226 var offsetX = 0; 227 var offsetY = 0; 228 229 if(!window.pageYOffset) 230 { 231 if(!(document.documentElement.scrollTop == 0)) 232 { 233 offsetY = document.documentElement.scrollTop; 234 offsetX = document.documentElement.scrollLeft; 235 } 236 else 237 { 238 offsetY = document.body.scrollTop; 239 offsetX = document.body.scrollLeft; 240 } 241 } 242 else 243 { 244 offsetX = window.pageXOffset; 245 offsetY = window.pageYOffset; 246 } 247 248 _x = ((this.size().width-hWnd.width)/2)+offsetX; 249 _y = ((this.size().height-hWnd.height)/2)+offsetY; 250 _x = ((this.size().width-hWnd.width)/2); 251 _y = ((this.size().height-hWnd.height)/2); 252 253 return{x:_x,y:_y}; 254}
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.