Modifications of the JS in Design

This commit is contained in:
chris2tof committed 2011-09-09 15:40:13 +08:00
1 parent 77b8fcdd1d
commit 07ccacb7d7
4 files changed
+10 -12

No files matched your search

+2 -7
View File
@@ -11,7 +11,7 @@ function r_editor(tgetUrl,tpostUrl,tfilename,toption){
editor.height = toption['height'];
var html='';
editor.init = function(){
code = "<span style='border:solid; width:"+editor.width+"px;height:"+editor.height+"px; float:right;' ><textarea style='height:87%;width:97%;resize:none;border:none;' ></textarea><input type='button' class='send' value='Send' ><input type='button' class='discard' value='Discard' ></span>";
code = "<span id='file_editor' style='border:solid; width:"+editor.width+"px;height:"+editor.height+"px; float:right;' ><textarea style='height:87%;width:97%;resize:none;border:none;' ></textarea><input type='button' class='send' value='Send' ><input type='button' class='discard' value='Discard' ></span>";
html = $(code);
html.children("textarea").load(editor.getUrl);
html.children("input.discard").click(function(){
@@ -28,12 +28,7 @@ function r_editor(tgetUrl,tpostUrl,tfilename,toption){
});
};
editor.send = function(){
callback_for_send = function(data){
editor.postUrl = data;
alert($(this).attr("path"));
};
$.post(editor.postUrl,{filename:editor.filename,context:html.children("textarea").val(),authenticity_token:$('meta[name=csrf-token]').attr('content')},callback_for_send,"json");
$.post(editor.postUrl,{filename:editor.filename,context:html.children("textarea").val(),authenticity_token:$('meta[name=csrf-token]').attr('content')},null,"script");
};
editor.destroy = function(){
html.remove();