author | Dan |
Thu, 16 Apr 2009 00:55:13 -0400 | |
changeset 927 | e964577b5fa9 |
parent 906 | c949e82b8f49 |
child 1091 | bb8e04f74819 |
permissions | -rw-r--r-- |
582
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
1 |
// Message box and visual effect system |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
2 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
3 |
/** |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
4 |
* The ultimate message box framework for Javascript |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
5 |
* Syntax is (almost) identical to the MessageBox command in NSIS |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
6 |
* @param int type - a bitfield consisting of the MB_* constants |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
7 |
* @param string title - the blue text at the top of the window |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
8 |
* @param string text - HTML for the body of the message box |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
9 |
* Properties: |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
10 |
* onclick - an array of functions to be called on button click events |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
11 |
* NOTE: key names are to be strings, and they must be the value of the input, CaSe-SeNsItIvE |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
12 |
* onbeforeclick - same as onclick but called before the messagebox div is destroyed |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
13 |
* Methods: |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
14 |
* destroy: kills the running message box |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
15 |
* Example: |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
16 |
* var my_message = new MessageBox(MB_OK|MB_ICONSTOP, 'Error logging in', 'The username and/or password is incorrect. Please check the username and retype your password'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
17 |
* my_message.onclick['OK'] = function() { |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
18 |
* document.getElementById('password').value = ''; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
19 |
* }; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
20 |
* Deps: |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
21 |
* Modern browser that supports DOM |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
22 |
* darken() and enlighten() (above) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
23 |
* opacity() - required for darken() and enlighten() |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
24 |
* MB_* constants are defined in enano-lib-basic.js |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
25 |
*/ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
26 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
27 |
var mb_current_obj; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
28 |
var mb_previously_had_darkener = false; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
29 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
30 |
function MessageBox(type, title, message) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
31 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
32 |
if ( !aclDisableTransitionFX ) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
33 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
34 |
load_component('flyin'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
35 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
36 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
37 |
var y = getScrollOffset(); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
38 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
39 |
// Prevent multiple instances |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
40 |
if ( document.getElementById('messageBox') ) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
41 |
return; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
42 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
43 |
if ( document.getElementById('specialLayer_darkener') ) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
44 |
if ( document.getElementById('specialLayer_darkener').style.display == 'block' ) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
45 |
mb_previously_had_darkener = true; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
46 |
if ( !mb_previously_had_darkener ) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
47 |
darken(true); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
48 |
if ( aclDisableTransitionFX ) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
49 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
50 |
document.getElementById('specialLayer_darkener').style.zIndex = '5'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
51 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
52 |
var master_div = document.createElement('div'); |
694
43367c66d869
Couple of fixes (hacks) for Opera and the aftermath of that z-index change to darken() and enlighten() fadefilters; added ajaxOpenDirectACLRule() to placeholder list
Dan
parents:
677
diff
changeset
|
53 |
master_div.style.zIndex = getHighestZ() + 1; |
582
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
54 |
var mydiv = document.createElement('div'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
55 |
mydiv.style.height = '200px'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
56 |
w = getWidth(); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
57 |
h = getHeight(); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
58 |
if ( aclDisableTransitionFX ) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
59 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
60 |
master_div.style.left = ((w / 2) - 200)+'px'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
61 |
master_div.style.top = ((h / 2) + y - 120)+'px'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
62 |
master_div.style.position = 'absolute'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
63 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
64 |
else |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
65 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
66 |
master_div.style.top = '-10000px'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
67 |
master_div.style.position = ( IE ) ? 'absolute' : 'fixed'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
68 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
69 |
z = ( aclDisableTransitionFX ) ? document.getElementById('specialLayer_darkener').style.zIndex : getHighestZ(); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
70 |
mydiv.style.backgroundColor = '#FFFFFF'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
71 |
mydiv.style.padding = '10px'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
72 |
mydiv.style.marginBottom = '1px'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
73 |
mydiv.id = 'messageBox'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
74 |
mydiv.style.overflow = 'auto'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
75 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
76 |
var buttondiv = document.createElement('div'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
77 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
78 |
mydiv.style.width = '400px'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
79 |
buttondiv.style.width = '400px'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
80 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
81 |
w = getWidth(); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
82 |
h = getHeight(); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
83 |
if ( aclDisableTransitionFX ) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
84 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
85 |
//buttondiv.style.left = ((w / 2) - 200)+'px'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
86 |
//buttondiv.style.top = ((h / 2) + y + 101)+'px'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
87 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
88 |
//buttondiv.style.position = ( IE ) ? 'absolute' : 'fixed'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
89 |
z = ( aclDisableTransitionFX ) ? document.getElementById('specialLayer_darkener').style.zIndex : getHighestZ(); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
90 |
buttondiv.style.backgroundColor = '#C0C0C0'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
91 |
buttondiv.style.padding = '10px'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
92 |
buttondiv.style.textAlign = 'right'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
93 |
buttondiv.style.verticalAlign = 'middle'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
94 |
buttondiv.id = 'messageBoxButtons'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
95 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
96 |
this.clickHandler = function() { messagebox_click(this, mb_current_obj); }; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
97 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
98 |
if( ( type & MB_ICONINFORMATION || type & MB_ICONSTOP || type & MB_ICONQUESTION || type & MB_ICONEXCLAMATION ) && !(type & MB_ICONLOCK) ) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
99 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
100 |
mydiv.style.paddingLeft = '50px'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
101 |
mydiv.style.width = '360px'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
102 |
mydiv.style.backgroundRepeat = 'no-repeat'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
103 |
mydiv.style.backgroundPosition = '8px 8px'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
104 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
105 |
else if ( type & MB_ICONLOCK ) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
106 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
107 |
mydiv.style.paddingLeft = '50px'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
108 |
mydiv.style.width = '360px'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
109 |
mydiv.style.backgroundRepeat = 'no-repeat'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
110 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
111 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
112 |
if(type & MB_ICONINFORMATION) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
113 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
114 |
mydiv.style.backgroundImage = 'url(\''+scriptPath+'/images/info.png\')'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
115 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
116 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
117 |
if(type & MB_ICONQUESTION) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
118 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
119 |
mydiv.style.backgroundImage = 'url(\''+scriptPath+'/images/question.png\')'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
120 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
121 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
122 |
if(type & MB_ICONSTOP) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
123 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
124 |
mydiv.style.backgroundImage = 'url(\''+scriptPath+'/images/error.png\')'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
125 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
126 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
127 |
if(type & MB_ICONEXCLAMATION) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
128 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
129 |
mydiv.style.backgroundImage = 'url(\''+scriptPath+'/images/warning.png\')'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
130 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
131 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
132 |
if(type & MB_ICONLOCK) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
133 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
134 |
mydiv.style.backgroundImage = 'url(\''+scriptPath+'/images/lock.png\')'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
135 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
136 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
137 |
if(type & MB_OK) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
138 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
139 |
btn = document.createElement('input'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
140 |
btn.type = 'button'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
141 |
btn.value = $lang.get('etc_ok'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
142 |
btn._GenericName = 'OK'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
143 |
btn.onclick = this.clickHandler; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
144 |
btn.style.margin = '0 3px'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
145 |
buttondiv.appendChild(btn); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
146 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
147 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
148 |
if(type & MB_OKCANCEL) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
149 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
150 |
btn = document.createElement('input'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
151 |
btn.type = 'button'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
152 |
btn.value = $lang.get('etc_ok'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
153 |
btn._GenericName = 'OK'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
154 |
btn.onclick = this.clickHandler; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
155 |
btn.style.margin = '0 3px'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
156 |
buttondiv.appendChild(btn); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
157 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
158 |
btn = document.createElement('input'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
159 |
btn.type = 'button'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
160 |
btn.value = $lang.get('etc_cancel'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
161 |
btn._GenericName = 'Cancel'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
162 |
btn.onclick = this.clickHandler; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
163 |
btn.style.margin = '0 3px'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
164 |
buttondiv.appendChild(btn); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
165 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
166 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
167 |
if(type & MB_YESNO) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
168 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
169 |
btn = document.createElement('input'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
170 |
btn.type = 'button'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
171 |
btn.value = $lang.get('etc_yes'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
172 |
btn._GenericName = 'Yes'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
173 |
btn.onclick = this.clickHandler; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
174 |
btn.style.margin = '0 3px'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
175 |
buttondiv.appendChild(btn); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
176 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
177 |
btn = document.createElement('input'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
178 |
btn.type = 'button'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
179 |
btn.value = $lang.get('etc_no'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
180 |
btn._GenericName = 'No'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
181 |
btn.onclick = this.clickHandler; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
182 |
btn.style.margin = '0 3px'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
183 |
buttondiv.appendChild(btn); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
184 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
185 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
186 |
if(type & MB_YESNOCANCEL) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
187 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
188 |
btn = document.createElement('input'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
189 |
btn.type = 'button'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
190 |
btn.value = $lang.get('etc_yes'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
191 |
btn._GenericName = 'Yes'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
192 |
btn.onclick = this.clickHandler; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
193 |
btn.style.margin = '0 3px'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
194 |
buttondiv.appendChild(btn); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
195 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
196 |
btn = document.createElement('input'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
197 |
btn.type = 'button'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
198 |
btn.value = $lang.get('etc_no'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
199 |
btn._GenericName = 'No'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
200 |
btn.onclick = this.clickHandler; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
201 |
btn.style.margin = '0 3px'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
202 |
buttondiv.appendChild(btn); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
203 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
204 |
btn = document.createElement('input'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
205 |
btn.type = 'button'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
206 |
btn.value = $lang.get('etc_cancel'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
207 |
btn._GenericName = 'Cancel'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
208 |
btn.onclick = this.clickHandler; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
209 |
btn.style.margin = '0 3px'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
210 |
buttondiv.appendChild(btn); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
211 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
212 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
213 |
heading = document.createElement('h2'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
214 |
heading.innerHTML = title; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
215 |
heading.style.color = '#50A0D0'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
216 |
heading.style.fontFamily = 'trebuchet ms, verdana, arial, helvetica, sans-serif'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
217 |
heading.style.fontSize = '12pt'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
218 |
heading.style.fontWeight = 'lighter'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
219 |
heading.style.textTransform = 'lowercase'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
220 |
heading.style.marginTop = '0'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
221 |
mydiv.appendChild(heading); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
222 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
223 |
var text = document.createElement('div'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
224 |
text.innerHTML = String(message); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
225 |
this.text_area = text; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
226 |
mydiv.appendChild(text); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
227 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
228 |
this.updateContent = function(text) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
229 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
230 |
this.text_area.innerHTML = text; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
231 |
}; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
232 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
233 |
this.destroy = function() |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
234 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
235 |
var mbdiv = document.getElementById('messageBox'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
236 |
mbdiv.parentNode.removeChild(mbdiv.nextSibling); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
237 |
mbdiv.parentNode.removeChild(mbdiv); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
238 |
if ( !mb_previously_had_darkener ) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
239 |
enlighten(true); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
240 |
}; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
241 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
242 |
//domObjChangeOpac(0, mydiv); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
243 |
//domObjChangeOpac(0, master_div); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
244 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
245 |
body = document.getElementsByTagName('body'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
246 |
body = body[0]; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
247 |
master_div.appendChild(mydiv); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
248 |
master_div.appendChild(buttondiv); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
249 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
250 |
body.appendChild(master_div); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
251 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
252 |
if ( !aclDisableTransitionFX ) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
253 |
setTimeout('mb_runFlyIn();', 100); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
254 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
255 |
this.onclick = new Array(); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
256 |
this.onbeforeclick = new Array(); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
257 |
mb_current_obj = this; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
258 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
259 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
260 |
var messagebox = MessageBox; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
261 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
262 |
function mb_runFlyIn() |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
263 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
264 |
var mydiv = document.getElementById('messageBox'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
265 |
var maindiv = mydiv.parentNode; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
266 |
fly_in_top(maindiv, true, false); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
267 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
268 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
269 |
function messagebox_click(obj, mb) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
270 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
271 |
val = ( typeof ( obj._GenericName ) == 'string' ) ? obj._GenericName : obj.value; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
272 |
if(typeof mb.onbeforeclick[val] == 'function') |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
273 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
274 |
var o = mb.onbeforeclick[val]; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
275 |
var resp = o(); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
276 |
if ( resp ) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
277 |
return false; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
278 |
o = false; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
279 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
280 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
281 |
var mydiv = document.getElementById('messageBox'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
282 |
var maindiv = mydiv.parentNode; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
283 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
284 |
if ( aclDisableTransitionFX ) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
285 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
286 |
var mbdiv = document.getElementById('messageBox'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
287 |
mbdiv.parentNode.removeChild(mbdiv.nextSibling); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
288 |
mbdiv.parentNode.removeChild(mbdiv); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
289 |
if ( !mb_previously_had_darkener ) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
290 |
enlighten(true); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
291 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
292 |
else |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
293 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
294 |
var to = fly_out_top(maindiv, true, false); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
295 |
setTimeout("var mbdiv = document.getElementById('messageBox'); mbdiv.parentNode.removeChild(mbdiv.nextSibling); mbdiv.parentNode.removeChild(mbdiv); if ( !mb_previously_had_darkener ) enlighten(true);", to); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
296 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
297 |
if(typeof mb.onclick[val] == 'function') |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
298 |
{ |
811
5c807fe77020
Added support for live re-auth and de-auth; fully AJAX, no page reload required, plus plugin-usable API.
Dan
parents:
779
diff
changeset
|
299 |
(mb.onclick[val])(); |
582
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
300 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
301 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
302 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
303 |
function testMessageBox() |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
304 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
305 |
mb = new MessageBox(MB_OKCANCEL|MB_ICONINFORMATION, 'Javascripted dynamic message boxes', 'This is soooooo coool, now if only document.createElement() worked in IE!<br />this is some more text<br /><br /><br /><br /><br />this is some more text<br /><br /><br /><br /><br />this is some more text<br /><br /><br /><br /><br />this is some more text<br /><br /><br /><br /><br />this is some more text<br /><br /><br /><br /><br />this is some more text<br /><br /><br /><br /><br />this is some more text<br /><br /><br /><br /><br />this is some more text'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
306 |
mb.onclick['OK'] = function() |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
307 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
308 |
alert('You clicked OK!'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
309 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
310 |
mb.onbeforeclick['Cancel'] = function() |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
311 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
312 |
alert('You clicked Cancel!'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
313 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
314 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
315 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
316 |
/** |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
317 |
* The miniPrompt function, for creating small prompts and dialogs. The window will be flown in and the window darkened with opac=0.4. |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
318 |
* @param function Will be passed an HTMLElement that is the body of the prompt window; the function can do with this as it pleases |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
319 |
*/ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
320 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
321 |
function miniPrompt(call_on_create) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
322 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
323 |
if ( !aclDisableTransitionFX ) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
324 |
{ |
779
609e35845ec3
load_component() now accepts an array, and most JS components are loaded all in one request now. Totally modular baby. And failsafe too.
Dan
parents:
699
diff
changeset
|
325 |
load_component(['flyin', 'jquery', 'jquery-ui', 'fadefilter']); |
582
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
326 |
} |
854
7707f60d4a71
MessageBox: fixed: load fadefilter when aclDisableTransitionFX on
Dan
parents:
832
diff
changeset
|
327 |
else |
7707f60d4a71
MessageBox: fixed: load fadefilter when aclDisableTransitionFX on
Dan
parents:
832
diff
changeset
|
328 |
{ |
7707f60d4a71
MessageBox: fixed: load fadefilter when aclDisableTransitionFX on
Dan
parents:
832
diff
changeset
|
329 |
load_component(['fadefilter']); |
7707f60d4a71
MessageBox: fixed: load fadefilter when aclDisableTransitionFX on
Dan
parents:
832
diff
changeset
|
330 |
} |
677
2a263b598a2b
Improved miniPrompt and fadefilter to properly overlap parent modal windows. MessageBox() is next. Fixed pref_disable_js_fx not working due to wrong type (number instead of boolean).
Dan
parents:
673
diff
changeset
|
331 |
var darkener = darken(aclDisableTransitionFX, 40, 'miniprompt_darkener'); |
582
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
332 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
333 |
var wrapper = document.createElement('div'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
334 |
wrapper.className = 'miniprompt'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
335 |
var top = document.createElement('div'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
336 |
top.className = 'mp-top'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
337 |
var body = document.createElement('div'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
338 |
body.className = 'mp-body'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
339 |
var bottom = document.createElement('div'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
340 |
bottom.className = 'mp-bottom'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
341 |
if ( typeof(call_on_create) == 'function' ) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
342 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
343 |
call_on_create(body); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
344 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
345 |
wrapper.appendChild(top); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
346 |
wrapper.appendChild(body); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
347 |
wrapper.appendChild(bottom); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
348 |
var left = ( getWidth() / 2 ) - ( 388 / 2 ); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
349 |
wrapper.style.left = left + 'px'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
350 |
var top = getScrollOffset() - 27; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
351 |
wrapper.style.top = top + 'px'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
352 |
domObjChangeOpac(0, wrapper); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
353 |
var realbody = document.getElementsByTagName('body')[0]; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
354 |
realbody.appendChild(wrapper); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
355 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
356 |
if ( aclDisableTransitionFX ) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
357 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
358 |
domObjChangeOpac(100, wrapper); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
359 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
360 |
else |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
361 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
362 |
fly_in_top(wrapper, true, true); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
363 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
364 |
setTimeout(function() |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
365 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
366 |
domObjChangeOpac(100, wrapper); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
367 |
}, 40); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
368 |
} |
628
ab6f55abb17e
Rank editor is now in a working (beautiful) state. More intuitive than a Mac.
Dan
parents:
582
diff
changeset
|
369 |
|
677
2a263b598a2b
Improved miniPrompt and fadefilter to properly overlap parent modal windows. MessageBox() is next. Fixed pref_disable_js_fx not working due to wrong type (number instead of boolean).
Dan
parents:
673
diff
changeset
|
370 |
// set the darkener's onclick to refocus/shake the miniprompt |
2a263b598a2b
Improved miniPrompt and fadefilter to properly overlap parent modal windows. MessageBox() is next. Fixed pref_disable_js_fx not working due to wrong type (number instead of boolean).
Dan
parents:
673
diff
changeset
|
371 |
darkener.miniprompt = wrapper; |
2a263b598a2b
Improved miniPrompt and fadefilter to properly overlap parent modal windows. MessageBox() is next. Fixed pref_disable_js_fx not working due to wrong type (number instead of boolean).
Dan
parents:
673
diff
changeset
|
372 |
darkener.onclick = function() |
2a263b598a2b
Improved miniPrompt and fadefilter to properly overlap parent modal windows. MessageBox() is next. Fixed pref_disable_js_fx not working due to wrong type (number instead of boolean).
Dan
parents:
673
diff
changeset
|
373 |
{ |
2a263b598a2b
Improved miniPrompt and fadefilter to properly overlap parent modal windows. MessageBox() is next. Fixed pref_disable_js_fx not working due to wrong type (number instead of boolean).
Dan
parents:
673
diff
changeset
|
374 |
if ( !aclDisableTransitionFX ) |
2a263b598a2b
Improved miniPrompt and fadefilter to properly overlap parent modal windows. MessageBox() is next. Fixed pref_disable_js_fx not working due to wrong type (number instead of boolean).
Dan
parents:
673
diff
changeset
|
375 |
{ |
699
c7d737202d59
Removed Adobe Spry and replaced with jQuery. Please report any new bugs on the forums or via IRC. In a related note, auto-completion should work now at least for usernames. Still hacking away at page name completion...
Dan
parents:
694
diff
changeset
|
376 |
$(this.miniprompt).effect("pulsate", { times: 2 }, 200); |
677
2a263b598a2b
Improved miniPrompt and fadefilter to properly overlap parent modal windows. MessageBox() is next. Fixed pref_disable_js_fx not working due to wrong type (number instead of boolean).
Dan
parents:
673
diff
changeset
|
377 |
} |
2a263b598a2b
Improved miniPrompt and fadefilter to properly overlap parent modal windows. MessageBox() is next. Fixed pref_disable_js_fx not working due to wrong type (number instead of boolean).
Dan
parents:
673
diff
changeset
|
378 |
} |
2a263b598a2b
Improved miniPrompt and fadefilter to properly overlap parent modal windows. MessageBox() is next. Fixed pref_disable_js_fx not working due to wrong type (number instead of boolean).
Dan
parents:
673
diff
changeset
|
379 |
|
628
ab6f55abb17e
Rank editor is now in a working (beautiful) state. More intuitive than a Mac.
Dan
parents:
582
diff
changeset
|
380 |
return wrapper; |
582
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
381 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
382 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
383 |
/** |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
384 |
* For a given element, loops through the element and all of its ancestors looking for a miniPrompt div, and returns it. Returns false on failure. |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
385 |
* @param object:HTMLElement Child node to scan |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
386 |
* @return object |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
387 |
*/ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
388 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
389 |
function miniPromptGetParent(obj) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
390 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
391 |
while ( true ) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
392 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
393 |
// prevent infinite loops |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
394 |
if ( !obj || obj.tagName == 'BODY' ) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
395 |
return false; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
396 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
397 |
if ( $dynano(obj).hasClass('miniprompt') ) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
398 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
399 |
return obj; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
400 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
401 |
obj = obj.parentNode; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
402 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
403 |
return false; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
404 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
405 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
406 |
/** |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
407 |
* Destroys the first miniPrompt div encountered by recursively checking all parent nodes. |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
408 |
* Usage: <a href="javascript:miniPromptDestroy(this);">click</a> |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
409 |
* @param object:HTMLElement a child of the div.miniprompt |
677
2a263b598a2b
Improved miniPrompt and fadefilter to properly overlap parent modal windows. MessageBox() is next. Fixed pref_disable_js_fx not working due to wrong type (number instead of boolean).
Dan
parents:
673
diff
changeset
|
410 |
* @param bool (DEPRECATED) If true, does not call enlighten(). |
582
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
411 |
*/ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
412 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
413 |
function miniPromptDestroy(obj, nofade) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
414 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
415 |
obj = miniPromptGetParent(obj); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
416 |
if ( !obj ) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
417 |
return false; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
418 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
419 |
// found it |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
420 |
var parent = obj.parentNode; |
677
2a263b598a2b
Improved miniPrompt and fadefilter to properly overlap parent modal windows. MessageBox() is next. Fixed pref_disable_js_fx not working due to wrong type (number instead of boolean).
Dan
parents:
673
diff
changeset
|
421 |
// if ( !nofade ) |
2a263b598a2b
Improved miniPrompt and fadefilter to properly overlap parent modal windows. MessageBox() is next. Fixed pref_disable_js_fx not working due to wrong type (number instead of boolean).
Dan
parents:
673
diff
changeset
|
422 |
// enlighten(aclDisableTransitionFX); |
887
cb96d038baff
New logout interface + made DiffieHellman faster by disabling animated GIF
Dan
parents:
854
diff
changeset
|
423 |
enlighten((aclDisableTransitionFX || nofade), 'miniprompt_darkener'); |
cb96d038baff
New logout interface + made DiffieHellman faster by disabling animated GIF
Dan
parents:
854
diff
changeset
|
424 |
if ( aclDisableTransitionFX || nofade ) |
582
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
425 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
426 |
parent.removeChild(obj); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
427 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
428 |
else |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
429 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
430 |
var timeout = fly_out_top(obj, true, true); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
431 |
setTimeout(function() |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
432 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
433 |
parent.removeChild(obj); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
434 |
}, timeout); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
435 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
436 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
437 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
438 |
/** |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
439 |
* Simple test case |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
440 |
*/ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
441 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
442 |
function miniPromptTest() |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
443 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
444 |
miniPrompt(function(div) { div.innerHTML = 'hello world! <a href="#" onclick="miniPromptDestroy(this); return false;">destroy me</a>'; }); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
445 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
446 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
447 |
/** |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
448 |
* Message box system for miniPrompts. Less customization but easier to scale than the regular messageBox framework. |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
449 |
* @example |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
450 |
<code> |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
451 |
miniPromptMessage({ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
452 |
title: 'Delete page', |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
453 |
message: 'Do you really want to delete this page? This is reversible unless you clear the page logs.', |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
454 |
buttons: [ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
455 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
456 |
text: 'Delete', |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
457 |
color: 'red', |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
458 |
style: { |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
459 |
fontWeight: 'bold' |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
460 |
}, |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
461 |
onclick: function() { |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
462 |
ajaxDeletePage(); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
463 |
miniPromptDestroy(this); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
464 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
465 |
}, |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
466 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
467 |
text: 'cancel', |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
468 |
onclick: function() { |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
469 |
miniPromptDestroy(this); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
470 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
471 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
472 |
] |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
473 |
}); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
474 |
</code> |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
475 |
*/ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
476 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
477 |
function miniPromptMessage(parms) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
478 |
{ |
628
ab6f55abb17e
Rank editor is now in a working (beautiful) state. More intuitive than a Mac.
Dan
parents:
582
diff
changeset
|
479 |
if ( ( !parms.title && !parms.message ) || !parms.buttons ) |
582
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
480 |
return false; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
481 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
482 |
return miniPrompt(function(parent) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
483 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
484 |
try |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
485 |
{ |
628
ab6f55abb17e
Rank editor is now in a working (beautiful) state. More intuitive than a Mac.
Dan
parents:
582
diff
changeset
|
486 |
if ( parms.title ) |
ab6f55abb17e
Rank editor is now in a working (beautiful) state. More intuitive than a Mac.
Dan
parents:
582
diff
changeset
|
487 |
{ |
ab6f55abb17e
Rank editor is now in a working (beautiful) state. More intuitive than a Mac.
Dan
parents:
582
diff
changeset
|
488 |
var h3 = document.createElement('h3'); |
ab6f55abb17e
Rank editor is now in a working (beautiful) state. More intuitive than a Mac.
Dan
parents:
582
diff
changeset
|
489 |
h3.appendChild(document.createTextNode(parms.title)); |
ab6f55abb17e
Rank editor is now in a working (beautiful) state. More intuitive than a Mac.
Dan
parents:
582
diff
changeset
|
490 |
} |
ab6f55abb17e
Rank editor is now in a working (beautiful) state. More intuitive than a Mac.
Dan
parents:
582
diff
changeset
|
491 |
if ( parms.message ) |
582
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
492 |
{ |
628
ab6f55abb17e
Rank editor is now in a working (beautiful) state. More intuitive than a Mac.
Dan
parents:
582
diff
changeset
|
493 |
var body = document.createElement('p'); |
ab6f55abb17e
Rank editor is now in a working (beautiful) state. More intuitive than a Mac.
Dan
parents:
582
diff
changeset
|
494 |
var message = parms.message.split(unescape('%0A')); |
ab6f55abb17e
Rank editor is now in a working (beautiful) state. More intuitive than a Mac.
Dan
parents:
582
diff
changeset
|
495 |
for ( var i = 0; i < message.length; i++ ) |
ab6f55abb17e
Rank editor is now in a working (beautiful) state. More intuitive than a Mac.
Dan
parents:
582
diff
changeset
|
496 |
{ |
ab6f55abb17e
Rank editor is now in a working (beautiful) state. More intuitive than a Mac.
Dan
parents:
582
diff
changeset
|
497 |
body.appendChild(document.createTextNode(message[i])); |
ab6f55abb17e
Rank editor is now in a working (beautiful) state. More intuitive than a Mac.
Dan
parents:
582
diff
changeset
|
498 |
if ( i + 1 < message.length ) |
ab6f55abb17e
Rank editor is now in a working (beautiful) state. More intuitive than a Mac.
Dan
parents:
582
diff
changeset
|
499 |
body.appendChild(document.createElement('br')); |
ab6f55abb17e
Rank editor is now in a working (beautiful) state. More intuitive than a Mac.
Dan
parents:
582
diff
changeset
|
500 |
} |
582
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
501 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
502 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
503 |
parent.style.textAlign = 'center'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
504 |
|
628
ab6f55abb17e
Rank editor is now in a working (beautiful) state. More intuitive than a Mac.
Dan
parents:
582
diff
changeset
|
505 |
if ( parms.title ) |
ab6f55abb17e
Rank editor is now in a working (beautiful) state. More intuitive than a Mac.
Dan
parents:
582
diff
changeset
|
506 |
parent.appendChild(h3); |
ab6f55abb17e
Rank editor is now in a working (beautiful) state. More intuitive than a Mac.
Dan
parents:
582
diff
changeset
|
507 |
if ( parms.message ) |
ab6f55abb17e
Rank editor is now in a working (beautiful) state. More intuitive than a Mac.
Dan
parents:
582
diff
changeset
|
508 |
parent.appendChild(body); |
582
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
509 |
parent.appendChild(document.createElement('br')); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
510 |
|
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
511 |
// construct buttons |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
512 |
for ( var i = 0; i < parms.buttons.length; i++ ) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
513 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
514 |
var button = parms.buttons[i]; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
515 |
button.input = document.createElement('a'); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
516 |
button.input.href = '#'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
517 |
button.input.clickAction = button.onclick; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
518 |
button.input.className = 'abutton'; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
519 |
if ( button.color ) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
520 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
521 |
button.input.className += ' abutton_' + button.color; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
522 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
523 |
button.input.appendChild(document.createTextNode(button.text)); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
524 |
if ( button.style ) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
525 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
526 |
for ( var j in button.style ) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
527 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
528 |
button.input.style[j] = button.style[j]; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
529 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
530 |
} |
832
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
811
diff
changeset
|
531 |
if ( button.sprite ) |
673
99c617146a34
Added abutton_img class + supporting properties in miniPromptMessage to allow icons on abuttons
Dan
parents:
652
diff
changeset
|
532 |
{ |
832
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
811
diff
changeset
|
533 |
var sprite = gen_sprite(button.sprite[0], button.sprite[1], button.sprite[2], button.sprite[3], button.sprite[4]); |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
811
diff
changeset
|
534 |
sprite.style.position = 'relative'; |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
811
diff
changeset
|
535 |
sprite.style.top = '3px'; |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
811
diff
changeset
|
536 |
button.input.insertBefore(sprite, button.input.firstChild); |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
811
diff
changeset
|
537 |
insertAfter(button.input, document.createTextNode(' '), sprite); |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
811
diff
changeset
|
538 |
} |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
811
diff
changeset
|
539 |
else if ( button.image ) |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
811
diff
changeset
|
540 |
{ |
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
811
diff
changeset
|
541 |
button.input.className += ' icon'; |
673
99c617146a34
Added abutton_img class + supporting properties in miniPromptMessage to allow icons on abuttons
Dan
parents:
652
diff
changeset
|
542 |
button.input.style.backgroundImage = 'url(' + button.image + ')'; |
99c617146a34
Added abutton_img class + supporting properties in miniPromptMessage to allow icons on abuttons
Dan
parents:
652
diff
changeset
|
543 |
} |
582
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
544 |
button.input.onclick = function(e) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
545 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
546 |
try |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
547 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
548 |
this.clickAction(e); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
549 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
550 |
catch(e) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
551 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
552 |
console.error(e); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
553 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
554 |
return false; |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
555 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
556 |
parent.appendChild(button.input); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
557 |
} |
694
43367c66d869
Couple of fixes (hacks) for Opera and the aftermath of that z-index change to darken() and enlighten() fadefilters; added ajaxOpenDirectACLRule() to placeholder list
Dan
parents:
677
diff
changeset
|
558 |
// don't focus this in opera - it looks kinda ugly |
43367c66d869
Couple of fixes (hacks) for Opera and the aftermath of that z-index change to darken() and enlighten() fadefilters; added ajaxOpenDirectACLRule() to placeholder list
Dan
parents:
677
diff
changeset
|
559 |
if ( parms.buttons[0] && !window.opera ) |
582
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
560 |
{ |
677
2a263b598a2b
Improved miniPrompt and fadefilter to properly overlap parent modal windows. MessageBox() is next. Fixed pref_disable_js_fx not working due to wrong type (number instead of boolean).
Dan
parents:
673
diff
changeset
|
561 |
var timeout = ( aclDisableTransitionFX ) ? 10 : 1000; |
582
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
562 |
setTimeout(function() |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
563 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
564 |
parms.buttons[0].input.focus(); |
677
2a263b598a2b
Improved miniPrompt and fadefilter to properly overlap parent modal windows. MessageBox() is next. Fixed pref_disable_js_fx not working due to wrong type (number instead of boolean).
Dan
parents:
673
diff
changeset
|
565 |
}, timeout); |
582
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
566 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
567 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
568 |
catch ( e ) |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
569 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
570 |
console.error(e); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
571 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
572 |
}); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
573 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
574 |
|
906
c949e82b8f49
New page protection UI. Both miniPrompt and failsafe HTML.
Dan
parents:
887
diff
changeset
|
575 |
/** |
c949e82b8f49
New page protection UI. Both miniPrompt and failsafe HTML.
Dan
parents:
887
diff
changeset
|
576 |
* Identical to whiteOutElement(), but safe to call on miniPrompt divs. |
c949e82b8f49
New page protection UI. Both miniPrompt and failsafe HTML.
Dan
parents:
887
diff
changeset
|
577 |
*/ |
c949e82b8f49
New page protection UI. Both miniPrompt and failsafe HTML.
Dan
parents:
887
diff
changeset
|
578 |
|
c949e82b8f49
New page protection UI. Both miniPrompt and failsafe HTML.
Dan
parents:
887
diff
changeset
|
579 |
function whiteOutMiniPrompt(el) |
c949e82b8f49
New page protection UI. Both miniPrompt and failsafe HTML.
Dan
parents:
887
diff
changeset
|
580 |
{ |
c949e82b8f49
New page protection UI. Both miniPrompt and failsafe HTML.
Dan
parents:
887
diff
changeset
|
581 |
var top = getScrollOffset(); |
c949e82b8f49
New page protection UI. Both miniPrompt and failsafe HTML.
Dan
parents:
887
diff
changeset
|
582 |
var left = ( getWidth() / 2 ) - ( 320 / 2); |
c949e82b8f49
New page protection UI. Both miniPrompt and failsafe HTML.
Dan
parents:
887
diff
changeset
|
583 |
var width = 320; |
c949e82b8f49
New page protection UI. Both miniPrompt and failsafe HTML.
Dan
parents:
887
diff
changeset
|
584 |
var height = $dynano(el).Height() - 58; |
c949e82b8f49
New page protection UI. Both miniPrompt and failsafe HTML.
Dan
parents:
887
diff
changeset
|
585 |
|
c949e82b8f49
New page protection UI. Both miniPrompt and failsafe HTML.
Dan
parents:
887
diff
changeset
|
586 |
var blackout = document.createElement('div'); |
c949e82b8f49
New page protection UI. Both miniPrompt and failsafe HTML.
Dan
parents:
887
diff
changeset
|
587 |
// using fixed here allows modal windows to be blacked out |
c949e82b8f49
New page protection UI. Both miniPrompt and failsafe HTML.
Dan
parents:
887
diff
changeset
|
588 |
blackout.style.position = ( el.style.position == 'fixed' ) ? 'fixed' : 'absolute'; |
c949e82b8f49
New page protection UI. Both miniPrompt and failsafe HTML.
Dan
parents:
887
diff
changeset
|
589 |
blackout.style.top = top + 'px'; |
c949e82b8f49
New page protection UI. Both miniPrompt and failsafe HTML.
Dan
parents:
887
diff
changeset
|
590 |
blackout.style.left = left + 'px'; |
c949e82b8f49
New page protection UI. Both miniPrompt and failsafe HTML.
Dan
parents:
887
diff
changeset
|
591 |
blackout.style.width = width + 'px'; |
c949e82b8f49
New page protection UI. Both miniPrompt and failsafe HTML.
Dan
parents:
887
diff
changeset
|
592 |
blackout.style.height = height + 'px'; |
c949e82b8f49
New page protection UI. Both miniPrompt and failsafe HTML.
Dan
parents:
887
diff
changeset
|
593 |
|
c949e82b8f49
New page protection UI. Both miniPrompt and failsafe HTML.
Dan
parents:
887
diff
changeset
|
594 |
blackout.style.backgroundColor = '#FFFFFF'; |
c949e82b8f49
New page protection UI. Both miniPrompt and failsafe HTML.
Dan
parents:
887
diff
changeset
|
595 |
domObjChangeOpac(60, blackout); |
c949e82b8f49
New page protection UI. Both miniPrompt and failsafe HTML.
Dan
parents:
887
diff
changeset
|
596 |
var background = ( $dynano(el).Height() < 48 ) ? 'url(' + scriptPath + '/images/loading.gif)' : 'url(' + scriptPath + '/includes/clientside/tinymce/themes/advanced/skins/default/img/progress.gif)'; |
c949e82b8f49
New page protection UI. Both miniPrompt and failsafe HTML.
Dan
parents:
887
diff
changeset
|
597 |
blackout.style.backgroundImage = background; |
c949e82b8f49
New page protection UI. Both miniPrompt and failsafe HTML.
Dan
parents:
887
diff
changeset
|
598 |
blackout.style.backgroundPosition = 'center center'; |
c949e82b8f49
New page protection UI. Both miniPrompt and failsafe HTML.
Dan
parents:
887
diff
changeset
|
599 |
blackout.style.backgroundRepeat = 'no-repeat'; |
c949e82b8f49
New page protection UI. Both miniPrompt and failsafe HTML.
Dan
parents:
887
diff
changeset
|
600 |
blackout.style.zIndex = '1000'; |
c949e82b8f49
New page protection UI. Both miniPrompt and failsafe HTML.
Dan
parents:
887
diff
changeset
|
601 |
|
c949e82b8f49
New page protection UI. Both miniPrompt and failsafe HTML.
Dan
parents:
887
diff
changeset
|
602 |
var body = document.getElementsByTagName('body')[0]; |
c949e82b8f49
New page protection UI. Both miniPrompt and failsafe HTML.
Dan
parents:
887
diff
changeset
|
603 |
body.appendChild(blackout); |
c949e82b8f49
New page protection UI. Both miniPrompt and failsafe HTML.
Dan
parents:
887
diff
changeset
|
604 |
|
c949e82b8f49
New page protection UI. Both miniPrompt and failsafe HTML.
Dan
parents:
887
diff
changeset
|
605 |
return blackout; |
c949e82b8f49
New page protection UI. Both miniPrompt and failsafe HTML.
Dan
parents:
887
diff
changeset
|
606 |
} |
c949e82b8f49
New page protection UI. Both miniPrompt and failsafe HTML.
Dan
parents:
887
diff
changeset
|
607 |
|
582
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
608 |
function testMPMessageBox() |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
609 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
610 |
miniPromptMessage({ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
611 |
title: 'The Game of LIFE question #73', |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
612 |
message: 'You just got your girlfriend pregnant. Please select an option:', |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
613 |
buttons: [ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
614 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
615 |
text: 'Abort', |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
616 |
color: 'red', |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
617 |
style: { |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
618 |
fontWeight: 'bold' |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
619 |
}, |
832
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
811
diff
changeset
|
620 |
sprite: [ cdnPath + '/images/icons/abortretryignore-sprite.png', 16, 16, 0, 0 ], |
582
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
621 |
onclick: function() { |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
622 |
miniPromptDestroy(this); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
623 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
624 |
}, |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
625 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
626 |
text: 'Retry', |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
627 |
color: 'blue', |
832
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
811
diff
changeset
|
628 |
sprite: [ cdnPath + '/images/icons/abortretryignore-sprite.png', 16, 16, 0, 16 ], |
582
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
629 |
onclick: function() { |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
630 |
miniPromptDestroy(this); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
631 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
632 |
}, |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
633 |
{ |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
634 |
text: 'Ignore', |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
635 |
color: 'green', |
832
7152ca0a0ce9
Major redesign of rendering pipeline that separates pages saved with MCE from pages saved with the plaintext editor (full description in long commit message)
Dan
parents:
811
diff
changeset
|
636 |
sprite: [ cdnPath + '/images/icons/abortretryignore-sprite.png', 16, 16, 0, 32 ], |
582
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
637 |
onclick: function() { |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
638 |
miniPromptDestroy(this); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
639 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
640 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
641 |
] |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
642 |
}); |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
643 |
} |
a38876c0793c
Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff
changeset
|
644 |