|
@@ -330,6 +330,10 @@ function utilShowToast(info, showTime) {
|
|
|
}, showTimes);
|
|
|
}
|
|
|
|
|
|
+var GLOBAL = {
|
|
|
+ HOME_PAGE_URL: 'page.html#home'
|
|
|
+};
|
|
|
+
|
|
|
function gotoPageWithoutHistory(url) {
|
|
|
var curHref = window.location.href;
|
|
|
var curSearch = window.location.search;
|
|
@@ -403,7 +407,7 @@ function SelectItem(obj) {
|
|
|
}
|
|
|
$('#' + selectitemsid).toggle();
|
|
|
if (selectitemsLength > SHOW_MAX_ITEM_COUNT) {
|
|
|
- EMUI.Scroll.initScroll('#' + selectitemsid + '_items');
|
|
|
+ RVC.Scroll.initScroll('#' + selectitemsid + '_items');
|
|
|
}
|
|
|
var container;
|
|
|
var content;
|
|
@@ -726,7 +730,7 @@ function showErrorMsg(divid, errormsgid, para) {
|
|
|
}
|
|
|
if (para) {
|
|
|
msgcontent = msgcontent.replace('%d', para);
|
|
|
- msgcontent = msgcontent.replace('%s', publicLang[para]);
|
|
|
+ msgcontent = msgcontent.replace('%s', para);
|
|
|
}
|
|
|
errorLabel += '<div class="clearboth error_message">';
|
|
|
if ($('#' + divid).find('.control-label-win').length !== 0) {
|
|
@@ -736,7 +740,7 @@ function showErrorMsg(divid, errormsgid, para) {
|
|
|
errorLabel += '<div class="control-label"> </div>';
|
|
|
errorLabel += '<div class="controls-win">';
|
|
|
}
|
|
|
- errorLabel += '<div id="' + msgid + '" lang-id="' + errormsgid + '" class="error_info ">' + msgcontent + '</div>';
|
|
|
+ errorLabel += '<div id="' + msgid + ' class="error_info ">' + msgcontent + '</div>';
|
|
|
errorLabel += '</div>';
|
|
|
errorLabel += '</div>';
|
|
|
var classVal = '';
|
|
@@ -769,9 +773,6 @@ function showErrorMsg(divid, errormsgid, para) {
|
|
|
});
|
|
|
}
|
|
|
$('#' + divid).secureAppend(errorLabel);
|
|
|
- if (para) {
|
|
|
- EMUI.LanguageController.registerLanguage(msgid, errormsgid, para);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
function showRangeErrorMsg(divid, errormsgid, para1, para2) {
|
|
@@ -999,6 +1000,556 @@ $(function () {
|
|
|
return temp;
|
|
|
};
|
|
|
|
|
|
+ RVC.popWinController = RVC.Object.extend({
|
|
|
+ content: [],
|
|
|
+ isautoUpgChecked: false,
|
|
|
+ closeAll: function () {
|
|
|
+ var contentLength = this.content.length;
|
|
|
+ for (var i = 0; i < contentLength; i++) {
|
|
|
+ this.content[i]['isClose'] = true;
|
|
|
+ }
|
|
|
+ $('#emui_content_pop_win').hide();
|
|
|
+ },
|
|
|
+ closePopItem: function (moduleName) {
|
|
|
+ var contentLength = this.content.length;
|
|
|
+ for (var i = 0; i < contentLength; i++) {
|
|
|
+ if (this.content[i]['moduleName'] === moduleName) {
|
|
|
+ this.content[i]['isClose'] = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.showPop();
|
|
|
+ showPopWin();
|
|
|
+ },
|
|
|
+ addPopItem: function (moduleName, scribInfoId, contentItem) {
|
|
|
+ if (typeof contentItem === 'undefined' && contentItem === '') {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var isNeedShowAgain = false;
|
|
|
+ var scribInfo = '';
|
|
|
+ if (typeof scribInfoId !== 'undefined') {
|
|
|
+ scribInfo = scribInfoId;
|
|
|
+ }
|
|
|
+ var isExist = false;
|
|
|
+ var contentLen = this.content.length;
|
|
|
+ for (var i = 0; i < contentLen; i++) {
|
|
|
+ if (this.content[i]['moduleName'] === moduleName) {
|
|
|
+ if (contentItem !== this.content[i]['contentinfo']) {
|
|
|
+ this.content[i]['scribInfoId'] = scribInfo;
|
|
|
+ this.content[i]['contentinfo'] = contentItem;
|
|
|
+ this.content[i]['isClose'] = false;
|
|
|
+ isNeedShowAgain = true;
|
|
|
+ }
|
|
|
+ isExist = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!isExist) {
|
|
|
+ var conItem = {};
|
|
|
+ conItem.moduleName = moduleName;
|
|
|
+ conItem.scribInfoId = scribInfo;
|
|
|
+ conItem.contentinfo = contentItem;
|
|
|
+ conItem.isClose = false;
|
|
|
+ isNeedShowAgain = true;
|
|
|
+ this.content.push(conItem);
|
|
|
+ }
|
|
|
+ if (isNeedShowAgain) {
|
|
|
+ this.showPop();
|
|
|
+ showPopWin();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ toggleMessage: function (index) {
|
|
|
+ var arrowId = 'arrow_content_message_pop_' + index;
|
|
|
+ var messageId = 'body_content_message_pop_' + index;
|
|
|
+ for (var i = 0; i < this.content.length; i++) {
|
|
|
+ var contentItem = this.content[i];
|
|
|
+ if (contentItem['isClose'] === false && i !== index) {
|
|
|
+ $('#body_content_message_pop_' + i).hide();
|
|
|
+ $('#arrow_content_message_pop_' + i).removeClass('menu_arrow_open').addClass('menu_arrow_close');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ($('#' + arrowId).hasClass('menu_arrow_close')) {
|
|
|
+ $('#' + arrowId).removeClass('menu_arrow_close').addClass('menu_arrow_open');
|
|
|
+ } else {
|
|
|
+ $('#' + arrowId).removeClass('menu_arrow_open').addClass('menu_arrow_close');
|
|
|
+ }
|
|
|
+ $('#' + messageId).toggle();
|
|
|
+ showPopWin();
|
|
|
+ },
|
|
|
+ showPop: function () {
|
|
|
+ var self = this;
|
|
|
+ var contentLen = this.content.length;
|
|
|
+ if (contentLen === 0) {
|
|
|
+ $('#pop_win_content_area').empty();
|
|
|
+ $('#emui_content_pop_win').hide();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var showContent = [];
|
|
|
+ var i = 0;
|
|
|
+ var openIndex = '';
|
|
|
+ var curHash = window.location.hash.substr(1);
|
|
|
+ for (i = 0; i < this.content.length; i++) {
|
|
|
+ var contentItem = this.content[i];
|
|
|
+ if (contentItem['isClose'] === false && contentItem['moduleName'].toLowerCase().indexOf(curHash) < 0) {
|
|
|
+ showContent.push(contentItem);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ contentLen = showContent.length;
|
|
|
+ if (contentLen > 1) {
|
|
|
+ for (i = 0; i < contentLen; i++) {
|
|
|
+ var arrowId = 'arrow_content_message_pop_' + i;
|
|
|
+ if ($('#' + arrowId).hasClass('menu_arrow_open')) {
|
|
|
+ openIndex = i;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $('#pop_win_content_area').empty();
|
|
|
+ $('#emui_pop_win_title').empty();
|
|
|
+ if (contentLen === 0) {
|
|
|
+ $('#pop_win_content_area').empty();
|
|
|
+ $('#emui_content_pop_win').hide();
|
|
|
+ return;
|
|
|
+ } else if (contentLen === 1) {
|
|
|
+ $('#pop_win_content_area').empty();
|
|
|
+ $('#emui_pop_win_title').empty();
|
|
|
+ $('#emui_pop_win_title').attr('lang-id', showContent[0]['scribInfoId']);
|
|
|
+ langStr('emui_pop_win_title', showContent[0]['scribInfoId']);
|
|
|
+ $('#pop_win_content_area').html(showContent[0]['contentinfo']);
|
|
|
+ } else {
|
|
|
+ var bacicHtml = [];
|
|
|
+ $('#emui_pop_win_title').attr('lang-id', 'device.new.message');
|
|
|
+ langStr('emui_pop_win_title', 'device.new.message');
|
|
|
+ for (i = 0; i < contentLen; i++) {
|
|
|
+ var classTop = 'border_top message_item_split';
|
|
|
+ if (i === 0) {
|
|
|
+ classTop = '';
|
|
|
+ }
|
|
|
+ var htmlItem = '<div id="content_message_pop_' + i + '" onclick="EMUI.popWinController.toggleMessage(' + i + ');" class="clearboth list_shared pointer ' + classTop + '">'
|
|
|
+ + '<div class="dev-table-ip ic_header_new pull-left"></div>'
|
|
|
+ + '<div class="pull-left public_item_left" lang-id="' + showContent[i]['scribInfoId'] + '">' + publicLang[showContent[i]['scribInfoId']] + '</div>'
|
|
|
+ + '<div id="arrow_content_message_pop_' + i + '" class="pull-right menu_arrow_close"></div></div><div class="clearboth"></div>'
|
|
|
+ + '<div class="border_top hide" id="body_content_message_pop_' + i + '" style="margin-top:20px;"><div style="margin-top:20px;">' + showContent[i]['contentinfo'] + '</div></div><div class="clearboth"></div>';
|
|
|
+ bacicHtml.push(htmlItem);
|
|
|
+ }
|
|
|
+ bacicHtml = '<div style="margin-bottom:10px;">' + bacicHtml.join('') + '</div>';
|
|
|
+ $('#pop_win_content_area').html(bacicHtml);
|
|
|
+ }
|
|
|
+ $(showContent).each(function (i, value) {
|
|
|
+ if (value.moduleName === 'upgrade' && GLOBAL.modules.china_region_enable === '1') {
|
|
|
+ self.autoUpgStatus();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $('#emui_content_pop_win').show();
|
|
|
+ if (openIndex !== '') {
|
|
|
+ this.toggleMessage(openIndex);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ autoUpgStatus: function () {
|
|
|
+ if (!this.isautoUpgChecked) {
|
|
|
+ EMUI.indexAutoUpgradeController.load(null, false);
|
|
|
+ this.isautoUpgChecked = true;
|
|
|
+ }
|
|
|
+ if (EMUI.indexAutoUpgradeController.isOpenAutoUpg === 1) {
|
|
|
+ $('#index_autoUpg').show();
|
|
|
+ $('#index_autoUpg_check').attr('class', 'check_on');
|
|
|
+ } else if (EMUI.indexAutoUpgradeController.isOpenAutoUpg === 0) {
|
|
|
+ $('#index_autoUpg').show();
|
|
|
+ $('#index_autoUpg_check').attr('class', 'check_off');
|
|
|
+ } else {
|
|
|
+ $('#index_autoUpg').hide();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ RVC.Scroll = RVC.Object.extend({
|
|
|
+ i: 0,
|
|
|
+ cancelSelectListEvent: false,
|
|
|
+ boxH: {},
|
|
|
+ textH: {},
|
|
|
+ intervalResizeObj: {},
|
|
|
+ isHiddenOld: {},
|
|
|
+ mouseData: {
|
|
|
+ startY: 0,
|
|
|
+ curTop: 0,
|
|
|
+ startBoolear: false,
|
|
|
+ startSelector: ''
|
|
|
+ },
|
|
|
+ touchData: {
|
|
|
+ startY: 0,
|
|
|
+ curTop: 0,
|
|
|
+ startBoolear: false,
|
|
|
+ startSelector: ''
|
|
|
+ },
|
|
|
+ isStartMouseWheel: false,
|
|
|
+ initScroll: function (selectorS) {
|
|
|
+ var self = this;
|
|
|
+ $.each($(selectorS), function (index, selector) {
|
|
|
+ var $selector = $(selector);
|
|
|
+ var i = self.i;
|
|
|
+ if ($selector.find('.scroll_text').length > 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ self.$selector = $selector;
|
|
|
+ self.initBoxHtml($selector, i);
|
|
|
+ self.resize($selector);
|
|
|
+ self.resizeTop($('#scroll_bar_' + i), 0);
|
|
|
+ self.intervalResizeObj[i] = setInterval(function () {
|
|
|
+ self.intervalResize($selector, i);
|
|
|
+ }, 50);
|
|
|
+ self.bindEvent(i);
|
|
|
+ self.i++;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ callbacks: {},
|
|
|
+ callback: function (selectorS, callbackFun) {
|
|
|
+ var self = this;
|
|
|
+ $.each($(selectorS), function (index, selector) {
|
|
|
+ var i = $(selector).attr('scrollID');
|
|
|
+ self.callbacks[i] = callbackFun;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ initBoxHtml: function ($selector, i) {
|
|
|
+ var self = this;
|
|
|
+ $selector.css('position', 'relative');
|
|
|
+ $selector.css('overflow', 'visible');
|
|
|
+ $selector.attr('scrollID', i);
|
|
|
+ $selector.wrapInner('<div id="scroll_left_' + i + '" class="scroll_left">\
|
|
|
+<div id="scroll_text_'+ i + '" class="scroll_text"></div>\
|
|
|
+</div>');
|
|
|
+ $selector.append('<div id="scroll_right_' + i + '" class="scroll_right" style="display:none">\
|
|
|
+<div id="scroll_bar_'+ i + '" class="scroll_bar" style="min-height:40px;"></div>\
|
|
|
+</div>');
|
|
|
+ },
|
|
|
+ intervalResize: function ($selector, i) {
|
|
|
+ var self = this;
|
|
|
+ if ($('#scroll_text_' + i).length === 0 && self.intervalResizeObj[i]) {
|
|
|
+ clearInterval(self.intervalResizeObj[i]);
|
|
|
+ self.intervalResizeObj[i] = null;
|
|
|
+ } else {
|
|
|
+ var isUpdated = self.resize($selector);
|
|
|
+ if (isUpdated === 'updated') {
|
|
|
+ var curTop = $('#scroll_bar_' + i)[0].offsetTop;
|
|
|
+ self.resizeTop($('#scroll_bar_' + i), curTop);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ resize: function ($selector) {
|
|
|
+ var self = this;
|
|
|
+ if (typeof $selector === 'string') {
|
|
|
+ $.each($($selector), function (index, selector) {
|
|
|
+ self.resize($(selector));
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var i = $selector.attr('scrollID');
|
|
|
+ var $scrollRight = $('#scroll_right_' + i);
|
|
|
+ var $scrollLeft = $('#scroll_left_' + i);
|
|
|
+ var $scrollBar = $('#scroll_bar_' + i);
|
|
|
+ var maxHeight = parseInt($selector.css('max-height').slice(0, -2));
|
|
|
+ var height = parseInt($selector.css('height').slice(0, -2));
|
|
|
+ var currentBoxHeight = (maxHeight > height) ? maxHeight : height;
|
|
|
+ var currentTextH = $selector.find('.scroll_text').height();
|
|
|
+ var currentHidden = ($selector.is(':hidden')) ? true : false;
|
|
|
+ var firstInit = ($scrollBar.height() > 0) ? false : true;
|
|
|
+ if (currentHidden) {
|
|
|
+ self.isHiddenOld[i] = true;
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ if (self.isHiddenOld[i] && !firstInit) {
|
|
|
+ self.resizeTop($('#scroll_bar_' + i), 0);
|
|
|
+ }
|
|
|
+ self.isHiddenOld[i] = false;
|
|
|
+ }
|
|
|
+ if (self.boxH[i] === currentBoxHeight && self.textH[i] === currentTextH) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ self.boxH[i] = currentBoxHeight;
|
|
|
+ self.textH[i] = currentTextH;
|
|
|
+ if (currentTextH > currentBoxHeight) {
|
|
|
+ $scrollRight.css('display', 'block');
|
|
|
+ } else {
|
|
|
+ self.resizeTop($('#scroll_bar_' + i), 0);
|
|
|
+ $scrollRight.css('display', 'none');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var rateH = currentTextH / currentBoxHeight;
|
|
|
+ var scrollBarH = currentBoxHeight / rateH;
|
|
|
+ $scrollLeft.css('max-height', currentBoxHeight + 'px');
|
|
|
+ $scrollRight.css('height', currentBoxHeight + 'px');
|
|
|
+ $scrollBar.css('height', scrollBarH + 'px');
|
|
|
+ return 'updated';
|
|
|
+ },
|
|
|
+ setTop: function (selectorS, top) {
|
|
|
+ var self = this;
|
|
|
+ $.each($(selectorS), function (index, selector) {
|
|
|
+ var i = $(selector).attr('scrollID');
|
|
|
+ var $scrollBar = $('#scroll_bar_' + i);
|
|
|
+ self.resize($(selector));
|
|
|
+ self.resizeTop($scrollBar, top);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ setDomTop: function (selectorS, domTop) {
|
|
|
+ var self = this;
|
|
|
+ $.each($(selectorS), function (index, selector) {
|
|
|
+ var i = $(selector).attr('scrollID');
|
|
|
+ var $scrollBar = $('#scroll_bar_' + i);
|
|
|
+ self.resize($(selector));
|
|
|
+ self.resizeDomTop($scrollBar, domTop);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ setBottom: function (selectorS, bottom) {
|
|
|
+ var self = this;
|
|
|
+ $.each($(selectorS), function (index, selector) {
|
|
|
+ var i = $(selector).attr('scrollID');
|
|
|
+ var $scrollRight = $('#scroll_right_' + i);
|
|
|
+ var $scrollBar = $('#scroll_bar_' + i);
|
|
|
+ var realHeight = $scrollRight.height();
|
|
|
+ var bottomHeight = realHeight - (bottom || 0);
|
|
|
+ self.resize($(selector));
|
|
|
+ self.resizeTop($scrollBar, bottomHeight);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ resizeDomTop: function ($selectorBar, domTop) {
|
|
|
+ var self = this;
|
|
|
+ var barId = $selectorBar.attr('id');
|
|
|
+ var id = barId;
|
|
|
+ var i = id.slice('scroll_bar_'.length);
|
|
|
+ var boxH = self.boxH[i];
|
|
|
+ var textH = self.textH[i];
|
|
|
+ var barH = $selectorBar.height();
|
|
|
+ var rateH = (textH - boxH) / (boxH - barH);
|
|
|
+ var barTop = (domTop / rateH);
|
|
|
+ self.resizeTop($selectorBar, barTop);
|
|
|
+ },
|
|
|
+ resizeTop: function ($selectorBar, barTop, isAllowCallback) {
|
|
|
+ var self = this;
|
|
|
+ if ($selectorBar.is(':hidden')) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var barId = $selectorBar.attr('id');
|
|
|
+ var id = barId;
|
|
|
+ var i = id.slice('scroll_bar_'.length);
|
|
|
+ var boxH = self.boxH[i];
|
|
|
+ var textH = self.textH[i];
|
|
|
+ var barH = $selectorBar.height();
|
|
|
+ if (barTop < 0) {
|
|
|
+ barTop = 0;
|
|
|
+ } else if (barTop > (boxH - barH)) {
|
|
|
+ barTop = boxH - barH;
|
|
|
+ }
|
|
|
+ var rateH = (textH - boxH) / (boxH - barH);
|
|
|
+ var textTop = -(barTop * rateH);
|
|
|
+ if ($('#scroll_left_' + i).scrollTop() !== 0) {
|
|
|
+ $('#scroll_left_' + i).scrollTop(0);
|
|
|
+ }
|
|
|
+ $selectorBar.css('top', barTop + 'px');
|
|
|
+ $('#scroll_text_' + i).css('top', textTop + 'px');
|
|
|
+ if (isAllowCallback && self.callbacks[i]) {
|
|
|
+ self.callbacks[i]();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ bindEvent: function (i) {
|
|
|
+ var self = this;
|
|
|
+ var $targetDom = $('[scrollID=' + i + ']');
|
|
|
+ var isStartClick = false;
|
|
|
+ $targetDom.on('mousedown click', '#scroll_right_' + i, function (e) {
|
|
|
+ if ($('#' + e.target.id).is(':hidden')) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ e.preventDefault();
|
|
|
+ e.stopPropagation();
|
|
|
+ if ($('#' + e.target.id).hasClass('scroll_bar')) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (e.type === 'mousedown') {
|
|
|
+ isStartClick = true;
|
|
|
+ }
|
|
|
+ if (e.type === 'click' && isStartClick) {
|
|
|
+ isStartClick = false;
|
|
|
+ var id = e.currentTarget.id;
|
|
|
+ var i = id.slice('scroll_right_'.length);
|
|
|
+ self.resizeTop($('#scroll_bar_' + i), e.pageY - $('#' + id).offset().top, 'allowCallback');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $targetDom.on(((document.onmousewheel !== undefined) ? "mousewheel" : "DOMMouseScroll"), '#scroll_text_' + i, function (e) {
|
|
|
+ var id = e.currentTarget.id;
|
|
|
+ var i = id.slice('scroll_text_'.length);
|
|
|
+ var $selectorBar = $('#scroll_bar_' + i);
|
|
|
+ if ($selectorBar.is(':hidden')) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var curTop = $selectorBar[0].offsetTop;
|
|
|
+ var wheel = e.originalEvent.wheelDelta || -e.originalEvent.detail;
|
|
|
+ var delta = Math.max(-1, Math.min(1, wheel));
|
|
|
+ var action = (delta < 0) ? 'down' : 'up';
|
|
|
+ var setTopData;
|
|
|
+ var needUpPropagation = false;
|
|
|
+ if (action === 'up' && curTop > 0) {
|
|
|
+ e.preventDefault();
|
|
|
+ e.stopPropagation();
|
|
|
+ setTopData = curTop - 20;
|
|
|
+ } else if (action === 'down' && $('#scroll_right_' + i).height() - $selectorBar.height() - curTop > 1) {
|
|
|
+ e.preventDefault();
|
|
|
+ e.stopPropagation();
|
|
|
+ setTopData = curTop + 20;
|
|
|
+ } else {
|
|
|
+ needUpPropagation = true;
|
|
|
+ }
|
|
|
+ if (needUpPropagation) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (self.isStartMouseWheel) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ self.isStartMouseWheel = true;
|
|
|
+ setTimeout(function () {
|
|
|
+ self.isStartMouseWheel = false;
|
|
|
+ }, 100);
|
|
|
+ if (setTopData !== undefined) {
|
|
|
+ self.resizeTop($selectorBar, setTopData, 'allowCallback');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $targetDom.on('focusin', '#scroll_text_' + i, function (e) {
|
|
|
+ var tagName = e.target.tagName || '';
|
|
|
+ if (tagName.toLowerCase() !== 'input') {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var id = e.currentTarget.id;
|
|
|
+ var i = id.slice('scroll_text_'.length);
|
|
|
+ var $selectorBar = $('#scroll_bar_' + i);
|
|
|
+ if ($selectorBar.is(':hidden')) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ e.preventDefault();
|
|
|
+ e.stopPropagation();
|
|
|
+ var boxTop = $('#' + id)[0].offsetTop;
|
|
|
+ var dulHeight = $(document.activeElement).offset().top - $('#' + id).offset().top;
|
|
|
+ var domHeight = $(document.activeElement).outerHeight();
|
|
|
+ var overTop = boxTop + dulHeight + domHeight - $('#scroll_left_' + i).height();
|
|
|
+ if (overTop >= 0) {
|
|
|
+ self.resizeDomTop($selectorBar, dulHeight, 'allowCallback');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $targetDom.on('touchstart', '#scroll_text_' + i + ',#scroll_bar_' + i, function (e) {
|
|
|
+ var id = e.currentTarget.id;
|
|
|
+ var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
|
|
|
+ var i;
|
|
|
+ e.stopPropagation();
|
|
|
+ if (id.indexOf('scroll_text') > -1) {
|
|
|
+ i = id.slice('scroll_text_'.length);
|
|
|
+ } else if (id.indexOf('scroll_bar') > -1) {
|
|
|
+ i = id.slice('scroll_bar_'.length);
|
|
|
+ } else {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ self.touchData = {
|
|
|
+ startBoolear: true,
|
|
|
+ startY: touch.pageY,
|
|
|
+ curTop: $('#scroll_bar_' + i)[0].offsetTop,
|
|
|
+ startSelector: 'scroll_bar_' + i
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $targetDom.on('touchmove', '#scroll_text_' + i + ',#scroll_bar_' + i + ',#scroll_right_' + i, function (e) {
|
|
|
+ if (!self.touchData.startSelector || !self.touchData.startBoolear || !$('#' + self.touchData.startSelector).length) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var id = self.touchData.startSelector;
|
|
|
+ var i = id.slice('scroll_bar_'.length);
|
|
|
+ var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
|
|
|
+ var dulTop;
|
|
|
+ if ((e.currentTarget.id).indexOf('scroll_text') > -1) {
|
|
|
+ dulTop = self.touchData.startY - touch.pageY;
|
|
|
+ } else if ((e.currentTarget.id).indexOf('scroll_bar') > -1) {
|
|
|
+ dulTop = touch.pageY - self.touchData.startY;
|
|
|
+ }
|
|
|
+ var barTop = dulTop + self.touchData.curTop;
|
|
|
+ self.resizeTop($('#' + id), barTop);
|
|
|
+ e.preventDefault();
|
|
|
+ e.stopPropagation();
|
|
|
+ });
|
|
|
+ $targetDom.on('touchend', '#scroll_text_' + i + ',#scroll_bar_' + i, function (e) {
|
|
|
+ if (!self.touchData.startSelector || !$('#' + self.touchData.startSelector).length) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var id = self.touchData.startSelector;
|
|
|
+ var barTop = $('#' + id)[0].offsetTop;
|
|
|
+ self.touchData.startBoolear = false;
|
|
|
+ self.resizeTop($('#' + id), barTop, 'allowCallback');
|
|
|
+ });
|
|
|
+ $targetDom.on('mousedown', '#scroll_bar_' + i, function (e) {
|
|
|
+ var id = e.currentTarget.id;
|
|
|
+ var i = id.slice('scroll_bar_'.length);
|
|
|
+ self.mouseData = {
|
|
|
+ startBoolear: true,
|
|
|
+ startY: e.pageY,
|
|
|
+ curTop: $('#' + id)[0].offsetTop,
|
|
|
+ startSelector: id
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $(document).off('mousemove mouseup');
|
|
|
+ $(document).on('mousemove', function (e) {
|
|
|
+ if (!self.mouseData.startSelector || !self.mouseData.startBoolear || !$('#' + self.mouseData.startSelector).length) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ window.getSelection ? window.getSelection().removeAllRanges() : document.selection.empty();
|
|
|
+ var id = self.mouseData.startSelector;
|
|
|
+ var barTop = (e.pageY - self.mouseData.startY) + self.mouseData.curTop;
|
|
|
+ self.resizeTop($('#' + id), barTop);
|
|
|
+ });
|
|
|
+ $(document).on('mouseup', function (e) {
|
|
|
+ if (!self.mouseData.startSelector || !self.mouseData.startBoolear || !$('#' + self.mouseData.startSelector).length) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ self.cancelSelectListEvent = true;
|
|
|
+ var id = self.mouseData.startSelector;
|
|
|
+ var barTop = $('#' + id)[0].offsetTop;
|
|
|
+ self.mouseData.startBoolear = false;
|
|
|
+ self.resizeTop($('#' + id), barTop, 'allowCallback');
|
|
|
+ });
|
|
|
+ },
|
|
|
+ unbindEvent: function () {
|
|
|
+ $('.scroll_text,.scroll_right,.scroll_bar').off();
|
|
|
+ },
|
|
|
+ destroy: function (selectorS) {
|
|
|
+ var self = this;
|
|
|
+ $.each($(selectorS), function (index, selector) {
|
|
|
+ $selector.removeAttr('scrollID');
|
|
|
+ $scrollText = $(selector).find('.scroll_text');
|
|
|
+ if ($scrollText.length === 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var id = $scrollText.attr('id');
|
|
|
+ var index = id.slice('scroll_text_'.length);
|
|
|
+ if (self.intervalResizeObj[index]) {
|
|
|
+ clearInterval(self.intervalResizeObj[index]);
|
|
|
+ self.intervalResizeObj[index] = null;
|
|
|
+ }
|
|
|
+ ($(selector).find('.scroll_left')).replaceWith($scrollText.contents());
|
|
|
+ ($(selector).find('.scroll_right')).remove();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ adapterleftLabelStyle: function (para) {
|
|
|
+ var tag;
|
|
|
+ var selectorTag;
|
|
|
+ if (window.location.href.indexOf('/ManagerDesktop/page.html') >= 0) {
|
|
|
+ tag = '#' + window.location.hash.substr(1) + '_page';
|
|
|
+ } else {
|
|
|
+ tag = 'body';
|
|
|
+ }
|
|
|
+ selectorTag = tag + ' .control-label:visible';
|
|
|
+ if (para) {
|
|
|
+ var otherTag = tag + ' .' + para + ' .control-label-win:visible';
|
|
|
+ selectorTag = selectorTag + ',' + otherTag;
|
|
|
+ }
|
|
|
+ $(selectorTag).each(function (index, element) {
|
|
|
+ if ($(element).height() > 25) {
|
|
|
+ $(element).css('margin-top', '0px')
|
|
|
+ } else {
|
|
|
+ $(element).css('margin-top', '8px')
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
RVC.EntityController = RVC.Object.extend({
|
|
|
entityName:'',
|
|
|
className: '',
|
|
@@ -1020,11 +1571,42 @@ $(function () {
|
|
|
},
|
|
|
compareObject: function (obj1, obj2) {
|
|
|
return compareObject(obj1, obj2);
|
|
|
- }
|
|
|
- });
|
|
|
+ },
|
|
|
|
|
|
+ webSocketInvoke: function(req, callback) {
|
|
|
+ WebSocketBase.sendMsg(req, (data) => {
|
|
|
+ var jsondata = JSON.parse(data);
|
|
|
+ if(typeof callback === 'function') {
|
|
|
+ try {
|
|
|
+ callback(jsondata);
|
|
|
+ } catch(err) {}
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ commCallback : function(ret) {
|
|
|
+ if("undefined" != typeof ret.errorCode && ret.errorCode === 0) {
|
|
|
+ utilStartCommonDialog("操作成功!");
|
|
|
+ setTimeout(function () {
|
|
|
+ utilStopCommonDialog();
|
|
|
+ }, 1000);
|
|
|
+ } else {
|
|
|
+ if('undefined' != typeof ret.userCode) {
|
|
|
+ utilStartAlertDialog("操作失败! ErrorCode: " + ErrorCodeStringfy(ret.errorCode) + " | UserCode: " + ret.userCode);
|
|
|
+ } else {
|
|
|
+ utilStartAlertDialog("操作失败! ErrorCode: " + ErrorCodeStringfy(ret.errorCode));
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
});
|
|
|
|
|
|
+function test()
|
|
|
+{
|
|
|
+ //utilShowToast("操作成功!", 5000);
|
|
|
+}
|
|
|
+
|
|
|
$(function () {
|
|
|
|
|
|
WebSocketBase.socket.onerror = function () {
|
|
@@ -1049,10 +1631,7 @@ $(function () {
|
|
|
req.methodID = this.methodID.QueryHardwareInfo;
|
|
|
req.signature = this.methodSignature.QueryHardwareInfo;
|
|
|
|
|
|
- WebSocketBase.sendMsg(req, (data) => {
|
|
|
- var jsondata = JSON.parse(data);
|
|
|
- callback(jsondata);
|
|
|
- });
|
|
|
+ this.webSocketInvoke(req, callback);
|
|
|
},
|
|
|
});
|
|
|
|
|
@@ -1072,10 +1651,7 @@ $(function () {
|
|
|
req.methodID = this.methodID.ControlTerminalLife;
|
|
|
req.signature = this.methodSignature.ControlTerminalLife;
|
|
|
|
|
|
- WebSocketBase.sendMsg(req, (data) => {
|
|
|
- var jsondata = JSON.parse(data);
|
|
|
- callback(jsondata);
|
|
|
- });
|
|
|
+ this.webSocketInvoke(req, callback);
|
|
|
},
|
|
|
|
|
|
ControlTerminalLifeNo: function(cmdValue) {
|
|
@@ -1091,7 +1667,10 @@ $(function () {
|
|
|
this.ControlTerminalLife(req, function(ret) {
|
|
|
utilStopSubmitDialog();
|
|
|
if (ret.errorCode === 0 && ret.retCode === 0) {
|
|
|
- utilShowToast("操作成功!", 5000);
|
|
|
+ utilStartCommonDialog("操作成功!");
|
|
|
+ setTimeout(function () {
|
|
|
+ utilStopCommonDialog();
|
|
|
+ }, 2000);
|
|
|
} else {
|
|
|
utilStartAlertDialog("操作失败:" + ErrorCodeStringfy(ret.errorCode) + " | " + ret.retCode);
|
|
|
}
|
|
@@ -1114,7 +1693,7 @@ $(function () {
|
|
|
});
|
|
|
},
|
|
|
RestartPC: function() {
|
|
|
- utilStartConfirmDialog("确认要重启可视柜台终端设备?", function() {
|
|
|
+ utilStartConfirmDialog("确认要重启计算机?", function() {
|
|
|
RVC.HealthmanagerEntityCtrl.ControlTerminalLifeNo(4);
|
|
|
});
|
|
|
}
|
|
@@ -1143,7 +1722,7 @@ function GetTerminalBasicInfo() {
|
|
|
$('#ip4Address span').html(result.ip[0]);
|
|
|
$('#macAddress span').html(result.mac[0]);
|
|
|
} else {
|
|
|
- utilStartAlertDialog("获取终端信息失败:" + ret.errorCode);
|
|
|
+ utilStartAlertDialog("获取终端信息失败:" + ErrorCodeStringfy(ret.errorCode));
|
|
|
}
|
|
|
});
|
|
|
}
|