js面向对象开发互联网机顶盒应用头端之二
?
/**
* Dare Movie Object.
* @constructor
*/
//聲明構(gòu)造函數(shù) 構(gòu)造函數(shù)初始化變量
Dare.Movie = function() {
? this.parent = new Dare.Util();
? this.className = "Dare.Movie";
? //----類Dare.Movie全局屬性變量-----//
? this.stylePath = dareStyle.getStylePath();
? this.pageIndex = 0; //當(dāng)前頁索引
? this.pageTotal = 0; //總頁數(shù);
? this.pageSize = 8; //每頁顯示記錄數(shù)
? this.recordCount = 0; //總記錄數(shù)
? this.dataSource = null; //數(shù)據(jù)源
? this.tempdataSource; //數(shù)據(jù)源
? this.orderBy = 'sortdate'; //默認(rèn)排序字段
? this.sortDirection = 'asc'; //默認(rèn)升序方式
? this.searchValue = '';
? this.currentFocus = 'searchvalue'; //初始化焦點
? this.bookMovies = { movies: [] };
? //----類Dare.Movie全局屬性變量-----//
? this.selectImages = { "normal": this.stylePath + "selectall.gif", "focus": this.stylePath + "selectallover.gif", "on": this.stylePath + "selectallon.gif" };
? this.unselectImages = { "normal": this.stylePath + "unselectall.gif", "focus": this.stylePath + "unselectallover.gif", "on": this.stylePath + "unselectallon.gif" };
? this.Allselected = false; //全選狀態(tài),按下后變?yōu)閠rue ,在按為false
? this.hasGetChspell = false; //獲取拼音的狀態(tài),第一次查詢后獲取
};
Dare.Movie.prototype = new Dare.Util(); //繼承父類 Dare.Util是系統(tǒng)架構(gòu)工具類
Dare.Movie.prototype.constructor = Dare.Movie; //引用構(gòu)造函數(shù)
/**
* @function movieInit
* @author
* @param null
* @return null
*/
Dare.Movie.prototype.movieInit = function() {
? sortimg.innerText = DareLang.DATETIME;
? searchimg.innerText = DareLang.SEARCH;
? sortdate.innerText = DareLang.DATETIME;
? sortname.innerText = DareLang.NAME;
? sorttype.innerText = DareLang.TYPE;
? sortsize.innerText = DareLang.SIZE;
? this.$('title').src = this.stylePath + DareLang.IMAGE.MY_MOVIE_TITLE; //'movie_title.gif';
? this.$('imgtop').src = this.stylePath + 'movie_no.png';
? this.$('selectAllimg').src = this.unselectImages.normal;
? this.$('freshimg').src = this.stylePath + 'no.gif';
? var json = new Dare.JSObject.JSON();
? var cmd = new Dare.Business.Command();
? this.dataSource = cmd.getFiles('movie', 'date', '');
? var request = new Dare.Request();
? var index = request.QueryString('pageIndex');
? this.pageIndex = index == null ? 0 : parseInt(index);
?
? this.tempdataSource = this.dataSource;
? this.recordCount = this.dataSource.length;
? this.pageTotal = this.recordCount % this.pageSize == 0 ? this.recordCount / this.pageSize : parseInt(this.recordCount / this.pageSize + 1);
? this.movieDataBind();
};
Dare.Movie.prototype.sort = function() {
? var sortname = 'date';
? switch (this.orderBy) {
??? case 'sortname':
????? sortname = 'name';
????? if (this.hasGetChspell == false) {
??????? for (var j in this.tempdataSource) {
????????? this.tempdataSource[j].chname = chineseSpell.getpy(dareUtil.getFileName(this.tempdataSource[j]["name"]), 4).toString().toLowerCase();
??????? }
??????? this.dataSource = this.tempdataSource;
??????? this.hasGetChspell = true;
????? }
????? break;
??? case 'sorttype':
????? sortname = 'type';
????? break;
??? case 'sortsize':
????? sortname = 'size';
????? break;
??? case 'sortdate':
????? sortname = 'date';
????? break;
??? default:
????? sortname = 'date';
????? break;
? }
? dareUtil.sortBy(this.dataSource, sortname, this.sortDirection);
? this.movieDataBind();
}
Dare.Movie.prototype.loading = function() {
? this.$('freshimg').src = this.stylePath + 'loading.gif';
};
Dare.Movie.prototype.closeLoading = function() {
? this.$('freshimg').src = this.stylePath + 'no.gif';
};
/**
* @function movieDataBind
* @author
* @return this.$('maincontent').innerHTML
*/
Dare.Movie.prototype.movieDataBind = function() {
? this.loading();
? var start = parseInt(this.pageIndex * this.pageSize);
? var end = parseInt(this.pageIndex * this.pageSize + this.pageSize);
? if (end > this.recordCount) end = this.recordCount;
? var item = '';
? var i = 0;
? for (var j = start; j < end; j++) {
??? if (this.dataSource[j] == null) break;
??? var itemId = 'item' + i;
??? var selectId = 'select' + i;
??? var movieId = 'movie' + i;
??? var name = dareUtil.getFileName(this.dataSource[j]['name']);
??? var subName = dareUtil.trimstr(name, 20);
??? var movieObj = '{name:"' + this.dataSource[j]['name'] + '",type:"' + this.dataSource[j]['type'] + '",size:"' + this.dataSource[j]['size'] + '",time:"' + this.secondsToMMSS(this.dataSource[j]['time']) + '",scale:"' + this.dataSource[j]['scale'] + '",date:"' + this.dataSource[j]['date'] + '"}';
??? item += '<div? class="itemnone" id="' + itemId + '"><div id="' + movieId + '" style="display:none;">' + movieObj + '</div><div class="selectnone" id="' + selectId + '" ></div>' +
????? '<div class="menufont">' + subName + '</div>' +
????? '<div class="menusize">' + this.secondsToMMSS(this.dataSource[j]['time']) + '</div>'
??? '</div>';
??? i++;
? }
? this.$('movies').innerHTML = item;
? if (this.$('item0')) {
??? this.$('item0').className = 'item';
??? this.currentFocus = 'item0';
??? this.movieDetail('movie0');
??? this.$('pagetext').innerHTML = this.pageTotal == 0 ? '' : (this.pageIndex + 1) + "/" + this.pageTotal;
? }
? this.bookMovieBind();
? this.closeLoading();
};
/**
* @function movieDetail
* @author
* @return this.$('detail').innerHTML
*/
Dare.Movie.prototype.movieDetail = function(id) {
? var movie = this.$(id).innerText;
? var json = new Dare.JSObject.JSON();
? var movieArray = json.toObject(movie);
? var detailContent = '';
? detailContent += DareLang.NAME + ': ' + dareUtil.getFileName(movieArray["name"]) + '<br>';
? detailContent += DareLang.TYPE + ': ' + movieArray["type"] + '<br>';
? detailContent += DareLang.SIZE + ': ' + dareUtil.fileSizeInt2Str(movieArray["size"]) + '<br>';
? detailContent += DareLang.DURATION + ': ' + movieArray["time"] + '<br>';
? detailContent += DareLang.RESOLUTION + ': ' + movieArray["scale"] + '<br>';
? detailContent += DareLang.DATETIME + ': ' + movieArray["date"];
? this.$('detail').innerHTML = detailContent;
};
/**
* @function previousPage
* @author
* @param null
* @return null
*/
Dare.Movie.prototype.previousPage = function() {
? this.pageIndex--;
? if (this.pageIndex < 0) { this.pageIndex = 0; return; }
? if (this.pageIndex <= this.pageTotal - 1 && this.pageIndex >= 0) {
??? this.movieDataBind();
??? this.$('item0').className = 'item';
? }
};
/**
* @function nextPage
* @author
* @param null
* @return null
*/
Dare.Movie.prototype.nextPage = function() {
? this.pageIndex++;
? if (this.pageIndex >= this.pageTotal) { this.pageIndex = this.pageTotal - 1; return; }
? if (this.pageIndex <= this.pageTotal - 1) {
??? this.movieDataBind();
? }
};
Dare.Movie.prototype.searchLostFocus = function() {
? document.getElementById('searchvalue').blur();
? document.getElementById('fresh').focus();
}
/**
* @function keypressHandler
* @author
* @param event
* @return null
*/
Dare.Movie.prototype.keypressHandler = function(event) {
? var keyValue = Dare.isiPanel ? event.which : window.event.keyCode;
? //document.getElementById("divDebug").innerText += "keyValue:" + keyValue+"</br>";
? showUSBInfo(keyValue);
? this.searchLostFocus();
? switch (keyValue) {
??? case KeyMap.STB_KEY_DOWN: //向下
????? this.keydownHandler();
????? break;
??? case KeyMap.STB_KEY_UP: //向上
????? this.keyupHandler();
????? break;
??? case KeyMap.STB_KEY_ENTER: //確定
????? this.keyenterHandler();
????? break;
??? case KeyMap.STB_KEY_LEFT: //向左
????? this.keyleftHandler();
????? break;
??? case KeyMap.STB_KEY_RIGHT: //向右
????? this.keyrightHandler();
????? break;
??? case KeyMap.STB_KEY_PAGEUP: //上一頁
????? this.keypageupHandler();
????? break;
??? case KeyMap.STB_KEY_PAGEDOWN: //下一頁
????? this.keypagedownHandler();
????? break;
??? case KeyMap.STB_KEY_HOME:
????? break;
??? case KeyMap.STB_KEY_STOP:
????? window.location.href = '../main/index.html?focus=1';
????? break;
??? case KeyMap.STB_KEY_FULLSCREEN:
????? this.focusToolbar();
????? break;
??? default:
????? break;
? }
};
/**
* 回到菜單
*/
Dare.Movie.prototype.focusToolbar = function () {
? document.getElementById('searchvalue').focus();
? this.currentFocus = 'searchvalue';
? for (var i = 0; i < 8; i++) {
??? document.getElementById("item" + i).className = "itemnone";
? }
}
/**
* @function keyupHandler
* @author
* @param null
* @return null
*/
Dare.Movie.prototype.keyupHandler = function() {
? if (this.currentFocus == "searchvalue") {
??? this.$('searchvalue').focus();
??? return;
? }
? switch (this.currentFocus) {
??? case 'item0':
????? if (this.pageIndex == 0) {
??????? this.currentFocus = 'searchvalue';
??????? this.$('item0').className = 'itemnone';
??????? searchvalue.focus();
????? }
????? break;
??? case 'sortsize': //大小
????? this.$('sortsize').className = 'sortnone';
????? this.$('sorttype').className = 'sortselected';
????? this.currentFocus = 'sorttype';
????? break;
??? case 'sorttype': //類型
????? this.$('sorttype').className = 'sortnone';
????? this.$('sortname').className = 'sortselected';
????? this.currentFocus = 'sortname';
????? break;
??? case 'sortname': //名稱
????? this.$('sortname').className = 'sortnone';
????? this.$('sortdate').className = 'sortselected';
????? this.currentFocus = 'sortdate';
??? default:
????? break;
? }
? this.pageEvent = false;
? var foucusId = this.currentFocus.substr(4, 1);
? if ('0' == foucusId) {
??? this.previousPage();
??? this.pageEvent = true;
? }
? if (parseInt(foucusId) <= 7 && this.pageEvent == false) {
??? this.listUpFocus(foucusId);
? }
};
/**
* @function listDownFocus
* @author
* @param null
* @return null
*/
Dare.Movie.prototype.listDownFocus = function(i) {
? this.pageEvent = false;
? var id = parseInt(i) + 1;
? if (this.$('item' + (id))) {
??? this.$('item' + i).className = 'itemnone';
??? this.$('item' + (id)).className = 'item';
??? this.currentFocus = 'item' + (id);
??? this.rightPressCount = 0;
??? this.movieDetail('movie' + (id));
? }
};
/**
* @function listUpFocus
* @author
* @param null
* @return null
*/
Dare.Movie.prototype.listUpFocus = function(i) {
? this.pageEvent = false;
? this.$('item' + i).className = 'itemnone';
? var id = parseInt(i) - 1;
? this.$('item' + (id)).className = 'item';
? this.currentFocus = 'item' + (id);
? this.rightPressCount = 0;
? this.movieDetail('movie' + (id));
};
/**
* @function keydownHandler
* @author
* @param null
* @return null
*/
Dare.Movie.prototype.keydownHandler = function() {
? if (this.currentFocus.indexOf('item') < 0
?? && this.currentFocus.indexOf('sort') < 0
?? && this.$('item0')
?? && this.$('sortlist').style.display == 'none') {
??? this.$('searchimg').className = 'search';
??? this.$('sortimg').className = 'search';
??? if (this.sortDirection == 'asc') this.$('arrowimg').className = 'arrowup';
??? else this.$('arrowimg').className = 'arrowdown';
??? this.currentFocus = 'item0';
??? this.$('item0').className = 'item';
??? return;
? }
? if (sortlist.style.display != "none") {
??? switch (this.currentFocus) {
????? case 'sortimg':
??????? this.$('sortdate').className = 'sortselected';
??????? this.currentFocus = 'sortdate';
??????? break;
????? case 'sortdate': //日期
??????? this.$('sortdate').className = 'sortnone';
??????? this.$('sortname').className = 'sortselected';
??????? this.currentFocus = 'sortname';
??????? break;
????? case 'sortname': //名稱
??????? this.$('sortname').className = 'sortnone';
??????? this.$('sorttype').className = 'sortselected';
??????? this.currentFocus = 'sorttype';
??????? break;
????? case 'sorttype': //類型
??????? this.$('sorttype').className = 'sortnone';
??????? this.$('sortsize').className = 'sortselected';
??????? this.currentFocus = 'sortsize';
????? default:
??????? break;
??? }
? }
? this.pageEvent = false;
? var foucusId = this.currentFocus.substr(4, 1);
? if ('7' == foucusId) {
??? this.nextPage();
??? this.pageEvent = true;
??? return;
? }
? if (parseInt(foucusId) < 7 && this.pageEvent == false) {
??? this.listDownFocus(foucusId);
? }
};
/**
* @function keyenterHandler
* @author
* @param null
* @return null
*/
Dare.Movie.prototype.keyenterHandler = function() {
? if (this.currentFocus == 'sortimg') {
??? this.$('sortlist').style.display = 'block';
??? return;
? }
? if (this.orderBy != this.currentFocus && (this.currentFocus == 'sortdate' || this.currentFocus == 'sortname' || this.currentFocus == 'sorttype' || this.currentFocus == 'sortsize')) {
??? this.$('sortlist').style.display = "none";
??? this.$('sortimg').innerText = this.$(this.currentFocus).innerText;
??? this.orderBy = this.currentFocus;
??? this.$(this.currentFocus).className = 'sortnone';
??? this.$('sortimg').className = 'search';
??? this.currentFocus = 'arrowimg';
? }
? switch (this.currentFocus) {
??? case 'arrowimg':
????? if (this.sortDirection == 'asc') {
??????? this.sortDirection = 'desc';
??????? this.$('arrowimg').className = 'arrowdownon';
????? }
????? else {
??????? this.sortDirection = 'asc';
??????? this.$('arrowimg').className = 'arrowupon';
????? }
????? this.sort();
????? return; case 'searchimg':
????? this.$('searchimg').className = 'searchon';
????? this.movieSeacher();
????? return; case 'sortimg':
????? this.$('sortimg').className = 'searchon';
????? break;
??? default:
????? break;
? }
? if (this.currentFocus == 'selectAllimg') {
??? this.Allselected = !this.Allselected; //取反
??? if (this.Allselected) {
????? this.selectAll();
??? }
??? else {
????? this.unSelectAll();
??? }
? }
? var hasMovie = false;
? if (this.currentFocus.indexOf('item') >= 0) {
??? var movies = this.bookMovies.movies;
??? var json = new Dare.JSObject.JSON();
??? if (movies.length != 0) {
????? var movieList = json.parse(movies);
????? new Dare.Business.Command().setGlobalVar("movieBookList", movieList);
????? hasMovie = true;
??? }
??? else {
????? var focusId = this.currentFocus.substr(4, 1);
????? var moviestr = this.$('movie' + focusId).innerText;
????? var json = new Dare.JSObject.JSON();
????? var movie = json.toObject(moviestr);
????? movies.push(movie);
????? var movieList = json.parse(movies);
????? new Dare.Business.Command().setGlobalVar('movieBookList', movieList);
????? //選片對象有實例 按確定轉(zhuǎn)向播放頁面
????? hasMovie = true;
??? }
??? if (hasMovie) {
????? var currentMedia = new Dare.Business.Command().getGlobalVar('currentPlayMedia');
????? var json = new Dare.JSObject.JSON();
????? var mp = json.toObject(currentMedia);
????? var currentPlayMovieInPlayList = false;
????? for (var k in movies) {
??????? if (movies[k].name == mp.playPath) {
????????? currentPlayMovieInPlayList = true;
????????? break;
??????? }
????? }
????? window.location.href = '../movie/movieplay.html?appendback=true¤tPlayMovieInPlayList=' + currentPlayMovieInPlayList + '&pageIndex=' + this.pageIndex;
??? }
? }
};
Dare.Movie.prototype.selectAll = function() {
? var movies = dareMovie.bookMovies.movies;
? for (var f in dareMovie.dataSource) {
??? var movie = dareMovie.dataSource[f];
??? movies.push(movie);
? }
? for (var i = 0; i < 8; i++) {
??? if (this.$('item' + i)) {
????? this.$('select' + i).className = 'select';
??? }
? }
? this.$('selectAllimg').src = this.selectImages.on;
};
/**
* 全不選
*/
Dare.Movie.prototype.unSelectAll = function() {
? this.$('selectAllimg').src = this.unselectImages.on;
? this.bookMovies.movies = [];
? for (var i = 0; i < 8; i++) {
??? if (this.$('item' + i)) {
????? this.$('select' + i).className = 'selectnone';
??? }
? }
};
Dare.Movie.prototype.arrowImageFocus = function() {
? if (this.sortDirection == "asc") {
??? document.getElementById('arrowimg').className = 'arrowupover';
? } else {
??? document.getElementById('arrowimg').className = 'arrowdownover';
? }
};
Dare.Movie.prototype.arrowImageLostFocus = function() {
? if (this.sortDirection == "asc") {
??? document.getElementById('arrowimg').className = 'arrowup';
? }
? else {
??? document.getElementById('arrowimg').className = 'arrowdown';
? }
};
/**
* @function keyleftHandler
* @author
* @param null
* @return null
*/
Dare.Movie.prototype.keyleftHandler = function() {
? this.$('sortlist').style.display = 'none';
? if (this.currentFocus.indexOf('sort') == 0) {
??? this.currentFocus = 'searchimg';
??? this.$('searchimg').className = 'searchover';
??? this.$('sortimg').className = 'search';
??? return;
? }
? switch (this.currentFocus) {
??? case 'arrowimg':
????? if (this.sortDirection == 'asc') {
??????? this.$('arrowimg').className = 'arrowup';
????? } else {
??????? this.$('arrowimg').className = 'arrowdown';
????? }
????? this.$('sortimg').className = 'searchover';
????? this.currentFocus = 'sortimg';
????? break;
??? case 'sortimg':
????? this.$('sortimg').className = 'search';
????? this.$('searchimg').className = 'searchover';
????? this.currentFocus = 'searchimg';
????? break;
??? case 'searchimg':
????? this.currentFocus = 'searchvalue';
????? document.getElementById('searchimg').className = 'search';
????? searchvalue.focus();
????? break;
??? case 'selectAllimg':
????? if (this.Allselected) { this.$('selectAllimg').src = this.selectImages.normal; }
????? else this.$('selectAllimg').src = this.unselectImages.normal;
????? this.arrowImageFocus();
????? this.currentFocus = 'arrowimg';
????? break;
??? default:
????? break;
? }
};
/**
* @function keyrightHandler
* @author
* @param null
* @return null
*/
Dare.Movie.prototype.keyrightHandler = function() {
? this.$('sortlist').style.display = 'none';
? if (this.currentFocus.indexOf('sort') == 0) {
??? this.currentFocus = 'arrowimg';
??? this.$('sortimg').className = 'search';
??? if (this.sortDirection == "asc") {
????? this.$('arrowimg').className = 'arrowupover';
??? } else {
????? this.$('arrowimg').className = 'arrowdownover';
??? }
??? return;
? }
? switch (this.currentFocus) {
??? case 'searchvalue':
????? this.$('searchimg').className = 'searchover';
????? this.currentFocus = 'searchimg';
????? break;
??? case 'searchimg':
????? this.$('searchimg').className = 'search';
????? this.$('sortimg').className = 'searchover';
????? this.currentFocus = 'sortimg';
????? break;
??? case 'sortimg':
????? this.$('sortimg').className = 'search';
????? if (this.sortDirection == "asc") {
??????? this.$('arrowimg').className = 'arrowupover';
????? } else {
??????? this.$('arrowimg').className = 'arrowdownover';
????? }
????? this.currentFocus = 'arrowimg';
????? break;
??? case "arrowimg":
????? if (this.Allselected) { this.$('selectAllimg').src = this.selectImages.focus; }
????? else this.$('selectAllimg').src = this.unselectImages.focus;
????? this.arrowImageLostFocus();
????? this.currentFocus = 'selectAllimg';
????? break;
??? default:
????? break;
? }
? if (this.currentFocus.indexOf('item') >= 0) {
??? var focusId = this.currentFocus.substr(4, 1);
??? var selectObj = this.$('select' + focusId);
??? var movieString = this.$('movie' + focusId).innerText;
??? var json = new Dare.JSObject.JSON();
??? var movie = json.toObject(movieString);
??? if (selectObj.className == 'selectnone') {
????? selectObj.className = 'select';
????? this.selectMovie(movie, 0);
??? }
??? else {
????? selectObj.className = 'selectnone';
????? this.selectMovie(movie, 1);
??? }
? }
};
/**
* @function keypageupHandler
* @author
* @param null
* @return null
*/
Dare.Movie.prototype.keypageupHandler = function() {
? this.previousPage();
};
/**
* @function keypagedownHandler
* @author
* @param null
* @return null
*/
Dare.Movie.prototype.keypagedownHandler = function() {
? this.nextPage();
};
/**
* @function selectMovie 選擇
* @author
* @param movie type
* @return null
*/
Dare.Movie.prototype.selectMovie = function(movie, type) {
? var movies = this.bookMovies.movies;
? switch (type) {
??? //添加對象??????????????????????????????????????????????????????????????????????????
??? case 0:
????? movies.push(movie);
????? break;
??? //移除對象?????????????????????????????????????????????????????????????????
??? case 1:
????? for (var i in movies) {
??????? if (movies[i].name == movie.name) {
????????? movies.splice(i, 1);
????????? break;
??????? }
????? }
????? break;
??? default:
????? break;
? }
};
/**
* @function bookMovieBind
* @author
* @return null
*/
Dare.Movie.prototype.bookMovieBind = function() {
? var start = parseInt(this.pageIndex * this.pageSize);
? var end = parseInt(this.pageIndex * this.pageSize + this.pageSize);
? if (end > this.dataSource.length) end = this.dataSource.length;
? var movies = this.bookMovies.movies;
? var json = new Dare.JSObject.JSON();
? var movieBookList = new Dare.Business.Command().getGlobalVar("movieBookList");
? if (movieBookList.length != 0) {
??? var movieBooks = json.toObject(movieBookList);
??? for (var key in movieBooks) {
????? movies.push(movieBooks[key]);
??? }
??? new Dare.Business.Command().setGlobalVar('movieBookList', '');
? }
? var i = 0;
? for (var j = start; j < end; j++) {
??? var selectObj = this.$('select' + i);
??? var movieString = this.$('movie' + i).innerText;
??? var json = new Dare.JSObject.JSON();
??? var movie = json.toObject(movieString);
??? for (var key in movies) {
????? if (movies[key].name == movie.name) {
??????? selectObj.className = 'select';
??????? break;
????? }
??? }
??? i++;
? }
};
/**
* @function styleInt
* @author
* @param null
* @return null
*/
Dare.Movie.prototype.styleInt = function() {
? this.$('searchimg').className = 'search';
? this.$('sortimg').className = 'search';
? this.$('arrowimg').className = 'arrowup';
};
/**
* @function movieSeacher 查詢
* @author
* @param null
* @return null
*/
Dare.Movie.prototype.movieSeacher = function() {
? if (this.hasGetChspell == false) {
??? for (var j in this.tempdataSource) {
????? this.tempdataSource[j].chname = chineseSpell.getpy(dareUtil.getFileName(this.tempdataSource[j]["name"]), 4).toString().toLowerCase();
??? }
??? this.dataSource = this.tempdataSource;
??? this.hasGetChspell = true;
? }
? var keyWord = this.$('searchvalue').value;
? var resultData = []; //交換數(shù)組
? var i = 0;
? for (var key in this.tempdataSource) {
??? if (dareUtil.getFileName(this.tempdataSource[key].name).indexOf(keyWord) != -1 || this.tempdataSource[key].chname.indexOf(keyWord) == 0) {
????? resultData.push(this.tempdataSource[key]); //從緩存數(shù)據(jù)庫原讀取,便于二次查詢
??? }
? }
? this.dataSource = resultData;
? this.recordCount = this.dataSource.length;
? this.pageTotal = this.recordCount % this.pageSize == 0 ? this.recordCount / this.pageSize : parseInt(this.recordCount / this.pageSize + 1);
? this.movieDataBind();
};
var dareMovie = new Dare.Movie();
document.onkeypress = function(event) {
? dareMovie.keypressHandler(event);
};
?
轉(zhuǎn)載于:https://www.cnblogs.com/fx2008/archive/2011/08/20/2147239.html
總結(jié)
以上是生活随笔為你收集整理的js面向对象开发互联网机顶盒应用头端之二的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 《FLUENT 14流场分析自学手册》—
- 下一篇: 自己的碎碎念