2011-09-15 5 views
0

KendoUIを使用してファイルをアップロードする簡単なフォームをセットアップし、自分のdevマシン(OSX Apache) (Linux Apache)画像に見られるように、それは悪く見えます。私はfirefoxとchromeの両方で同じ結果をテストしましたが、どちらもローカルコピーからは問題なく、リモートからは問題ありません。私はすべてのファイルがローカルサーバーとリモートサーバーの両方で同じであることを確認しました。次のようにborked after uploadKendoUIのアップロードダイアログがライブLinuxサーバーとOSXデベロッパーマシンでホストされている場合の違い

私のコード対

nice on dev machineがある...

<!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ファイルの1に引っ張らなっていないです。私は左のところ、私はここにフィドルを作成しましたkendo.common.min.cssその結果はあなたとまったく同じではありませんが、あまりにも近いです。

http://jsfiddle.net/B4dWB/

あなたのCSS参照をチェックして、彼らがすべて正しいとしてロードされていることを確認してください。

0

正しくロードされ、すべてを検証するための最も簡単な方法は、Firefoxでブラウザの開発ツール(Firebugのを使用することであるが、開発者Chrome/Safariのツール)。

[ネットワーク]タブでは、剣道UIのCSSファイルとJavaScriptファイルがリモートサーバーから正しくロードされているかどうかを確認できます。 一般的には(これはまた、あなたのページ/リソースのキャッシュされたバージョンを見ていないことを確認するには良い時間です。それは必ずしも容易でブラウザのデバッグ落とし穴です。)

、ブラウザでKendo UI実行されるので、あなたのホスティング環境とWebサーバーは影響を与えません。ファイルがブラウザに到達する限り、レンダリングと動作は適切に機能するはずです。

関連する問題