2011-09-15 2 views
0

KendoUI를 사용하여 파일을 업로드하는 간단한 양식을 설정하고 내 dev 컴퓨터 (OSX Apache)에서 멋지게 작동하지만 내 서버에 업로드됩니다 (Linux Apache) 이미지에서 볼 수있는 것처럼 나빠 보인다. 나는 파이어 폭스와 크롬 모두에서 같은 결과를 테스트했으며, 둘다 로컬 복사본과 리모트에서 좋았다. 모든 파일이 로컬 서버와 원격 서버에서 동일하다는 점을 확인했습니다.KendoUI 업로드 대화 상자가 라이브 Linux 서버에서 호스팅 될 때 OSX 개발 컴퓨터에서 사용되는 경우

nice on dev machineborked after upload

내 코드는 다음과 같다 ...

<!doctype html> 
<html> 
    <head> 
    <title>Test | Animation Tool</title> 
    <link href="./kendo/styles/kendo.common.min.css" rel="stylesheet"/> 
    <link href="./kendo/styles/kendo.kendo.min.css" rel="stylesheet"/> 
    <script src="./jquery.js"></script> 

    <script src="./kendo/js/kendo.all.min.js"></script> 

    <style type="text/css"> 
     body{ 
     background-Color: #f78049; 
     background-image: url(stripe.png); 
     background-repeat: repeat-y; 
     margin:0;padding:0; 
     font-family:sans-serif; 
     } 
     #sidebar{ 
     background-Color: #f78049; 
     border: 3px solid #ef652a; 
     margin:0;padding:0; 
     width: 300px; 
     float: left; 
     height: 900px; 
     } 
     .step{ 
     border-top: 3px solid #ef652a; 
     } 
     .step p.first{ 
     display: inline; 
     } 
     .step-id{ 
     background-color: #ef652a; 
     -moz-border-radius: 7px; 
     font-size: 30px; 
     margin: .2em .2em .2em 0; 
     padding: .1em .2em; 
     } 
     .t-button{ 
     margin: 0 37px 0 37px; 
     width:203px; 
     top: 10px; 
     } 
     button.t-button{ 
     margin: .2em 37px .2em 37px; 
     width:220px; 
     } 
     .t-upload-files{ 
     margin: 0.2em 2.6em 1em; 
     } 
     #main{ 
     float:left; 
     } 
     h1, h2{ 
     margin:0;padding:0 0 0.3em; 
     text-align:center; 
     color:#ffd; 
     } 
     #phone,#anim{ 
     width:401px; 
     height:875px; 
     background-image:url(phone.png); 
     position: absolute; 
     top:10px; 
     left:350px; 
     } 
     #anim{ 
     background-image:url("files/spec.png"); 
     background-position:0 0; 
     background-repeat:no-repeat; 
     height:480px; 
     left:391px; 
     top:144px; 
     width:320px; 
     } 
     a img{ 
     border:none; 
     } 
    </style> 
     <script type="text/javascript"> 
     $(function(){ 

      var i=0, x={timer:null, frames:4, frameWidth:320, frameRate:150}; 

      var addTestFile = function(filename){ 
      $('#test-files').append(
       $('<button />').addClass('t-button custom').html(filename).click(function(){ 
       $anim = $('#anim').css({backgroundImage:'url("files/'+filename+'")'}) 
        var loop = function(){ 
        $anim.css({backgroundPosition:"0 0"}).animate({borderWidth:0},150,function(){ 
         $anim.css({backgroundPosition:"-320px 0"}).animate({borderWidth:0},150,function(){ 
         $anim.css({backgroundPosition:"-640px 0"}).animate({borderWidth:0},150,function(){ 
          $anim.css({backgroundPosition:"-960px 0"}).animate({backgroundPosition:"-640px 0"},250,function(){ 

          }) 
         }) 
         }) 
        }) 
        } 
        clearInterval(x.timer) 
        x.timer = setInterval(function(){ 
        loop() 
        }, 950) 
       }) 
      ) 
      } 

      $.get('files.php',function(d){ 
      $.each(d, function(i,file){ 
       addTestFile(file) 
      }) 
      }) 

      $("#files").kendoUpload({ 
      async: { 
       saveUrl: "./save.php", 
       // removeUrl: "./remove.php", 
       autoUpload: true 
      }, 
      showFileList: true, 
      success: function(e){ 

       $('.t-file').last().siblings().remove() 

       var filename = e.files[0].name.replace(/\s/g,'-') 

       $('#test-files button').filter(function(){ 
       return $(this).text() == filename 
       }).remove() 

       addTestFile(filename) 

       console.log('uploaded' + e.files[0].name); 
       //    return true; 
      }, 
      error: function(e){ 
       console.log("Error (" + e.operation + ")"); 
       e.preventDefault(); // Suppress error message 
      } 

      }); 
     }); 
     </script> 
    </head> 
    <body> 
    <div id="sidebar"> 
     <h2>Animation Tool</h2> 

     <div id='one' class='step'> 
     <span class='step-id'>1</span> 
     <p class="first">Get the specification image</p> 
     <p><a href="getspec.php" class='t-button'>Download image...</a></p> 
     </div> 

     <div id='two' class='step'> 
     <span class='step-id'>2</span> 
     <p class="first">Edit the downloaded image file</p> 

     </div> 

     <div id='three' class='step'> 
     <span class='step-id'>3</span> 
     <p class="first">Upload your edited file</p> 
     <input name="files" id="files" type="file" /> 
     </div> 

     <div id='two' class='step'> 
     <span class='step-id'>4</span> 
     <p class='first'>Test you animation</p> 
     <span id='test-files'></span> 
     </div> 

    </div> 
    <div id="main"> 
     <div id="anim"></div> 
     <div id="phone"></div> 
    </div> 
    </body> 
</html> 

답변

3

내 생각은 CSS 파일 중 하나입니다 당겨지고 있지 않습니다. 나는을했던 곳 나는 여기에 바이올린을 만들었 kendo.common.min.css 결과가 귀하의 것과 정확히 같지는 않지만 너무 가까이 있습니다.

http://jsfiddle.net/B4dWB/

당신의 CSS 참조를 확인하고 그들은 모두 올바른 및로드되어 있는지 확인합니다.

0

제대로로드 모두를 확인하는 가장 쉬운 방법은 파이어 폭스 브라우저의 개발자 도구 (방화범을 사용하는 것입니다, 개발자 Chrome/Safari의 도구).

네트워크 탭에서 Kendo UI CSS 및 JavaScript 파일이 원격 서버에서 제대로로드되고 있는지 확인할 수 있습니다. 브라우저에서 (이것은 또한 당신이 당신의 페이지/자원의 캐시 된 버전을 표시되지 않는 확인하는 좋은 시간이다. 즉, 항상 쉬운 브라우저 디버깅 잡았다입니다.) 일반적으로

, Kendo UI부터 실행, 당신의 호스팅 환경 및 웹 서버는 영향을 미치지 않아야합니다. 파일이 브라우저에 도달하면 렌더링 및 동작이 제대로 작동해야합니다.