소스 검색

Removed the autosave function, was acting rare

pecesama 16 년 전
부모
커밋
aae90554cf
3개의 변경된 파일1개의 추가작업 그리고 2094개의 파일을 삭제
  1. 1 12
      admin/index.php
  2. 0 97
      admin/scripts/form.autosave.js
  3. 0 1985
      admin/scripts/prototype.js

+ 1 - 12
admin/index.php 파일 보기

@@ -99,8 +99,6 @@ if ($user->isAdmin()) {
99 99
 		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/tools.js"></script>
100 100
 		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/mootools.js"></script>
101 101
 		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/slimbox.js"></script>
102
-		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/prototype.js"></script>
103
-		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/form.autosave.js"></script>
104 102
 		<script language="javascript" type="text/javascript">
105 103
 		<!--
106 104
 			function exit(el, path) {
@@ -200,7 +198,6 @@ if ($user->isAdmin()) {
200 198
 ?>					
201 199
 					<form action="index.php" method="post" <?php echo (isset($_GET["new"]) && $_GET["new"]=="photo") ? "enctype=\"multipart/form-data\"" : ""?> name="frmAdd" id="autosave" class="newpost">
202 200
 						<fieldset>
203
-						<div id="update" style="display:none;" class="exito"></div><br />
204 201
 <?php
205 202
 							if ($isEdition) {
206 203
 ?>
@@ -305,15 +302,7 @@ if ($user->isAdmin()) {
305 302
 									<input class="btn" type="submit" name="btnAdd" value="<?php echo ($isEdition) ? "Modify" : "Create"; ?> post" />
306 303
 								</p>
307 304
 						</fieldset>
308
-					</form>
309
-					<div id="serialize"></div>
310
-					<script type="text/javascript" language="javascript" charset="utf-8">
311
-					// <![CDATA[
312
-						//id: formulario, id: info, options
313
-						new Form.autoSave('autosave','update',{});
314
-					// ]]>
315
-					</script>
316
-					
305
+					</form>					
317 306
 					<div class="footer-box">&nbsp;</div>
318 307
 				</div>
319 308
 <?php

+ 0 - 97
admin/scripts/form.autosave.js 파일 보기

@@ -1,97 +0,0 @@
1
-/*  Autocompleter.editor, version 1.0: http://icebeat.bitacoras.com
2
- *  (c) 2005 Daniel Mota aka IceBeat <daniel.mota@gmail.com>
3
- *
4
-/*--------------------------------------------------------------------------*/
5
-Form.autoSave = Class.create();
6
-Form.autoSave.prototype = {
7
-	/*	
8
-	*	Inicializamos la clase y preparamos parametros
9
-	*/
10
-  initialize: function(element, update, options) {
11
-    this.element = $(element);
12
-    this.update = $(update);
13
-    this.options = $H({
14
-			url: 'form.autosave.php',
15
-			frequency: 30,
16
-			method: 'get',
17
-			msg: {
18
-			  loading:  'Filling form',
19
-			  loaded:   'Form filled',
20
-			  sending:  'Sending form',
21
-			  update:   'Form saved at: '
22
-			}
23
-		}).merge(options);
24
-		this.msg = this.options.msg;
25
-		this.message(this.msg.loading);
26
-    new Ajax.Request(this.options.url, { method: this.options.method, parameters:"autosave=true&autosaveid="+this.element.id, onSuccess: this.autoFill.bind(this) });
27
-  },
28
-  message: function(msg) {
29
-    Element.show(this.update);
30
-    this.update.innerHTML = msg;
31
-  },
32
-  send: function(element,value) {
33
-    this.message(this.msg.sending);
34
-    new Ajax.Request(this.options.url, { method: this.options.method, parameters:"autosaveid="+element.id+'&'+value, onSuccess: this.updateForm.bind(this) });
35
-  },
36
-  updateForm: function(resp) {
37
-    if(resp.responseText) {
38
-      this.message(this.msg.update+resp.responseText);
39
-    }
40
-  },
41
-  autoFill: function(resp) {
42
-    if(resp.responseText) {
43
-      this.message(this.msg.loaded);
44
-      Form.Unserialize(this.element,resp.responseText);
45
-    } else {
46
-      Element.hide(this.update);
47
-    }
48
-    new Form.Observer(this.element,this.options.frequency,this.send.bind(this));
49
-  }
50
-};
51
-
52
-Form.Unserialize = function(form,queryComponents) {
53
-  var elements = Form.getElements($(form));
54
-  var queryComponents = queryComponents.toQueryParams();
55
-  for (var i = 0; i < elements.length; i++) {
56
-    var element = elements[i];
57
-    var name = element.name;
58
-    if(queryComponents[name]) {
59
-      var method = element.tagName.toLowerCase();
60
-      var value = decodeURIComponent(queryComponents[name]);
61
-      Form.Element.Unserializers[method](element,value);
62
-    }
63
-  }
64
-};
65
-
66
-Form.Element.Unserializers = {
67
-  input: function(element,value) {
68
-    switch (element.type.toLowerCase()) {
69
-      case 'submit':
70
-      case 'hidden':
71
-      case 'password':
72
-      case 'text':
73
-        return Form.Element.Unserializers.textarea(element,value);
74
-      case 'checkbox':
75
-      case 'radio':
76
-        return Form.Element.Unserializers.inputSelector(element,value);
77
-    }
78
-    return false;
79
-  },
80
-
81
-  inputSelector: function(element,value) {
82
-    if (element.value == value)
83
-        element.checked = 'checked';
84
-  },
85
-
86
-  textarea: function(element,value) {
87
-    element.value = value;
88
-  },
89
-
90
-  select: function(element,value) {
91
-    for (var i = 0; i < element.length; i++) {
92
-      var opt = element.options[i];
93
-      if(opt.value == value || opt.text == value) 
94
-        opt.selected = 'selected';
95
-    }
96
-  }
97
-}

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 1985
admin/scripts/prototype.js