Skip to content

Commit 29a0b69

Browse files
committed
fancybox frontend not working,changed tabs content
1 parent c50150b commit 29a0b69

File tree

5 files changed

+128
-21
lines changed

5 files changed

+128
-21
lines changed

admin.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ function mfbfw_options_page() {
2727
<li><a href="#fbfw-animations"><?php _e( 'Animations', 'mfbfw' ); ?></a></li>
2828
<li><a href="#fbfw-behaviour"><?php _e( 'Behaviour', 'mfbfw' ); ?></a></li>
2929
<li><a href="#fbfw-galleries"><?php _e( 'Galleries', 'mfbfw' ); ?></a></li>
30-
<li><a href="#fbfw-other"><?php _e( 'Miscellaneous', 'mfbfw' ); ?></a></li>
31-
<li><a href="#fbfw-calls"><?php _e( 'Extra Calls', 'mfbfw' ); ?></a></li>
32-
<li><a href="#fbfw-troubleshooting"><?php _e( 'Troubleshooting', 'mfbfw' ); ?></a></li>
30+
<li><a href="#fbfw-other"><?php _e( 'Misc.', 'mfbfw' ); ?></a></li>
31+
<!--<li><a href="#fbfw-calls"><?php _e( 'Extra Calls', 'mfbfw' ); ?></a></li>-->
32+
<!--<li><a href="#fbfw-troubleshooting"><?php _e( 'Troubleshooting', 'mfbfw' ); ?></a></li>-->
3333
<li><a href="#fbfw-support" style="color:green;"><?php _e( 'Support', 'mfbfw' ); ?></a></li>
34-
<li><a href="#fbfw-uninstall" style="color:red;"><?php _e( 'Uninstall', 'mfbfw' ); ?></a></li>
34+
<!--<li><a href="#fbfw-uninstall" style="color:red;"><?php _e( 'Uninstall', 'mfbfw' ); ?></a></li>-->
3535
</ul>
3636

3737
<div id="fbfw-info">
@@ -58,22 +58,22 @@ function mfbfw_options_page() {
5858
<?php require_once ( FBFW_PATH . 'lib/admin-tab-other.php' ); ?>
5959
</div>
6060

61-
<div id="fbfw-calls">
61+
<!--<div id="fbfw-calls">
6262
<?php require_once ( FBFW_PATH . 'lib/admin-tab-calls.php' ); ?>
6363
</div>
6464

6565
<div id="fbfw-troubleshooting">
6666
<?php require_once ( FBFW_PATH . 'lib/admin-tab-troubleshooting.php' ); ?>
67-
</div>
67+
</div>-->
6868

6969
<div id="fbfw-support">
7070
<?php require_once ( FBFW_PATH . 'lib/admin-tab-support.php' ); ?>
7171
</div>
72-
72+
<!--
7373
<div id="fbfw-uninstall">
7474
<?php require_once ( FBFW_PATH . 'lib/admin-tab-uninstall.php' ); ?>
7575
</div>
76-
76+
-->
7777
</div>
7878

7979
<p class="submit" style="text-align:center;">

assets/css/fancybox-admin.css

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,14 +280,17 @@ span.switch-text {
280280
#extraCallsBlock {
281281
width:80%;
282282
}
283-
.CodeMirror-code {
283+
/*.CodeMirror-code {
284284
margin-left:30px;
285-
}
286-
.CodeMirror-linenumber {
285+
}*/
286+
/*.CodeMirror-linenumber {
287287
left:-30px !important;
288-
}
289-
.CodeMirror-gutters {
288+
}*/
289+
/*.CodeMirror-gutters {
290290
left:0 !important;
291+
}*/
292+
#customExpressionBlock label {
293+
width:100%;
291294
}
292295
/*End extra calls block*
293296

assets/js/admin.js

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,31 @@ jQuery( function () {
4646
} );
4747

4848
//Function enable codemirror on FancyBox Extra Calls
49-
jQuery( 'textarea' ).each(function(){
50-
wp.codeEditor.initialize(jQuery(this));
51-
});
52-
49+
jQuery( '.nav-tab-wrapper > li' ).click( function () {
50+
var ariaControls = jQuery( this ).attr( 'aria-controls' );
51+
console.log( jQuery( '#' + ariaControls + ' textarea' ) );
52+
53+
jQuery( '#' + ariaControls + ' textarea' ).each( function () {
54+
var tArea = jQuery( this );
55+
console.log( tArea.parents( 'fieldset' ).children( 'input[type="checkbox"]:checked' ) );
56+
if ( tArea.parents( 'fieldset' ).children( 'input[type="checkbox"]:checked' ) ) {
57+
wp.codeEditor.initialize( tArea );
58+
}
59+
} );
60+
} );
61+
62+
jQuery( 'input[type="checkbox"]' ).click( function () {
63+
if ( jQuery( this ).is( ':checked' ) ) {
64+
var tArea = jQuery( this ).parent().find( 'textarea' );
65+
tArea.each( function () {
66+
wp.codeEditor.initialize( jQuery( this ) );
67+
} );
68+
}
69+
} );
70+
71+
5372
//add color picker to buttons
54-
jQuery('.color-btn').wpColorPicker();
73+
jQuery( '.color-btn' ).wpColorPicker();
5574
} );
5675

5776
jQuery( window ).load( function () {

fancybox.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function mfbfw_defaults() {
8585
'mouseWheel' => 'off',
8686
// Gallery Type
8787
'galleryType' => 'all',
88-
'customExpression' => 'jQuery(thumbnails).addClass("fancybox").attr("rel","fancybox").getTitle();',
88+
'customExpression' => 'jQuery(thumbnails).attr("data-fancybox","gallery").getTitle();',
8989
// Other
9090
'frameWidth' => '560',
9191
'frameHeight' => '340',
@@ -316,7 +316,7 @@ function mfbfw_init() {
316316
"onCancel": ' . ( isset( $mfbfw[ 'callbackEnable' ], $mfbfw[ 'callbackOnCancel' ] ) && $mfbfw[ 'callbackEnable' ] && $mfbfw[ 'callbackOnCancel' ] ? $mfbfw[ 'callbackOnCancel' ] . ',' : 'function() { },' ) . '
317317
"onCleanup": ' . ( isset( $mfbfw[ 'callbackEnable' ], $mfbfw[ 'callbackOnCleanup' ] ) && $mfbfw[ 'callbackEnable' ] && $mfbfw[ 'callbackOnCleanup' ] ? $mfbfw[ 'callbackOnCleanup' ] . ',' : 'function() { },' ) . '
318318
"onComplete": ' . ( isset( $mfbfw[ 'callbackEnable' ], $mfbfw[ 'callbackOnComplete' ] ) && $mfbfw[ 'callbackEnable' ] && $mfbfw[ 'callbackOnComplete' ] ? $mfbfw[ 'callbackOnComplete' ] . ',' : 'function() { },' ) . '
319-
"onClosed": ' . ( isset( $mfbfw[ 'callbackEnable' ], $mfbfw[ 'callbackOnClose' ] ) && $mfbfw[ 'callbackEnable' ] && $mfbfw[ 'callbackOnClose' ] ? $mfbfw[ 'callbackOnClose' ] . ',' : 'function() { }' ) . ',
319+
"onClosed": ' . ( isset( $mfbfw[ 'callbackEnable' ], $mfbfw[ 'callbackOnClose' ] ) && $mfbfw[ 'callbackEnable' ] && $mfbfw[ 'callbackOnClose' ] ? $mfbfw[ 'callbackOnClose' ] . ',' : 'function() { }' ) . '
320320
"infobar" : true,
321321
"toolbar":true,
322322
"preventCaptionOverlap": true,
@@ -408,7 +408,6 @@ function mfbfw_admin_scripts() {
408408
wp_enqueue_script( 'fancybox-admin', FBFW_URL . 'assets/js/admin.js', array( 'jquery', 'wp-color-picker' ), FBFW_VERSION ); // Load specific JS for Admin Page
409409

410410
/* Load codemirror editor */
411-
// Enqueue code editor and settings for manipulating Javascript.
412411
$settings = wp_enqueue_code_editor( array( 'type' => 'text/javascript' ) );
413412
}
414413

lib/admin-tab-other.php

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,90 @@
8484
</tr>
8585

8686
</tbody>
87+
</table>
88+
89+
<h3><?php _e( 'Extra FancyBox Calls <span style="color:red">(advanced)</span>', 'mfbfw' ); ?></h3>
90+
91+
<p><?php _e( 'Here you can add as many additional calls to fancybox as you want, with different settings. For example, if you want to use fancybox with iframes or ajax on any specific link, you can configure those calls here without affecting the settings for images.', 'mfbfw' ); ?></p>
92+
93+
<p><?php _e( 'For information on the options available you can use here see <a href="http://fancyapps.com/fancybox/3/">FancyBox\'s API & Options page</a>.', 'mfbfw' ); ?></p>
94+
95+
<table class="form-table fancy-table" style="clear:none;">
96+
<tbody>
97+
98+
<tr valign="top">
99+
<th scope="row"><?php _e( 'Additional FancyBox Calls', 'mfbfw' ); ?></th>
100+
<td>
101+
<fieldset>
102+
<input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[extraCallsEnable]" id="extraCallsEnable"<?php if ( isset( $settings[ 'extraCallsEnable' ] ) && $settings[ 'extraCallsEnable' ] ) echo ' checked="yes"'; ?> />
103+
<label for="extraCallsEnable" class="onoffswitch-label"></label>
104+
<span class="switch-text"><?php _e( 'Additional FancyBox Calls (default: off)', 'mfbfw' ); ?></span><div class="cf"></div><br /><br />
105+
106+
<div id="extraCallsBlock">
107+
108+
<label for="extraCalls">
109+
<textarea rows="20" cols="50" class="large-text code" name="mfbfw[extraCallsData]" wrap="physical" id="extraCalls"><?php echo ($settings[ 'extraCallsData' ]); ?></textarea>
110+
</label><br /><br />
111+
112+
<small><strong><em><?php _e( 'Example:', 'mfbfw' ); ?></em></strong></small><br />
113+
<small><em><code>
114+
jQuery("#login a").fancybox({<br />
115+
&nbsp;&nbsp;'transitionIn': 'elastic',<br />
116+
&nbsp;&nbsp;'speedIn': 600,<br />
117+
&nbsp;&nbsp;'speedOut': 200,<br />
118+
&nbsp;&nbsp;'type': 'iframe'<br />
119+
});
120+
</code></em></small><br /><br />
121+
</div>
122+
123+
</fieldset>
124+
</td>
125+
</tr>
126+
127+
</tbody>
128+
</table>
129+
130+
<h3><?php _e( 'Troubleshooting Settings', 'mfbfw' ); ?></h3>
131+
132+
<p><span style="font-weight:bold;color:red;"><?php _e( 'Settings in this section should only be changed if you are having problems with the plugin!', 'mfbfw' ); ?></span></p>
133+
134+
<p><?php _e( 'If the plugin doesn\'t seem to work, first you should check for other plugins that may be conflicting with this one, especially other Lightbox, Slimbox, etc. Make sure all your plugins and WordPress itself are up to date (this plugin has only been tested in WordPress 2.7 and above).', 'mfbfw' ); ?></p>
135+
136+
<p><?php _e( 'Change them one at a time and test to see if they help. Remember that having a cache plugin may prevent changes from taking effect immidiately, so clear cache after saving changes here or deactivate cache until you finish editing these options.', 'mfbfw' ); ?></p><br />
137+
138+
<table class="form-table fancy-table" style="clear:none;">
139+
<tbody>
140+
141+
<tr valign="top">
142+
<th scope="row"><?php _e( 'Do not call jQuery', 'mfbfw' ); ?></th>
143+
<td>
144+
<fieldset>
145+
<input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[nojQuery]" id="nojQuery"<?php if ( isset( $settings[ 'nojQuery' ] ) && $settings[ 'nojQuery' ] ) echo ' checked="yes"'; ?> />
146+
<label for="nojQuery" class="onoffswitch-label"></label>
147+
<span class="switch-text"><?php _e( 'Skip jQuery call. Use this only if jQuery is being loaded twice (default: off)', 'mfbfw' ); ?></span><div class="cf"></div><br />
148+
149+
</fieldset>
150+
</td>
151+
</tr>
152+
153+
</tbody>
154+
</table>
155+
156+
<h3><?php _e( 'Uninstall', 'mfbfw' ); ?></h3>
157+
158+
<p><?php _e( 'Like many other plugins, FancyBox for WordPress stores its settings on your WordPress\' options database table. Actually, these settings are not using more than a couple of kilobytes of space, but if you want to completely uninstall this plugin, check the option below, then save changes, and <strong>when you deactivate the plugin</strong>, all its settings will be removed from the database.', 'mfbfw' ); ?></p>
159+
160+
<table class="form-table fancy-table" style="clear:none;">
161+
<tbody>
162+
<tr valign="top">
163+
<th scope="row"><?php _e( 'Remove settings', 'mfbfw' ); ?></th>
164+
<td>
165+
<fieldset>
166+
<input type="checkbox" class="onoffswitch-checkbox" name="mfbfw[uninstall]" id="uninstall"<?php if ( isset( $settings[ 'uninstall' ] ) && $settings[ 'uninstall' ] ) echo ' checked="yes"'; ?> />
167+
<label for="uninstall" class="onoffswitch-label"></label>
168+
<span class="switch-text"><?php _e( 'Remove Settings when plugin is deactivated from the "Manage Plugins" page. (default: off)', 'mfbfw' ); ?></span><div class="cf"></div><br /><br />
169+
</fieldset>
170+
</td>
171+
</tr>
172+
</tbody>
87173
</table>

0 commit comments

Comments
 (0)