app/controllers/papermill_controller.rb in papermill-1.4.0 vs app/controllers/papermill_controller.rb in papermill-1.4.1

- old
+ new

@@ -40,13 +40,15 @@ render :update do |page| page << %{ jQuery('##{params[:Fileid]}').replaceWith('#{escape_javascript output}'); } page << %{ jQuery('#papermill_asset_#{@old_asset.id}').remove() } if @old_asset end else - page << %{ notify("#{@asset.name}", @asset.errors.full_messages.join('<br />'), "error"); } - page << %{ jQuery('##{params[:Fileid]}').remove() } - page << %{ jQuery('#papermill_asset_#{@old_asset.id}').show() } if @old_asset + render :update do |page| + page << %{ notify('#{@asset.name}', '#{escape_javascript @asset.errors.full_messages.join("<br />")}', 'error'); } + page << %{ jQuery('##{params[:Fileid]}').remove(); } + page << %{ jQuery('#papermill_asset_#{@old_asset.id}').show(); } if @old_asset + end end end def edit render :action => "edit", :layout => false @@ -58,12 +60,12 @@ def update @asset.create_thumb_file(params[:target], params[:papermill_asset].merge({ :geometry => "#{params[:target]}#" })) if params[:target] render :update do |page| if @asset.update_attributes(params[:papermill_asset]) - page << %{ notify("#{@asset.name}", "#{ escape_javascript t("papermill.updated", :resource => @asset.name)}", "notice"); close_popup(self); } + page << %{ notify('#{@asset.name}', '#{ escape_javascript t("papermill.updated", :resource => @asset.name)}', 'notice'); close_popup(self); } else - page << %{ jQuery("#error").html("#{ escape_javascript @asset.errors.full_messages.join('<br />') }"); jQuery("#error").show(); } + page << %{ jQuery('#error').html('#{ escape_javascript @asset.errors.full_messages.join("<br />") }'); jQuery('#error').show(); } end end end def destroy \ No newline at end of file