2013-05-29 3 views
0

파일 선택기를 사용하여 이미지를 내 레일 앱에 업로드 한 다음 표시 페이지에 이미지를 열어서 새 사물함 내부에서 편집 할 수있는 버튼이 있습니다.Aviary가 열린 직후 닫습니다.

편집기가 열리지 만 잠시 표시된 후에 닫힙니다. 그것은 지금처럼 여기

코드입니다 : 여기에 좋아

<%= javascript_tag do %> 
     //Setup Filepicker.io - to get an apikey, go to https://developers.filepicker.io/register/ 
     filepicker.setKey('Ao6qJVzzAQ5K8zL6UUhxKz'); 

     //Setup Aviary 
     var featherEditor = new Aviary.Feather({ 
      //Get an api key for Aviary at http://www.aviary.com/web-key 
      apiKey: 'jdbk5iwjxibpotfn', 
      apiVersion: 2, 
      onSave: function(imageID, newURL) { 
       //Export the photo to the cloud using Filepicker.io! 
       filepicker.export(newURL, {extension:'.png'}); 
      }, 
      appendTo: 'web_demo_pane' 
     }); 

     //Giving a placeholder image while Aviary loads 
     var preview = document.getElementById('web_demo_preview'); 
     var editPane = document.getElementById('start_web_demo'); 
     editPane.onclick = function(){ 
     //When the user clicks the button, import a file using Filepicker.io 
     var theurl = "<%= @user.filepicker_url %>+.jpg"; 
     preview.src = theurl; 
       featherEditor.launch({ 
        image: preview, 
        url: theurl 
       }); 
    }; 

    <% end %> 
+1

위로 링크 - http://stackoverflow.com/questions/11988437/im-getting-the-message-resource-interpreted-as-script-but-transferred-with-mime – David

+0

감사합니다. 그게 도움이되었습니다. 문제를 이해하십시오. –

답변

0
This line needed to change 

<%= @user.filepicker_url %>+.jpg 

To this: 

<%= @user.filepicker_url %> 
+0

후속 문제에 대해 새로운 질문을해야합니다. – ChrisF

0

리소스 스크립트로 해석하지만, MIME 타입 text/html과 함께 전송 다음은 콘솔에 오류가 있습니다 내가 다른 변경을 한 곳이며 현재 작동 중입니다 ... 저장된 파일이 축소판 버전을 변경하지 않는다는 것을 받아들입니까 ???

//filepicker.store(newURL); 
$.post(oldurl, {url: newURL}, function(response){console.log(response);}); 

filepicker.io 파일의 모든 버전이 수정되지 않는 이유는 무엇입니까?

관련 문제