Skip to content

Commit a3e7d42

Browse files
committed
feedback update
removed commented lines updated admin css updated field names
1 parent c760eb0 commit a3e7d42

14 files changed

+212
-448
lines changed

assets/css/fancybox-admin.css

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
display: block;
9696
}
9797

98-
#fbfwTabs .inlined>div {
98+
#fbfwTabs .inlined>div:not(.cf) {
9999
display: inline-block;
100100
width: 50%;
101101
vertical-align: middle;
@@ -265,7 +265,14 @@ input[type="checkbox"]:checked + .onoffswitch-label:before {
265265
font-size: 11px;
266266
font-family: 'Arial';
267267
}
268-
268+
label.onoffswitch-label, span.switch-text {
269+
float:left;
270+
display:inline-block;
271+
}
272+
span.switch-text {
273+
margin-left:25px;
274+
padding:5px;
275+
}
269276

270277
/*End checkbox onf offswitch design*/
271278

@@ -282,4 +289,42 @@ input[type="checkbox"]:checked + .onoffswitch-label:before {
282289
.CodeMirror-gutters {
283290
left:0 !important;
284291
}
285-
/*End extra calls block*/
292+
/*End extra calls block*
293+
294+
/* Tabs design */
295+
#fbfwTabs .ui-tabs-panel h3 {
296+
margin-top:0px;
297+
}
298+
#fbfwTabs.ui-tabs .ui-tabs-panel {
299+
padding-left:0px !important;
300+
padding-right:0px !important;
301+
}
302+
/* End Tabs design */
303+
304+
/* Callbacks design */
305+
#callbackBlock label {
306+
width:100%;
307+
}
308+
#callbackBlock .CodeMirror-wrap pre {
309+
margin-left:15px;
310+
}
311+
312+
/*Clearfix Hack*/
313+
.cf:before,
314+
.cf:after {
315+
content: " "; /* 1 */
316+
display: table; /* 2 */
317+
}
318+
319+
.cf:after {
320+
clear: both;
321+
}
322+
323+
/**
324+
* For IE 6/7 only
325+
* Include this rule to trigger hasLayout and contain floats.
326+
*/
327+
.cf {
328+
*zoom: 1;
329+
width:100%;
330+
}

