-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
executable file
·177 lines (173 loc) · 6 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<?php require 'header.php';?>
<div id="status">
</div>
<div class="drop">
<script type="text/javascript" charset="utf-8">
window.addEvent('domready', function(){
$('dropform').addEvent('submit', function(e) {
new Event(e).stop();
var status = $('status').empty();
var form_title = $('form_title');
var form_highlighting = $('form_highlighting');
var form_editable = $('form_editable');
var form_private = $('form_private');
var form_submit = $('form_submit');
var form_text = $('form_text');
function errorFlash(obj)
{
var fx = obj.effects({duration: 200, transition: Fx.Transitions.Quad.easeInOut});
fx.start({
'background-color': '#e6e6db'
}).chain(function() {
this.start.delay(200, this, {
'background-color': '#ffaeae'
});
}).chain(function(){
this.start.delay(200, this, {
'background-color': '#e6e6db'
});
}).chain(function() {
this.start.delay(200, this, {
'background-color': '#ffaeae'
});
}).chain(function() {
this.start.delay(200, this, {
'background-color': '#e6e6db'
});
}).chain(function() {
this.start.delay(200, this, {
'background-color': '#ffaeae'
});
});
}
function errorFlashGlobal()
{
var fx = $('error').effects({duration: 200, transition: Fx.Transitions.Quad.easeInOut});
fx.start({
'background-color': '#ffffff',
'border-bottom-color': '#ffffff'
}).chain(function() {
this.start.delay(200, this, {
'background-color': '#ffaeae',
'border-bottom-color': '#e94545'
});
}).chain(function(){
this.start.delay(200, this, {
'background-color': '#ffffff',
'border-bottom-color': '#ffffff'
});
}).chain(function() {
this.start.delay(200, this, {
'background-color': '#ffaeae',
'border-bottom-color': '#e94545'
});
}).chain(function() {
this.start.delay(200, this, {
'background-color': '#ffffff',
'border-bottom-color': '#ffffff'
});
}).chain(function() {
this.start.delay(200, this, {
'background-color': '#ffaeae',
'border-bottom-color': '#e94545'
});
});
}
function successFlash()
{
var fx = $('success').effects({duration: 150, transition: Fx.Transitions.Quad.easeInOut});
fx.start({
'background-color': '#ffffff',
'border-bottom-color': '#ffffff'
}).chain(function() {
this.start({
'background-color': '#a7d8a0',
'border-bottom-color': '#448a3a'
});
});
$('form_textarea').value = '';
$('form_titleinput').value = '';
$('form_editcheck').checked = false;
$('form_privatecheck').checked = false;
$each($('form_lang').options, function(option){
if (option.selected) option.selected = false;
if (option.id == "default_lang") option.selected = true;
});
}
function removeError(obj){
new Fx.Style(obj, 'background-color').set('#e6e6db');
}
this.send({
update: status,
onComplete: function() {
if(document.getElementById('error_what')) {
errorFlashGlobal();
if ($('error_what').getText().contains('title')) errorFlash(form_title);
else removeError(form_title);
if ($('error_what').getText().contains('text')) errorFlash(form_text);
else removeError(form_text);
if ($('error_what').getText().contains('highlight')) errorFlash(form_highlighting);
else removeError(form_highlighting);
if ($('error_what').getText().contains('edit')) errorFlash(form_editable);
else removeError(form_editable);
if ($('error_what').getText().contains('private')) errorFlash(form_private);
else removeError(form_private);
if ($('error_what').getText().contains('submit')) errorFlash(form_submit);
else removeError(form_submit);
} else {
removeError(form_title);
removeError(form_text);
removeError(form_highlighting);
removeError(form_editable);
removeError(form_private);
removeError(form_submit);
successFlash();
}
}
});
});
/*$('type_file').addEvent('click', function() {
$('form_change').setHTML("<p id=\"form_file\"><input type=\"file\" name=\"dropfile\" size=\"40\" id=\"form_filefield\"/></ p>")
});*/
});
</script>
<form action="drop.php" method="post" accept-charset="utf-8" id="dropform">
<p id="form_highlighting">
<select name="language" id="form_lang">
<?php
foreach ($DROP_CONF['aval_lang'] AS $l) {
echo '<option';
echo ($l == @$_POST['language']) ? ' selected="selected"' : '';
echo ($l == @$DROP_CONF['default']) ? ' id="default_lang">' : '>';
echo $l ,'</option>';
}
?>
</select>
Highlighting
</p>
<p id="form_type_text" style="display: none;"><input type="radio" name="type" value="text" checked="checked" id="type_text"/> Text</p>
<?php $for_later = '<p id="form_type_file"><input type="radio" name="type" value="file" id="type_file"/> File</p>'; ?>
<br />
<div id="form_change">
<p id="form_text" style="padding: 0;">
<textarea id="form_textarea" name="text" cols="87" rows="20"></textarea>
</p>
</div>
<br />
<p id="form_title">
Title <input id="form_titleinput" type="text" name="title" />
</p>
<?php $for_later = '<!--<p>Post as:</p>
<p id="form_as_user"><input type="radio" name="post_as" value="userid" /> Joe User</p>
<p id="form_as_anon"><input type="radio" name="post_as" value="anon" checked="checked"/> Anonymous</p>-->'; ?>
<br />
<p id="form_submit"><input type="submit" value="Drop That!" /></p>
<p id="form_editable">
<input type="checkbox" id="form_editcheck" name="editable" value="yes" /> Editable
</p>
<p id="form_private">
<input type="checkbox" id="form_privatecheck" name="private" value="yes" /> Private
</p>
</form>
</div>
<?php require 'footer.php';?>