PageSourceSearch

https://www.agir.ro/js/modalfiles/modal.js

js agir.ro collected 2026-09-24 09:50:11 UTC 3,289 bytes, 72 lines download raw bytes

1// -------------------------------------------------------------------
2// DHTML Modal window- By Dynamic Drive, available at: http://www.dynamicdrive.com
3// v1.0: Script created Feb 27th, 07'
4// v1.01 May 5th, 07' Minor change to modal window positioning behavior (not a bug fix)
5// v1.1: April 16th, 08' Brings it in sync with DHTML Window widget. See changelog.txt for the later for changes.
6// REQUIRES: DHTML Window Widget (v1.01 or higher): http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/
7// -------------------------------------------------------------------
8
9if (typeof dhtmlwindow=="undefined")
10alert('ERROR: Modal Window script requires all files from "DHTML Window widget" in order to work!')
11
12var dhtmlmodal={
13veilstack: 0,
14open:function(t, contenttype, contentsource, title, attr, recalonload){
15	var d=dhtmlwindow //reference dhtmlwindow object
16	this.interVeil=document.getElementById("interVeil") //Reference "veil" div
17	this.veilstack++ //var to keep track of how many modal windows are open right now
18	this.loadveil()
19	if (recalonload=="recal" && d.scroll_top==0)
20		d.addEvent(window, function(){dhtmlmodal.adjustveil()}, "load")
21	var t=d.open(t, contenttype, contentsource, title, attr, recalonload)
22	t.controls.firstChild.style.display="none" //Disable "minimize" button
23	t.controls.onclick=function(){dhtmlmodal.close(this._parent, true)} //OVERWRITE default control action with new one
24	t.show=function(){dhtmlmodal.show(this)} //OVERWRITE default t.show() method with new one
25	t.hide=function(){dhtmlmodal.close(this)} //OVERWRITE default t.hide() method with new one
26return t
27},
28
29
30loadveil:function(){
31	var d=dhtmlwindow
32	d.getviewpoint()
33	this.docheightcomplete=(d.standardbody.offsetHeight>d.standardbody.scrollHeight)? d.standardbody.offsetHeight : d.standardbody.scrollHeight
34	this.interVeil.style.width=d.docwidth+"px" //set up veil over page
35	this.interVeil.style.height=this.docheightcomplete+"px" //set up veil over page
36	this.interVeil.style.left=0 //Position veil over page
37	this.interVeil.style.top=0 //Position veil over page
38	this.interVeil.style.visibility="visible" //Show veil over page
39	this.interVeil.style.display="block" //Show veil over page
40},
41
42adjustveil:function(){ //function to adjust veil when window is resized
43	if (this.interVeil && this.interVeil.style.display=="block") //If veil is currently visible on the screen
44		this.loadveil() //readjust veil
45},
46
47closeveil:function(){ //function to close veil
48	this.veilstack--
49	if (this.veilstack==0) //if this is the only modal window visible on the screen, and being closed
50		this.interVeil.style.display="none"
51},
52
53
54close:function(t, forceclose){ //DHTML modal close function
55	t.contentDoc=(t.contentarea.datatype=="iframe")? window.frames["_iframe-"+t.id].document : t.contentarea //return reference to modal window DIV (or document object in the case of iframe
56	if (typeof forceclose!="undefined")
57		t.onclose=function(){return true}
58	if (dhtmlwindow.close(t)) //if close() returns true
59		this.closeveil()
60},
61
62
63show:function(t){
64	dhtmlmodal.veilstack++
65	dhtmlmodal.loadveil()
66	dhtmlwindow.show(t)
67}
68} //END object declaration
69
70
71document.write('<div id="interVeil"></div>')
72dhtmlwindow.addEvent(window, function(){if (typeof dhtmlmodal!="undefined") dhtmlmodal.adjustveil()}, "resize")

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.