assets/js/admin.js

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,33 +38,23 @@ jQuery( function () {
3838
switchBlock( "#extraCallsBlock", "#extraCallsEnable" );
3939
switchBlock( "#easingBlock", "#easing" );
4040

41-
42-
//Modified
43-
//Razvan Test Function enable codemirror on FancyBox Extra Calls
4441
jQuery( document ).ready( function () {
45-
4642
jQuery( ".slider-horizontal" ).each( function () {
4743
var mySl = jQuery( this );
4844
var defaultState = mySl.prev( 'input' ).val();
4945
mySl.attr( 'defSl', defaultState );
5046
} );
5147

52-
//modified by Razvan
53-
var textArea = document.getElementById( 'extraCalls' );
54-
wp.codeEditor.initialize(textArea);
55-
// if ( jQuery( '.CodeMirror' ).length ) {
56-
//
57-
// } else {
58-
// CodeMirror.fromTextArea( textArea );
59-
//
60-
// }
61-
//jQuery( 'input[type="color"]' ).wpColorPicker();
48+
//Function enable codemirror on FancyBox Extra Calls
49+
jQuery( 'textarea' ).each(function(){
50+
wp.codeEditor.initialize(jQuery(this));
51+
});
52+
53+
//add color picker to buttons
6254
jQuery('.color-btn').wpColorPicker();
6355
} );
6456

6557
jQuery( window ).load( function () {
66-
//jQuery( '.CodeMirror' ).addClass( 'CodeMirror-focused' );
67-
//
6858
//function to initiate horizontal slider from jQuery UI
6959
jQuery( ".slider-horizontal" ).each( function () {
7060
var mySl = jQuery( this );

fancybox.php

Lines changed: 29 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
/*
44
Plugin Name: FancyBox for WordPress
55
Plugin URI: http://plugins.josepardilla.com/fancybox-for-wordpress/
6-
Description: Integrates <a href="http://fancybox.net/">FancyBox</a> by <a href="http://klade.lv/">Janis Skarnelis</a> into WordPress.
7-
Version: 3.0.2
6+
Description: Integrates <a href="http://fancyapps.com/fancybox/3/">FancyBox</a> by <a href="http://klade.lv/">Janis Skarnelis</a> into WordPress.
7+
Version: 3.0.14
88
Author: Jos&eacute; Pardilla
99
Author URI: http://josepardilla.com/
1010
@@ -21,7 +21,7 @@
2121
* Plugin Init
2222
*/
2323
// Constants
24-
define( 'FBFW_VERSION', '3.0.2' );
24+
define( 'FBFW_VERSION', '3.0.14' );
2525
define( 'FBFW_PATH', plugin_dir_path( __FILE__ ) );
2626
define( 'FBFW_URL', plugin_dir_url( __FILE__ ) );
2727

@@ -57,42 +57,32 @@ function mfbfw_defaults() {
5757
// Appearance
5858
'border' => '',
5959
'borderColor' => '#BBBBBB',
60-
'borderRadius' => '5',
61-
'borderRadiusInner' => '0',
6260
'showCloseButton' => 'on',
63-
'closeHorPos' => 'right',
64-
'closeVerPos' => 'top',
6561
'paddingColor' => '#FFFFFF',
6662
'padding' => '15',
6763
'overlayShow' => 'on',
6864
'overlayColor' => '#000000',
6965
'overlayOpacity' => '0.7',
70-
'shadowOpacity' => '0.5',
71-
'shadowSize' => '25',
72-
'shadowOffset' => '10',
7366
'titleShow' => 'on',
7467
'titlePosition' => 'inside',
7568
'titleColor' => '#333333',
76-
'arrows' => 'on',
69+
'showNavArrows' => 'on',
70+
'titleSize' => '14',
71+
'showCloseButton' => 'true',
7772
// Animations
7873
'zoomOpacity' => 'on',
7974
'zoomSpeedIn' => '500',
80-
'zoomSpeedOut' => '500',
81-
'animationDuration' => '500',
82-
'transitionDuration' => '500',
83-
'animationEffect' => 'fade',
75+
'zoomSpeedChange' => '300',
76+
'transitionIn' => 'fade',
8477
'transitionEffect' => 'fade',
85-
'transitionOut' => 'fade',
8678
// Behaviour
87-
'imageScale' => 'on',
88-
'centerOnScroll' => 'on',
89-
'clickContent' => 'function(current, event) {
90-
return current.type === "image" ? "close" : false;
91-
},',
92-
'clickSlide' => 'on',
93-
'keyboard' => 'on',
94-
'loop' => 'on',
95-
'wheel' => 'off',
79+
'hideOnOverlayClick' => 'function(current, event) {
80+
return current.type === "image" ? "close" : false;
81+
},',
82+
'hideOnContentClick' => 'on',
83+
'enableEscapeButton' => 'on',
84+
'cyclic' => 'on',
85+
'mouseWheel' => 'off',
9686
// Gallery Type
9787
'galleryType' => 'all',
9888
'customExpression' => 'jQuery(thumbnails).addClass("fancybox").attr("rel","fancybox").getTitle();',
@@ -139,7 +129,7 @@ function mfbfw_deactivate() {
139129
register_deactivation_hook( __FILE__, 'mfbfw_deactivate' );
140130

141131
/**
142-
* Load FancyBox JS with jQuery and jQuery.easing & jquery.mousewheel if necessary
132+
* Load FancyBox JS with jQuery and
143133
*/
144134
function mfbfw_enqueue_scripts() {
145135

@@ -161,8 +151,6 @@ function mfbfw_enqueue_scripts() {
161151

162152
// Register Scripts
163153
wp_register_script( 'fancybox', FBFW_URL . 'assets/js/jquery.fancybox.js', $jquery, '1.3.4', $footer ); // Main Fancybox script
164-
wp_register_script( 'jqueryeasing', FBFW_URL . 'assets/js/jquery.easing.1.3.min.js', $jquery, '1.3', $footer ); // Easing animations script
165-
wp_register_script( 'jquerymousewheel', FBFW_URL . 'assets/js/jquery.mousewheel.3.0.4.pack.js', $jquery, '3.0.4', $footer ); // Mouse wheel support script
166154
// Enqueue Scripts
167155
wp_enqueue_script( 'fancybox' ); // Load fancybox
168156

@@ -194,19 +182,6 @@ function mfbfw_init() {
194182

195183
global $mfbfw, $mfbfw_version;
196184

197-
//baseTpl testing for title
198-
$baseTpl = '<div class=\'fancybox-container\' role=\'dialog\' tabindex=\'-1\'> " +
199-
"<div class=\'fancybox-bg\'></div>"+
200-
"<div class=\'fancybox-inner\'>"+
201-
"<div class=\'fancybox-infobar\'><span data-fancybox-index></span>&nbsp;/&nbsp;<span data-fancybox-count></span></div>"+
202-
"<div class=\'fancybox-toolbar\'>{{buttons}}</div>"+
203-
"<div class=\'fancybox-navigation\'>{{arrows}}</div>"+
204-
"<div class=\'fancybox-stage\'></div>"+
205-
"<div class=\'fancybox-title\'></div>"+
206-
"<div class=\'fancybox-caption\'></div>"+
207-
"</div>"+
208-
"</div>';
209-
210185
//caption function to display image title
211186
$caption = 'function( instance, item ) {' .
212187
'var testing = jQuery(this).context.title;' .
@@ -251,7 +226,7 @@ function mfbfw_init() {
251226
' . ( isset( $mfbfw[ 'titleShow' ] ) ? 'div.fancybox-caption p.caption-title{display:block}' : 'div.fancybox-caption p.caption-title{display:none}' ) . '
252227
' . ( isset( $mfbfw[ 'titleSize' ] ) ? 'div.fancybox-caption p.caption-title{font-size:' . $mfbfw[ 'titleSize' ] . 'px}' : 'div.fancybox-caption p.caption-title{font-size:14px}' ) . '
253228
' . ( isset( $mfbfw[ 'titleColor' ] ) ? 'div.fancybox-caption p.caption-title{color:' . $mfbfw[ 'titleColor' ] . '}' : 'div.fancybox-caption p.caption-title{color:#333333}' ) . '
254-
' . ( isset( $mfbfw[ 'titlePosition' ] ) ? 'div.fancybox-caption {color:' . $mfbfw[ 'titleColor' ] . '}' : 'div.fancybox-caption p.caption-title{color:#333333}' ) . $captionPosition.'
229+
' . ( isset( $mfbfw[ 'titlePosition' ] ) ? 'div.fancybox-caption {color:' . $mfbfw[ 'titleColor' ] . '}' : 'div.fancybox-caption p.caption-title{color:#333333}' ) . $captionPosition . '
255230
</style>';
256231

257232
echo '
@@ -264,6 +239,7 @@ function mfbfw_init() {
264239
265240
// Supported file extensions
266241
var thumbnails = jQuery("a:has(img)").not(".nolightbox, .nofancybox, a:has(img.nolightbox, img.nofancybox)").filter( function() { return /\.(jpe?g|png|gif|bmp)$/i.test(jQuery(this).attr("href")) });
242+
console.log(thumbnails);
267243
';
268244
if ( $mfbfw[ 'galleryType' ] == 'post' ) {
269245

@@ -315,36 +291,32 @@ function mfbfw_init() {
315291
// Call fancybox and apply it on any link with a rel atribute that starts with "fancybox", with the options set on the admin panel
316292
echo '
317293
jQuery("a[data-fancybox]").fancybox({
318-
"loop": ' . ( isset( $mfbfw[ 'loop' ] ) && $mfbfw[ 'loop' ] ? 'true' : 'false' ) . ',
319-
"animationEffect": "zoom",
294+
"loop": ' . ( isset( $mfbfw[ 'cyclic' ] ) && $mfbfw[ 'cyclic' ] ? 'true' : 'false' ) . ',
295+
"smallBtn": ' . ( isset( $mfbfw[ 'showCloseButton' ] ) && $mfbfw[ 'showCloseButton' ] ? 'true' : 'false' ) . ',
320296
"padding": ' . $mfbfw[ 'padding' ] . ',
321297
"opacity": ' . ( isset( $mfbfw[ 'zoomOpacity' ] ) && $mfbfw[ 'zoomOpacity' ] ? 'true' : 'false' ) . ',
322-
"animationEffect": "' . $mfbfw[ 'animationEffect' ] . '",
323-
"animationDuration": ' . $mfbfw[ 'animationDuration' ] . ',
298+
"animationEffect": "' . $mfbfw[ 'transitionIn' ] . '",
299+
"animationDuration": ' . $mfbfw[ 'zoomSpeedChange' ] . ',
324300
"transitionEffect": "' . $mfbfw[ 'transitionEffect' ] . '",
325301
"overlayShow": ' . ( isset( $mfbfw[ 'overlayShow' ] ) && $mfbfw[ 'overlayShow' ] ? 'true' : 'false' ) . ',
326302
"overlayOpacity": "' . $mfbfw[ 'overlayOpacity' ] . '",
327303
"titleShow": ' . ( isset( $mfbfw[ 'titleShow' ] ) && $mfbfw[ 'titleShow' ] ? 'true' : 'false' ) . ',
328304
"titlePosition": "' . $mfbfw[ 'titlePosition' ] . '",
329-
"keyboard": ' . ( isset( $mfbfw[ 'keyboard' ] ) && $mfbfw[ 'keyboard' ] ? 'true' : 'false' ) . ',
305+
"keyboard": ' . ( isset( $mfbfw[ 'enableEscapeButton' ] ) && $mfbfw[ 'enableEscapeButton' ] ? 'true' : 'false' ) . ',
330306
"showCloseButton": ' . ( isset( $mfbfw[ 'showCloseButton' ] ) && $mfbfw[ 'showCloseButton' ] ? 'true' : 'false' ) . ',
331-
"arrows": ' . ( isset( $mfbfw[ 'arrows' ] ) && $mfbfw[ 'arrows' ] ? 'true' : 'false' ) . ',
332-
"clickSlide": ' . ( isset( $mfbfw[ 'clickSlide' ] ) && $mfbfw[ 'clickSlide' ] ? '"close"' : 'false' ) . ',
333-
"clickContent": ' . ( isset( $mfbfw[ 'clickContent' ] ) && $mfbfw[ 'clickContent' ] ? 'function(current, event) {
307+
"arrows": ' . ( isset( $mfbfw[ 'showNavArrows' ] ) && $mfbfw[ 'showNavArrows' ] ? 'true' : 'false' ) . ',
308+
"clickSlide": ' . ( isset( $mfbfw[ 'hideOnContentClick' ] ) && $mfbfw[ 'hideOnContentClick' ] ? '"close"' : 'false' ) . ',
309+
"clickContent": ' . ( isset( $mfbfw[ 'hideOnOverlayClick' ] ) && $mfbfw[ 'hideOnOverlayClick' ] ? 'function(current, event) {
334310
return current.type === "image" ? "close" : false;
335311
}' : 'false' ) . ',
336-
"wheel": ' . ( isset( $mfbfw[ 'wheel' ] ) && $mfbfw[ 'wheel' ] ? 'true' : 'false' ) . ',
312+
"wheel": ' . ( isset( $mfbfw[ 'mouseWheel' ] ) && $mfbfw[ 'mouseWheel' ] ? 'true' : 'false' ) . ',
337313
"width": ' . $mfbfw[ 'frameWidth' ] . ',
338314
"height": ' . $mfbfw[ 'frameHeight' ] . ',
339315
"onStart": ' . ( isset( $mfbfw[ 'callbackEnable' ], $mfbfw[ 'callbackOnStart' ] ) && $mfbfw[ 'callbackEnable' ] && $mfbfw[ 'callbackOnStart' ] ? $mfbfw[ 'callbackOnStart' ] . ',' : 'function() { },' ) . '
340316
"onCancel": ' . ( isset( $mfbfw[ 'callbackEnable' ], $mfbfw[ 'callbackOnCancel' ] ) && $mfbfw[ 'callbackEnable' ] && $mfbfw[ 'callbackOnCancel' ] ? $mfbfw[ 'callbackOnCancel' ] . ',' : 'function() { },' ) . '
341317
"onCleanup": ' . ( isset( $mfbfw[ 'callbackEnable' ], $mfbfw[ 'callbackOnCleanup' ] ) && $mfbfw[ 'callbackEnable' ] && $mfbfw[ 'callbackOnCleanup' ] ? $mfbfw[ 'callbackOnCleanup' ] . ',' : 'function() { },' ) . '
342318
"onComplete": ' . ( isset( $mfbfw[ 'callbackEnable' ], $mfbfw[ 'callbackOnComplete' ] ) && $mfbfw[ 'callbackEnable' ] && $mfbfw[ 'callbackOnComplete' ] ? $mfbfw[ 'callbackOnComplete' ] . ',' : 'function() { },' ) . '
343-
"onClosed": ' . ( isset( $mfbfw[ 'callbackEnable' ], $mfbfw[ 'callbackOnClose' ] ) && $mfbfw[ 'callbackEnable' ] && $mfbfw[ 'callbackOnClose' ] ? $mfbfw[ 'callbackOnClose' ] . ',' : 'function() { },' ) . '
344-
"centerOnScroll": ' . ( isset( $mfbfw[ 'centerOnScroll' ] ) && $mfbfw[ 'centerOnScroll' ] ? 'true' : 'false ' ) . ( isset( $mfbfw[ 'easing' ] ) && $mfbfw[ 'easing' ] ? ',
345-
"easingIn": "' . $mfbfw[ 'easingIn' ] . '",
346-
"easingOut": "' . $mfbfw[ 'easingOut' ] . '",
347-
"easingChange": "' . $mfbfw[ 'easingChange' ] . '"' : '' ) . ',
319+
"onClosed": ' . ( isset( $mfbfw[ 'callbackEnable' ], $mfbfw[ 'callbackOnClose' ] ) && $mfbfw[ 'callbackEnable' ] && $mfbfw[ 'callbackOnClose' ] ? $mfbfw[ 'callbackOnClose' ] . ',' : 'function() { }' ) . ',
348320
"infobar" : true,
349321
"toolbar":true,
350322
"preventCaptionOverlap": true,
@@ -465,14 +437,12 @@ function mfbfw_plugin_action_links( $links,
465437
* Transform from Hex to rgb or rgba
466438
*/
467439

468-
function hexTorgba( $hexColor,
469-
$opacity ) {
440+
function hexTorgba( $hexColor,$opacity ) {
470441
list($r, $g, $b) = sscanf( $hexColor, "#%02x%02x%02x" );
471442
if ( $opacity ) {
472443
$rgb = 'rgba(' . $r . ',' . $g . ',' . $b . ',' . $opacity . ')';
473444
} else {
474445
$rgb = 'rgba(' . $r . ',' . $g . ',' . $b . ')';
475446
}
476-
477447
return $rgb;
478448
}

lib/admin-head.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,4 @@
1414
$transitionTypeArray = array( 'fade', 'zoom', 'none' );
1515
$overlayArray = array( 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1 );
1616
$msArray = array( 0, 25, 50, 75, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1250, 1500, 1750, 2000 );
17-
$slideEffectArray = array('fade','slide','circular','tube','zoom-in-out','rotate');
18-
$easingArray = array( 'easeInQuad', 'easeOutQuad', 'easeInOutQuad', 'easeInCubic', 'easeOutCubic', 'easeInOutCubic', 'easeInQuart', 'easeOutQuart',
19-
'easeInOutQuart', 'easeInQuint', 'easeOutQuint', 'easeInOutQuint', 'easeInSine', 'easeOutSine', 'easeInOutSine', 'easeInExpo',
20-
'easeOutExpo', 'easeInOutExpo', 'easeInCirc', 'easeOutCirc', 'easeInOutCirc', 'easeInElastic', 'easeOutElastic', 'easeInOutElastic',
21-
'easeInBack', 'easeOutBack', 'easeInOutBack', 'easeInBounce', 'easeOutBounce', 'easeInOutBounce' );
17+
$slideEffectArray = array('false','fade','slide','circular','tube','zoom-in-out','rotate');

0 commit comments

Comments
 (0)