Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #10777: proto2_rt-editing.htm

File proto2_rt-editing.htm, 1.4 kB (added by unhealing_s, 6 months ago)

html file (frontend)

Line 
1 <?xml version="1.0" encoding ="utf-8"?>
2
3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 //EN"
4 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
5
6
7 <html xmlns="http://www.w3.org/1999/xhtml">
8
9 <head>
10
11 <script type="text/javascript" src="../framework/js/libs/prototype.js"></script>
12 <script type="text/javascript" src="../framework/js/scriptaculous.js"></script>
13
14 <script>
15
16 function editT() {
17        
18         var editor = new Ajax.InPlaceEditor('edit', 'test.php', {
19                 okButton:false,
20                 cancelLink:false,
21                 rows:5,
22                 submitOnBlur:true,
23                 externalControl: 'cpt',
24                 externalControlOnly: true,
25                 paramName: 'fld',
26                 //loadTextURL: 'test.php',
27                 stripLoadedTextTags: true,
28                 savingText: "Updating...",
29                 //callback: function(form, value) {
30                         //return "fld=" + encodeURIComponent(value.stripTags())
31                 //},
32                 ajaxOptions: {
33                         method:'get',
34                         // parameters: {fld: 'test value'},
35                         //onComplete: function(transport){
36                                 //var response = transport.responseText || "";
37                                 //alert(creatLinks(response));
38                                 //$('edit').update(response)
39                         //},
40                 //onFailure: function(){ alert('Something went wrong...') }
41                 }
42                
43         });
44        
45         editor.enterEditMode();
46
47 }
48
49 </script>
50
51 <title>editing</title>
52 </head>
53
54 <body>
55
56 <div id="cpt" onclick="editT();">External Control:</div><div id="edit"><b>HTML Chars should be stripped!</b>, test 2, blahj blah blah, and this too.., yada yada yada, lalala, waaah</div>
57
58 </body>
59
60 </html>