當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript opg.ts.default.format類代碼示例

本文整理匯總了TypeScript中ts/opg.ts.default.format的典型用法代碼示例。如果您正苦於以下問題:TypeScript ts.default.format類的具體用法?TypeScript ts.default.format怎麽用?TypeScript ts.default.format使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ts.default.format類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: image

	set image(imgFile: File){
		let self = this;
		let fileSize = opg.format.fileSize(imgFile.size);

		let reader = new FileReader();

		reader.onload = function (e) {

			let img = document.createElement('img');
			//noinspection TypeScriptUnresolvedVariable
			img.src = e.target.result;

			//out.put
			setTimeout( () => {

				let liClass = '' , miscTxt = '';
				if(img.width != self._validWidth || img.height != self._validHeight ){
					liClass = 'text-red' ;
					miscTxt = `,期望為:${self._validWidth} x ${self._validHeight}`;
				}

				self._output.html(`
					<li>文件大小:${fileSize}</li>
					<li class="${liClass}">圖像尺寸:${img.width} x ${img.height} ${miscTxt}</li>
				`);
			} , 100) ;


			self._thumbnail.attr('src' , img.src);
		};

		reader.readAsDataURL(imgFile);

		this._image = imgFile ;
	}
開發者ID:rpdg,項目名稱:fy.js,代碼行數:35,代碼來源:uploadImage.ts

示例2: bindMetaData

function bindMetaData(data) {
	if (!data.seconds) {
		data.seconds = data.length;
		data.length = opg.format.timeLength(data.seconds);
	}

	renameAttr(data, 'tags', 'tagIds');
	renameAttr(data, 'genre', 'genreIds');

	if (data.originDate) data.originDate = data.originDate.split(' ')[0];
	if(!data.episodeNumber) data.episodeNumber = 1;

	console.log(data);
	progInfo = data;


	$('#d1').jsonToFields(data);

	$('#progType').text(data.typeName);
	$('#contentType').text(data.contentType);
	$('#length').text(data.length);

	//todo:可能會有擴展類別
	if (data.type != 1000) {
		$('.forOne').find('*').css('visibility', 'visible');
	}
	else {
		$('.forOne').find('*').css('visibility', 'hidden');
	}
}
開發者ID:rpdg,項目名稱:fy.js,代碼行數:30,代碼來源:metaData.ts

示例3: appendRow

	//append a comment table row
	appendRow(curTime: number, text?: string = '') :HTMLInputElement {

		let trId = `tr_${serial()}`;
		let row =
			$(`<tr id="${trId}">
				<td class="lead2">
					${opg.format.timeLength(curTime)}
				</td>
				<td>
					<div class="expandingArea ">
						<pre><span></span><br></pre>
						<textarea data-time="${curTime}" placeholder="輸入意見">${text}</textarea>
					</div>
				</td>
				<td class="text-center">
					<button class="btn-mini btn-info" data-time="${curTime}" title="從該時間點播放">
						<svg style="width: 8px;height: 8px; fill: currentColor;">
							<use xlink:href="${this._svgPath}#plyr-play"></use>
						</svg>
					</button>
					<button data-tid="${trId}" data-time="${curTime}" class="btn-mini btn-danger">&times;</button>
				</td>
			</tr>`);


		this.tb.append(row);

		makeExpandingArea(row.find('.expandingArea')[0]);

		return row.find('textarea')[0] as HTMLInputElement;
	}
開發者ID:rpdg,項目名稱:fy.js,代碼行數:32,代碼來源:AuditTable.ts

示例4:

	opg.api.meta({assetId}, (data) => {

		data.length = opg.format.timeLength(data.length);
		data.vodArrange = contentUsages[data.vodArrange] || '';
		data.copyrightType = copyRightTypes[data.copyrightType] || '';
		data.defaultPriceType = priceTypes[data.defaultPriceType] || '';
		data.sourceType = serialSourceTypes[data.sourceType] || '';
		data.starLevel = starLevels[data.starLevel] || '';
		data.rating = ratings[data.rating] || '';

		if (data.originDate) data.originDate = data.originDate.split(' ')[0];

		for (let attr in data) {
			$(document.getElementById(attr)).text(`${data[attr]}`);
		}
		//todo:可能會有擴展類別
		if (data.type != 1000) {
			$('.forOne').find('*').css('visibility', 'visible');
		}
		else {
			$('.forOne').find('*').css('visibility', 'hidden');
		}
	});
