晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。 林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。 见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝) 既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。 南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。
|
Server : Apache System : Linux srv.rainic.com 4.18.0-553.47.1.el8_10.x86_64 #1 SMP Wed Apr 2 05:45:37 EDT 2025 x86_64 User : rainic ( 1014) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/rainic/www/oldTZh/wp-content/plugins/powerpack-elements/assets/js/ |
Upload File : |
(function ($) {
"use strict";
var getElementSettings = function ($element) {
var elementSettings = {},
modelCID = $element.data('model-cid');
if ( isEditMode && modelCID ) {
var settings = elementorFrontend.config.elements.data[ modelCID ],
settingsKeys = elementorFrontend.config.elements.keys[ settings.attributes.widgetType || settings.attributes.elType ];
jQuery.each( settings.getActiveControls(), function( controlKey ) {
if ( -1 !== settingsKeys.indexOf( controlKey ) ) {
elementSettings[ controlKey ] = settings.attributes[ controlKey ];
}
} );
} else {
elementSettings = $element.data('settings') || {};
}
return elementSettings;
};
var isEditMode = false;
var PPVideo = {
/**
* Auto Play Video
*/
_play: function( $selector ) {
var $iframe = $( "<iframe/>" );
var $vid_src = $selector.data( 'src' );
if ( 0 == $selector.find( 'iframe' ).length ) {
$iframe.attr( 'src', $vid_src );
$iframe.attr( 'frameborder', '0' );
$iframe.attr( 'allowfullscreen', '1' );
$iframe.attr( 'allow', 'autoplay;encrypted-media;' );
$selector.html( $iframe );
}
}
}
var DeviceHandler = function ($scope, $) {
var elementSettings = getElementSettings( $scope ),
$selector = $scope.find( '.pp-video' ).eq(0),
$video_obj = $scope.find( '.pp-video-player-source' ),
video = $video_obj.get(0),
$screen = $scope.find( '.pp-device-screen' ),
playbtn = $scope.find( '.pp-player-controls-play' ),
rewindbtn = $scope.find( '.pp-player-controls-rewind'),
controls = $scope.find( '.pp-video-player-controls'),
fs_control = $scope.find( '.pp-player-controls-fs'),
video_source = elementSettings.video_source,
restart_on_pause = elementSettings.restart_on_pause,
stop_others = elementSettings.stop_others,
auto_play = elementSettings.autoplay,
playback_speed = elementSettings.playback_speed,
end_at_last_frame = elementSettings.end_at_last_frame,
show_buttons = elementSettings.video_show_buttons,
settings = $selector.data('settings'),
$video_play = $scope.find( '.pp-video-play' ),
$orientation_control = $scope.find( '.pp-device-orientation .fas.fa-mobile' );
$video_play.off( 'click' ).on( 'click', function( e ) {
e.preventDefault();
var $selector = $( this ).find( '.pp-video-player' );
PPVideo._play( $selector );
});
if ( $video_play.data( 'autoplay' ) == '1' ) {
PPVideo._play( $scope.find( '.pp-video-player' ) );
};
var screen_play = '';
if ( 'show' !== show_buttons ) {
screen_play = $scope.find( '.pp-device-screen' );
}
$orientation_control.click( function(e) {
if ( $(this).hasClass( 'pp-mobile-icon-portrait' ) ){
$scope.find( '.pp-device-container' ).removeClass( 'pp-device-orientation-portrait' );
$scope.find( '.pp-device-container' ).addClass( 'pp-device-orientation-landscape' );
$(this).removeClass( 'pp-mobile-icon-portrait' );
$(this).addClass( 'pp-mobile-icon-landscape' );
}
else if ( $(this).hasClass( 'pp-mobile-icon-landscape' ) ){
$scope.find( '.pp-device-container' ).removeClass( 'pp-device-orientation-landscape' );
$scope.find( '.pp-device-container' ).addClass( 'pp-device-orientation-portrait' );
$(this).addClass( 'pp-mobile-icon-portrait' );
$(this).removeClass( 'pp-mobile-icon-landscape' );
}
});
if ( 'yes' === restart_on_pause ) {
restart_on_pause = true;
}
if ( 'yes' === stop_others ) {
$("video").on("play", function() {
$("video").not(this).each(function(index, video) {
var plybtn = $(video).parent().find('.pp-player-controls-play');
plybtn.removeClass('pp-pause');
plybtn.addClass('pp-play');
video.pause();
});
});
}
//get HTML5 video time duration
$video_obj.on('loadedmetadata', function() {
if ( 'yes' === auto_play ) {
playbtn.first().trigger('click');
}
//playback speed.
video.playbackRate = playback_speed.size;
var date = new Date(null);
date.setSeconds(video.duration); // specify value for SECONDS here
var timeString = date.toISOString().substr(11, 8);
$scope.find( '.pp-player-controls-duration' ).text(timeString);
});
//update HTML5 video current play time
$video_obj.on('timeupdate', function() {
var currentPos = video.currentTime; //Get currenttime
var maxduration = video.duration; //Get video duration
var percentage = 100 * currentPos / maxduration; //in %
$scope.find( '.pp-player-control-progress-track.pp-player-control-progress-inner' ).css('width', percentage+'%');
var date = new Date(null);
date.setSeconds(video.currentTime); // specify value for SECONDS here
var timeString = date.toISOString().substr(11, 8);
$scope.find( '.pp-player-controls-time' ).text(timeString);
if ( video.currentTime === video.duration ) {
$screen.removeClass('pp-paused');
$screen.removeClass('pp-playing');
playbtn.removeClass('pp-pause');
playbtn.addClass('pp-play');
if ( playbtn.hasClass( 'pp-play' ) ) {
playbtn.find( '.fa-play, .e-fas-fa-play' ).show();
playbtn.find( '.fa-pause, .e-fas-fa-pause' ).hide();
} else {
playbtn.find( '.fa-pause, .e-fas-fa-pause' ).show();
playbtn.find( '.fa-play, .e-fas-fa-play' ).hide();
}
$scope.find( '.pp-player-controls-time' ).text('00:00');
$scope.find( '.pp-player-control-progress-track.pp-player-control-progress-inner' ).css('width', '0%');
$scope.find( '.pp-video-overlay' ).css('opacity', '');
is_playing = false;
}
});
//on video play
$video_obj.on('play', function() {
$scope.find( '.pp-video-overlay' ).css('opacity', '0');
});
//on video pause
$video_obj.on('pause', function() {
$scope.find( '.pp-player-controls-rewind.pp-video-button' ).show();
$scope.find( '.pp-video-overlay' ).css('opacity', '');
});
//mute
$scope.find( '.pp-player-controls-volume-icon' ).click( function() {
if( $(this).hasClass('fa-volume-up') ){
$(this).removeClass('fa-volume-up');
$(this).addClass('fa-volume-mute');
}
else if( $(this).hasClass('fa-volume-mute') ){
$(this).removeClass('fa-volume-mute');
$(this).addClass('fa-volume-up');
}
video.muted = !video.muted;
return false;
});
//volume bar
var volumeDrag = false; /* Drag status */
$scope.find( '.pp-player-controls-volume-bar' ).mousedown( function(e) {
volumeDrag = true;
updateVolumeBar(e.pageX);
});
$scope.find( '.pp-player-controls-volume-bar' ).mouseup( function(e) {
if(volumeDrag) {
volumeDrag = false;
updateVolumeBar(e.pageX);
}
});
$scope.find( '.pp-player-controls-volume-bar' ).mousemove( function(e) {
if(volumeDrag) {
updateVolumeBar(e.pageX);
}
});
//Update Volume Bar control
var updateVolumeBar = function(x) {
var volumebar = $scope.find( '.pp-player-controls-volume-bar' );
var position = x - volumebar.offset().left; //Click pos
var volume = position / volumebar.width();
var percentage = 100 * volume; //in %
//Check within range
if(volume > 1) {
volume = 1;
percentage = 100;
}
if(volume < 0) {
volume = 0;
percentage = 0;
}
//Update volume
video.volume = volume;
$scope.find( '.pp-player-controls-volume-bar-amount.pp-player-control-progress-inner' ).css('width', percentage+'%');
};
//Rewind control
rewindbtn.on('click', function() {
video.currentTime = 0;
return false;
});
//Full screen control
fs_control.on('click', function() {
if ( video.requestFullscreen ) {
video.requestFullscreen();
} else if ( video.webkitRequestFullscreen ) {
video.webkitRequestFullscreen();
} else if ( video.webkitEnterFullscreen ) {
video.webkitEnterFullscreen();
} else if ( video.mozRequestFullScreen ) {
video.mozRequestFullScreen();
} else if ( video.msRequestFullscreen ) {
video.msRequestFullscreen();
} else {
alert('Your browser doesn\'t support fullscreen');
}
});
var timeDrag = false; /* Drag status */
$scope.find( '.pp-player-controls-progress' ).mousedown( function(e) {
timeDrag = true;
updatebar(e.pageX);
});
$scope.find( '.pp-player-controls-progress' ).mouseup( function(e) {
if(timeDrag) {
timeDrag = false;
updatebar(e.pageX);
}
});
$scope.find( '.pp-player-controls-progress' ).mousemove( function(e) {
if(timeDrag) {
updatebar(e.pageX);
}
});
//Update Progress Bar control
var updatebar = function(x) {
var progress = $scope.find( '.pp-player-controls-progress' );
var maxduration = video.duration; //Video duraiton
var position = x - progress.offset().left; //Click pos
var percentage = 100 * position / progress.width();
//Check within range
if ( percentage > 100 ) {
percentage = 100;
}
if ( percentage < 0 ) {
percentage = 0;
}
//Update progress bar and video currenttime
video.currentTime = maxduration * percentage / 100;
$scope.find( '.pp-player-controls-progress-time.pp-player-control-progress-inner' ).css('width', percentage+'%');
if ( 'yes' === end_at_last_frame && 'yes' !== loop ) {
if ( 100 === percentage ){
var plybtn = $scope.find( ' .pp-player-controls-play');
plybtn.removeClass('pp-pause');
plybtn.addClass('pp-play');
}
}
};
if ( 'hosted' == video_source ) {
playbtn.on("click", function (e) {
if ( $(this).hasClass('pp-play') ) {
video.play();
playbtn.removeClass('pp-play');
playbtn.addClass('pp-pause');
$screen.removeClass('pp-paused');
$screen.addClass('pp-playing');
}
else if ( $(this).hasClass('pp-pause') ) {
video.pause();
playbtn.removeClass('pp-pause');
playbtn.addClass('pp-play');
$screen.removeClass('pp-playing');
$screen.addClass('pp-paused');
if ( restart_on_pause ) {
video.currentTime = 0;
}
}
if ( playbtn.hasClass( 'pp-play' ) ) {
playbtn.find( '.fa-play, .e-fas-fa-play' ).show();
playbtn.find( '.fa-pause, .e-fas-fa-pause' ).hide();
} else {
playbtn.find( '.fa-pause, .e-fas-fa-pause' ).show();
playbtn.find( '.fa-play, .e-fas-fa-play' ).hide();
}
return false;
});
if ( 'show' !== show_buttons ) {
var is_playing = false;
screen_play.on("click", function (e) {
if ( $(this).hasClass('pp-device-screen-video') ) {
if ( !is_playing ) {
video.play();
$screen.removeClass('pp-paused');
$screen.addClass('pp-playing');
playbtn.removeClass('pp-play');
playbtn.addClass('pp-pause');
is_playing = true;
return;
}
if ( is_playing ) {
video.pause();
$screen.removeClass('pp-playing');
$screen.addClass('pp-paused');
playbtn.removeClass('pp-pause');
playbtn.addClass('pp-play');
is_playing = false;
return;
}
if ( playbtn.hasClass( 'pp-play' ) ) {
playbtn.find( '.fa-play, .e-fas-fa-play' ).show();
playbtn.find( '.fa-pause, .e-fas-fa-pause' ).hide();
} else {
playbtn.find( '.fa-pause, .e-fas-fa-pause' ).show();
playbtn.find( '.fa-play, .e-fas-fa-play' ).hide();
}
}
});
}
}
};
$(window).on('elementor/frontend/init', function () {
if ( elementorFrontend.isEditMode() ) {
isEditMode = true;
}
elementorFrontend.hooks.addAction('frontend/element_ready/pp-devices.default', DeviceHandler);
});
}(jQuery));