From 8004db9ae141e537abefd0e95dce2210f2e56d56 Mon Sep 17 00:00:00 2001 From: “shentao” Date: Sat, 8 Oct 2016 21:18:18 +0800 Subject: modify main_page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I7e80ff78534db0d5c1fcfc69b690858d76a7a924 Signed-off-by: “shentao” --- .../src/main/webapp/common/js/core/const.js | 2 +- .../common/js/international/loadi18n-login.js | 2 +- .../webapp/common/js/international/loadi18n.js | 116 ++++++----------- .../src/main/webapp/common/js/login.js | 65 +++++----- .../webapp/common/js/mainpage/ict.main.page.js | 138 --------------------- .../webapp/common/js/mainpage/load_mainPage.js | 97 +++++++++++++++ 6 files changed, 169 insertions(+), 251 deletions(-) delete mode 100644 openo-portal/portal-common/src/main/webapp/common/js/mainpage/ict.main.page.js create mode 100644 openo-portal/portal-common/src/main/webapp/common/js/mainpage/load_mainPage.js (limited to 'openo-portal/portal-common/src/main/webapp/common/js') diff --git a/openo-portal/portal-common/src/main/webapp/common/js/core/const.js b/openo-portal/portal-common/src/main/webapp/common/js/core/const.js index fc1e69bd..d8a3371e 100644 --- a/openo-portal/portal-common/src/main/webapp/common/js/core/const.js +++ b/openo-portal/portal-common/src/main/webapp/common/js/core/const.js @@ -25,7 +25,7 @@ var IS_V5_TESTVERSION = true; var FrameConst={}; //Ĭϵ¼ɹתҳ -FrameConst.DEFAULT_LOGINSKIP_PAGE = "main-page.html"; +FrameConst.DEFAULT_LOGINSKIP_PAGE = "common/main-page.html"; FrameConst.do_heartbeat = false; FrameConst.change_pass = false; diff --git a/openo-portal/portal-common/src/main/webapp/common/js/international/loadi18n-login.js b/openo-portal/portal-common/src/main/webapp/common/js/international/loadi18n-login.js index bdbb4057..ac9f77e0 100644 --- a/openo-portal/portal-common/src/main/webapp/common/js/international/loadi18n-login.js +++ b/openo-portal/portal-common/src/main/webapp/common/js/international/loadi18n-login.js @@ -20,7 +20,7 @@ function loadProperties_login(lang) { path:'./common/i18n/', mode:'map', callback: function() { - var i18nItems = $('[name_i18n=com_zte_ums_ict_framework_ui_i18n_login]'); + var i18nItems = $('[name_i18n=openo_login_i18n_login]'); for (var i = 0; i < i18nItems.length; i++) { var $item = $(i18nItems.eq(i)); var itemId = $item.attr('id'); diff --git a/openo-portal/portal-common/src/main/webapp/common/js/international/loadi18n.js b/openo-portal/portal-common/src/main/webapp/common/js/international/loadi18n.js index d62dbbd9..adfcbb98 100644 --- a/openo-portal/portal-common/src/main/webapp/common/js/international/loadi18n.js +++ b/openo-portal/portal-common/src/main/webapp/common/js/international/loadi18n.js @@ -14,97 +14,55 @@ * limitations under the License. */ var lang = getLanguage(); -//lang = 'en-US'; -//加载主页面head部分国际化 -function loadProperties(lang){ - jQuery.i18n.properties({ - language:lang, - name:'web-framework-integration-i18n', - path:'i18n/', // 资源文件路径 - mode:'map', // 用 Map 的方式使用资源文件中的值 - callback: function() {// 加载成功后设置显示内容 - var i18nItems = $('[name_i18n=com_zte_ums_ict_framework_ui_i18n]'); - for(var i=0;i" + - "
" + - "
{cover}
" + - "
" + - "
{contentTip}
" + - "
" + - "" + - ""; - - var templatePic = "
" + - "
" + - "
{cover}
" + - "
" + - "
{contentTip}
" + - "
" + - "
"; - - for (var i = 0; i < modules.length; ++i) { - - if(!modules[i].background){ - alert("Brick background missed!"); - return; - } - - var temp = ""; - - if(modules[i].linkId){ - temp = template.replace("{linkId}", modules[i].linkId) - .replace("{image}", modules[i].background) - .replace("{toolsImage}", modules[i].toolsImage) - .replace("{url}", modules[i].url) - .replace("{contentTip}", modules[i].contentTip); - }else{ - temp = templatePic.replace("{image}", modules[i].background) - .replace("{url}", modules[i].url) - .replace("{contentTip}", ""); - } - - if(modules[i].cover){ - temp = temp.replace("{cover}", ""); - }else{ - temp = temp.replace("{cover}",""); - } - - $($(".column")[i % 4]).append(temp); - - } - - - $(function() { - - $("#headerName").html("" ); - - $(".brick").mouseover(function(){ - $(".contentTip", this).fadeTo(1000, 1); - $(".cover", this).fadeOut(1000); - }); - - $(".brick").mouseout(function(){ - $(".contentTip", this).fadeTo(1000, 0); - $(".cover", this).fadeIn(1000); - }); - - //添加模块导航链接 - $("a.entranceLink").click(function(e){ - e.preventDefault(); - if($(this).attr("id") && $(this).attr("id") != "undefined"){ - location.href = "default.html" + "#_" + $(this).attr("id"); - } - }); - - //国际化 - loadPropertiesSideMenu(lang, propertiesFileNamePrefix, "appRes/i18n/" , "com_zte_ums_ict_framework_ui_i18n"); - //loadPropertiesSideMenu(lang, propertiesFileNamePrefix, "i18n/" , "com_zte_ums_ict_framework_ui_i18n"); - loadPropertiesSideMenu(lang, "web-framework-integration-i18n", "i18n/" , "com_zte_ums_ict_framework_ui_i18n"); - }); -} \ No newline at end of file diff --git a/openo-portal/portal-common/src/main/webapp/common/js/mainpage/load_mainPage.js b/openo-portal/portal-common/src/main/webapp/common/js/mainpage/load_mainPage.js new file mode 100644 index 00000000..05704b56 --- /dev/null +++ b/openo-portal/portal-common/src/main/webapp/common/js/mainpage/load_mainPage.js @@ -0,0 +1,97 @@ +/* + * Copyright 2016, CMCC Technologies Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var initMainPage = function() { + var modules; + var resConfig; + var lang = getLanguage(); + var propertiesFileNamePrefix = ""; + + $.ajax({ + async : false, + "type" : "GET", + url : "json/main-page.json", + dataType : "json", + "success" : function (res, textStatus, jqXHR) { + resConfig = res; + modules = res.modules; + propertiesFileNamePrefix = res.propertiesFileNamePrefix; + }, + error : function () { + } + }); + + var template = ""; + + var templatePic = "
" + + "
" + + "
{cover}
" + + "
" + + "
{contentTip}
" + + "
" + + "
"; + + for (var i = 0; i < modules.length; ++i) { + var temp = ""; + if (modules[i].linkId) { + temp = template.replace("{linkId}", modules[i].linkId) + .replace("{image}", modules[i].background) + .replace("{toolsImage}", modules[i].toolsImage) + .replace("{url}", modules[i].url) + .replace("{contentTip}", modules[i].contentTip); + } else { + temp = templatePic.replace("{image}", modules[i].background) + .replace("{url}", modules[i].url) + .replace("{contentTip}", ""); + } + + if (modules[i].cover) { + temp = temp.replace("{cover}", ""); + } else { + temp = temp.replace("{cover}",""); + } + + $($(".column")[i % 4]).append(temp); + } + + $(function() { + $(".brick").mouseover(function() { + $(".contentTip", this).fadeTo(1000, 1); + $(".cover", this).fadeOut(1000); + }); + + $(".brick").mouseout(function() { + $(".contentTip", this).fadeTo(1000, 0); + $(".cover", this).fadeIn(1000); + }); + + $("a.entranceLink").click(function(e) { + e.preventDefault(); + if ($(this).attr("id") && $(this).attr("id") != "undefined") { + location.href = "default.html" + "#_" + $(this).attr("id"); + } + }); + + loadPropertiesSideMenu(lang, propertiesFileNamePrefix, "i18n/" , "openo_main_page_i18n"); + }); +} \ No newline at end of file -- cgit 1.2.3-korg