image insertion completed..

This commit is contained in:
Harry Bomrah 2012-05-16 16:22:50 +08:00
parent c380c4cad0
commit 617a683d00
5 changed files with 19 additions and 24 deletions

View File

@ -5,12 +5,3 @@ $(document).on('click', '#ajax_form_submit', function(){
} }
}); });
}); });
$(document).ready(function(){
var win = parent.OWindow;
var thatwindow = win.thiswindow;
alert(self.id);
$("div.button_bar input[type=submit]").click(function(){
thatwindow.document.getElementById(win.input).value = "Soemthing";
return false;
})
})

View File

@ -1,4 +1,3 @@
var OWindow = {};
function load_tinymce() { function load_tinymce() {
$('.tinymce_textarea').tinymce({ $('.tinymce_textarea').tinymce({
@ -59,10 +58,6 @@ function myFileBrowser(field_name, url, type, win) {
// (PHP session ID is now included if there is one at all) // (PHP session ID is now included if there is one at all)
cmsURL = cmsURL + "&type=" + type; cmsURL = cmsURL + "&type=" + type;
} }
OWindow = {
thiswindow : win,
input : field_name
}
tinyMCE.activeEditor.windowManager.open({ tinyMCE.activeEditor.windowManager.open({
file : cmsURL, file : cmsURL,
@ -74,7 +69,7 @@ function myFileBrowser(field_name, url, type, win) {
close_previous : "no" close_previous : "no"
}, { }, {
window : win, window : win,
input : field_name input : field_name,
}); });
return false; return false;
} }

View File

@ -31,7 +31,7 @@ class Admin::AssetsController < OrbitBackendController
if @asset.save if @asset.save
respond_to do |format| respond_to do |format|
format.html { render :text => @asset.data.url } format.html { render :text => @asset.data.url }
format.js { render 'js/remove_pop_up_and_reload_content', :locals => {:function => 'append', :id => 'tbody_assets', :value => @asset, :values => nil, :partial => 'admin/assets/asset', :locals => nil} } format.js {}
end end
else else
respond_to do |format| respond_to do |format|

View File

@ -1,16 +1,11 @@
<div id='pop_up_content' class="main2"> <div id='pop_up_content' class="main2">
<h1><%= t('admin.new_asset') %></h1> <h1><%= t('admin.new_asset') %></h1>
<%= form_for :asset, :url => admin_assets_path, :html => {:id => (is_html ? nil : 'ajaxForm'), :multipart => true } do |f| %> <%= form_for :asset, :url => admin_assets_path, :html => {:id => 'ajaxForm', :multipart => true } do |f| %>
<%= f.error_messages %> <%= f.error_messages %>
<%= render :partial => "form", :locals => { :f => f } %> <%= render :partial => "form", :locals => { :f => f } %>
<div class="button_bar"> <div class="button_bar">
<% if is_html %>
<%= link_back %>
<%= f.submit t(:create) %>
<% else %>
<a id='ajax_form_submit' class="new"><%= t(:create) %></a> <a id='ajax_form_submit' class="new"><%= t(:create) %></a>
<% end %>
</div> </div>
<% end %> <% end %>
</div> </div>

File diff suppressed because one or more lines are too long