開發者ID:rpdg,項目名稱:fy.js,代碼行數:23,代碼來源:info.ts

示例5:

			opg.api.metaInfo({assetId}, (data) => {

				data.length = opg.format.timeLength(data.length);
				data.vodArrange = contentUsages[data.vodArrange] || '';
				data.copyrightType = copyRightTypes[data.copyrightType] || '';
				data.defaultPriceType = priceTypes[data.defaultPriceType] || '';
				data.sourceType = serialSourceTypes[data.sourceType] || '';
				data.starLevel = starLevels[data.starLevel] || '';
				data.rating = ratings[data.rating] || '';
				if (data.originDate) data.originDate = data.originDate.split(' ')[0];

				let singleProgramClassName = 'forOne' ;
				//todo:可能會有擴展類別
				if (data.type != 1000) {
					singleProgramClassName = '';
				}

				let html = `
					<table class="search-table">
								<thead>
								<tr>
									<td colspan="4" class="lead text-center">基本信息</td>
								</tr>
								</thead>
								<tbody>
								<tr class="forSingleFileOnly">
									<td class="lead">節目名稱</td>
									<td>${data.managerName||''}</td>
									<td class="lead">原名稱</td>
									<td>${data.oriName||''}</td>
								</tr>
								<tr class="forSingleFileOnly">
									<td class="lead">索引名</td>
									<td>${data.sortName||''}<span id=""></span></td>
									<td class="lead">查詢名</td>
									<td>${data.srarchName||''}</td>
								</tr>
								<tr>
									<td class="lead">節目類型</td>
									<td>${data.typeDesc||''}<span id=""></span></td>
									<td class="lead">類別</td>
									<td>${data.contentType||''}</td>
								</tr>
								<tr>
									<td class="lead">欄目Category</td>
									<td>${data.category||''}</td>
									<td class="lead ${singleProgramClassName}"><span>總集數</span></td>
									<td class="${singleProgramClassName}">${data.episodeNumber||''}</td>
								</tr>
								<tr>
									<td class="lead"><label for="genre">子類別Genre</label></td>
									<td colspan="3">${data.genre||''}</td>
								</tr>
								<tr>
									<td class="lead">標簽Tag</td>
									<td colspan="3">${data.tags||''}</td>
								</tr>
								<tr>
									<td class="lead"><label for="categoryNames">分類</label></td>
									<td colspan="3">${data.categoryNames||''}</td>
								</tr>
								<tr>
									<td class="lead"><label for="groupNames">內容分組 </label></td>
									<td colspan="3">${data.groupNames||''}</td>
								</tr>
								<tr>
									<td class="lead">生效時間</td>
									<td>${data.validTime||''}</td>
									<td class="lead"><label for="expireTime">失效時間</label></td>
									<td>${data.expireTime||''}</td>
								</tr>
								<tr>
									<td class="lead">節目時長</td>
									<td colspan="3">${data.length||''}</td>
								</tr>
								<tr>
									<td class="lead"><label for="keyword">關鍵字</label></td>
									<td colspan="3">${data.keyword||''}</td>
								</tr>
								<tr>
									<td class="lead"><label for="description">簡介</label></td>
									<td colspan="3">${data.description||''}</td>
								</tr>
								<tr>
									<td class="lead"><label for="adName">廣告名稱</label></td>
									<td colspan="3">${data.adName||''}</td>
								</tr>
								</tbody>
							</table>
					
							<table class="search-table">
								<thead>
								<tr>
									<td colspan="4" class="lead text-center">版權信息</td>
								</tr>
								</thead>
								<tbody>
								<tr>
									<td class="lead"><label for="vodArrange">用途</label></td>
									<td>${data.vodArrange||''}</td>
//.........這裏部分代碼省略.........
開發者ID:rpdg,項目名稱:fy.js,代碼行數:101,代碼來源:viewMeta.ts


注:本文中的ts/opg.ts.default.format類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。