diff --git a/css/admin.css b/css/admin.css
index 9f6bb81eb..16448e40b 100755
--- a/css/admin.css
+++ b/css/admin.css
@@ -46,19 +46,25 @@
.flowplayer-wrapper { width: 70%; display: inline-block; float: right;}
@media only screen and (max-width: 940px) {.flowplayer-wrapper { width: 100%; float: none;} .form-table2.flowplayer-settings {width: 100% !important;}}
-
+/* POPUPS */
#fv-player-popups-settings tr.data:nth-child(even) { background-color: #eee; }
.fv-player-popup-remove { visibility: hidden; }
td:hover > .fv-player-popup-remove { visibility: visible; }
table.fv-player-popup-formats td:first-child { width: 72px }
-#fv_flowplayer_popups .inside label {
- display: initial;
- text-align: inherit;
-}
-#fv-player-popups-settings > tbody > tr > td:nth-child( 1 ) {
- text-align: center;
- max-width: 7px;
+#fv_flowplayer_popups .inside label {display: initial;text-align: inherit;}
+#fv-player-popups-settings > tbody > tr > td:nth-child( 1 ) {text-align: center;max-width: 7px;}
+
+.fv-player-popups-editable .hide-if-popups-editable,
+.fv-player-popups-editing .hide-if-popups-editing,
+.fv-player-popups-legacy .hide-if-popups-legacy,
+.fv-player-popups-preset .hide-if-popups-preset{
+ display:none;
}
+.fv-player-popup-css-edit{margin-top: 0!important;}
+
+
+
+
.fv-metabox-holder {
padding-top:0!important;
diff --git a/css/flowplayer.css b/css/flowplayer.css
index c38538ef4..0240e02f0 100755
--- a/css/flowplayer.css
+++ b/css/flowplayer.css
@@ -924,3 +924,11 @@ article .entry-content .fvfp_admin_error p { line-height: 18px; }
.flowplayer.chrome55fix video::-webkit-media-controls-panel {
width: calc(100% + 48px);
}
+
+
+
+.fv-player-popup-default { position: absolute; top: 10%; z-index: 20; text-align: center; width: 100%; color: #fff; }
+.fv-player-popup-default .fv_player_popup_content { background: #555555; padding: 1% 5%; width: 65%; margin: 0 auto; }
+
+.fv-player-popup-tw { position: absolute; top: 10%; z-index: 20; text-align: center; width: 100%; color: #f88; }
+.fv-player-popup-tw .fv_player_popup_content { background: #333333; padding: 1% 5%; width: 65%; margin: 0 auto; }
diff --git a/flowplayer/fv-flowplayer.min.js b/flowplayer/fv-flowplayer.min.js
index 31dab7930..72fd4577b 100644
--- a/flowplayer/fv-flowplayer.min.js
+++ b/flowplayer/fv-flowplayer.min.js
@@ -615,7 +615,7 @@ flowplayer(function (api,root) {
if( root.find('.wpfp_custom_popup').length > 0) {
root.find('.wpfp_custom_popup').show();
} else {
- root.append( '
' );
+ root.append( fv_flowplayer_popup[player_id].html );
}
}
diff --git a/js/shortcode-editor.js b/js/shortcode-editor.js
index a25730c19..9ad9239d8 100644
--- a/js/shortcode-editor.js
+++ b/js/shortcode-editor.js
@@ -1077,7 +1077,11 @@ function fv_wp_flowplayer_submit( preview ) {
if( jQuery('[name=fv_wp_flowplayer_field_popup]').val() !== ''){
fv_wp_flowplayer_shortcode_write_arg('fv_wp_flowplayer_field_popup','popup','html');
}else{
- fv_wp_flowplayer_shortcode_write_arg('fv_wp_flowplayer_field_popup_id', 'popup', false, false, ['no','random','1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16'] );
+ var sPopup = jQuery('#fv_wp_flowplayer_field_popup_id').val();
+ if(sPopup){
+ fv_wp_fp_shortcode += ' popup="' + sPopup + '"';
+ }
+
}
break;
}
@@ -1336,7 +1340,7 @@ function fv_wp_flowplayer_shortcode_write_arg( sField, sArg, sKind, bCheckbox, a
if( typeof(element) == "undefined") {
return false;
}
-
+
var sValue = false;
if( bCheckbox ) {
if( element.checked ){
diff --git a/models/flowplayer-frontend.php b/models/flowplayer-frontend.php
index 1836a3cba..94742a536 100644
--- a/models/flowplayer-frontend.php
+++ b/models/flowplayer-frontend.php
@@ -806,12 +806,13 @@ function get_popup_code() {
}
}
- $sClass = ' fv_player_popup-'.$iPopupIndex;
+ $sClass = ' fv_player_popup-id_'.$iPopupIndex;
+ $sStyle = isset($aPopupData[$iPopupIndex]['css_preset']) ? $aPopupData[$iPopupIndex]['css_preset'] : 'default';
$popup = apply_filters('fv_flowplayer_popup_html', $popup);
if (strlen(trim($popup)) > 0) {
$popup_contents = array(
- 'html' => ''
+ 'html' => ''
);
return $popup_contents;
}
diff --git a/models/flowplayer.php b/models/flowplayer.php
index 7d5f3a6c4..ac376b9cd 100644
--- a/models/flowplayer.php
+++ b/models/flowplayer.php
@@ -254,14 +254,7 @@ public function _set_conf() {
$sKey = $aNewOptions['key'];
if(isset($aNewOptions['popups'])){
- unset($aNewOptions['popups']['#fv_popup_dummy_key#']);
-
- foreach( $aNewOptions['popups'] AS $key => $value ) {
- $aNewOptions['popups'][$key]['css'] = stripslashes($value['css']);
- $aNewOptions['popups'][$key]['html'] = stripslashes($value['html']);
- }
-
- update_option('fv_player_popups',$aNewOptions['popups']);
+ $this->popup_settings($aNewOptions['popups']);
unset($aNewOptions['popups']);
}
@@ -305,6 +298,45 @@ public function _set_conf() {
return true;
}
+
+ private function popup_settings($aPopups) {
+ unset($aPopups['#fv_popup_dummy_key#']);
+ $aPopupCss = get_option('fv_player_popups_css',array());
+
+ foreach( $aPopups AS $key => $aPopupData ) {
+
+ //unset( $aPopups[$key]['css_preset_name']);
+ $aPopups[$key]['css'] = stripslashes($aPopupData['css']);
+ $aPopups[$key]['html'] = stripslashes($aPopupData['html']);
+
+ if(in_array($aPopupData['css_preset'], array('default','tw'))){
+ $aPopups[$key]['css'] = '';
+ $aPopups[$key]['css_preset_name'] = '';
+ $aPopups[$key]['css_preset_content'] = '';
+ continue;
+ }else if($aPopupData['css_preset'] === 'legacy'){
+ $aPopups[$key]['css_preset_name'] = '';
+ $aPopups[$key]['css_preset_content'] = '';
+ continue;
+ }
+
+
+ if(isset($aPopupData['css_preset']) && is_numeric($aPopupData['css_preset'])){
+
+ $aPopupCss[$aPopupData['css_preset']] = array(
+ 'name' => $aPopupData['css_preset_name'],
+ 'content' => trim($aPopupData['css_preset_content']),
+ );
+ $aPopups[$key]['css_preset'] = $aPopupData['css_preset'];
+ update_option('fv_player_popups_css',$aPopupCss);
+ }
+
+
+
+ }
+ update_option('fv_player_popups',$aPopups);
+
+ }
/**
* Salt function - returns pseudorandom string hash.
* @return Pseudorandom string hash.
@@ -314,7 +346,7 @@ public function _salt() {
return $salt;
}
-
+
private function build_playlist_html( $aArgs, $sSplashImage, $sItemCaption ){
if(isset($aArgs['liststyle']) && $aArgs['liststyle'] == 'vertical'){
@@ -559,7 +591,7 @@ function css_generate( $skip_style_tag = true ) {
.flowplayer.fixed-controls { margin: 0 auto px auto; display: block; }
.flowplayer.has-abloop { margin-bottom: px; }
.flowplayer.fixed-controls.has-abloop { margin-bottom: px; }
- .flowplayer.has-caption, flowplayer.has-caption * { margin: 0 auto; }
+ .flowplayer.has-caption, .flowplayer.has-caption * { margin: 0 auto; }
.flowplayer .fp-controls, .flowplayer .fv-ab-loop, .fv-player-buttons a:active, .fv-player-buttons a { color: _get_option('durationColor'); ?> !important; background-color: _get_option('backgroundColor'); ?> !important; }
.flowplayer { background-color: _get_option('canvas'); ?> !important; }
.flowplayer .fp-duration, .flowplayer a.fp-play, .flowplayer a.fp-mute { color: _get_option('durationColor'); ?> !important; }
@@ -580,7 +612,8 @@ function css_generate( $skip_style_tag = true ) {
.fvplayer .me-cannotplay span { padding: 5px; }
#content .fvplayer .mejs-container .mejs-controls div { font-family: _get_option('font-face'); ?>; }
- .wpfp_custom_background { display: none; }
+
+ .wpfp_custom_background { display: none; }
.wpfp_custom_popup { position: absolute; top: 10%; z-index: 20; text-align: center; width: 100%; color: #fff; }
.is-finished .wpfp_custom_background { display: block; }
.fv_player_popup { background: _get_option('backgroundColor') ?>; padding: 1% 5%; width: 65%; margin: 0 auto; }
@@ -885,7 +918,7 @@ public static function get_duration( $post_id, $video_src ) {
public static function get_duration_post( $post_id = false ) {
- global $post, $fv_fp;
+ global $post;
$post_id = ( $post_id ) ? $post_id : $post->ID;
$content = false;
@@ -1302,16 +1335,23 @@ function css_writeout_option() {
function popup_css( $css ){
- $aPopupData = get_option('fv_player_popups');
+ $aPopupData = get_option('fv_player_popups',array());
$sNewCss = '';
- if( is_array($aPopupData) ) {
- foreach($aPopupData as $key => $val){
- if( empty($val['css']) ){
- continue;
- }
- $sNewCss .= stripslashes($val['css'])."\n";
+ foreach($aPopupData as $key => $val){
+ if( empty($val['css']) ){
+ continue;
}
+ $sNewCss .= stripslashes($val['css'])."\n";
}
+
+ $aPopupData = get_option('fv_player_popups_css',array());
+ foreach($aPopupData as $key => $val){
+ if( empty($val['content']) ){
+ continue;
+ }
+ $sNewCss .= stripslashes($val['content'])."\n";
+ }
+
if( strlen($sNewCss) ){
$css .= "\n/*custom popup css*/\n".$sNewCss."/*end custom popup css*/\n";
}
@@ -1365,7 +1405,6 @@ function template_embed_buffer(){
if( get_query_var('fv_player_embed') ) {
ob_start();
- global $fvseo;
if( isset($_REQUEST['fv_player_preview']) ) {
global $fvseo;
if( isset($fvseo) ) remove_action('wp_footer', array($fvseo, 'script_footer_content'), 999999 );
@@ -1388,8 +1427,8 @@ function template_embed() {
?>
diff --git a/view/admin.php b/view/admin.php
index c5c16cbf7..6e3c9e935 100644
--- a/view/admin.php
+++ b/view/admin.php
@@ -681,38 +681,92 @@ function fv_flowplayer_admin_popups(){
array() );
} else {
$aPopupData = array( '#fv_popup_dummy_key#' => array() ) + $aPopupData ;
}
-
+
foreach ($aPopupData AS $key => $aPopup) {
+ $bShowLegacy = isset($aPopup['css_preset']) && $aPopup['css_preset'] === 'legacy' || empty($aPopup['css_preset']) && !empty($aPopup['css']);
+
+ if(isset($aPopup['css_preset']) && isset($aPopupCss[$aPopup['css_preset']])){
+ $aPopup['css_preset_content'] = $aPopupCss[$aPopup['css_preset']]['content'];
+ $aPopup['css_preset_name'] = $aPopupCss[$aPopup['css_preset']]['name'];
+ }
?>
+
+
+ |
+
+
+ />
+
+ |
+
@@ -727,27 +781,82 @@ function fv_flowplayer_admin_popups(){
-
- false,
- 'dropdown' => array( 'Default', 'On', 'Off' ),
+ 'dropdown' => array( array('','Default'), array('true','On'), array('false','Off') ),
'id' => false,
'label' => '',
'live' => true,
@@ -109,7 +108,7 @@ function fv_player_shortcode_row( $args ) {