Dojo:基本的dojox /移动应用程序会生成警告

时间:2013-08-27 06:21:04

标签: mobile dojo webstorm

我正在关注Dojox/Mobile - TweetView的移动教程系列,我注意到在启动一个非常基本的应用程序时(即使应用程序看起来应该如此),控制台会打印出几十个警告,例如“ CSS属性值无效“。

我正在使用Chrome(版本29.0.1547.57)& WebStorm IDE,警告出现在IDE的控制台上。

所以问题是,我是应该忽略这些警告,还是我做错了什么?

HTML页面:

<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta http-equiv="cache-control" content="no-cache">
        <meta http-equiv="pragma" content="no-cache">

        <script src="dojo/dojo.js" data-dojo-config="async: true"></script>
    </head>

    <body>

        <div data-dojo-type="dojox.mobile.View">
            <h1 data-dojo-type="dojox.mobile.Heading">About</h1>
            <h2 data-dojo-type="dojox.mobile.RoundRectCategory">Generic Mobile Device</h2>
            <ul data-dojo-type="dojox.mobile.RoundRectList">
                <li data-dojo-type="dojox.mobile.ListItem" data-dojo-props="rightText:'AcmePhone'">
                    Network
                </li>
            </ul>
        </div>

        <script type="text/javascript">
            require(["dojox/mobile/parser", "dojox/mobile/deviceTheme", "dojox/mobile"
            ],
                    function(parser, deviceTheme){
                        // startup the application
                        parser.parse();
                    });
        </script>
    </body>

</html>

Webstorm控制台警告:

Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/iphone/CheckBox.css:42
Invalid CSS property name: animation-duration   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/iphone/IconContainer.css:65
Invalid CSS property name: animation-timing-function    C:/Users/Alon/Desktop/dj/dojox/mobile/themes/iphone/IconContainer.css:67
Invalid CSS property name: animation-iteration-count    C:/Users/Alon/Desktop/dj/dojox/mobile/themes/iphone/IconContainer.css:69
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/iphone/IconContainer.css:71
Invalid CSS property name: animation-duration   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/iphone/IconContainer.css:77
Invalid CSS property name: animation-timing-function    C:/Users/Alon/Desktop/dj/dojox/mobile/themes/iphone/IconContainer.css:79
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/iphone/IconContainer.css:81
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/iphone/IconContainer.css:87
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/iphone/IconContainer.css:91
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/iphone/IconContainer.css:95
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/iphone/IconContainer.css:99
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/iphone/RadioButton.css:38
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/iphone/ToggleButton.css:46
Invalid CSS property value: radial-gradient(6 at center, #17df25 0%, #1ba51c 100%)  C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/domButtons/DomButtonSilverCircleGreenButton.css:29
Invalid CSS property value: radial-gradient(6 at center, #ff7a07 0%, #e66b03 100%)  C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/domButtons/DomButtonSilverCircleOrangeButton.css:29
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/iphone/ProgressIndicator.css:23
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/iphone/ProgressIndicator.css:34
Invalid CSS property name: animation-duration   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/dissolve.css:3
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/dissolve.css:5
Invalid CSS property name: animation-timing-function    C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/dissolve.css:7
Invalid CSS property name: animation-duration   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/dissolve.css:11
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/dissolve.css:13
Invalid CSS property name: animation-timing-function    C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/dissolve.css:15
Invalid CSS property value: transform   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cover.css:9
Invalid CSS property value: transform   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/reveal.css:9
Invalid CSS property name: animation-duration   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:3
Invalid CSS property name: animation-timing-function    C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:5
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:9
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:11
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:15
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:17
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:65
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:67
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:71
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:73
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:124
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:126
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:130
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:132
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:168
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:170
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:174
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:176
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:212
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:214
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:218
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:220
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:256
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:258
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:262
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:264
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:300
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:302
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:306
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:308
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:344
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:346
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:350
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:352
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:388
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:390
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:394
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:396
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:432
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:434
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:438
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:440
Invalid CSS property value: transform   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/slidev.css:9
Invalid CSS property value: transform   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/coverv.css:9
Invalid CSS property value: transform   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/revealv.css:9
Invalid CSS property name: animation-duration   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/swirl.css:3
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/swirl.css:5
Invalid CSS property name: animation-timing-function    C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/swirl.css:7
Invalid CSS property name: animation-duration   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/swirl.css:12
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/swirl.css:14
Invalid CSS property name: animation-timing-function    C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/swirl.css:16
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/swirl.css:20
Invalid CSS property name: animation-duration   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/scaleOut.css:3
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/scaleOut.css:5
Invalid CSS property name: animation-timing-function    C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/scaleOut.css:7
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/scaleOut.css:11
Invalid CSS property name: animation-duration   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/scaleOut.css:16
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/scaleOut.css:18
Invalid CSS property name: animation-timing-function    C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/scaleOut.css:20
Invalid CSS property name: animation-duration   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/swap.css:3
Invalid CSS property name: animation-timing-function    C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/swap.css:5
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/swap.css:9
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/swap.css:13
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/swap.css:17
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/swap.css:21
Invalid CSS property name: animation-duration   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/scaleIn.css:4
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/scaleIn.css:6
Invalid CSS property name: animation-timing-function    C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/scaleIn.css:8
Invalid CSS property name: animation-duration   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/scaleIn.css:12
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/scaleIn.css:14
Invalid CSS property name: animation-timing-function    C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/scaleIn.css:16
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/scaleIn.css:20
Invalid CSS property name: animation-duration   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/zoomIn.css:4
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/zoomIn.css:6
Invalid CSS property name: animation-timing-function    C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/zoomIn.css:8
Invalid CSS property name: animation-duration   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/zoomIn.css:12
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/zoomIn.css:14
Invalid CSS property name: animation-timing-function    C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/zoomIn.css:16
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/zoomIn.css:20
Invalid CSS property name: animation-duration   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/zoomOut.css:3
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/zoomOut.css:5
Invalid CSS property name: animation-timing-function    C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/zoomOut.css:7
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/zoomOut.css:11
Invalid CSS property name: animation-duration   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/zoomOut.css:16
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/zoomOut.css:18
Invalid CSS property name: animation-timing-function    C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/zoomOut.css:20
Invalid CSS property value: transform   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/coverv.css:9
Invalid CSS property value: transform   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/revealv.css:9
Invalid CSS property value: transform   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/slide.css:9

1 个答案:

答案 0 :(得分:1)

我觉得无效的CSS属性并不重要,我也得到了很多这些。我通常将日志记录级别设置为高于警告的级别。通常这些无效属性存在,因为在某些浏览器中它们受支持,而在其他浏览器中它们可能无效。例如,许多与UI相关的框架使用供应商特定的前缀,如-o--webkit--moz-,....它们只能在特定的浏览器上工作,但是其他浏览器会忽略它们(或者它们会给你一个警告)。

例如(这是zoomIn.css文件的一部分,你会收到错误):

.mblZoomIn.mblIn {
    -webkit-animation-duration: 0.5s;
    animation-duration: 0.5s;
    -webkit-animation-name: mblZoomInIn;
    animation-name: mblZoomInIn;
    -webkit-animation-timing-function: ease-out;
    animation-timing-function: ease-out;
}

您收到animation-duration的警告,但您的浏览器(Chrome)会识别-webkit-animation-duration,因此没有任何问题。

但是在本教程的后期阶段,您可能会遇到一些问题。 TweetView教程基于Twitter v1.0 API,该API已弃用超过一年(如果我没记错的话),并于2013年6月被删除了。

尽管如此,本教程可能会让您基本了解如何使用Dojo创建移动应用程序。