فهرست منبع

add appmarketv2

jyew2 5 سال پیش
والد
کامیت
fd8159e832
43فایلهای تغییر یافته به همراه6193 افزوده شده و 0 حذف شده
  1. 2 0
      o2web/gulpapps.js
  2. BIN
      o2web/source/x_component_AppMarketV2/$Main/appicon.png
  3. 20 0
      o2web/source/x_component_AppMarketV2/$Main/default/applicationsContent.html
  4. 216 0
      o2web/source/x_component_AppMarketV2/$Main/default/css.wcss
  5. BIN
      o2web/source/x_component_AppMarketV2/$Main/default/icon.png
  6. BIN
      o2web/source/x_component_AppMarketV2/$Main/default/icon/add.png
  7. BIN
      o2web/source/x_component_AppMarketV2/$Main/default/icon/add_over.png
  8. BIN
      o2web/source/x_component_AppMarketV2/$Main/default/icon/blackfiveangular.png
  9. BIN
      o2web/source/x_component_AppMarketV2/$Main/default/icon/conflict.png
  10. BIN
      o2web/source/x_component_AppMarketV2/$Main/default/icon/default.png
  11. BIN
      o2web/source/x_component_AppMarketV2/$Main/default/icon/default2.png
  12. BIN
      o2web/source/x_component_AppMarketV2/$Main/default/icon/flag.png
  13. BIN
      o2web/source/x_component_AppMarketV2/$Main/default/icon/halffiveangular.png
  14. BIN
      o2web/source/x_component_AppMarketV2/$Main/default/icon/loading.gif
  15. BIN
      o2web/source/x_component_AppMarketV2/$Main/default/icon/logo1.png
  16. BIN
      o2web/source/x_component_AppMarketV2/$Main/default/icon/whitefiveangular.png
  17. 21 0
      o2web/source/x_component_AppMarketV2/$Main/default/recommendContent.html
  18. 327 0
      o2web/source/x_component_AppMarketV2/$Main/default/style.css
  19. 7 0
      o2web/source/x_component_AppMarketV2/$Main/default/view.html
  20. 331 0
      o2web/source/x_component_AppMarketV2/ApplicationsContent.js
  21. 89 0
      o2web/source/x_component_AppMarketV2/Main.js
  22. 146 0
      o2web/source/x_component_AppMarketV2/RecommendContent.js
  23. 27 0
      o2web/source/x_component_AppMarketV2/lp/zh-cn.js
  24. BIN
      o2web/source/x_component_AppMarketV2_Application/$Main/appicon.png
  25. 30 0
      o2web/source/x_component_AppMarketV2_Application/$Main/default/applicationComment.html
  26. 40 0
      o2web/source/x_component_AppMarketV2_Application/$Main/default/applicationView.html
  27. 216 0
      o2web/source/x_component_AppMarketV2_Application/$Main/default/css.wcss
  28. BIN
      o2web/source/x_component_AppMarketV2_Application/$Main/default/icon.png
  29. BIN
      o2web/source/x_component_AppMarketV2_Application/$Main/default/icon/bigblackfiveangular.png
  30. BIN
      o2web/source/x_component_AppMarketV2_Application/$Main/default/icon/bighalffiveangular.png
  31. BIN
      o2web/source/x_component_AppMarketV2_Application/$Main/default/icon/bigwhitefiveangular.png
  32. BIN
      o2web/source/x_component_AppMarketV2_Application/$Main/default/icon/blackfiveangular.png
  33. BIN
      o2web/source/x_component_AppMarketV2_Application/$Main/default/icon/halffiveangular.png
  34. BIN
      o2web/source/x_component_AppMarketV2_Application/$Main/default/icon/icon_men.png
  35. BIN
      o2web/source/x_component_AppMarketV2_Application/$Main/default/icon/loading.gif
  36. BIN
      o2web/source/x_component_AppMarketV2_Application/$Main/default/icon/logo1.png
  37. BIN
      o2web/source/x_component_AppMarketV2_Application/$Main/default/icon/whitefiveangular.png
  38. 418 0
      o2web/source/x_component_AppMarketV2_Application/$Main/default/style.css
  39. 456 0
      o2web/source/x_component_AppMarketV2_Application/$Main/default/viewer.css
  40. 3043 0
      o2web/source/x_component_AppMarketV2_Application/$Main/default/viewer.js
  41. 455 0
      o2web/source/x_component_AppMarketV2_Application/Comment.js
  42. 328 0
      o2web/source/x_component_AppMarketV2_Application/Main.js
  43. 21 0
      o2web/source/x_component_AppMarketV2_Application/lp/zh-cn.js

+ 2 - 0
o2web/gulpapps.js

