Skip to content

Commit 93c875b

Browse files
Merge pull request #103 from WPChill/master
3.3.4 update and general branch update
2 parents f66cf3c + 3ca743e commit 93c875b

17 files changed

+1022
-864
lines changed

Gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ module.exports = function(grunt) {
9393
build: {
9494
options: {
9595
pretty: true, // Pretty print file sizes when logging.
96-
archive: '<%= pkg.name %>.zip'
96+
archive: '<%= pkg.name %>-<%= pkg.version %>.zip'
9797
},
9898
expand: true,
9999
cwd: 'build/',

admin.php

Lines changed: 7 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function mfbfw_options_page() {
99
<div id="icon-plugins" class="icon32"></div>
1010
<div class="inlined">
1111
<div id="pluginDescription">
12-
<h1><?php printf( __( 'Fancybox for WordPress (version %s)', 'mfbfw' ), FBFW_VERSION ); ?></h1>
12+
<h1><?php printf( esc_html__( 'Fancybox for WordPress (version %s)', 'mfbfw' ), esc_html( FBFW_VERSION ) ); ?></h1>
1313
<p class="about-text">Seamlessly integrates FancyBox into your blog: Upload, activate, and you’re done. Additional configuration optional.</p>
1414
</div>
1515
</div>
@@ -22,12 +22,12 @@ function mfbfw_options_page() {
2222

2323
<div id="fbfwTabs">
2424
<ul class="nav-tab-wrapper wp-clearfix">
25-
<li><a href="#fbfw-appearance"><?php _e( 'Appearance', 'mfbfw' ); ?></a></li>
26-
<li><a href="#fbfw-animations"><?php _e( 'Animations', 'mfbfw' ); ?></a></li>
27-
<li><a href="#fbfw-behaviour"><?php _e( 'Behaviour', 'mfbfw' ); ?></a></li>
28-
<li><a href="#fbfw-galleries"><?php _e( 'Galleries', 'mfbfw' ); ?></a></li>
29-
<li><a href="#fbfw-other"><?php _e( 'Misc.', 'mfbfw' ); ?></a></li>
30-
<li><a href="#fbfw-support" style="color:green;"><?php _e( 'Support', 'mfbfw' ); ?></a></li>
25+
<li><a href="#fbfw-appearance"><?php esc_html_e( 'Appearance', 'mfbfw' ); ?></a></li>
26+
<li><a href="#fbfw-animations"><?php esc_html_e( 'Animations', 'mfbfw' ); ?></a></li>
27+
<li><a href="#fbfw-behaviour"><?php esc_html_e( 'Behaviour', 'mfbfw' ); ?></a></li>
28+
<li><a href="#fbfw-galleries"><?php esc_html_e( 'Galleries', 'mfbfw' ); ?></a></li>
29+
<li><a href="#fbfw-other"><?php esc_html_e( 'Misc.', 'mfbfw' ); ?></a></li>
30+
<li><a href="#fbfw-support" style="color:green;"><?php esc_html_e( 'Support', 'mfbfw' ); ?></a></li>
3131
</ul>
3232

3333
<div id="fbfw-appearance">
@@ -79,70 +79,6 @@ class="button-secondary" value="<?php esc_attr_e( 'Revert to defaults', 'mfbfw'
7979
</div>
8080

8181
</div>
82-
83-
<div class="modula-wrap">
84-
<a target="_blank" href="http://wp-modula.com/?utm_source=fancybox-for-wp&utm_medium=options-page&utm_campaign=Modula%20Lite" class="modula-link">
85-
<img src="<?php echo FBFW_URL; ?>assets/images/modula-300x300.jpg"/>
86-
<h2>Easy Image Gallery for WP</h2>
87-
<p>Modula is creative! Modula is dynamic! Modula doesn’t always look the same. Just have fun with it! Modula uses a new concept to build its internal grid. The result is a dynamic, creative, interesting and attractive gallery.</p>
88-
89-
<?php
90-
91-
$plugin_slug = 'modula-best-grid-gallery';
92-
$plugin_path = 'modula-best-grid-gallery/Modula.php';
93-
94-
$installed = false;
95-
$activated = false;
96-
if ( file_exists( ABSPATH . 'wp-content/plugins/' . $plugin_slug ) ) {
97-
$installed = true;
98-
}
99-
100-
if ( file_exists( ABSPATH . 'wp-content/plugins/' . $plugin_path ) ) {
101-
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
102-
if ( is_plugin_active( $plugin_path ) ) {
103-
$activated = true;
104-
}
105-
}
106-
107-
if ( ! $activated ) {
108-
109-
if ( ! $installed ) {
110-
$label = esc_html__( 'Install & Activate Modula', 'mfbfw' );
111-
$link = wp_nonce_url(
112-
add_query_arg(
113-
array(
114-
'action' => 'install-plugin',
115-
'plugin' => $plugin_slug,
116-
),
117-
network_admin_url( 'update.php' )
118-
),
119-
'install-plugin_' . $plugin_slug
120-
);
121-
$action = 'install';
122-
}else{
123-
$label = esc_html__( 'Activate Modula', 'mfbfw' );
124-
$link = add_query_arg(
125-
array(
126-
'action' => 'activate',
127-
'plugin' => rawurlencode( $plugin_path ),
128-
'plugin_status' => 'all',
129-
'paged' => '1',
130-
'_wpnonce' => wp_create_nonce( 'activate-plugin_' . $plugin_path ),
131-
),
132-
admin_url( 'plugins.php' )
133-
);
134-
$action = 'activate';
135-
}
136-
137-
echo '<a href="' . esc_url( $link ) . '" class="mfbfw-modula-link button button-primary button-large" data-action="' . esc_attr( $action ) . '">' . esc_html( $label ) . '</a>';
138-
139-
}
140-
141-
?>
142-
143-
</a>
144-
</div>
145-
14682

14783
<?php
14884
}

assets/css/fancybox-admin.css

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@
4343
border: none
4444
}
4545

46+
#fbfwTabs th {
47+
min-width:250px;
48+
}
49+
4650
#fbfwTabs .ui-tabs-nav {
4751
background: 0 0;
4852
border: 0;
@@ -267,20 +271,6 @@ tr.spacer {
267271
float:left;
268272
}
269273

270-
.modula-wrap {
271-
float: left;
272-
max-width: 20%;
273-
padding-top: 32px;
274-
}
275-
276-
a.modula-link {
277-
color:#000;
278-
text-decoration: none;
279-
}
280-
a.modula-link:hover {
281-
text-decoration: none;
282-
}
283-
284274
.cf:after,
285275
.cf:before {
286276
content: " ";

assets/css/fancybox.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -901,3 +901,7 @@ body.compensate-for-scrollbar {
901901
max-width: calc(100% - 10px);
902902
}
903903
}
904+
905+
.fancybox-content {
906+
height: auto!important;
907+
}

assets/js/admin.js

Lines changed: 36 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jQuery(function () {
1212
jQuery(block).css("display", "none");
1313
}
1414

15-
jQuery(button).click(function () {
15+
jQuery(button).on('click', function () {
1616
jQuery(block).animate({
1717
opacity: "toggle",
1818
height: "toggle"
@@ -30,47 +30,39 @@ jQuery(function () {
3030
switchBlock("#extraCallsBlock", "#extraCallsEnable");
3131
switchBlock("#easingBlock", "#easing");
3232

33-
jQuery(document).ready(function () {
34-
jQuery(".slider-horizontal").each(function () {
35-
var mySl = jQuery(this);
36-
var defaultState = mySl.prev('input').val();
37-
mySl.attr('defSl', defaultState);
38-
});
39-
40-
41-
42-
43-
//Function enable codemirror on FancyBox Extra Calls
44-
45-
jQuery('.start-editing').click(function () {
46-
wp.codeEditor.initialize(jQuery(this).next("textarea"));
47-
jQuery(this).hide();
48-
});
49-
33+
jQuery(".slider-horizontal").each(function () {
34+
var mySl = jQuery(this);
35+
var defaultState = mySl.prev('input').val();
36+
mySl.attr('defSl', defaultState);
37+
});
5038

51-
//add color picker to buttons
52-
jQuery('.color-btn').wpColorPicker();
39+
//Function enable codemirror on FancyBox Extra Calls
40+
jQuery('.start-editing').on('click', function () {
41+
wp.codeEditor.initialize(jQuery(this).next("textarea"));
42+
jQuery(this).hide();
5343
});
5444

55-
jQuery(window).load(function () {
56-
//function to initiate horizontal slider from jQuery UI
57-
jQuery(".slider-horizontal").each(function () {
58-
var mySl = jQuery(this);
59-
var minSl = parseFloat(mySl.attr("minSl"));
60-
var maxSl = parseFloat(mySl.attr("maxSl"));
61-
var defSl = parseFloat(mySl.attr("defSl"));
62-
var stepSl = parseFloat(mySl.attr("stepSl"));
63-
jQuery(this).slider({
64-
orientation: "horizontal",
65-
range: "min",
66-
min: minSl,
67-
max: maxSl,
68-
value: defSl,
69-
step: stepSl,
70-
slide: function (event, ui) {
71-
mySl.prev("input").val(ui.value);
72-
}
73-
});
45+
46+
//add color picker to buttons
47+
jQuery('.color-btn').wpColorPicker();
48+
49+
//function to initiate horizontal slider from jQuery UI
50+
jQuery(".slider-horizontal").each(function () {
51+
var mySl = jQuery(this);
52+
var minSl = parseFloat(mySl.attr("minSl"));
53+
var maxSl = parseFloat(mySl.attr("maxSl"));
54+
var defSl = parseFloat(mySl.attr("defSl"));
55+
var stepSl = parseFloat(mySl.attr("stepSl"));
56+
jQuery(this).slider({
57+
orientation: "horizontal",
58+
range: "min",
59+
min: minSl,
60+
max: maxSl,
61+
value: defSl,
62+
step: stepSl,
63+
slide: function (event, ui) {
64+
mySl.prev("input").val(ui.value);
65+
}
7466
});
7567
});
7668

@@ -84,11 +76,11 @@ jQuery(function () {
8476
jQuery("#titleColorBlock").css("display", "none");
8577
}
8678

87-
jQuery("#titlePositionFloat, #titlePositionOutside, #titlePositionOver").click(function () {
79+
jQuery("#titlePositionFloat, #titlePositionOutside, #titlePositionOver").on('click', function () {
8880
jQuery("#titleColorBlock").hide("slow");
8981
});
9082

91-
jQuery("#titlePositionInside").click(function () {
83+
jQuery("#titlePositionInside").on('click', function () {
9284
jQuery("#titleColorBlock").show("slow");
9385
});
9486

@@ -104,11 +96,11 @@ jQuery(function () {
10496
jQuery("#customExpressionBlock").css("display", "none");
10597
}
10698

107-
jQuery("#galleryTypeAll, #galleryTypeNone, #galleryTypePost, #galleryTypeGutenbergBlock").click(function () {
99+
jQuery("#galleryTypeAll, #galleryTypeNone, #galleryTypePost, #galleryTypeGutenbergBlock").on('click', function () {
108100
jQuery("#customExpressionBlock").hide("slow");
109101
});
110102

111-
jQuery("#galleryTypeCustom").click(function () {
103+
jQuery("#galleryTypeCustom").on('click', function () {
112104
jQuery("#customExpressionBlock").show("slow");
113105
});
114106

@@ -133,42 +125,4 @@ function activatePlugin( url ) {
133125
location.reload();
134126
}
135127
} );
136-
}
137-
138-
jQuery( '.mfbfw-modula-link' ).click(function(evt){
139-
evt.preventDefault();
140-
141-
var action = jQuery( this ).data( 'action' ),
142-
link = jQuery( this ).attr( 'href' );
143-
144-
jQuery(this).addClass( 'updating-message' );
145-
jQuery(this).attr( 'disabled', 'disabled' );
146-
147-
if ( 'install' == action ) {
148-
wp.updates.installPlugin( { slug: 'modula-best-grid-gallery' } );
149-
}else{
150-
activatePlugin( link );
151-
}
152-
153-
});
154-
155-
jQuery( document ).on( 'wp-plugin-install-success', function( response, data ) {
156-
157-
if ( 'modula-best-grid-gallery' == data.slug ) {
158-
159-
jQuery.ajax( {
160-
type: 'POST',
161-
data: { action: 'mfbfw_activate_link' },
162-
dataType: 'json',
163-
url: ajaxurl,
164-
success: function( json ) {
165-
if ( json.status ) {
166-
activatePlugin( json.link );
167-
}
168-
}
169-
});
170-
171-
}
172-
console.log( response );
173-
console.log( data );
174-
});
128+
}

0 commit comments

Comments
 (0)