本文整理汇总了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">×</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;未经允许,请勿转载。 |
请发表评论