开发者

Difference in KendoUI upload dialog when hosted on live linux server vs on OSX dev machine

I set up a simple form to upload files using KendoUI, and looks and works great on my dev machine (OSX Apache), but uploaded to my server (Linux Apache) it looks bad as you can see in the images. I tested with same results in both firefox and chrome, and both are fine from local copy and bad from remote. I have tripple checked that all the files are the same on both local and remote servers.

Difference in KendoUI upload dialog when hosted on live linux server vs on OSX dev machine

vs

Difference in KendoUI upload dialog when hosted on live linux server vs on OSX dev machine

My code is as follows...

<!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){
     开发者_Python百科       $.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>


My guess is one of the css files is not getting pulled in. I created a fiddle here where I left out the kendo.common.min.css and the result is not exactly the same as yours, but too darn close.

http://jsfiddle.net/B4dWB/

Check your css references and make sure they are all correct and loaded in.


The easiest way to validate everything is loading correctly is to use your browser developer tools (Firebug in Firefox, Developer Tools in Chrome/Safari).

On the network tab, you should be able to see if the Kendo UI CSS and JavaScript files are being properly loaded from your remote server. (This is also a good time to make sure you're not seeing a cached version of your page/resources. That's always an easy browser debugging gotcha.)

In general, since Kendo UI runs in the browser, your hosting environment and web server should have no impact. As long as the files reach the browser, the rendering and behavior should function properly.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