feat: 后端全量更新 - 含所有本次需求

- Contract.php: 返回合约账户余额(balance_contract)
- My.php: 地址管理增加BTC/ETH
- AppContract.php: 一键平仓(closeall)
- AppProxy.php: 代理专属注册链接 + 分级权限(L1/L2)
- site.php: 手续费减半(0.018→0.009)
- agent_permission_setup.sql: 代理权限SQL
- crypto_news_crawler.py: 新闻自动采集脚本
This commit is contained in:
li
2026-03-30 20:16:32 +08:00
commit 1b24994e74
6721 changed files with 1308571 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
<?php
class DPlayerPlugin extends PluginBase{
function __construct(){
parent::__construct();
}
public function regiest(){
$this->hookRegiest(array(
'user.commonJs.insert' => 'DPlayerPlugin.echoJs',
));
}
public function echoJs($st,$act){
if($this->isFileExtence($st,$act)){
$this->echoFile('static/main.js');
}
}
}
+45
View File
@@ -0,0 +1,45 @@
{
"id":"DPlayer",
"name":"DPlayer播放器",
"title":"DPlayer播放器",
"version":"1.08",
"source":{
"icon":"{{pluginHost}}static/images/icon.png",
},
"category":"media,file",
"description":"DPlayer mediafile player;",
"keywords":"",
"auther":{
"copyright":"kodcloud.",
"homePage":"http://www.kodcloud.com",
},
"configItem":{
"pluginAuth":{
"type":"userSelect",
"value":"all:1",
"display":"{{LNG.Plugin.config.auth}}",
"desc":"{{LNG.Plugin.config.authDesc}}",
"require":1
},
"subtitle":{
"type":"switch",
"display":"自动加载字幕",
"desc":"字幕需要放在视频文件同位置,与视频文件同名并追加.vtt",
"value":"0"
},
"step001":"<hr/>",
"fileSort":{
"type":"number",
"display":"{{LNG.Plugin.Config.fileSort}}",
"desc":"{{LNG.Plugin.Config.fileSortDesc}}",
"value":200,
},
"fileExt":{
"type":"tags",
"display":"{{LNG.Plugin.Config.fileExt}}",
"desc":"{{LNG.Plugin.Config.fileExtDesc}}",
//"value":"mp3,wav,m4a,aac,oga,ogg,webma,mp4,m4v,flv,mov,f4v,ogv,webm,webmv,mkv",
"value":"mp4,m4v,flv,mov,f4v,ogv,webm,webmv,mkv",
}
}
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

@@ -0,0 +1,88 @@
kodReady.push(function(){
kodApp.add({
name:"DPlayer",
title:LNG['Plugin.default.DPlayer'],
ext:"{{config.fileExt}}",
sort:"{{config.fileSort}}",
icon:'{{pluginHost}}static/images/icon.png',
callback:function(path,ext){
var music = ['mp3','wav','aac','m4a','oga','ogg','webma'];
if(isWap() && G.ACT != 'file'){ //移动端,非视频文件分享页面用跳转方式打开
return window.open(core.path2url(path));
}
var vedio = {
url:core.path2url(path),
name:urlDecode(core.pathThis(path)),
path:path,
ext:ext
};
var appStatic = "{{pluginHost}}static/";
var top = ShareData.frameTop();
top.require.async(appStatic+'page.js',function(app){
app.play(appStatic,vedio);
});
}
});
window.DplayerSubtitle = parseInt("{{config.subtitle}}");
//临时兼容4.38及以前版本;APP预览txt校验权限失败问题;
if (G.ACT + '.' + G.ST == 'view.api' && !G.user){
G.sharePage = undefined;
$.addStyle('.ace_editor{font-size:13px !important;}');
}
/**
* 临时修复文件夹右键新窗口打开异常问题<=4.32
*/
var checkAuth = function(path){
if (path == undefined) return false;
if (path.indexOf('http') === 0 ) return true;
if (!G.shareInfo &&
!core.pathReadable(path)){
Tips.tips(LNG.no_permission_read_all,false);
core.playSound("error");
return false;
}
return true;
}
kodApp.add({
name:"browserOpen",
title:LNG.open_ie,
sort:-100,
icon:"x-item-file x-html",
callback:function(path,ext){
var url = core.path2url(path);
console.log(url,path,ext);
if( path.substr(-1) == '/' && url.search("explorer/fileProxy&") !=-1 ){
return Tips.tips(LNG.path_can_not_action,false);
}
if(!checkAuth(path)) return;
if(isWap()){
window.location.href = url;
}else{
window.open(url);
}
}
});
core.path2url=function(beforePath,testHttp){
if (beforePath.substr(0,4) == 'http') return beforePath;
if(testHttp == undefined) testHttp = true;//尝试转换为http真实路径;只允许root用户
var url,path = core.pathClear(beforePath);
//user group
if (G.isRoot && testHttp &&
path.substring(0,G.webRoot.length) == G.webRoot){//服务器路径下
if (path.substring(0,G.basicPath.length) == G.basicPath){//设置了服务器到子目录
url = G.appRoot + core.pathUrlEncode(path.replace(G.basicPath,''));
}else{
url = G.webHost + core.pathUrlEncode(path.replace(G.webRoot,''));
}
}else{
url = G.appHost+'explorer/fileProxy&accessToken='+G.accessToken+'&path=' +urlEncode(path);
if (typeof(G.sharePage) != 'undefined') {
url = G.appHost+'share/fileProxy&user='+G.user+'&sid='+G.sid+'&path=' +urlEncode(path);
}
}
return url;
}
});
+108
View File
@@ -0,0 +1,108 @@
define(function(require, exports) {
var playStart = function(vedioInfo){
var $target = createDialog(vedioInfo.name);
var typeArr = {
'f4v' : 'flv',
'f4a' : 'flv',
'm4a' : 'mp3',
'aac' : 'mp3',
'ogg' : 'oga',
};
var type = typeArr[vedioInfo.ext] || vedioInfo.ext;
var playerOption = {
container:$target.get(0),
preload: 'none',
theme:'#f60',
loop: false,
autoplay:true,
lang: 'zh-cn',
//flv仅支持 H.264+AAC编码 https://github.com/Bilibili/flv.js/issues/47
video: {
url:vedioInfo.url,
type:type
},
// danmaku: {
// id:md5(vedioInfo.url),
// api:'https://api.prprpr.me/dplayer/'
// },
contextmenu: [
{
text: 'kodcloud官网',
link: 'https://kodcloud.com/'
}
]
};
if(window.DplayerSubtitle){
// 默认加载同名文件字幕;暂时只支持vtt格式 http://dplayer.js.org/#/home?id=options
playerOption.subtitle = {
url:core.path2url(vedioInfo.path+'.vtt')
}
}
var player = new DPlayer(playerOption);
resetSize(player,$target);
}
var resetSize = function(player,$player){
var reset = function(){
// $player.css({position:'absolute'});
var vWidth = $player.width();
var vHeight = $player.height();
var wWidth = $(window).width() * 0.9;
var wHeight = $(window).height() * 0.9;
if(vHeight >= wHeight){
vWidth = (wHeight * vWidth) / vHeight;
vHeight = wHeight;
}
if( vWidth >= wWidth ){
vHeight = (wWidth * vHeight) / vWidth;
vWidth = wWidth;
}
var dialog = $player.parents('.dplayer-dialog').data('artDialog');
var left = ($(window).width() - vWidth) / 2;
var top = ($(window).height() - vHeight) / 2;
// console.log(22,[vWidth,vHeight],[left,top]);
if(!dialog) return;
dialog.size(vWidth,vHeight).position(left,top);
}
// $player.css({position:'absolute'});
player.on('loadeddata',reset);
};
var createDialog = function(title,ext){
var size = {width:'70%',height:'60%'};
if(ext == 'mp3'){
size = {width:'320px',height:'420px'};
}
var dialog = $.dialog({
//id:'movie-dialog',
simple:true,
ico:core.icon('mp4'),
title:title,
width:size.width,
height:size.height,
content:'<div class="Dplayer"></div>',
resize:true,
padding:0,
fixed:true,
close:function(){
}
});
dialog.DOM.wrap.addClass('dplayer-dialog');
return dialog.DOM.wrap.find(".Dplayer");
}
var playReady = function(appStatic,vedioInfo){
require.async([
appStatic+'DPlayer/lib/flv.min.js',
appStatic+'DPlayer/lib/hls.min.js',
appStatic+'DPlayer/lib/dash.all.min.js',
appStatic+'DPlayer/DPlayer.min.css',
appStatic+'DPlayer/DPlayer.min.js',
],function(a){
playStart(vedioInfo);
});
}
return {
play:playReady
};
});
+17
View File
@@ -0,0 +1,17 @@
<?php
class VLCPlayerPlugin extends PluginBase{
function __construct(){
parent::__construct();
}
public function regiest(){
$this->hookRegiest(array(
'user.commonJs.insert' => 'VLCPlayerPlugin.echoJs',
));
}
public function echoJs($st,$act){
if($this->isFileExtence($st,$act)){
$this->echoFile('static/main.js');
}
}
}
@@ -0,0 +1,37 @@
{
"id":"VLCPlayer",
"name":"VLC Player",
"title":"VLC 播放器",
"version":"1.33",
"source":{
"icon":"{{pluginHost}}static/images/icon.png"
},
"category":"media,file",
"description":"VLCPlayer mediafile player;",
"keywords":"",
"auther":{
"copyright":"kodcloud.",
"homePage":"http://www.kodcloud.com",
},
"configItem":{
"pluginAuth":{
"type":"userSelect",
"value":"all:1",
"display":"{{LNG.Plugin.config.auth}}",
"desc":"{{LNG.Plugin.config.authDesc}}",
"require":1
},
"fileExt":{
"type":"tags",
"display":"{{LNG.Plugin.Config.fileExt}}",
"desc":"{{LNG.Plugin.Config.fileExtDesc}}",
"value":"aac,arc,arj,asf,asx,avi,f4v,flv, m2ts,m4v,mp2,mov,mp3,mp4,mp4v,mpe,mpg,mts,mkv,ogv,3gp,mpeg,wav,wma,wmv,rm,rmvb,vob,webm,webmv, mp3,wav,wma,m4a,aac,oga,ogg,webma",
},
"fileSort":{
"type":"number",
"display":"{{LNG.Plugin.Config.fileSort}}",
"desc":"{{LNG.Plugin.Config.fileSortDesc}}",
"value":1,
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

@@ -0,0 +1,84 @@
kodReady.push(function(){
kodApp.add({
name:"VLCPlayer",
title:LNG['Plugin.default.VLCPlayer'],
ext:"{{config.fileExt}}",
sort:"{{config.fileSort}}",
icon:'{{pluginHost}}static/images/icon.png',
callback:function(path,ext){
if(isWap()){//ios不支持文件下载
window.open(core.path2url(path));
return;
}
var dialog = $.dialog({
ico:core.icon(ext),
title:urlDecode(core.pathThis(path)),
animate:false,
width:750,
height:450,
content:makePlayer(core.path2url(path)),
resize:true,
padding:0,
fixed:true
});
$('.VLCPlayer-dialog embed').css('background','#000');
setTimeout(function() {
var vlc = getVLC("vlc");
if(!vlc || !vlc.playlist){
dialog.DOM.wrap.find('.error-tips').removeClass('hidden');
}
dialog._clickMax();
dialog._clickMax();
},500);
}
});
function getVLC(name){
if (window.document[name]){
return window.document[name];
}
if ($.isIE()) {
if (document.embeds && document.embeds[name]){
return document.embeds[name];
}
}else{
return document.getElementById(name);
}
}
var makePlayer = function(src){
if(navigator.platform.toLowerCase().indexOf('win') == -1 ){
var msg = '<div class="row can-select" style="position:absolute;top:40%;width:100%;">\
<div class="col-md-8 col-md-offset-2">\
<div class="alert alert-warning" role="alert">\
<h5>抱歉该插件仅支持windows系统</h5> </div> </div></div>';
return msg;
}
var player = "";
var width = '100%',height = '100%';
var download = "http://download.videolan.org/pub/videolan/vlc/2.2.6/win32/vlc-2.2.6-win32.exe";
player = '<object width="'+width+'" height="'+height+'" data="'+src+'" id="VLCPlayer" ';
player += 'classid="clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616">';
player += '<param name="codebase" value="http://go.divx.com/plugin/DivXBrowserPlugin.cab">';
player += '<param value="true" name="autoPlay">';
player += '<param value="'+src+'" name="src">';
player += '<embed width="'+width+'" height="'+height+'" version="VideoLAN.VLCPlugin.2" pluginspage="'+download+'" type="application/x-vlc-plugin" name="vlc" src="' + src + '">';
player += '</object>';
player += '<div class="row can-select error-tips hidden" style="position:absolute;top:40%;width:100%;">\
<div class="col-md-8 col-md-offset-2"><div class="alert alert-warning">\
<h4> VLC播放器尚未安装<br/><br/></h4>\
<p>请先安装 <a href="'+download+'">VLC播放器</a> 安装后需重新启动浏览。<br/>\
或将文件<a href="'+src+'">下载</a>到本地用电脑播放器播放。<br/><br/>\
: 该插件需要activex支持只支持windows,不支持firefox和chrome50+(屏蔽了activex功能),建议使用360极速QQ浏览器UC浏览器猎豹等\
</p>\
</div>\
</div></div>';
return player;
}
});
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+26
View File
@@ -0,0 +1,26 @@
<?php
class adminerPlugin extends PluginBase{
function __construct(){
parent::__construct();
}
public function regiest(){
$this->hookRegiest(array(
'templateCommonHeader' => 'adminerPlugin.addMenu'
));
}
public function addMenu(){
$config = $this->getConfig();
$subMenu = $config['menuSubMenu'];
navbar_menu_add(array(
'name' => 'Adminer',
'icon' => $this->appIcon(),
'url' => $this->pluginApi,
'target' => '_blank',
'subMenu' => $subMenu,
'use' => '1'
));
}
public function index(){
header('Location: '.$this->pluginHost.'adminer/');
}
}
+5
View File
@@ -0,0 +1,5 @@
<?php
return array(
'Adminer.meta.title' => "Database management",
'Adminer.meta.desc' => " Database management in a single PHP file.<br/><br/>support:MySQL, PostgreSQL, SQLite, MS SQL, Oracle, SimpleDB, Elasticsearch, MongoDB, Firebird"
);
@@ -0,0 +1,6 @@
<?php
return array(
'Adminer.meta.title' => "数据库管理工具",
'Adminer.meta.desc' => "Adminer 是一款全功能的数据库管理工具,类似phpMyAdmin,相比而言更轻量强大。<br/><br/>支持管理的数据库:MySQL, PostgreSQL, SQLite, MS SQL, Oracle, SimpleDB, Elasticsearch, MongoDB, Firebird<br/>由于安全要求比较高,此插件仅限管理员可以使用"
);
+32
View File
@@ -0,0 +1,32 @@
{
"id":"adminer",
"name":"Adminer",
"title":"{{LNG.Adminer.meta.title}}",
"version":"4.77",
"source":{
"thumb":"",
"className":"font-icon icon-bar-chart bg-blue-7",
"screenshoot":["{{pluginHost}}static/screenshot.png"]
},
"category":"tools",
"description":"{{LNG.Adminer.meta.desc}}",
"keywords":"",
"auther":{
"copyright":"adminer.org",
"homePage":"https://www.adminer.org"
},
"configItem":{
"pluginAuth":{
"type":"userSelect",
"value":"role:1",
"display":"{{LNG.Plugin.config.auth}}",
"desc":"{{LNG.Plugin.config.authDesc}}",
"require":1
},
"menuSubMenu":{
"type":"switch",
"value":1,
"display":"{{LNG.menu_sub_menu}}"
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

+68
View File
@@ -0,0 +1,68 @@
<?php
class imageExifPlugin extends PluginBase{
function __construct(){
parent::__construct();
//扩展缺失提示
if( !function_exists('exif_read_data')){
$this->appPackage();
$this->packageData['configItem'] = array(
"sep001" => '<div class="alert alert-danger m-30">'.LNG('imageExif.Config.missLib').'</div>',
);
}
}
public function regiest(){
$this->hookRegiest(array(
'user.commonJs.insert' => 'imageExifPlugin.echoJs',
'share.image' => 'imageExifPlugin.imageCheck',
'explorer.image' => 'imageExifPlugin.imageCheck',
));
}
public function echoJs($st,$act){
if( !function_exists('exif_read_data')){
return;
}
//$this->echoFile('static/main.js');
}
public function getExif(){
$path = _DIR($this->in['path']);
$exif = @exif_read_data($path);
show_json($exif,!!$exif);
}
//根据Orientation 自动旋转图片
//http://blog.csdn.net/ouyangtianhan/article/details/29825885
//https://gxnotes.com/article/126807.html
//https://zhuanlan.zhihu.com/p/25216999
public function imageCheck(){
if( !function_exists('exif_read_data')){
return;
}
$path = _DIR($this->in['path']);
$exif = @exif_read_data($path);
if(!file_exists($path) || !$exif || !isset($exif['Orientation'])) return;
if( $exif['Orientation']< 3) return;
$img = ImageThumb::image($path);
if(!$img) return;
$ort = $exif['Orientation'];
if($ort == 5 || $ort == 6){
$img = imagerotate($img, 270, null);
}
if($ort == 3 || $ort == 4){
$img = imagerotate($img, 180, null);
}
if($ort == 7 || $ort == 8){
$img = imagerotate($img, 90, null);
}
if($ort == 4 || $ort == 5 || $ort == 7){
imageflip($img,IMG_FLIP_HORIZONTAL);
}
$ext = get_path_ext($path);
$imagefun = 'image'.($ext=='jpg'?'jpeg':$ext);
$res = $imagefun($img, $path);
imagedestroy($img);
//show_json($exif,$res);
}
}
@@ -0,0 +1,7 @@
<?php
return array(
'imageExif.meta.name' => 'Image EXIF',
'imageExif.meta.title' => 'Image EXIF Get',
'imageExif.meta.desc' => 'Picture EXIF access; camera phone to take pictures automatically correct direction',
'imageExif.Config.missLib' => "Lack php exif extensions, try again after installation"
);
@@ -0,0 +1,7 @@
<?php
return array(
'imageExif.meta.name' => '图片EXIF',
'imageExif.meta.title' => '图片EXIF获取',
'imageExif.meta.desc' => '图片EXIF获取;手机拍摄图片方向自动校正',
'imageExif.Config.missLib' => "缺少php扩展exif,请安装后再试",
);
@@ -0,0 +1,26 @@
{
"id":"imageExif",
"name":"{{LNG.imageExif.meta.name}}",
"title":"{{LNG.imageExif.meta.title}}",
"version":"1.2",
"category":"media",
"source":{
"className":"font-icon icon-info bg-blue-7"
},
"description":"{{LNG.imageExif.meta.desc}}",
"auther":{
"copyright":"kodcloud",
"homePage":"http://kodcloud.com"
},
"configItem":{
"formStyle":{"className":"form-box-title-right"},
"pluginAuth":{
"type":"userSelect",
"value":"all:1",
"display":"{{LNG.Plugin.config.auth}}",
"desc":"{{LNG.Plugin.config.authDesc}}",
"require":1
}
}
}
@@ -0,0 +1,52 @@
// fileHistoryPlugin
kodReady.push(function(){
var menuOpt = {
'image-exif':{
name:LNG['imageExif.meta.name'],
className:"image-exif",
icon:" icon-info",
callback:function(action,option){
if(option.selector == '.menu-tree-file'){
var param = ui.tree.makeParam();
}else{
var param = ui.path.makeParam();
}
var request = '{{pluginApi}}getExif&path='+urlEncode(param.path);
console.log(param.path);
$.ajax({
url:request,
dataType:'json',
beforeSend: function(){
Tips.loading(LNG.loading);
},
error:core.ajaxError,
success:function(data){
Tips.close(data);
if(data.code){
console.log(data.data);
}
}
});
}
}
}
$.contextMenu.menuAdd(menuOpt,'.menu-file',false,'.info');
$.contextMenu.menuAdd(menuOpt,'.menu-tree-file',false,'.info');
//显示隐藏 [ 只在自己的目录;自己所在的群组目录文件有历史记录权限]
Hook.bind('rightMenu.show.menu-file',function($menuAt,$theMenu){
if($('.context-menu-active').hasClass('menu-tree-file') ){
var param = ui.tree.makeParam();
}else{
var param = ui.path.makeParam();
}
var ext = core.pathExt(param.path);
var hideClass = 'hidden';//'disabled' hideClass
if (inArray(['jpg','jpeg','png','bmp'],ext)){
$theMenu.find('.image-exif').removeClass(hideClass);
}else{
$theMenu.find('.image-exif').addClass(hideClass);
}
});
});
+17
View File
@@ -0,0 +1,17 @@
<?php
class jPlayerPlugin extends PluginBase{
function __construct(){
parent::__construct();
}
public function regiest(){
$this->hookRegiest(array(
'user.commonJs.insert' => 'jPlayerPlugin.echoJs',
));
}
public function echoJs($st,$act){
if($this->isFileExtence($st,$act)){
$this->echoFile('static/main.js');
}
}
}
+41
View File
@@ -0,0 +1,41 @@
{
"id":"jPlayer",
"name":"jPlayer",
"title":"jPlayer",
"version":"1.35",
"source":{
"icon":"{{pluginHost}}static/images/icon.png",
"screenshoot":[
"https://raw.githubusercontent.com/kalcaddle/static/master/images/kod/file-player.png"
]
},
"category":"media,file",
"description":"jPlayer mediafile player;",
"keywords":"",
"auther":{
"copyright":"kodcloud.",
"homePage":"http://www.kodcloud.com",
},
"configItem":{
"pluginAuth":{
"type":"userSelect",
"value":"all:1",
"display":"{{LNG.Plugin.config.auth}}",
"desc":"{{LNG.Plugin.config.authDesc}}",
"require":1
},
"fileExt":{
"type":"tags",
"display":"{{LNG.Plugin.Config.fileExt}}",
"desc":"{{LNG.Plugin.Config.fileExtDesc}}",
"value":"mp3,wav,m4a,aac,oga,ogg,webma,mp4,m4v,flv,mov,f4v,ogv,webm,webmv,m3u8a,m3ua,flac,fla,rtmp,rtmpa",
},
"fileSort":{
"type":"number",
"display":"{{LNG.Plugin.Config.fileSort}}",
"desc":"{{LNG.Plugin.Config.fileSortDesc}}",
"value":10,
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

File diff suppressed because one or more lines are too long
@@ -0,0 +1,223 @@
var jPlayerConfigInit = function($player,config){
var playerConfig = {
supplied: "flv,webma,webmv,oga,ogv,m4v,mp3,wav,rtmpa,rtmpv",
solution: "html,flash",
wmode:"transparent",
volume:0.8,
autoBlur: true,
autohide:{
restored:true,// false true autohide
full:true,
fadeIn:400,
fadeOut:1000,
hold:2500
},
smoothPlayBar: false,
keyEnabled: true,
remainingDuration: false,
toggleDuration: false,
errorAlerts: false,
warningAlerts: false,
size: {
width: "100%",
height: "auto"
},
cssSelectorAncestor: "#"+$($player).attr('id'),
cssSelector: {
videoPlay: ".video-play",
play: ".play",
pause: ".pause",
seekBar: ".seekBar",
playBar: ".playBar",
mute: ".right-volume .mute",
unmute: ".right-volume .unmute",
volumeBar: ".volume-control",
volumeBarValue: ".volume-control .volume-value",
currentTime: ".timer.current",
duration: ".timer.duration",
fullScreen: ".fullscreen",
restoreScreen: ".smallscreen",
gui: ".controls",
noSolution: ".noSolution"
},
ready: function(current) {
$($player).find(".controls .progress-block").css({margin: "0 10px 0 45px"});
var media = $(this).data('jPlayer').option.media;
if(media){
$(this).jPlayer('setMedia',media);
}
},
loadedmetadata:function(){//载入后重置窗口大小
try{
$player.data('player_resize','0');
setTimeout(function(){
jPlayerResizeVedio($player);
},200);
}catch(e){};
},
error: function(current) {
if( current.jPlayer.error.type == 'e_no_solution' &&
current.jPlayer.error.context.indexOf("solution:'flash'") === 1){
$(".jPlayer-container").css({"text-align": "center"});
$(".jPlayer-container").html('Flash插件被屏蔽,请在运行后播放');
return;
}
if(current.jPlayer.error.type != $.jPlayer.error.FLASH){
//Tips.tips(LNG.unknow_file_tips+'('+current.jPlayer.error.type+')',false);
}
var $that = $(this);
var $jPlayer = $($player).find(".jPlayer-container");
if($that.data('errorNum') == undefined){
$that.data('errorNum',1);
}
//flash未加载完成
if( current.jPlayer.error.type == $.jPlayer.error.FLASH &&
$jPlayer.data('jPlayer') &&
$that.data('errorNum') < 100 &&
$jPlayer.data('jPlayer').status){
setTimeout(function(){
$that.data('errorNum',$that.data('errorNum')+1);
var data = $jPlayer.data('jPlayer');
if(data && data.status){
$jPlayer.jPlayer('setMedia',data.status.media).jPlayer('play');
}
},200);
}
if(current.jPlayer.error.type === $.jPlayer.error.URL_NOT_SET){
}
},
waiting:function(){
$($player).find('.video-play-loading').show();
},
playing:function(){
$($player).find('.video-play-loading').hide();
if($player.data('player_resize') != '1'){
$player.data('player_resize','1');
jPlayerResizeVedio($($player));
}
},
play: function() {
$($player).find('.video-play').stop(true, true).fadeOut(150);
},
pause: function() {
$($player).find('.video-play').stop(true, true).fadeIn(150);
},
ended: function() {
var $next = $($player).find('.play-forward');
if($next.length ==1){
$next.click();
}
}
};
$.extend(playerConfig,config);
return playerConfig;
}
var jPlayerResizeVedio = function($player){
var name = $player.parents('.dialog-simple').find('.aui-title-bar').attr('id');
var dialog = $.artDialog.list[name];
var $vedio = $player.find('video');
if(name != 'movie-player-dialog' || $vedio.length == 0){
return;
}
var vWidth = $vedio.width(),
vHeight = $vedio.height(),
winWidth = $(window).width(),
winHeight = $(window).height(),
r = vWidth/vHeight;
if(vHeight >= winHeight*0.8){
vHeight = winHeight*0.8;
vWidth = vHeight*r;
}
if(vWidth >= winWidth*0.8){
vWidth = winWidth*0.8;
vHeight = vWidth/r;
}
dialog.size(vWidth,vHeight);
}
var jPlayerBindControl = function($player){
var $jPlayer = $player.find(".jPlayer-container");
$player.find('.playerScreen').unbind('dblclick').dblclick(function(event) {
if(!$player.hasClass('jp-state-full-screen')){
$player.find('.fullscreen').click();
}else{//退出全屏
$player.find('.smallscreen').click();
}
}).unbind('click').click(function(event) {
var $buttonPlay = $player.find('.video-play');
if($buttonPlay.css('display') == "none"){
$jPlayer.jPlayer("pause");
$buttonPlay.stop(true, true).fadeIn(150);
}else{
$jPlayer.jPlayer("play");
$buttonPlay.stop(true, true).fadeOut(350);
}
stopPP(event);
return false;
}).unbind('mousemove').mousemove(function(event) {
var $gui = $player.find('.controls');
$gui.fadeIn(100, function() {
clearTimeout($gui.data('auto_timer'));
var timer = setTimeout( function() {
$gui.fadeOut(300);
},2000);
$gui.data('auto_timer',timer);
});
});
$player.find(".volumeblock").unbind('mousedown').mousedown(function() {
var $that = $(this);
var isDrag = true;
$that.mousemove(function(e) {
if(!isDrag) return;
var percent = (e.pageX - $that.offset().left-5) / $that.find(".volume-control").width();
percent = percent <= 0 ? 0 : percent;
percent = percent >= 1 ? 1 : percent;
$that.find(".volume-value").css('width',(percent*100)+'%');
$player.find(".jPlayer-container").jPlayer("option", "muted", false);
$player.find(".jPlayer-container").jPlayer("option", "volume",percent);
return false;
}).mouseup(function(e){
isDrag = false;
});
return false;
});
$player.find(".progress").unbind('mousedown').mousedown(function() {
var $that = $(this);
var isDrag = true;
var resetHead = function(e){
var width = $that.find(".seekBar").width();
var percent = (e.pageX - $that.offset().left) / width * 100;
$that.find(".playBar").css({
width: percent + "%"
});
$player.find(".jPlayer-container").jPlayer("playHead",percent);
$player.find(".jPlayer-container").jPlayer('play');
};
$(this).mousemove(function(e) {
if(!isDrag) return;
resetHead(e);
return false;
}).mouseup(function(e){
resetHead(e);
isDrag = false;
});
return false;
}).unbind('mouseenter').bind('mouseenter',function(){
$player.find('.current-time-tips').fadeIn();
}).unbind('mouseleave').bind('mouseleave',function(){
$player.find('.current-time-tips').fadeOut();
}).unbind('mousemove').bind('mousemove',function(e){
var playerData = $player.find(".jPlayer-container").data('jPlayer');
if(!playerData) return;
var $that = $(this);
var percent = (e.pageX - $that.offset().left) / $that.width();
var display = $.jPlayer.convertTime(playerData.status.duration * percent);
var left = e.pageX - $($player).offset().left;
$player.find('.current-time-tips').css('left',left).text(display);
});
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

@@ -0,0 +1,713 @@
.dialog-simple.movie-player-dialog,
.dialog-simple.movie-player-dialog .aui-outer,
.dialog-simple.movie-player-dialog .aui-border {overflow: visible;}
div.dialog-simple.my-jPlayer.movie-player-dialog .aui-header{}
div.dialog-simple.my-jPlayer.movie-player-dialog .aui-title{
background:#666;filter: alpha(opacity=50);opacity:0.5;
border-radius: 0;opacity:1;
}
/*div.dialog-simple.my-jPlayer.movie-player-dialog .aui-header {top: -31px;background:#444;background:rgba(0,0,0,0.01);}*/
/*div.dialog-simple.my-jPlayer.movie-player-dialog.dialog-max .aui-header {top:0px;background:transparent;}*/
/*div.dialog-simple.my-jPlayer.movie-player-dialog .jPlayer-movie .controls{bottom: -33px;}*/
div.dialog-simple.my-jPlayer.movie-player-dialog .aui-header {top:0px;background:#000;background:rgba(0,0,0,0.01);}
div.dialog-simple.my-jPlayer.movie-player-dialog.dialog-max .aui-header {top:0px;background:transparent;}
div.dialog-simple.my-jPlayer.movie-player-dialog .aui-title{background:#000;filter: alpha(opacity=50);opacity:0.5;}
div.dialog-simple.my-jPlayer.movie-player-dialog .jPlayer-movie .controls{bottom:0px;}
/*div.dialog-simple.my-jPlayer.movie-player-dialog .dialog-mouse-in .jPlayer-movie .controls{display:block !important;}*/
.jPlayer-movie {
display:block;
/*overflow:hidden;*/
color:#f9f9f9;
box-shadow: 0 2px 30px rgba(50,50,50,0.5);
margin:0;
height: 100%;width: 100%;
background: #000;
position: relative;
}
.jPlayer-movie a {
color:#f9f9f9;
text-decoration:none;
outline-style:none;
outline-width:0
}
.jPlayer-movie * {
box-sizing:content-box;
-moz-box-sizing:content-box;
-webkit-box-sizing:content-box
}
.jPlayer-movie.flashPlayer .jPlayer-container,
.jPlayer-movie.flashPlayer .jPlayer-container object{
width:100% !important;
height:100% !important;
}
.jPlayer-movie a.smooth {
transition:all 0.1s linear;
-webkit-transition:all 0.1s linear;
-moz-transition:all 0.1s linear;
-o-transition:all 0.1s linear
}
.jPlayer-movie .jPlayer-container {
margin:0;
padding:0;
line-height:0;
}
.jPlayer-movie .jPlayerMask,
.jPlayer-movie.jp-video-full .jPlayerMask{
position: absolute;
top: 0;bottom:0px;left: 0px;right: 0px;
cursor:pointer;
z-index: 99;
z-index:999\9;
background:#000;
filter: alpha(opacity=1);opacity:0.01;
}
.jPlayer-movie object{width:100%;height:100%;}
.jPlayer-movie.jp-video-full,.dialog-max .jPlayer{
width:100% !important;
height:100% !important;
}
.jPlayer-movie.jp-video-full>.controls {
position:absolute;
left:0;
right:0;
bottom:0;
z-index:1000
}
.jPlayer-movie.jp-video-full, .jPlayer-movie.jp-video-full object, .jPlayer-movie.jp-video-full video {
position:fixed;
top:0;
left:0;
right:0;
bottom:0;
display:block;
border-width:0px;
z-index:999
}
.jPlayer-movie.jp-video-full .playerScreen {
position:static;
}
.jPlayer-movie.jp-video-full .playerScreen .video-play {
z-index:1000
}
.jPlayer-movie .playerScreen {
cursor:pointer;
position:relative;
width: 100%;
height: 100%;
z-index: 1;
display: flex;display: -webkit-flex;
align-items: center;-webkit-align-items: center;
justify-content: center;-webkit-justify-content: center;
position: absolute;overflow: hidden;
}
.jPlayer-movie .current-time-tips{
display: none;
position: absolute;
bottom: 35px;
border-radius: 4px;
font-size: 12px;
width: 40px;
margin-left: -20px;
height: 25px;
background-color: #444;
color: #fff;
z-index: 99;
text-align: center;
line-height: 25px;
background-color: rgba(50,50,50,0.7);
}
.jPlayer-movie .playerScreen .video-play{
display:block;
position:absolute;
z-index:100;
width:100%;
top:0;
left:0;
right:0;
bottom:0;
background:rgba(0, 0, 0, 0.4);
}
.jPlayer-movie .playerScreen .video-play-loading{
display: none;
position: absolute;
z-index: 100;
top: 50%;
left: 50%;
background: none;
opacity: 0.6;
}
.jPlayer-movie .playerScreen .video-play-loading .play-icon{
display: block;
left: 0;
top: 50%;
width:100px;
height:100px;
font-size:80px;
text-align:center;
line-height:100px;
color: #fff;
margin:-50px 0 0 -50px;
}
.jPlayer-movie .playerScreen .video-play .play-icon{
position:absolute;
top:50%;
left:50%;
color: #fff;
color: rgba(255,255,255,0.7);
margin:-60px 0 0 -60px;
display:block;
width:120px;
height:120px;
font-size:6em;
text-align:center;
line-height:140px;
}
.jPlayer-movie .controls {
position: absolute;
width: 100%;
bottom: 0px;
font-size:12px;
height:32px;
line-height:32px !important;
background:#232323;
border-top: 1px solid #333;
z-index:10;
background-color:rgba(30,30,30,0.5);
border-color:rgba(0,0,0,0.1);
opacity: 0.9;
padding:0;
margin:0;
}
.jPlayer-movie .controls .progress-block {
display:block;
width:auto;
margin:0 185px 0 45px !important;
}
.jPlayer-movie .controls .progress-block .timer {
text-align:center
}
.jPlayer-movie .controls .progress-block .timer.current {
float:left;
width:40px
}
.jPlayer-movie .controls .progress-block .timer.duration {
float:right;
width:40px
}
.jPlayer-movie .controls .progress-block .progress {
display:block;
width:auto;
margin:0 45px 0 45px;
background: none;filter: none;
overflow: visible;
position: relative;
height:6px;
padding:13px 0;
z-index:9
}
.jPlayer-movie .controls .progress-block .progress .fullBar {
width: 100%;
background: #2f2f2f;
background: rgba(150,150,150,0.3);
height: 100%;
position: absolute;
left: 0px;
height: 6px;
border-radius:6px;
-webkit-border-radius:6px;
z-index: -1;
}
.jPlayer-movie .controls .progress-block .progress .seekBar {
position:relative;
display:block;
cursor:pointer;
padding:0;
margin:0;
height:100%;
background:#3d3d3d;
background-color: rgba(170,170,170,0.55);
border-radius:6px;
-webkit-border-radius:6px;
}
.jPlayer-movie .controls .progress-block .progress .seekBar .playBar {
display:block;
position:relative;
height:100%;
padding:0;
background:#0082B2;
border-radius:2px;
-webkit-border-radius:2px;
overflow: visible !important;
}
.jPlayer-movie .controls .progress-block .progress .seekBar .playBar:after,
.jPlayer-movie .controls .volumeblock .volume-control .volume-value:after{
content: " ";
width: 16px;
height: 16px;
position: absolute;
background: #03A9F4;
border-radius: 50%;
right: -8px;
top: -5px;
transition: box-shadow 0.2s;
}
.jPlayer-movie .controls .progress-block .progress .seekBar:hover .playBar:after,
.jPlayer-movie .controls .volumeblock .volume-control:hover .volume-value:after{
box-shadow: 0 0 0 5px rgba(81, 201, 255, 0.32);
background: #90ddff;
transition: box-shadow 0.2s;
}
.jPlayer-movie .controls .volumeblock {
display:block;
position:absolute;
right:40px;
top:0;
width:80px;
margin:0 10px;
height:32px;
font-size:0
}
.jPlayer-movie .controls .volumeblock .volume-control {
display:inline-block;
height:5px;
width:100%;
cursor:pointer;
background:#3d3d3d;
background-color: rgba(150,150,150,0.5);
border-radius:6px;
-webkit-border-radius:6px;
vertical-align:middle;
}
.jPlayer-movie .controls .volumeblock .volume-control .volume-value {
display:block;
width:20%;
height:100%;
background:#0082B2;
border-radius:6px;
position: relative;
-webkit-border-radius:6px;
}
.jPlayer-movie .controls .controlset {
display:block;
position:absolute;
text-align:center;
top:0
}
.jPlayer-movie .controls .controlset.left {left:0;}
.jPlayer-movie .controls .controlset.right {right:0;}
.jPlayer-movie .controls .controlset.right-volume {right:140px}
.jPlayer-movie .controls .controlset .play, .jPlayer-movie .controls .controlset .pause, .jPlayer-movie .controls .controlset .fullscreen, .jPlayer-movie .controls .controlset .smallscreen, .jPlayer-movie .controls .controlset .mute, .jPlayer-movie .controls .controlset .unmute {
display:inline-block;
width:38px;
height:32px;
font-size:1.4444444444em;
background:transparent
}
.jPlayer-movie .controls .controlset .play:hover, .jPlayer-movie .controls .controlset .pause:hover, .jPlayer-movie .controls .controlset .fullscreen:hover, .jPlayer-movie .controls .controlset .smallscreen:hover, .jPlayer-movie .controls .controlset .mute:hover, .jPlayer-movie .controls .controlset .unmute:hover {
background:#3d3d3d;
background: rgba(255,255,255,0.4);
}
.jPlayer-movie.audioPlayer .playerScreen .video-play {
display:none !important
}
.jPlayer-movie.audioPlayer .controls .controlset.right {
display:none
}
.jPlayer-movie.audioPlayer .controls .controlset.right-volume {
right:100px
}
.jPlayer-movie.audioPlayer .controls .progress-block {
margin:0 140px 0 40px;
}
.jPlayer-movie.audioPlayer .controls .volumeblock {
right:5px
}
.jPlayer-movie.light {
color:#000
}
.jPlayer-movie.light a {
color:#000
}
.jPlayer-movie.light .playerScreen .video-play {
background:rgba(204, 204, 204, 0.4)
}
.jPlayer-movie.light .controls {
background:#F4F4F4;
border:1px solid #e7e7e7
}
.jPlayer-movie.light .controls .play:hover, .jPlayer-movie.light .controls .pause:hover, .jPlayer-movie.light .controls .fullscreen:hover, .jPlayer-movie.light .controls .smallscreen:hover, .jPlayer-movie.light .controls .mute:hover, .jPlayer-movie.light .controls .unmute:hover {
background:#dbdbdb
}
.jPlayer-movie.light .controls .volumeblock .volume-control, .jPlayer-movie.light .controls .progress-block .progress .seekBar {
background:#dbdbdb
}
.jPlayer-movie.light .controls .volumeblock .volume-control .volume-value, .jPlayer-movie.light .controls .progress-block .progress .seekBar .playBar {
background:#0082B2
}
@media (max-width: 480px) {
.jPlayer-movie .controls .progress-block {
margin:0 40px 0 40px !important;
}
.jPlayer-movie.audioPlayer .controls .progress-block {
margin:0 5px 0 40px !important;
}
.jPlayer-movie .controls .volumeblock {
display:none
}
.jPlayer-movie .controls .controlset.right-volume {
display:none
}
.jPlayer-movie .playerScreen .video-play .play-icon {
font-size:3.5em;
margin:-35px 0 0 -35px;
width:70px;
height:70px;
line-height:70px
}
}
/*=========================*/
div.dialog-simple.my-jPlayer .aui-header{
position: absolute;
left: 0px;right: 0px;
width: 100%;height: 40px;
}
div.dialog-simple.my-jPlayer .aui-title-bar{z-index: 100;}
div.dialog-simple.my-jPlayer .aui-title{background:none;opacity: 0;}
body div.dialog-simple.my-jPlayer .aui-outer .aui-min,
body div.dialog-simple.my-jPlayer .aui-outer .aui-max,
body div.dialog-simple.my-jPlayer .aui-outer .aui-close{
border-radius: 50%;
background-image: none;
background: rgba(255, 255, 255, 0.3);
width: 18px;
height: 18px;
font-size: 12px;
line-height: 18px;
}
body div.dialog-simple.my-jPlayer .aui-outer .aui-min:hover{background: #ffeb3b;color: #8e810d;}
body div.dialog-simple.my-jPlayer .aui-outer .aui-max:hover{background: #4CAF50;color: #19581c;}
body div.dialog-simple.my-jPlayer .aui-outer .aui-close:hover{background:#f30;color:#751717;}
body div.dialog-simple.my-jPlayer .aui-outer .aui-close{right:6px;}
body div.dialog-simple.my-jPlayer .aui-outer .aui-max{right: 28px;}
body div.dialog-simple.my-jPlayer .aui-outer .aui-min{right: 50px;}
body div.dialog-simple.my-jPlayer .aui-outer .aui-close:before{content: "\f00d";}
body div.dialog-simple.my-jPlayer .aui-outer .aui-max:before{content: "\f065";}
body div.dialog-simple.my-jPlayer .aui-outer .aui-min:before{content: "\f068";}
div.dialog-simple.music-player-dialog.my-jPlayer .aui-header{
opacity: 1 !important;filter: alpha(opacity=100) !important;overflow: hidden;
}
div.dialog-simple.music-player-dialog.my-jPlayer .aui-title-bar{width:100%;height:80%;overflow: hidden;}
div.dialog-simple.music-player-dialog.my-jPlayer .aui-title{
font-size:0px;height:100%;width:100%;padding:0;
background:#1a9aff;opacity: 0.01 !important;filter: alpha(opacity=1) !important;
}
div.dialog-simple.music-player-dialog.my-jPlayer .aui-main{min-height: 400px;}
.jPlayer-music{
width: 100%;height: 100%;
min-width: 280px;
min-height: 400px;
box-shadow: 0 0 30px rgba(0,0,0,.35);
color: #fff;text-shadow: 0 0 1px #fff;
}
.jPlayer-music .player-bg{
position:absolute;
border-radius: 4px;
opacity: 0.9;
top:0;left:0;right:0;bottom:0;
transition: all .3s ease;-webkit-transition: all .3s ease;
background: #1a9aff;
background-image: -webkit-linear-gradient(160deg, #3f2536, #bc6e07);
background-image: -moz-linear-gradient(160deg, #3f2536, #bc6e07);
background-image: -o-linear-gradient(160deg, #3f2536, #bc6e07);
background-image: -ms-linear-gradient(160deg, #3f2536, #bc6e07);
background-image: linear-gradient(160deg, #5fa716, #2196F3);
}
.jPlayer-music .playerScreen{width:0px;height:0px;}
.jPlayer-music .video-play{display:none !important;}
.jPlayer-music .top-banner {
position: relative;
padding: 15px 15px 5px 15px;
background:#03a9f4;
background: rgba(3, 169, 244, 0.4);
background: rgba(0, 0, 0, 0.25);
}
.jPlayer-music .top-banner .item-title{
position: absolute;width: 70%;margin-top: -8px;
overflow: hidden;white-space: nowrap;text-overflow: ellipsis;
}
.jPlayer-music .current-time-tips{
position: absolute;
display: none;
background: #2984cc;
background: rgba(200, 200, 200, 0.2);
border-radius: 3px;
padding: 2px 5px;
margin-top: -7px;
margin-left: -20px;
}
.jPlayer-music .play-tools{
padding: 0px 0 6px;
position: absolute;
right: 0px;left: 0px;
background: #03a9f4;
background: rgba(0, 0, 0, 0.25);
}
.jPlayer-music .play-tools .time{float: left;margin-left: 15px;}
.jPlayer-music .play-tools .right{float: right;margin-right: 10px;}
.jPlayer-music .play-tools .right span{
padding-left: 10px;
cursor: pointer;
}
.jPlayer-music .play-tools span.show-list,
.jPlayer-music .play-tools span.change-loop,
.jPlayer-music .right-volume a{
display:inline-block;
width:20px;
text-align: right;
}
.jPlayer-music .right-volume a{text-align: center;}
.jPlayer-music .play-tools span.show-list:hover,
.jPlayer-music .play-tools span.change-loop:hover,
.jPlayer-music .right-volume a:hover {
text-shadow: 0 0 2px #fff,0 0 5px #fff,0 0 20px #fff;
}
.jPlayer-music .play-tools i.loop-one:after {
content: "1";
position: absolute;
font-size: 12px;
font-weight: 800;
font-family: monospace;
margin-left: 0px;
margin-top: 3px;
}
.jPlayer-music .right-volume{
position: absolute;
right: 15px;
width: 90px;
height: 20px;
top:60px;
}
.jPlayer-music .right-volume a{
color: #fff;
font-size: 15px;
line-height: 15px;
text-decoration: none;
}
.jPlayer-music .top-banner .progress {
width: auto;
margin: 0;
margin-top:8px;
background: none;filter: none;
overflow: visible;
position: relative;
box-shadow: none;
cursor: pointer;
height: auto;
height:20px;
padding: 0;
z-index: 9;
}
.jPlayer-music .top-banner .progress .fullBar {
width: 100%;
background: #28bcff;
background: rgba(255,255,255,0.2);
position: absolute;
left: 0px;
top: 10px;
height:2px;
border-radius: 6px;
-webkit-border-radius: 6px;
z-index: -1;
}
.jPlayer-music .top-banner .volumeblock {
position: absolute;
right: 0;
top: 7px;
width:65px;
font-size: 0;
}
.jPlayer-music .top-banner .progress .seekBar .playBar,
.jPlayer-music .top-banner .volumeblock .volume-control .volume-value {
display:block;
width:20%;
height:100%;
background: #fff;
background:rgba(255, 255, 255, 0.8);
border-radius:6px;
position: relative;
-webkit-border-radius:6px;
}
.jPlayer-music .top-banner .progress .seekBar,
.jPlayer-music .top-banner .volumeblock .volume-control {
display:inline-block;
height:2px;
width:100%;
cursor:pointer;
background: #5db7ff;
background-color: rgba(255,255,255,0.2);
border-radius:6px;
-webkit-border-radius:6px;
vertical-align:middle;
}
.jPlayer-music .top-banner .progress .seekBar .playBar:after,
.jPlayer-music .top-banner .volumeblock .volume-control .volume-value:after{
content:"";
width: 12px;
height: 12px;
position: absolute;
background: #bce1ff;
background: rgba(255, 255, 255, 0.95);
border-radius: 50%;
right: -10px;
top: -5px;
}
.jPlayer-music .progress i.video-play-loading {
position: absolute;
margin-top: -5px;
width: 12px;
height: 12px;
text-align: center;
font-size: 12px;
right: -10px;
color: rgba(33, 33, 33, 0.4);
z-index: 10;
}
.jPlayer-music .top-banner .progress .seekBar:hover .playBar:after,
.jPlayer-music .top-banner .volumeblock .volume-control:hover .volume-value:after{
box-shadow: 0 0 0 5px rgba(192, 236, 255, 0.32);
}
.jPlayer-music .control-actions{padding-top: 10px;padding-top: 28px;}
.jPlayer-music .control-actions a{
width: 50px;height: 50px;line-height: 50px;
text-decoration: none;
text-align: center;
float: left;
margin-right: 5px;
display: inline-block;
border:2px solid rgba(255,255,255,0.7);
border-radius: 50%;
font-size: 20px;
opacity: .8;
cursor: pointer;
text-shadow: 0 1px 1px rgba(0,0,0,.2);
box-shadow: 0 1px 1px rgba(0,0,0,.2);
background: rgba(0,0,0,.2);
-webkit-transition: all .1s ease;
transition: all .1s ease;
color: #fff;
}
.jPlayer-music .control-actions a:hover{
color:#fff; background: rgba(255,255,255,0.3);
}
.jPlayer-music .control-actions a i.icon-backward{margin-left:-5px;}
.jPlayer-music .control-actions a i.icon-play{margin-left: 4px;}
.jPlayer-music .control-actions a i.icon-play{margin-left: 4px;}
.jPlayer-music .control-actions a i.icon-forward{margin-left:3px;}
.jPlayer-music .control-actions a.play-backward,
.jPlayer-music .control-actions a.play-forward{
height: 30px;margin-top:10px;
width: 30px;
line-height: 30px;
font-size: 14px;
}
/*播放列表*/
.jPlayer-music .play-list{
overflow-y: auto;
height: auto;
top: 154px;
bottom: 0px;
position: absolute;
width: 100%;
background: #3b94dc;
background: rgba(100, 100, 100, 0.3);
}
.jPlayer-music .play-list ul{list-style: none; padding: 0;}
.jPlayer-music .play-list .item{
display: block;
cursor: pointer;
height:35px;
line-height: 35px;
padding-left:10px;
border-color: 1px solid #237cc1;
border-bottom: 1px solid rgba(160, 160, 160, 0.1);
transition: background-color .2s ease;
-webkit-transition: background-color .2s ease;
overflow: hidden;
}
.jPlayer-music .play-list .item .name{
padding-left: 10px;border-left: 4px solid transparent;
display: inline-block;width: 80%;
white-space: nowrap;text-overflow: ellipsis; overflow: hidden;
height: 25px;line-height: 25px;margin-top: 5px;
}
.jPlayer-music .play-list .item:hover,
.jPlayer-music .play-list .item.this{
background: #237cc1;
background: rgba(202, 200, 200, 0.2);
border-color:transparent;
}
.jPlayer-music.jp-state-playing .play-list .item.this:hover{background-image: none;}
.jPlayer-music .play-list .item.this .name{
border-left: 4px solid rgba(255,255,255,0.6);
}
.jPlayer-music .play-list .item .action-right {
float: right;display:none;
transition: all .2s ease;-webkit-transition: all .2s ease;
position: absolute;right: 0;margin-top: -43px;
}
.jPlayer-music .play-list .item:hover .action-right{display:block;}
.jPlayer-music .play-list .item .action-right .download,
.jPlayer-music .play-list .item .action-right .remove{
display: inline-block;text-align: center;
transition: all .2s ease;-webkit-transition: all .2s ease;
width: 36px;height: 36px;background: rgba(255,255,255,0.1);margin-left: -4px;
}
.jPlayer-music .play-list .item .action-right .download:hover,
.jPlayer-music .play-list .item .action-right .remove:hover{
background: rgba(255, 255, 255, 0.3);
transition: all .2s ease;-webkit-transition: all .2s ease;
}
/*播放中 列表*/
.jPlayer-music.jp-state-playing .play-list .item.this{
background-image: url(./images/sound-playing.gif);
background-repeat: no-repeat;
background-position: 95% 13px;
}
/*隐藏列表*/
.hide-play-list .aui-main{height:155px !important;}
.hide-play-list .jPlayer-music{min-height:inherit;}
.hide-play-list .jPlayer-music .play-list{display:none;}
@@ -0,0 +1,92 @@
var jplayerTemplateMovie =
'<div class="jPlayer jPlayer-movie">\
<div class="playerScreen">\
<div class="jPlayer-container"></div>\
<div class="jPlayerMask"></div>\
<a href="javascript:void(0);" class="video-play disable-ripple"><i class="play-icon icon-play-sign"></i></a>\
<a href="javascript:void(0);" class="video-play-loading disable-ripple"><i class="play-icon icon-spinner moveCircleRight"></i></a>\
</div>\
<div class="current-time-tips"><span>00:00</span></div>\
<div class="controls">\
<div class="controlset left">\
<a href="javascript:void(0);" class="play smooth disable-ripple"><i class="icon-play"></i></a>\
<a href="javascript:void(0);" class="pause smooth"><i class="icon-pause"></i></a>\
</div>\
<div class="controlset right-volume">\
<a href="javascript:void(0);" class="mute smooth"><i class="icon-volume-up"></i></a>\
<a href="javascript:void(0);" class="unmute smooth"><i class="icon-volume-off"></i></a>\
</div>\
<div class="volumeblock">\
<div class="volume-control">\
<div class="volume-value"></div>\
</div>\
</div>\
<div class="controlset right">\
<a href="javascript:void(0);" class="fullscreen smooth"><i class="icon-fullscreen"></i></a>\
<a href="javascript:void(0);" class="smallscreen smooth"><i class=" icon-resize-small"></i></a>\
</div>\
<div class="progress-block">\
<div class="timer current"></div>\
<div class="timer duration"></div>\
<div class="progress">\
<div class="fullBar"></div>\
<div class="seekBar">\
<div class="playBar"></div>\
</div>\
</div>\
</div>\
</div>\
<div class="wmp-player"></div>\
</div>';
var jplayerTemplateMusic =
'<div class="jPlayer jPlayer-music">\
<div class="player-bg"></div>\
<div class="playerScreen">\
<div class="jPlayer-container"></div>\
<div class="jPlayerMask"></div>\
</div>\
<div class="top-banner">\
<div class="item-title">--</div>\
<div class="control-actions">\
<a href="javascript:void(0);" class="play-backward smooth"><i class="icon-backward"></i></a>\
<a href="javascript:void(0);" class="play smooth"><i class="icon-play"></i></a>\
<a href="javascript:void(0);" class="pause smooth"><i class="icon-pause"></i></a>\
<a href="javascript:void(0);" class="play-forward smooth"><i class="icon-forward"></i></a>\
<div class="clear"></div>\
</div>\
<div class="current-time-tips"><span>00:00</span></div>\
<!-- volume -->\
<div class="controlset right-volume">\
<a href="javascript:void(0);" class="mute smooth"><i class="icon-volume-up"></i></a>\
<a href="javascript:void(0);" class="unmute smooth"><i class="icon-volume-off"></i></a>\
<div class="volumeblock">\
<div class="volume-control">\
<div class="volume-value"></div>\
</div>\
</div>\
</div>\
<!-- progress -->\
<div class="progress">\
<div class="fullBar"></div>\
<div class="seekBar">\
<div class="playBar"><i class="video-play-loading icon-refresh moveCircleRight"></i></div>\
</div>\
</div>\
</div>\
<!-- info -->\
<div class="play-tools">\
<span class="time">\
<span class="timer current"></span> / <span class="timer duration"></span>\
</span>\
<span class="right">\
<span class="change-loop" data-loop="0"><i class="icon-retweet"></i> </span>\
<span class="show-list"><i class="icon-reorder"></i> </span>\
</span>\
<div class="clear"></div>\
</div>\
<div class="play-list">\
<ul class="content"></ul>\
</div>\
<div class="wmp-player"></div>\
</div>';
+138
View File
@@ -0,0 +1,138 @@
kodReady.push(function(){
var playerSupport = function(){
var support = {
wap:{//移动端
music:['mp3','m4a','aac'],
movie:['mp4','m4v','mov']
},
ie:{
music:['mp3','m4a','aac'],
movie:['mp4','m4v','mov' , 'flv','f4v']
},
chrome:{//default chrome,firefox,edge
music:['mp3','wav','aac', 'm4a','oga','ogg','webma','flac'],
movie:['mp4','m4v','mov', 'f4v','flv','ogv','webm','webmv']
}
//safari 已经禁用了flash
};
var res = support.chrome;
if(isWap()){
res = support.wap;
}else if(!!window.ActiveXObject || "ActiveXObject" in window){
res = support.ie;
}
return res.music.join(',') + ',' + res.movie.join(',');
}
//'mp3,wav,m4a,aac,oga,ogg,webma,mp4,m4v,flv,mov,f4v,ogv,webm,webmv'
var myPlayer;
var loadMyPlayer = function(callback){
var appStatic = "{{pluginHost}}static/";
var appStaticDefault = "{{pluginHostDefault}}static/";
if(myPlayer){
callback(myPlayer);
}else{
var top = ShareData.frameTop();
top.require.async(appStatic+'page.js',function(app){
if(!myPlayer){
myPlayer = app;
myPlayer.init(appStatic,appStaticDefault);
}
callback(myPlayer);
});
}
};
kodApp.add({
name:"jPlayer",
title:LNG['Plugin.default.jPlayer'],
ext:playerSupport(),
//ext:"{{config.fileExt}}",
sort:"{{config.fileSort}}",
icon:'{{pluginHost}}static/images/icon.png',
callback:function(path,ext){
var music = ['mp3','wav','aac','m4a','oga','ogg','webma','m3u8a','m3ua','flac'];
if(isWap() && $.inArray(ext, music) == -1 && G.ACT != 'file' ){ //移动端,非视频文件分享页面用跳转方式打开
return window.open(core.path2url(path));
}
var list = [{
url:core.path2url(path),
name:urlDecode(core.pathThis(path)),//zip内文件播放
ext:ext
}];
if(isWap() && !window.jplayerInit){
window.jplayerInit = true;
$(".jPlayer-music .play-list .remove").trigger("click");
$.addStyle('.music-player-dialog{visibility:visible;}');
}
loadMyPlayer(function(player){
player.play(list);
});
}
});
// 移动端安卓首次打开播放器不自动播放问题处理;
if(isWap()){
$.addStyle('.music-player-dialog{visibility:hidden;}');
// loadMyPlayer(function(player){
// player.play([{url:"",name:"",ext:"mp3"}]);
// });
}
//音效播放绑定
Hook.bind('playSound',function(url){
loadMyPlayer(function(player){
player.playSound(url);
});
});
//多选含有音乐右键菜单
var menuOpt = {
'play-media':{
name:LNG.add_to_play,
className:"play-media hidden",
icon:"x-item-file x-mp3",
accesskey: "p",
callback:function(action,option){
if (ui.fileLight.fileListSelect().length <1) return;
var list = [];//选中单个&多个都可以播放
ui.fileLight.fileListSelect().each(function(index){
var ext = ui.fileLight.type($(this));
if ( kodApp.appSupportCheck('jPlayer',ext) ) {
var path = ui.fileLight.path($(this));
var url = core.path2url(path,false);
list.push({
url:url,
name:core.pathThis(path),
ext:ext
});
}
});
loadMyPlayer(function(player){
player.play(list);
});
}
}
}
$.contextMenu.menuAdd(menuOpt,'.menu-more',false,'.clone');
//多选含有音乐检测;添加到音乐列表
Hook.bind('rightMenu.show.menu-more',function($menuAt,$theMenu){
var needMenu = 0;
var hideClass = 'hidden';
ui.fileLight.fileListSelect().each(function(){
var ext = core.pathExt(ui.fileLight.name($(this)));
if ( kodApp.appSupportCheck('jPlayer',ext) ){
needMenu +=1;
}
});
if(needMenu == 0){
$theMenu.find('.play-media').addClass(hideClass);
}else{
$theMenu.find('.play-media').removeClass(hideClass);
}
});
});
+384
View File
@@ -0,0 +1,384 @@
define(function(require, exports) {
var movieTemplate = '';
var musicTemplate = '';
var MUSIC = 'music-player';
var MOVIE = 'movie-player';
var appStatic,appStaticDefault;
var create = function(playerType){
var ico = playerType == MUSIC?'mp3':'mp4';
var selector = '.'+playerType+'-dialog';
var template = movieTemplate;
var size = {width:'70%',height:'60%'};
if(playerType == MUSIC){
template = musicTemplate;
size = {width:'320px',height:'420px'};
}
var dialog = $.dialog({
id:playerType+'-dialog',
simple:true,
ico:core.icon(ico),
title:'player',
// top:'25%',
disableTab:true,
width:size.width,
height:size.height,
content:template,
resize:true,
padding:0,
fixed:true,
close:function(){
var player = getPlayer(playerType);
player.jPlayer("destroy");//.jPlayer("pause");
}
});
dialog.DOM.wrap.addClass('my-jPlayer');
return $(selector).find(".jPlayer-container");
};
var getPlayerType = function(ext){
if (ext =='music' ) return MUSIC;
if (ext == undefined) ext = 'mp3';
if (inArray(['mp3','wav','aac', 'm4a','oga','ogg','webma','m3u8a','m3ua','flac'],ext)) {
return MUSIC;
}else {
return MOVIE;
}
};
var getPlayer = function(playerType){
var selector = '.'+playerType+'-dialog';
var dialog = $(selector);
if(dialog.length == 0){
return false;
}
return dialog.find(".jPlayer-container");
}
/*
html5:mp3,webma,oga,ogg,wav | webmv,ogv,m4v,mp4,mov
flash:mp3,m4a,m4v,mov,mp4,flv
Safari:mp3,m4a | mp4,m4v,mov
Chrome,Firefox: mp3,m4a,webma,oga,wav | webmv,ogv,m4v,mp4,mov
IE9:mp3,m4a | m4v,mp4
*/
var getMedia = function(item){
var typeArr = {
'mp4' : 'm4v',
'm4v' : 'm4v',
'mov' : 'm4v',
'ogv' : 'ogv',
'webm': 'webmv',
'webmv':'webmv',
'flv' : 'flv',
'fla' : 'flv',
'f4v' : 'flv',
'f4a' : 'flv',
'mp3' : 'mp3',
'wav' : 'wav',
'm4a' : 'mp3',
'aac' : 'mp3',
'ogg' : 'oga',
'oga' : 'oga',
'webma':'webma'
};
var ext = item['ext'];
var key = typeArr[ext];
var media = {
'extType':key,
'title':item['name'],
'url':item['url'],
'solution' : (ext=='flv' || ext == 'f4v') ? "flash" : "html,flash"
}
media[key] = item['url'];
return media;
}
var playStart = function(player,media){
if(!media) return;
var $playerBox = player.parents('.jPlayer');
var config = {
solution:media.solution,
//solution:'flash',
swfPath: appStatic+"jPlayer/jquery.jplayer.swf"
}
$playerBox.attr('id',UUID());
player.jPlayer("destroy");
player.find(".jPlayer-container").children().remove();
player.jPlayer(jPlayerConfigInit($playerBox,config));
if(player.find('object').length > 0){
$playerBox.addClass('flashPlayer');
}else{
$playerBox.removeClass('flashPlayer');
}
//delay start play;
player.jPlayer("setMedia",media).jPlayer("play");;
jPlayerBindControl($playerBox);
setTimeout(function(){
var name = $playerBox.parents('.dialog-simple').find('.aui-title-bar').attr('id');
var dialog = $.dialog.list[name];
if(dialog){
dialog.title(media.title);
}
},100);
}
var play = function(list){
var ext = list[0]['ext'];
var playerType = getPlayerType(ext);
var player = getPlayer(playerType);
var media = getMedia(list[0]);
if(!player){
player = create(playerType);
if(playerType == MUSIC){
musicPlayer.init();
}
}
if(playerType == MUSIC){
media = musicPlayer.insert(player,list,ext);
}
playStart(player,media);
try{
$.dialog.list[playerType+'-dialog'].display(true);
}catch(e){};
}
var musicPlayer = (function(){
var playList = [];
var playCurrent = 0;
var player = null;
var loopType = 'circle';//circle,rand
var insert = function(thePlayer,list){
player = thePlayer;
var oldLength = playList.length;
for (var i = 0; i < list.length; i++) {//插入后默认播放列表的最后一个
var exists = false;
var find = 0;
for (find = 0; find < playList.length; find++) {
if(playList[find]['url'] == list[i]['url']){
exists = true;
break;
}
}
// 已存在则不插入
// 插入后默认播放列表的最后一个;最后一个已存在则不做处理
if(exists){
if(i == list.length - 1){
if(playCurrent != find){
playIndex(find);
}
}
continue;
}
playList.push( getMedia(list[i]));
}
if(playList.length == oldLength){
return false;//有重复对应处理
}
playCurrent = playList.length-1;
updateView(true);
return playList[playCurrent];
}
var playIndex = function(index){
index = index <= 0 ? 0 : index;
index = index >= playList.length-1 ? playList.length-1 : index;
playCurrent = index;
var media = playList[index];
playStart(player,media);
updateView(false);
}
var playAt = function(type){
switch(loopType){
case 'circle':
if(type == 'next'){
if(playCurrent < playList.length-1){
playIndex(playCurrent+1);
}else{
playIndex(0);
}
}else{//prev
if(playCurrent-1 < 0){
playIndex(playList.length-1);
}else{
playIndex(playCurrent-1);
}
}
break;
case 'rand':playIndex(roundFromTo(0,playList.length)-1);break;
case 'one':playIndex(playCurrent);break;
default:break;
}
}
var remove = function(index){
playList.splice(index,1);
playIndex(index);
updateView(true);
}
var download = function(index){
var media = playList[index];
var url = media.url+'&download=1';
kodApp.download(url);
}
var init = function(player){
playCurrent = 0;
playList = [];
loopType = 'circle';
var $playBox = $('.jPlayer-music');
var arr = [
{icon:"icon-retweet",loop:'circle'},
{icon:"icon-random",loop:'rand'},
{icon:"icon-refresh loop-one",loop:'one'},
];
$playBox.find('.change-loop').unbind('click').bind('click',function(){
var index = parseInt($(this).attr('data-loop')) + 1;
index = index < 0 ? 0 : index;
index = index >= arr.length ? 0 : index;
var cell = arr[index];
$(this).attr('data-loop',index).find('i').attr('class',cell.icon);
loopType = cell.loop;
});
$playBox.find('.play-backward').unbind('click').bind('click',function(){
playAt('prev');
});
$playBox.find('.play-forward').unbind('click').bind('click',function(){
playAt('next');
});
$playBox.find('.show-list').unbind('click').bind('click',function(e){
$playBox.parents('.music-player-dialog').toggleClass('hide-play-list');
stopPP(e);
});
$playBox.find('.play-list .item').die('click').live('click',function(e){
var index = $(this).index();
playIndex(index);
stopPP(e);
});
$playBox.find('.play-list .remove').die('click').live('click',function(e){
var $item = $(this).parents('.item');
var index = $item.index();
$item.remove();
remove(index);
stopPP(e);
return false;
});
$playBox.find('.play-list .download').die('click').live('click',function(e){
var index = $(this).parents('.item').index();
download(index);
stopPP(e);
return false;
});
}
var updateView = function(resetList){
var $playBox = $(player).parents('.jPlayer');
if(resetList){
var html = '';
$.each(playList,function(i,val){
html +=
'<li class="item">\
<span class="name">'+val.title+'</span>\
<div class="action-right">\
<span class="download"><i class="icon-download-alt"></i></span>\
<span class="remove"><i class="icon-remove"></i></span>\
</div>\
</li>';
});
$playBox.find('.play-list .content').html(html);
}
if(playList.length == 0 || !playList[playCurrent]){
playCurrent = 0;
$playBox.find('.item-title').html("&nbsp; ");
player.jPlayer("destroy");
player.find(".jPlayer-container").children().remove();
return;
}
$playBox.find('.item-title').html(playList[playCurrent].title);
$playBox.find('.item').removeClass('this');
$playBox.find('.item:eq('+playCurrent+')').addClass('this');
colorful($playBox.find('.player-bg'));
}
var colorful = function($dom){
var from = randomColor();
var to = randomColor();
var rotate = '160deg';
var css =
"background-image: -webkit-linear-gradient("+rotate+", "+from+", "+to+");\
background-image: -moz-linear-gradient("+rotate+", "+from+", "+to+");\
background-image: -o-linear-gradient("+rotate+", "+from+", "+to+");\
background-image: -ms-linear-gradient("+rotate+", "+from+", "+to+");\
background-image: linear-gradient("+rotate+", "+from+", "+to+");"
$dom.attr('style',css);
}
var randomColor = function(r,g,b){
return '#'+(Math.random()*0xffffff<<0).toString(16);
}
return {
insert:insert,
init:init
};
})();
var readyPlay = function(list){
if( !$.isArray(list) || list.length == 0){
Tips.tips(LNG.error,false);
}
var playerType = getPlayerType(list[0]['ext']);
if(playerType == MOVIE){
require.async([
appStatic+'jPlayer/kod.flat/template.js',
appStatic+'jPlayer/jquery.jplayer.min.js',
appStatic+'jPlayer/kod.flat/control.js',
appStatic+'jPlayer/kod.flat/style.css'
],function(){
movieTemplate = jplayerTemplateMovie;
play(list);
});
}else{
require.async([
appStatic+'jPlayer/kod.flat/template.js',
appStatic+'jPlayer/jquery.jplayer.min.js',
appStatic+'jPlayer/kod.flat/control.js',
appStatic+'jPlayer/kod.flat/style.css'
],function(a){
musicTemplate = jplayerTemplateMusic;
play(list);
});
}
}
//后台播放声音;
var playSound = function(sound){//mp3
var playerKey = 'x-play-sound';
if($('.'+playerKey).length == 0){
$('<div style="width:0px;height:0px;" class="'+playerKey+'"></div>').appendTo('body');
}
var $dom = $('.'+playerKey);
require.async(appStatic+'jPlayer/jquery.jplayer.min.js',function(a){
var config = {
solution:'html',//'html,flash'
swfPath: appStatic+'jPlayer/jquery.jplayer.swf',
media:{title: "",mp3:sound},
ready:function(){
$dom.jPlayer("setMedia",config.media).jPlayer("play");
}
}
$dom.jPlayer("destroy").children().remove();
$dom.jPlayer(config);
});
}
return {
init:function(staticPath,staticDefault){
appStatic = staticPath;
appStaticDefault = staticDefault;
},
playSound:playSound,
play:readyPlay
};
});
+30
View File
@@ -0,0 +1,30 @@
<?php
class officeLivePlugin extends PluginBase{
function __construct(){
parent::__construct();
}
public function regiest(){
$this->hookRegiest(array(
'user.commonJs.insert' => 'officeLivePlugin.echoJs'
));
}
public function echoJs($st,$act){
if($this->isFileExtence($st,$act)){
$this->echoFile('static/main.js');
}
}
public function index(){
if(substr($this->in['path'],0,4) == 'http'){
$path = $fileUrl = $this->in['path'];
}else{
$path = _DIR($this->in['path']);
$fileUrl = _make_file_proxy($path);
if (!file_exists($path)) {
show_tips(LNG('not_exists'));
}
}
$config = $this->getConfig();
header('Location:'.$config['apiServer'].rawurlencode($fileUrl));
}
}
@@ -0,0 +1,15 @@
<?php
return array(
"officeLive.meta.name" => "Officelive Viewer",
"officeLive.meta.title" => "Officelive Viewer",
"officeLive.meta.desc" => "Officelive Viewer",
"officeLive.Config.apiServer" => "Server Api",
"officeLive.Config.apiServerDesc" => "<div class='can-select pt-10'>
The address of the preview server must be accessible by the server where the server can access kods can use third party services, or Microsoft's official interface <br/> (Kod server must be in the external network, and the need for domain name access)
<div class = 'grayy 8'> https://owa-box.vips100.com/op/view.aspx?src= </div>
<div class = 'grayy 8'> https://docview.mingdao.com/op/view.aspx?src= </div>
<div class = 'grayy 8'> https://preview.tita.com/op/view.aspx?src= </div>
<div class = 'grayy 8'> https://view.officeapps.live.com/op/view.aspx?src= </div>
Users can build their own; <a href='https://kodcloud.com/help/show-5.html' target='_blank'> learn more </a></div>"
);
@@ -0,0 +1,15 @@
<?php
return array(
"officeLive.meta.name" => "Officelive预览",
"officeLive.meta.title" => "Officelive预览",
"officeLive.meta.desc" => "office系列文件在线预览",
"officeLive.Config.apiServer" => "服务器接口",
"officeLive.Config.apiServerDesc" => "<div class='can-select pt-10'>
预览服务器的地址,必须要office所在服务器能访问到kod<br/>可以使用第三方的服务,或微软官方的接口<br/>(kod服务器必须要在外网,且需要域名访问)<br/><br/>
<div class='grey-8'>https://owa-box.vips100.com/op/view.aspx?src=</div>
<div class='grey-8'>https://docview.mingdao.com/op/view.aspx?src=</div>
<div class='grey-8'>https://preview.tita.com/op/view.aspx?src=</div>
<div class='grey-8'>https://view.officeapps.live.com/op/view.aspx?src=</div><br/>
内网的用户,可以自己搭建;<a href='https://kodcloud.com/help/show-5.html' target='_blank'>了解详情</a></div>"
);
@@ -0,0 +1,69 @@
{
"id":"officeLive",
"name":"{{LNG.officeLive.meta.name}}",
"title":"{{LNG.officeLive.meta.title}}",
"version":"1.23",
"category":"file",
"source":{
"icon":"{{pluginHost}}static/images/icon.png"
},
"description":"{{LNG.officeLive.meta.desc}}",
"auther":{
"copyright":"kodcloud",
"homePage":"http://kodcloud.com"
},
"configItem":{
"formStyle":{
"className":"form-box-title-left",
"tabs":[
{
"name":"{{LNG.Plugin.tab.basic}}",
"field":["pluginAuth","pluginAuthOpen","sep001","openWith","apiServer"]
}
]
},
"pluginAuth":{
"type":"userSelect",
"value":"all:1",
"display":"{{LNG.Plugin.config.auth}}",
"desc":"{{LNG.Plugin.config.authDesc}}",
"require":1
},
"pluginAuthOpen":{
"type":"switch",
"value":0,
"display":"{{LNG.Plugin.config.authOpen}}",
"desc":"{{LNG.Plugin.config.authOpenDesc}}",
"require":1
},
"sep001":"<hr/>",
"openWith":{
"type":"radio",
"value":"dialog",
"display":"{{LNG.Plugin.Config.openWith}}",
"info":[
["dialog","{{LNG.Plugin.Config.openWithDilog}}"],
["window","{{LNG.Plugin.Config.openWithWindow}}"]
]
},
"apiServer":{
"type":"input",
"value":"https://view.officeapps.live.com/op/view.aspx?src=",
"display":"{{LNG.officeLive.Config.apiServer}}",
"desc":"{{LNG.officeLive.Config.apiServerDesc}}",
"require":1
},
"fileExt":{
"type":"tags",
"display":"{{LNG.Plugin.Config.fileExt}}",
"desc":"{{LNG.Plugin.Config.fileExtDesc}}",
"value":"doc,docx,docm,dot,dotx,dotm,rtf,xls,xlsx,xlt,xlsb,xlsm,csv,ppt,pptx,pps,ppsx,pptm,potm,ppam,potx,ppsm,odt,ods,odp,ott,ots,otp,wps,wpt",
},
"fileSort":{
"type":"number",
"display":"{{LNG.Plugin.Config.fileSort}}",
"desc":"{{LNG.Plugin.Config.fileSortDesc}}",
"value":55,
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

@@ -0,0 +1,17 @@
kodReady.push(function(){
kodApp.add({
name:"officeLive",
title:"{{LNG.officeLive.meta.name}}",
icon:'{{pluginHost}}static/images/icon.png',
ext:"{{config.fileExt}}",
sort:"{{config.fileSort}}",
callback:function(path,ext){
var url = '{{pluginApi}}&path='+core.pathCommon(path);
if('window' == "{{config.openWith}}" && !core.isFileView() ){
window.open(url);
}else{
core.openDialog(url,core.icon(ext),htmlEncode(core.pathThis(path)));
}
}
});
});
+17
View File
@@ -0,0 +1,17 @@
<?php
class photoSwipePlugin extends PluginBase{
function __construct(){
parent::__construct();
}
public function regiest(){
$this->hookRegiest(array(
'user.commonJs.insert' => 'photoSwipePlugin.echoJs',
));
}
public function echoJs($st,$act){
if($this->isFileExtence($st,$act)){
$this->echoFile('static/main.js');
}
}
}
@@ -0,0 +1,42 @@
{
"id":"photoSwipe",
"name":"PhotoSwipe Image",
"title":"PhotoSwipe Image Viewer",
"version":"1.33",
"source":{
"className":"x-item-file x-png",
"screenshoot":[
"{{staticPath}}images/wall_page/6.jpg",
"{{staticPath}}images/wall_page/8.jpg"
]
},
"category":"media,file",
"description":"PhotoSwipe Image",
"keywords":"",
"auther":{
"copyright":"kodcloud.",
"homePage":"http://www.kodcloud.com",
},
"configItem":{
"pluginAuth":{
"type":"userSelect",
"value":"all:1",
"display":"{{LNG.Plugin.config.auth}}",
"desc":"{{LNG.Plugin.config.authDesc}}",
"require":1
},
"sep1001":"<hr/>",
"fileExt":{
"type":"tags",
"display":"{{LNG.Plugin.Config.fileExt}}",
"desc":"{{LNG.Plugin.Config.fileExtDesc}}",
"value":"jpg,jpeg,png,bmp,gif,ico,svg,cur,webp",
},
"fileSort":{
"type":"number",
"display":"{{LNG.Plugin.Config.fileSort}}",
"desc":"{{LNG.Plugin.Config.fileSortDesc}}",
"value":20
}
}
}
@@ -0,0 +1,483 @@
/*! PhotoSwipe Default UI CSS by Dmitry Semenov | photoswipe.com | MIT license */
/*
Contents:
1. Buttons
2. Share modal and links
3. Index indicator ("1 of X" counter)
4. Caption
5. Loading indicator
6. Additional styles (root element, top bar, idle state, hidden state, etc.)
*/
/*
1. Buttons
*/
/* <button> css reset */
.pswp__button {
width: 44px;
height: 44px;
position: relative;
background: none;
cursor: pointer;
overflow: visible;
-webkit-appearance: none;
display: block;
border: 0;
padding: 0;
margin: 0;
float: right;
opacity: 0.75;
-webkit-transition: opacity 0.2s;
transition: opacity 0.2s;
-webkit-box-shadow: none;
box-shadow: none; }
.pswp__button:focus,
.pswp__button:hover {
opacity: 1; }
.pswp__button:active {
outline: none;
opacity: 0.9; }
.pswp__button::-moz-focus-inner {
padding: 0;
border: 0; }
/* pswp__ui--over-close class it added when mouse is over element that should close gallery */
.pswp__ui--over-close .pswp__button--close {
opacity: 1; }
.pswp__button,
.pswp__button--arrow--left:before,
.pswp__button--arrow--right:before {
background: url(default-skin.png) 0 0 no-repeat;
background-size: 264px 88px;
width: 44px;
height: 44px; }
@media (-webkit-min-device-pixel-ratio: 1.1), (-webkit-min-device-pixel-ratio: 1.09375), (min-resolution: 105dpi), (min-resolution: 1.1dppx) {
/* Serve SVG sprite if browser supports SVG and resolution is more than 105dpi */
.pswp--svg .pswp__button,
.pswp--svg .pswp__button--arrow--left:before,
.pswp--svg .pswp__button--arrow--right:before {
background-image: url(default-skin.svg); }
.pswp--svg .pswp__button--arrow--left,
.pswp--svg .pswp__button--arrow--right {
background: none; } }
.pswp__button--close {
background-position: 0 -44px; }
.pswp__button--share {
background-position: -44px -44px; }
.pswp__button--fs {
display: none; }
.pswp--supports-fs .pswp__button--fs {
display: block; }
.pswp--fs .pswp__button--fs {
background-position: -44px 0; }
.pswp__button--zoom {
display: none;
background-position: -88px 0; }
.pswp--zoom-allowed .pswp__button--zoom {
display: block; }
.pswp--zoomed-in .pswp__button--zoom {
background-position: -132px 0; }
/* no arrows on touch screens */
.pswp--touch .pswp__button--arrow--left,
.pswp--touch .pswp__button--arrow--right {
visibility: hidden; }
/*
Arrow buttons hit area
(icon is added to :before pseudo-element)
*/
.pswp__button--arrow--left,
.pswp__button--arrow--right {
background: none;
top: 50%;
margin-top: -50px;
width: 70px;
height: 100px;
position: absolute; }
.pswp__button--arrow--left {
left: 0; }
.pswp__button--arrow--right {
right: 0; }
.pswp__button--arrow--left:before,
.pswp__button--arrow--right:before {
content: '';
top: 35px;
background-color: rgba(0, 0, 0, 0.3);
height: 30px;
width: 32px;
position: absolute; }
.pswp__button--arrow--left:before {
left: 6px;
background-position: -138px -44px; }
.pswp__button--arrow--right:before {
right: 6px;
background-position: -94px -44px; }
/*
2. Share modal/popup and links
*/
.pswp__counter,
.pswp__share-modal {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none; }
.pswp__share-modal {
display: block;
background: rgba(0, 0, 0, 0.5);
width: 100%;
height: 100%;
top: 0;
left: 0;
padding: 10px;
position: absolute;
z-index: 1600;
opacity: 0;
-webkit-transition: opacity 0.25s ease-out;
transition: opacity 0.25s ease-out;
-webkit-backface-visibility: hidden;
will-change: opacity; }
.pswp__share-modal--hidden {
display: none; }
.pswp__share-tooltip {
z-index: 1620;
position: absolute;
background: #FFF;
top: 56px;
border-radius: 2px;
display: block;
width: auto;
right: 44px;
-webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
-webkit-transform: translateY(6px);
-ms-transform: translateY(6px);
transform: translateY(6px);
-webkit-transition: -webkit-transform 0.25s;
transition: transform 0.25s;
-webkit-backface-visibility: hidden;
will-change: transform; }
.pswp__share-tooltip a {
display: block;
padding: 8px 12px;
color: #000;
text-decoration: none;
font-size: 14px;
line-height: 18px; }
.pswp__share-tooltip a:hover {
text-decoration: none;
color: #000; }
.pswp__share-tooltip a:first-child {
/* round corners on the first/last list item */
border-radius: 2px 2px 0 0; }
.pswp__share-tooltip a:last-child {
border-radius: 0 0 2px 2px; }
.pswp__share-modal--fade-in {
opacity: 1; }
.pswp__share-modal--fade-in .pswp__share-tooltip {
-webkit-transform: translateY(0);
-ms-transform: translateY(0);
transform: translateY(0); }
/* increase size of share links on touch devices */
.pswp--touch .pswp__share-tooltip a {
padding: 16px 12px; }
a.pswp__share--facebook:before {
content: '';
display: block;
width: 0;
height: 0;
position: absolute;
top: -12px;
right: 15px;
border: 6px solid transparent;
border-bottom-color: #FFF;
-webkit-pointer-events: none;
-moz-pointer-events: none;
pointer-events: none; }
a.pswp__share--facebook:hover {
background: #3E5C9A;
color: #FFF; }
a.pswp__share--facebook:hover:before {
border-bottom-color: #3E5C9A; }
a.pswp__share--twitter:hover {
background: #55ACEE;
color: #FFF; }
a.pswp__share--pinterest:hover {
background: #CCC;
color: #CE272D; }
a.pswp__share--download:hover {
background: #DDD; }
/*
3. Index indicator ("1 of X" counter)
*/
.pswp__counter {
position: absolute;
left: 0;
top: 0;
height: 44px;
font-size: 13px;
line-height: 44px;
color: #FFF;
opacity: 0.75;
padding: 0 10px; }
/*
4. Caption
*/
.pswp__caption {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
min-height: 44px; }
.pswp__caption small {
font-size: 11px;
color: #BBB; }
.pswp__caption__center {
text-align: left;
max-width: 420px;
margin: 0 auto;
font-size: 13px;
padding: 10px;
line-height: 20px;
color: #CCC; }
.pswp__caption--empty {
display: none; }
/* Fake caption element, used to calculate height of next/prev image */
.pswp__caption--fake {
visibility: hidden; }
/*
5. Loading indicator (preloader)
You can play with it here - http://codepen.io/dimsemenov/pen/yyBWoR
*/
.pswp__preloader {
width: 44px;
height: 44px;
position: absolute;
top: 0;
left: 50%;
margin-left: -22px;
opacity: 0;
-webkit-transition: opacity 0.25s ease-out;
transition: opacity 0.25s ease-out;
will-change: opacity;
direction: ltr; }
.pswp__preloader__icn {
width: 20px;
height: 20px;
margin: 12px; }
.pswp__preloader--active {
opacity: 1; }
.pswp__preloader--active .pswp__preloader__icn {
/* We use .gif in browsers that don't support CSS animation */
background: url(preloader.gif) 0 0 no-repeat; }
.pswp--css_animation .pswp__preloader--active {
opacity: 1; }
.pswp--css_animation .pswp__preloader--active .pswp__preloader__icn {
-webkit-animation: clockwise 500ms linear infinite;
animation: clockwise 500ms linear infinite; }
.pswp--css_animation .pswp__preloader--active .pswp__preloader__donut {
-webkit-animation: donut-rotate 1000ms cubic-bezier(0.4, 0, 0.22, 1) infinite;
animation: donut-rotate 1000ms cubic-bezier(0.4, 0, 0.22, 1) infinite; }
.pswp--css_animation .pswp__preloader__icn {
background: none;
opacity: 0.75;
width: 14px;
height: 14px;
position: absolute;
left: 15px;
top: 15px;
margin: 0; }
.pswp--css_animation .pswp__preloader__cut {
/*
The idea of animating inner circle is based on Polymer ("material") loading indicator
by Keanu Lee https://blog.keanulee.com/2014/10/20/the-tale-of-three-spinners.html
*/
position: relative;
width: 7px;
height: 14px;
overflow: hidden; }
.pswp--css_animation .pswp__preloader__donut {
-webkit-box-sizing: border-box;
box-sizing: border-box;
width: 14px;
height: 14px;
border: 2px solid #FFF;
border-radius: 50%;
border-left-color: transparent;
border-bottom-color: transparent;
position: absolute;
top: 0;
left: 0;
background: none;
margin: 0; }
@media screen and (max-width: 1024px) {
.pswp__preloader {
position: relative;
left: auto;
top: auto;
margin: 0;
float: right; } }
@-webkit-keyframes clockwise {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg); }
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg); } }
@keyframes clockwise {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg); }
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg); } }
@-webkit-keyframes donut-rotate {
0% {
-webkit-transform: rotate(0);
transform: rotate(0); }
50% {
-webkit-transform: rotate(-140deg);
transform: rotate(-140deg); }
100% {
-webkit-transform: rotate(0);
transform: rotate(0); } }
@keyframes donut-rotate {
0% {
-webkit-transform: rotate(0);
transform: rotate(0); }
50% {
-webkit-transform: rotate(-140deg);
transform: rotate(-140deg); }
100% {
-webkit-transform: rotate(0);
transform: rotate(0); } }
/*
6. Additional styles
*/
/* root element of UI */
.pswp__ui {
-webkit-font-smoothing: auto;
visibility: visible;
opacity: 1;
z-index: 1550; }
/* top black bar with buttons and "1 of X" indicator */
.pswp__top-bar {
position: absolute;
left: 0;
top: 0;
height: 44px;
width: 100%; }
.pswp__caption,
.pswp__top-bar,
.pswp--has_mouse .pswp__button--arrow--left,
.pswp--has_mouse .pswp__button--arrow--right {
-webkit-backface-visibility: hidden;
will-change: opacity;
-webkit-transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1);
transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); }
/* pswp--has_mouse class is added only when two subsequent mousemove events occur */
.pswp--has_mouse .pswp__button--arrow--left,
.pswp--has_mouse .pswp__button--arrow--right {
visibility: visible; }
.pswp__top-bar,
.pswp__caption {
background-color: rgba(0, 0, 0, 0.5); }
/* pswp__ui--fit class is added when main image "fits" between top bar and bottom bar (caption) */
.pswp__ui--fit .pswp__top-bar,
.pswp__ui--fit .pswp__caption {
background-color: rgba(0, 0, 0, 0.3); }
/* pswp__ui--idle class is added when mouse isn't moving for several seconds (JS option timeToIdle) */
.pswp__ui--idle .pswp__top-bar {
opacity: 0; }
.pswp__ui--idle .pswp__button--arrow--left,
.pswp__ui--idle .pswp__button--arrow--right {
opacity: 0; }
/*
pswp__ui--hidden class is added when controls are hidden
e.g. when user taps to toggle visibility of controls
*/
.pswp__ui--hidden .pswp__top-bar,
.pswp__ui--hidden .pswp__caption,
.pswp__ui--hidden .pswp__button--arrow--left,
.pswp__ui--hidden .pswp__button--arrow--right {
/* Force paint & create composition layer for controls. */
opacity: 0.001; }
/* pswp__ui--one-slide class is added when there is just one item in gallery */
.pswp__ui--one-slide .pswp__button--arrow--left,
.pswp__ui--one-slide .pswp__button--arrow--right,
.pswp__ui--one-slide .pswp__counter {
display: none; }
.pswp__element--disabled {
display: none !important; }
.pswp--minimal--dark .pswp__top-bar {
background: none; }
Binary file not shown.

After

Width:  |  Height:  |  Size: 547 B

@@ -0,0 +1 @@
<svg width="264" height="88" viewBox="0 0 264 88" xmlns="http://www.w3.org/2000/svg"><title>default-skin 2</title><g fill="none" fill-rule="evenodd"><g><path d="M67.002 59.5v3.768c-6.307.84-9.184 5.75-10.002 9.732 2.22-2.83 5.564-5.098 10.002-5.098V71.5L73 65.585 67.002 59.5z" id="Shape" fill="#fff"/><g fill="#fff"><path d="M13 29v-5h2v3h3v2h-5zM13 15h5v2h-3v3h-2v-5zM31 15v5h-2v-3h-3v-2h5zM31 29h-5v-2h3v-3h2v5z" id="Shape"/></g><g fill="#fff"><path d="M62 24v5h-2v-3h-3v-2h5zM62 20h-5v-2h3v-3h2v5zM70 20v-5h2v3h3v2h-5zM70 24h5v2h-3v3h-2v-5z"/></g><path d="M20.586 66l-5.656-5.656 1.414-1.414L22 64.586l5.656-5.656 1.414 1.414L23.414 66l5.656 5.656-1.414 1.414L22 67.414l-5.656 5.656-1.414-1.414L20.586 66z" fill="#fff"/><path d="M111.785 65.03L110 63.5l3-3.5h-10v-2h10l-3-3.5 1.785-1.468L117 59l-5.215 6.03z" fill="#fff"/><path d="M152.215 65.03L154 63.5l-3-3.5h10v-2h-10l3-3.5-1.785-1.468L147 59l5.215 6.03z" fill="#fff"/><g><path id="Rectangle-11" fill="#fff" d="M160.957 28.543l-3.25-3.25-1.413 1.414 3.25 3.25z"/><path d="M152.5 27c3.038 0 5.5-2.462 5.5-5.5s-2.462-5.5-5.5-5.5-5.5 2.462-5.5 5.5 2.462 5.5 5.5 5.5z" id="Oval-1" stroke="#fff" stroke-width="1.5"/><path fill="#fff" d="M150 21h5v1h-5z"/></g><g><path d="M116.957 28.543l-1.414 1.414-3.25-3.25 1.414-1.414 3.25 3.25z" fill="#fff"/><path d="M108.5 27c3.038 0 5.5-2.462 5.5-5.5s-2.462-5.5-5.5-5.5-5.5 2.462-5.5 5.5 2.462 5.5 5.5 5.5z" stroke="#fff" stroke-width="1.5"/><path fill="#fff" d="M106 21h5v1h-5z"/><path fill="#fff" d="M109.043 19.008l-.085 5-1-.017.085-5z"/></g></g></g></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 866 B

@@ -0,0 +1,42 @@
<div class="pswp pswp_content" tabindex="-1" role="dialog" aria-hidden="true">
<div class="pswp__bg"></div>
<!-- Slides wrapper with overflow:hidden. -->
<div class="pswp__scroll-wrap">
<!-- Container that holds slides. PhotoSwipe keeps only 3 slides in DOM to save memory. -->
<div class="pswp__container">
<!-- don't modify these 3 pswp__item elements, data is added later on -->
<div class="pswp__item"></div>
<div class="pswp__item"></div>
<div class="pswp__item"></div>
</div>
<!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
<div class="pswp__ui pswp__ui--hidden">
<div class="pswp__top-bar">
<div class="pswp__counter"></div>
<button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
<button class="pswp__button pswp__button--share" title="Share"></button>
<button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
<button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
<div class="pswp__preloader">
<div class="pswp__preloader__icn">
<div class="pswp__preloader__cut">
<div class="pswp__preloader__donut"></div>
</div>
</div>
</div>
</div>
<div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
<div class="pswp__share-tooltip"></div>
</div>
<button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
</button>
<button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
</button>
<div class="pswp__caption">
<div class="pswp__caption__center"></div>
</div>
</div>
</div>
</div>
File diff suppressed because one or more lines are too long
@@ -0,0 +1,178 @@
/*! PhotoSwipe main CSS by Dmitry Semenov | photoswipe.com | MIT license */
/*
Styles for basic PhotoSwipe functionality (sliding area, open/close transitions)
*/
/* pswp = photoswipe */
.pswp {
display: none;
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
overflow: hidden;
-ms-touch-action: none;
touch-action: none;
z-index: 1500;
-webkit-text-size-adjust: 100%;
/* create separate layer, to avoid paint on window.onscroll in webkit/blink */
-webkit-backface-visibility: hidden;
outline: none; }
.pswp * {
-webkit-box-sizing: border-box;
box-sizing: border-box; }
.pswp img {
max-width: none; }
/* style is added when JS option showHideOpacity is set to true */
.pswp--animate_opacity {
/* 0.001, because opacity:0 doesn't trigger Paint action, which causes lag at start of transition */
opacity: 0.001;
will-change: opacity;
/* for open/close transition */
-webkit-transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1);
transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); }
.pswp--open {
display: block; }
.pswp--zoom-allowed .pswp__img {
/* autoprefixer: off */
cursor: -webkit-zoom-in;
cursor: -moz-zoom-in;
cursor: zoom-in; }
.pswp--zoomed-in .pswp__img {
/* autoprefixer: off */
cursor: -webkit-grab;
cursor: -moz-grab;
cursor: grab; }
.pswp--dragging .pswp__img {
/* autoprefixer: off */
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
cursor: grabbing; }
/*
Background is added as a separate element.
As animating opacity is much faster than animating rgba() background-color.
*/
.pswp__bg {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: #000;
opacity: 0;
transform: translateZ(0);
-webkit-backface-visibility: hidden;
will-change: opacity; }
.pswp__scroll-wrap {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: hidden; }
.pswp__container,
.pswp__zoom-wrap {
-ms-touch-action: none;
touch-action: none;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0; }
/* Prevent selection and tap highlights */
.pswp__container,
.pswp__img {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-tap-highlight-color: transparent;
-webkit-touch-callout: none; }
.pswp__zoom-wrap {
position: absolute;
width: 100%;
-webkit-transform-origin: left top;
-ms-transform-origin: left top;
transform-origin: left top;
/* for open/close transition */
-webkit-transition: -webkit-transform 333ms cubic-bezier(0.4, 0, 0.22, 1);
transition: transform 333ms cubic-bezier(0.4, 0, 0.22, 1); }
.pswp__bg {
will-change: opacity;
/* for open/close transition */
-webkit-transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1);
transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); }
.pswp--animated-in .pswp__bg,
.pswp--animated-in .pswp__zoom-wrap {
-webkit-transition: none;
transition: none; }
.pswp__container,
.pswp__zoom-wrap {
-webkit-backface-visibility: hidden; }
.pswp__item {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
overflow: hidden; }
.pswp__img {
position: absolute;
width: auto;
height: auto;
top: 0;
left: 0; }
/*
stretched thumbnail or div placeholder element (see below)
style is added to avoid flickering in webkit/blink when layers overlap
*/
.pswp__img--placeholder {
-webkit-backface-visibility: hidden; }
/*
div element that matches size of large image
large image loads on top of it
*/
.pswp__img--placeholder--blank {
background: #222; }
.pswp--ie .pswp__img {
width: 100% !important;
height: auto !important;
left: 0;
top: 0; }
/*
Error message appears when image is not loaded
(JS option errorMsg controls markup)
*/
.pswp__error-msg {
position: absolute;
left: 0;
top: 50%;
width: 100%;
text-align: center;
font-size: 14px;
line-height: 16px;
margin-top: -8px;
color: #CCC; }
.pswp__error-msg a {
color: #CCC;
text-decoration: underline; }
File diff suppressed because one or more lines are too long
@@ -0,0 +1,22 @@
kodReady.push(function(){
if( !$.supportCanvas() ){
return;
}
kodApp.add({
name:"photoSwipe",
title:"photoSwipe Image",
ext:"{{config.fileExt}}",
sort:"{{config.fileSort}}",
icon:"x-item-file x-jpg",
callback:function(imagePath,ext){
var appStatic = "{{pluginHost}}static/";
var appStaticDefault = "{{pluginHostDefault}}static/";
require.async(appStatic+'page.js?ver='+G.version,function(app){
app(imagePath,appStatic,appStaticDefault)
});
}
});
if(isWap()){
$.addStyle(".pswp--supports-fs .pswp__button--fs{display:none !important;}")
}
});
@@ -0,0 +1,185 @@
define(function(require, exports) {
var imageUrl = function(path,trueImage){
if(path.substr(0,4) == 'http'){
return path;
}
//gif 预览
if(trueImage || core.pathExt(path) == 'gif'){
return core.path2url(path);
}
var imageThumb = G.appHost+'explorer/image';
if(G.sid){
imageThumb = G.appHost+'share/image&user='+G.user+'&sid='+G.sid;
}
imageThumb += '&path='+urlEncode(path)+'&thumbWidth=1200';
return imageThumb;
}
var itemsArr = [];
var getImageArr = function(imagePath){
itemsArr = [];
var index = -1;
var itemsPush = function(path,msrc,$dom){
if($dom && $dom.attr('data-src')){
path = $dom.attr('data-src');
msrc = $dom.attr('data-original');
}
var width = 0,height = 0;
var link = imageUrl(path);
if(!msrc){
msrc = link;
}
itemsArr.push({
src:link,
msrc:msrc,
trueImage:imageUrl(path,true),
title:core.pathThis(urlDecode(path)),
w:width,h:height,
$dom:$dom?$dom:false
});
}
//打开时最后的target对象dom [文件列表;搜索列表;树目录[编辑器压缩文件预览]]
var $lastTarget = kodApp.getLastOpenTarget();
//console.log('test',$lastTarget);
if(!$lastTarget || _.get($lastTarget,'length') == 0){
}else if($lastTarget.hasClass('file-box')){
var $continer = $lastTarget.parents('.file-continer');
$continer.find('.ico.picture').each(function(i){
var $image = $(this).find('img');
var thePath = hashDecode($(this).parents('.file').attr('data-path'));
if(thePath == imagePath){
index = i;
}
itemsPush(thePath,$image.attr('data-original'),$image);
});
}else if($lastTarget.parents('.search-result').exists()){//搜索列表
var $continer = $lastTarget.parents('.search-result');
$continer.find('.file-item').each(function(i){
var thePath = hashDecode($(this).attr('data-path'));
if($(this).attr('data-src')){
thePath = $(this).attr('data-src');
}
var ext = core.pathExt(thePath);
if(!kodApp.appSupportCheck('photoSwipe',ext)){
return;
}
if(thePath == imagePath){
index = i;
}
itemsPush(thePath,false,$(this).find('.file-icon'));
});
}else if($lastTarget.parents('.ztree').exists()){ //树目录:编辑器或压缩文件内打开
var id = $lastTarget.parents('.ztree').attr('id');
var zTree = $.fn.zTree.getZTreeObj(id);
var fileNum = 0;
$lastTarget.parent().find('li[treenode]').each(function(){
var node = zTree.getNodeByTId($(this).attr('id'));
if(!node) return;
var thePath = node.path;
var ext = core.pathExt(node.path);
if(!kodApp.appSupportCheck('photoSwipe',ext)){
return;
}
if(thePath == imagePath){
index = fileNum;
}
fileNum ++;
itemsPush(thePath,false,$(this).find('.tree_icon'));
});
}
if(itemsArr.length == 0 || index == -1){
itemsArr = [];
itemsPush(imagePath);
index = 0;
}
return {items:itemsArr,index:index};
}
//http://dimsemenov.com/plugins/royal-slider/gallery/
//http://photoswipe.com/documentation/faq.html
return function(imagePath,appStatic,appStaticDefault){
require.async([
appStaticDefault+'PhotoSwipe/photoSwipe.html',
appStatic+'PhotoSwipe/photoswipe.min',
appStatic+'PhotoSwipe/photoswipe-ui-default.min',
appStatic+'PhotoSwipe/photoswipe.css',
appStatic+'PhotoSwipe/default-skin/default-skin.css',
],function(photoSwipeTpl){
if($('.pswp_content').length == 0){
$(photoSwipeTpl).appendTo('body');
$('.pswp__caption__center').css({"text-align":"center"});
}
if($('.pswp').hasClass('pswp--open')){//已经打开
return;
}
var options = {
// history: false,
focus: true,
index: 0,
bgOpacity:0.8,
maxSpreadZoom:5,
closeOnScroll:false,
shareEl: true,
shareButtons: [
//{id:'facebook', label:'Facebook', url:'https://www.facebook.com/sharer/sharer.php?u={{url}}'},
{id:'open', label:"查看原图", url:'{{raw_image_url}}', download:false},
{id:'download', label:LNG.download, url:'{{raw_image_url}}', download:true}
],
getImageURLForShare: function( shareButtonData ) {
return gallery.currItem.trueImage || '';
},
showHideOpacity:false,
showAnimationDuration: 300,
hideAnimationDuration: 300,
fullscreenEl : true,
// captionEl : false,
// tapToClose : false,
// tapToToggleControls : true,
getThumbBoundsFn: function(index) {
var item = itemsArr[index];
if(!item || !item.$dom || item.$dom.length == 0){//目录切换后没有原图
return {x:$(window).width()/2,y:$(window).height()/2,w:1,h:1};
}
var pageYScroll = window.pageYOffset || document.documentElement.scrollTop;
var rect = $(item.$dom).get(0).getBoundingClientRect();
return {x:rect.left,y:rect.top + pageYScroll,w:rect.width,h:rect.height};
}
};
var image = getImageArr(imagePath);
options.index = image.index;
var gallery = new PhotoSwipe($('.pswp').get(0),PhotoSwipeUI_Default,image.items,options);
gallery.loadFinished = false;
gallery.listen('gettingData', function(index, item) {
if (item.w < 1 || item.h < 1) {
var img = new Image();
img.onload = function() {
item.w = this.width;
item.h = this.height;
gallery.updateSize(true);
}
img.src = item.src;
}
//打开图片,加载动画起始位置
if(!gallery.loadFinished){
var rect = options.getThumbBoundsFn(index);
item.w = rect.w * 25;
item.h = rect.h * 25;
gallery.loadFinished = true;
}
});
gallery.init();
});
}
});
+17
View File
@@ -0,0 +1,17 @@
<?php
class picasaPlugin extends PluginBase{
function __construct(){
parent::__construct();
}
public function regiest(){
$this->hookRegiest(array(
'user.commonJs.insert' => 'picasaPlugin.echoJs',
));
}
public function echoJs($st,$act){
if($this->isFileExtence($st,$act)){
$this->echoFile('static/main.js');
}
}
}
+42
View File
@@ -0,0 +1,42 @@
{
"id":"picasa",
"name":"{{LNG.Plugin.default.picasa}}",
"title":"",
"version":"1.22",
"source":{
"className":"x-item-file x-jpg",
"screenshoot":[
"{{staticPath}}images/wall_page/1.jpg",
"{{staticPath}}images/wall_page/5.jpg"
]
},
"category":"media,file",
"description":"{{LNG.Plugin.default.picasa}}",
"keywords":"",
"auther":{
"copyright":"kodcloud.",
"homePage":"http://www.kodcloud.com",
},
"configItem":{
"pluginAuth":{
"type":"userSelect",
"value":"all:1",
"display":"{{LNG.Plugin.config.auth}}",
"desc":"{{LNG.Plugin.config.authDesc}}",
"require":1
},
"sep1001":"<hr/>",
"fileExt":{
"type":"tags",
"display":"{{LNG.Plugin.Config.fileExt}}",
"desc":"{{LNG.Plugin.Config.fileExtDesc}}",
"value":"jpg,jpeg,png,bmp,gif,ico,svg,cur,webp",
},
"fileSort":{
"type":"number",
"display":"{{LNG.Plugin.Config.fileSort}}",
"desc":"{{LNG.Plugin.Config.fileSortDesc}}",
"value":10
}
}
}
+15
View File
@@ -0,0 +1,15 @@
kodReady.push(function(){
kodApp.add({
name:"picasa",
title:"{{LNG.Plugin.default.picasa}}",
ext:"{{config.fileExt}}",
sort:"{{config.fileSort}}",
icon:"x-item-file x-png",
callback:function(imagePath,ext){
var appStatic = "{{pluginHost}}static/";
require.async(appStatic+'page.js',function(app){
app(imagePath,appStatic)
});
}
});
});
+138
View File
@@ -0,0 +1,138 @@
define(function(require, exports) {
var imageUrl = function(path,trueImage){
if(path.substr(0,4) == 'http'){
return path;
}
//gif 预览
if(trueImage || core.pathExt(path) == 'gif'){
return core.path2url(path);
}
var imageThumb = G.appHost+'explorer/image';
if(G.sid){
imageThumb = G.appHost+'share/image&user='+G.user+'&sid='+G.sid;
}
imageThumb += '&path='+urlEncode(path)+'&thumbWidth=1200';
return imageThumb;
}
var getImageArr = function(imagePath){
var items = [];
var index = -1;
if(window.Config){
if(Config.pageApp == 'editor'){
var $folder = $(".curSelectedNode").parent().parent();
var fileNum = 0;
var zTree = ui.tree.zTree()
$folder.find('li[treenode]').each(function(){
var node = zTree.getNodeByTId($(this).attr('id'));
if(!node) return;
var thePath = node.path;
var ext = core.pathExt(node.path);
if(!kodApp.appSupportCheck('photoSwipe',ext)){
return;
}
if(thePath == imagePath){
index = fileNum;
}
fileNum ++;
items.push([
[imageUrl(thePath),imageUrl(thePath),thePath],
core.pathThis(thePath),[0,0],'',imageUrl(thePath,true)
]);
});
}else{
$('.file-continer .ico.picture').each(function(i){
var thumb = $(this).find('img').attr('data-original');
var thePath = hashDecode($(this).parents('.file').attr('data-path'));
if($(this).find('img').attr('data-src')){
thePath = $(this).find('img').attr('data-src');
}
if(thePath == imagePath){
index = i;
}
items.push([
[thumb,imageUrl(thePath),thePath],
core.pathThis(thePath),[0,0],'',imageUrl(thePath,true)
]);
});
}
}
if(items.length == 0 || index == -1){
items = [[[imageUrl(imagePath),imageUrl(imagePath),imagePath],
core.pathThis(urlDecode(imagePath)),[0,0],'']];
index = 0;
}
return {items:items,index:index};
}
//播放幻灯片时,删除图片.
var removeImageRequest = function(path,callback){
ui.pathOperate.remove([{type:"file",path:path}],function(result){
if(!result || !result.code){
return;
}
ui.fileLight.clear();
ui.f5Callback(function() {
callback();
});
})
};
var removeImage = function(){
var index = parseInt($('#PV_Control #PV_Items .current').attr('number'));
var path = myPicasa.arrItems[index][0][2];
removeImageRequest(path,function(){
if(myPicasa.arrItems.length <=1){
return myPicasa.close();
}
myPicasa.arrItems.splice(index,1);
if(index >= myPicasa.arrItems.length -1){
index = myPicasa.arrItems.length -1
}
myPicasa.play(myPicasa.arrItems,index);
});
}
var imageRotate = function(rotate){
var index = parseInt($('#PV_Control #PV_Items .current').attr('number'));
var path = myPicasa.arrItems[index][0][2];
ui.pathOperate.imageRotate(path,rotate,function(){
var imgSrc = function(img){
var str = '&picture='+UUID();
return img.indexOf('?') == -1 ? img+'?a=1'+str : img+str
}
var $img = $('[data-path='+pathHashEncode(path)+']').find('img');
var imageSmall = imgSrc(myPicasa.arrItems[index][0][0]);
var imgageBig = imgSrc(myPicasa.arrItems[index][0][1]);
$("#PV_Items .current img").attr('src',imageSmall);
$img.attr('src',imageSmall);
$img.attr('data-original',imageSmall);
myPicasa.resetImage(imgageBig,imageSmall);
});
}
var loadImageBefore = function(){
var index = parseInt($('#PV_Control #PV_Items .current').attr('number'));
var path = myPicasa.arrItems[index][0][2];
if(path.substr(0,4) == 'http'){
$("#PV_rotate_Left,#PV_rotate_Right,#PV_Btn_Remove").addClass('hidden');
}else{
$("#PV_rotate_Left,#PV_rotate_Right,#PV_Btn_Remove").removeClass('hidden');
}
}
return function(imagePath,appStatic){
require.async([
appStatic+'picasa/style/style.css',
appStatic+'picasa/picasa.js'
],function(){
if(!window.myPicasa){
myPicasa = new Picasa();
myPicasa.removeImage = removeImage;
myPicasa.imageRotate = imageRotate;
myPicasa.loadImageBefore = loadImageBefore;
}
var images = getImageArr(imagePath);
myPicasa.play(images.items,images.index);
});
}
});
@@ -0,0 +1,931 @@
var picasaGetDom=function(element) {
return typeof(element) == 'object' ? element : document.getElementById(element);
};
function Picasa(){}
Picasa.prototype = {
author : 'Mudoo',
version : '1.0 Alpha',
name : 'MyPicasa', // 实例名
// 功能状态
hotkey : true, // 快捷按键是否可用
wheel : true, // 鼠标滚轮是否可用
slide : true, // 幻灯片播放是否可用
auto : true, // 自动播放是否可用
zoomAnimation : true, // 图片缩放动画是否可用
// 参数
itemWidth : 36, // 列表项宽度(像素)
maskOpacity : 80, // 遮罩层透明度
fadeOutTime : 200, // 隐藏遮罩层动画时间
itemsOpacity : 60, // 列表项透明度
perHintOpacity : 40, // 百分比提示框透明度
fadeInModulus : 5, // 渐显系数
fadeOutModulus : 8, // 渐隐系数
moveModulus : 6, // 移动系数
zoomModulus : 10, // 缩放系数
zoomSpeed : .8, // 缩放步长
zoomMin : 5, // 缩放最小百分比
zoomMax : 300, // 缩放最大百分比
defaulePerMax : 90, // 初始图片最大占屏幕百分比
toQuickInterval : 200, // 切换到快速模式间歇(1秒=1000)
quickDoInterval : 50, // 快速模式动作间歇(1秒=1000)
autoInterval : 3000, // 自动播放间歇(1秒=1000)
actionSpeed : 2, // 动作速度(越小越快,1秒=1000)
// 计时器
doFade : null, // 透明
doZoom : null, // 图片缩放
doShowItem : null, // 列表显示
doMove : null, // 列表移动
doToQuick : null, // 切换到快速模式
doQuick : null, // 快速模式
doLoad : null, // 加载图片
doAuto : null, // 自动播放
doHidePerHint : null, // 隐藏百分比提示栏
doFadePerHint : null, // 显示百分比提示栏
// 变量
arrItems : [], // 列表数组
arrCount : -1, // 列表数量
currentNo : 0, // 当前图片No
itemDefaultX : 0, // 列表默认位置
initialCoord : [0, 0], // 图片初始坐标
moveDistance : [0, 0], // 图片拖拽移动距离
defaultSizePer : 100, // 默认图片大小百分比
fullSizePer : 100, // 满屏图片大小百分比
currentSizePer : 100, // 当前图片大小百分比
currentZoomSize : [0, 0], // 当前图片大小
currentZoomCoord: [0, 0], // 当前图片坐标
isLoaded : false, // 图片是否加载完
isZooming : false, // 是否正在缩放图片
isDraging : false, // 是否正在拖拽图片
isAutoPlaying : false, // 是否正在自动播放
activeImage : null, // 图片加载容器
lng : { // 中文
'zoomin' : 'zoom in',
'zoomout' : 'zoom out',
'zoomactual': 'true size',
'zoomauto' : 'zoom auto',
'prev' : 'prev',
'slide' : 'play',
'next' : 'next',
'autoplay' : 'auto play',
'loading' : 'loading...',
'loaderror' : 'image load error!'
},
play:function(items,index) {
var self = this;
if($('#PicasaMask').length == 0) {
this.createFrame();
this.setElementEvent();
if(this.wheel) this.setWheel();
$(window).bind("resize",function(){
if(self.arrCount > 0){
self.setFrameResize();
}
});
}
self.arrItems = items;
this.arrCount = this.arrItems.length;
this.createItems();
$('#PicasaView a,#PicasaView img').attr('draggable',false);
$('#PV_Control li').click(function(){
var number = $(this).attr('number');
self.changeImage(number);
});
self.display(index);
$('body').addClass('stop_hot_key');
},
removeImage:function(){
},
imageRotate:function(){
},
loadImageBefore:function(){
},
// 窗口大小
getWindowSize:function() {
var windowWidth, windowHeight;
if (self.innerHeight) { // all except Explorer
windowWidth = self.innerWidth;
windowHeight = self.innerHeight;
} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
windowWidth = document.documentElement.clientWidth;
windowHeight = document.documentElement.clientHeight;
} else if (document.body) { // other Explorers
windowWidth = window.screen.width;
windowHeight= window.screen.height;
}
var visibleWidth, visibleHeight;
visibleWidth = document.body.clientWidth;
visibleHeight = document.body.clientHeight;
return new Array(windowWidth, windowHeight, visibleWidth, visibleHeight);
},
// 获取鼠标位置
getXY:function (e){
var XY;
if(navigator.userAgent.match(/msie/i)){
var scrollPos;
if (typeof window.pageYOffset != 'undefined'){
scrollPos = [window.pageXOffset, window.pageYOffset];
}else if(typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat'){
scrollPos = [document.documentElement.scrollLeft, document.documentElement.scrollTop];
}else if(typeof document.body != 'undefined'){
scrollPos =[document.body.scrollLeft, document.body.scrollTop];
}
XY =[
window.event.clientX + scrollPos[0] - document.body.clientLeft,
window.event.clientY + scrollPos[1] - document.body.clientTop
];
}else{
XY = [e.pageX, e.pageY];
}
return XY;
},
// 透明度
opacity:{
set : function() {
var args = arguments;
var o = picasaGetDom(args[0]);
try{
o.filters.alpha.opacity = args[1];
}catch(e){
o.style.opacity = args[1]/100;
o.style.filter = 'alpha(opacity='+ (args[1]) +')';
}
},
get : function() {
var o = picasaGetDom(arguments[0]), p;
try{
p = parseInt(o.filters.alpha.opacity, 10);
if(isNaN(p)) p=100;
}catch(e){
p = o.style.opacity;
p *= 100;
}
return p;
}
},
// 显示隐藏下拉框
displaySelect:function(status) {
var selects = document.getElementsByTagName('select');
var count = selects.length;
for (var i=0;i<count;i++){
selects[i].style.visibility = status ? 'visible' : 'hidden';
}
},
// 事件操作
Event:{
add : function(o, e, h) {
o = picasaGetDom(o);
if(o.addEventListener){
o.addEventListener(e, h, false);
}else if(o.attachEvent){
o.attachEvent('on'+e, function(){
return h.call(o, window.event);
});
}else{
var oldHandler = o['on'+e] || function(){};
o['on'+e] = function(){
oldHandler();
h();
}
}
},
remove : function(o, e, h) {
o = picasaGetDom(o);
if(o.removeEventListener){
o.removeEventListener(e, h, false);
}else if(o.detachEvent){
o.detachEvent('on'+e, h);
}else{
o['on'+e] = null;
}
},
end : function(e) {
e = e || window.event;
e.stopPropagation && (e.preventDefault(), e.stopPropagation()) || (e.cancelBubble = true, e.returnValue = false);
}
},
// 生成框架
createFrame : function() {
// 背景遮罩
this.mask = document.createElement('div');
this.mask.id = 'PicasaMask';
document.body.appendChild(this.mask);
// 主体框架
this.frame = document.createElement('div');
this.frame.id = 'PicasaView';
this.frame.innerHTML =
'<div id="PV_Loading"></div>'+
'<div id="PV_Error" >error</div>'+
'<div id="PV_Number"></div>'+
'<a href="#" id="PV_Close" ><span>×</span></a>'+
'<img id="PV_Picture" src="" />'+
'<img id="PV_Picture_Temp" src="" />'+
'<div id="PV_PerHint"></div>'+
'<div id="PV_Hint"></div>'+
'<div id="PV_Control">'+
' <ul id="PV_Items"></ul>'+
' <div id="PV_Buttons">'+
' <a href="javascript: void(0);" id="PV_Btn_ZoomOut" class="tool-btn">-</a>'+
' <a href="javascript: void(0);" id="PV_Btn_ZoomIn" class="tool-btn">+</a>'+
' <a href="javascript: void(0);" id="PV_Btn_ZoomActual" class="tool-btn">1:1</a>'+
' <div id="PV_Select" class="PV_Btn_Normal">'+
' <a href="javascript: void(0);" id="PV_Btn_Prev"><i class="icon-arrow-left"></i></a>'+
' <a href="javascript: void(0);" id="PV_Btn_Slide"><i class="icon-play"></i></a>'+
' <a href="javascript: void(0);" id="PV_Btn_Next"><i class="icon-arrow-right"></i></a>'+
' </div>'+
' <a href="javascript:void(0);" id="PV_rotate_Left" class="tool-btn rotate"><i class=" icon-rotate-left"></i></a>'+
' <a href="javascript:void(0);" id="PV_rotate_Right" class="tool-btn rotate"><i class="icon-rotate-right"></i></a>'+
' <a href="javascript:void(0);" id="PV_Btn_Full" class="tool-btn"><i class="icon-fullscreen"></i></a>'+
' <a href="javascript:void(0);" id="PV_Btn_Remove" title="Remove(key delete)" class="tool-btn ml-20"><i class="icon-trash"></i></a>'+
' <a href="javascript:void(0);" id="PV_Btn_Open" class="tool-btn"><i class="icon-external-link"></i></a>'+
' </div>'+
'</div>';
document.body.appendChild(this.frame);
this.CloseBox = document.getElementById('PV_Close');
// 框架对象
this.Picture = picasaGetDom('PV_Picture'); // 大图
this.Loading = picasaGetDom('PV_Loading'); // 加载提示图
this.Error = picasaGetDom('PV_Error'); // 错误提示图
this.fPerHint = picasaGetDom('PV_PerHint'); // 缩放百分比提示框
this.fHint = picasaGetDom('PV_Hint'); // 底部提示框
this.fControl = picasaGetDom('PV_Control'); // 控制栏
this.fItems = picasaGetDom('PV_Items'); // 列表项
this.fButtons = picasaGetDom('PV_Buttons'); // 控制按钮
// 按钮对象
this.btnZoomIn = picasaGetDom('PV_Btn_ZoomIn'); // 放大(+)
this.btnZoomOut = picasaGetDom('PV_Btn_ZoomOut'); // 缩小(-)
this.btnZoomActual = picasaGetDom('PV_Btn_ZoomActual'); // 原始尺寸(1:1)
this.btnPrev = picasaGetDom('PV_Btn_Prev'); // 上一张图片
this.btnAutoPlay = picasaGetDom('PV_Btn_Slide'); // 幻灯片演示
this.btnNext = picasaGetDom('PV_Btn_Next'); // 下一张图片
this.mask.style.display = 'none';
this.frame.style.display = 'none';
var self = this;
this.activeImage = new Image();
this.activeImage.onload = function() {self.doLoad = setTimeout(function() {self.loadedAction();}, 0)}
this.activeImage.onerror = function() {self.doLoad = setTimeout(function() {self.loadError();}, 0)}
// 设置遮罩层透明度
this.opacity.set(this.mask, this.maskOpacity);
},
// 生成列表项
createItems : function() {
var itemStr = '';
// change by warlee 大于200则展示的时候再处理
for (var i=0; i<this.arrCount; i++){
if(i>=200){
itemStr += '<li number="'+i+'"><img data-original="'+ this.arrItems[i][0][0] +'" draggable="false"/></li>';
}else{
itemStr += '<li number="'+i+'"><img src="'+ this.arrItems[i][0][0] +'" draggable="false"/></li>';
}
}
this.fItems.innerHTML = itemStr;
this.fItems.style.width = (this.arrCount*36) +'px';
},
// 设置框架布局
setFrameLayout : function() {
this._setFrame();
this.opacity.set(this.fPerHint, 0);
$(this.mask).fadeIn(this.fadeOutTime);
},
setFrameResize:function(){
var self = this;
self._setFrame();
var winSize = this.getWindowSize();
var widthPer = Math.round(this.activeImage.width/winSize[2]*100);
var heightPer = Math.round(this.activeImage.height/winSize[1]*100);
var sizePer = 100;
if(widthPer>heightPer && widthPer>=this.defaulePerMax) {
sizePer = Math.round((winSize[2]*this.defaulePerMax)/this.activeImage.width);
}else if(widthPer<heightPer && heightPer>=this.defaulePerMax){
sizePer = Math.round((winSize[1]*this.defaulePerMax)/this.activeImage.height);
}
this.defaultSizePer = sizePer;
this.zoomAction(sizePer, true, false);
},
_setFrame:function() {
this.mask.style.display = '';
this.frame.style.display = '';
var winSize = this.getWindowSize();
this.mask.style.width = winSize[2] +'px';
this.mask.style.height = winSize[1] +'px';
this.frame.style.width = winSize[2] +'px';
this.frame.style.height = winSize[1] +'px';
this.fHint.style.width = winSize[2] +'px';
this.fHint.style.top = (winSize[1]-this.fControl.offsetHeight-this.fHint.offsetHeight) +'px';
this.fControl.style.width = winSize[2] +'px';
this.fControl.style.top = (winSize[1]-this.fControl.offsetHeight) +'px';
this.fButtons.style.left = ((winSize[2]-this.fButtons.offsetWidth)/2) +'px';
this.itemDefaultX = Math.round((winSize[2]-this.itemWidth)/2);
this.fItems.style.left = this.itemDefaultX +'px';
this.initialCoord = [
Math.round(winSize[2]/2),
Math.round((winSize[1]-this.fControl.offsetHeight)/2)
];
//重设loadinghit位置。
this.Loading.style.left = (this.initialCoord[0]-30) +'px';
this.Loading.style.top = (this.initialCoord[1]-30) +'px';
this.Error.style.left = (this.initialCoord[0]-Math.round(this.Error.offsetWidth/2)) +'px';
this.Error.style.top = (this.initialCoord[1]-Math.round(this.Error.offsetHeight/2)) +'px';
this.fPerHint.style.left = (this.initialCoord[0]-Math.round(this.fPerHint.offsetWidth/2)) +'px';
this.fPerHint.style.top = (this.initialCoord[1]-Math.round(this.fPerHint.offsetHeight/2)) +'px';
},
// 设置事件
setElementEvent : function() {
var self = this;
this.frame.oncontextmenu = function() {return false}
//this.CloseBox.onclick = function() {self.close()}//点击按钮关闭
this.frame.onclick = function() {self.close()}//点击蒙版关闭
this.Picture.onclick = this.Event.end;
this.Picture.ondblclick = function() {
var zoomPer = self.currentSizePer==self.defaultSizePer ? self.fullSizePer : self.defaultSizePer;
if(self.moveDistance.join(',')!='0,0') {
zoomPer = self.defaultSizePer;
self.moveDistance = [0, 0];
}
self.zoomAction(zoomPer, true);
}
this.dragPicture();
this.Loading.onclick = this.Event.end;
this.Error.onclick = this.Event.end;
this.fPerHint.onclick = this.Event.end;
this.fControl.onclick = this.Event.end;
this.fControl.ondblclick = function() {
// var zoomPer = self.currentSizePer==self.defaultSizePer ? self.fullSizePer : self.defaultSizePer;
// if(self.moveDistance.join(',')!='0,0') {
// zoomPer = self.defaultSizePer;
// self.moveDistance = [0, 0];
// }
// self.zoomAction(zoomPer, true);
}
this.fControl.onmouseover = function() {clearInterval(self.doFade); self.doFade = self.fadeAction(1, self.fItems, 100)}
this.fControl.onmouseout = function() {clearInterval(self.doFade); self.doFade = self.fadeAction(0, self.fItems, self.itemsOpacity)}
this.btnZoomIn.onmouseover = function() {self.hint(self.lng.zoomin);}
this.btnZoomIn.onmouseout = function() {self.hint();}
this.btnZoomIn.onclick = function() {self.zoomAction(1); return false;}
this.setQuickAction(this.btnZoomIn, 'self.zoomAction(1);');
this.btnZoomOut.onmouseover = function() {self.hint(self.lng.zoomout);}
this.btnZoomOut.onmouseout = function() {self.hint();}
this.btnZoomOut.onclick = function() {self.zoomAction(-1); return false;}
this.setQuickAction(this.btnZoomOut, 'self.zoomAction(-1);');
this.btnZoomActual.onmouseover = function() {self.hint(self.currentSizePer==100 ? self.lng.zoomauto : self.lng.zoomactual);}
this.btnZoomActual.onmouseout = function() {self.hint();}
this.btnZoomActual.onclick = function() {self.zoomAction(self.currentSizePer==100 ? self.defaultSizePer : 0); return false;}
this.btnPrev.onmouseover = function() {self.hint(self.lng.prev);picasaGetDom('PV_Select').className='PV_Btn_PrevOver';}
this.btnPrev.onmouseout = function() {self.hint();picasaGetDom('PV_Select').className='PV_Btn_Normal';}
this.btnPrev.onclick = function() {self.changeImage(self.currentNo-1); return false;}
this.setQuickAction(this.btnPrev, 'self.changeImage(self.currentNo-1);');
// this.btnSlide.onmouseover = function() {self.hint(self.lng.slide);picasaGetDom('PV_Select').className='PV_Btn_SildeOver';}
// this.btnSlide.onmouseout = function() {self.hint();picasaGetDom('PV_Select').className='PV_Btn_Normal';}
// this.btnSlide.onclick = function() {self.autoPlayAction(); return false;}
this.btnNext.onmouseover = function() {self.hint(self.lng.next);picasaGetDom('PV_Select').className='PV_Btn_NextOver';}
this.btnNext.onmouseout = function() {self.hint();picasaGetDom('PV_Select').className='PV_Btn_Normal';}
this.btnNext.onclick = function() {self.changeImage(self.currentNo+1); return false;}
this.setQuickAction(this.btnNext, 'self.changeImage(self.currentNo+1);');
//TODO 点击缩略图问题
$('#PV_Btn_Full').die("click").bind('click',function(e){
try{
core.fullScreen();
}catch(e){}
});
$('#PV_rotate_Left').die("click").bind('click',function(e){
try{
self.imageRotate(270);
}catch(e){}
})
$('#PV_rotate_Right').die("click").bind('click',function(e){
try{
self.imageRotate(90);
}catch(e){}
});
$('#PV_Btn_Remove').die("click").bind('click',function(e){
try{
self.removeImage();
}catch(e){}
});
$('#PV_Btn_Open').die("click").bind('click',function(e){
try{
//var imageLink = $('#PV_Picture').attr('src');
var imageLink = myPicasa.arrItems[myPicasa.currentNo][4];
window.open(imageLink);
}catch(e){}
});
this.btnAutoPlay.onmouseover = function() {self.hint(self.lng.autoplay);}
this.btnAutoPlay.onmouseout = function() {self.hint();}
this.btnAutoPlay.onclick = function() {self.autoPlayAction(); return false;}
},
// 开始显示
display : function(index) {
var self = this;
this.currentNo = index;
if(typeof(index) != 'number'){
this.currentNo = 0;
}
if(this.hotkey) this.setKeyboard(true);
this.displaySelect(false);
this.setFrameLayout();
this.loadImage();
this.moveAction();
this.doShowItem = setTimeout(function(){
self.fadeAction(1, self.fItems, self.itemsOpacity, 0);
}, 0);
},
// 切换图片
changeImage : function() {
if(this.isDraging) return;
var No = arguments[0];
if(No<0) No = 0;
if(No>=this.arrCount) No = this.arrCount-1;
if(No == this.currentNo) return;
clearInterval(this.doZoom);
clearTimeout(this.doAuto);
this.currentNo = No;
this.moveAction(true);
this.loadImage();
},
resetImage:function(image){
this.arrItems[this.currentNo][0][1] = image;
this.currentNo -= 1;
this.changeImage(this.currentNo+1);
},
// 加载图片
loadImage : function() {
$("#PV_Number").html((parseInt(this.currentNo)+1) + "/" +this.arrCount);
$('#PV_Items .current').removeClass('current');
$('#PV_Items [number='+this.currentNo+']').addClass('current');
this.loadImageBefore();
clearTimeout(this.doLoad);
var self = this;
this.isLoaded = false;
//this.Picture.style.display = 'none';
this.Loading.style.display = '';
this.Error.style.display = 'none';
if(this.Loading.offsetLeft==0) {
this.Loading.style.left = (this.initialCoord[0]-30) +'px';
this.Loading.style.top = (this.initialCoord[1]-30) +'px';
}
this.hintTxt = this.lng.loading;
this.hint();
this.activeImage.src = this.arrItems[this.currentNo][0][1];
this.Picture.src = this.activeImage.src;
//缩略图 change by warlee
var $image = $('#PV_Items .current img');
if(!$image.attr('src')){
$image.attr('src',$image.attr('data-original'));
}
$('#PV_Picture').css('display','none').fadeIn(200);
},
loadedAction : function() {
this.isLoaded = true;
var winSize = this.getWindowSize();
var widthPer = Math.round(this.activeImage.width/winSize[2]*100);
var heightPer = Math.round(this.activeImage.height/winSize[1]*100);
var sizePer = 100;
if(widthPer>heightPer && widthPer>=this.defaulePerMax) {
sizePer = Math.round((winSize[2]*this.defaulePerMax)/this.activeImage.width);
}else if(widthPer<heightPer && heightPer>=this.defaulePerMax){
sizePer = Math.round((winSize[1]*this.defaulePerMax)/this.activeImage.height);
}
this.defaultSizePer = sizePer;
this.fullSizePer = Math.round(winSize[2]/this.activeImage.width*100);
this.moveDistance = [0, 0];
this.arrItems[this.currentNo][2] = [this.activeImage.width, this.activeImage.height];
//this.Picture.src = this.activeImage.src;
this.zoomAction(sizePer, true, false);
var cItem = this.arrItems[this.currentNo];
var hintTxt = '';
if(cItem[3]!='') hintTxt = cItem[3]+' — ';
hintTxt += cItem[1] +' ('+ (cItem[2][0] +' x '+ cItem[2][1]) +')';
this.hintTxt = '<strong>'+ hintTxt +'</strong>';
this.hint();
this.Picture.style.display = '';
this.Loading.style.display = 'none';
this.Error.style.display = 'none';
if(this.isAutoPlaying) this.autoPlay();
},
loadError : function() {
if ($('#PicasaView').css("display")!="none") return;//动画方式退出。
this.Picture.style.display = 'none';
this.Loading.style.display = 'none';
this.Error.style.display = '';
this.Error.style.left = (this.initialCoord[0]-30) +'px';
this.Error.style.top = (this.initialCoord[1]-30) +'px';
this.hintTxt = this.lng.loaderror;
this.hint();
if(this.isAutoPlaying) this.autoPlay();
},
// 自动播放
autoPlayAction : function() {
if(!this.auto) return;
if(this.isAutoPlaying) {
clearTimeout(this.doAuto);
this.isAutoPlaying = false;
$(this.btnAutoPlay).removeClass('seled');
}else{
this.autoPlay();
this.isAutoPlaying = true;
$(this.btnAutoPlay).addClass('seled');
}
},
autoPlay : function() {
var self = this;
var No = this.currentNo>=this.arrCount-1 ? 0 : this.currentNo+1;
this.doAuto = setTimeout(function() {
self.changeImage(No);
}, this.autoInterval);
},
// 拖拽图片
dragPicture : function() {
var self = this;
var currentCoord = [];
var currentXY = [];
function dragMove(e) {
if(self.isZooming) return false;
if(!self.isDraging) {
self.fControl.style.display = 'none';
self.fHint.style.display = 'none';
self.isDraging = true;
}
var mouseXY = self.getXY(e);
self.Picture.style.left = (currentCoord[0]+mouseXY[0]-currentXY[0]) +'px';
self.Picture.style.top = (currentCoord[1]+mouseXY[1]-currentXY[1]) +'px';
return false;
}
function initDrag(e) {
currentCoord = [self.Picture.offsetLeft, self.Picture.offsetTop];
currentXY = self.getXY(e);
document.onmousemove = dragMove;
document.onmouseup = stopDrag;
return false;
}
function stopDrag() {
document.onmousemove = null;
document.onmouseup = null;
self.moveDistance = [Math.round((self.currentZoomCoord[0]-self.Picture.offsetLeft)/self.currentSizePer*100), Math.round((self.currentZoomCoord[1]-self.Picture.offsetTop)/self.currentSizePer*100)];
self.fControl.style.display = '';
self.fHint.style.display = '';
self.isDraging = false;
}
this.Picture.onmousedown = initDrag;
},
// 图片缩放
zoomAction : function() {
if(!this.isLoaded || this.isDraging) return;
clearInterval(this.doZoom);
switch(arguments[0]) {
case -1 :
this.currentSizePer *= this.zoomSpeed;
break;
case 0 :
this.currentSizePer = 100;
break;
case 1 :
this.currentSizePer /= this.zoomSpeed;
break;
case 2 :
this.currentSizePer = 0;
break;
default :
this.currentSizePer = arguments[0];
break;
}
if(!arguments[1]) {
if(this.currentSizePer<this.zoomMin) this.currentSizePer=this.zoomMin;
if(this.currentSizePer>this.zoomMax) this.currentSizePer=this.zoomMax;
this.currentSizePer = Math.round(this.currentSizePer);
}
var size = this.arrItems[this.currentNo][2];
this.currentZoomSize = [Math.round(size[0]*this.currentSizePer/100), Math.round(size[1]*this.currentSizePer/100)];
this.currentZoomCoord = [Math.round(this.initialCoord[0]-this.currentZoomSize[0]/2), Math.round(this.initialCoord[1]-this.currentZoomSize[1]/2)];
var moveDistance = [Math.round(this.moveDistance[0]*this.currentSizePer/100), Math.round(this.moveDistance[1]*this.currentSizePer/100)];
var zoomSize = this.currentZoomSize;
var zoomCoord = [this.currentZoomCoord[0]-moveDistance[0], this.currentZoomCoord[1]-moveDistance[1]]
var animation = arguments[2]==undefined ? this.zoomAnimation : arguments[2];
if(animation) {
var self = this;
var is_close = arguments[3];//arguments[3]退出时回调,退出缩放动画
this.doZoom = setInterval(function() {
self.zoomLoop(zoomSize, zoomCoord,is_close);
}, this.actionSpeed);
this.isZooming = true;
}else{
this.Picture.width = zoomSize[0];
this.Picture.height = zoomSize[1];
this.Picture.style.left = zoomCoord[0] +'px';
this.Picture.style.top = zoomCoord[1] +'px';
this.perHint(this.currentSizePer);
}
},
zoomLoop : function() {
var zoomSize = arguments[0];
var zoomCoord = arguments[1];
var sizeSpeed = [Math.round((zoomSize[0]-this.Picture.width)/this.zoomModulus*10)/10, Math.round((zoomSize[1]-this.Picture.height)/this.zoomModulus*10)/10]
var coordSpeed = [Math.round((zoomCoord[0]-this.Picture.offsetLeft)/this.zoomModulus*10)/10, Math.round((zoomCoord[1]-this.Picture.offsetTop)/this.zoomModulus*10)/10]
if((sizeSpeed.join(',')!='0,0') || coordSpeed.join(',')!='0,0') {
this.Picture.width += (sizeSpeed[0]>0 ? Math.ceil(sizeSpeed[0]) : Math.floor(sizeSpeed[0]));
this.Picture.height += (sizeSpeed[1]>0 ? Math.ceil(sizeSpeed[1]) : Math.floor(sizeSpeed[1]));
this.Picture.style.left = (this.Picture.offsetLeft+(coordSpeed[0]>0 ? Math.ceil(coordSpeed[0]) : Math.floor(coordSpeed[0]))) +'px';
this.Picture.style.top = (this.Picture.offsetTop+(coordSpeed[1]>0 ? Math.ceil(coordSpeed[1]) : Math.floor(coordSpeed[1]))) +'px';
this.perHint(Math.round(this.Picture.width/this.arrItems[this.currentNo][2][0]*100));
}else{
clearInterval(this.doZoom);
this.isZooming = false;
if (arguments[2]!=undefined) {
this.stopAll();
}
}
},
// 列表移动
moveAction : function() {
clearInterval(this.doMove);
var self = this;
var moveX = this.itemDefaultX-this.currentNo*this.itemWidth;
if(arguments[0]) {
this.doMove = setInterval(function(){
self.moveLoop(moveX);
}, this.actionSpeed);
}else{
this.fItems.style.left = moveX +'px';
}
},
moveLoop : function() {
var moveX = arguments[0];
var currX = this.fItems.offsetLeft;
var speed = Math.round((moveX-currX)/this.moveModulus*10)/10;
if(speed!=0) {
speed = speed>0 ? Math.ceil(speed) : Math.floor(speed);
this.fItems.style.left = (currX+speed) +'px';
}else{
this.fItems.style.left = moveX +'px';
clearInterval(this.doMove);
}
},
// 渐变
fadeAction : function() {
var args = arguments;
if(args[3]) this.opacity.set(args[1], args[3]);
var self = this;
var modulus = args[0]==1 ? this.fadeInModulus : this.fadeOutModulus;
var intervalID = setInterval(function(){
self.fadeLoop(args[1], args[2], modulus, intervalID)
}, this.actionSpeed);
return intervalID;
},
fadeLoop : function() {
var args = arguments;
var o = picasaGetDom(args[0]);
var currOpacity = this.opacity.get(o);
var modulus = parseInt(args[2], 10) || 5;
var speed = Math.round((args[1]-currOpacity)/modulus*10)/10;
if(speed!=0) {
speed = speed>0 ? Math.ceil(speed) : Math.floor(speed);
currOpacity += speed;
this.opacity.set(o, currOpacity);
}else{
clearInterval(args[3]);
}
},
// 信息提示
hint : function() {
var msg='';
if(arguments[0]) {
msg = arguments[0];
}else{
msg = this.hintTxt;
}
this.fHint.innerHTML = msg;
},
// 缩放百分比提示
perHint : function() {
this.fPerHint.innerHTML = arguments[0] +'%';
var self = this;
clearInterval(this.doFadePerHint);
this.doFadePerHint = this.fadeAction(1, self.fPerHint, this.perHintOpacity);
clearTimeout(this.doHidePerHint);
this.doHidePerHint = setTimeout(function(){
self.doFadePerHint = self.fadeAction(0, self.fPerHint, 0);
}, 1000);
},
// 快速模式
setQuickAction : function() {
var args = arguments;
var self = this;
args[0].onmousedown = function() {
self.doToQuick = setTimeout(function(){
self.doQuick = setInterval(function() {
eval(args[1]);
}, self.quickDoInterval);
}, self.toQuickInterval);
}
args[0].onmouseup = function() {
clearTimeout(self.doToQuick);
clearInterval(self.doQuick);
}
this.Event.add(args[0], 'mouseout', function() {
clearTimeout(self.doToQuick);
clearInterval(self.doQuick);
});
},
// 快捷键操作
setKeyboard : function(b) {
var self = this;
if(b) {
document.onkeydown = function(e) {self.keyboardAction(e);}
}else{
document.onkeydown = null;
}
},
keyboardAction : function(e) {
e = e || window.event;
var key = e.keyCode;
var isHotKey = false;
if(key==27) {//esc
this.close();
isHotKey = true;
}else if(key==37) {//left
this.changeImage(this.currentNo-1);
isHotKey = true;
}else if(key==39) {//right
this.changeImage(this.currentNo+1);
isHotKey = true;
}else if(key==38 || key==187 || key==107) {//up + number+
this.zoomAction(1);
isHotKey = true;
}else if(key==40 || key==189 || key==109) {//down - number-
this.zoomAction(-1);
isHotKey = true;
}else if(key==111 || key==191 || key==220) {//KP_Divide less greater bar
this.zoomAction(100);
isHotKey = true;
}else if(key==106) {
this.zoomAction(this.defaultSizePer);
isHotKey = true;
}else if(key==46) {
this.removeImage();
}
if(isHotKey) this.Event.end(e);
},
// 滚轮操作
setWheel : function(b) {
var self = this;
if (window.addEventListener) {
this.frame.addEventListener('DOMMouseScroll', function(e) {self.frameWheelAction(e);}, false);
this.fControl.addEventListener('DOMMouseScroll', function(e) {self.itemWheelAction(e);}, false);
}
this.frame.onmousewheel = function() {self.frameWheelAction();};
this.fControl.onmousewheel = function() {self.itemWheelAction();};
},
getWheel : function(e) {
e = e || window.event;
var delta = 0;
if (e.wheelDelta) {
delta = e.wheelDelta/120;
//if (window.opera) delta = -delta;
} else if (e.detail) {
delta = -e.detail/3;
}
delta = delta>0 ? 1 : -1;
return delta;
},
frameWheelAction : function(e) {
this.zoomAction(this.getWheel(e));
this.Event.end(e);
},
itemWheelAction : function(e) {
this.changeImage((this.currentNo-this.getWheel(e)));
this.Event.end(e);
},
// 停止所有动作
stopAll : function() {
var self = this;
clearTimeout(this.doShowItem);
clearTimeout(this.doAuto);
clearTimeout(this.doToQuick);
clearInterval(this.doQuick);
clearTimeout(this.doLoad);
clearInterval(this.doZoom);
clearInterval(this.doMove);
clearInterval(this.doFade);
clearTimeout(this.doHidePerHint);
clearInterval(this.doFadePerHint);
if(this.isAutoPlaying) this.autoPlayAction();
this.setKeyboard(false);
this.displaySelect(true);
this.activeImage.src = '';
this.arrCount = -1;
$(self.frame).fadeOut(self.fadeOutTime);
$(self.mask).fadeOut(self.fadeOutTime);
$('body').removeClass('stop_hot_key');
},
// 结束关闭
close : function() {
if (this.Error.style.display==''
|| this.hintTxt == 'loading...') {
this.stopAll();
}else{
this.zoomAction(2,true,true,true);
}
},
// 销毁
destruction : function() {
this.mask = null;// 框架对象
this.frame = null;
this.Picture = null;
this.Loading = null;
this.Error = null;
this.fPerHint = null;
this.fHint = null;
this.fControl = null;
this.fItems = null;
this.fButtons = null;
// 按钮对象
this.btnZoomIn = null;
this.btnZoomOut = null;
this.btnZoomActual = null;
this.btnPrev = null;
this.btnAutoPlay = null;
this.btnNext = null;
this.activeImage = null;
window[this.name] = null;
//try{window.CollectGarbage();}catch(e){};
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

@@ -0,0 +1,136 @@
/* Picasa View */
* body {height: 100%; overflow-y: auto}
* html{overflow-x: auto; overflow-y: hidden}
/* www.codefans.net */
#PicasaMask {position: fixed; _position: absolute; z-index: 100; top: 0; left: 0;
background: #000; overflow: hidden;}
#PV_Close{position: fixed; _position: absolute; z-index: 200; right:-70px; top:-75px;height:140px;
width:140px;text-decoration:none;background:#000;border-radius:70px;opacity:0.4;filter:alpha(opacity=40);}
#PV_Close span{display:block;margin-top:75px;margin-left:35px;color:#fff;
font-size:35px;font-family: Arial, sans-serif;}
#PV_Close:hover{opacity:0.6;filter:alpha(opacity=80);}
#PV_Close:hover span{color:#f30;}
#PV_Picture_Temp {display: none;}
#PicasaView {position: fixed; _position: absolute; z-index: 200; left: 0; top: 0; overflow: hidden}
#PV_Picture {position: absolute; z-index: 0; cursor: move;
-webkit-box-reflect: below 1px -webkit-gradient(linear,left top,left bottom,from(transparent),color-stop(80%,transparent),color-stop(70%,rgba(255,255,255,0)),to(rgba(255,255,255,0.3)));
}
#PV_Loading {position: absolute; z-index: 1;
background:#000 url(./loading.gif) center no-repeat;width:60px;height:60px;border-radius:4px;opacity:0.4;filter:alpha(opacity=40);}
#PV_Error {position: absolute; z-index: 2;
background:#000;width:60px;height:60px;border-radius:4px;opacity:0.4;filter:alpha(opacity=40);color:#d00;font-size:16px;line-height:50px;text-align:center;}
#PV_PerHint {position: absolute; z-index: 3;margin-top: 5%; width: 62px; height: 28px; text-align: center; font: bold 13px/28px Tahoma; color: #fff; background:#000;border-radius:4px;opacity:0.4;filter:alpha(opacity=40); cursor: default}
#PV_Hint {position: absolute; z-index: 3; height: 25px; color: #fff; font: 12px/25px Tahoma, "ËÎÌå"; text-align: center}
#PV_Control {position: absolute; z-index: 4; height: 54px; background:rgba(0,0,0,0.6); border-top: solid 1px #000; overflow: hidden;}
#PV_Items {position: absolute; z-index: 5; padding: 1px 0 0; margin: 0; list-style: none; height: 60px; overflow: hidden;}
#PV_Items li {float: left; width: 36px; padding: 0; margin: 0; list-style: none; cursor: pointer;position: relative;}
#PV_Items img {border: none; width: 35px; height: 35px;-webkit-box-reflect: below 1px -webkit-gradient(linear,left top,left bottom,from(transparent),color-stop(20%,transparent),color-stop(60%,rgba(255,255,255,0.1)),to(rgba(255,255,255,0.8)));}
#PV_Buttons {position: absolute; z-index: 6; margin: 20px auto 0 auto}
#PV_Buttons a {float: left; color: #808080; text-align: center; text-decoration: none}
#PV_Select {float: left; width: 78px; height: 30px; margin: 0 15px; background-image: url(Picasa_Button.gif); overflow: hidden}
.PV_Btn_Normal {background-position: -120px 0}
.PV_Btn_PrevOver {background-position: -120px -40px}
.PV_Btn_SildeOver {background-position: -120px -120px}
.PV_Btn_NextOver {background-position: -120px -80px}
#PV_Select a {margin: 0; height: 30px}
#PV_Btn_Prev {width: 24px}
#PV_Btn_Slide {width: 30px}
#PV_Btn_Next {width: 24px}
#PV_AutoPlay {float: left; width: 100px; margin-top: 8px}
#PV_AutoPlay a {width: 70px; height: 19px; line-height: 19px; font-size: 12px; background-image: url(Picasa_Button.gif); background-position: -40px 0}
#PV_AutoPlay a:hover {color: #ccc; background-position: -40px -20px}
#PV_AutoPlay a.seled {color: #fff; background-position: -40px -40px;font-weight:800;}
#PV_Buttons{opacity:0.9;}
#PV_Zoom{margin:0;margin-right: 10px;}
#PV_Buttons .tool-btn{
background-image: none;
margin-right: 2px;
border-radius: 4px;
width: 24px;
line-height: 20px;
background:#333;
height: 20px;
border:2px solid #555;
border-color:rgba(255,255,255,0.1);
}
#PV_Buttons .tool-btn:hover{border: 2px solid #888;background:#222;}
#PV_Select{
margin: 0 15px;
height: 40px;
margin-left: 7px;
margin-top: 0px;
width: 90px;
overflow: visible;
background-image: none;
}
#PV_Buttons a{
display: inline-block;
width: 40px;
height: 25px;
z-index: 0;
color: #fff;
position: relative;
line-height: 25px;
font-size: 13px;
margin-right: -10px;
margin-top: 4px;
border-radius: 4px;
background: #777;
}
#PV_Items li.current:after {
box-shadow: 0 0 30px #fff inset;
content: "+";
position: absolute;
z-index: 99;
/* left: 50%; */
left: 0;
width: 100%;
opacity: 0.5;
height: 100%;
font-size: 20px;
color: #fff;
text-align: center;
}
#PV_Number{
color: #bbb;
display: block;
font-size: 12px;
background: rgba(100,100,100,0.3);
padding: 4px 11px;
border-radius: 20px;
position: fixed;
right: 10px;
bottom: 65px;
z-index: 100;
}
#PV_Buttons a i{padding-left:2px;}
#PV_Buttons a#PV_Btn_Prev{display: inline-block;margin-left: -4px;}
#PV_Buttons a#PV_Btn_Slide{
background: #888;
border-radius: 50%;
z-index: 10;
width: 31px;line-height: 31px;
margin-top: 0px;
height: 31px;
box-shadow: 0 0 5px #333;
}
#PV_Buttons a#PV_Btn_Prev,
#PV_Buttons a#PV_Btn_Slide,
#PV_Buttons a#PV_Btn_Next{
background-image: -webkit-linear-gradient(top,#bbb,#666);
background-image: -moz-linear-gradient(top,#bbb,#666);
background-image: -o-linear-gradient(top,#bbb,#666);
background-image: -ms-linear-gradient(top,#bbb,#666);
background-image: linear-gradient(top,#bbb,#666);
-pie-background: linear-gradient(to top,#bbb,#666);
}
#PV_Buttons a.seled#PV_Btn_Slide i:before{content: "\f04d";}
#PV_Buttons a:hover{background: #999;color:#fff;}
+21
View File
@@ -0,0 +1,21 @@
<?php
/**
* 隐藏插件,默认开启
*/
class simpleClockPlugin extends PluginBase{
function __construct(){
parent::__construct();
}
public function regiest(){
$this->hookRegiest(array(
'user.commonJs.insert' => 'simpleClockPlugin.echoJs'
));
}
public function echoJs($st,$act){
$this->echoFile('static/main.js');
}
public function index(){
include($this->pluginPath.'static/page.html');
}
}
@@ -0,0 +1,23 @@
{
"id":"simpleClock",
"name":"clock",
"title":"时钟 clock",
"version":"1.1",
"source":{
"className":"font-icon icon-time bg-blue-6"
},
"description":"桌面时钟挂件(desktop widget)",
"auther":{
"copyright":"kodcloud.",
"homePage":"http://www.kodcloud.com",
},
"configItem":{
"pluginAuth":{
"type":"userSelect",
"value":"all:1",
"display":"{{LNG.Plugin.config.auth}}",
"desc":"{{LNG.Plugin.config.authDesc}}",
"require":1
}
}
}
@@ -0,0 +1,17 @@
kodReady.push(function(){
if(!$.supportCss3() || isWap()){//ie8 ie9
return;
}
if(lodash.get(window,'Config.pageApp') != 'desktop'){
return;
}
//加载时钟挂件
$.artDialog.open("{{pluginApi}}",{
title:"clock",
top: 40,
left:$(window).width() - 210,
width:'200px',
height:'200px',
simple:true
});
});
@@ -0,0 +1,137 @@
body {
background: transparent;
overflow:hidden;
}
.clock {
position: absolute;
opacity: 1;
}
.fill .clock {
left: 50%;
top: 50%;
}
.centre {
position: absolute;
top: 50%;
left: 50%;
width: 0;
height: 0;
}
.expand {
position: absolute;
top: 0;
left: 0;
transform: translate(-50%, -50%);
}
.anchor {
position: absolute;
top: 0;
left: 0;
width: 0;
height: 0;
}
.element {
position: absolute;
top: 0;
left: 0;
}
.round {
border-radius: 296px;
}
.circle-1 {
background: white;
width: 12px;
height: 12px;
}
.circle-2 {
background: #FA9F22;
width: 8px;
height: 8px;
}
.circle-3 {
background: black;
width: 4px;
height: 4px;
}
.second {
transform: rotate(180deg);
}
.minute {
transform: rotate(54deg);
}
.second-hand {
width: 2px;
height: 164px;
background: #FA9F22;
transform: translate(-50%,-100%) translateY(24px);
}
.hour {
transform: rotate(304.5deg);
}
.thin-hand {
width: 4px;
height: 50px;
background: white;
transform: translate(-50%,-100%);
}
.fat-hand {
width: 10px;
height: 57px;
border-radius: 10px;
background: white;
transform: translate(-50%,-100%) translateY(-18px);
}
.minute-hand {
height: 112px;
}
.hour-text {
position: absolute;
font: 40px Hei, Helvetica, Arial, sans-serif;
color: white;
transform: translate(-50%,-50%);
}
.hour-10 {
padding-left: 0.4ex;
}
.hour-11 {
padding-left: 0.25ex;
}
.minute-text {
position: absolute;
font: 12px Avenir Next, Helvetica, Arial, sans-serif;
color: white;
transform: translate(-50%,-50%);
}
.minute-line {
background: white;
width: 1px;
height: 9px;
transform: translate(-50%,-100%) translateY(-131px);
opacity: 0.34;
}
.file{opacity:0.9;}
.element.fat-hand{height:50px;}
.element.fat-hand.minute-hand{height:70px;}
File diff suppressed because one or more lines are too long
@@ -0,0 +1,68 @@
var clock = document.querySelector('#utility-clock')
utilityClock(clock)
if (clock.parentNode.classList.contains('fill')) autoResize(clock, 295 + 32)
function utilityClock(container) {
var dynamic = container.querySelector('.dynamic')
var hourElement = container.querySelector('.hour')
var minuteElement = container.querySelector('.minute')
var secondElement = container.querySelector('.second')
var minute = function(n) {
return n % 5 == 0 ? minuteText(n) : minuteLine(n)
}
var minuteText = function(n) {
var element = document.createElement('div')
element.className = 'minute-text'
element.innerHTML = (n < 10 ? '0' : '') + n
position(element, n / 60, 135)
dynamic.appendChild(element)
}
var minuteLine = function(n) {
var anchor = document.createElement('div')
anchor.className = 'anchor'
var element = document.createElement('div')
element.className = 'element minute-line'
rotate(anchor, n)
anchor.appendChild(element)
dynamic.appendChild(anchor)
}
var hour = function(n) {
var element = document.createElement('div')
element.className = 'hour-text hour-' + n
element.innerHTML = n
position(element, n / 12, 105)
dynamic.appendChild(element)
}
var position = function(element, phase, r) {
var theta = phase * 2 * Math.PI
element.style.top = (-r * Math.cos(theta)).toFixed(1) + 'px'
element.style.left = (r * Math.sin(theta)).toFixed(1) + 'px'
}
var rotate = function(element, second) {
element.style.transform = element.style.webkitTransform = 'rotate(' + (second * 6) + 'deg)'
}
var animate = function() {
var now = new Date()
var time = now.getHours() * 3600 +
now.getMinutes() * 60 +
now.getSeconds() * 1 +
now.getMilliseconds() / 1000
rotate(secondElement, time)
rotate(minuteElement, time / 60)
rotate(hourElement, time / 60 / 12)
requestAnimationFrame(animate)
}
for (var i = 1; i <= 60; i ++) minute(i)
for (var i = 1; i <= 12; i ++) hour(i)
animate()
}
function autoResize(element, nativeSize) {
var update = function() {
var scale = Math.min(window.innerWidth, window.innerHeight) / nativeSize
element.style.transform = element.style.webkitTransform = 'scale(' + scale.toFixed(3) + ')'
}
update()
window.addEventListener('resize', update)
}
+71
View File
@@ -0,0 +1,71 @@
<?php
/**
* 隐藏插件,默认开启
*/
class toolsCommonPlugin extends PluginBase{
function __construct(){
parent::__construct();
}
public function regiest(){
$this->hookRegiest(array(
'user.commonJs.insert' => 'toolsCommonPlugin.echoJs'
));
}
public function echoJs($st,$act){
$this->systemBackup();
$this->echoFile('static/main.js');
}
public function systemBackup(){
$system = DATA_PATH.'system/';
$bakcupLast = $system.'backup/last/';
$backupLastDay = $system.'backup/day/'.date('Ymd',time()).'/';
//每N天备份一次;首次备份当天
$backupRepeat = 5;
$day = intval(date('d',time()));
if( !@file_exists($bakcupLast) ||
(!@file_exists($backupLastDay) && $day % $backupRepeat == 0)
){
mk_dir($backupLastDay);
$this->backupTo($backupLastDay);
}
//每天覆盖备份一次
if(!@file_exists($bakcupLast)){
mk_dir($bakcupLast);
$this->backupTo($bakcupLast);
}
$lastTime = @filemtime($bakcupLast.'/system_member.php');
if(time() - $lastTime > 60*60*24){
$this->backupTo($bakcupLast);
}
}
private function backupTo($folder){
$system = DATA_PATH.'system/';
$backFile = array(
'apps.php',
'system_group.php',
'system_member.php',
'system_role.php',
'system_role_group.php',
'system_setting.php',
'desktop_app.php'
);
foreach ($backFile as $file) {
if(file_exists($folder.$file)){
@unlink($folder.$file);
}
@copy($system.$file,$folder.$file);
}
}
/**
* ie8 css hack;
* @return [type] [description]
*/
public function pie(){
header('Content-type: text/x-component');
include($this->pluginPath.'/static/pie/pie.htc');
}
}
@@ -0,0 +1,17 @@
{
"id":"toolsCommon",
"name":"toolsCommon",
"title":"toos setting",
"version":"1.1",
"hidden":1,
"source":{
"className":"x-item-file x-ini"
},
"description":"some configs",
"auther":{
"copyright":"kodcloud.",
"homePage":"http://www.kodcloud.com",
},
"configItem":{
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

@@ -0,0 +1,31 @@
kodReady.push(function(){
require.async([
'{{pluginHost}}static/pie/pie.css',//ie8 css hack
// 'https://cdn.bootcss.com/malihu-custom-scrollbar-plugin/3.1.5/jquery.mCustomScrollbar.concat.min.js',
// 'https://cdn.bootcss.com/malihu-custom-scrollbar-plugin/3.1.5/jquery.mCustomScrollbar.css'
],function(a,b){
// $.mCustomScrollbar.defaults.scrollButtons.enable=true;
// var scrollArr = [
// //'.app-content .app-model',
// // '#page-explorer .bodymain',
// '#folder-list-tree',
// '#page-editor .frame-main .frame-left'
// ];
// $(scrollArr.join(',')).mCustomScrollbar({theme:"minimal-dark"});
});
//关闭随机壁纸
//$.addStyle('#random-wallpaper,.randomImage{display:none;}');
//编辑器扩展
kodApp.appSupportSet('aceEditor','vue,we,wpy');
Hook.bind('edit.main.init',function(){
Editor.fileModeSet('vue,we,wpy','html');
});
$.addStyle(
".x-item-file.x-vue,.x-item-file.x-we,.x-item-file.x-wpy{\
background-image:url('{{pluginHost}}static/file_icon/vue.png');\
}");
});
File diff suppressed because one or more lines are too long
@@ -0,0 +1,34 @@
@media \0screen\,screen\9 {
#page-desktop .topbar,
#page-desktop .topbar .topbar-menu,
#page-desktop .topbar .topbar-menu.this,
#page-desktop .topbar .topbar-menu:hover,
#page-desktop .file-continer .file.hover,
#page-desktop .file-continer .file.select,
#page-desktop .file-continer .file.file-select-drag-temp,
.topbar .content .share-title-info,
.bindary-box .title .ico,
.desktop,div.background,
.task-tab .tabs .tab,
.task-tab .tabs .tab.hover,.task-tab .tabs .tab.this{
behavior: url("./?pluginApp/to/toolsCommon/pie");
}
}
.mCSB_scrollTools .mCSB_draggerContainer{z-index:99;}
.mCS-minimal-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
background-color: rgba(100,100,100,0.3);width:6px;
}
/*ie8兼容性调整*/
body div.topbar .content .title.topbar-menu{width:200px\9;}
body .file-continer .file .item-select{width:12px;height:12px;}
body .file-continer .file .item-select .item-check{font-size:10px;}
body .dialog-no-title .aui-outer{border:1px solid #ddd !important;}
body .dialog-no-title .aui-max,
body .dialog-no-title .aui-min,
body .dialog-no-title .aui-close{filter:none !important;}
body .dialog-no-title .aui-title i{display:none;}
body #messageTips{border:1px solid #ddd\9;}
@@ -0,0 +1,74 @@
<!--
PIE: CSS3 rendering for IE
Version 1.0beta1
http://css3pie.com
Licensed for use under the Apache License, Version 2.0
-->
<PUBLIC:COMPONENT lightWeight="true">
<PUBLIC:ATTACH EVENT="onresize" FOR="element" ONEVENT="update()" />
<PUBLIC:ATTACH EVENT="onresize" FOR="window" ONEVENT="update()" /><!-- for IE8 -->
<PUBLIC:ATTACH EVENT="onmove" FOR="element" ONEVENT="update()" />
<PUBLIC:ATTACH EVENT="onpropertychange" FOR="element" ONEVENT="propChanged()" />
<PUBLIC:ATTACH EVENT="onmouseenter" FOR="element" ONEVENT="mouseEntered()" />
<PUBLIC:ATTACH EVENT="onmouseleave" FOR="element" ONEVENT="mouseLeft()" />
<PUBLIC:ATTACH EVENT="oncontentready" FOR="element" ONEVENT="init()" />
<PUBLIC:ATTACH EVENT="ondetach" FOR="element" ONEVENT="cleanup()" />
<script type="text/javascript">
function j(){return function(){}}var C=window.PIE;
if(!C){C=window.PIE={T:"-pie-",Ha:"Pie",Fa:"pie_"};if(!window.XMLHttpRequest){C.Qb=true;C.T=C.T.replace(/^-/,"")}C.q={ja:function(a){var b=C.zb;if(!b){b=C.zb=element.document.createDocumentFragment();b.namespaces.add("css3vml","urn:schemas-microsoft-com:vml")}return b.createElement("css3vml:"+a)},Aa:function(a){var b,c,d,e,f=arguments;b=1;for(c=f.length;b<c;b++){e=f[b];for(d in e)if(e.hasOwnProperty(d))a[d]=e[d]}return a},bb:function(a,b,c){var d=C.tb||(C.tb={}),e=d[a],f;if(e)b.call(c,e);else{f=new Image;
f.onload=function(){e=d[a]={v:f.width,i:f.height};b.call(c,e);f.onload=null};f.src=a}}};C.g=function(){function a(b){this.F=b}a.prototype={Ba:/(px|em|ex|mm|cm|in|pt|pc|%)$/,Qa:function(){var b=this.ub;if(b===undefined)b=this.ub=parseFloat(this.F);return b},xa:function(){var b=this.sa;if(!b)b=this.sa=(b=this.F.match(this.Ba))&&b[0]||"px";return b},a:function(b,c){var d=this.Qa(),e=this.xa();switch(e){case "px":return d;case "%":return d*(typeof c==="function"?c():c)/100;case "em":return d*this.Pa(b);
case "ex":return d*this.Pa(b)/2;default:return d*a.Hb[e]}},Pa:function(b){var c=b.currentStyle.fontSize,d;if(c.indexOf("px")>0)return parseFloat(c);else{c=this.yb;if(!c){c=this.yb=b.document.createElement("length-calc");d=c.style;d.width="1em";d.position="absolute";d.top=d.left=-9999}b.appendChild(c);d=c.offsetWidth;b.removeChild(c);return d}}};a.Hb=function(){for(var b=["mm","cm","in","pt","pc"],c={},d=element.parentNode,e=0,f=b.length,i,h,g;e<f;e++){i=b[e];h=element.document.createElement("length-calc");
g=h.style;g.position="absolute";g.top=g.left=-9999;g.width="100"+i;d.appendChild(h);c[i]=h.offsetWidth/100;d.removeChild(h)}return c}();a.Ja=new a("0");return a}();C.qa=function(){function a(b){this.C=b}a.prototype={Nb:function(){if(!this.La){var b=this.C,c=b.length,d=C.g.Ja,e=new C.g("50%"),f=C.k.Y.V,i={top:1,center:1,bottom:1},h={left:1,center:1,right:1};d=["left",d,"top",d];if(c===1){b.push({type:f,value:"center"});c++}if(c===2){f&(b[0].type|b[1].type)&&b[0].value in i&&b[1].value in h&&b.push(b.shift());
if(b[0].type&f)if(b[0].value==="center")d[1]=e;else d[0]=b[0].value;else if(b[0].J())d[1]=new C.g(b[0].value);if(b[1].type&f)if(b[1].value==="center")d[3]=e;else d[2]=b[1].value;else if(b[1].J())d[3]=new C.g(b[1].value)}this.La=d}return this.La},coords:function(b,c,d){var e=this.Nb(),f=e[1].a(b,c);b=e[3].a(b,d);return{x:Math.round(e[0]==="right"?c-f:f),y:Math.round(e[2]==="bottom"?d-b:b)}}};return a}();C.cb=function(){function a(b){this.F=b}a.prototype={Ba:/[a-z]+$/i,xa:function(){return this.sa||
(this.sa=this.F.match(this.Ba)[0].toLowerCase())},Ib:function(){var b=this.sb,c;if(b===undefined){b=this.xa();c=parseFloat(this.F,10);b=this.sb=b==="deg"?c:b==="rad"?c/Math.PI*180:b==="grad"?c/400*360:b==="turn"?c*360:0}return b}};return a}();C.U=function(){function a(b){this.F=b}a.Xb=/\s*rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d+|\d*\.\d+)\s*\)\s*/;a.prototype={parse:function(){if(!this.ga){var b=this.F,c=b.match(a.Xb);if(c){this.ga="rgb("+c[1]+","+c[2]+","+c[3]+")";this.Ka=parseFloat(c[4])}else{this.ga=
b;this.Ka=1}}},value:function(b){this.parse();return this.ga==="currentColor"?b.currentStyle.color:this.ga},Ma:function(){this.parse();return this.Ka}};return a}();C.k=function(){function a(c){this.ka=c;this.ch=0;this.C=[];this.da=0}var b=a.Y={ea:1,Ea:2,S:4,nb:8,Ga:16,V:32,o:64,W:128,X:256,fa:512,pb:1024,URL:2048};a.Ia=function(c,d){this.type=c;this.value=d};a.Ia.prototype={za:function(){return this.type&b.o||this.type&b.W&&this.value==="0"},J:function(){return this.za()||this.type&b.fa}};a.prototype=
{fc:/\s/,Sb:/^[\+\-]?(\d*\.)?\d+/,url:/^url\(\s*("([^"]*)"|'([^']*)'|([!#$%&*-~]*))\s*\)/i,Ta:/^\-?[_a-z][\w-]*/i,ac:/^("([^"]*)"|'([^']*)')/,Ob:/^#([\da-f]{6}|[\da-f]{3})/i,dc:{px:b.o,em:b.o,ex:b.o,mm:b.o,cm:b.o,"in":b.o,pt:b.o,pc:b.o,deg:b.ea,rad:b.ea,grad:b.ea},Eb:{aqua:1,black:1,blue:1,fuchsia:1,gray:1,green:1,lime:1,maroon:1,navy:1,olive:1,purple:1,red:1,silver:1,teal:1,white:1,yellow:1,currentColor:1},Db:{rgb:1,rgba:1,hsl:1,hsla:1},next:function(c){function d(p,o){p=new a.Ia(p,o);if(!c){k.C.push(p);
k.da++}return p}function e(){k.da++;return null}var f,i,h,g,k=this;if(this.da<this.C.length)return this.C[this.da++];for(;this.fc.test(this.ka.charAt(this.ch));)this.ch++;if(this.ch>=this.ka.length)return e();i=this.ch;f=this.ka.substring(this.ch);h=f.charAt(0);switch(h){case "#":if(g=f.match(this.Ob)){this.ch+=g[0].length;return d(b.S,g[0])}break;case '"':case "'":if(g=f.match(this.ac)){this.ch+=g[0].length;return d(b.pb,g[2]||g[3]||"")}break;case "/":case ",":this.ch++;return d(b.X,h);case "u":if(g=
f.match(this.url)){this.ch+=g[0].length;return d(b.URL,g[2]||g[3]||g[4]||"")}}if(g=f.match(this.Sb)){h=g[0];this.ch+=h.length;if(f.charAt(h.length)==="%"){this.ch++;return d(b.fa,h+"%")}if(g=f.substring(h.length).match(this.Ta)){h+=g[0];this.ch+=g[0].length;return d(this.dc[g[0].toLowerCase()]||b.nb,h)}return d(b.W,h)}if(g=f.match(this.Ta)){h=g[0];this.ch+=h.length;if(h.toLowerCase()in this.Eb)return d(b.S,h);if(f.charAt(h.length)==="("){this.ch++;if(h.toLowerCase()in this.Db){f=function(p){return p&&
p.type&b.W};g=function(p){return p&&p.type&(b.W|b.fa)};var n=function(p,o){return p&&p.value===o},m=function(){return k.next(1)};if((h.charAt(0)==="r"?g(m()):f(m()))&&n(m(),",")&&g(m())&&n(m(),",")&&g(m())&&(h==="rgb"||h==="hsa"||n(m(),",")&&f(m()))&&n(m(),")"))return d(b.S,this.ka.substring(i,this.ch));return e()}return d(b.Ga,h+"(")}return d(b.V,h)}this.ch++;return d(b.Ea,h)},n:function(){return this.C[this.da-- -2]},all:function(){for(;this.next(););return this.C},R:function(c,d){for(var e=[],
f,i;f=this.next();){if(c(f)){i=true;this.n();break}e.push(f)}return d&&!i?null:e}};return a}();C.w={M:function(a){function b(c){this.element=c}C.q.Aa(b.prototype,C.w,a);return b},f:function(){if(this.j())this.xb=this.N(this.rb=this.aa());return this.xb},aa:function(){var a=this.element,b=a.style;a=a.currentStyle;var c=this.$,d=this.ca,e=this.vb||(this.vb=C.T+c),f=this.wb||(this.wb=C.Ha+d.charAt(0).toUpperCase()+d.substring(1));return b[f]||a.getAttribute(e)||b[d]||a.getAttribute(c)},d:function(){return!!this.f()},
j:function(){return this.rb!==this.aa()}};C.eb=C.w.M({$:C.T+"background",ca:C.Ha+"Background",Bb:{scroll:1,fixed:1,local:1},pa:{"repeat-x":1,"repeat-y":1,repeat:1,"no-repeat":1},Tb:{"padding-box":1,"border-box":1,"content-box":1},Cb:{"padding-box":1,"border-box":1},Wb:{top:1,right:1,bottom:1,left:1,center:1},Zb:{contain:1,cover:1},N:function(a){function b(q){return q.J()||q.type&g&&q.value in p}function c(q){return q.J()&&new C.g(q.value)||q.value==="auto"&&"auto"}var d=this.element.currentStyle,
e,f,i=C.k.Y,h=i.X,g=i.V,k=i.S,n,m,p=this.Wb,o,r,t=null;if(this.wa()){a=new C.k(a);t={images:[]};for(f={};e=a.next();){n=e.type;m=e.value;if(!f.type&&n&i.Ga&&m==="linear-gradient("){o={P:[],type:"linear-gradient"};for(r={};e=a.next();){n=e.type;m=e.value;if(n&i.Ea&&m===")"){r.color&&o.P.push(r);o.P.length>1&&C.q.Aa(f,o);break}if(n&k){if(o.ua||o.ya){e=a.n();if(e.type!==h)break;a.next()}r={color:new C.U(m)};e=a.next();if(e.J())r.Ua=new C.g(e.value);else a.n()}else if(n&i.ea&&!o.ua&&!r.color&&!o.P.length)o.ua=
new C.cb(e.value);else if(b(e)&&!o.ya&&!r.color&&!o.P.length){a.n();o.ya=new C.qa(a.R(function(q){return!b(q)},false))}else if(n&h&&m===","){if(r.color){o.P.push(r);r={}}}else break}}else if(!f.type&&n&i.URL){f.url=m;f.type="image"}else if(b(e)&&!f.size){a.n();f.position=new C.qa(a.R(function(q){return!b(q)},false))}else if(n&g)if(m in this.pa)f.repeat=m;else if(m in this.Tb){f.origin=m;if(m in this.Cb)f.clip=m}else{if(m in this.Bb)f.jc=m}else if(n&k&&!t.color)t.color=new C.U(m);else if(n&h)if(m===
"/"){e=a.next();n=e.type;m=e.value;if(n&g&&m in this.Zb)f.size=m;else if(m=c(e))f.size={v:m,i:c(a.next())||a.n()&&m}}else{if(m===","&&f.type){t.images.push(f);f={}}}else return null}f.type&&t.images.push(f)}else this.ab(function(){var q=d.backgroundPositionX,v=d.backgroundPositionY,l=d.backgroundImage,u=d.backgroundColor;t={};if(u!=="transparent")t.color=new C.U(u);if(l!=="none")t.images=[{type:"image",url:(new C.k(l)).next().value,repeat:d.backgroundRepeat,position:new C.qa((new C.k(q+" "+v)).all())}]});
return t},ab:function(a){var b=this.element.runtimeStyle,c=b.backgroundImage,d=b.backgroundColor;b.backgroundImage=b.backgroundColor="";a=a.call(this);b.backgroundImage=c;b.backgroundColor=d;return a},aa:function(){var a=this.element.currentStyle;return this.wa()||this.ab(function(){return a.backgroundColor+" "+a.backgroundImage+" "+a.backgroundRepeat+" "+a.backgroundPositionX+" "+a.backgroundPositionY})},wa:function(){var a=this.element;return a.style[this.ca]||a.currentStyle.getAttribute(this.$)},
d:function(){return this.wa()&&!!this.f()}});C.jb=C.w.M({Yb:["Top","Right","Bottom","Left"],Rb:{mc:"1px",kc:"3px",lc:"5px"},N:function(){var a={},b={},c={},d=this.element,e=d.currentStyle;d=d.runtimeStyle;var f=d.borderColor,i=0,h=false,g=true,k=true,n=true,m,p,o,r,t,q,v;for(d.borderColor="";i<4;i++){o=this.Yb[i];v=o.charAt(0).toLowerCase();m=b[v]=e["border"+o+"Style"];p=e["border"+o+"Color"];o=e["border"+o+"Width"];if(i>0){if(m!==r)k=false;if(p!==t)g=false;if(o!==q)n=false}r=m;t=p;q=o;c[v]=new C.U(p);
o=a[v]=new C.g(b[v]==="none"?"0":this.Rb[o]||o);if(o.a(this.element)>0)h=true}d.borderColor=f;return h?{$a:a,bc:b,Fb:c,gc:n,Gb:g,cc:k}:null},aa:function(){var a=this.element,b=a.currentStyle;a=a.runtimeStyle;var c=a.borderColor;a.borderColor="";b=b.borderWidth+"|"+b.borderStyle+"|"+b.borderColor;a.borderColor=c;return b}});C.hb=C.w.M({$:"border-radius",ca:"borderRadius",N:function(a){var b=null,c,d,e,f,i=false;if(a){d=new C.k(a);var h=function(){for(var g=[],k;(e=d.next())&&e.J();){f=new C.g(e.value);
k=f.Qa();if(k<0)return null;if(k>0)i=true;g.push(f)}return g.length>0&&g.length<5?{tl:g[0],tr:g[1]||g[0],br:g[2]||g[0],bl:g[3]||g[1]||g[0]}:null};if(a=h()){if(e){if(e.type&C.k.Y.X&&e.value==="/")c=h()}else c=a;if(i&&a&&c)b={x:a,y:c}}}return b}});C.gb=C.w.M({$:"border-image",ca:"borderImage",pa:{stretch:1,round:1,repeat:1,space:1},N:function(a){var b=null,c,d,e,f,i,h,g=0,k,n=C.k.Y,m=n.V,p=n.W,o=n.o,r=n.fa;if(a){c=new C.k(a);b={};for(var t=function(l){return l&&l.type&n.X&&l.value==="/"},q=function(l){return l&&
l.type&m&&l.value==="fill"},v=function(){f=c.R(function(l){return!(l.type&(p|r))});if(q(c.next())&&!b.fill)b.fill=true;else c.n();if(t(c.next())){g++;i=c.R(function(){return!(d.type&(p|r|o))&&!(d.type&m&&d.value==="auto")});if(t(c.next())){g++;h=c.R(function(){return!(d.type&(p|o))})}}else c.n()};d=c.next();){a=d.type;e=d.value;if(a&(p|r)&&!f){c.n();v()}else if(q(d)&&!b.fill){b.fill=true;v()}else if(a&m&&this.pa[e]&&!b.repeat){b.repeat={i:e};if(d=c.next())if(d.type&m&&this.pa[d.value])b.repeat.Ca=
d.value;else c.n()}else if(a&n.URL&&!b.src)b.src=e;else return null}if(!b.src||!f||f.length<1||f.length>4||i&&i.length>4||g===1&&i.length<1||h&&h.length>4||g===2&&h.length<1)return null;if(!b.repeat)b.repeat={i:"stretch"};if(!b.repeat.Ca)b.repeat.Ca=b.repeat.i;a=function(l,u){return{Q:u(l[0]),O:u(l[1]||l[0]),H:u(l[2]||l[0]),K:u(l[3]||l[1]||l[0])}};b.slice=a(f,function(l){return new C.g(l.type&p?l.value+"px":l.value)});b.width=i&&i.length>0?a(i,function(l){return l.type&(o|r)?new C.g(l.value):l.value}):
(k=this.element.currentStyle)&&{Q:new C.g(k.borderTopWidth),O:new C.g(k.borderRightWidth),H:new C.g(k.borderBottomWidth),K:new C.g(k.borderLeftWidth)};b.ba=a(h||[0],function(l){return l.type&o?new C.g(l.value):l.value})}return b}});C.mb=C.w.M({$:"box-shadow",ca:"boxShadow",N:function(a){var b,c=C.g,d=C.k.Y,e;if(a){e=new C.k(a);b={ba:[],oa:[]};for(a=function(){for(var f,i,h,g,k,n;f=e.next();){h=f.value;i=f.type;if(i&d.X&&h===",")break;else if(f.za()&&!k){e.n();k=e.R(function(m){return!m.za()})}else if(i&
d.S&&!g)g=h;else if(i&d.V&&h==="inset"&&!n)n=true;else return false}f=k&&k.length;if(f>1&&f<5){(n?b.oa:b.ba).push({hc:new c(k[0].value),ic:new c(k[1].value),blur:new c(k[2]?k[2].value:"0"),$b:new c(k[3]?k[3].value:"0"),color:new C.U(g||"currentColor")});return true}return false};a(););}return b&&(b.oa.length||b.ba.length)?b:null}});C.qb=C.w.M({aa:function(){var a=this.element.currentStyle;return a.visibility+"|"+a.display},N:function(){var a=this.element,b=a.runtimeStyle;a=a.currentStyle;var c=b.visibility,
d;b.visibility="";d=a.visibility;b.visibility=c;return{ec:d!=="hidden",Jb:a.display!=="none"}},d:function(){return false}});C.p={L:function(a){function b(c,d,e){this.element=c;this.e=d;this.parent=e}C.q.Aa(b.prototype,C.p,a);return b},B:function(){return false},D:j(),Xa:j(),u:j(),ta:function(a,b){this.Wa(a);for(var c=this.Z||(this.Z=[]),d=a+1,e=c.length,f;d<e;d++)if(f=c[d])break;c[a]=b;this.m().insertBefore(b,f||null)},ma:function(a){var b=this.Z;return b&&b[a]||null},Wa:function(a){var b=this.ma(a),
c=this.G;if(b&&c){c.removeChild(b);this.Z[a]=null}},na:function(a,b,c,d){var e=this.ra||(this.ra={}),f=e[a];if(!f){f=e[a]=C.q.ja("shape");if(b)f.appendChild(f[b]=C.q.ja(b));if(d){c=this.ma(d);if(!c){this.ta(d,this.element.document.createElement("group"+d));c=this.ma(d)}}c.appendChild(f);a=f.style;a.position="absolute";a.left=a.top=0;a.behavior="url(#default#VML)"}return f},va:function(a){var b=this.ra,c=b&&b[a];if(c){c.parentNode.removeChild(c);delete b[a]}return!!c},Ra:function(a){var b=this.element,
c=b.offsetWidth,d=b.offsetHeight,e,f,i,h,g,k,n;e=a.x.tl.a(b,c);f=a.y.tl.a(b,d);i=a.x.tr.a(b,c);h=a.y.tr.a(b,d);g=a.x.br.a(b,c);k=a.y.br.a(b,d);n=a.x.bl.a(b,c);a=a.y.bl.a(b,d);c=Math.min(c/(e+i),d/(h+k),c/(n+g),d/(f+a));if(c<1){e*=c;f*=c;i*=c;h*=c;g*=c;k*=c;n*=c;a*=c}return{x:{tl:e,tr:i,br:g,bl:n},y:{tl:f,tr:h,br:k,bl:a}}},la:function(a,b,c){b=b||1;var d,e,f=this.element;e=f.offsetWidth*b;f=f.offsetHeight*b;var i=this.e.s,h=Math.floor,g=Math.ceil,k=a?a.Q*b:0,n=a?a.O*b:0,m=a?a.H*b:0;a=a?a.K*b:0;var p,
o,r,t,q;if(c||i.d()){d=this.Ra(c||i.f());c=d.x.tl*b;i=d.y.tl*b;p=d.x.tr*b;o=d.y.tr*b;r=d.x.br*b;t=d.y.br*b;q=d.x.bl*b;b=d.y.bl*b;e="m"+h(a)+","+h(i)+"qy"+h(c)+","+h(k)+"l"+g(e-p)+","+h(k)+"qx"+g(e-n)+","+h(o)+"l"+g(e-n)+","+g(f-t)+"qy"+g(e-r)+","+g(f-m)+"l"+h(q)+","+g(f-m)+"qx"+h(a)+","+g(f-b)+" x e"}else e="m"+h(a)+","+h(k)+"l"+g(e-n)+","+h(k)+"l"+g(e-n)+","+g(f-m)+"l"+h(a)+","+g(f-m)+"xe";return e},m:function(){var a=this.parent.ma(this.zIndex),b;if(!a){a=this.element.document.createElement(this.ia);
b=a.style;b.position="absolute";b.top=b.left=0;this.parent.ta(this.zIndex,a)}return a},h:function(){this.parent.Wa(this.zIndex);delete this.ra;delete this.Z}};C.ob=C.p.L({d:function(){var a=this.e;for(var b in a)if(a.hasOwnProperty(b)&&a[b].d())return true;return false},B:function(){return this.e.Za.j()},Xa:function(){if(this.d()){var a=this.element,b=a,c,d,e=this.m().style,f=0;c=0;do b=b.offsetParent;while(b&&b.currentStyle.position==="static");c=a.getBoundingClientRect();if(b){d=b.getBoundingClientRect();
b=b.currentStyle;f=c.left-d.left-(parseFloat(b.borderLeftWidth)||0);c=c.top-d.top-(parseFloat(b.borderTopWidth)||0)}else{b=a.document.documentElement;f=c.left+b.scrollLeft-b.clientLeft;c=c.top+b.scrollTop-b.clientTop}e.left=f;e.top=c;e.zIndex=a.currentStyle.position==="static"?-1:a.currentStyle.zIndex}},u:function(){if(this.d()){var a=this.element,b=this.m().style;b.width=a.offsetWidth;b.height=a.offsetHeight}},Ya:function(){var a=this.e.Za.f();this.m().style.display=a.ec&&a.Jb?"":"none"},D:function(){this.d()?
this.Ya():this.h()},m:function(){var a=this.G,b,c;if(!a){b=this.element;a=this.G=b.document.createElement("css3-container");c=a.style;c.position=b.currentStyle.position==="fixed"?"fixed":"absolute";this.Ya();b.parentNode.insertBefore(a,b)}return a},h:function(){var a=this.G;a&&a.parentNode&&a.parentNode.removeChild(a);delete this.G;delete this.Z}});C.db=C.p.L({zIndex:2,ia:"background",B:function(){var a=this.e;return a.I.j()||a.s.j()},d:function(){var a=this.e;return a.z.d()||a.s.d()||a.I.d()||a.A.d()&&
a.A.f().oa},u:function(){this.d()&&this.Na()},D:function(){this.h();this.d()&&this.Na()},Na:function(){this.Kb();this.Lb()},Kb:function(){var a=this.e.I.f(),b=this.element,c=a&&a.color&&a.color.value(b),d,e,f;if(c&&c!=="transparent"){this.Sa();d=this.na("bgColor","fill",this.m(),1);e=b.offsetWidth;b=b.offsetHeight;d.stroked=false;d.coordsize=e*2+","+b*2;d.coordorigin="1,1";d.path=this.la(null,2);f=d.style;f.width=e;f.height=b;d.fill.color=c;a=a.color.Ma();if(a<1)d.fill.opacity=a}else this.va("bgColor")},
Lb:function(){var a=this.e.I.f();a=a&&a.images;var b,c,d,e,f,i;if(a){this.Sa();b=this.element;d=b.offsetWidth;e=b.offsetHeight;for(i=a.length;i--;){b=a[i];c=this.na("bgImage"+i,"fill",this.m(),2);c.stroked=false;c.fill.type="tile";c.fillcolor="none";c.coordsize=d*2+","+e*2;c.coordorigin="1,1";c.path=this.la(0,2);f=c.style;f.width=d;f.height=e;if(b.type==="linear-gradient")this.Ab(c,b);else{c.fill.src=b.url;this.Vb(c,i)}}}for(i=a?a.length:0;this.va("bgImage"+i++););},Vb:function(a,b){C.q.bb(a.fill.src,
function(c){var d=a.fill,e=this.element,f=e.offsetWidth,i=e.offsetHeight,h=this.e,g=h.ha.f(),k=g&&g.$a;g=k?k.t.a(e):0;var n=k?k.r.a(e):0,m=k?k.b.a(e):0;k=k?k.l.a(e):0;h=h.I.f().images[b];e=h.position?h.position.coords(e,f-c.v-k-n,i-c.i-g-m):{x:0,y:0};h=h.repeat;n=0;m=f;var p=i,o=0;k=e.x+k+0.5;g=e.y+g+0.5;d.position=k/f+","+g/i;if(h&&h!=="repeat"){if(h==="repeat-x"||h==="no-repeat"){n=g+1;p=g+c.i+1}if(h==="repeat-y"||h==="no-repeat"){o=k+1;m=k+c.v+1}a.style.clip="rect("+n+"px,"+m+"px,"+p+"px,"+o+"px)"}},
this)},Ab:function(a,b){function c(x,y,w,D,H){if(w===0||w===180)return[D,y];else if(w===90||w===270)return[x,H];else{w=Math.tan(-w*m/180);x=w*x-y;y=-1/w;D=y*D-H;H=y-w;return[(D-x)/H,(w*D-y*x)/H]}}function d(){q=g>=90&&g<270?i:0;v=g<180?h:0;l=i-q;u=h-v}function e(x,y){var w=y[0]-x[0];x=y[1]-x[1];return Math.abs(w===0?x:x===0?w:Math.sqrt(w*w+x*x))}var f=this.element,i=f.offsetWidth,h=f.offsetHeight;a=a.fill;var g=b.ua,k=b.ya;b=b.P;var n=b.length,m=Math.PI,p,o,r,t,q,v,l,u,s,A,B,z;if(k){k=k.coords(f,
i,h);p=k.x;o=k.y}if(g){g=g.Ib();if(g<0)g+=360;g%=360;d();if(!k){p=q;o=v}k=c(p,o,g,l,u);r=k[0];t=k[1]}else if(k){r=i-p;t=h-o}else{p=o=r=0;t=h}k=r-p;s=t-o;if(g===undefined){g=-Math.atan2(s,k)/m*180;if(g<0)g+=360;g%=360;d()}k=Math.atan2(k*i/h,s)/m*180;k+=180;k%=360;A=e([p,o],[r,t]);r=e([q,v],c(q,v,g,l,u));t=[];o=e([p,o],c(p,o,g,q,v))/r*100;p=[];for(s=0;s<n;s++)p.push(b[s].Ua?b[s].Ua.a(f,A):s===0?0:s===n-1?A:null);for(s=1;s<n;s++){if(p[s]===null){B=p[s-1];A=s;do z=p[++A];while(z===null);p[s]=B+(z-B)/
(A-s+1)}p[s]=Math.max(p[s],p[s-1])}for(s=0;s<n;s++)t.push(o+p[s]/r*100+"% "+b[s].color.value(f));a.angle=k;a.type="gradient";a.method="sigma";a.color=b[0].color.value(f);a.color2=b[n-1].color.value(f);a.colors.value=t.join(",")},Sa:function(){var a=this.element.runtimeStyle;a.backgroundImage="none";a.backgroundColor="transparent"},h:function(){C.p.h.call(this);var a=this.element.runtimeStyle;a.backgroundImage=a.backgroundColor=""}});C.ib=C.p.L({zIndex:4,ia:"border",B:function(){var a=this.e;return a.ha.j()||
a.s.j()},d:function(){var a=this.e;return a.z.d()||a.s.d()||a.I.d()},u:function(){this.d()&&this.Oa()},D:function(){this.h();this.d()&&this.Oa()},Oa:function(){var a=this.element,b=a.offsetWidth,c=a.offsetHeight,d,e,f,i,h,g;if(this.e.ha.f()){this.Pb();f=this.Mb(2);h=0;for(g=f.length;h<g;h++){i=f[h];d=this.na("borderPiece"+h,i.stroke?"stroke":"fill",this.m());d.coordsize=b*2+","+c*2;d.coordorigin="1,1";d.path=i.path;e=d.style;e.width=b;e.height=c;d.filled=!!i.fill;d.stroked=!!i.stroke;if(i.stroke){d=
d.stroke;d.weight=i.Da+"px";d.color=i.color.value(a);d.dashstyle=i.stroke==="dashed"?"2 2":i.stroke==="dotted"?"1 1":"solid";d.linestyle=i.stroke==="double"&&i.Da>2?"ThinThin":"Single"}else d.fill.color=i.fill.value(a)}for(;this.va("borderPiece"+h++););}},Pb:function(){var a=this.element,b=a.runtimeStyle;if(C.Qb){if(a.childNodes.length!==1||a.firstChild.tagName!=="ie6-mask"){var c=a.document.createElement("ie6-mask"),d=c.style;d.visibility="visible";for(d.zoom=1;d=a.firstChild;)c.appendChild(d);a.appendChild(c);
b.visibility="hidden"}}else b.borderColor="transparent"},Mb:function(a){var b=this.element,c,d,e=this.e.ha,f=[],i,h,g,k,n,m,p,o;if(e.d()){e=e.f();m=e.$a;p=e.bc;o=e.Fb;if(e.gc&&e.cc&&e.Gb){e=m.t.a(b);g=e/2;f.push({path:this.la({Q:g,O:g,H:g,K:g},a),stroke:p.t,color:o.t,Da:e})}else{a=a||1;c=b.offsetWidth;d=b.offsetHeight;e=m.t.a(b);g=m.r.a(b);k=m.b.a(b);b=m.l.a(b);var r={t:e,r:g,b:k,l:b};b=this.e.s;if(b.d())n=this.Ra(b.f());i=Math.floor;h=Math.ceil;var t=function(l,u){return n?n[l][u]:0},q=function(l,
u,s,A,B,z){var x=t("x",l),y=t("y",l),w=l.charAt(1)==="r";l=l.charAt(0)==="b";return x>0&&y>0?(z?"al":"ae")+(w?h(c-x):i(x))*a+","+(l?h(d-y):i(y))*a+","+(i(x)-u)*a+","+(i(y)-s)*a+","+A*65535+","+2949075*(B?1:-1):(z?"m":"l")+(w?c-u:u)*a+","+(l?d-s:s)*a},v=function(l,u,s,A){var B=l==="t"?i(t("x","tl"))*a+","+h(u)*a:l==="r"?h(c-u)*a+","+i(t("y","tr"))*a:l==="b"?h(c-t("x","br"))*a+","+i(d-u)*a:i(u)*a+","+h(d-t("y","bl"))*a;l=l==="t"?h(c-t("x","tr"))*a+","+h(u)*a:l==="r"?h(c-u)*a+","+h(d-t("y","br"))*a:
l==="b"?i(t("x","bl"))*a+","+i(d-u)*a:i(u)*a+","+i(t("y","tl"))*a;return s?(A?"m"+l:"")+"l"+B:(A?"m"+B:"")+"l"+l};b=function(l,u,s,A,B,z){var x=l==="l"||l==="r",y=r[l],w,D;if(y>0&&p[l]!=="none"){w=r[x?l:u];u=r[x?u:l];D=r[x?l:s];s=r[x?s:l];if(p[l]==="dashed"||p[l]==="dotted"){f.push({path:q(A,w,u,z+45,0,1)+q(A,0,0,z,1,0),fill:o[l]});f.push({path:v(l,y/2,0,1),stroke:p[l],Da:y,color:o[l]});f.push({path:q(B,D,s,z,0,1)+q(B,0,0,z-45,1,0),fill:o[l]})}else f.push({path:q(A,w,u,z+45,0,1)+v(l,y,0,0)+q(B,D,
s,z,0,0)+(p[l]==="double"&&y>2?q(B,D-i(D/3),s-i(s/3),z-45,1,0)+v(l,h(y/3*2),1,0)+q(A,w-i(w/3),u-i(u/3),z,1,0)+"x "+q(A,i(w/3),i(u/3),z+45,0,1)+v(l,i(y/3),1,0)+q(B,i(D/3),i(s/3),z,0,0):"")+q(B,0,0,z-45,1,0)+v(l,0,1,0)+q(A,0,0,z,1,0),fill:o[l]})}};b("t","l","r","tl","tr",90);b("r","t","b","tr","br",0);b("b","r","l","br","bl",-90);b("l","b","t","bl","tl",-180)}}return f},h:function(){C.p.h.call(this);this.element.runtimeStyle.borderColor=""}});C.fb=C.p.L({zIndex:5,Ub:["t","tr","r","br","b","bl","l",
"tl","c"],B:function(){var a=this.e;return a.z.j()||a.z.j()},d:function(){return this.e.z.d()},u:function(){if(this.d()){var a=this.e.z.f();this.m();var b=this.element,c=this.Va;C.q.bb(a.src,function(d){function e(q,v,l,u,s){q=c[q].style;q.width=v;q.height=l;q.left=u;q.top=s}function f(q,v,l){for(var u=0,s=q.length;u<s;u++)c[q[u]].imagedata[v]=l}var i=b.offsetWidth,h=b.offsetHeight,g=a.width,k=g.Q.a(b),n=g.O.a(b),m=g.H.a(b);g=g.K.a(b);var p=a.slice,o=p.Q.a(b),r=p.O.a(b),t=p.H.a(b);p=p.K.a(b);e("tl",
g,k,0,0);e("t",i-g-n,k,g,0);e("tr",n,k,i-n,0);e("r",n,h-k-m,i-n,k);e("br",n,m,i-n,h-m);e("b",i-g-n,m,g,h-m);e("bl",g,m,0,h-m);e("l",g,h-k-m,0,k);e("c",i-g-n,h-k-m,g,k);f(["tl","t","tr"],"cropBottom",(d.i-o)/d.i);f(["tl","l","bl"],"cropRight",(d.v-p)/d.v);f(["bl","b","br"],"cropTop",(d.i-t)/d.i);f(["tr","r","br"],"cropLeft",(d.v-r)/d.v);if(a.repeat.Ca==="stretch"){f(["l","r","c"],"cropTop",o/d.i);f(["l","r","c"],"cropBottom",t/d.i)}if(a.repeat.i==="stretch"){f(["t","b","c"],"cropLeft",p/d.v);f(["t",
"b","c"],"cropRight",r/d.v)}c.c.style.display=a.fill?"":"none"},this)}else this.h()},D:function(){this.h();this.d()&&this.u()},m:function(){var a=this.G,b,c,d,e=this.Ub,f=e.length;if(!a){a=this.G=this.element.document.createElement("border-image");b=a.style;b.position="absolute";this.Va={};for(d=0;d<f;d++){c=this.Va[e[d]]=C.q.ja("rect");c.appendChild(C.q.ja("imagedata"));b=c.style;b.behavior="url(#default#VML)";b.position="absolute";b.top=b.left=0;c.imagedata.src=this.e.z.f().src;c.stroked=false;
c.filled=false;a.appendChild(c)}this.parent.ta(this.zIndex,a)}return a}});C.lb=C.p.L({zIndex:1,ia:"outset-box-shadow",B:function(){var a=this.e;return a.A.j()||a.s.j()},d:function(){var a=this.e.A;return a.d()&&a.f().ba[0]},u:function(){if(this.d())for(var a=this.element,b=this.e.A.f().ba,c=b.length,d,e=a.offsetWidth,f=a.offsetHeight,i=["tl","tr","br","bl"],h,g,k,n,m,p,o,r;c--;){h=b[c];k=this.na("shadow"+c,"fill",this.m());n=k.style;d=k.fill;m=h.hc.a(a);p=h.ic.a(a);o=h.$b.a(a);r=h.blur.a(a);n.left=
m;n.top=p;n.width=e;n.height=f;k.coordsize=e*2+","+f*2;k.coordorigin="1,1";k.stroked=false;k.filled=true;d.color=h.color.value(a);m=h.color.Ma();if(m<1)n.filter="alpha(opacity="+m*100+")";if(r){d.type="gradienttitle";d.color2=h.color.value(a);d.opacity=0;g=r*2;h=Math.max(g-e/2,g-f/2);if(h>0)g-=h;h=g/(e+o+r);g=g/(f+o+r);d.focusposition=h+","+g;d.focussize=1-h*2+","+(1-g*2);g=this.e.s.f();if(!g){g={x:{},y:{}};for(d=4;d--;){h=i[d];g.x[h]=g.y[h]=C.g.Ja}}}o=-o-r;k.path=this.la({Q:o,O:o,H:o,K:o},2,g)}else this.h()},
D:function(){this.h();this.u()}});C.kb=C.p.L({zIndex:3,ia:"inset-box-shadow",B:function(){var a=this.e;return a.A.j()||a.s.j()},d:function(){var a=this.e.A;return a.d()&&a.f().oa[0]},u:j(),D:j()})}var E,F,G,I,J,K,L;function update(){init();var a=element.getBoundingClientRect(),b=a.left,c=a.top,d=a.right-b;a=a.bottom-c;var e,f;if(b!==G||c!==I){e=0;for(f=J.length;e<f;e++)J[e].Xa();G=b;I=c}if(d!==E||a!==F){e=0;for(f=J.length;e<f;e++)J[e].u();E=d;F=a}}
function propChanged(){init();var a,b,c=[];a=0;for(b=J.length;a<b;a++)J[a].B()&&c.push(J[a]);a=0;for(b=c.length;a<b;a++)c[a].D()}function mouseEntered(){event.srcElement.className+=" "+C.Fa+"hover";setTimeout(propChanged,0)}function mouseLeft(){var a=event.srcElement;a.className=a.className.replace(new RegExp("\\b"+C.Fa+"hover\\b","g"),"");setTimeout(propChanged,0)}function M(){var a=event.propertyName;if(a==="className"||a==="id")propChanged()}
function cleanup(){var a,b;if(J){a=0;for(b=J.length;a<b;a++)J[a].h();J=null}K=null;if(L){a=0;for(b=L.length;a<b;a++){L[a].detachEvent("onpropertychange",M);L[a].detachEvent("onmouseenter",mouseEntered);L[a].detachEvent("onmouseleave",mouseLeft)}L=null}}
function init(){if(!J){var a=element;a.runtimeStyle.zoom=1;K={I:new C.eb(a),ha:new C.jb(a),z:new C.gb(a),s:new C.hb(a),A:new C.mb(a),Za:new C.qb(a)};var b=new C.ob(a,K);J=[b,new C.lb(a,K,b),new C.db(a,K,b),new C.kb(a,K,b),new C.ib(a,K,b),new C.fb(a,K,b)];var c=element;if(a=c.currentStyle.getAttribute(C.T+"watch-ancestors")){L=[];a=parseInt(a,10);b=0;for(c=c.parentNode;c&&(a==="NaN"||b++<a);){L.push(c);c.attachEvent("onpropertychange",M);c.attachEvent("onmouseenter",mouseEntered);c.attachEvent("onmouseleave",
mouseLeft);c=c.parentNode}}update()}}element.readyState==="complete"&&init();
</script>
</PUBLIC:COMPONENT>
+24
View File
@@ -0,0 +1,24 @@
<?php
class webodfPlugin extends PluginBase{
function __construct(){
parent::__construct();
}
public function regiest(){
$this->hookRegiest(array(
'user.commonJs.insert' => 'webodfPlugin.echoJs',
));
}
public function echoJs($st=false,$act=false){
if($this->isFileExtence($st,$act)){
$this->echoFile('static/main.js');
}
}
public function index(){
$path = $this->filePath($this->in['path']);
$fileUrl = _make_file_proxy($path);
$fileName = get_path_this(rawurldecode($this->in['path']));
$fileName.= ' - '.LNG('kod_name').LNG('kod_power_by');
include($this->pluginPath.'/php/template.php');
}
}
+48
View File
@@ -0,0 +1,48 @@
{
"id":"webodf",
"name":"Opendocument Viewer",
"title":"",
"version":"1.23",
"source":{
"className":"x-item-file x-odt",
"icon":""
},
"category":"file",
"description":"Opendocument Viewer",
"keywords":"",
"auther":{
"copyright":"kodcloud.",
"homePage":"http://www.kodcloud.com",
},
"configItem":{
"pluginAuth":{
"type":"userSelect",
"value":"all:1",
"display":"{{LNG.Plugin.config.auth}}",
"desc":"{{LNG.Plugin.config.authDesc}}",
"require":1
},
"openWith":{
"type":"radio",
"value":"dialog",
"display":"{{LNG.Plugin.Config.openWith}}",
"info":[
["dialog","{{LNG.Plugin.Config.openWithDilog}}"],
["window","{{LNG.Plugin.Config.openWithWindow}}"]
]
},
"sep1001":"<hr/>",
"fileExt":{
"type":"tags",
"display":"{{LNG.Plugin.Config.fileExt}}",
"desc":"{{LNG.Plugin.Config.fileExtDesc}}",
"value":"odf,odt,ods,odp",
},
"fileSort":{
"type":"number",
"display":"{{LNG.Plugin.Config.fileSort}}",
"desc":"{{LNG.Plugin.Config.fileSortDesc}}",
"value":5000,
}
}
}
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html dir="ltr" mozdisallowselectionprint moznomarginboxes>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title><?php echo clear_html($fileName);?></title>
</head>
<?php if(get_path_ext($path) == 'odt'){ ?>
<style type="text/css">
#theBODY{margin:0;padding:0;background:#f0f0f0;}
#odf{text-align: center;width:100%;display: block !important;}
#odf > div{text-align: center;width:100%;background:#f0f0f0 !important;}
document{
margin:20px 0;background:#fff;
border-bottom: 1px solid rgb(217, 217, 217);
box-shadow: rgb(204, 204, 204) 0px 1px 6px;
}
</style>
<?php } ?>
<body id="theBODY">
<div id="odf"></div>
<script src="<?php echo $this->pluginHost;?>static/webodf.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
var fileURL = "<?php echo clear_quote($fileUrl);?>";
var odfelement = document.getElementById("odf"),
odfcanvas = new odf.OdfCanvas(odfelement);
odfcanvas.load(fileURL);
</script>
</body>
</html>
Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 KiB

+20
View File
@@ -0,0 +1,20 @@
kodReady.push(function(){
if( !$.supportCanvas() ){
return;
}
kodApp.add({
name:"webodfView",
title:"Opendocument Viewer",
ext:"{{config.fileExt}}",
sort:"{{config.fileSort}}",
icon:'x-item-file x-odt',
callback:function(path,ext){
var url = '{{pluginApi}}&path='+core.pathCommon(path)+'#locale='+G.lang;
if('window' == "{{config.openWith}}" && !core.isFileView() ){
window.open(url);
}else{
core.openDialog(url,core.icon(ext),htmlEncode(core.pathThis(path)));
}
}
});
});
File diff suppressed because one or more lines are too long
+116
View File
@@ -0,0 +1,116 @@
<?php
/*
* @link http://kodcloud.com/
* @author warlee | e-mail:kodcloud@qq.com
* @copyright warlee 2014.(Shanghai)Co.,Ltd
* @license http://kodcloud.com/tools/license/license.txt
*/
class yzOfficePlugin extends PluginBase{
function __construct(){
parent::__construct();
//IE8自动切换为普通模式
if( strpos($_SERVER["HTTP_USER_AGENT"],"MSIE 8.0") ){
$this->getConfig();
$this->pluginConfig['preview'] = '0';
}
}
public function regiest(){
$this->hookRegiest(array(
'user.commonJs.insert' => 'yzOfficePlugin.echoJs'
));
}
public function echoJs($st,$act){
if($this->isFileExtence($st,$act)){
$this->echoFile('static/main.js');
}
}
public function index(){
$app = $this->getObj();
$fileName = get_path_this(rawurldecode($this->in['path']));
$fileName.= ' - '.LNG('kod_name').LNG('kod_power_by');
if(!$app->task['success'] ){
include($this->pluginPath.'php/template.php');
return;
}
//获取页面
$step = count($app->task['steps']) - 1;
$infoData = $app->task['steps'][$step]['result'];
if( !is_array($infoData['data']) ){
$app->clearChche();
show_tips($infoData['message']);
}
$link = $infoData['data'][0];
$pageFile = $app->cachePath.md5($link).'.html.temp';
if(!file_exists($pageFile)){
$result = url_request($link,'GET');
if($result['code'] == 200){
$title = '<title>永中文档转换服务</title>';
$content = str_replace($title,'<title>'.$fileName.'</title>',$result['data']);
file_put_contents($pageFile,$content);
}else{
$app->clearChche();
show_tips($result);
}
}else{
$content = file_get_contents($pageFile);
}
if(strstr($content,'location.href = ')){
$app->clearChche();
show_tips("请求转换异常,请重试!");
}
//替换内容
$config = $this->getConfig();
if(!$config['cacheFile']){
header("Location: ".$html);
exit;
}
$name = str_replace(".html",'',get_path_this($link));
$urlReplaceFrom = './'.$name.".files";
$urlReplaceTo = $this->pluginApi.'getFile&path='.rawurlencode($this->in['path']).
$urlReplaceTo .= '&file='.rawurlencode($urlReplaceFrom);
// show_json(array($result,$urlReplaceFrom,$urlReplaceTo),false);
$content = str_replace($urlReplaceFrom,$urlReplaceTo,$content);
$content = str_replace('"'.$name.'.files','"'.$urlReplaceTo,$content);
$content = str_replace(array('<!DOCTYPE html>','<html>','<head>','</html>'),'',$content);
include('php/assign/header.php');
echo $content;
include('php/assign/footer.php');
}
private function str_rtrim($str,$remove){
if(!$str || !$remove) return false;
while(substr($str,-strlen($remove)) == $remove){
$str = substr($str,0,-strlen($remove));
}
return $str;
}
public function task(){
$app = $this->getObj();
$app->runTask();
}
public function getFile(){
$app = $this->getObj();
$app->getFile($this->in['file']);
}
private function getObj(){
$path = $this->filePath($this->in['path']);
if(filesize($path) > 1024*1024*2){
//show_tips("由于永中官方接口限制,<br/>暂不支持大于2M的文件在线预览!");
}
//文档分享预览; http://yozodoc.com/
// require_once($this->pluginPath.'php/yzOffice.class.php');
// return new yzOffice($this,$path);
//官网用户demo;
//http://www.yozodcs.com/examples.html 2M上传限制;
//http://dcs.yozosoft.com/examples.html
require_once($this->pluginPath.'php/yzOffice.class.php');
return new yzOffice2($this,$path);
}
}
+19
View File
@@ -0,0 +1,19 @@
<?php
return array(
"yzOffice.meta.name" => "Yozo Office View",
"yzOffice.meta.title" => "Yozo Office",
"yzOffice.meta.desc" => "Yozo Office View;",
'yzOffice.config.cacheFile' => "Open the cache",
'yzOffice.config.cacheFileDesc' => "After Opened,Office parsing generated images and other files stored in the server;",
'yzOffice.config.preview' => "Preview mode",
'yzOffice.config.previewDesc' => "Normal mode, the contents of complex layout will be converted to pictures;",
'yzOffice.config.previewNormal' => "Normal mode",
'yzOffice.config.previewHight' => "HD mode",
'yzOffice.Main.transfer' => "1.In data transmission......",
'yzOffice.Main.converting' => '2.File conversion, please wait a moment...',
'yzOffice.Main.uploadError' => "Upload failed. Please check PHP execution timeout!",
'yzOffice.Main.convert' => "Start convert...",
'yzOffice.Main.transferAgain' => "Retry"
);
@@ -0,0 +1,20 @@
<?php
return array(
"yzOffice.meta.name" => "永中office预览",
"yzOffice.meta.title" => "永中office",
"yzOffice.meta.desc" => "office系列文件在线预览",
'yzOffice.config.cacheFile' => "开启缓存",
'yzOffice.config.cacheFileDesc' => "开启后,office解析生成的图片等文件存储于本服务器;",
'yzOffice.config.preview' => "预览模式",
'yzOffice.config.previewDesc' => "普通模式,复杂排版的内容会转为图片;",
'yzOffice.config.previewNormal' => "普通模式",
'yzOffice.config.previewHight' => "高清模式",
'yzOffice.Main.transfer' => "1.数据传输中,请稍后...",
'yzOffice.Main.converting' => '2.文件转换中,请稍后...',
'yzOffice.Main.uploadError' => "上传失败,请检查php执行超时时间!",
'yzOffice.Main.convert' => "正在转换,请稍后...",
'yzOffice.Main.transferAgain' => "重新转换"
);
+71
View File
@@ -0,0 +1,71 @@
{
"id":"yzOffice",
"name":"{{LNG.yzOffice.meta.name}}",
"title":"{{LNG.yzOffice.meta.title}}",
"version":"1.37",
"category":"file",
"source":{
"icon":"{{pluginHost}}static/images/icon.png"
},
"description":"{{LNG.yzOffice.meta.desc}}",
"auther":{
"copyright":"kodcloud",
"homePage":"http://kodcloud.com"
},
"configItem":{
"formStyle":{
"className":"form-box-title-left",
"tabs":[
{
"name":"{{LNG.Plugin.tab.basic}}",
"field":["sep001","pluginAuth","openWith","cacheFile","preview"]
}
]
},
"pluginAuth":{
"type":"userSelect",
"value":"all:1",
"display":"{{LNG.Plugin.config.auth}}",
"desc":"{{LNG.Plugin.config.authDesc}}",
"require":1
},
"openWith":{
"type":"radio",
"value":"dialog",
"display":"{{LNG.Plugin.Config.openWith}}",
"info":[
["dialog","{{LNG.Plugin.Config.openWithDilog}}"],
["window","{{LNG.Plugin.Config.openWithWindow}}"]
]
},
"fileExt":{
"type":"tags",
"display":"{{LNG.Plugin.Config.fileExt}}",
"desc":"{{LNG.Plugin.Config.fileExtDesc}}",
"value":"doc,docx,docm,dot,dotx,dotm,rtf,wps,wpt,xls,xlsx,xlt,xlsm,csv,ppt,pptx,pps,ppsx",
},
"fileSort":{
"type":"number",
"display":"{{LNG.Plugin.Config.fileSort}}",
"desc":"{{LNG.Plugin.Config.fileSortDesc}}",
"value":50,
},
"cacheFile":{
"type":"switch",
"value":"1",
"display":"{{LNG.yzOffice.config.cacheFile}}",
"desc":"{{LNG.yzOffice.config.cacheFileDesc}}"
},
"preview":{
"type":"radio",
"value":"0",
"display":"{{LNG.yzOffice.config.preview}}",
"info":[
["1","{{LNG.yzOffice.config.previewNormal}}"],
["0","{{LNG.yzOffice.config.previewHight}}"]
],
"desc":"<br/>{{LNG.yzOffice.config.previewDesc}}"
}
}
}
@@ -0,0 +1,17 @@
<script type="text/javascript">
var funcNull = function(){return false;}
// document.oncopy = funcNull;
// document.oncontextmenu = funcNull;
// document.ondragstart = funcNull;
if( !window.datas &&
$('.excel-tab-title').length == 0){//没有目录
//$('.navbar-inverse').css('opacity',0);
}
$(document).ready(function(){
if($(".nav-collapse").length == 1){
$('body').addClass("body-excle");
}
})
</script>
<div class='powerby'>yozo DCS</div>
</html>
@@ -0,0 +1,132 @@
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
html body{
font-family:-apple-system,BlinkMacSystemFont,PingFang SC,
Helvetica,Tahoma,Arial,Hiragino Sans GB,Microsoft YaHei,Heiti,sans-serif;
background-image:none !important;
/*background-color:#f0f0f0;*/
}
.powerby{text-align: center;font-size:12px;color:#ccc;}
div.word-body, .ppt-body{background:#f9f9f9;}
div.word-page{border-bottom:1px solid #d9d9d9;box-shadow:0 1px 6px #ccc; max-width: 845px;}
div.word-page .word-content{max-width: 85%;}}
div.navbar{display:none;}
body.fullScreen div.word-page{max-width: 100%;border: none;}
body > div,body > hr{display:none;}
body div.container-fluid,
body div.navbar-inverse,
body #header,
div.openSide #loading,
div.openSide #header
{display:block;}
div.navbar-inverse{opacity:1;}
div.openSide .side-pager {
cursor: pointer;display: inline-block;font-size: 12px;color: #666;font-weight: 100;
background: #eee;padding: 0px 1em;margin-top: 4px;border-radius: 18px;
}
div#next, div#prev{
border-radius:4px;text-decoration: inherit;
font-family: FontAwesome;
font-weight: normal;font-style: normal;
-webkit-font-smoothing: antialiased;
color: rgba(0,0,0,0.001);
}
div.navbar-inverse .navbar-inner {
background:#eee;filter:none;
background-image: linear-gradient(to bottom,#fff,#eee);
border-bottom: 1px solid #ddd;
background-repeat: repeat-x;
}
div.navbar-inverse .nav>li>a {color: #666;text-shadow: none;}
div.navbar-inverse .brand{color: #666;text-shadow: none;width:40%;margin-left:0px;}
div.changePage{color:#888;}
div.navbar .nav{position: static;}
.nav.word-tab-title .dropdown.word-tab-title-li{position:absolute;left:0px;}
div.navbar-inverse .nav>li>a.dropdown-toggle{}
ul.dropdown-menu{margin-top:0;border-radius:2px;border: 1px solid rgba(0,0,0,0.1);}
ul.dropdown-menu>li>a:hover,
ul.dropdown-menu>li>a:focus,
ul.dropdown-submenu:hover>a,
ul.dropdown-submenu:focus>a{background:#2196F3 !important}
div.navbar-inverse .nav>li>a:focus,
div.navbar-inverse .nav>li>a:hover,
div.left a:hover,div.right a:hover{
color: #2196F3;background-color:rgba(0,0,0,0.05);
}
div.left,div.right{margin-right:5px;}
div.left a,div.right a{width:40px;text-align: center;display: block;}
div.navbar-inverse .brand:hover,
div.navbar-inverse .nav>li>a:hover,
div.navbar-inverse .brand:focus,
div.navbar-inverse .nav>li>a:focus{
color: #2196F3;
}
div.navbar-inverse .nav .active>a,
div.navbar-inverse .nav .active>a:hover,
div.navbar-inverse .nav .active>a:focus {
color: #fff !important;background: #2196F3 !important;
}
#next:after, #prev:after{color:#222;margin-left:-25px;}
#prev:after{content: "\f104";}
#next:after{content: "\f105";}
/*excle*/
@media (max-width: 979px) {
div.navbar-inverse .nav-collapse .nav>li>a:hover,
div.navbar-inverse .nav-collapse .nav>li>a:focus,
div.navbar-inverse .nav-collapse .dropdown-menu a:hover,
div.navbar-inverse .nav-collapse .dropdown-menu a:focus{
background-color: #d4ecff;
}
}
#btnPrint{filter: invert(60%);}
#zoom{display:none !important;}
.changePage .pageUp:after{content: "";font-family: FontAwesome;}
.changePage .pageDown:after {content: "";font-family: FontAwesome;}
.changePage .pageUp,.changePage .pageDown{font-size:16px;background:transparent !important;color:#888;text-decoration: none;}
.changePage .pageUp:hover,.changePage .pageDown:hover{background:#444;}
@media print {
body .powerby{display:none !important;}
body #zoom{display:none !important;}
body #btnPrint{filter: invert(60%);}
}
/*word*/
@media (max-width: 743px) {
div.word-page,div.word-page .word-content{border-bottom:none;box-shadow:none;}
/*.container-fluid{padding:20px 10px;}*/
}
<?php
$doc = array('doc','docx','docm','dot','dotx','dotm','rtf', 'wps','wpt');
if(in_array(get_path_ext($app->filePath),$doc)){
echo '
html body{background-color:#f0f0f0;}
div.powerby{display:block;}
';
}
?>
</style>
<script type="text/javascript">
if(!window.addEventListener){
window.addEventListener = window.attachEvent;
}
</script>
<link href="./static/style/font-awesome/css/font-awesome.css?ver=<?php echo KOD_VERSION;?>" rel="stylesheet">
<!--[if IE 7]>
<link rel="stylesheet" href="./static/style/font-awesome/css/font-awesome-ie7.css">
<![endif]-->
@@ -0,0 +1,165 @@
<!doctype html>
<head>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=no" />
<meta charset="utf-8">
<link rel="stylesheet" href="<?php echo STATIC_PATH;?>style/common.css" type="text/css">
<link rel="stylesheet" href="./static/style/font-awesome/css/font-awesome.css">
<title><?php echo clear_html($fileName);?></title>
<style>
body {margin: 0;font-family: "Helvetica Neue Light", "Segoe UI Semilight", sans-serif;}
.infoButtonPrint{
cursor: pointer;font-size:20px;right:60px;text-align:center;
background:none;color: #666;line-height:27px;
}
.load-content{
position: fixed;
overflow: hidden;z-index: 100;top:0;left:0;right:0;bottom:0;
font-size:13px;color:#666;
}
.app-icon{text-align: center;position: absolute;width: 100%;top:40%;margin-top: -150px;}
.app-icon img{max-height: 150px;}
.app-icon .app-name{font-size:16px;color:#222;}
.load-status{margin: 20px auto;}
.load-status .progress{
width:300px;height:30px;margin: 10px auto;position: relative;
background-image: linear-gradient(to right,#ddd, #f6f6f6, #ddd);
}
.progress-loading{font-size:30px;margin-top: 20px;}
.progress-slider .content{position: absolute;width: 100%;color:#29792c;font-size:12px;line-height:30px;}
.progress-slider .left{float:left;padding-left: 10px;}
.progress-slider .right{float:right;padding-right: 10px;}
.progress-bar{opacity: 0.7;}
.clear{clear:both;}
.progress-text{text-align: center;display: block;width:300px;margin: 0 auto;padding: 10px;word-wrap: break-word;}
@page {
margin-left: 0px;
margin-right: 0px;
margin-top: 0px;
margin-bottom: 0px;
margin: 0;
-webkit-print-color-adjust: exact;
}
body{background:#f0f0f0 !important;}
div.word-body, div.ppt-body{background:#ff0;}
div.word-page{box-shadow: 0 1px 6px #ccc;}
</style>
</head>
<body>
<div class="load-content display">
<div class="app-icon">
<img src="<?php echo "{$this->pluginHost}/static/images/icon.png";?>" />
<div class="app-name"><?php echo LNG('yzOffice.meta.name');?></div>
<div class="load-status">
<div class="progress-text alert"><?php echo LNG('yzOffice.Main.transfer');?></div>
<div class="progress-slider progress progress-striped active hidden">
<div class="progress-bar progress-bar-success" role="progressbar" style="width:0%;"></div>
<div class="content">
<span class="left"></span>
<span class="right"></span>
<div class="clear"></div>
</div>
</div>
<div class="progress-loading hidden">
<div class="moveCircleRight"><i class="icon-spinner"></i></div>
</div>
</div>
</div>
</div>
<div id="MyViewerDiv"></div>
</body>
<script src="<?php echo STATIC_PATH;?>js/lib/jquery-1.8.0.min.js"></script>
<script src="<?php echo STATIC_PATH;?>js/lib/jquery-lib.js"></script>
<script src="<?php echo STATIC_PATH;?>js/lib/util.js"></script>
<script type="text/javascript">
var LNG = {
"error":"<?php echo LNG('error');?>",
"success":"<?php echo LNG('success');?>",
"yzOffice.Main.transfer":"<?php echo LNG('yzOffice.Main.transfer');?>",
"yzOffice.Main.converting":"<?php echo LNG('yzOffice.Main.converting');?>",
"yzOffice.Main.uploadError":"<?php echo LNG('yzOffice.Main.uploadError');?>",
"yzOffice.Main.convert":"<?php echo LNG('yzOffice.Main.convert');?>",
"yzOffice.Main.transferAgain":"<?php echo LNG('yzOffice.Main.transferAgain');?>"
};
var path = '<?php echo clear_quote($this->in["path"]);?>';
var apiBase = "<?php echo $this->pluginApi;?>";//不能含有index.php
var selfHost = '<?php echo $this->pluginHost;?>';
var cacheFile= '<?php echo $config["cacheFile"];?>';
var apiUrl = {
task:apiBase+'task&path='+urlEncode(path),
getFile:apiBase+'getFile&path='+urlEncode(path)+'&file='
}
var request = function(){
$('.load-content').fadeIn(100);
$('.progress-text').removeClass('alert-danger').html(LNG['gstarCAD.Main.transfer']);
$('.progress-bar').css('width',"0%");
var repeatTimer;
var taskStatus = function(){
$.ajax({
url:apiUrl.task+"&time"+UUID(),
dataType:'json',
success:function(data){
statusUpdate(data);
}
});
}
var statusUpdate = function(data){
if(!data) return;
if(!data.code){
var error = data.data;
if(!_.isString(error)){
error = LNG.error;
}
clearInterval(repeatTimer);
$('.progress-text').addClass('alert-danger').html(error);
$('.progress-slider,.progress-loading').hide();
return;
}
if(!data.data) return;
if(data.data.success == 1){
clearInterval(repeatTimer);
var item = data.data.steps[data.data.steps.length-1];
$('.progress-text').html(LNG.success+LNG['yzOffice.Main.convert']);
loadSuccess(data);
}else{
var step = data.data.steps[data.data.currentStep];
var stepInfo = step.result;
if(!_.isObject(stepInfo)){
return;
}
$('.progress-text').removeClass('alert-danger');
$('.progress-slider,.progress-loading').removeClass('hidden');
if(step.name == 'upload'){
$('.progress-text').html(LNG['yzOffice.Main.transfer']);
if(stepInfo === false){
clearInterval(repeatTimer);
loadError(LNG['yzOffice.Main.uploadError']);
}
var sizeTotal = pathTools.fileSize(stepInfo.sizeTotal);
var sizeSuccess = pathTools.fileSize(stepInfo.sizeSuccess);
var speed = pathTools.fileSize(stepInfo.speed)+'/s';
$('.progress-slider .left').html(sizeSuccess+'/'+sizeTotal+' ('+speed+')');//12.6M/25.3M (1.2M/s)
$('.progress-slider .right').html(_.floor((stepInfo.progress*100),1)+"%");
$('.progress-bar').css('width',(stepInfo.progress*100)+"%");
}else if(step.name == 'convertProcess'){
$('.progress-slider').addClass('hidden');
$('.progress-text').html(LNG['gstarCAD.Main.conver']);
}
}
}
clearInterval(repeatTimer);
taskStatus();
repeatTimer = setInterval(taskStatus,1000);
};
var loadSuccess = function(data){
window.location.reload();
}
$(window).ready(function(){
request();
});
</script>
</head>
@@ -0,0 +1,181 @@
<?php
/*
* @link http://kodcloud.com/
* @author warlee | e-mail:kodcloud@qq.com
* @copyright warlee 2014.(Shanghai)Co.,Ltd
* @license http://kodcloud.com/tools/license/license.txt
*/
//官网用户demo
//http://www.yozodcs.com/examples.html
class yzOffice2{
public $cachePath = 'yzOffice/';
public $plugin;
public $filePath;
public $task;
public $taskFile;
public $api;
public function __construct($plugin,$filePath){
$this->plugin = $plugin;
$this->filePath = $filePath;
//新版本,加入了文件上传2M的限制; http://dcs.yozosoft.com/examples.html
$this->api = array(
'upload' => "http://dcs.yozosoft.com/testUpload",
'convert' => "http://dcs.yozosoft.com/convert",
);
if($filePath === -1) return;
if(!$filePath || !file_exists($filePath)){
show_json('path '.LNG('not_exist'),false);
}
$config = $plugin->getConfig();
$mode = $config['preview'];
$this->cachePath = TEMP_PATH.$this->cachePath.hash_path($this->filePath).$mode.'/';
$this->taskFile = $this->cachePath.'info.json';
mk_dir($this->cachePath);
if(file_exists($this->taskFile)){
$task_has = json_decode(file_get_contents($this->taskFile),true);
$this->task = is_array($task_has)?$task_has:false;
}
// show_json($this->upload(),false);
}
public function runTask(){
$task = array(
'currentStep' => 0,
'success' => 0,
'taskUuid' => md5($this->filePath.rand_string(20)),
'hideData' => array(),
'steps' => array(
array('name'=>'upload','process'=>'uploadProcess','status'=>0,'result'=>''),
array('name'=>'convert','process'=>'convert','status'=>0,'result'=>''),
)
);
if(is_array($this->task)){
$task = &$this->task;
}else{
$this->task = &$task;
}
$item = &$task['steps'][$task['currentStep']];
if($item['status'] == 0){
$item['status'] = 1;
if(!$item['process'] ||
$item['name'] == $item['process']){ //单步没有定时检测;相等则自我查询进度;0=>2之间跳转
$item['status'] = 0;
}
$this->saveData();
$function = $item['name'];
$result = $this->$function();
if(isset($result['data'])){
$item['result'] = $result['data'];
$item['status'] = 2;
$task['currentStep'] += 1;
//最后一步完成
if( $item['status'] == 2 && $task['currentStep'] > count($task['steps'])-1 ){
$task['success'] = 1;
}
if($task['currentStep'] >= count($task['steps'])-1 ){
$task['currentStep'] = count($task['steps'])-1;
}
$this->saveData();
}else{
$error = LNG('error');
if(is_array($result) && $result['code'] == 100){
$error = LNG('uploadError');
}else if(is_array($result) && is_string($result['data']) ){
$error = $result['data'];
}
show_json($error,false,array($function,$result));
}
}else if($item['status'] == 1){
$function = $item['process'];
if($function){
$item['result'] = $this->$function();
if($item['name'] == 'upload' && !$item['result']){
show_json($item['result'],false);
}
$this->saveData();
}
}
unset($task['hideData']);
show_json($task);
}
public function saveData(){
$data = json_encode_force($this->task);
file_put_contents($this->taskFile,$data);
}
private function convertMode(){
$config = $this->plugin->getConfig();
$ext = get_path_ext($this->filePath);
$mode = $config['preview'];
if(in_array($ext,array("xls","xlsb","xlsx","xlt","xlsm","csv",'ppt','pptx'))){
$mode = '1';//excle不支持高清模式,自动切换
}
return $mode;
}
//非高清预览【返回上传后直接转换过的文件】
public function upload(){
$post = array(
"file" => "@".$this->filePath,
"convertType" => $this->convertMode()
);
curl_progress_bind($this->filePath,$this->task['taskUuid']);//上传进度监听id
$result = url_request($this->api['upload'],'POST',$post,false,false,true,3600);
if(is_array($result) && $result['data']){
return $result;
}
return false;
}
public function convert($tempFile=false){
$headers = array("Content-Type: application/x-www-form-urlencoded; charset=UTF-8");
$stepInfo = $this->task['steps'][0]['result'];
$tempFile = $tempFile?$tempFile:$stepInfo['data'];
if(!$tempFile){
show_json("操作失败: ".$stepInfo['message'],false,$this->task);
}
$postArr = array(
"inputDir" => $tempFile,
"sourceFolder" => rtrim(get_path_father($tempFile),'/'),
"convertType" => $this->convertMode(),
"isAsync" => 1,
"isDownload" => 0,
"isSignature" => 0,
);
$post = http_build_query($postArr);//post默认用array发送;content-type为x-www-form-urlencoded时用key=1&key=2的形式
// show_json([$stepInfo,$postArr,$post],false);
$result = url_request($this->api['convert'],'POST',$post,$headers,false,true,5);
if(is_array($result) && is_array($result['data'])){
return $result;
}
return false;
}
public function clearChche(){
del_dir($this->cachePath);
}
public function uploadProcess(){
return curl_progress_get($this->filePath,$this->task['taskUuid']);
}
public function getFile($file){
ignore_timeout();
$ext = unzip_filter_ext(get_path_ext($file));
$cacheFile = $this->cachePath.md5($file.'file').'.'.$ext;
if(file_exists($cacheFile)){
file_put_out($cacheFile,false);
return;
}
$step = count($this->task['steps']) - 1;
$infoData = $this->task['steps'][$step]['result'];
$link = $infoData['data'][0];
$linkFile = get_path_father($link) . str_replace('./','',$file);
$result = url_request($linkFile,'GET',false);
if($result['code'] == 200){
file_put_contents($cacheFile, $result['data']);
file_put_out($cacheFile,false);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

@@ -0,0 +1,18 @@
kodReady.push(function(){
kodApp.add({
name:"yzOffice",
title:"{{LNG.yzOffice.meta.name}}",
ext:"{{config.fileExt}}",
sort:"{{config.fileSort}}",
icon:'{{pluginHost}}static/images/icon.png',
callback:function(path,ext){
var url = '{{pluginApi}}&path='+core.pathCommon(path);
if('window' == "{{config.openWith}}" && !core.isFileView() ){
window.open(url);
}else{
core.openDialog(url,core.icon(ext),htmlEncode(core.pathThis(path)));
}
}
});
});
+57
View File
@@ -0,0 +1,57 @@
<?php
class zipViewPlugin extends PluginBase{
function __construct(){
parent::__construct();
}
public function regiest(){
$this->hookRegiest(array(
'user.commonJs.insert' => 'zipViewPlugin.echoJs',
'globalRequest'=>'zipViewPlugin.changeData',
));
}
public function changeData(){
$GLOBALS['config']['pathRoleDefine']['read']['preview'] = array('explorer.image','explorer.unzipList','explorer.fileProxy','explorer.fileView','editor.fileGet');
//临时
if(isset($_REQUEST['HTTP_X_PLATFORM'])){
$GLOBALS['config']['settingSystem']['needCheckCode'] = false;
}
}
public function unzipList(){
$maxLength = 50000;
$path = $this->filePath($this->in['path']);
if(isset($this->in['index'])){
$download = isset($this->in['download'])?true:false;
KodArchive::filePreview($path,$this->in['index'],$download,$this->in['name']);
}else{
$cacheFile = TEMP_PATH.'zipView/'.hash_path($path).'.log';
if(file_exists($cacheFile)){
$content = file_get_contents($cacheFile);
$data = json_decode($content,true);
if( count($data) >= $maxLength ){
show_json("包含内容太多(".count($data)."项),请在本地打开查看;",false);
}
show_json($data);
}
mk_dir(get_path_father($cacheFile));
$result = KodArchive::listContent($path);
$data = json_encode($result['data']);
if( count($result['data']) >= $maxLength ){
show_json("包含内容太多(".count($result['data'])."项),请在本地打开查看;",false);
}
if($result['code'] && $data){
file_put_contents($cacheFile,$data);
show_json($result['data'],$result['code']);
}else{
show_json($result['data'],false);
}
}
}
public function echoJs($st,$act){
if($this->isFileExtence($st,$act)){
$this->echoFile('static/main.js');
}
}
}
Binary file not shown.
Binary file not shown.
+40
View File
@@ -0,0 +1,40 @@
{
"id":"zipView",
"name":"{{LNG.Plugin.default.zipView}}",
"title":"",
"version":"1.38",
"source":{
"icon":"{{pluginHost}}static/images/icon.png",
"screenshoot":[
"https://raw.githubusercontent.com/kalcaddle/static/master/images/kod/file-unzip.png"
]
},
"category":"file,tool",
"description":"",
"keywords":"",
"auther":{
"copyright":"kodcloud.",
"homePage":"http://www.kodcloud.com",
},
"configItem":{
"pluginAuth":{
"type":"userSelect",
"value":"all:1",
"display":"{{LNG.Plugin.config.auth}}",
"desc":"{{LNG.Plugin.config.authDesc}}",
"require":1
},
"fileExt":{
"type":"tags",
"display":"{{LNG.Plugin.Config.fileExt}}",
"desc":"{{LNG.Plugin.Config.fileExtDesc}}",
"value":"zip,tar,gz,tgz,ipa,apk,rar,7z,iso,bz2,zx,z,arj,epub",
},
"fileSort":{
"type":"number",
"display":"{{LNG.Plugin.Config.fileSort}}",
"desc":"{{LNG.Plugin.Config.fileSortDesc}}",
"value":10
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Some files were not shown because too many files have changed in this diff Show More