fix for ie8,9 for tinymce
This commit is contained in:
1 parent
8ea7bf75cd
commit
4660c26b7a
6 files changed
+44
-32
No files matched your search
@@ -23,10 +23,42 @@ $(document).on('click', '#ajax_form_submit', function(){
|
||||
// dataType: 'script',
|
||||
dataType: 'html',
|
||||
url:$("#ajaxForm").attr("action"),
|
||||
success: function(response,status,xhr){
|
||||
alert(response);
|
||||
eval(response);
|
||||
|
||||
success: function(response,status,xhr){
|
||||
if(typeof tinyMCEPopup != "undefined"){
|
||||
var x = response.split("#");
|
||||
var returnurl = x[0],
|
||||
returntitle = x[1],
|
||||
returndescription = x[2];
|
||||
var win = tinyMCEPopup.getWindowArg("window");
|
||||
win.document.getElementById(tinyMCEPopup.getWindowArg("input")).value = returnurl;
|
||||
win.document.getElementById(tinyMCEPopup.getWindowArg("alt")).value = returndescription;
|
||||
win.document.getElementById(tinyMCEPopup.getWindowArg("title")).value = returntitle;
|
||||
if (typeof(win.ImageDialog) != "undefined") {
|
||||
// we are, so update image dimensions...
|
||||
if (win.ImageDialog.getImageData)
|
||||
win.ImageDialog.getImageData();
|
||||
|
||||
// ... and preview if necessary
|
||||
if (win.ImageDialog.showPreviewImage)
|
||||
win.ImageDialog.showPreviewImage(returnurl);
|
||||
}
|
||||
tinyMCEPopup.close();
|
||||
}else{
|
||||
//incase if we want to do something for quick edit file upload
|
||||
// $("#modal-file").modal('hide');
|
||||
// var r = "";
|
||||
// if(rcom.getInternetExplorerVersion() > -1){
|
||||
// r = "<tr><td>" + response + "</td></tr>";
|
||||
// r = r.replace("</a><a","</a></td><td><a");
|
||||
// r = $(r);
|
||||
// r.attr("id",r.find("span").attr("for"));
|
||||
// alert(r.html())
|
||||
// }else{
|
||||
// r = $(response);
|
||||
// }
|
||||
// $('#bulletin_files tbody').append(r);
|
||||
//$(response).fadeIn();
|
||||
}
|
||||
},
|
||||
error:function(){
|
||||
alert("error");
|
||||
|
||||
@@ -41,7 +41,8 @@ class Admin::AssetsController < OrbitBackendController
|
||||
# end
|
||||
# }
|
||||
# end
|
||||
render :layout => false
|
||||
# render :json=>{"url"=>@asset.data.url,"title"=>"xxx","desc"=>"sss"}.to_json
|
||||
render :layout=>false
|
||||
else
|
||||
flash[:error] = t(:create_fail)
|
||||
@asset_categories = AssetCategory.all
|
||||
|
||||
@@ -1,21 +1 @@
|
||||
|
||||
// Uncomment and change this document.domain value if you are loading the script cross subdomains
|
||||
// document.domain = 'moxiecode.com';
|
||||
(function(){
|
||||
var returnurl = "<%= @asset.data.url %>";
|
||||
var returntitle = "<%= show_all_fields(@asset, 'title') %>";
|
||||
var returndescription = "<%= show_all_fields(@asset, 'description') %>";
|
||||
var win = tinyMCEPopup.getWindowArg("window");
|
||||
win.document.getElementById(tinyMCEPopup.getWindowArg("input")).value = returnurl;
|
||||
win.document.getElementById(tinyMCEPopup.getWindowArg("alt")).value = returndescription;
|
||||
win.document.getElementById(tinyMCEPopup.getWindowArg("title")).value = returntitle;
|
||||
if (typeof(win.ImageDialog) != "undefined") {
|
||||
// we are, so update image dimensions...
|
||||
if (win.ImageDialog.getImageData)
|
||||
win.ImageDialog.getImageData();
|
||||
|
||||
// ... and preview if necessary
|
||||
if (win.ImageDialog.showPreviewImage)
|
||||
win.ImageDialog.showPreviewImage(returnurl);
|
||||
}
|
||||
tinyMCEPopup.close();})()
|
||||
<%= @asset.data.url %>#<%= show_all_fields(@asset, 'title') %>#<%= show_all_fields(@asset, 'description') %>
|
||||
Reference in new issue
Block a user