fix for ie8,9 for tinymce
This commit is contained in:
parent
8ea7bf75cd
commit
4660c26b7a
|
@ -24,9 +24,41 @@ $(document).on('click', '#ajax_form_submit', function(){
|
||||||
dataType: 'html',
|
dataType: 'html',
|
||||||
url:$("#ajaxForm").attr("action"),
|
url:$("#ajaxForm").attr("action"),
|
||||||
success: function(response,status,xhr){
|
success: function(response,status,xhr){
|
||||||
alert(response);
|
if(typeof tinyMCEPopup != "undefined"){
|
||||||
eval(response);
|
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(){
|
error:function(){
|
||||||
alert("error");
|
alert("error");
|
||||||
|
|
|
@ -41,7 +41,8 @@ class Admin::AssetsController < OrbitBackendController
|
||||||
# end
|
# end
|
||||||
# }
|
# }
|
||||||
# end
|
# end
|
||||||
render :layout => false
|
# render :json=>{"url"=>@asset.data.url,"title"=>"xxx","desc"=>"sss"}.to_json
|
||||||
|
render :layout=>false
|
||||||
else
|
else
|
||||||
flash[:error] = t(:create_fail)
|
flash[:error] = t(:create_fail)
|
||||||
@asset_categories = AssetCategory.all
|
@asset_categories = AssetCategory.all
|
||||||
|
|
|
@ -1,21 +1 @@
|
||||||
|
<%= @asset.data.url %>#<%= show_all_fields(@asset, 'title') %>#<%= show_all_fields(@asset, 'description') %>
|
||||||
// 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();})()
|
|
|
@ -128,11 +128,11 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
||||||
|
|
||||||
@bulletin_file = BulletinFile.new(params[:bulletin_file])
|
@bulletin_file = BulletinFile.new(params[:bulletin_file])
|
||||||
|
|
||||||
respond_to do |format|
|
# respond_to do |format|
|
||||||
if @bulletin_file.save
|
if @bulletin_file.save
|
||||||
format.js { render 'create_bulletin_file' }
|
render 'create_bulletin_file',:layout=>false
|
||||||
end
|
end
|
||||||
end
|
# end
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
|
|
||||||
<tr id="<%= dom_id list_bulletin_file %>">
|
<tr id="<%= dom_id list_bulletin_file %>">
|
||||||
<td><%= list_bulletin_file.file.file ? ( link_to list_bulletin_file.title_translations['zh_tw'], list_bulletin_file.file.url, {:target => '_blank', :title => list_bulletin_file.description_translations['zh_tw']} ) : list_bulletin_file.title_translations['zh_tw'] %></td>
|
<td><%= list_bulletin_file.file.file ? ( link_to list_bulletin_file.title_translations['zh_tw'], list_bulletin_file.file.url, {:target => '_blank', :title => list_bulletin_file.description_translations['zh_tw']} ) : list_bulletin_file.title_translations['zh_tw'] %></td>
|
||||||
<td><%= list_bulletin_file.file.file ? ( link_to list_bulletin_file.title_translations['en'], list_bulletin_file.file.url, {:target => '_blank', :title => list_bulletin_file.description_translations['en']} ) : list_bulletin_file.title_translations['zh_tw'] %></td>
|
<td><%= list_bulletin_file.file.file ? ( link_to list_bulletin_file.title_translations['en'], list_bulletin_file.file.url, {:target => '_blank', :title => list_bulletin_file.description_translations['en']} ) : list_bulletin_file.title_translations['zh_tw'] %></td>
|
||||||
<td>
|
<td>
|
||||||
<a href="<%= panel_announcement_back_end_bulletin_file_quick_edit_path(list_bulletin_file) %>#modal-file" data-toggle="modal" data-remote="true" class="action"><i class="icon-pencil"></i></a>
|
<a href="<%= panel_announcement_back_end_bulletin_file_quick_edit_path(list_bulletin_file) %>#modal-file" data-toggle="modal" data-remote="true" class="action"><i class="icon-pencil"></i></a>
|
||||||
<span class="action">
|
<span class="action" for="<%= dom_id list_bulletin_file %>">
|
||||||
<%= fields_for "bulletin[bulletin_files_attributes][]", list_bulletin_file, :index => list_bulletin_file_counter do |f| %>
|
<%= fields_for "bulletin[bulletin_files_attributes][]", list_bulletin_file, :index => list_bulletin_file_counter do |f| %>
|
||||||
<%= f.hidden_field :id %>
|
<%= f.hidden_field :id %>
|
||||||
<%= hidden_field_tag :tr, (dom_id list_bulletin_file) %>
|
<%= hidden_field_tag :tr, (dom_id list_bulletin_file) %>
|
||||||
|
@ -19,4 +18,3 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
<%= render :partial => 'list_bulletin_file', :collection => [@bulletin_file] %>
|
Loading…
Reference in New Issue