@@ -4,6 +4,8 @@ var apps = [
     { "folder": "x_component_ANN", "tasks": ["move", "min"] },
     { "folder": "x_component_ANN", "tasks": ["move", "min"] },
     { "folder": "x_component_AppCenter", "tasks": ["move", "min"] },
     { "folder": "x_component_AppCenter", "tasks": ["move", "min"] },
     { "folder": "x_component_AppMarket", "tasks": ["move", "min"] },
     { "folder": "x_component_AppMarket", "tasks": ["move", "min"] },
+    { "folder": "x_component_AppMarketV2", "tasks": ["move", "min"] },
+    { "folder": "x_component_AppMarketV2_Application", "tasks": ["move", "min"] },
     { "folder": "x_component_Attendance", "tasks": ["move", "min"] },
     { "folder": "x_component_Attendance", "tasks": ["move", "min"] },
     { "folder": "x_component_BAM", "tasks": ["move", "min"] },
     { "folder": "x_component_BAM", "tasks": ["move", "min"] },
     { "folder": "x_component_Calendar", "tasks": ["move", "min"] },
     { "folder": "x_component_Calendar", "tasks": ["move", "min"] },

BIN
o2web/source/x_component_AppMarketV2/$Main/appicon.png


+ 20 - 0
o2web/source/x_component_AppMarketV2/$Main/default/applicationsContent.html

@@ -0,0 +1,20 @@
+        <div class="o2_appmarket_appcategorys">
+            <div data-o2-element="appCategory">
+            </div>
+            <div class="o2_appmarket_app_search_box" data-o2-element="searchAppNode">
+                <div class="o2_appmarket_app_search_box_icon o2_appmarket_app_icon_search" data-o2-element="searchAppIconNode" data-o2-events="click:doAppSearch"></div>
+                <div class="o2_appmarket_app_area_search_clear" data-o2-element="searchAppClearNode" data-o2-events="click:clearAppSearch"></div>
+                <div class="o2_appmarket_app_search_inputArea">
+                    <input class="o2_appmarket_app_searchinput" data-o2-element="searchAppInputNode" data-o2-events="focus:focusAppSearch;blur:blurAppSearch;keydown:searchAppInputKeyDown" type="text" placeholder="请输入搜索关键字">
+                </div>
+            </div>
+        </div>
+        <div style="clear:both;"></div>
+        <div class="o2_appmarket_appcategory_count" data-o2-element="appCategory_count">
+        </div>
+        <div style="clear:both;"></div>
+        <div class="o2_appmarket_applist" data-o2-element="appList">
+        </div>
+
+
+       

+ 216 - 0
o2web/source/x_component_AppMarketV2/$Main/default/css.wcss

@@ -0,0 +1,216 @@
+{
+    "titleBar": {
+        "overflow": "hidden",
+        "height": "50px",
+        "background-color": "#4c6b87"
+    },
+    "titleActionNode": {
+        "float": "right",
+        "margin-right": "20px",
+        "height": "26px",
+        "border": "1px solid #ffffff",
+        "border-radius": "5px",
+        "line-height": "26px",
+        "text-align": "center",
+        "padding": "0 20px",
+        "margin-top": "12px",
+        "cursor": "pointer",
+        "color": "#ffffff"
+    },
+    "titleTextNode": {
+        "padding-left": "20px",
+        "color": "#FFF",
+        "font-size": "18px",
+        "line-height": "50px",
+        "font-weight": "bold",
+        "width": "160px",
+        "float": "left"
+    },
+    "contentNode": {
+        "overflow": "auto",
+        "background-color": "#eeeeee"
+    },
+    "contentModuleArea": {
+        "width": "90%",
+        "margin": "20px auto",
+        "overflow": "hidden"
+    },
+
+    "moduleNode": {
+        "width": "160px",
+        "height": "300px",
+        "float": "left",
+        "background-color": "#f5f5f5",
+        "margin": "20px 5px"
+    },
+    "moduleIconNode": {
+        "width": "160px",
+        "height": "160px",
+        "background-image": "url(../x_component_AppMarket/$Main/default/icon/logo1.png)",
+        "background-repeat": "no-repeat",
+        "background-position": "center"
+    },
+    "moduleIconAreaNode": {
+        "width": "160px",
+        "height": "160px",
+        "background-color": "#666666",
+        "overflow": "hidden"
+    },
+
+
+    "moduleContentNode": {
+        "height": "130px",
+        "padding": "5px 0px",
+        "cursor": "pointer"
+    },
+    "moduleNameNode": {
+        "height": "40px",
+        "line-height": "20px",
+        "padding": "0px 10px",
+        "font-size": "16px",
+        "font-weight": "bold",
+        "color": "#333333",
+    },
+    "moduleCategoryNode": {
+        "padding": "5px 10px 0px 10px",
+        "height": "20px",
+        "line-height": "20px",
+        "font-size": "12px",
+        "color": "#333333"
+    },
+    "moduleDescriptionNode": {
+        "height": "36px",
+        "line-height": "18px",
+        "font-size": "12px",
+        "padding": "0px 10px",
+        "color": "#999999"
+    },
+    "moduleActionNode": {
+        "height": "28px",
+        "border": "1px solid #999999",
+        "line-height": "28px",
+        "font-size": "14px",
+        "color": "#ffffff",
+        "background-color": "#4c6b87",
+        "cursor": "pointer",
+        "text-align": "center"
+    },
+    "moduleLoadingAreaNode": {
+        "margin": "auto",
+        "width": "100px"
+    },
+    "moduleLoadingImgNode": {
+        "margin-top": "60px",
+        "margin-bottom": "60px",
+        "width": "100px",
+        "height": "100px",
+        "border": "0px"
+    },
+
+    "moduleSetupContentNode": {
+        "width": "90%",
+        "margin": "auto",
+        "overflow": "hidden"
+    },
+
+    "moduleSetupTitleNode": {
+        "margin-top": "10px",
+        "height": "130px",
+        "background-color": "#ffffff"
+    },
+    "moduleSetupIconAreaNode": {
+        "width": "130px",
+        "height": "130px",
+        "background-color": "#666666",
+        "overflow": "hidden",
+        "float": "left"
+    },
+    "moduleSetupIconNode": {
+        "width": "130px",
+        "height": "130px",
+        "background": "url(../x_component_AppMarket/$Main/default/icon/logo1.png) center center no-repeat"
+    },
+
+    "moduleSetupTitleContentNode": {
+        "margin-left": "140px",
+        "padding-top": "10px",
+        "padding-bottom": "10px",
+        "height": "110px"
+    },
+    "moduleSetupNameNode": {
+        "height": "30px",
+        "line-height": "30px",
+        "font-size": "16px",
+        "font-weight": "bold",
+        "color": "#333333"
+    },
+    "moduleSetupCategoryNode": {
+        "height": "20px",
+        "line-height": "20px",
+        "font-size": "12px",
+        "color": "#777777"
+    },
+    "moduleSetupDescriptionNode": {
+        "height": "40px",
+        "line-height": "20px",
+        "font-size": "12px",
+        "color": "#999999"
+    },
+    "moduleSetupCompareContentNode": {
+        //"border": "1px solid #cccccc",
+        "margin": "10px auto",
+        "overflow": "hidden"
+    },
+    "moduleSetupContentInforNode": {
+        "height": "36px",
+        "line-height": "36px",
+        "color": "#666666",
+        "font-size": "14px",
+        "padding-left": "6px"
+    },
+    "moduleSetupListAreaTitleNode": {
+        "height": "30px",
+        "line-height": "30px",
+        "background-color": "#dddddd",
+        "color": "#333333",
+        "padding-left": "10px",
+        "font-weight": "bold",
+        "font-size": "14px"
+    },
+    "moduleSetupListAreaContentNode": {
+        "min-height": "30px",
+        "background-color": "#ffffff"
+    },
+    "moduleSetupListContentNode": {
+        "height": "36px",
+        "line-height": "36px",
+        "margin": "0px 10px",
+        "font-size": "14px",
+        "color": "#666666",
+        "border-bottom": "1px solid #eeeeee"
+    },
+    moduleSetupListIconNode: {
+        "height": "36px",
+        "float": "left",
+        "width": "36px"
+    },
+    moduleSetupListNameNode: {
+        "height": "36px",
+        "margin-right": "160px",
+        "margin-left": "36px"
+    },
+    moduleSetupListActionNode: {
+        "height": "36px",
+        "float": "right",
+        "width": "60px"
+    },
+    moduleSetupListInforNode: {
+        "height": "36px",
+        "float": "right",
+        "width": "100px"
+    },
+    "moduleSetupListActionSelectNode": {
+        "border": "1px solid #333333"
+    }
+
+}

BIN
o2web/source/x_component_AppMarketV2/$Main/default/icon.png


BIN
o2web/source/x_component_AppMarketV2/$Main/default/icon/add.png


BIN
o2web/source/x_component_AppMarketV2/$Main/default/icon/add_over.png


BIN
o2web/source/x_component_AppMarketV2/$Main/default/icon/blackfiveangular.png


BIN
o2web/source/x_component_AppMarketV2/$Main/default/icon/conflict.png


BIN
o2web/source/x_component_AppMarketV2/$Main/default/icon/default.png


BIN
o2web/source/x_component_AppMarketV2/$Main/default/icon/default2.png


BIN
o2web/source/x_component_AppMarketV2/$Main/default/icon/flag.png


BIN
o2web/source/x_component_AppMarketV2/$Main/default/icon/halffiveangular.png


BIN
o2web/source/x_component_AppMarketV2/$Main/default/icon/loading.gif


BIN
o2web/source/x_component_AppMarketV2/$Main/default/icon/logo1.png


BIN
o2web/source/x_component_AppMarketV2/$Main/default/icon/whitefiveangular.png


+ 21 - 0
o2web/source/x_component_AppMarketV2/$Main/default/recommendContent.html

@@ -0,0 +1,21 @@
+    <div class="o2_appmarket_recommend_in" data-o2-element="topRecommendContent">
+        <div class="o2_appmarket_recommendLeft" data-o2-element="leftCoverNode">
+            <div class="o2_appmarket_recommendBiggestPic" data-o2-element="recommendBiggestPic"></div>
+            <div class="o2_appmarket_recommendBiggestMask"></div>            
+            <div class="o2_appmarket_recommendBiggestTitle" data-o2-element="recommendBiggestTitle"></div>
+        </div>
+        <div class="o2_appmarket_recommendRight" data-o2-element="rightCoverNode">
+            <div class="o2_appmarket_recommendRightTop" data-o2-element="rightTopCoverNode">
+                <div class="o2_appmarket_recommendRightTopPic" data-o2-element="recommendRightTopPic"></div>
+                <div class="o2_appmarket_recommendRightTopMask"></div>
+                <div class="o2_appmarket_recommendRightTitle" data-o2-element="recommendRightTopTitle"></div>
+            </div>
+            <div style="clear:both;"></div>
+            <div class="o2_appmarket_recommendRightBottom" data-o2-element="rightBottomCoverNode">
+                <div class="o2_appmarket_recommendRightBottomPic" data-o2-element="recommendRightBottomPic"></div>
+                <div class="o2_appmarket_recommendRightBottomMask"></div>
+                <div class="o2_appmarket_recommendRightTitle" data-o2-element="recommendRightBottomTitle"></div>
+            </div>
+        </div>
+    </div>
+

+ 327 - 0
o2web/source/x_component_AppMarketV2/$Main/default/style.css

@@ -0,0 +1,327 @@
+.o2_appmarket_content {
+    margin: 40px 20px 0px 40px;
+    width:100%;
+    min-width: 1280px;
+    min-height: 700px;
+    font-size: 14px;
+    overflow: auto;
+}
+
+.o2_appmarket_recommend {
+    min-width: 1280px;
+    min-height: 320px;
+    height: 40%;
+}
+.o2_appmarket_recommend_in{
+    height:100%;
+}
+.o2_appmarket_app {
+    min-width: 1280px;
+    min-height: 380px;
+    height: 55%;
+}
+.o2_appmarket_recommendLeft {
+    float: left;
+    width:65%;
+    height:100%;
+    border-radius:16px;
+    border:1px solid rgba(151,151,151,1);
+    margin:0px 10px 0px 0px;
+    position:relative;
+    cursor: pointer;
+}
+
+.o2_appmarket_recommendBiggestPic{
+    width:100%;
+    height:100%;
+    border-radius:16px;
+    border:1px solid rgba(151,151,151,1);
+    position:absolute;
+    left:0px;
+    top:0px;
+    background-size:cover;
+
+}
+.o2_appmarket_recommendBiggestMask{
+    width:100%;
+    height:100%;
+    background:linear-gradient(180deg,rgba(0,0,0,0) 0%,rgba(0,0,0,0.5) 100%);
+    border-radius:16px;
+    position:absolute;
+    left:0px;
+    top:0px;
+}
+
+.o2_appmarket_recommendBiggestTitle{
+    width:100%;
+    height:31px;
+    font-size:24px;
+    font-family:MicrosoftYaHei;
+    color:rgba(255,255,255,1);
+    line-height:31px;
+    position:absolute;
+    text-align: center;
+    top:90%;
+}
+
+.o2_appmarket_recommendRight {
+    float: left;
+    height: 100%;
+    width: 35%;
+    margin-right:40px;
+}
+.o2_appmarket_recommendRightTop {
+    height: 49%;
+    position: relative;
+    cursor: pointer;
+}
+
+.o2_appmarket_recommendRightTopPic{
+    width:100%;
+    height:100%;
+    border-radius:16px;
+    border:1px solid rgba(151,151,151,1);
+    position:absolute;
+    left:0px;
+    top:0px;
+    background-size:cover;
+
+}
+.o2_appmarket_recommendRightTopMask{
+    width:100%;
+    height:100%;
+    background:linear-gradient(180deg,rgba(0,0,0,0) 0%,rgba(0,0,0,0.5) 100%);
+    border-radius:16px;    
+    position:absolute;
+    left:0px;
+    top:0px;
+}
+
+.o2_appmarket_recommendRightTitle{
+    width:100%;
+    height:31px;
+    font-size:24px;
+    font-family:MicrosoftYaHei;
+    color:rgba(255,255,255,1);
+    line-height:31px;   
+    position:absolute;
+    text-align:center;
+    top:82%; 
+}
+
+.o2_appmarket_recommendRightBottom {
+    height: 49%;
+    margin-top:10px;
+    position: relative;
+    cursor: pointer;
+}
+
+.o2_appmarket_recommendRightBottomPic{
+    width:100%;
+    height:100%;
+    border-radius:16px;
+    border:1px solid rgba(151,151,151,1);
+    position:absolute;
+    left:0px;
+    top:0px;
+    background-size:cover;
+}
+.o2_appmarket_recommendRightBottomMask{
+    width:100%;
+    height:100%;
+    background:linear-gradient(180deg,rgba(0,0,0,0) 0%,rgba(0,0,0,0.5) 100%);
+    border-radius:16px;  
+    position:absolute;
+    left:0px;
+    top:0px;  
+}
+
+.o2_appmarket_appcategorys{
+    text-align:center;
+    margin-top:60px;
+    margin-bottom:40px;
+    display: flex;
+    justify-content: center;
+}
+.o2_appmarket_appcategory_current{
+    color: #4A90E2;
+    border-color: #4A90E2;
+    cursor: pointer;
+    width:80px;
+    height:26px;
+    font-size:20px;
+    font-family:MicrosoftYaHei;
+    line-height:26px;
+    margin:40px 20px 40px 20px;
+}
+
+.o2_appmarket_appcategory_tab_over {
+    border-bottom: 1px solid rgba(151,151,151,1);
+}
+
+.o2_appmarket_appcategory{    
+    width:80px;
+    height:26px;
+    font-size:20px;
+    font-family:MicrosoftYaHei;
+    color:rgba(51,51,51,1);
+    line-height:26px;
+    margin:40px 20px 40px 20px;
+    cursor: pointer;
+}
+.o2_appmarket_app_search_box{
+    height: 28px;
+    width: 268px;
+    border-radius: 20px;
+    border: 1px solid #DDDDDD;
+}
+.o2_appmarket_app_search_box_icon{
+    float: right;
+    height: 28px;
+    width: 36px;
+    background-position: center;
+    background-repeat: no-repeat;
+    cursor: pointer;
+}
+.o2_appmarket_app_icon_search{
+    background-image: url(../o2_core/o2/xDesktop/$Default/blue/icons/icon_sousuo.png) !important;
+}
+
+.o2_appmarket_app_icon_clear{
+    background-image: url(../o2_core/o2/xDesktop/$Default/blue/icons/icon_clear.png) !important;
+}
+
+.o2_appmarket_app_area_search_clear{
+    float: right;
+    height: 28px;
+    width: 16px;
+    background-image: none;
+    background-position: center;
+    background-repeat: no-repeat;
+}
+.o2_appmarket_app_search_inputArea{
+    height: 28px;
+    border-radius: 20px;
+    padding: 0 10px;
+    margin-right: 52px;
+}
+
+.o2_appmarket_app_searchinput{
+    height: 26px;
+    width: 99%;
+    line-height: 26px;
+    border: 0;
+    border-radius: 20px;
+    float: left;
+}
+.o2_appmarket_applist{
+    min-width: 1280px;
+    min-height: 380px;
+    height: 60%;
+}
+.o2_appmarket_appcategory_count{
+    height:28px;
+    font-size:18px;
+    font-family:MicrosoftYaHei;
+    color:rgba(74,144,226,1);
+    line-height:24px;
+    margin:20px 80px 20px 0px;
+    float:right;
+}
+.o2_appmarket_application{
+    width:285px;
+    height:555px;
+    background:rgba(255,255,255,1);
+    box-shadow:0px 0px 8px 0px rgba(0,0,0,0.25);
+    border-radius:16px;
+    float:left;
+    margin-bottom:30px;
+    cursor: pointer; 
+
+}
+.o2_appmarket_application_icon{
+    height:70%;
+    border-top-left-radius: 16px;
+    border-top-right-radius: 16px;
+    background-size:cover;
+}
+.o2_appmarket_application_info{
+    height:30%;
+    width:90%;
+    margin:20px 20px auto 20px;
+}
+.o2_appmarket_application_info_name{
+    width:100%;
+    height:26px;
+    font-size:20px;
+    font-family:MicrosoftYaHei;
+    color:rgba(51,51,51,1);
+    line-height:26px;
+    overflow: hidden;
+    
+}
+.o2_appmarket_application_info_recommend{
+    width:100%;
+    height:24px;
+    font-size:18px;
+    font-family:MicrosoftYaHei;
+    color:rgba(102,102,102,1);
+    line-height:24px;
+    margin-bottom:20px;
+
+}
+.o2_appmarket_application_info_starpic{
+    width:14px;
+    height:13px;
+}
+.o2_appmarket_application_info_category{
+    width:64px;
+    height:19px;
+    font-size:14px;
+    font-family:MicrosoftYaHei;
+    color:rgba(153,153,153,1);
+    line-height:19px;
+}
+.o2_appmarket_application_info_searchinput{
+    height: 26px;
+    line-height: 26px;
+    border: 0;
+    border-radius: 20px;
+    float: left;
+}
+.o2_appmarket_application_info_bottom{
+
+}
+.o2_appmarket_application_info_bottom_free{
+    width:34px;
+    height:24px;
+    font-size:16px;
+    font-family:MicrosoftYaHei;
+    color:rgba(51,51,51,1);
+    line-height:21px;
+    float:left;
+}
+.o2_appmarket_application_info_bottom_button{
+    width:70px;
+    height:24px;
+    background:rgba(74,144,226,1);
+    border-radius:20px;
+    float:right;
+    text-align: center;
+    cursor: pointer;
+}
+.o2_appmarket_application_info_bottom_button_text{
+    height:17px;
+    font-size:12px;
+    font-family:MicrosoftYaHei;
+    color:rgba(255,255,255,1);
+    line-height:16px;
+    margin:4px auto 3px auto;
+
+}
+
+.moduleLoading {
+    margin: "auto";
+    width: "100px";
+    z-index:9999999999;
+},

+ 7 - 0
o2web/source/x_component_AppMarketV2/$Main/default/view.html

@@ -0,0 +1,7 @@
+<div class="o2_appmarket_content" data-o2-element="marketnode">
+    <div class="o2_appmarket_recommend" data-o2-element="topRecommendNode">
+    </div>
+    <div style="clear:both;"></div>
+    <div class="o2_appmarket_app" data-o2-element="applicationsNode">
+    </div>
+</div>

+ 331 - 0
o2web/source/x_component_AppMarketV2/ApplicationsContent.js

@@ -0,0 +1,331 @@
+MWF.xApplication.AppMarketV2.ApplicationsContent = new Class({
+    Implements: [Options, Events],
+    options: {
+        "view": "applicationsContent.html"
+    },
+    initialize: function(app, container, options){
+        this.setOptions(options);
+        this.app = app;
+        this.container = container;
+        this.viewPath = this.app.path+this.app.options.style+"/"+this.options.view;
+        debugger;
+        this.querydata = {};
+        this.currentcategory = {"name":"全部","count":0};
+        this.load();
+    },
+    load: function(){
+        debugger;
+        this.container.loadHtml(this.viewPath, {"bind": {"lp": this.app.lp}, "module": this}, function(){
+            this.loadApplication(function(){
+                this.fireEvent("load");
+            }.bind(this));
+        }.bind(this));
+    },    
+
+    loadApplication: function(callback){
+        debugger;
+        if (!this.isLoading){
+            if (!this.applicationsContentV){
+                this.applicationsContentV = new MWF.xApplication.AppMarketV2.ApplicationsContent.Applications(this, {
+                    "onLoad": function(){ if (callback) callback(); }
+                });
+            }else{
+                this.applicationsContentV.load();
+            }
+        }
+    },
+    focusAppSearch: function(){
+        this.searchAppNode.addClass("layout_content_taskbar_area_search_box_focus");
+        this.searchAppNode.addClass("mainColor_border");
+        this.searchAppIconNode.addClass("icon_search_focus");
+    },
+    blurAppSearch: function(){
+        this.searchAppNode.removeClass("layout_content_taskbar_area_search_box_focus");
+        this.searchAppNode.removeClass("mainColor_border");
+        this.searchAppIconNode.removeClass("icon_search_focus");
+    },
+    searchAppInputKeyDown: function(e){
+        if (this.searchAppInputNode.get("value")){
+            this.searchAppClearNode.addClass("icon_clear");
+        }else{
+            this.searchAppClearNode.removeClass("icon_clear");
+        }
+        if (e.keyCode===13) this.doSearch();
+    },
+    clearAppSearch: function(){
+        this.searchAppInputNode.set("value", "");
+        this.searchAppClearNode.removeClass("icon_clear");
+        this.clearSearchResult();
+    },
+    doAppSearch: function(){
+        var key = this.searchAppInputNode.get("value");
+        if (key){
+            this.querydata["name"]=key;  
+            if (!this.applicationsContentV){
+                this.applicationsContentV = new MWF.xApplication.AppMarketV2.ApplicationsContent.Applications(this, {
+                    "onLoad": function(){ if (callback) callback(); }
+                });
+            }else{
+                this.applicationsContentV.load();
+            }
+        }
+    },
+    clearSearchResult: function(){
+        this.querydata["name"]="";  
+        if (!this.applicationsContentV){
+                this.applicationsContentV = new MWF.xApplication.AppMarketV2.ApplicationsContent.Applications(this, {
+                    "onLoad": function(){ if (callback) callback(); }
+                });
+        }else{
+                this.applicationsContentV.load();
+        }
+    }
+});
+
+MWF.xApplication.AppMarketV2.ApplicationsContent.Applications= new Class({
+    Implements: [Options, Events],
+    options: {
+        "type": "applications"
+    },
+    initialize: function(content, options){
+        this.setOptions(options);
+        this.content = content;
+        this.app = this.content.app;
+        this.actions = this.app.actions;
+        this.container = this.content.container;
+        this.page = 1;
+        this.pageSize = 100;
+        this.load();
+        
+    },
+    load: function(){
+        debugger;
+        this.loadAppCategorys();
+        this.loadApplications();
+    },
+    loadAppCategorys: function(){
+        debugger;
+        this.actions.MarketAction.listCategory(function(json){
+            if (json.data && json.data.valueList){
+                this.showCategorys(json.data.valueList);
+            }
+            this.fireEvent("load");
+        }.bind(this));
+    },
+    loadApplications: function(){
+        debugger;
+        this.emptyLoadContent();
+        this.actions.MarketAction.listPaging(this.page, this.pageSize, this.content.querydata,function(json){
+            if (json.data && json.data.length){
+                debugger;
+                this.content.currentcategory["name"] = this.content.querydata.category==""||!(this.content.querydata.category)?"全部":this.content.querydata.category;
+                this.content.currentcategory["count"] = json.count;
+                this.showApplications(json.data);
+            }
+            this.fireEvent("load");
+        }.bind(this));
+    },
+    reload: function(){
+        if (!this.content.isLoading) {
+            this.loadAppCategorys();
+            this.loadApplications();
+        }
+    },
+    emptyLoadContent: function(){
+        this.content.appList.empty();
+        //this.container.removeClass("o2_homepage_area_content_loading").removeClass("icon_loading");
+        //this.content.noItemNode = new Element("div.o2_appMarket_content_empty_node", {"text": this.app.lp.noRecommend}).inject(this.container);
+        //var m = (this.content.contentHeight- this.content.noItemNode.getSize().y)/2;
+        //this.content.noItemNode.setStyle("margin-top", ""+m+"px");
+
+        this.content.isLoading = false;
+    },
+    showCategorys:function(data){
+        debugger;
+        var categorysdiv = this.content.appCategory;
+        categorysdiv.empty();
+        this.loadCertainCategory(categorysdiv,"全部")
+        data.each(function(d,i){
+            this.loadCertainCategory(categorysdiv,d)
+        }.bind(this))
+
+    },
+    loadCertainCategory:function(categorysdiv,d){
+        debugger;
+        var _self = this;
+        
+        var categorydiv = new Element("span",{"text":d,"class":"o2_appmarket_appcategory"}).inject(categorysdiv);
+        categorydiv.store("data",d);
+        categorydiv.addEvents({
+            "mouseover":function(){
+                debugger;
+                this.addClass("o2_appmarket_appcategory_tab_over");
+            },
+            "mouseout":function(){
+                this.removeClass("o2_appmarket_appcategory_tab_over");
+            },
+            "click":function(e){
+                var d = this.retrieve("data");
+                this.getParent().getElements(".o2_appmarket_appcategory_current").removeClass("mainColor_color").removeClass("o2_appmarket_appcategory_current").addClass("o2_appmarket_appcategory");
+                this.removeClass("o2_appmarket_appcategory").addClass("mainColor_color").addClass("o2_appmarket_appcategory_current");
+                if (d){
+                    if (d=="全部"){
+                        _self.content.querydata["category"]="";                        
+                    }else{
+                        _self.content.querydata["category"]=d;
+                    }
+                    _self.loadApplications();
+                }
+            }
+        })
+    },
+    showApplications: function(data){
+        debugger;
+        //show category count
+        this.content.appCategory_count.empty();
+        new Element("div",{"text":this.content.currentcategory.name+"("+this.content.currentcategory.count+")"}).inject(this.content.appCategory_count);        
+        var appsdiv = this.content.appList;
+        var appsdivwidth= appsdiv.clientWidth-80;
+        //appwidth = (appsdivwidth-200)/7;
+        rowappnum = parseInt(appsdivwidth/285);
+        rowappmargin = (appsdivwidth/285-rowappnum)  * 285  / (rowappnum-1);
+        if (rowappmargin<10){
+            rowappnum = rowappnum -1;
+            rowappmargin = (appsdivwidth/285-rowappnum)  * 285  / (rowappnum-1)
+        }
+        debugger;
+        //appsdiv.setStyle("width","calc("+appwidth+"px)");
+        //appsdiv.setStyle("margin-left","10px");
+        data.each(function(d, i){
+            this.loadCertainApplication(appsdiv, d, i,rowappnum,rowappmargin);
+        }.bind(this));
+    },
+    loadCertainApplication: function(appsdiv, d, i,rowappnum,rowappmargin){
+        debugger;
+        //app 排列 begin
+       var applicationdiv = new Element("div",{"class":"o2_appmarket_application"}).inject(appsdiv);
+ 
+       if ((i+1)%rowappnum!=0){
+            applicationdiv.setStyle("margin-right",rowappmargin+"px");
+       }else{
+            applicationdiv.setStyle("margin-right","40px");
+       }
+       var applicationicon = new Element("div",{"class":"o2_appmarket_application_icon"}).inject(applicationdiv);
+       applicationicon.setStyle("background-image", "url(data:image/png;base64,"+d.icon+")");
+       var applicationinfo = new Element("div",{"class":"o2_appmarket_application_info"}).inject(applicationdiv);
+       var applicationinfo_name = new Element("div",{"text":d.name,"class":"o2_appmarket_application_info_name"}).inject(applicationinfo);
+       //var applicationinfo_recommend = new Element("div",{"text":d.recommend,"class":"o2_appmarket_application_info_recommend"}).inject(applicationinfo);
+       //推荐指数改为显示评星
+       var applicationinfo_star = new Element("div",{"class":"o2_appmarket_application_info_recommend"}).inject(applicationinfo);
+       var grade = d.grade;
+	   var intgrade = parseInt(grade);
+	   var dotgrade = grade - intgrade;
+	   for (var tmpnum=0;tmpnum<intgrade;tmpnum++){
+			new Element("img",{"src":this.app.iconPath+"blackfiveangular.png","class":"o2_appmarket_application_info_starpic"}).inject(applicationinfo_star)
+	   }
+	  if (dotgrade>=0.5){
+			new Element("img",{"src":this.app.iconPath+"halffiveangular.png","class":"o2_appmarket_application_info_starpic"}).inject(applicationinfo_star);
+			intgrade++;
+	   }
+	   for (var tmpnum=0;tmpnum<5-intgrade;tmpnum++){
+			new Element("img",{"src":this.app.iconPath+"whitefiveangular.png","class":"o2_appmarket_application_info_starpic"}).inject(applicationinfo_star);
+		}
+       var applicationinfo_category = new Element("div",{"text":d.category,"class":"o2_appmarket_application_info_category"}).inject(applicationinfo);
+       var applicationinfo_bottom = new Element("div",{"class":"o2_appmarket_application_info_bottom"}).inject(applicationinfo);
+       var applicationinfo_bottom_free = new Element("div",{"text":d.price==0?"Free":d.price+"","class":"o2_appmarket_application_info_bottom_free"}).inject(applicationinfo_bottom);
+       var applicationinfo_bottom_open = new Element("div",{"class":"o2_appmarket_application_info_bottom_button mainColor_bg"}).inject(applicationinfo_bottom);
+       var bottomtext =this.app.lp.setup;
+       if (d.installedVersion && d.installedVersion!=""){
+           if (d.installedVersion==d.version){
+                bottomtext = this.app.lp.setupDone;
+           }else{
+                bottomtext = this.app.lp.update;
+           }
+       }
+       var applicationinfo_bottom_open_text = new Element("div",{"text":bottomtext,"class":"o2_appmarket_application_info_bottom_button_text"}).inject(applicationinfo_bottom_open);
+        var _self = this;
+        applicationicon.store("data", d);
+        applicationicon.addEvents({
+            "mouseover": function(){
+            },
+            "mouseout": function(){
+            },
+            "click": function(e){
+                var d = this.retrieve("data");
+                if (d) {
+                    _self.open(e, d);
+                }
+            }
+        })
+
+        applicationinfo_bottom_open.store("data",d);
+        applicationinfo_bottom_open.addEvents({
+            "click":function(e){
+                var d = this.retrieve("data");
+                if (d){
+                    _self.installapp(e,d);
+                }
+            }
+        })
+    },
+    installapp:function(e,d){
+            var p = e.target.getPosition();
+            var tmpe = {"event": {"x": p.x+40, "y": p.y}};
+            var confirmtitle = d.installedVersion==""?this.app.lp.confirmsetupTitle:this.app.lp.confirmupdateTitle;
+            var confirmcontent = d.installedVersion==""?this.app.lp.confirmsetupContent:this.app.lp.confirmupdateContent;
+            var _self = this;
+            MWF.xDesktop.confirm("warn", tmpe, confirmtitle, confirmcontent, 300, 120, function(){
+                _self.app.mask();
+                //this.createLoading(this.container,true);  
+                //alert("after createLoading")          
+                _self.actions.MarketAction.installOrUpdate(
+                    d.id,
+                function( json ){ 
+                    data = json.data; 
+                    _self.app.notice(d.name+" "+_self.app.lp.setupSuccess, "success");
+                    _self.app.unmask();
+                    //this.clearLoading()
+                }.bind(_self),
+                function( json ){ 
+                    data = json.data; 
+                    debugger;
+                    _self.app.unmask();
+                    //this.clearLoading()
+                }.bind(_self),
+                    true
+                );
+                this.close();
+            }, function(){
+                this.close();
+            }, null, null, "o2");        
+    },
+    open: function(e, d){
+        var apppar = {};
+        apppar["appid"] = d.id;
+        layout.openApplication(e, "AppMarketV2.Application", apppar);
+    },
+    createLoading: function(node,mask){
+        debugger;
+        //alert("createloading")
+        this.app.content.mask({
+            "destroyOnHide": true,
+			"style": {
+				"opacity": 0.7,
+				"background-color": "#999"
+            },
+            "loading": true
+            
+		});
+        //if (mask) this.mask.loadNode(node);
+    },
+    clearLoading: function(){
+        /*
+        if (this.loadingAreaNode){
+            this.loadingAreaNode.destroy();
+            this.loadingAreaNode = null;
+        }
+        */
+       this.app.content.unmask();
+       // this.dlg.button.setStyle("display", "block");
+    }
+});

+ 89 - 0
o2web/source/x_component_AppMarketV2/Main.js

@@ -0,0 +1,89 @@
+MWF.require("MWF.widget.MaskNode", null, false);
+o2.requireApp("AppMarketV2", "RecommendContent", null, false);
+MWF.xApplication.AppMarketV2.Main = new Class({
+    Extends: MWF.xApplication.Common.Main,
+    Implements: [Options, Events],
+    options: {
+        "style": "default",
+        "mvcStyle": "style.css",
+        "name": "AppMarketV2",
+        "icon": "icon.png",
+        "width": "1000",
+        "height": "700",
+        "isResize": true,
+		"isMax": true,
+        "title": MWF.xApplication.AppMarketV2.LP.title,
+        "minHeight": 700
+    },
+    onQueryLoad: function(){
+        this.lp = MWF.xApplication.AppMarketV2.LP;
+        this.actions = MWF.Actions.load("x_program_center");
+		this.viewPath = this.path+this.options.style+"/view.html";
+		this.iconPath = this.path+this.options.style+"/icon/";
+	},
+	mask: function(){
+        if (!this.maskNode){
+            this.maskNode = new MWF.widget.MaskNode(this.marketnode, {"style": "bam"});
+            this.maskNode.load();
+        }
+    },
+    unmask: function(){
+        if (this.maskNode) this.maskNode.hide(function(){
+            MWF.release(this.maskNode);
+            this.maskNode = null;
+        }.bind(this));
+    },
+    loadApplication: function(callback){
+		this.content.loadHtml(this.viewPath, {"bind": {"lp": this.lp}, "module": this}, function(){
+			if (!this.options.isRefresh){
+				this.maxSize(function(){
+					this.loadApp(callback);
+				}.bind(this));
+			}else{
+				this.loadApp(callback);
+			}
+		}.bind(this));
+	},
+	loadApp: function(callback){
+		//this.initNode();
+		this.initNodeSize();
+
+		this.recommondLoaded = false;
+		this.applicationsLoaded = true;
+
+		this.loadRecommondContent(function(){ this.recommondLoaded = true; this.checkAppLoaded(callback); }.bind(this));
+		this.loadApplicationsContent(function(){ this.applicationsLoaded = true; this.checkAppLoaded(callback); }.bind(this));
+	},
+	checkAppLoaded: function(callback){
+		if (this.recommondLoaded && this.applicationsLoaded){
+			if (callback) callback();
+		}
+	},
+	initNodeSize: function(){
+		this.resizeNodeSize();
+		this.addEvent("resize", this.resizeNodeSize.bind(this));
+	},
+	resizeNodeSize: function(){
+		var size = this.content.getSize();
+		var edge = this.marketnode.getEdgeHeight();
+		var height = size.y - edge;
+		if (height<this.options.minHeight) height = this.options.minHeight;
+		this.marketnode.setStyle("height", ""+height+"px");
+	},
+	loadRecommondContent: function(callback){
+		debugger;
+		this.recommendContent = new MWF.xApplication.AppMarketV2.RecommendContent(this, this.topRecommendNode, {
+			"onLoad": function(){if (callback) callback();}
+		});
+	},
+
+	loadApplicationsContent: function(callback){
+		
+		o2.requireApp("AppMarketV2", "ApplicationsContent", function(){
+			this.applicationsContent = new MWF.xApplication.AppMarketV2.ApplicationsContent(this, this.applicationsNode, {
+				"onLoad": function(){if (callback) callback();}
+			});
+		}.bind(this));
+		
+	}
+});

+ 146 - 0
o2web/source/x_component_AppMarketV2/RecommendContent.js

@@ -0,0 +1,146 @@
+MWF.xApplication.AppMarketV2.RecommendContent = new Class({
+    Implements: [Options, Events],
+    options: {
+        "view": "recommendContent.html"
+    },
+    initialize: function(app, container, options){
+        this.setOptions(options);
+        this.app = app;
+        this.container = container;
+        this.viewPath = this.app.path+this.app.options.style+"/"+this.options.view;
+        debugger;
+        this.load();
+    },
+    load: function(){
+        debugger;
+        this.container.loadHtml(this.viewPath, {"bind": {"lp": this.app.lp}, "module": this}, function(){
+            this.loadRecommend(function(){
+                this.fireEvent("load");
+            }.bind(this));
+        }.bind(this));
+    },    
+
+    loadRecommend: function(callback){
+        debugger;
+        if (!this.isLoading){
+            if (!this.topRecommendContentV){
+                this.topRecommendContentV = new MWF.xApplication.AppMarketV2.RecommendContent.Recommend(this, {
+                    "onLoad": function(){ if (callback) callback(); }
+                });
+            }else{
+                this.topRecommendContentV.load();
+            }
+        }
+    }
+});
+
+MWF.xApplication.AppMarketV2.RecommendContent.Recommend= new Class({
+    Implements: [Options, Events],
+    options: {
+        "type": "recommend"
+    },
+    initialize: function(content, options){
+        this.setOptions(options);
+        this.content = content;
+        this.app = this.content.app;
+        this.actions = this.app.actions;
+        this.container = this.content.container;
+        this.page = 1;
+        this.pageSize = 3;
+        this.querydata = {"orderBy":"recommend","isAsc":"true"};
+        this.load();
+        
+    },
+    load: function(){
+        debugger;
+        this.loadItemsRes();
+    },
+    loadItemsRes: function(){
+        debugger;
+        this.actions.MarketAction.listPaging(this.page, this.pageSize, this.querydata,function(json){
+            if (json.data && json.data.length){
+                this.loadItems(json.data);
+            }else{
+                this.emptyLoadContent();
+            }
+            this.fireEvent("load");
+        }.bind(this));
+    },
+    reload: function(){
+        if (!this.content.isLoading) {
+            this.loadItemsRes();
+        }
+    },
+    emptyLoadContent: function(){
+        this.container.empty();
+        this.container.removeClass("o2_homepage_area_content_loading").removeClass("icon_loading");
+        //this.itemContentNode.addClass("o2_homepage_task_area_content_empty").addClass("icon_notask");
+        this.content.noItemNode = new Element("div.o2_appMarket_content_empty_node", {"text": this.app.lp.noRecommend}).inject(this.container);
+        var m = (this.content.contentHeight- this.content.noItemNode.getSize().y)/2;
+        this.content.noItemNode.setStyle("margin-top", ""+m+"px");
+
+        this.content.isLoading = false;
+    },
+    loadItems: function(data){
+        debugger;
+        var recommendWidth = this.content.topRecommendContent.clientWidth;
+        var recommendLeftWidth = (recommendWidth - 80-10)*0.65;
+        var recommendRightWidth = (recommendWidth - 80-10)*0.35;
+        this.content.leftCoverNode.setStyle("width",recommendLeftWidth+"px");
+        this.content.rightCoverNode.setStyle("width",recommendRightWidth+"px");
+        data.each(function(d, i){
+            this.loadItem(d, i);
+        }.bind(this));
+    },
+    loadItem: function(d, i){
+        var app;
+        var apppar;
+        debugger;
+        if (i==0){
+            app = this.content.recommendBiggestPic;
+            apptext = this.content.recommendBiggestTitle;
+            apppar = this.content.leftCoverNode;
+        }
+        if (i==1){
+            app = this.content.recommendRightTopPic;
+            apptext = this.content.recommendRightTopTitle;
+            apppar = this.content.rightTopCoverNode;
+        }
+        if (i==2){
+            app = this.content.recommendRightBottomPic;
+            apptext = this.content.recommendRightBottomTitle;
+            apppar = this.content.rightBottomCoverNode;
+        }
+        //获取对应indexPic图片
+        this.actions.MarketAction.getCoverPic(d.id,function(json){
+            debugger;
+            if (json.data && json.data.value){
+                app.setStyle("background-image", "url(data:image/png;base64,"+json.data.value+")");
+            }
+        }.bind(this));
+        apptext.set("text",d.name);
+       
+
+        var _self = this;
+        apppar.store("data", d);
+        apppar.addEvents({
+            "mouseover": function(){
+            },
+            "mouseout": function(){
+            },
+            "click": function(e){
+                var d = this.retrieve("data");
+                if (d) {
+                    _self.open(e, d);
+                }
+            }
+        })
+    },
+    open: function(e, d){
+        debugger;
+        var apppar = {};
+        apppar["appid"] = d.id;
+        layout.openApplication(e, "AppMarketV2.Application", apppar);
+    },
+
+});

+ 27 - 0
o2web/source/x_component_AppMarketV2/lp/zh-cn.js

@@ -0,0 +1,27 @@
+MWF.xApplication.AppMarketV2.LP = {
+	"title": "应用市场V2",
+    "implodeLocal": "从本地导入",
+    "download": "免费下载",
+    "setupTitle": "即将安装",
+    "ok": "确定",
+    "cancel": "取消",
+
+    "downloadInfor": "即将下载安装以下模块:",
+
+    "setup": "安装",
+    "setupDone":"已安装",
+    "update":"更新",
+    "conflict": "冲突",
+
+    "ignore": "忽略",
+    "create": "新建",
+    "cover": "覆盖",
+    "name": "名称",
+    "id": "ID",
+    "setupSuccess": "应用安装成功!",
+    "localApp": "本地应用",
+    "confirmsetupTitle":"安装提示",
+    "confirmsetupContent":"您确认安装本应用么?",
+    "confirmupdateTitle":"更新提示",
+    "confirmupdateContent":"您确认更新本应用么?如果安装应用后改过本应用,本次更新后会被替换"
+};

BIN
o2web/source/x_component_AppMarketV2_Application/$Main/appicon.png


+ 30 - 0
o2web/source/x_component_AppMarketV2_Application/$Main/default/applicationComment.html

@@ -0,0 +1,30 @@
+<div class="o2_appmarket_application_comment" data-o2-element="commentnode">
+        <div class="o2_appmarket_application_comment_top" data-o2-element="applicationcommenttop">
+                <div class="o2_appmarket_application_comment_top_left" data-o2-element="applicationcommenttop">
+                        <div class="o2_appmarket_application_comment_top_left_grade" data-o2-element="applicationcommenttopgrade"></div>
+                        <div class="o2_appmarket_application_comment_top_left_angular" data-o2-element="applicationcommenttopangular"></div>
+                </div>
+
+                <div class="o2_appmarket_application_comment_top_right" data-o2-element="applicationcommentright">
+                        <div class="o2_appmarket_application_comment_top_right_graderatio" data-o2-element="applicationcommentrightfive"></div>
+                        <div style="clear:both;"></div>
+                        <div class="o2_appmarket_application_comment_top_right_graderatio" data-o2-element="applicationcommentrightfour"></div>
+                        <div style="clear:both;"></div>
+                        <div class="o2_appmarket_application_comment_top_right_graderatio" data-o2-element="applicationcommentrightthree"></div>
+                        <div style="clear:both;"></div>
+                        <div class="o2_appmarket_application_comment_top_right_graderatio" data-o2-element="applicationcommentrighttwo"></div>
+                        <div style="clear:both;"></div>
+                        <div class="o2_appmarket_application_comment_top_right_graderatio" data-o2-element="applicationcommentrightone"></div>
+                        <div style="clear:both;"></div>
+                </div>
+
+        </div>
+        <div style="clear:both;"></div>
+        <div class="o2_appmarket_application_comment_middle" data-o2-element="applicationcommentmiddle">
+                
+        </div>
+        <div style="clear:both;"></div>
+        <div class="o2_appmarket_application_comment_bottom" data-o2-element="applicationcommentbottom">
+                
+        </div>
+</div>

+ 40 - 0
o2web/source/x_component_AppMarketV2_Application/$Main/default/applicationView.html

@@ -0,0 +1,40 @@
+<div class="o2_appmarket_application_introduce" data-o2-element="introducenode">
+        <div class="o2_appmarket_application_introduce_top" data-o2-element="applicationintroducetop">
+                <div class="o2_appmarket_application_introduce_iconcontain" data-o2-element="applicationintroduceiconcontain">
+                </div>
+                <div class="o2_appmarket_application_introduce_memo" data-o2-element="applicationintroducememo">
+                        <div class="o2_appmarket_application_introduce_memo_free" data-o2-element="applicationintroducememofree"></div>
+                        <div class="o2_appmarket_application_introduce_memo_name" data-o2-element="applicationintroducememoname"></div>                        
+                        <div class="o2_appmarket_application_introduce_memo_remark" data-o2-element="applicationintroducememoremark">
+                                <div class="o2_appmarket_application_introduce_memo_remark_inner" data-o2-element="applicationintroducememoremarkgrade"></div>
+                                <div class="o2_appmarket_application_introduce_memo_remark_inner" data-o2-element="applicationintroducememoremarkiconangular"></div>
+                                <div class="o2_appmarket_application_introduce_memo_remark_inner" data-o2-element="applicationintroducememoremarkcommentcount"></div>
+                        </div>
+                        <div class="o2_appmarket_application_introduce_memo_download" data-o2-element="applicationintroducememodownload"></div>
+                        <div class="o2_appmarket_application_introduce_memo_category" data-o2-element="applicationintroducememocategory"></div>
+                        <div class="o2_appmarket_application_introduce_memo_content" data-o2-element="applicationintroducememocontent"></div>                        
+                </div>
+                <div class="o2_appmarket_application_introduce_download" data-o2-element="applicationintroducedownload">
+                        <div class="o2_appmarket_application_introduce_download_price" data-o2-element="applicationintroducedownloadprice"></div>
+                        <div class="o2_appmarket_application_introduce_download_downbtn mainColor_bg" data-o2-element="applicationintroducedownloadbtn">
+                                <div class="o2_appmarket_application_introduce_download_downbtn_text" data-o2-element="applicationintroducedownloadbtntext"></div>
+                        </div>
+                </div>
+        </div>
+        <div style="clear:both;"></div>
+        <div class="o2_appmarket_application_introduce_bottom" data-o2-element="applicationintroducebottom">
+                <div class="o2_appmarket_application_introduce_tabdiv">
+                        <span class="o2_appmarket_application_introduce_tab" data-o2-element="applicationintroducesinfoTab" data-o2-events="click:loadIntroduceInfo;mouseover:tabover;mouseout:tabout">{{$.lp.appInfoTab}}</span>
+                        <span class="o2_appmarket_application_introduce_tab" data-o2-element="applicationintroducedemandTab" data-o2-events="click:loadIntroduceDemand;mouseover:tabover;mouseout:tabout">{{$.lp.appDemandTab}}</span>
+                        <span class="o2_appmarket_application_introduce_tab" data-o2-element="applicationintroducecommentTab" data-o2-events="click:loadIntroduceComment;mouseover:tabover;mouseout:tabout">{{$.lp.appCommentTab}}</span>
+                </div>
+                <div class="o2_appmarket_application_introduce_contentdiv" data-o2-element="applicationintroducecontentdiv">
+                        <div class="o2_appmarket_application_introduce_content" data-o2-element="applicationintroducecontent"></div>
+                        <div class="o2_appmarket_application_introduce_picsdiv" data-o2-element="applicationintroducepicsdiv">
+                                <div class="o2_appmarket_application_introduce_picslable" data-o2-element="applicationintroducepicslable">屏幕截图</div>
+                                <div class="o2_appmarket_application_introduce_pics" data-o2-element="applicationintroducepics"></div>
+                        </div>
+                </div>
+                
+        </div>
+</div>

+ 216 - 0
o2web/source/x_component_AppMarketV2_Application/$Main/default/css.wcss

@@ -0,0 +1,216 @@
+{
+    "titleBar": {
+        "overflow": "hidden",
+        "height": "50px",
+        "background-color": "#4c6b87"
+    },
+    "titleActionNode": {
+        "float": "right",
+        "margin-right": "20px",
+        "height": "26px",
+        "border": "1px solid #ffffff",
+        "border-radius": "5px",
+        "line-height": "26px",
+        "text-align": "center",
+        "padding": "0 20px",
+        "margin-top": "12px",
+        "cursor": "pointer",
+        "color": "#ffffff"
+    },
+    "titleTextNode": {
+        "padding-left": "20px",
+        "color": "#FFF",
+        "font-size": "18px",
+        "line-height": "50px",
+        "font-weight": "bold",
+        "width": "160px",
+        "float": "left"
+    },
+    "contentNode": {
+        "overflow": "auto",
+        "background-color": "#eeeeee"
+    },
+    "contentModuleArea": {
+        "width": "90%",
+        "margin": "20px auto",
+        "overflow": "hidden"
+    },
+
+    "moduleNode": {
+        "width": "160px",
+        "height": "300px",
+        "float": "left",
+        "background-color": "#f5f5f5",
+        "margin": "20px 5px"
+    },
+    "moduleIconNode": {
+        "width": "160px",
+        "height": "160px",
+        "background-image": "url(../x_component_AppMarket/$Main/default/icon/logo1.png)",
+        "background-repeat": "no-repeat",
+        "background-position": "center"
+    },
+    "moduleIconAreaNode": {
+        "width": "160px",
+        "height": "160px",
+        "background-color": "#666666",
+        "overflow": "hidden"
+    },
+
+
+    "moduleContentNode": {
+        "height": "130px",
+        "padding": "5px 0px",
+        "cursor": "pointer"
+    },
+    "moduleNameNode": {
+        "height": "40px",
+        "line-height": "20px",
+        "padding": "0px 10px",
+        "font-size": "16px",
+        "font-weight": "bold",
+        "color": "#333333",
+    },
+    "moduleCategoryNode": {
+        "padding": "5px 10px 0px 10px",
+        "height": "20px",
+        "line-height": "20px",
+        "font-size": "12px",
+        "color": "#333333"
+    },
+    "moduleDescriptionNode": {
+        "height": "36px",
+        "line-height": "18px",
+        "font-size": "12px",
+        "padding": "0px 10px",
+        "color": "#999999"
+    },
+    "moduleActionNode": {
+        "height": "28px",
+        "border": "1px solid #999999",
+        "line-height": "28px",
+        "font-size": "14px",
+        "color": "#ffffff",
+        "background-color": "#4c6b87",
+        "cursor": "pointer",
+        "text-align": "center"
+    },
+    "moduleLoadingAreaNode": {
+        "margin": "auto",
+        "width": "100px"
+    },
+    "moduleLoadingImgNode": {
+        "margin-top": "60px",
+        "margin-bottom": "60px",
+        "width": "100px",
+        "height": "100px",
+        "border": "0px"
+    },
+
+    "moduleSetupContentNode": {
+        "width": "90%",
+        "margin": "auto",
+        "overflow": "hidden"
+    },
+
+    "moduleSetupTitleNode": {
+        "margin-top": "10px",
+        "height": "130px",
+        "background-color": "#ffffff"
+    },
+    "moduleSetupIconAreaNode": {
+        "width": "130px",
+        "height": "130px",
+        "background-color": "#666666",
+        "overflow": "hidden",
+        "float": "left"
+    },
+    "moduleSetupIconNode": {
+        "width": "130px",
+        "height": "130px",
+        "background": "url(../x_component_AppMarket/$Main/default/icon/logo1.png) center center no-repeat"
+    },
+
+    "moduleSetupTitleContentNode": {
+        "margin-left": "140px",
+        "padding-top": "10px",
+        "padding-bottom": "10px",
+        "height": "110px"
+    },
+    "moduleSetupNameNode": {
+        "height": "30px",
+        "line-height": "30px",
+        "font-size": "16px",
+        "font-weight": "bold",
+        "color": "#333333"
+    },
+    "moduleSetupCategoryNode": {
+        "height": "20px",
+        "line-height": "20px",
+        "font-size": "12px",
+        "color": "#777777"
+    },
+    "moduleSetupDescriptionNode": {
+        "height": "40px",
+        "line-height": "20px",
+        "font-size": "12px",
+        "color": "#999999"
+    },
+    "moduleSetupCompareContentNode": {
+        //"border": "1px solid #cccccc",
+        "margin": "10px auto",
+        "overflow": "hidden"
+    },
+    "moduleSetupContentInforNode": {
+        "height": "36px",
+        "line-height": "36px",
+        "color": "#666666",
+        "font-size": "14px",
+        "padding-left": "6px"
+    },
+    "moduleSetupListAreaTitleNode": {
+        "height": "30px",
+        "line-height": "30px",
+        "background-color": "#dddddd",
+        "color": "#333333",
+        "padding-left": "10px",
+        "font-weight": "bold",
+        "font-size": "14px"
+    },
+    "moduleSetupListAreaContentNode": {
+        "min-height": "30px",
+        "background-color": "#ffffff"
+    },
+    "moduleSetupListContentNode": {
+        "height": "36px",
+        "line-height": "36px",
+        "margin": "0px 10px",
+        "font-size": "14px",
+        "color": "#666666",
+        "border-bottom": "1px solid #eeeeee"
+    },
+    moduleSetupListIconNode: {
+        "height": "36px",
+        "float": "left",
+        "width": "36px"
+    },
+    moduleSetupListNameNode: {
+        "height": "36px",
+        "margin-right": "160px",
+        "margin-left": "36px"
+    },
+    moduleSetupListActionNode: {
+        "height": "36px",
+        "float": "right",
+        "width": "60px"
+    },
+    moduleSetupListInforNode: {
+        "height": "36px",
+        "float": "right",
+        "width": "100px"
+    },
+    "moduleSetupListActionSelectNode": {
+        "border": "1px solid #333333"
+    }
+
+}

BIN
o2web/source/x_component_AppMarketV2_Application/$Main/default/icon.png


BIN
o2web/source/x_component_AppMarketV2_Application/$Main/default/icon/bigblackfiveangular.png


BIN
o2web/source/x_component_AppMarketV2_Application/$Main/default/icon/bighalffiveangular.png


BIN
o2web/source/x_component_AppMarketV2_Application/$Main/default/icon/bigwhitefiveangular.png


BIN
o2web/source/x_component_AppMarketV2_Application/$Main/default/icon/blackfiveangular.png


BIN
o2web/source/x_component_AppMarketV2_Application/$Main/default/icon/halffiveangular.png


BIN
o2web/source/x_component_AppMarketV2_Application/$Main/default/icon/icon_men.png


BIN
o2web/source/x_component_AppMarketV2_Application/$Main/default/icon/loading.gif


BIN
o2web/source/x_component_AppMarketV2_Application/$Main/default/icon/logo1.png


BIN
o2web/source/x_component_AppMarketV2_Application/$Main/default/icon/whitefiveangular.png


+ 418 - 0
o2web/source/x_component_AppMarketV2_Application/$Main/default/style.css

@@ -0,0 +1,418 @@
+.o2_appmarket_application_introduce {
+    margin: auto auto;
+    width:100%;
+    min-width: 1280px;
+    min-height: 700px;
+    font-size: 14px;
+    overflow: auto;
+}
+
+.o2_appmarket_application_introduce_top {
+    min-width: 1280px;
+    min-height: 530px;
+    height: 35%;
+    background:rgba(255,255,255,1);
+    border-radius:16px;
+    width:95%;
+    margin:auto auto;
+
+}
+
+.o2_appmarket_application_introduce_iconcontain{
+    width:16%;
+    height:100%;
+    margin:42px 20px 38px 20px;
+    position:relative;
+    float:left;
+}
+.o2_appmarket_application_introduce_icon{
+    width:300px;
+    height:450px;
+    border-radius:16px;    
+    position:absolute;
+    left:0px;
+    top:0px;
+    background-size: cover;
+
+}
+.o2_appmarket_application_introduce_memo{
+    width:60%;
+    height:100%;
+    margin:42px 10px 38px 10px;
+    float:left;
+}
+.o2_appmarket_application_introduce_memo_free{
+    width:34px;
+    height:21px;
+    font-size:16px;
+    font-family:MicrosoftYaHei;
+    color:rgba(74,144,226,1);
+    line-height:21px;    
+}
+.o2_appmarket_application_introduce_memo_name{
+    height:51px;
+    font-size:36px;
+    font-family:MicrosoftYaHei;
+    color:rgba(51,51,51,1);
+    line-height:47px;
+    overflow:hidden;       
+}
+.o2_appmarket_application_introduce_memo_recommend{
+    width:437px;
+    height:51px;
+    font-size:36px;
+    font-family:MicrosoftYaHei;
+    color:rgba(51,51,51,1);
+    line-height:47px;       
+}
+.o2_appmarket_application_introduce_memo_remark{
+    width:90%;
+    height:19px;
+    font-size:14px;
+    font-family:MicrosoftYaHei;
+    color:rgba(102,102,102,1);
+    line-height:19px;        
+}
+.o2_appmarket_application_introduce_memo_category{
+    width:90%;
+    height:19px;
+    font-size:14px;
+    font-family:MicrosoftYaHei;
+    color:rgba(153,153,153,1);
+    line-height:19px;
+    margin-top:40px;
+}
+.o2_appmarket_application_introduce_memo_content{
+    width:870px;
+    height:280px;
+    font-size:18px;
+    font-family:MicrosoftYaHei;
+    color:rgba(51,51,51,1);
+    line-height:30px;
+    overflow: hidden;
+}
+
+.o2_appmarket_application_introduce_memo_remark_inner{
+    float:left;
+    margin:5px 5px;
+}
+
+.o2_appmarket_application_introduce_memo_remark_inner_pic{
+    margin-right:8px;
+    height:19px;
+}
+.o2_appmarket_application_introduce_memo_remark_inner_text{
+    width:22px;
+    height:24px;
+    font-size:18px;
+    font-family:MicrosoftYaHei;
+    color:rgba(102,102,102,1);
+    line-height:24px;   
+    margin-left:8px; 
+}
+.o2_appmarket_application_introduce_download{
+    width:16%;
+    height:100%;
+    margin:42px 10px 38px 10px;
+    float:left;
+}
+.o2_appmarket_application_introduce_download_price{
+    width:88px;
+    height:37px;
+    font-size:28px;
+    font-family:MicrosoftYaHei;
+    color:rgba(74,144,226,1);
+    line-height:37px;
+    margin:0px 0px 20px 20px;  
+}
+.o2_appmarket_application_introduce_download_downbtn{
+    width:240px;
+    height:58px;
+    background:rgba(74,144,226,1);
+    border-radius:30px;
+    text-align: center;      
+}
+.o2_appmarket_application_introduce_download_downbtn_text{
+    width:94px;
+    height:29px;
+    font-size:22px;
+    font-family:MicrosoftYaHei;
+    color:rgba(255,255,255,1);
+    line-height:29px;
+    padding-top:10px;
+    margin:auto auto;        
+}
+.o2_appmarket_application_introduce_download_favbtn{
+    width:240px;
+    height:58px;
+    background:rgba(240,240,240,1);
+    border-radius:30px; 
+    margin-top:58px; 
+    text-align: center;        
+}
+.o2_appmarket_application_introduce_download_favbtn_text{
+    width:143px;
+    height:29px;
+    font-size:22px;
+    font-family:MicrosoftYaHei;
+    color:rgba(102,102,102,1);
+    line-height:29px; 
+    padding-top:10px;
+    margin:auto auto;       
+}
+
+.o2_appmarket_application_introduce_bottom{
+    min-width: 1280px;
+    min-height: 800px;
+    height: 65%;
+    width:70%;
+    margin:auto auto;
+}
+
+.o2_appmarket_application_introduce_tabdiv{
+    height:128px;
+    background:rgba(216,216,216,0); 
+    text-align: center;
+}
+.o2_appmarket_application_introduce_tab_current{
+    color: #4A90E2;
+    border-color: #4A90E2;
+    height:26px;
+    font-size:20px;
+    font-family:MicrosoftYaHei;
+    line-height:26px;
+    margin:40px 20px 40px 20px;
+    cursor: pointer;
+}
+
+.o2_appmarket_appcategory_tab_over {
+    border-bottom: 1px solid rgba(151,151,151,1);
+}
+
+.o2_appmarket_application_introduce_tab{
+    height:26px;
+    font-size:20px;
+    font-family:MicrosoftYaHei;
+    color:rgba(51,51,51,1);;
+    line-height:26px;
+    margin:40px 20px 40px 20px;
+    cursor: pointer;
+}
+.o2_appmarket_application_introduce_tab_current{
+    color:rgba(74,144,226,1);
+}
+.o2_appmarket_application_introduce_contentdiv{
+    width:100%;
+    min-height:672px;
+    background:rgba(216,216,216,0);
+    border-radius:6px; 
+    margin:20px 0px 20px 20px; 
+}
+.o2_appmarket_application_introduce_content{
+    width:100%;
+    height:70%;
+}
+.o2_appmarket_application_introduce_picslable{
+    width:200px;
+    height:30px;
+    font-size:28px;
+    font-family:MicrosoftYaHei-Bold,MicrosoftYaHei;
+    font-weight:bold;
+    color:rgba(51,51,51,1);
+    line-height:29px;
+    margin:50px 0px 30px 0px;
+}
+.o2_appmarket_application_introduce_pics{
+    width:100%;
+    height:10%;
+}
+.o2_appmarket_application_introduce_pic{
+    float:left;
+    width:280px;
+    height:158px;
+    margin:0px 20px 20px 0px;
+    border-radius: 16px;
+}
+
+.o2_appmarket_application_comment_top{
+    width:100%;
+    height:300px;
+}
+
+.o2_appmarket_application_comment_top_left{
+    width:19%;
+    height:230px;
+    float:left;
+    margin-right:1%
+}
+.o2_appmarket_application_comment_top_right{
+    width:80%;
+    float:left;
+    height:230px;
+}
+.o2_appmarket_application_comment_top_left_grade{
+    width:90%;
+    height:183px;
+    font-size:150px;
+    font-family:MicrosoftYaHeiLight;
+    color:rgba(51,51,51,1);
+    line-height:213px;
+    margin:auto auto;
+
+}
+.o2_appmarket_application_comment_top_right_graderatio{
+
+}
+.o2_appmarket_application_comment_top_right_graderatioItem{
+    float:left;
+    margin-top:26px;
+    margin-right:5px;
+}
+.o2_appmarket_application_comment_gradetotal{
+    width:85%;
+    height:14px;
+    border-radius:4px;    
+    background:rgba(216,216,216,1);
+    float:left;
+    margin-top:26px;
+    margin-right:5px;
+}
+.o2_appmarket_application_comment_graderatio{
+    width:740px;
+    height:14px;
+    background:rgba(102,102,102,1);
+    border-radius:30px;
+
+}
+.o2_appmarket_application_comment_middle{
+    height:100px;
+    width:98%;
+}
+.o2_appmarket_application_comment_middle_commentbutton{
+    width:200px;
+    height:50px;
+    background:rgba(230,230,230,1);
+    border-radius:30px;  
+    float:left;  
+    text-align:center;
+    position:relative;
+    cursor: pointer;
+}
+.o2_appmarket_application_comment_middle_commentbutton_InnerSpan{
+    width:144px;
+    height:29px;
+    font-size:20px;
+    font-family:MicrosoftYaHei;
+    color:rgba(102,102,102,1);
+    line-height:29px;
+    left:26px;
+    top:5px;
+    position: absolute;
+}
+.o2_appmarket_application_comment_middle_tip{
+    width:420px;
+    height:21px;
+    font-size:16px;
+    font-family:MicrosoftYaHei;
+    color:rgba(102,102,102,1);
+    line-height:21px;
+}
+
+.o2_appmarket_application_comment_bottom{
+    width:98%;
+}
+.o2_appmarket_application_comment_content{
+    width:98%;
+    height:220px;
+    background:rgba(255,255,255,1);
+    border-radius:16px; 
+    margin-top:20px;
+}
+.o2_appmarket_application_comment_content_right{
+    width:68%;
+    height:220px;
+    float:left;
+    margin-top:10px;
+}
+.o2_appmarket_application_comment_content_left_icon{
+    width: 72px;
+    height:72px;
+    float:left;
+    margin:0px 5px auto 10px;
+}
+.o2_appmarket_application_comment_content_left_name{
+    width:147px;
+    height:24px;
+    font-size:18px;
+    font-family:MicrosoftYaHei;
+    color:rgba(51,51,51,1);
+    line-height:24px;
+    float:left;
+    margin:20px 5px auto 0px;
+
+}
+.o2_appmarket_application_comment_content_left{
+    width:30%;
+    height:220px;
+    float:left;
+    margin-top:10px;
+}
+.o2_appmarket_application_comment_content_title{
+    width:399px;
+    height:26px;
+    font-size:20px;
+    font-family:MicrosoftYaHei;
+    color:rgba(51,51,51,1);
+    line-height:26px;
+
+}
+.o2_appmarket_application_comment_content_text{
+    width:90%;
+    height:58%;
+    font-size:16px;
+    font-family:MicrosoftYaHei;
+    color:rgba(51,51,51,1);
+    line-height:21px;
+    overflow: hidden;
+
+}
+.comment_dlg_title{
+    width:60px;
+    height:20px;
+    font-size:15px;
+    font-family:MicrosoftYaHei;
+    color:rgba(51,51,51,1);
+    line-height:20px;
+    margin: 10px 0px 10px 0px;
+}
+.comment_dlg_png{
+    float:left;
+}
+.comment_dlg_input_div{
+    float:left;
+}
+.comment_dlg_input{
+    width:600px;
+    height:200px;
+    background:rgba(255,255,255,1);
+    border-radius:10px;
+    border:1px solid rgba(222,222,222,1);   
+
+}
+.comment_dlg_star{
+    margin-right: 15px;
+    hwidth:21px;
+    height:20px;
+}
+.comment_dlg_button_ok{
+    width:250px;
+    height:40px;
+    background:rgba(74,144,226,1);
+    border-radius:20px;
+}
+.comment_dlg_button_cancel{
+    width:130px;
+    height:40px;
+    background:rgba(240,240,240,1);
+    border-radius:20px;
+}

+ 456 - 0
o2web/source/x_component_AppMarketV2_Application/$Main/default/viewer.css

@@ -0,0 +1,456 @@
+/*!
+ * Viewer.js v1.3.5
+ * https://fengyuanchen.github.io/viewerjs
+ *
+ * Copyright 2015-present Chen Fengyuan
+ * Released under the MIT license
+ *
+ * Date: 2019-07-04T11:00:13.705Z
+ */
+
+.viewer-zoom-in::before,
+.viewer-zoom-out::before,
+.viewer-one-to-one::before,
+.viewer-reset::before,
+.viewer-prev::before,
+.viewer-play::before,
+.viewer-next::before,
+.viewer-rotate-left::before,
+.viewer-rotate-right::before,
+.viewer-flip-horizontal::before,
+.viewer-flip-vertical::before,
+.viewer-fullscreen::before,
+.viewer-fullscreen-exit::before,
+.viewer-close::before {
+  background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARgAAAAUCAYAAABWOyJDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAQPSURBVHic7Zs/iFxVFMa/0U2UaJGksUgnIVhYxVhpjDbZCBmLdAYECxsRFBTUamcXUiSNncgKQbSxsxH8gzAP3FU2jY0kKKJNiiiIghFlccnP4p3nPCdv3p9778vsLOcHB2bfveeb7955c3jvvNkBIMdxnD64a94GHMfZu3iBcRynN7zAOI7TG15gHCeeNUkr8zaxG2lbYDYsdgMbktBsP03jdQwljSXdtBhLOmtjowC9Mg9L+knSlcD8TNKpSA9lBpK2JF2VdDSR5n5J64m0qli399hNFMUlpshQii5jbXTbHGviB0nLNeNDSd9VO4A2UdB2fp+x0eCnaXxWXGA2X0au/3HgN9P4LFCjIANOJdrLr0zzZ+BEpNYDwKbpnQMeAw4m8HjQtM6Z9qa917zPQwFr3M5KgA6J5rTJCdFZJj9/lyvGhsDvwFNVuV2MhhjrK6b9bFiE+j1r87eBl4HDwCF7/U/k+ofAX5b/EXBv5JoLMuILzf3Ap6Z3EzgdqHMCuF7hcQf4HDgeoHnccncqdK/TvSDWffFXI/exICY/xZyqc6XLWF1UFZna4gJ7q8BsRvgd2/xXpo6P+D9dfT7PpECtA3cnWPM0GXGFZh/wgWltA+cDNC7X+AP4GzjZQe+k5dRxuYPeiuXU7e1qwLpDz7dFjXKRaSwuMLvAlG8zZlG+YmiK1HoFqT7wP2z+4Q45TfEGcMt01xLoNZEBTwRqD4BLpnMLeC1A41UmVxsXgXeBayV/Wx20rpTyrpnWRft7p6O/FdqzGrDukPNtkaMoMo3FBdBSQMOnYBCReyf05s126fU9ytfX98+mY54Kxnp7S9K3kj6U9KYdG0h6UdLbkh7poFXMfUnSOyVvL0h6VtIXHbS6nOP+s/Zm9mvyXW1uuC9ohZ72E9uDmXWLJOB1GxsH+DxPftsB8B6wlGDN02TAkxG6+4D3TWsbeC5CS8CDFce+AW500LhhOW2020TRjK3b21HEmgti9m0RonxbdMZeVzV+/4tF3cBpP7E9mKHNL5q8h5g0eYsCMQz0epq8gQrwMXAgcs0FGXGFRcB9wCemF9PkbYqM/Bas7fxLwNeJPdTdpo4itQti8lPMqTpXuozVRVXPpbHI3KkNTB1NfkL81j2mvhDp91HgV9MKuRIqrykj3WPq4rHyL+axj8/qGPmTqi6F9YDlHOvJU6oYcTsh/TYSzWmTE6JT19CtLTJt32D6CmHe0eQn1O8z5AXgT4sx4Vcu0/EQecMydB8z0hUWkTd2t4CrwNEePqMBcAR4mrBbwyXLPWJa8zrXmmLEhNBmfpkuY2102xxrih+pb+ieAb6vGhuA97UcJ5KR8gZ77K+99xxeYBzH6Q3/Z0fHcXrDC4zjOL3hBcZxnN74F+zlvXFWXF9PAAAAAElFTkSuQmCC');
+  background-repeat: no-repeat;
+  background-size: 280px;
+  color: transparent;
+  display: block;
+  font-size: 0;
+  height: 20px;
+  line-height: 0;
+  width: 20px;
+}
+
+.viewer-zoom-in::before {
+  background-position: 0 0;
+  content: 'Zoom In';
+}
+
+.viewer-zoom-out::before {
+  background-position: -20px 0;
+  content: 'Zoom Out';
+}
+
+.viewer-one-to-one::before {
+  background-position: -40px 0;
+  content: 'One to One';
+}
+
+.viewer-reset::before {
+  background-position: -60px 0;
+  content: 'Reset';
+}
+
+.viewer-prev::before {
+  background-position: -80px 0;
+  content: 'Previous';
+}
+
+.viewer-play::before {
+  background-position: -100px 0;
+  content: 'Play';
+}
+
+.viewer-next::before {
+  background-position: -120px 0;
+  content: 'Next';
+}
+
+.viewer-rotate-left::before {
+  background-position: -140px 0;
+  content: 'Rotate Left';
+}
+
+.viewer-rotate-right::before {
+  background-position: -160px 0;
+  content: 'Rotate Right';
+}
+
+.viewer-flip-horizontal::before {
+  background-position: -180px 0;
+  content: 'Flip Horizontal';
+}
+
+.viewer-flip-vertical::before {
+  background-position: -200px 0;
+  content: 'Flip Vertical';
+}
+
+.viewer-fullscreen::before {
+  background-position: -220px 0;
+  content: 'Enter Full Screen';
+}
+
+.viewer-fullscreen-exit::before {
+  background-position: -240px 0;
+  content: 'Exit Full Screen';
+}
+
+.viewer-close::before {
+  background-position: -260px 0;
+  content: 'Close';
+}
+
+.viewer-container {
+  bottom: 0;
+  direction: ltr;
+  font-size: 0;
+  left: 0;
+  line-height: 0;
+  overflow: hidden;
+  position: absolute;
+  right: 0;
+  -webkit-tap-highlight-color: transparent;
+  top: 0;
+  -ms-touch-action: none;
+  touch-action: none;
+  -webkit-touch-callout: none;
+  -webkit-user-select: none;
+  -moz-user-select: none;
+  -ms-user-select: none;
+  user-select: none;
+}
+
+.viewer-container::-moz-selection,
+.viewer-container *::-moz-selection {
+  background-color: transparent;
+}
+
+.viewer-container::selection,
+.viewer-container *::selection {
+  background-color: transparent;
+}
+
+.viewer-container img {
+  display: block;
+  height: auto;
+  max-height: none !important;
+  max-width: none !important;
+  min-height: 0 !important;
+  min-width: 0 !important;
+  width: 100%;
+}
+
+.viewer-canvas {
+  bottom: 0;
+  left: 0;
+  overflow: hidden;
+  position: absolute;
+  right: 0;
+  top: 0;
+}
+
+.viewer-canvas > img {
+  height: auto;
+  margin: 15px auto;
+  max-width: 90% !important;
+  width: auto;
+}
+
+.viewer-footer {
+  bottom: 0;
+  left: 0;
+  overflow: hidden;
+  position: absolute;
+  right: 0;
+  text-align: center;
+}
+
+.viewer-navbar {
+  background-color: rgba(0, 0, 0, 0.5);
+  overflow: hidden;
+}
+
+.viewer-list {
+  -webkit-box-sizing: content-box;
+  box-sizing: content-box;
+  height: 50px;
+  margin: 0;
+  overflow: hidden;
+  padding: 1px 0;
+}
+
+.viewer-list > li {
+  color: transparent;
+  cursor: pointer;
+  float: left;
+  font-size: 0;
+  height: 50px;
+  line-height: 0;
+  opacity: 0.5;
+  overflow: hidden;
+  -webkit-transition: opacity 0.15s;
+  transition: opacity 0.15s;
+  width: 30px;
+}
+
+.viewer-list > li:hover {
+  opacity: 0.75;
+}
+
+.viewer-list > li + li {
+  margin-left: 1px;
+}
+
+.viewer-list > .viewer-loading {
+  position: relative;
+}
+
+.viewer-list > .viewer-loading::after {
+  border-width: 2px;
+  height: 20px;
+  margin-left: -10px;
+  margin-top: -10px;
+  width: 20px;
+}
+
+.viewer-list > .viewer-active,
+.viewer-list > .viewer-active:hover {
+  opacity: 1;
+}
+
+.viewer-player {
+  background-color: #000;
+  bottom: 0;
+  cursor: none;
+  display: none;
+  left: 0;
+  position: absolute;
+  right: 0;
+  top: 0;
+}
+
+.viewer-player > img {
+  left: 0;
+  position: absolute;
+  top: 0;
+}
+
+.viewer-toolbar > ul {
+  display: inline-block;
+  margin: 0 auto 5px;
+  overflow: hidden;
+  padding: 3px 0;
+}
+
+.viewer-toolbar > ul > li {
+  background-color: rgba(0, 0, 0, 0.5);
+  border-radius: 50%;
+  cursor: pointer;
+  float: left;
+  height: 24px;
+  overflow: hidden;
+  -webkit-transition: background-color 0.15s;
+  transition: background-color 0.15s;
+  width: 24px;
+}
+
+.viewer-toolbar > ul > li:hover {
+  background-color: rgba(0, 0, 0, 0.8);
+}
+
+.viewer-toolbar > ul > li::before {
+  margin: 2px;
+}
+
+.viewer-toolbar > ul > li + li {
+  margin-left: 1px;
+}
+
+.viewer-toolbar > ul > .viewer-small {
+  height: 18px;
+  margin-bottom: 3px;
+  margin-top: 3px;
+  width: 18px;
+}
+
+.viewer-toolbar > ul > .viewer-small::before {
+  margin: -1px;
+}
+
+.viewer-toolbar > ul > .viewer-large {
+  height: 30px;
+  margin-bottom: -3px;
+  margin-top: -3px;
+  width: 30px;
+}
+
+.viewer-toolbar > ul > .viewer-large::before {
+  margin: 5px;
+}
+
+.viewer-tooltip {
+  background-color: rgba(0, 0, 0, 0.8);
+  border-radius: 10px;
+  color: #fff;
+  display: none;
+  font-size: 12px;
+  height: 20px;
+  left: 50%;
+  line-height: 20px;
+  margin-left: -25px;
+  margin-top: -10px;
+  position: absolute;
+  text-align: center;
+  top: 50%;
+  width: 50px;
+}
+
+.viewer-title {
+  color: #ccc;
+  display: inline-block;
+  font-size: 12px;
+  line-height: 1;
+  margin: 0 5% 5px;
+  max-width: 90%;
+  opacity: 0.8;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  -webkit-transition: opacity 0.15s;
+  transition: opacity 0.15s;
+  white-space: nowrap;
+}
+
+.viewer-title:hover {
+  opacity: 1;
+}
+
+.viewer-button {
+  background-color: rgba(0, 0, 0, 0.5);
+  border-radius: 50%;
+  cursor: pointer;
+  height: 80px;
+  overflow: hidden;
+  position: absolute;
+  right: -40px;
+  top: -40px;
+  -webkit-transition: background-color 0.15s;
+  transition: background-color 0.15s;
+  width: 80px;
+}
+
+.viewer-button:focus,
+.viewer-button:hover {
+  background-color: rgba(0, 0, 0, 0.8);
+}
+
+.viewer-button::before {
+  bottom: 15px;
+  left: 15px;
+  position: absolute;
+}
+
+.viewer-fixed {
+  position: fixed;
+}
+
+.viewer-open {
+  overflow: hidden;
+}
+
+.viewer-show {
+  display: block;
+}
+
+.viewer-hide {
+  display: none;
+}
+
+.viewer-backdrop {
+  background-color: rgba(0, 0, 0, 0.5);
+}
+
+.viewer-invisible {
+  visibility: hidden;
+}
+
+.viewer-move {
+  cursor: move;
+  cursor: -webkit-grab;
+  cursor: grab;
+}
+
+.viewer-fade {
+  opacity: 0;
+}
+
+.viewer-in {
+  opacity: 1;
+}
+
+.viewer-transition {
+  -webkit-transition: all 0.3s;
+  transition: all 0.3s;
+}
+
+@-webkit-keyframes viewer-spinner {
+  0% {
+    -webkit-transform: rotate(0deg);
+    transform: rotate(0deg);
+  }
+
+  100% {
+    -webkit-transform: rotate(360deg);
+    transform: rotate(360deg);
+  }
+}
+
+@keyframes viewer-spinner {
+  0% {
+    -webkit-transform: rotate(0deg);
+    transform: rotate(0deg);
+  }
+
+  100% {
+    -webkit-transform: rotate(360deg);
+    transform: rotate(360deg);
+  }
+}
+
+.viewer-loading::after {
+  -webkit-animation: viewer-spinner 1s linear infinite;
+  animation: viewer-spinner 1s linear infinite;
+  border: 4px solid rgba(255, 255, 255, 0.1);
+  border-left-color: rgba(255, 255, 255, 0.5);
+  border-radius: 50%;
+  content: '';
+  display: inline-block;
+  height: 40px;
+  left: 50%;
+  margin-left: -20px;
+  margin-top: -20px;
+  position: absolute;
+  top: 50%;
+  width: 40px;
+  z-index: 1;
+}
+
+@media (max-width: 767px) {
+  .viewer-hide-xs-down {
+    display: none;
+  }
+}
+
+@media (max-width: 991px) {
+  .viewer-hide-sm-down {
+    display: none;
+  }
+}
+
+@media (max-width: 1199px) {
+  .viewer-hide-md-down {
+    display: none;
+  }
+}

+ 3043 - 0
o2web/source/x_component_AppMarketV2_Application/$Main/default/viewer.js

@@ -0,0 +1,3043 @@
+/*!
+ * Viewer.js v1.3.5
+ * https://fengyuanchen.github.io/viewerjs
+ *
+ * Copyright 2015-present Chen Fengyuan
+ * Released under the MIT license
+ *
+ * Date: 2019-07-04T11:00:16.790Z
+ */
+
+(function (global, factory) {
+  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
+  typeof define === 'function' && define.amd ? define(factory) :
+  (global = global || self, global.Viewer = factory());
+}(this, function () { 'use strict';
+
+  function _typeof(obj) {
+    if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
+      _typeof = function (obj) {
+        return typeof obj;
+      };
+    } else {
+      _typeof = function (obj) {
+        return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
+      };
+    }
+
+    return _typeof(obj);
+  }
+
+  function _classCallCheck(instance, Constructor) {
+    if (!(instance instanceof Constructor)) {
+      throw new TypeError("Cannot call a class as a function");
+    }
+  }
+
+  function _defineProperties(target, props) {
+    for (var i = 0; i < props.length; i++) {
+      var descriptor = props[i];
+      descriptor.enumerable = descriptor.enumerable || false;
+      descriptor.configurable = true;
+      if ("value" in descriptor) descriptor.writable = true;
+      Object.defineProperty(target, descriptor.key, descriptor);
+    }
+  }
+
+  function _createClass(Constructor, protoProps, staticProps) {
+    if (protoProps) _defineProperties(Constructor.prototype, protoProps);
+    if (staticProps) _defineProperties(Constructor, staticProps);
+    return Constructor;
+  }
+
+  var DEFAULTS = {
+    /**
+     * Enable a modal backdrop, specify `static` for a backdrop
+     * which doesn't close the modal on click.
+     * @type {boolean}
+     */
+    backdrop: true,
+
+    /**
+     * Show the button on the top-right of the viewer.
+     * @type {boolean}
+     */
+    button: true,
+
+    /**
+     * Show the navbar.
+     * @type {boolean | number}
+     */
+    navbar: true,
+
+    /**
+     * Specify the visibility and the content of the title.
+     * @type {boolean | number | Function | Array}
+     */
+    title: true,
+
+    /**
+     * Show the toolbar.
+     * @type {boolean | number | Object}
+     */
+    toolbar: true,
+
+    /**
+     * Custom class name(s) to add to the viewer's root element.
+     * @type {string}
+     */
+    className: '',
+
+    /**
+     * Define where to put the viewer in modal mode.
+     * @type {string | Element}
+     */
+    container: 'body',
+
+    /**
+     * Filter the images for viewing. Return true if the image is viewable.
+     * @type {Function}
+     */
+    filter: null,
+
+    /**
+     * Enable to request fullscreen when play.
+     * @type {boolean}
+     */
+    fullscreen: true,
+
+    /**
+     * Define the initial index of image for viewing.
+     * @type {number}
+     */
+    initialViewIndex: 0,
+
+    /**
+     * Enable inline mode.
+     * @type {boolean}
+     */
+    inline: false,
+
+    /**
+     * The amount of time to delay between automatically cycling an image when playing.
+     * @type {number}
+     */
+    interval: 5000,
+
+    /**
+     * Enable keyboard support.
+     * @type {boolean}
+     */
+    keyboard: true,
+
+    /**
+     * Indicate if show a loading spinner when load image or not.
+     * @type {boolean}
+     */
+    loading: true,
+
+    /**
+     * Indicate if enable loop viewing or not.
+     * @type {boolean}
+     */
+    loop: true,
+
+    /**
+     * Min width of the viewer in inline mode.
+     * @type {number}
+     */
+    minWidth: 200,
+
+    /**
+     * Min height of the viewer in inline mode.
+     * @type {number}
+     */
+    minHeight: 100,
+
+    /**
+     * Enable to move the image.
+     * @type {boolean}
+     */
+    movable: true,
+
+    /**
+     * Enable to zoom the image.
+     * @type {boolean}
+     */
+    zoomable: true,
+
+    /**
+     * Enable to rotate the image.
+     * @type {boolean}
+     */
+    rotatable: true,
+
+    /**
+     * Enable to scale the image.
+     * @type {boolean}
+     */
+    scalable: true,
+
+    /**
+     * Indicate if toggle the image size between its natural size
+     * and initial size when double click on the image or not.
+     * @type {boolean}
+     */
+    toggleOnDblclick: true,
+
+    /**
+     * Show the tooltip with image ratio (percentage) when zoom in or zoom out.
+     * @type {boolean}
+     */
+    tooltip: true,
+
+    /**
+     * Enable CSS3 Transition for some special elements.
+     * @type {boolean}
+     */
+    transition: true,
+
+    /**
+     * Define the CSS `z-index` value of viewer in modal mode.
+     * @type {number}
+     */
+    zIndex: 2015,
+
+    /**
+     * Define the CSS `z-index` value of viewer in inline mode.
+     * @type {number}
+     */
+    zIndexInline: 0,
+
+    /**
+     * Define the ratio when zoom the image by wheeling mouse.
+     * @type {number}
+     */
+    zoomRatio: 0.1,
+
+    /**
+     * Define the min ratio of the image when zoom out.
+     * @type {number}
+     */
+    minZoomRatio: 0.01,
+
+    /**
+     * Define the max ratio of the image when zoom in.
+     * @type {number}
+     */
+    maxZoomRatio: 100,
+
+    /**
+     * Define where to get the original image URL for viewing.
+     * @type {string | Function}
+     */
+    url: 'src',
+
+    /**
+     * Event shortcuts.
+     * @type {Function}
+     */
+    ready: null,
+    show: null,
+    shown: null,
+    hide: null,
+    hidden: null,
+    view: null,
+    viewed: null,
+    zoom: null,
+    zoomed: null
+  };
+
+  var TEMPLATE = '<div class="viewer-container" touch-action="none">' + '<div class="viewer-canvas"></div>' + '<div class="viewer-footer">' + '<div class="viewer-title"></div>' + '<div class="viewer-toolbar"></div>' + '<div class="viewer-navbar">' + '<ul class="viewer-list"></ul>' + '</div>' + '</div>' + '<div class="viewer-tooltip"></div>' + '<div role="button" class="viewer-button" data-viewer-action="mix"></div>' + '<div class="viewer-player"></div>' + '</div>';
+
+  var IS_BROWSER = typeof window !== 'undefined';
+  var WINDOW = IS_BROWSER ? window : {};
+  var IS_TOUCH_DEVICE = IS_BROWSER ? 'ontouchstart' in WINDOW.document.documentElement : false;
+  var HAS_POINTER_EVENT = IS_BROWSER ? 'PointerEvent' in WINDOW : false;
+  var NAMESPACE = 'viewer'; // Actions
+
+  var ACTION_MOVE = 'move';
+  var ACTION_SWITCH = 'switch';
+  var ACTION_ZOOM = 'zoom'; // Classes
+
+  var CLASS_ACTIVE = "".concat(NAMESPACE, "-active");
+  var CLASS_CLOSE = "".concat(NAMESPACE, "-close");
+  var CLASS_FADE = "".concat(NAMESPACE, "-fade");
+  var CLASS_FIXED = "".concat(NAMESPACE, "-fixed");
+  var CLASS_FULLSCREEN = "".concat(NAMESPACE, "-fullscreen");
+  var CLASS_FULLSCREEN_EXIT = "".concat(NAMESPACE, "-fullscreen-exit");
+  var CLASS_HIDE = "".concat(NAMESPACE, "-hide");
+  var CLASS_HIDE_MD_DOWN = "".concat(NAMESPACE, "-hide-md-down");
+  var CLASS_HIDE_SM_DOWN = "".concat(NAMESPACE, "-hide-sm-down");
+  var CLASS_HIDE_XS_DOWN = "".concat(NAMESPACE, "-hide-xs-down");
+  var CLASS_IN = "".concat(NAMESPACE, "-in");
+  var CLASS_INVISIBLE = "".concat(NAMESPACE, "-invisible");
+  var CLASS_LOADING = "".concat(NAMESPACE, "-loading");
+  var CLASS_MOVE = "".concat(NAMESPACE, "-move");
+  var CLASS_OPEN = "".concat(NAMESPACE, "-open");
+  var CLASS_SHOW = "".concat(NAMESPACE, "-show");
+  var CLASS_TRANSITION = "".concat(NAMESPACE, "-transition"); // Events
+
+  var EVENT_CLICK = 'click';
+  var EVENT_DBLCLICK = 'dblclick';
+  var EVENT_DRAG_START = 'dragstart';
+  var EVENT_HIDDEN = 'hidden';
+  var EVENT_HIDE = 'hide';
+  var EVENT_KEY_DOWN = 'keydown';
+  var EVENT_LOAD = 'load';
+  var EVENT_TOUCH_START = IS_TOUCH_DEVICE ? 'touchstart' : 'mousedown';
+  var EVENT_TOUCH_MOVE = IS_TOUCH_DEVICE ? 'touchmove' : 'mousemove';
+  var EVENT_TOUCH_END = IS_TOUCH_DEVICE ? 'touchend touchcancel' : 'mouseup';
+  var EVENT_POINTER_DOWN = HAS_POINTER_EVENT ? 'pointerdown' : EVENT_TOUCH_START;
+  var EVENT_POINTER_MOVE = HAS_POINTER_EVENT ? 'pointermove' : EVENT_TOUCH_MOVE;
+  var EVENT_POINTER_UP = HAS_POINTER_EVENT ? 'pointerup pointercancel' : EVENT_TOUCH_END;
+  var EVENT_READY = 'ready';
+  var EVENT_RESIZE = 'resize';
+  var EVENT_SHOW = 'show';
+  var EVENT_SHOWN = 'shown';
+  var EVENT_TRANSITION_END = 'transitionend';
+  var EVENT_VIEW = 'view';
+  var EVENT_VIEWED = 'viewed';
+  var EVENT_WHEEL = 'wheel';
+  var EVENT_ZOOM = 'zoom';
+  var EVENT_ZOOMED = 'zoomed'; // Data keys
+
+  var DATA_ACTION = "".concat(NAMESPACE, "Action"); // RegExps
+
+  var REGEXP_SPACES = /\s\s*/; // Misc
+
+  var BUTTONS = ['zoom-in', 'zoom-out', 'one-to-one', 'reset', 'prev', 'play', 'next', 'rotate-left', 'rotate-right', 'flip-horizontal', 'flip-vertical'];
+
+  /**
+   * Check if the given value is a string.
+   * @param {*} value - The value to check.
+   * @returns {boolean} Returns `true` if the given value is a string, else `false`.
+   */
+
+  function isString(value) {
+    return typeof value === 'string';
+  }
+  /**
+   * Check if the given value is not a number.
+   */
+
+  var isNaN = Number.isNaN || WINDOW.isNaN;
+  /**
+   * Check if the given value is a number.
+   * @param {*} value - The value to check.
+   * @returns {boolean} Returns `true` if the given value is a number, else `false`.
+   */
+
+  function isNumber(value) {
+    return typeof value === 'number' && !isNaN(value);
+  }
+  /**
+   * Check if the given value is undefined.
+   * @param {*} value - The value to check.
+   * @returns {boolean} Returns `true` if the given value is undefined, else `false`.
+   */
+
+  function isUndefined(value) {
+    return typeof value === 'undefined';
+  }
+  /**
+   * Check if the given value is an object.
+   * @param {*} value - The value to check.
+   * @returns {boolean} Returns `true` if the given value is an object, else `false`.
+   */
+
+  function isObject(value) {
+    return _typeof(value) === 'object' && value !== null;
+  }
+  var hasOwnProperty = Object.prototype.hasOwnProperty;
+  /**
+   * Check if the given value is a plain object.
+   * @param {*} value - The value to check.
+   * @returns {boolean} Returns `true` if the given value is a plain object, else `false`.
+   */
+
+  function isPlainObject(value) {
+    if (!isObject(value)) {
+      return false;
+    }
+
+    try {
+      var _constructor = value.constructor;
+      var prototype = _constructor.prototype;
+      return _constructor && prototype && hasOwnProperty.call(prototype, 'isPrototypeOf');
+    } catch (error) {
+      return false;
+    }
+  }
+  /**
+   * Check if the given value is a function.
+   * @param {*} value - The value to check.
+   * @returns {boolean} Returns `true` if the given value is a function, else `false`.
+   */
+
+  function isFunction(value) {
+    return typeof value === 'function';
+  }
+  /**
+   * Iterate the given data.
+   * @param {*} data - The data to iterate.
+   * @param {Function} callback - The process function for each element.
+   * @returns {*} The original data.
+   */
+
+  function forEach(data, callback) {
+    if (data && isFunction(callback)) {
+      if (Array.isArray(data) || isNumber(data.length)
+      /* array-like */
+      ) {
+          var length = data.length;
+          var i;
+
+          for (i = 0; i < length; i += 1) {
+            if (callback.call(data, data[i], i, data) === false) {
+              break;
+            }
+          }
+        } else if (isObject(data)) {
+        Object.keys(data).forEach(function (key) {
+          callback.call(data, data[key], key, data);
+        });
+      }
+    }
+
+    return data;
+  }
+  /**
+   * Extend the given object.
+   * @param {*} obj - The object to be extended.
+   * @param {*} args - The rest objects which will be merged to the first object.
+   * @returns {Object} The extended object.
+   */
+
+  var assign = Object.assign || function assign(obj) {
+    for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
+      args[_key - 1] = arguments[_key];
+    }
+
+    if (isObject(obj) && args.length > 0) {
+      args.forEach(function (arg) {
+        if (isObject(arg)) {
+          Object.keys(arg).forEach(function (key) {
+            obj[key] = arg[key];
+          });
+        }
+      });
+    }
+
+    return obj;
+  };
+  var REGEXP_SUFFIX = /^(?:width|height|left|top|marginLeft|marginTop)$/;
+  /**
+   * Apply styles to the given element.
+   * @param {Element} element - The target element.
+   * @param {Object} styles - The styles for applying.
+   */
+
+  function setStyle(element, styles) {
+    var style = element.style;
+    forEach(styles, function (value, property) {
+      if (REGEXP_SUFFIX.test(property) && isNumber(value)) {
+        value += 'px';
+      }
+
+      style[property] = value;
+    });
+  }
+  /**
+   * Escape a string for using in HTML.
+   * @param {String} value - The string to escape.
+   * @returns {String} Returns the escaped string.
+   */
+
+  function escapeHTMLEntities(value) {
+    return isString(value) ? value.replace(/&(?!amp;|quot;|#39;|lt;|gt;)/g, '&amp;').replace(/"/g, '&quot;').replace(/'/g, '&#39;').replace(/</g, '&lt;').replace(/>/g, '&gt;') : value;
+  }
+  /**
+   * Check if the given element has a special class.
+   * @param {Element} element - The element to check.
+   * @param {string} value - The class to search.
+   * @returns {boolean} Returns `true` if the special class was found.
+   */
+
+  function hasClass(element, value) {
+    return element.classList ? element.classList.contains(value) : element.className.indexOf(value) > -1;
+  }
+  /**
+   * Add classes to the given element.
+   * @param {Element} element - The target element.
+   * @param {string} value - The classes to be added.
+   */
+
+  function addClass(element, value) {
+    if (!value) {
+      return;
+    }
+
+    if (isNumber(element.length)) {
+      forEach(element, function (elem) {
+        addClass(elem, value);
+      });
+      return;
+    }
+
+    if (element.classList) {
+      element.classList.add(value);
+      return;
+    }
+
+    var className = element.className.trim();
+
+    if (!className) {
+      element.className = value;
+    } else if (className.indexOf(value) < 0) {
+      element.className = "".concat(className, " ").concat(value);
+    }
+  }
+  /**
+   * Remove classes from the given element.
+   * @param {Element} element - The target element.
+   * @param {string} value - The classes to be removed.
+   */
+
+  function removeClass(element, value) {
+    if (!value) {
+      return;
+    }
+
+    if (isNumber(element.length)) {
+      forEach(element, function (elem) {
+        removeClass(elem, value);
+      });
+      return;
+    }
+
+    if (element.classList) {
+      element.classList.remove(value);
+      return;
+    }
+
+    if (element.className.indexOf(value) >= 0) {
+      element.className = element.className.replace(value, '');
+    }
+  }
+  /**
+   * Add or remove classes from the given element.
+   * @param {Element} element - The target element.
+   * @param {string} value - The classes to be toggled.
+   * @param {boolean} added - Add only.
+   */
+
+  function toggleClass(element, value, added) {
+    if (!value) {
+      return;
+    }
+
+    if (isNumber(element.length)) {
+      forEach(element, function (elem) {
+        toggleClass(elem, value, added);
+      });
+      return;
+    } // IE10-11 doesn't support the second parameter of `classList.toggle`
+
+
+    if (added) {
+      addClass(element, value);
+    } else {
+      removeClass(element, value);
+    }
+  }
+  var REGEXP_HYPHENATE = /([a-z\d])([A-Z])/g;
+  /**
+   * Transform the given string from camelCase to kebab-case
+   * @param {string} value - The value to transform.
+   * @returns {string} The transformed value.
+   */
+
+  function hyphenate(value) {
+    return value.replace(REGEXP_HYPHENATE, '$1-$2').toLowerCase();
+  }
+  /**
+   * Get data from the given element.
+   * @param {Element} element - The target element.
+   * @param {string} name - The data key to get.
+   * @returns {string} The data value.
+   */
+
+  function getData(element, name) {
+    if (isObject(element[name])) {
+      return element[name];
+    }
+
+    if (element.dataset) {
+      return element.dataset[name];
+    }
+
+    return element.getAttribute("data-".concat(hyphenate(name)));
+  }
+  /**
+   * Set data to the given element.
+   * @param {Element} element - The target element.
+   * @param {string} name - The data key to set.
+   * @param {string} data - The data value.
+   */
+
+  function setData(element, name, data) {
+    if (isObject(data)) {
+      element[name] = data;
+    } else if (element.dataset) {
+      element.dataset[name] = data;
+    } else {
+      element.setAttribute("data-".concat(hyphenate(name)), data);
+    }
+  }
+
+  var onceSupported = function () {
+    var supported = false;
+
+    if (IS_BROWSER) {
+      var once = false;
+
+      var listener = function listener() {};
+
+      var options = Object.defineProperty({}, 'once', {
+        get: function get() {
+          supported = true;
+          return once;
+        },
+
+        /**
+         * This setter can fix a `TypeError` in strict mode
+         * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Getter_only}
+         * @param {boolean} value - The value to set
+         */
+        set: function set(value) {
+          once = value;
+        }
+      });
+      WINDOW.addEventListener('test', listener, options);
+      WINDOW.removeEventListener('test', listener, options);
+    }
+
+    return supported;
+  }();
+  /**
+   * Remove event listener from the target element.
+   * @param {Element} element - The event target.
+   * @param {string} type - The event type(s).
+   * @param {Function} listener - The event listener.
+   * @param {Object} options - The event options.
+   */
+
+
+  function removeListener(element, type, listener) {
+    var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
+    var handler = listener;
+    type.trim().split(REGEXP_SPACES).forEach(function (event) {
+      if (!onceSupported) {
+        var listeners = element.listeners;
+
+        if (listeners && listeners[event] && listeners[event][listener]) {
+          handler = listeners[event][listener];
+          delete listeners[event][listener];
+
+          if (Object.keys(listeners[event]).length === 0) {
+            delete listeners[event];
+          }
+
+          if (Object.keys(listeners).length === 0) {
+            delete element.listeners;
+          }
+        }
+      }
+
+      element.removeEventListener(event, handler, options);
+    });
+  }
+  /**
+   * Add event listener to the target element.
+   * @param {Element} element - The event target.
+   * @param {string} type - The event type(s).
+   * @param {Function} listener - The event listener.
+   * @param {Object} options - The event options.
+   */
+
+  function addListener(element, type, listener) {
+    var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
+    var _handler = listener;
+    type.trim().split(REGEXP_SPACES).forEach(function (event) {
+      if (options.once && !onceSupported) {
+        var _element$listeners = element.listeners,
+            listeners = _element$listeners === void 0 ? {} : _element$listeners;
+
+        _handler = function handler() {
+          delete listeners[event][listener];
+          element.removeEventListener(event, _handler, options);
+
+          for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
+            args[_key2] = arguments[_key2];
+          }
+
+          listener.apply(element, args);
+        };
+
+        if (!listeners[event]) {
+          listeners[event] = {};
+        }
+
+        if (listeners[event][listener]) {
+          element.removeEventListener(event, listeners[event][listener], options);
+        }
+
+        listeners[event][listener] = _handler;
+        element.listeners = listeners;
+      }
+
+      element.addEventListener(event, _handler, options);
+    });
+  }
+  /**
+   * Dispatch event on the target element.
+   * @param {Element} element - The event target.
+   * @param {string} type - The event type(s).
+   * @param {Object} data - The additional event data.
+   * @returns {boolean} Indicate if the event is default prevented or not.
+   */
+
+  function dispatchEvent(element, type, data) {
+    var event; // Event and CustomEvent on IE9-11 are global objects, not constructors
+
+    if (isFunction(Event) && isFunction(CustomEvent)) {
+      event = new CustomEvent(type, {
+        detail: data,
+        bubbles: true,
+        cancelable: true
+      });
+    } else {
+      event = document.createEvent('CustomEvent');
+      event.initCustomEvent(type, true, true, data);
+    }
+
+    return element.dispatchEvent(event);
+  }
+  /**
+   * Get the offset base on the document.
+   * @param {Element} element - The target element.
+   * @returns {Object} The offset data.
+   */
+
+  function getOffset(element) {
+    var box = element.getBoundingClientRect();
+    return {
+      left: box.left + (window.pageXOffset - document.documentElement.clientLeft),
+      top: box.top + (window.pageYOffset - document.documentElement.clientTop)
+    };
+  }
+  /**
+   * Get transforms base on the given object.
+   * @param {Object} obj - The target object.
+   * @returns {string} A string contains transform values.
+   */
+
+  function getTransforms(_ref) {
+    var rotate = _ref.rotate,
+        scaleX = _ref.scaleX,
+        scaleY = _ref.scaleY,
+        translateX = _ref.translateX,
+        translateY = _ref.translateY;
+    var values = [];
+
+    if (isNumber(translateX) && translateX !== 0) {
+      values.push("translateX(".concat(translateX, "px)"));
+    }
+
+    if (isNumber(translateY) && translateY !== 0) {
+      values.push("translateY(".concat(translateY, "px)"));
+    } // Rotate should come first before scale to match orientation transform
+
+
+    if (isNumber(rotate) && rotate !== 0) {
+      values.push("rotate(".concat(rotate, "deg)"));
+    }
+
+    if (isNumber(scaleX) && scaleX !== 1) {
+      values.push("scaleX(".concat(scaleX, ")"));
+    }
+
+    if (isNumber(scaleY) && scaleY !== 1) {
+      values.push("scaleY(".concat(scaleY, ")"));
+    }
+
+    var transform = values.length ? values.join(' ') : 'none';
+    return {
+      WebkitTransform: transform,
+      msTransform: transform,
+      transform: transform
+    };
+  }
+  /**
+   * Get an image name from an image url.
+   * @param {string} url - The target url.
+   * @example
+   * // picture.jpg
+   * getImageNameFromURL('http://domain.com/path/to/picture.jpg?size=1280×960')
+   * @returns {string} A string contains the image name.
+   */
+
+  function getImageNameFromURL(url) {
+    return isString(url) ? decodeURIComponent(url.replace(/^.*\//, '').replace(/[?&#].*$/, '')) : '';
+  }
+  var IS_SAFARI = WINDOW.navigator && /(Macintosh|iPhone|iPod|iPad).*AppleWebKit/i.test(WINDOW.navigator.userAgent);
+  /**
+   * Get an image's natural sizes.
+   * @param {string} image - The target image.
+   * @param {Function} callback - The callback function.
+   * @returns {HTMLImageElement} The new image.
+   */
+
+  function getImageNaturalSizes(image, callback) {
+    var newImage = document.createElement('img'); // Modern browsers (except Safari)
+
+    if (image.naturalWidth && !IS_SAFARI) {
+      callback(image.naturalWidth, image.naturalHeight);
+      return newImage;
+    }
+
+    var body = document.body || document.documentElement;
+
+    newImage.onload = function () {
+      callback(newImage.width, newImage.height);
+
+      if (!IS_SAFARI) {
+        body.removeChild(newImage);
+      }
+    };
+
+    newImage.src = image.src; // iOS Safari will convert the image automatically
+    // with its orientation once append it into DOM
+
+    if (!IS_SAFARI) {
+      newImage.style.cssText = 'left:0;' + 'max-height:none!important;' + 'max-width:none!important;' + 'min-height:0!important;' + 'min-width:0!important;' + 'opacity:0;' + 'position:absolute;' + 'top:0;' + 'z-index:-1;';
+      body.appendChild(newImage);
+    }
+
+    return newImage;
+  }
+  /**
+   * Get the related class name of a responsive type number.
+   * @param {string} type - The responsive type.
+   * @returns {string} The related class name.
+   */
+
+  function getResponsiveClass(type) {
+    switch (type) {
+      case 2:
+        return CLASS_HIDE_XS_DOWN;
+
+      case 3:
+        return CLASS_HIDE_SM_DOWN;
+
+      case 4:
+        return CLASS_HIDE_MD_DOWN;
+
+      default:
+        return '';
+    }
+  }
+  /**
+   * Get the max ratio of a group of pointers.
+   * @param {string} pointers - The target pointers.
+   * @returns {number} The result ratio.
+   */
+
+  function getMaxZoomRatio(pointers) {
+    var pointers2 = assign({}, pointers);
+    var ratios = [];
+    forEach(pointers, function (pointer, pointerId) {
+      delete pointers2[pointerId];
+      forEach(pointers2, function (pointer2) {
+        var x1 = Math.abs(pointer.startX - pointer2.startX);
+        var y1 = Math.abs(pointer.startY - pointer2.startY);
+        var x2 = Math.abs(pointer.endX - pointer2.endX);
+        var y2 = Math.abs(pointer.endY - pointer2.endY);
+        var z1 = Math.sqrt(x1 * x1 + y1 * y1);
+        var z2 = Math.sqrt(x2 * x2 + y2 * y2);
+        var ratio = (z2 - z1) / z1;
+        ratios.push(ratio);
+      });
+    });
+    ratios.sort(function (a, b) {
+      return Math.abs(a) < Math.abs(b);
+    });
+    return ratios[0];
+  }
+  /**
+   * Get a pointer from an event object.
+   * @param {Object} event - The target event object.
+   * @param {boolean} endOnly - Indicates if only returns the end point coordinate or not.
+   * @returns {Object} The result pointer contains start and/or end point coordinates.
+   */
+
+  function getPointer(_ref2, endOnly) {
+    var pageX = _ref2.pageX,
+        pageY = _ref2.pageY;
+    var end = {
+      endX: pageX,
+      endY: pageY
+    };
+    return endOnly ? end : assign({
+      timeStamp: Date.now(),
+      startX: pageX,
+      startY: pageY
+    }, end);
+  }
+  /**
+   * Get the center point coordinate of a group of pointers.
+   * @param {Object} pointers - The target pointers.
+   * @returns {Object} The center point coordinate.
+   */
+
+  function getPointersCenter(pointers) {
+    var pageX = 0;
+    var pageY = 0;
+    var count = 0;
+    forEach(pointers, function (_ref3) {
+      var startX = _ref3.startX,
+          startY = _ref3.startY;
+      pageX += startX;
+      pageY += startY;
+      count += 1;
+    });
+    pageX /= count;
+    pageY /= count;
+    return {
+      pageX: pageX,
+      pageY: pageY
+    };
+  }
+
+  var render = {
+    render: function render() {
+      this.initContainer();
+      this.initViewer();
+      this.initList();
+      this.renderViewer();
+    },
+    initContainer: function initContainer() {
+      this.containerData = {
+        width: window.innerWidth,
+        height: window.innerHeight
+      };
+    },
+    initViewer: function initViewer() {
+      var options = this.options,
+          parent = this.parent;
+      var viewerData;
+
+      if (options.inline) {
+        viewerData = {
+          width: Math.max(parent.offsetWidth, options.minWidth),
+          height: Math.max(parent.offsetHeight, options.minHeight)
+        };
+        this.parentData = viewerData;
+      }
+
+      if (this.fulled || !viewerData) {
+        viewerData = this.containerData;
+      }
+
+      this.viewerData = assign({}, viewerData);
+    },
+    renderViewer: function renderViewer() {
+      if (this.options.inline && !this.fulled) {
+        setStyle(this.viewer, this.viewerData);
+      }
+    },
+    initList: function initList() {
+      var _this = this;
+
+      var element = this.element,
+          options = this.options,
+          list = this.list;
+      var items = [];
+      forEach(this.images, function (image, index) {
+        var src = image.src;
+        var alt = escapeHTMLEntities(image.alt || getImageNameFromURL(src));
+        var url = options.url;
+
+        if (isString(url)) {
+          url = image.getAttribute(url);
+        } else if (isFunction(url)) {
+          url = url.call(_this, image);
+        }
+
+        if (src || url) {
+          var item = document.createElement('li');
+          var img = document.createElement('img');
+          img.src = src || url;
+          img.alt = alt;
+          img.setAttribute('data-index', index);
+          img.setAttribute('data-original-url', url || src);
+          img.setAttribute('data-viewer-action', 'view');
+          img.setAttribute('role', 'button');
+          item.appendChild(img);
+          list.appendChild(item);
+          items.push(item);
+        }
+      });
+      this.items = items;
+      forEach(items, function (item) {
+        var image = item.firstElementChild;
+        setData(image, 'filled', true);
+
+        if (options.loading) {
+          addClass(item, CLASS_LOADING);
+        }
+
+        addListener(image, EVENT_LOAD, function (event) {
+          if (options.loading) {
+            removeClass(item, CLASS_LOADING);
+          }
+
+          _this.loadImage(event);
+        }, {
+          once: true
+        });
+      });
+
+      if (options.transition) {
+        addListener(element, EVENT_VIEWED, function () {
+          addClass(list, CLASS_TRANSITION);
+        }, {
+          once: true
+        });
+      }
+    },
+    renderList: function renderList(index) {
+      var i = index || this.index;
+      var width = this.items[i].offsetWidth || 30;
+      var outerWidth = width + 1; // 1 pixel of `margin-left` width
+      // Place the active item in the center of the screen
+
+      setStyle(this.list, assign({
+        width: outerWidth * this.length
+      }, getTransforms({
+        translateX: (this.viewerData.width - width) / 2 - outerWidth * i
+      })));
+    },
+    resetList: function resetList() {
+      var list = this.list;
+      list.innerHTML = '';
+      removeClass(list, CLASS_TRANSITION);
+      setStyle(list, getTransforms({
+        translateX: 0
+      }));
+    },
+    initImage: function initImage(done) {
+      var _this2 = this;
+
+      var options = this.options,
+          image = this.image,
+          viewerData = this.viewerData;
+      var footerHeight = this.footer.offsetHeight;
+      var viewerWidth = viewerData.width;
+      var viewerHeight = Math.max(viewerData.height - footerHeight, footerHeight);
+      var oldImageData = this.imageData || {};
+      var sizingImage;
+      this.imageInitializing = {
+        abort: function abort() {
+          sizingImage.onload = null;
+        }
+      };
+      sizingImage = getImageNaturalSizes(image, function (naturalWidth, naturalHeight) {
+        var aspectRatio = naturalWidth / naturalHeight;
+        var width = viewerWidth;
+        var height = viewerHeight;
+        _this2.imageInitializing = false;
+
+        if (viewerHeight * aspectRatio > viewerWidth) {
+          height = viewerWidth / aspectRatio;
+        } else {
+          width = viewerHeight * aspectRatio;
+        }
+
+        width = Math.min(width * 0.9, naturalWidth);
+        height = Math.min(height * 0.9, naturalHeight);
+        var imageData = {
+          naturalWidth: naturalWidth,
+          naturalHeight: naturalHeight,
+          aspectRatio: aspectRatio,
+          ratio: width / naturalWidth,
+          width: width,
+          height: height,
+          left: (viewerWidth - width) / 2,
+          top: (viewerHeight - height) / 2
+        };
+        var initialImageData = assign({}, imageData);
+
+        if (options.rotatable) {
+          imageData.rotate = oldImageData.rotate || 0;
+          initialImageData.rotate = 0;
+        }
+
+        if (options.scalable) {
+          imageData.scaleX = oldImageData.scaleX || 1;
+          imageData.scaleY = oldImageData.scaleY || 1;
+          initialImageData.scaleX = 1;
+          initialImageData.scaleY = 1;
+        }
+
+        _this2.imageData = imageData;
+        _this2.initialImageData = initialImageData;
+
+        if (done) {
+          done();
+        }
+      });
+    },
+    renderImage: function renderImage(done) {
+      var _this3 = this;
+
+      var image = this.image,
+          imageData = this.imageData;
+      setStyle(image, assign({
+        width: imageData.width,
+        height: imageData.height,
+        // XXX: Not to use translateX/Y to avoid image shaking when zooming
+        marginLeft: imageData.left,
+        marginTop: imageData.top
+      }, getTransforms(imageData)));
+
+      if (done) {
+        if ((this.viewing || this.zooming) && this.options.transition) {
+          var onTransitionEnd = function onTransitionEnd() {
+            _this3.imageRendering = false;
+            done();
+          };
+
+          this.imageRendering = {
+            abort: function abort() {
+              removeListener(image, EVENT_TRANSITION_END, onTransitionEnd);
+            }
+          };
+          addListener(image, EVENT_TRANSITION_END, onTransitionEnd, {
+            once: true
+          });
+        } else {
+          done();
+        }
+      }
+    },
+    resetImage: function resetImage() {
+      // this.image only defined after viewed
+      if (this.viewing || this.viewed) {
+        var image = this.image;
+
+        if (this.viewing) {
+          this.viewing.abort();
+        }
+
+        image.parentNode.removeChild(image);
+        this.image = null;
+      }
+    }
+  };
+
+  var events = {
+    bind: function bind() {
+      var options = this.options,
+          viewer = this.viewer,
+          canvas = this.canvas;
+      var document = this.element.ownerDocument;
+      addListener(viewer, EVENT_CLICK, this.onClick = this.click.bind(this));
+      addListener(viewer, EVENT_WHEEL, this.onWheel = this.wheel.bind(this), {
+        passive: false,
+        capture: true
+      });
+      addListener(viewer, EVENT_DRAG_START, this.onDragStart = this.dragstart.bind(this));
+      addListener(canvas, EVENT_POINTER_DOWN, this.onPointerDown = this.pointerdown.bind(this));
+      addListener(document, EVENT_POINTER_MOVE, this.onPointerMove = this.pointermove.bind(this));
+      addListener(document, EVENT_POINTER_UP, this.onPointerUp = this.pointerup.bind(this));
+      addListener(document, EVENT_KEY_DOWN, this.onKeyDown = this.keydown.bind(this));
+      addListener(window, EVENT_RESIZE, this.onResize = this.resize.bind(this));
+
+      if (options.toggleOnDblclick) {
+        addListener(canvas, EVENT_DBLCLICK, this.onDblclick = this.dblclick.bind(this));
+      }
+    },
+    unbind: function unbind() {
+      var options = this.options,
+          viewer = this.viewer,
+          canvas = this.canvas;
+      var document = this.element.ownerDocument;
+      removeListener(viewer, EVENT_CLICK, this.onClick);
+      removeListener(viewer, EVENT_WHEEL, this.onWheel, {
+        passive: false,
+        capture: true
+      });
+      removeListener(viewer, EVENT_DRAG_START, this.onDragStart);
+      removeListener(canvas, EVENT_POINTER_DOWN, this.onPointerDown);
+      removeListener(document, EVENT_POINTER_MOVE, this.onPointerMove);
+      removeListener(document, EVENT_POINTER_UP, this.onPointerUp);
+      removeListener(document, EVENT_KEY_DOWN, this.onKeyDown);
+      removeListener(window, EVENT_RESIZE, this.onResize);
+
+      if (options.toggleOnDblclick) {
+        removeListener(canvas, EVENT_DBLCLICK, this.onDblclick);
+      }
+    }
+  };
+
+  var handlers = {
+    click: function click(event) {
+      var target = event.target;
+      var options = this.options,
+          imageData = this.imageData;
+      var action = getData(target, DATA_ACTION); // Cancel the emulated click when the native click event was triggered.
+
+      if (IS_TOUCH_DEVICE && event.isTrusted && target === this.canvas) {
+        clearTimeout(this.clickCanvasTimeout);
+      }
+
+      switch (action) {
+        case 'mix':
+          if (this.played) {
+            this.stop();
+          } else if (options.inline) {
+            if (this.fulled) {
+              this.exit();
+            } else {
+              this.full();
+            }
+          } else {
+            this.hide();
+          }
+
+          break;
+
+        case 'hide':
+          this.hide();
+          break;
+
+        case 'view':
+          this.view(getData(target, 'index'));
+          break;
+
+        case 'zoom-in':
+          this.zoom(0.1, true);
+          break;
+
+        case 'zoom-out':
+          this.zoom(-0.1, true);
+          break;
+
+        case 'one-to-one':
+          this.toggle();
+          break;
+
+        case 'reset':
+          this.reset();
+          break;
+
+        case 'prev':
+          this.prev(options.loop);
+          break;
+
+        case 'play':
+          this.play(options.fullscreen);
+          break;
+
+        case 'next':
+          this.next(options.loop);
+          break;
+
+        case 'rotate-left':
+          this.rotate(-90);
+          break;
+
+        case 'rotate-right':
+          this.rotate(90);
+          break;
+
+        case 'flip-horizontal':
+          this.scaleX(-imageData.scaleX || -1);
+          break;
+
+        case 'flip-vertical':
+          this.scaleY(-imageData.scaleY || -1);
+          break;
+
+        default:
+          if (this.played) {
+            this.stop();
+          }
+
+      }
+    },
+    dblclick: function dblclick(event) {
+      event.preventDefault();
+
+      if (this.viewed && event.target === this.image) {
+        // Cancel the emulated double click when the native dblclick event was triggered.
+        if (IS_TOUCH_DEVICE && event.isTrusted) {
+          clearTimeout(this.doubleClickImageTimeout);
+        }
+
+        this.toggle();
+      }
+    },
+    load: function load() {
+      var _this = this;
+
+      if (this.timeout) {
+        clearTimeout(this.timeout);
+        this.timeout = false;
+      }
+
+      var element = this.element,
+          options = this.options,
+          image = this.image,
+          index = this.index,
+          viewerData = this.viewerData;
+      removeClass(image, CLASS_INVISIBLE);
+
+      if (options.loading) {
+        removeClass(this.canvas, CLASS_LOADING);
+      }
+
+      image.style.cssText = 'height:0;' + "margin-left:".concat(viewerData.width / 2, "px;") + "margin-top:".concat(viewerData.height / 2, "px;") + 'max-width:none!important;' + 'position:absolute;' + 'width:0;';
+      this.initImage(function () {
+        toggleClass(image, CLASS_MOVE, options.movable);
+        toggleClass(image, CLASS_TRANSITION, options.transition);
+
+        _this.renderImage(function () {
+          _this.viewed = true;
+          _this.viewing = false;
+
+          if (isFunction(options.viewed)) {
+            addListener(element, EVENT_VIEWED, options.viewed, {
+              once: true
+            });
+          }
+
+          dispatchEvent(element, EVENT_VIEWED, {
+            originalImage: _this.images[index],
+            index: index,
+            image: image
+          });
+        });
+      });
+    },
+    loadImage: function loadImage(event) {
+      var image = event.target;
+      var parent = image.parentNode;
+      var parentWidth = parent.offsetWidth || 30;
+      var parentHeight = parent.offsetHeight || 50;
+      var filled = !!getData(image, 'filled');
+      getImageNaturalSizes(image, function (naturalWidth, naturalHeight) {
+        var aspectRatio = naturalWidth / naturalHeight;
+        var width = parentWidth;
+        var height = parentHeight;
+
+        if (parentHeight * aspectRatio > parentWidth) {
+          if (filled) {
+            width = parentHeight * aspectRatio;
+          } else {
+            height = parentWidth / aspectRatio;
+          }
+        } else if (filled) {
+          height = parentWidth / aspectRatio;
+        } else {
+          width = parentHeight * aspectRatio;
+        }
+
+        setStyle(image, assign({
+          width: width,
+          height: height
+        }, getTransforms({
+          translateX: (parentWidth - width) / 2,
+          translateY: (parentHeight - height) / 2
+        })));
+      });
+    },
+    keydown: function keydown(event) {
+      var options = this.options;
+
+      if (!this.fulled || !options.keyboard) {
+        return;
+      }
+
+      switch (event.keyCode || event.which || event.charCode) {
+        // Escape
+        case 27:
+          if (this.played) {
+            this.stop();
+          } else if (options.inline) {
+            if (this.fulled) {
+              this.exit();
+            }
+          } else {
+            this.hide();
+          }
+
+          break;
+        // Space
+
+        case 32:
+          if (this.played) {
+            this.stop();
+          }
+
+          break;
+        // ArrowLeft
+
+        case 37:
+          this.prev(options.loop);
+          break;
+        // ArrowUp
+
+        case 38:
+          // Prevent scroll on Firefox
+          event.preventDefault(); // Zoom in
+
+          this.zoom(options.zoomRatio, true);
+          break;
+        // ArrowRight
+
+        case 39:
+          this.next(options.loop);
+          break;
+        // ArrowDown
+
+        case 40:
+          // Prevent scroll on Firefox
+          event.preventDefault(); // Zoom out
+
+          this.zoom(-options.zoomRatio, true);
+          break;
+        // Ctrl + 0
+
+        case 48: // Fall through
+        // Ctrl + 1
+        // eslint-disable-next-line no-fallthrough
+
+        case 49:
+          if (event.ctrlKey) {
+            event.preventDefault();
+            this.toggle();
+          }
+
+          break;
+
+        default:
+      }
+    },
+    dragstart: function dragstart(event) {
+      if (event.target.tagName.toLowerCase() === 'img') {
+        event.preventDefault();
+      }
+    },
+    pointerdown: function pointerdown(event) {
+      var options = this.options,
+          pointers = this.pointers;
+      var buttons = event.buttons,
+          button = event.button;
+
+      if (!this.viewed || this.showing || this.viewing || this.hiding // No primary button (Usually the left button)
+      // Note that touch events have no `buttons` or `button` property
+      || isNumber(buttons) && buttons !== 1 || isNumber(button) && button !== 0 // Open context menu
+      || event.ctrlKey) {
+        return;
+      } // Prevent default behaviours as page zooming in touch devices.
+
+
+      event.preventDefault();
+
+      if (event.changedTouches) {
+        forEach(event.changedTouches, function (touch) {
+          pointers[touch.identifier] = getPointer(touch);
+        });
+      } else {
+        pointers[event.pointerId || 0] = getPointer(event);
+      }
+
+      var action = options.movable ? ACTION_MOVE : false;
+
+      if (Object.keys(pointers).length > 1) {
+        action = ACTION_ZOOM;
+      } else if ((event.pointerType === 'touch' || event.type === 'touchstart') && this.isSwitchable()) {
+        action = ACTION_SWITCH;
+      }
+
+      if (options.transition && (action === ACTION_MOVE || action === ACTION_ZOOM)) {
+        removeClass(this.image, CLASS_TRANSITION);
+      }
+
+      this.action = action;
+    },
+    pointermove: function pointermove(event) {
+      var pointers = this.pointers,
+          action = this.action;
+
+      if (!this.viewed || !action) {
+        return;
+      }
+
+      event.preventDefault();
+
+      if (event.changedTouches) {
+        forEach(event.changedTouches, function (touch) {
+          assign(pointers[touch.identifier] || {}, getPointer(touch, true));
+        });
+      } else {
+        assign(pointers[event.pointerId || 0] || {}, getPointer(event, true));
+      }
+
+      this.change(event);
+    },
+    pointerup: function pointerup(event) {
+      var _this2 = this;
+
+      var options = this.options,
+          action = this.action,
+          pointers = this.pointers;
+      var pointer;
+
+      if (event.changedTouches) {
+        forEach(event.changedTouches, function (touch) {
+          pointer = pointers[touch.identifier];
+          delete pointers[touch.identifier];
+        });
+      } else {
+        pointer = pointers[event.pointerId || 0];
+        delete pointers[event.pointerId || 0];
+      }
+
+      if (!action) {
+        return;
+      }
+
+      event.preventDefault();
+
+      if (options.transition && (action === ACTION_MOVE || action === ACTION_ZOOM)) {
+        addClass(this.image, CLASS_TRANSITION);
+      }
+
+      this.action = false; // Emulate click and double click in touch devices to support backdrop and image zooming (#210).
+
+      if (IS_TOUCH_DEVICE && action !== ACTION_ZOOM && pointer && Date.now() - pointer.timeStamp < 500) {
+        clearTimeout(this.clickCanvasTimeout);
+        clearTimeout(this.doubleClickImageTimeout);
+
+        if (options.toggleOnDblclick && this.viewed && event.target === this.image) {
+          if (this.imageClicked) {
+            this.imageClicked = false; // This timeout will be cleared later when a native dblclick event is triggering
+
+            this.doubleClickImageTimeout = setTimeout(function () {
+              dispatchEvent(_this2.image, EVENT_DBLCLICK);
+            }, 50);
+          } else {
+            this.imageClicked = true; // The default timing of a double click in Windows is 500 ms
+
+            this.doubleClickImageTimeout = setTimeout(function () {
+              _this2.imageClicked = false;
+            }, 500);
+          }
+        } else {
+          this.imageClicked = false;
+
+          if (options.backdrop && options.backdrop !== 'static' && event.target === this.canvas) {
+            // This timeout will be cleared later when a native click event is triggering
+            this.clickCanvasTimeout = setTimeout(function () {
+              dispatchEvent(_this2.canvas, EVENT_CLICK);
+            }, 50);
+          }
+        }
+      }
+    },
+    resize: function resize() {
+      var _this3 = this;
+
+      if (!this.isShown || this.hiding) {
+        return;
+      }
+
+      this.initContainer();
+      this.initViewer();
+      this.renderViewer();
+      this.renderList();
+
+      if (this.viewed) {
+        this.initImage(function () {
+          _this3.renderImage();
+        });
+      }
+
+      if (this.played) {
+        if (this.options.fullscreen && this.fulled && !(document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement)) {
+          this.stop();
+          return;
+        }
+
+        forEach(this.player.getElementsByTagName('img'), function (image) {
+          addListener(image, EVENT_LOAD, _this3.loadImage.bind(_this3), {
+            once: true
+          });
+          dispatchEvent(image, EVENT_LOAD);
+        });
+      }
+    },
+    wheel: function wheel(event) {
+      var _this4 = this;
+
+      if (!this.viewed) {
+        return;
+      }
+
+      event.preventDefault(); // Limit wheel speed to prevent zoom too fast
+
+      if (this.wheeling) {
+        return;
+      }
+
+      this.wheeling = true;
+      setTimeout(function () {
+        _this4.wheeling = false;
+      }, 50);
+      var ratio = Number(this.options.zoomRatio) || 0.1;
+      var delta = 1;
+
+      if (event.deltaY) {
+        delta = event.deltaY > 0 ? 1 : -1;
+      } else if (event.wheelDelta) {
+        delta = -event.wheelDelta / 120;
+      } else if (event.detail) {
+        delta = event.detail > 0 ? 1 : -1;
+      }
+
+      this.zoom(-delta * ratio, true, event);
+    }
+  };
+
+  var methods = {
+    /** Show the viewer (only available in modal mode)
+     * @param {boolean} [immediate=false] - Indicates if show the viewer immediately or not.
+     * @returns {Viewer} this
+     */
+    show: function show() {
+      var immediate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
+      var element = this.element,
+          options = this.options;
+
+      if (options.inline || this.showing || this.isShown || this.showing) {
+        return this;
+      }
+
+      if (!this.ready) {
+        this.build();
+
+        if (this.ready) {
+          this.show(immediate);
+        }
+
+        return this;
+      }
+
+      if (isFunction(options.show)) {
+        addListener(element, EVENT_SHOW, options.show, {
+          once: true
+        });
+      }
+
+      if (dispatchEvent(element, EVENT_SHOW) === false || !this.ready) {
+        return this;
+      }
+
+      if (this.hiding) {
+        this.transitioning.abort();
+      }
+
+      this.showing = true;
+      this.open();
+      var viewer = this.viewer;
+      removeClass(viewer, CLASS_HIDE);
+
+      if (options.transition && !immediate) {
+        var shown = this.shown.bind(this);
+        this.transitioning = {
+          abort: function abort() {
+            removeListener(viewer, EVENT_TRANSITION_END, shown);
+            removeClass(viewer, CLASS_IN);
+          }
+        };
+        addClass(viewer, CLASS_TRANSITION); // Force reflow to enable CSS3 transition
+        // eslint-disable-next-line
+
+        viewer.offsetWidth;
+        addListener(viewer, EVENT_TRANSITION_END, shown, {
+          once: true
+        });
+        addClass(viewer, CLASS_IN);
+      } else {
+        addClass(viewer, CLASS_IN);
+        this.shown();
+      }
+
+      return this;
+    },
+
+    /**
+     * Hide the viewer (only available in modal mode)
+     * @param {boolean} [immediate=false] - Indicates if hide the viewer immediately or not.
+     * @returns {Viewer} this
+     */
+    hide: function hide() {
+      var immediate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
+      var element = this.element,
+          options = this.options;
+
+      if (options.inline || this.hiding || !(this.isShown || this.showing)) {
+        return this;
+      }
+
+      if (isFunction(options.hide)) {
+        addListener(element, EVENT_HIDE, options.hide, {
+          once: true
+        });
+      }
+
+      if (dispatchEvent(element, EVENT_HIDE) === false) {
+        return this;
+      }
+
+      if (this.showing) {
+        this.transitioning.abort();
+      }
+
+      this.hiding = true;
+
+      if (this.played) {
+        this.stop();
+      } else if (this.viewing) {
+        this.viewing.abort();
+      }
+
+      var viewer = this.viewer;
+
+      if (options.transition && !immediate) {
+        var hidden = this.hidden.bind(this);
+
+        var hide = function hide() {
+          // XXX: It seems the `event.stopPropagation()` method does not work here
+          setTimeout(function () {
+            addListener(viewer, EVENT_TRANSITION_END, hidden, {
+              once: true
+            });
+            removeClass(viewer, CLASS_IN);
+          }, 0);
+        };
+
+        this.transitioning = {
+          abort: function abort() {
+            if (this.viewed) {
+              removeListener(this.image, EVENT_TRANSITION_END, hide);
+            } else {
+              removeListener(viewer, EVENT_TRANSITION_END, hidden);
+            }
+          }
+        }; // Note that the `CLASS_TRANSITION` class will be removed on pointer down (#255)
+
+        if (this.viewed && hasClass(this.image, CLASS_TRANSITION)) {
+          addListener(this.image, EVENT_TRANSITION_END, hide, {
+            once: true
+          });
+          this.zoomTo(0, false, false, true);
+        } else {
+          hide();
+        }
+      } else {
+        removeClass(viewer, CLASS_IN);
+        this.hidden();
+      }
+
+      return this;
+    },
+
+    /**
+     * View one of the images with image's index
+     * @param {number} index - The index of the image to view.
+     * @returns {Viewer} this
+     */
+    view: function view() {
+      var _this = this;
+
+      var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.options.initialViewIndex;
+      index = Number(index) || 0;
+
+      if (!this.isShown) {
+        this.index = index;
+        return this.show();
+      }
+
+      if (this.hiding || this.played || index < 0 || index >= this.length || this.viewed && index === this.index) {
+        return this;
+      }
+
+      if (this.viewing) {
+        this.viewing.abort();
+      }
+
+      var element = this.element,
+          options = this.options,
+          title = this.title,
+          canvas = this.canvas;
+      var item = this.items[index];
+      var img = item.querySelector('img');
+      var url = getData(img, 'originalUrl');
+      var alt = escapeHTMLEntities(img.getAttribute('alt'));
+      var image = document.createElement('img');
+      image.src = url;
+      image.alt = alt;
+
+      if (isFunction(options.view)) {
+        addListener(element, EVENT_VIEW, options.view, {
+          once: true
+        });
+      }
+
+      if (dispatchEvent(element, EVENT_VIEW, {
+        originalImage: this.images[index],
+        index: index,
+        image: image
+      }) === false || !this.isShown || this.hiding || this.played) {
+        return this;
+      }
+
+      this.image = image;
+      removeClass(this.items[this.index], CLASS_ACTIVE);
+      addClass(item, CLASS_ACTIVE);
+      this.viewed = false;
+      this.index = index;
+      this.imageData = {};
+      addClass(image, CLASS_INVISIBLE);
+
+      if (options.loading) {
+        addClass(canvas, CLASS_LOADING);
+      }
+
+      canvas.innerHTML = '';
+      canvas.appendChild(image); // Center current item
+
+      this.renderList(); // Clear title
+
+      title.innerHTML = ''; // Generate title after viewed
+
+      var onViewed = function onViewed() {
+        var imageData = _this.imageData;
+        var render = Array.isArray(options.title) ? options.title[1] : options.title;
+        title.innerHTML = escapeHTMLEntities(isFunction(render) ? render.call(_this, image, imageData) : "".concat(alt, " (").concat(imageData.naturalWidth, " \xD7 ").concat(imageData.naturalHeight, ")"));
+      };
+
+      var onLoad;
+      addListener(element, EVENT_VIEWED, onViewed, {
+        once: true
+      });
+      this.viewing = {
+        abort: function abort() {
+          removeListener(element, EVENT_VIEWED, onViewed);
+
+          if (image.complete) {
+            if (this.imageRendering) {
+              this.imageRendering.abort();
+            } else if (this.imageInitializing) {
+              this.imageInitializing.abort();
+            }
+          } else {
+            // Cancel download to save bandwidth.
+            image.src = '';
+            removeListener(image, EVENT_LOAD, onLoad);
+
+            if (this.timeout) {
+              clearTimeout(this.timeout);
+            }
+          }
+        }
+      };
+
+      if (image.complete) {
+        this.load();
+      } else {
+        addListener(image, EVENT_LOAD, onLoad = this.load.bind(this), {
+          once: true
+        });
+
+        if (this.timeout) {
+          clearTimeout(this.timeout);
+        } // Make the image visible if it fails to load within 1s
+
+
+        this.timeout = setTimeout(function () {
+          removeClass(image, CLASS_INVISIBLE);
+          _this.timeout = false;
+        }, 1000);
+      }
+
+      return this;
+    },
+
+    /**
+     * View the previous image
+     * @param {boolean} [loop=false] - Indicate if view the last one
+     * when it is the first one at present.
+     * @returns {Viewer} this
+     */
+    prev: function prev() {
+      var loop = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
+      var index = this.index - 1;
+
+      if (index < 0) {
+        index = loop ? this.length - 1 : 0;
+      }
+
+      this.view(index);
+      return this;
+    },
+
+    /**
+     * View the next image
+     * @param {boolean} [loop=false] - Indicate if view the first one
+     * when it is the last one at present.
+     * @returns {Viewer} this
+     */
+    next: function next() {
+      var loop = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
+      var maxIndex = this.length - 1;
+      var index = this.index + 1;
+
+      if (index > maxIndex) {
+        index = loop ? 0 : maxIndex;
+      }
+
+      this.view(index);
+      return this;
+    },
+
+    /**
+     * Move the image with relative offsets.
+     * @param {number} offsetX - The relative offset distance on the x-axis.
+     * @param {number} offsetY - The relative offset distance on the y-axis.
+     * @returns {Viewer} this
+     */
+    move: function move(offsetX, offsetY) {
+      var imageData = this.imageData;
+      this.moveTo(isUndefined(offsetX) ? offsetX : imageData.left + Number(offsetX), isUndefined(offsetY) ? offsetY : imageData.top + Number(offsetY));
+      return this;
+    },
+
+    /**
+     * Move the image to an absolute point.
+     * @param {number} x - The x-axis coordinate.
+     * @param {number} [y=x] - The y-axis coordinate.
+     * @returns {Viewer} this
+     */
+    moveTo: function moveTo(x) {
+      var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : x;
+      var imageData = this.imageData;
+      x = Number(x);
+      y = Number(y);
+
+      if (this.viewed && !this.played && this.options.movable) {
+        var changed = false;
+
+        if (isNumber(x)) {
+          imageData.left = x;
+          changed = true;
+        }
+
+        if (isNumber(y)) {
+          imageData.top = y;
+          changed = true;
+        }
+
+        if (changed) {
+          this.renderImage();
+        }
+      }
+
+      return this;
+    },
+
+    /**
+     * Zoom the image with a relative ratio.
+     * @param {number} ratio - The target ratio.
+     * @param {boolean} [hasTooltip=false] - Indicates if it has a tooltip or not.
+     * @param {Event} [_originalEvent=null] - The original event if any.
+     * @returns {Viewer} this
+     */
+    zoom: function zoom(ratio) {
+      var hasTooltip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
+
+      var _originalEvent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
+
+      var imageData = this.imageData;
+      ratio = Number(ratio);
+
+      if (ratio < 0) {
+        ratio = 1 / (1 - ratio);
+      } else {
+        ratio = 1 + ratio;
+      }
+
+      this.zoomTo(imageData.width * ratio / imageData.naturalWidth, hasTooltip, _originalEvent);
+      return this;
+    },
+
+    /**
+     * Zoom the image to an absolute ratio.
+     * @param {number} ratio - The target ratio.
+     * @param {boolean} [hasTooltip=false] - Indicates if it has a tooltip or not.
+     * @param {Event} [_originalEvent=null] - The original event if any.
+     * @param {Event} [_zoomable=false] - Indicates if the current zoom is available or not.
+     * @returns {Viewer} this
+     */
+    zoomTo: function zoomTo(ratio) {
+      var _this2 = this;
+
+      var hasTooltip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
+
+      var _originalEvent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
+
+      var _zoomable = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
+
+      var element = this.element,
+          options = this.options,
+          pointers = this.pointers,
+          imageData = this.imageData;
+      var width = imageData.width,
+          height = imageData.height,
+          left = imageData.left,
+          top = imageData.top,
+          naturalWidth = imageData.naturalWidth,
+          naturalHeight = imageData.naturalHeight;
+      ratio = Math.max(0, ratio);
+
+      if (isNumber(ratio) && this.viewed && !this.played && (_zoomable || options.zoomable)) {
+        if (!_zoomable) {
+          var minZoomRatio = Math.max(0.01, options.minZoomRatio);
+          var maxZoomRatio = Math.min(100, options.maxZoomRatio);
+          ratio = Math.min(Math.max(ratio, minZoomRatio), maxZoomRatio);
+        }
+
+        if (_originalEvent && ratio > 0.95 && ratio < 1.05) {
+          ratio = 1;
+        }
+
+        var newWidth = naturalWidth * ratio;
+        var newHeight = naturalHeight * ratio;
+        var offsetWidth = newWidth - width;
+        var offsetHeight = newHeight - height;
+        var oldRatio = width / naturalWidth;
+
+        if (isFunction(options.zoom)) {
+          addListener(element, EVENT_ZOOM, options.zoom, {
+            once: true
+          });
+        }
+
+        if (dispatchEvent(element, EVENT_ZOOM, {
+          ratio: ratio,
+          oldRatio: oldRatio,
+          originalEvent: _originalEvent
+        }) === false) {
+          return this;
+        }
+
+        this.zooming = true;
+
+        if (_originalEvent) {
+          var offset = getOffset(this.viewer);
+          var center = pointers && Object.keys(pointers).length ? getPointersCenter(pointers) : {
+            pageX: _originalEvent.pageX,
+            pageY: _originalEvent.pageY
+          }; // Zoom from the triggering point of the event
+
+          imageData.left -= offsetWidth * ((center.pageX - offset.left - left) / width);
+          imageData.top -= offsetHeight * ((center.pageY - offset.top - top) / height);
+        } else {
+          // Zoom from the center of the image
+          imageData.left -= offsetWidth / 2;
+          imageData.top -= offsetHeight / 2;
+        }
+
+        imageData.width = newWidth;
+        imageData.height = newHeight;
+        imageData.ratio = ratio;
+        this.renderImage(function () {
+          _this2.zooming = false;
+
+          if (isFunction(options.zoomed)) {
+            addListener(element, EVENT_ZOOMED, options.zoomed, {
+              once: true
+            });
+          }
+
+          dispatchEvent(element, EVENT_ZOOMED, {
+            ratio: ratio,
+            oldRatio: oldRatio,
+            originalEvent: _originalEvent
+          });
+        });
+
+        if (hasTooltip) {
+          this.tooltip();
+        }
+      }
+
+      return this;
+    },
+
+    /**
+     * Rotate the image with a relative degree.
+     * @param {number} degree - The rotate degree.
+     * @returns {Viewer} this
+     */
+    rotate: function rotate(degree) {
+      this.rotateTo((this.imageData.rotate || 0) + Number(degree));
+      return this;
+    },
+
+    /**
+     * Rotate the image to an absolute degree.
+     * @param {number} degree - The rotate degree.
+     * @returns {Viewer} this
+     */
+    rotateTo: function rotateTo(degree) {
+      var imageData = this.imageData;
+      degree = Number(degree);
+
+      if (isNumber(degree) && this.viewed && !this.played && this.options.rotatable) {
+        imageData.rotate = degree;
+        this.renderImage();
+      }
+
+      return this;
+    },
+
+    /**
+     * Scale the image on the x-axis.
+     * @param {number} scaleX - The scale ratio on the x-axis.
+     * @returns {Viewer} this
+     */
+    scaleX: function scaleX(_scaleX) {
+      this.scale(_scaleX, this.imageData.scaleY);
+      return this;
+    },
+
+    /**
+     * Scale the image on the y-axis.
+     * @param {number} scaleY - The scale ratio on the y-axis.
+     * @returns {Viewer} this
+     */
+    scaleY: function scaleY(_scaleY) {
+      this.scale(this.imageData.scaleX, _scaleY);
+      return this;
+    },
+
+    /**
+     * Scale the image.
+     * @param {number} scaleX - The scale ratio on the x-axis.
+     * @param {number} [scaleY=scaleX] - The scale ratio on the y-axis.
+     * @returns {Viewer} this
+     */
+    scale: function scale(scaleX) {
+      var scaleY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : scaleX;
+      var imageData = this.imageData;
+      scaleX = Number(scaleX);
+      scaleY = Number(scaleY);
+
+      if (this.viewed && !this.played && this.options.scalable) {
+        var changed = false;
+
+        if (isNumber(scaleX)) {
+          imageData.scaleX = scaleX;
+          changed = true;
+        }
+
+        if (isNumber(scaleY)) {
+          imageData.scaleY = scaleY;
+          changed = true;
+        }
+
+        if (changed) {
+          this.renderImage();
+        }
+      }
+
+      return this;
+    },
+
+    /**
+     * Play the images
+     * @param {boolean} [fullscreen=false] - Indicate if request fullscreen or not.
+     * @returns {Viewer} this
+     */
+    play: function play() {
+      var _this3 = this;
+
+      var fullscreen = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
+
+      if (!this.isShown || this.played) {
+        return this;
+      }
+
+      var options = this.options,
+          player = this.player;
+      var onLoad = this.loadImage.bind(this);
+      var list = [];
+      var total = 0;
+      var index = 0;
+      this.played = true;
+      this.onLoadWhenPlay = onLoad;
+
+      if (fullscreen) {
+        this.requestFullscreen();
+      }
+
+      addClass(player, CLASS_SHOW);
+      forEach(this.items, function (item, i) {
+        var img = item.querySelector('img');
+        var image = document.createElement('img');
+        image.src = getData(img, 'originalUrl');
+        image.alt = escapeHTMLEntities(img.getAttribute('alt'));
+        total += 1;
+        addClass(image, CLASS_FADE);
+        toggleClass(image, CLASS_TRANSITION, options.transition);
+
+        if (hasClass(item, CLASS_ACTIVE)) {
+          addClass(image, CLASS_IN);
+          index = i;
+        }
+
+        list.push(image);
+        addListener(image, EVENT_LOAD, onLoad, {
+          once: true
+        });
+        player.appendChild(image);
+      });
+
+      if (isNumber(options.interval) && options.interval > 0) {
+        var play = function play() {
+          _this3.playing = setTimeout(function () {
+            removeClass(list[index], CLASS_IN);
+            index += 1;
+            index = index < total ? index : 0;
+            addClass(list[index], CLASS_IN);
+            play();
+          }, options.interval);
+        };
+
+        if (total > 1) {
+          play();
+        }
+      }
+
+      return this;
+    },
+    // Stop play
+    stop: function stop() {
+      var _this4 = this;
+
+      if (!this.played) {
+        return this;
+      }
+
+      var player = this.player;
+      this.played = false;
+      clearTimeout(this.playing);
+      forEach(player.getElementsByTagName('img'), function (image) {
+        removeListener(image, EVENT_LOAD, _this4.onLoadWhenPlay);
+      });
+      removeClass(player, CLASS_SHOW);
+      player.innerHTML = '';
+      this.exitFullscreen();
+      return this;
+    },
+    // Enter modal mode (only available in inline mode)
+    full: function full() {
+      var _this5 = this;
+
+      var options = this.options,
+          viewer = this.viewer,
+          image = this.image,
+          list = this.list;
+
+      if (!this.isShown || this.played || this.fulled || !options.inline) {
+        return this;
+      }
+
+      this.fulled = true;
+      this.open();
+      addClass(this.button, CLASS_FULLSCREEN_EXIT);
+
+      if (options.transition) {
+        removeClass(list, CLASS_TRANSITION);
+
+        if (this.viewed) {
+          removeClass(image, CLASS_TRANSITION);
+        }
+      }
+
+      addClass(viewer, CLASS_FIXED);
+      viewer.setAttribute('style', '');
+      setStyle(viewer, {
+        zIndex: options.zIndex
+      });
+      this.initContainer();
+      this.viewerData = assign({}, this.containerData);
+      this.renderList();
+
+      if (this.viewed) {
+        this.initImage(function () {
+          _this5.renderImage(function () {
+            if (options.transition) {
+              setTimeout(function () {
+                addClass(image, CLASS_TRANSITION);
+                addClass(list, CLASS_TRANSITION);
+              }, 0);
+            }
+          });
+        });
+      }
+
+      return this;
+    },
+    // Exit modal mode (only available in inline mode)
+    exit: function exit() {
+      var _this6 = this;
+
+      var options = this.options,
+          viewer = this.viewer,
+          image = this.image,
+          list = this.list;
+
+      if (!this.isShown || this.played || !this.fulled || !options.inline) {
+        return this;
+      }
+
+      this.fulled = false;
+      this.close();
+      removeClass(this.button, CLASS_FULLSCREEN_EXIT);
+
+      if (options.transition) {
+        removeClass(list, CLASS_TRANSITION);
+
+        if (this.viewed) {
+          removeClass(image, CLASS_TRANSITION);
+        }
+      }
+
+      removeClass(viewer, CLASS_FIXED);
+      setStyle(viewer, {
+        zIndex: options.zIndexInline
+      });
+      this.viewerData = assign({}, this.parentData);
+      this.renderViewer();
+      this.renderList();
+
+      if (this.viewed) {
+        this.initImage(function () {
+          _this6.renderImage(function () {
+            if (options.transition) {
+              setTimeout(function () {
+                addClass(image, CLASS_TRANSITION);
+                addClass(list, CLASS_TRANSITION);
+              }, 0);
+            }
+          });
+        });
+      }
+
+      return this;
+    },
+    // Show the current ratio of the image with percentage
+    tooltip: function tooltip() {
+      var _this7 = this;
+
+      var options = this.options,
+          tooltipBox = this.tooltipBox,
+          imageData = this.imageData;
+
+      if (!this.viewed || this.played || !options.tooltip) {
+        return this;
+      }
+
+      tooltipBox.textContent = "".concat(Math.round(imageData.ratio * 100), "%");
+
+      if (!this.tooltipping) {
+        if (options.transition) {
+          if (this.fading) {
+            dispatchEvent(tooltipBox, EVENT_TRANSITION_END);
+          }
+
+          addClass(tooltipBox, CLASS_SHOW);
+          addClass(tooltipBox, CLASS_FADE);
+          addClass(tooltipBox, CLASS_TRANSITION); // Force reflow to enable CSS3 transition
+          // eslint-disable-next-line
+
+          tooltipBox.offsetWidth;
+          addClass(tooltipBox, CLASS_IN);
+        } else {
+          addClass(tooltipBox, CLASS_SHOW);
+        }
+      } else {
+        clearTimeout(this.tooltipping);
+      }
+
+      this.tooltipping = setTimeout(function () {
+        if (options.transition) {
+          addListener(tooltipBox, EVENT_TRANSITION_END, function () {
+            removeClass(tooltipBox, CLASS_SHOW);
+            removeClass(tooltipBox, CLASS_FADE);
+            removeClass(tooltipBox, CLASS_TRANSITION);
+            _this7.fading = false;
+          }, {
+            once: true
+          });
+          removeClass(tooltipBox, CLASS_IN);
+          _this7.fading = true;
+        } else {
+          removeClass(tooltipBox, CLASS_SHOW);
+        }
+
+        _this7.tooltipping = false;
+      }, 1000);
+      return this;
+    },
+    // Toggle the image size between its natural size and initial size
+    toggle: function toggle() {
+      if (this.imageData.ratio === 1) {
+        this.zoomTo(this.initialImageData.ratio, true);
+      } else {
+        this.zoomTo(1, true);
+      }
+
+      return this;
+    },
+    // Reset the image to its initial state
+    reset: function reset() {
+      if (this.viewed && !this.played) {
+        this.imageData = assign({}, this.initialImageData);
+        this.renderImage();
+      }
+
+      return this;
+    },
+    // Update viewer when images changed
+    update: function update() {
+      var element = this.element,
+          options = this.options,
+          isImg = this.isImg; // Destroy viewer if the target image was deleted
+
+      if (isImg && !element.parentNode) {
+        return this.destroy();
+      }
+
+      var images = [];
+      forEach(isImg ? [element] : element.querySelectorAll('img'), function (image) {
+        if (options.filter) {
+          if (options.filter(image)) {
+            images.push(image);
+          }
+        } else {
+          images.push(image);
+        }
+      });
+
+      if (!images.length) {
+        return this;
+      }
+
+      this.images = images;
+      this.length = images.length;
+
+      if (this.ready) {
+        var indexes = [];
+        forEach(this.items, function (item, i) {
+          var img = item.querySelector('img');
+          var image = images[i];
+
+          if (image) {
+            if (image.src !== img.src) {
+              indexes.push(i);
+            }
+          } else {
+            indexes.push(i);
+          }
+        });
+        setStyle(this.list, {
+          width: 'auto'
+        });
+        this.initList();
+
+        if (this.isShown) {
+          if (this.length) {
+            if (this.viewed) {
+              var index = indexes.indexOf(this.index);
+
+              if (index >= 0) {
+                this.viewed = false;
+                this.view(Math.max(this.index - (index + 1), 0));
+              } else {
+                addClass(this.items[this.index], CLASS_ACTIVE);
+              }
+            }
+          } else {
+            this.image = null;
+            this.viewed = false;
+            this.index = 0;
+            this.imageData = {};
+            this.canvas.innerHTML = '';
+            this.title.innerHTML = '';
+          }
+        }
+      } else {
+        this.build();
+      }
+
+      return this;
+    },
+    // Destroy the viewer
+    destroy: function destroy() {
+      var element = this.element,
+          options = this.options;
+
+      if (!element[NAMESPACE]) {
+        return this;
+      }
+
+      this.destroyed = true;
+
+      if (this.ready) {
+        if (this.played) {
+          this.stop();
+        }
+
+        if (options.inline) {
+          if (this.fulled) {
+            this.exit();
+          }
+
+          this.unbind();
+        } else if (this.isShown) {
+          if (this.viewing) {
+            if (this.imageRendering) {
+              this.imageRendering.abort();
+            } else if (this.imageInitializing) {
+              this.imageInitializing.abort();
+            }
+          }
+
+          if (this.hiding) {
+            this.transitioning.abort();
+          }
+
+          this.hidden();
+        } else if (this.showing) {
+          this.transitioning.abort();
+          this.hidden();
+        }
+
+        this.ready = false;
+        this.viewer.parentNode.removeChild(this.viewer);
+      } else if (options.inline) {
+        if (this.delaying) {
+          this.delaying.abort();
+        } else if (this.initializing) {
+          this.initializing.abort();
+        }
+      }
+
+      if (!options.inline) {
+        removeListener(element, EVENT_CLICK, this.onStart);
+      }
+
+      element[NAMESPACE] = undefined;
+      return this;
+    }
+  };
+
+  var others = {
+    open: function open() {
+      var body = this.body;
+      addClass(body, CLASS_OPEN);
+      body.style.paddingRight = "".concat(this.scrollbarWidth + (parseFloat(this.initialBodyPaddingRight) || 0), "px");
+    },
+    close: function close() {
+      var body = this.body;
+      removeClass(body, CLASS_OPEN);
+      body.style.paddingRight = this.initialBodyPaddingRight;
+    },
+    shown: function shown() {
+      var element = this.element,
+          options = this.options;
+      this.fulled = true;
+      this.isShown = true;
+      this.render();
+      this.bind();
+      this.showing = false;
+
+      if (isFunction(options.shown)) {
+        addListener(element, EVENT_SHOWN, options.shown, {
+          once: true
+        });
+      }
+
+      if (dispatchEvent(element, EVENT_SHOWN) === false) {
+        return;
+      }
+
+      if (this.ready && this.isShown && !this.hiding) {
+        this.view(this.index);
+      }
+    },
+    hidden: function hidden() {
+      var element = this.element,
+          options = this.options;
+      this.fulled = false;
+      this.viewed = false;
+      this.isShown = false;
+      this.close();
+      this.unbind();
+      addClass(this.viewer, CLASS_HIDE);
+      this.resetList();
+      this.resetImage();
+      this.hiding = false;
+
+      if (!this.destroyed) {
+        if (isFunction(options.hidden)) {
+          addListener(element, EVENT_HIDDEN, options.hidden, {
+            once: true
+          });
+        }
+
+        dispatchEvent(element, EVENT_HIDDEN);
+      }
+    },
+    requestFullscreen: function requestFullscreen() {
+      var document = this.element.ownerDocument;
+
+      if (this.fulled && !(document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement)) {
+        var documentElement = document.documentElement; // Element.requestFullscreen()
+
+        if (documentElement.requestFullscreen) {
+          documentElement.requestFullscreen();
+        } else if (documentElement.webkitRequestFullscreen) {
+          documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
+        } else if (documentElement.mozRequestFullScreen) {
+          documentElement.mozRequestFullScreen();
+        } else if (documentElement.msRequestFullscreen) {
+          documentElement.msRequestFullscreen();
+        }
+      }
+    },
+    exitFullscreen: function exitFullscreen() {
+      var document = this.element.ownerDocument;
+
+      if (this.fulled && (document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement)) {
+        // Document.exitFullscreen()
+        if (document.exitFullscreen) {
+          document.exitFullscreen();
+        } else if (document.webkitExitFullscreen) {
+          document.webkitExitFullscreen();
+        } else if (document.mozCancelFullScreen) {
+          document.mozCancelFullScreen();
+        } else if (document.msExitFullscreen) {
+          document.msExitFullscreen();
+        }
+      }
+    },
+    change: function change(event) {
+      var options = this.options,
+          pointers = this.pointers;
+      var pointer = pointers[Object.keys(pointers)[0]];
+      var offsetX = pointer.endX - pointer.startX;
+      var offsetY = pointer.endY - pointer.startY;
+
+      switch (this.action) {
+        // Move the current image
+        case ACTION_MOVE:
+          this.move(offsetX, offsetY);
+          break;
+        // Zoom the current image
+
+        case ACTION_ZOOM:
+          this.zoom(getMaxZoomRatio(pointers), false, event);
+          break;
+
+        case ACTION_SWITCH:
+          {
+            this.action = 'switched';
+            var absoluteOffsetX = Math.abs(offsetX);
+
+            if (absoluteOffsetX > 1 && absoluteOffsetX > Math.abs(offsetY)) {
+              // Empty `pointers` as `touchend` event will not be fired after swiped in iOS browsers.
+              this.pointers = {};
+
+              if (offsetX > 1) {
+                this.prev(options.loop);
+              } else if (offsetX < -1) {
+                this.next(options.loop);
+              }
+            }
+
+            break;
+          }
+
+        default:
+      } // Override
+
+
+      forEach(pointers, function (p) {
+        p.startX = p.endX;
+        p.startY = p.endY;
+      });
+    },
+    isSwitchable: function isSwitchable() {
+      var imageData = this.imageData,
+          viewerData = this.viewerData;
+      return this.length > 1 && imageData.left >= 0 && imageData.top >= 0 && imageData.width <= viewerData.width && imageData.height <= viewerData.height;
+    }
+  };
+
+  var AnotherViewer = WINDOW.Viewer;
+
+  var Viewer =
+  /*#__PURE__*/
+  function () {
+    /**
+     * Create a new Viewer.
+     * @param {Element} element - The target element for viewing.
+     * @param {Object} [options={}] - The configuration options.
+     */
+    function Viewer(element) {
+      var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+
+      _classCallCheck(this, Viewer);
+
+      if (!element || element.nodeType !== 1) {
+        throw new Error('The first argument is required and must be an element.');
+      }
+
+      this.element = element;
+      this.options = assign({}, DEFAULTS, isPlainObject(options) && options);
+      this.action = false;
+      this.fading = false;
+      this.fulled = false;
+      this.hiding = false;
+      this.imageClicked = false;
+      this.imageData = {};
+      this.index = this.options.initialViewIndex;
+      this.isImg = false;
+      this.isShown = false;
+      this.length = 0;
+      this.played = false;
+      this.playing = false;
+      this.pointers = {};
+      this.ready = false;
+      this.showing = false;
+      this.timeout = false;
+      this.tooltipping = false;
+      this.viewed = false;
+      this.viewing = false;
+      this.wheeling = false;
+      this.zooming = false;
+      this.init();
+    }
+
+    _createClass(Viewer, [{
+      key: "init",
+      value: function init() {
+        var _this = this;
+
+        var element = this.element,
+            options = this.options;
+
+        if (element[NAMESPACE]) {
+          //return;
+        }
+
+        element[NAMESPACE] = this;
+        var isImg = element.tagName.toLowerCase() === 'img';
+        var images = [];
+        forEach(isImg ? [element] : element.querySelectorAll('img'), function (image) {
+          if (isFunction(options.filter)) {
+            if (options.filter.call(_this, image)) {
+              images.push(image);
+            }
+          } else {
+            images.push(image);
+          }
+        });
+        this.isImg = isImg;
+        this.length = images.length;
+        this.images = images;
+        var ownerDocument = element.ownerDocument;
+        var body = ownerDocument.body || ownerDocument.documentElement;
+        this.body = body;
+        this.scrollbarWidth = window.innerWidth - ownerDocument.documentElement.clientWidth;
+        this.initialBodyPaddingRight = window.getComputedStyle(body).paddingRight; // Override `transition` option if it is not supported
+
+        if (isUndefined(document.createElement(NAMESPACE).style.transition)) {
+          options.transition = false;
+        }
+
+        if (options.inline) {
+          var count = 0;
+
+          var progress = function progress() {
+            count += 1;
+
+            if (count === _this.length) {
+              var timeout;
+              _this.initializing = false;
+              _this.delaying = {
+                abort: function abort() {
+                  clearTimeout(timeout);
+                }
+              }; // build asynchronously to keep `this.viewer` is accessible in `ready` event handler.
+
+              timeout = setTimeout(function () {
+                _this.delaying = false;
+
+                _this.build();
+              }, 0);
+            }
+          };
+
+          this.initializing = {
+            abort: function abort() {
+              forEach(images, function (image) {
+                if (!image.complete) {
+                  removeListener(image, EVENT_LOAD, progress);
+                }
+              });
+            }
+          };
+          forEach(images, function (image) {
+            if (image.complete) {
+              progress();
+            } else {
+              addListener(image, EVENT_LOAD, progress, {
+                once: true
+              });
+            }
+          });
+        } else {
+          addListener(element, EVENT_CLICK, this.onStart = function (_ref) {
+            var target = _ref.target;
+
+            if (target.tagName.toLowerCase() === 'img' && (!isFunction(options.filter) || options.filter.call(_this, target))) {
+              _this.view(_this.images.indexOf(target));
+            }
+          });
+        }
+      }
+    }, {
+      key: "build",
+      value: function build() {
+        if (this.ready) {
+          return;
+        }
+
+        var element = this.element,
+            options = this.options;
+        var parent = element.parentNode;
+        var template = document.createElement('div');
+        template.innerHTML = TEMPLATE;
+        var viewer = template.querySelector(".".concat(NAMESPACE, "-container"));
+        var title = viewer.querySelector(".".concat(NAMESPACE, "-title"));
+        var toolbar = viewer.querySelector(".".concat(NAMESPACE, "-toolbar"));
+        var navbar = viewer.querySelector(".".concat(NAMESPACE, "-navbar"));
+        var button = viewer.querySelector(".".concat(NAMESPACE, "-button"));
+        var canvas = viewer.querySelector(".".concat(NAMESPACE, "-canvas"));
+        this.parent = parent;
+        this.viewer = viewer;
+        this.title = title;
+        this.toolbar = toolbar;
+        this.navbar = navbar;
+        this.button = button;
+        this.canvas = canvas;
+        this.footer = viewer.querySelector(".".concat(NAMESPACE, "-footer"));
+        this.tooltipBox = viewer.querySelector(".".concat(NAMESPACE, "-tooltip"));
+        this.player = viewer.querySelector(".".concat(NAMESPACE, "-player"));
+        this.list = viewer.querySelector(".".concat(NAMESPACE, "-list"));
+        addClass(title, !options.title ? CLASS_HIDE : getResponsiveClass(Array.isArray(options.title) ? options.title[0] : options.title));
+        addClass(navbar, !options.navbar ? CLASS_HIDE : getResponsiveClass(options.navbar));
+        toggleClass(button, CLASS_HIDE, !options.button);
+
+        if (options.backdrop) {
+          addClass(viewer, "".concat(NAMESPACE, "-backdrop"));
+
+          if (!options.inline && options.backdrop !== 'static') {
+            setData(canvas, DATA_ACTION, 'hide');
+          }
+        }
+
+        if (isString(options.className) && options.className) {
+          // In case there are multiple class names
+          options.className.split(REGEXP_SPACES).forEach(function (className) {
+            addClass(viewer, className);
+          });
+        }
+
+        if (options.toolbar) {
+          var list = document.createElement('ul');
+          var custom = isPlainObject(options.toolbar);
+          var zoomButtons = BUTTONS.slice(0, 3);
+          var rotateButtons = BUTTONS.slice(7, 9);
+          var scaleButtons = BUTTONS.slice(9);
+
+          if (!custom) {
+            addClass(toolbar, getResponsiveClass(options.toolbar));
+          }
+
+          forEach(custom ? options.toolbar : BUTTONS, function (value, index) {
+            var deep = custom && isPlainObject(value);
+            var name = custom ? hyphenate(index) : value;
+            var show = deep && !isUndefined(value.show) ? value.show : value;
+
+            if (!show || !options.zoomable && zoomButtons.indexOf(name) !== -1 || !options.rotatable && rotateButtons.indexOf(name) !== -1 || !options.scalable && scaleButtons.indexOf(name) !== -1) {
+              return;
+            }
+
+            var size = deep && !isUndefined(value.size) ? value.size : value;
+            var click = deep && !isUndefined(value.click) ? value.click : value;
+            var item = document.createElement('li');
+            item.setAttribute('role', 'button');
+            addClass(item, "".concat(NAMESPACE, "-").concat(name));
+
+            if (!isFunction(click)) {
+              setData(item, DATA_ACTION, name);
+            }
+
+            if (isNumber(show)) {
+              addClass(item, getResponsiveClass(show));
+            }
+
+            if (['small', 'large'].indexOf(size) !== -1) {
+              addClass(item, "".concat(NAMESPACE, "-").concat(size));
+            } else if (name === 'play') {
+              addClass(item, "".concat(NAMESPACE, "-large"));
+            }
+
+            if (isFunction(click)) {
+              addListener(item, EVENT_CLICK, click);
+            }
+
+            list.appendChild(item);
+          });
+          toolbar.appendChild(list);
+        } else {
+          addClass(toolbar, CLASS_HIDE);
+        }
+
+        if (!options.rotatable) {
+          var rotates = toolbar.querySelectorAll('li[class*="rotate"]');
+          addClass(rotates, CLASS_INVISIBLE);
+          forEach(rotates, function (rotate) {
+            toolbar.appendChild(rotate);
+          });
+        }
+
+        if (options.inline) {
+          addClass(button, CLASS_FULLSCREEN);
+          setStyle(viewer, {
+            zIndex: options.zIndexInline
+          });
+
+          if (window.getComputedStyle(parent).position === 'static') {
+            setStyle(parent, {
+              position: 'relative'
+            });
+          }
+
+          parent.insertBefore(viewer, element.nextSibling);
+        } else {
+          addClass(button, CLASS_CLOSE);
+          addClass(viewer, CLASS_FIXED);
+          addClass(viewer, CLASS_FADE);
+          addClass(viewer, CLASS_HIDE);
+          setStyle(viewer, {
+            zIndex: options.zIndex
+          });
+          var container = options.container;
+
+          if (isString(container)) {
+            container = element.ownerDocument.querySelector(container);
+          }
+
+          if (!container) {
+            container = this.body;
+          }
+
+          container.appendChild(viewer);
+        }
+
+        if (options.inline) {
+          this.render();
+          this.bind();
+          this.isShown = true;
+        }
+
+        this.ready = true;
+
+        if (isFunction(options.ready)) {
+          addListener(element, EVENT_READY, options.ready, {
+            once: true
+          });
+        }
+
+        if (dispatchEvent(element, EVENT_READY) === false) {
+          this.ready = false;
+          return;
+        }
+
+        if (this.ready && options.inline) {
+          this.view(this.index);
+        }
+      }
+      /**
+       * Get the no conflict viewer class.
+       * @returns {Viewer} The viewer class.
+       */
+
+    }], [{
+      key: "noConflict",
+      value: function noConflict() {
+        window.Viewer = AnotherViewer;
+        return Viewer;
+      }
+      /**
+       * Change the default options.
+       * @param {Object} options - The new default options.
+       */
+
+    }, {
+      key: "setDefaults",
+      value: function setDefaults(options) {
+        assign(DEFAULTS, isPlainObject(options) && options);
+      }
+    }]);
+
+    return Viewer;
+  }();
+
+  assign(Viewer.prototype, render, events, handlers, methods, others);
+
+  return Viewer;
+
+}));

+ 455 - 0
o2web/source/x_component_AppMarketV2_Application/Comment.js

@@ -0,0 +1,455 @@
+MWF.xApplication.AppMarketV2.Application.Comment = new Class({
+    Implements: [Options, Events],
+    options: {
+        "view": "applicationComment.html"
+    },
+    initialize: function(app, container, options){
+        this.setOptions(options);
+        this.app = app;
+        this.appdata = this.app.appdata;
+        this.container = container;
+        this.viewPath = this.app.path+this.app.options.style+"/"+this.options.view;
+        this.iconPath = this.app.path+this.app.options.style+"/icon/";
+        this.actions = MWF.Actions.load("x_program_center");
+        this.load();
+    },
+    load: function(){
+        this.container.loadHtml(this.viewPath, {"bind": {"lp": this.app.lp}, "module": this}, function(){
+            this.loadApplication(function(){
+                this.fireEvent("load");
+            }.bind(this));
+        }.bind(this));
+    },    
+
+    loadApplication: function(callback){        
+        if (!this.isLoading){
+            if (!this.applicationsContentV){
+                this.applicationsContentV = new MWF.xApplication.AppMarketV2.Application.Comment.ViewPage(this, {
+                    "onLoad": function(){ if (callback) callback(); }
+                });
+            }else{
+                this.applicationsContentV.load();
+            }
+        }
+    }        
+});
+
+MWF.xApplication.AppMarketV2.Application.Comment.ViewPage= new Class({
+    Implements: [Options, Events],
+    options: {
+        "type": "commentViewPage"
+    },
+    initialize: function(content, options){
+        this.setOptions(options);
+        this.content = content;
+        this.app = this.content.app;
+        this.appdata = this.content.appdata;
+        this.actions = this.app.actions;
+        this.container = this.content.container;
+        this.page = 1;
+        this.pageSize = 100;
+        this.querydata = {};
+        this.load();
+        
+    },
+    load: function(){
+        if (this.app.collectToken=="" || this.app.collectUrl==""){
+            //先登录collcect
+            this.actions.CollectAction.login(//平台封装好的方法
+                function( json ){ //服务调用成功的回调函数, json为服务传回的数据
+                    if (json.type && json.type=="success"){
+                        data = json.data; //为变量data赋值
+                        this.app.collectUrl = data.collectUrl;
+                        this.app.collectToken = data.collectToken;
+                        this.loadCommentsGrade(this,this.commentsGrade.bind(this));
+                        this.loadCommentPower(this,this.commentsPower.bind(this));
+                        this.loadCommentsList(this,this.commentsView.bind(this));
+                    }
+                }.bind(this),null,false //同步执行 
+            );
+        }else{
+            this.loadCommentsGrade(this,this.commentsGrade.bind(this));
+            this.loadCommentPower(this,this.commentsPower.bind(this));
+            this.loadCommentsList(this,this.commentsView.bind(this));
+        }      
+    },
+    loadCommentsGrade: function(content,callback){
+        var json = null;
+        var commenturl = content.app.collectUrl +'/o2_collect_assemble/jaxrs/comment/stat/grade/app/'+content.appdata.id+'?time='+(new Date()).getMilliseconds();
+        var res = new Request.JSON({
+            url: commenturl,
+            headers : {'x-debugger' : true,'Authorization':content.app.collectToken,'c-token':content.app.collectToken},
+            secure: false,
+            method: "get",
+            async: true,
+            withCredentials: true,
+            contentType : 'application/json',
+            crossDomain : true,
+            onSuccess: function(responseJSON, responseText){
+                json = responseJSON;
+                if (typeOf(callback).toLowerCase() == 'function'){
+                    callback(responseJSON);
+                }else{
+                    o2.runCallback(callback, "success", [responseJSON, responseText]);
+                }
+            }.bind(this),
+            onFailure: function(xhr){
+                o2.runCallback(callback, "requestFailure", [xhr]);
+            }.bind(this),
+            onError: function(text, error){
+                o2.runCallback(callback, "error", [text, error]);
+            }.bind(this)
+        });
+        res.send();
+    },
+    loadCommentPower: function(content,callback){
+        var json = null;
+        var commenturl = content.app.collectUrl +'/o2_collect_assemble/jaxrs/comment/app/'+content.appdata.id+'/available?time='+(new Date()).getMilliseconds();
+        var res = new Request.JSON({
+            url: commenturl,
+            headers : {'x-debugger' : true,'Authorization':content.app.collectToken,'c-token':content.app.collectToken},
+            secure: false,
+            method: "get",
+            async: true,
+            withCredentials: true,
+            contentType : 'application/json',
+            crossDomain : true,
+            onSuccess: function(responseJSON, responseText){
+                json = responseJSON;
+                if (typeOf(callback).toLowerCase() == 'function'){
+                    callback(responseJSON);
+                }else{
+                    o2.runCallback(callback, "success", [responseJSON, responseText]);
+                }
+            }.bind(this),
+            onFailure: function(xhr){
+                o2.runCallback(callback, "requestFailure", [xhr]);
+            }.bind(this),
+            onError: function(text, error){
+                o2.runCallback(callback, "error", [text, error]);
+            }.bind(this)
+        });
+        res.send();        
+    },
+    loadCommentsList:function(content,callback){
+        var json = null;
+        var commenturl = content.app.collectUrl +'/o2_collect_assemble/jaxrs/comment/list/app/'+content.appdata.id+'?time='+(new Date()).getMilliseconds();
+        var res = new Request.JSON({
+            url: commenturl,
+            headers : {'x-debugger' : true,'Authorization':content.app.collectToken,'c-token':content.app.collectToken},
+            secure: false,
+            method: "get",
+            async: true,
+            withCredentials: true,
+            contentType : 'application/json',
+            crossDomain : true,
+            onSuccess: function(responseJSON, responseText){
+                json = responseJSON;
+                if (typeOf(callback).toLowerCase() == 'function'){
+                    callback(responseJSON);
+                }else{
+                    o2.runCallback(callback, "success", [responseJSON, responseText]);
+                }
+            }.bind(this),
+            onFailure: function(xhr){
+                o2.runCallback(callback, "requestFailure", [xhr]);
+            }.bind(this),
+            onError: function(text, error){
+                o2.runCallback(callback, "error", [text, error]);
+            }.bind(this)
+        });
+        res.send();
+    },
+    commentsGrade:function(commentdata){
+        debugger;
+        var commentcount = 0;
+        var grade = 0;
+        var totalgrade = 0; 
+        var commentratiolist = commentdata.data;
+        var gradeList = ["0","0","0","0","0"];
+        commentratiolist.each(function(pergrade){
+            gradeList[parseInt(pergrade.grade)-1]=pergrade.count;
+            commentcount +=parseInt(pergrade.count)
+        }.bind(this));
+
+        gradeList.each(function(pergrade,index){
+            totalgrade += parseInt(pergrade)*(index+1)
+        })
+        if (commentcount>0){
+            grade = this.numberFix(totalgrade/commentcount,1)
+        }
+        debugger;
+        this.content.applicationcommenttopgrade.set("text",grade+"");
+		var intgrade = parseInt(grade);
+        var dotgrade = grade - intgrade;
+        
+
+		for (var tmpnum=0;tmpnum<intgrade;tmpnum++){
+				new Element("img",{"src":this.content.iconPath+"blackfiveangular.png","class":"o2_appmarket_application_introduce_memo_remark_inner_pic"}).inject(this.content.applicationcommenttopangular)
+		}
+		if (dotgrade>=0.5){
+			new Element("img",{"src":this.content.iconPath+"halffiveangular.png","class":"o2_appmarket_application_introduce_memo_remark_inner_pic"}).inject(this.content.applicationcommenttopangular);
+			intgrade++;
+		}
+		for (var tmpnum=0;tmpnum<5-intgrade;tmpnum++){
+			new Element("img",{"src":this.content.iconPath+"whitefiveangular.png","class":"o2_appmarket_application_introduce_memo_remark_inner_pic"}).inject(this.content.applicationcommenttopangular);
+        }
+        new Element("span",{"class":"o2_appmarket_application_introduce_memo_remark_inner_text","text":"共"+commentcount+"个评分"}).inject(this.content.applicationcommenttopangular);
+        
+        //5星
+        new Element("div",{"text":"5","class":"o2_appmarket_application_comment_top_right_graderatioItem"}).inject(this.content.applicationcommentrightfive);
+        gradeangular = new Element("div",{"class":"o2_appmarket_application_comment_top_right_graderatioItem"}).inject(this.content.applicationcommentrightfive);
+        new Element("img",{"src":this.content.iconPath+"blackfiveangular.png","class":"o2_appmarket_application_introduce_memo_remark_inner_pic"}).inject(gradeangular)
+        graderatiodiv = new Element("div",{"class":"o2_appmarket_application_comment_gradetotal"}).inject(this.content.applicationcommentrightfive);
+        blackratiodiv = new Element("div",{"class":"o2_appmarket_application_comment_graderatio"}).inject(graderatiodiv);
+        graderratiodivwidth = graderatiodiv.clientWidth;
+        if (commentcount==0){
+            blackratio = 0;
+            blackratiodiv.setStyle("width","0px");
+        }else{
+            blackratio = parseInt(gradeList[4])/commentcount;
+            blackratiowidth = blackratio*graderratiodivwidth;
+            blackratiodiv.setStyle("width",blackratiowidth+"px");
+        }        
+        new Element("div",{"text":this.numberFix(blackratio*100,1)+"%","class":"o2_appmarket_application_comment_top_right_graderatioItem"}).inject(this.content.applicationcommentrightfive);
+        debugger;
+        //4星
+        new Element("div",{"text":"4","class":"o2_appmarket_application_comment_top_right_graderatioItem"}).inject(this.content.applicationcommentrightfour);
+        gradeangular = new Element("div",{"class":"o2_appmarket_application_comment_top_right_graderatioItem"}).inject(this.content.applicationcommentrightfour);
+        new Element("img",{"src":this.content.iconPath+"blackfiveangular.png","class":"o2_appmarket_application_introduce_memo_remark_inner_pic"}).inject(gradeangular)
+        graderatiodiv = new Element("div",{"class":"o2_appmarket_application_comment_gradetotal"}).inject(this.content.applicationcommentrightfour);
+        blackratiodiv = new Element("div",{"class":"o2_appmarket_application_comment_graderatio"}).inject(graderatiodiv);
+        graderratiodivwidth = graderatiodiv.clientWidth;
+        if (commentcount==0){
+            blackratio = 0;
+            blackratiodiv.setStyle("width","0px");
+        }else{
+            blackratio = parseInt(gradeList[3])/commentcount;
+            blackratiowidth = blackratio*graderratiodivwidth;
+            blackratiodiv.setStyle("width",blackratiowidth+"px");
+        }   
+        new Element("div",{"text":this.numberFix(blackratio*100,1)+"%","class":"o2_appmarket_application_comment_top_right_graderatioItem"}).inject(this.content.applicationcommentrightfour);
+        //3星
+        new Element("div",{"text":"3","class":"o2_appmarket_application_comment_top_right_graderatioItem"}).inject(this.content.applicationcommentrightthree);
+        gradeangular = new Element("div",{"class":"o2_appmarket_application_comment_top_right_graderatioItem"}).inject(this.content.applicationcommentrightthree);
+        new Element("img",{"src":this.content.iconPath+"blackfiveangular.png","class":"o2_appmarket_application_introduce_memo_remark_inner_pic"}).inject(gradeangular)
+        graderatiodiv = new Element("div",{"class":"o2_appmarket_application_comment_gradetotal"}).inject(this.content.applicationcommentrightthree);
+        blackratiodiv = new Element("div",{"class":"o2_appmarket_application_comment_graderatio"}).inject(graderatiodiv);
+        graderratiodivwidth = graderatiodiv.clientWidth;
+        if (commentcount==0){
+            blackratio = 0;
+            blackratiodiv.setStyle("width","0px");
+        }else{
+            blackratio = (parseInt(gradeList[2])/commentcount).toFixed(4);
+            blackratiowidth = blackratio*graderratiodivwidth;
+            blackratiodiv.setStyle("width",blackratiowidth+"px");
+        }   
+        new Element("div",{"text":this.numberFix(blackratio*100,1)+"%","class":"o2_appmarket_application_comment_top_right_graderatioItem"}).inject(this.content.applicationcommentrightthree);
+         //2星
+         new Element("div",{"text":"2","class":"o2_appmarket_application_comment_top_right_graderatioItem"}).inject(this.content.applicationcommentrighttwo);
+         gradeangular = new Element("div",{"class":"o2_appmarket_application_comment_top_right_graderatioItem"}).inject(this.content.applicationcommentrighttwo);
+         new Element("img",{"src":this.content.iconPath+"blackfiveangular.png","class":"o2_appmarket_application_introduce_memo_remark_inner_pic"}).inject(gradeangular)
+         graderatiodiv = new Element("div",{"class":"o2_appmarket_application_comment_gradetotal"}).inject(this.content.applicationcommentrighttwo);
+         blackratiodiv = new Element("div",{"class":"o2_appmarket_application_comment_graderatio"}).inject(graderatiodiv);
+         graderratiodivwidth = graderatiodiv.clientWidth;
+         if (commentcount==0){
+            blackratio = 0;
+            blackratiodiv.setStyle("width","0px");
+        }else{
+            blackratio = (parseInt(gradeList[1])/commentcount).toFixed(4);
+            blackratiowidth = blackratio*graderratiodivwidth;
+            blackratiodiv.setStyle("width",blackratiowidth+"px");
+        }   
+        new Element("div",{"text":this.numberFix(blackratio*100,1)+"%","class":"o2_appmarket_application_comment_top_right_graderatioItem"}).inject(this.content.applicationcommentrighttwo);
+         //1星
+         new Element("div",{"text":"1","class":"o2_appmarket_application_comment_top_right_graderatioItem"}).inject(this.content.applicationcommentrightone);
+         gradeangular = new Element("div",{"class":"o2_appmarket_application_comment_top_right_graderatioItem"}).inject(this.content.applicationcommentrightone);
+         new Element("img",{"src":this.content.iconPath+"blackfiveangular.png","class":"o2_appmarket_application_introduce_memo_remark_inner_pic"}).inject(gradeangular)
+         graderatiodiv = new Element("div",{"class":"o2_appmarket_application_comment_gradetotal"}).inject(this.content.applicationcommentrightone);
+         blackratiodiv = new Element("div",{"class":"o2_appmarket_application_comment_graderatio"}).inject(graderatiodiv); 
+         graderratiodivwidth = graderatiodiv.clientWidth;
+         if (commentcount==0){
+            blackratio = 0;
+            blackratiodiv.setStyle("width","0px");
+        }else{
+            blackratio = (parseInt(gradeList[0])/commentcount).toFixed(4);
+            blackratiowidth = blackratio*graderratiodivwidth;
+            blackratiodiv.setStyle("width",blackratiowidth+"px");
+        }   
+        new Element("div",{"text":this.numberFix(blackratio*100,1)+"%","class":"o2_appmarket_application_comment_top_right_graderatioItem"}).inject(this.content.applicationcommentrightone);        
+    },
+    commentsPower:function(commentdata){
+        var commentText = "";
+        if (commentdata.type && commentdata.type=="success"){
+            if (commentdata.data.value){
+                commentText = "您已评论过该应用!"
+            }
+        }
+        if (this.appdata.installedVersion==""){
+            commentText = "由于您还未安装本应用,因此无法对其进行评分及评论!"
+        }
+        if (commentText == ""){
+            var commentbuttondiv = new Element("div",{"class":"o2_appmarket_application_comment_middle_commentbutton"}).inject(this.content.applicationcommentmiddle);
+            new Element("span",{"class":"o2_appmarket_application_comment_middle_commentbutton_InnerSpan","text":"我要评分及评论"}).inject(commentbuttondiv);
+            var _self = this;
+            commentbuttondiv.addEvents({
+                "click": function(e){
+                     _self.createComment(e);
+                }
+            })
+            
+        }else{
+            new Element("div",{"class":"o2_appmarket_application_comment_middle_tip","text":commentText}).inject(this.content.applicationcommentmiddle);
+        }
+    },
+    commentsView:function(commentdata){
+        var commentsList = commentdata.data;        
+        commentsList.each(function(percomment){
+            var commentcontentdiv = new Element("div",{"class":"o2_appmarket_application_comment_content"}).inject(this.content.applicationcommentbottom);
+            var commentcontentleft = new Element("div",{"class":"o2_appmarket_application_comment_content_left"}).inject(commentcontentdiv);
+            var iconpersondiv = new Element("div",{"class":"o2_appmarket_application_comment_content_left_icon"}).inject(commentcontentleft);
+            new Element("img",{"src":this.content.iconPath+"icon_men.png"}).inject(iconpersondiv);
+            new Element("div",{"class":"o2_appmarket_application_comment_content_left_name","text":percomment.person}).inject(commentcontentleft);
+            var commentcontentright = new Element("div",{"class":"o2_appmarket_application_comment_content_right"}).inject(commentcontentdiv);
+            var commentangulardiv = new Element("div").inject(commentcontentright);
+            for (var tmpi=0;tmpi<parseInt(percomment.grade);tmpi++){
+                new Element("img",{"src":this.content.iconPath+"blackfiveangular.png","class":"o2_appmarket_application_introduce_memo_remark_inner_pic"}).inject(commentangulardiv)
+            }
+            for (var tmpi=0;tmpi<5-parseInt(percomment.grade);tmpi++){
+                new Element("img",{"src":this.content.iconPath+"whitefiveangular.png","class":"o2_appmarket_application_introduce_memo_remark_inner_pic"}).inject(commentangulardiv)
+            }
+            new Element("div",{"class":"o2_appmarket_application_comment_content_title","text":percomment.title}).inject(commentcontentright);
+            new Element("div",{"class":"o2_appmarket_application_comment_content_text","text":percomment.comment,"title":percomment.comment}).inject(commentcontentright);
+            
+        }.bind(this))
+    },
+    reload: function(){
+        if (!this.content.isLoading) {
+            this.loadComments();
+            this.loadCommentPower();
+        }
+    },
+    emptyLoadContent: function(){
+        this.content.commentnode.empty();
+        this.content.isLoading = false;
+    },
+    createComment:function(targetnode){
+        var content = new Element("div", {"styles": {"margin": "20px"}});
+        var xingdiv = new Element("div").inject(content);
+        new Element("div",{"class":"comment_dlg_title","text":"评分:"}).inject(xingdiv);
+        xingpngdiv = new Element("div",{"class":"comment_dlg_png"}).inject(xingdiv);
+        var starnode;
+        var _self = this;
+        var selectstar = 0;
+        for (var tmpi=0;tmpi<5;tmpi++){
+            starnode = new Element("img",{"src":this.content.iconPath+"whitefiveangular.png","class":tmpi+"star comment_dlg_star"}).inject(xingpngdiv);
+            starnode.store("id",tmpi);
+            starnode.addEvents({
+                "click": function(e){
+                     var idnum = this.retrieve("id");
+                     selectstar = idnum + 1;
+                     var starblacknode = this;
+                     var starwhitenode = this.nextElementSibling;
+                     while(starwhitenode){
+                        starwhitenode.set("src",_self.content.iconPath+"whitefiveangular.png");
+                        starwhitenode = starwhitenode.nextElementSibling;
+                     }
+                     while(starblacknode){
+                        starblacknode.set("src",_self.content.iconPath+"blackfiveangular.png");
+                        starblacknode = starblacknode.previousElementSibling
+                     }
+                }
+            })
+        }
+        var cleardiv = new Element("div",{"style":"clear:both"}).inject(content);
+        var commentdiv = new Element("div").inject(content);
+        new Element("div",{"class":"comment_dlg_title","text":"评论:"}).inject(commentdiv);
+        inputdiv = new Element("div",{"class":"comment_dlg_input_div"}).inject(commentdiv);
+        commentcontentNode = new Element("textarea",{"class":"comment_dlg_input"}).inject(inputdiv);
+        o2.DL.open({
+            "title": this.app.lp.commentTitle,
+            "content": content,
+            "width": 740,
+            "height": 520,
+            "buttonList": [
+                {
+                    "text": this.app.lp.ok,
+                    "class":"comment_dlg_button_ok",
+                    "action": function(){
+                        debugger;
+                        if (selectstar==0 || commentcontentNode.get("value")==""){
+                            MWF.xDesktop.notice("error", {x: "right", y:"top"}, "请评分,评论后提交");
+                        }else{
+                            var commentdata = {};
+                            commentdata["title"] = "";
+                            commentdata["application"] = _self.appdata.id;
+                            commentdata["grade"] = selectstar+"";
+                            commentdata["comment"] = commentcontentNode.get("value");
+                            _self.submitComment(commentdata);                        
+                            this.close();
+                        }
+                    }
+                },
+                {
+                    "text": this.app.lp.cancel,
+                    "class":"comment_dlg_button_cancel",
+                    "action": function(){this.close();}
+                }
+            ]
+        });
+    },
+    submitComment:function(commentdata){
+        var tmpjson= JSON.stringify(commentdata);
+        var commenturl = this.app.collectUrl +'/o2_collect_assemble/jaxrs/comment';
+        var res = new Request.JSON({
+            "url": commenturl,
+            "headers" : {"Content-Type": "application/json; charset=utf-8","x-debugger" : true,"Authorization":this.app.collectToken,"c-token":this.app.collectToken},
+            secure: false,
+            "method": "POST",
+            secure: false,
+            emulation: false,
+            noCache: true,
+            withCredentials: true, 
+            crossDomain : true,
+            "data": JSON.stringify(commentdata),
+            onSuccess: function(responseJSON, responseText){
+                debugger;
+                MWF.xDesktop.notice("success", {x: "right", y:"top"}, this.app.lp.commentsuccess);
+                this.app.loadIntroduceComment();
+            }.bind(this),
+            onFailure: function(xhr){
+                MWF.xDesktop.notice("error", {x: "right", y:"top"}, xhr);
+            }.bind(this),
+            onError: function(text, error){
+                MWF.xDesktop.notice("error", {x: "right", y:"top"}, text);
+            }.bind(this)
+        });
+        res.send();
+    },
+    numberFix:function(data,n){
+        var numbers = '';
+        // 保留几位小数后面添加几个0
+        for (var i = 0; i < n; i++) {
+            numbers += '0';
+        }
+        var s = 1 + numbers;
+        // 如果是整数需要添加后面的0
+        var spot = "." + numbers;
+        // Math.round四舍五入  
+        //  parseFloat() 函数可解析一个字符串,并返回一个浮点数。
+        var value = Math.round(parseFloat(data) * s) / s;
+        // 从小数点后面进行分割
+        var d = value.toString().split(".");
+        if (d.length == 1) {
+            value = value.toString();
+            return value;
+        }
+        if (d.length > 1) {
+            if (d[1].length < n) {
+                value = value.toString() + "0";
+            }
+            return value;
+        }
+    }
+    
+})

+ 328 - 0
o2web/source/x_component_AppMarketV2_Application/Main.js

@@ -0,0 +1,328 @@
+MWF.xApplication.AppMarketV2.Application.options.multitask = true;
+MWF.require("MWF.widget.MaskNode", null, false);
+MWF.xApplication.AppMarketV2.Application.Main = new Class({
+    Extends: MWF.xApplication.Common.Main,
+    Implements: [Options, Events],
+    options: {
+        "style": "default",
+		"mvcStyle": "style.css",
+		"view": "applicationView.html",
+        "name": "AppMarketV2.Application",
+        "icon": "icon.png",
+        "width": "1000",
+        "height": "700",
+        "isResize": true,
+		"isMax": true,
+        "title": MWF.xApplication.AppMarketV2.Application.LP.title,
+        "minHeight": 700
+    },
+    onQueryLoad: function(){
+        this.lp = MWF.xApplication.AppMarketV2.Application.LP;
+        this.actions = MWF.Actions.load("x_program_center");
+		this.viewPath = this.path+this.options.style+"/"+this.options.view;
+		this.iconPath = this.path+this.options.style+"/icon/";
+		this.collectToken = "";
+        this.collectUrl = "";
+		if (!this.status) {
+        } else {
+            this.options.appid = this.status.appid;
+        }
+		this.appdata = {};
+	},
+	mask: function(){
+        if (!this.maskNode){
+            this.maskNode = new MWF.widget.MaskNode(this.introducenode, {"style": "bam"});
+            this.maskNode.load();
+        }
+    },
+    unmask: function(){
+        if (this.maskNode) this.maskNode.hide(function(){
+            MWF.release(this.maskNode);
+            this.maskNode = null;
+        }.bind(this));
+    },
+    loadApplication: function(callback){
+
+		if (this.collectToken=="" || this.collectUrl==""){
+            //先登录collcect
+            this.actions.CollectAction.login(//平台封装好的方法
+                function( json ){ //服务调用成功的回调函数, json为服务传回的数据
+                    if (json.type && json.type=="success"){
+                        data = json.data; //为变量data赋值
+                        this.collectUrl = data.collectUrl;
+                        this.collectToken = data.collectToken;
+                        this.content.loadHtml(this.viewPath, {"bind": {"lp": this.lp}, "module": this}, function(){
+							if (!this.options.isRefresh){
+								this.maxSize(function(){
+									this.loadIntroduce(callback);
+								}.bind(this));
+							}else{
+								this.loadIntroduce(callback);
+							}
+						}.bind(this));
+                    }
+                }.bind(this),null,false //同步执行 
+            );
+		}	
+		
+	},
+	initNodeSize: function(){
+		this.resizeNodeSize();
+		this.addEvent("resize", this.resizeNodeSize.bind(this));
+	},
+	resizeNodeSize: function(){
+		var size = this.content.getSize();
+		var edge = this.introducenode.getEdgeHeight();
+		var height = size.y - edge;
+		if (height<this.options.minHeight) height = this.options.minHeight;
+		this.introducenode.setStyle("height", ""+height+"px");
+	},
+	loadIntroduce:function(callback){
+		debugger;
+		this.initNodeSize();
+		if (this.options.appid){
+			this.actions.MarketAction.get(this.options.appid,function(json){
+				if (json.data && json.data.icon){
+					this.appdata = json.data;
+					var applicationicon = new Element("div",{"class":"o2_appmarket_application_introduce_icon"}).inject(this.applicationintroduceiconcontain);
+					applicationicon.setStyle("background-image", "url(data:image/png;base64,"+this.appdata.icon+")");
+					if (this.applicationintroduceiconcontain.clientWidth<300){
+						applicationicon.setStyle("width",this.applicationintroduceiconcontain.clientWidth);
+						applicationicon.setStyle("height",450*this.applicationintroduceiconcontain.clientWidth/300);
+					}
+					
+					var price=this.appdata.price>0?this.appdata.price+"":"Free";
+					this.applicationintroducememofree.set("text",price);
+					this.applicationintroducememoname.set("text",this.appdata.name);
+					var grade = this.numberFix(this.appdata.grade,1);
+					this.applicationintroducememoremarkgrade.set("text",grade);
+					var intgrade = parseInt(grade);
+					var dotgrade = grade - intgrade;
+					for (var tmpnum=0;tmpnum<intgrade;tmpnum++){
+						new Element("img",{"src":this.iconPath+"blackfiveangular.png","class":"o2_appmarket_application_introduce_memo_remark_inner_pic"}).inject(this.applicationintroducememoremarkiconangular)
+					}
+					if (dotgrade>=0.5){
+						new Element("img",{"src":this.iconPath+"halffiveangular.png","class":"o2_appmarket_application_introduce_memo_remark_inner_pic"}).inject(this.applicationintroducememoremarkiconangular);
+						intgrade++;
+					}
+					for (var tmpnum=0;tmpnum<5-intgrade;tmpnum++){
+						new Element("img",{"src":this.iconPath+"whitefiveangular.png","class":"o2_appmarket_application_introduce_memo_remark_inner_pic"}).inject(this.applicationintroducememoremarkiconangular);
+					}
+					if (!this.appdata.commentCount) this.appdata.commentCount=0;					
+					this.applicationintroducememoremarkcommentcount.set("text","共"+this.appdata.commentCount+"个评分")
+					//this.applicationintroducememodownload.set("text",this.appdata.downloadCount);
+					this.applicationintroducememocategory.set("text","分类:"+this.appdata.category);
+					this.applicationintroducememocontent.set("html",this.appdata.abort);
+					this.applicationintroducedownloadprice.set("text","$"+this.appdata.price);
+
+					var bottomtext =this.lp.setup;
+					if (this.appdata.installedVersion && this.appdata.installedVersion!=""){
+						if (this.appdata.installedVersion==this.appdata.version){
+							 bottomtext = this.lp.setupDone;
+						}else{
+							 bottomtext = this.lp.update;
+						}
+					}
+					this.applicationintroducedownloadbtntext.set("text",bottomtext);
+					
+					var _self = this;
+					this.applicationintroducedownloadbtn.store("data",this.appdata);
+					this.applicationintroducedownloadbtn.addEvents({
+						"click": function(e){
+							//updateorinstall application
+							var d = this.retrieve("data");
+							if (d){
+								_self.installapp(e,d);
+							}
+						}
+					})
+					
+					//this.applicationintroducefavbtntext.set("text","下载");
+
+					this.loadIntroduceInfo();
+					
+				}
+				this.fireEvent("load");
+			}.bind(this));
+		}
+		
+		if (callback) callback();
+	},
+    tabover: function(e){
+        e.currentTarget.addClass("o2_appmarket_appcategory_tab_over");
+    },
+    tabout: function(e){
+        e.currentTarget.removeClass("o2_appmarket_appcategory_tab_over");
+        //e.currentTarget.removeClass("mainColor_border").removeClass("mainColor_color");
+	},
+	mouseover:function(){
+		debugger;
+		this.addClass("o2_appmarket_appcategory_tab_over");
+	},
+	mouseout:function(){
+		this.removeClass("o2_appmarket_appcategory_tab_over");
+	},
+	installapp:function(e,d){
+		var p = e.target.getPosition();
+		var tmpe = {"event": {"x": p.x+40, "y": p.y}};
+		var confirmtitle = d.installedVersion==""?this.lp.confirmsetupTitle:this.lp.confirmupdateTitle;
+		var confirmcontent = d.installedVersion==""?this.lp.confirmsetupContent:this.lp.confirmupdateContent;
+		var _self = this;
+		MWF.xDesktop.confirm("warn", tmpe, confirmtitle, confirmcontent, 300, 120, function(){
+			_self.mask();
+			//this.createLoading(this.container,true);  
+			//alert("after createLoading")          
+			_self.actions.MarketAction.installOrUpdate(
+				d.id,
+			function( json ){ 
+				data = json.data; 
+				_self.notice(d.name+" "+_self.lp.setupSuccess, "success");
+				_self.unmask();
+				//this.clearLoading()
+			}.bind(_self),
+			function( json ){ 
+				data = json.data; 
+				debugger;
+				_self.unmask();
+				//this.clearLoading()
+			}.bind(_self),
+				true
+			);
+			this.close();
+		}, function(){
+			this.close();
+		}, null, null, "o2");        
+	},
+
+	loadIntroduceInfo: function(callback){
+		debugger;
+		var _self = this;
+		this.applicationintroducesinfoTab.getParent().getElements(".o2_appmarket_application_introduce_tab_current").removeClass("mainColor_color").removeClass("o2_appmarket_application_introduce_tab_current").addClass("o2_appmarket_application_introduce_tab");
+		this.applicationintroducesinfoTab.removeClass("o2_appmarket_application_introduce_tab").addClass("mainColor_color").addClass("o2_appmarket_application_introduce_tab_current");
+		this.applicationintroducecontent.set("html","");
+		this.applicationintroducecontent.set("html",this.appdata.abort);
+		this.applicationintroducepicslable.set("html","");
+		this.applicationintroducepics.set("html","")
+		this.applicationintroducepicslable.set("html","屏幕截图");			//截图
+		this.appdata.attList.each(function(peratt,i){
+				if (peratt.type == "image"){
+					picdiv = new Element("img",{"class":"o2_appmarket_application_introduce_pic"}).inject(this.applicationintroducepics);
+					picdiv.setProperty("src", "data:image/png;base64,"+peratt.icon);
+					picdiv.setProperty("data-original",this.collectUrl +'/o2_collect_assemble/jaxrs/attachment/download/'+peratt.id+"?c-token="+this.collectToken);
+					picdiv.setProperty("alt",peratt.name);
+					//picdiv.store("id",peratt.id);
+					/*
+					picdiv.addEvents({
+						"click": function(e){
+							//updateorinstall application
+							var d = this.retrieve("id");
+							if (d){
+								_self.openLargeImage(e,d);
+							}
+						}
+					})
+					*/
+				}
+		}.bind(this));
+		this.loadImgView();
+	},
+	
+	loadImgView:function(){				
+        if(this.viewer) this.viewer.destroy();
+        this.applicationintroducepics.setProperty("id","list");
+        o2.loadCss(this.path+this.options.style+"/viewer.css", this.content,function(){
+            o2.load(this.path+this.options.style+"/viewer.js", function(){
+                this.viewer = new Viewer(document.getElementById('list'), {
+                	url: 'data-original'
+                });                
+            }.bind(this));
+        }.bind(this));           
+	},
+	
+	loadIntroduceDemand:function(callback){
+		debugger;
+		this.applicationintroducedemandTab.getParent().getElements(".o2_appmarket_application_introduce_tab_current").removeClass("mainColor_color").removeClass("o2_appmarket_application_introduce_tab_current").addClass("o2_appmarket_application_introduce_tab");
+		this.applicationintroducedemandTab.removeClass("o2_appmarket_application_introduce_tab").addClass("mainColor_color").addClass("o2_appmarket_application_introduce_tab_current");
+		this.applicationintroducecontent.set("html","");
+		this.applicationintroducepicslable.set("html","");
+		this.applicationintroducepics.set("html","")
+		this.applicationintroducecontent.set("html",this.appdata.installSteps);
+
+	},
+	loadIntroduceComment:function(callback){
+		debugger;
+		this.applicationintroducecommentTab.getParent().getElements(".o2_appmarket_application_introduce_tab_current").removeClass("mainColor_color").removeClass("o2_appmarket_application_introduce_tab_current").addClass("o2_appmarket_application_introduce_tab");
+		this.applicationintroducecommentTab.removeClass("o2_appmarket_application_introduce_tab").addClass("mainColor_color").addClass("o2_appmarket_application_introduce_tab_current");
+		this.applicationintroducecontent.set("html","");
+		this.applicationintroducepicslable.set("html","");
+		this.applicationintroducepics.set("html","");
+		o2.requireApp("AppMarketV2.Application", "Comment", function(){
+			new MWF.xApplication.AppMarketV2.Application.Comment(this, this.applicationintroducecontent, {
+				"onLoad": function(){if (callback) callback();}
+			});
+		}.bind(this));
+	},
+	/*
+	openLargeImage:function(e,id){
+		//alert(this.collectUrl)
+		if (this.collectUrl=="" || this.collectToken==""){
+			this.actions.CollectAction.login(//平台封装好的方法
+				function( json ){ //服务调用成功的回调函数, json为服务传回的数据
+					if (json.type && json.type=="success"){
+						data = json.data; //为变量data赋值
+						this.collectUrl = data.collectUrl;
+						this.collectToken = data.collectToken;						
+						//download large image by attimageid
+						this.openLargeImageDl(id);
+					}					
+				}.bind(this),null,false //同步执行 	
+			)    
+		}else{
+			this.openLargeImageDl(id);
+		}		
+	},
+	openLargeImageDl:function(id){
+		var downloadurl = this.collectUrl +'/o2_collect_assemble/jaxrs/attachment/download/'+id+"?c-token="+this.collectToken;
+		var content = new Element("div", {"styles": {"overflow": "auto"}});
+				var largepicdiv = new Element("div", {"styles": {"overflow": "hidden"}}).inject(content);
+				new Element("img",{"src":downloadurl}).inject(largepicdiv);
+				o2.DL.open({
+					"title": "",
+					"content": content,
+					"width": 1200,
+					"height": 800,
+					"buttonList": [
+					]
+				});
+	},
+	*/
+	recordStatus: function(){
+	    debugger;
+        return {"appid": this.options.appid};x
+    },
+    numberFix:function(data,n){
+        var numbers = '';
+        // 保留几位小数后面添加几个0
+        for (var i = 0; i < n; i++) {
+            numbers += '0';
+        }
+        var s = 1 + numbers;
+        // 如果是整数需要添加后面的0
+        var spot = "." + numbers;
+        // Math.round四舍五入  
+        //  parseFloat() 函数可解析一个字符串,并返回一个浮点数。
+        var value = Math.round(parseFloat(data) * s) / s;
+        // 从小数点后面进行分割
+        var d = value.toString().split(".");
+        if (d.length == 1) {
+            value = value.toString();
+            return value;
+        }
+        if (d.length > 1) {
+            if (d[1].length < n) {
+                value = value.toString() + "0";
+            }
+            return value;
+        }
+    }
+});

+ 21 - 0
o2web/source/x_component_AppMarketV2_Application/lp/zh-cn.js

@@ -0,0 +1,21 @@
+MWF.xApplication.AppMarketV2.Application.LP = {
+	"title": "应用市场V2",
+    "implodeLocal": "从本地导入",
+    "download": "免费下载",
+    "setup": "安装",
+    "setupDone":"已安装",
+    "update":"更新",
+    "ok": "确定",
+    "cancel": "取消",
+    "setupSuccess": "应用安装成功!",
+    "localApp": "本地应用",
+    "appInfoTab":"功能介绍",
+    "appDemandTab":"安装及使用",
+    "appCommentTab":"评分及评论",
+    "commentTitle":"评分及评论",
+    "commentsuccess":"评论成功",
+    "confirmsetupTitle":"安装提示",
+    "confirmsetupContent":"您确认安装本应用么?",
+    "confirmupdateTitle":"更新提示",
+    "confirmupdateContent":"您确认更新本应用么?如果安装应用后改过本应用,本次更新后会被替换"
+};