Skip to content

Commit

Permalink
Merge pull request #798 from gravityview/develop
Browse files Browse the repository at this point in the history
Version 1.19
  • Loading branch information
zackkatz authored Nov 14, 2016
2 parents 2ddace7 + 2bf2959 commit f4e16fe
Show file tree
Hide file tree
Showing 159 changed files with 9,639 additions and 5,246 deletions.
40 changes: 28 additions & 12 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
/.gitattributes export-ignore
/.gitignore export-ignore
/.gitmodules export-ignore
/.idea export-ignore
/.tx export-ignore
/.editorconfig export-ignore
/Gruntfile.js export-ignore
/phpunit.xml export-ignore
/tests export-ignore
/readme.md export-ignore
/node_modules export-ignore
/docs export-ignore
# Items to ignore when downloading a zip

# Files
.gitattributes export-ignore
.gitignore export-ignore
.gitmodules export-ignore
.editorconfig export-ignore
Gruntfile.js export-ignore
package.json export-ignore
phpunit.xml export-ignore
phpunit.xml.dist export-ignore
readme.md export-ignore
Rakefile export-ignore
.scrutinizer.yml
.travis.yml
.bowerrc
.coveralls.yml

# Folders

/.idea export-ignore
/.tx export-ignore
/node_modules export-ignore
/docs export-ignore
/docs/* export-ignore
/tests export-ignore
/tests/* export-ignore
/tests/unit-tests/* export-ignore
17 changes: 17 additions & 0 deletions .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions assets/css/scss/admin-settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#gaddon-setting-row-license_key th {
position: relative;
}

#gaddon-setting-row-license_key td {
vertical-align: top;
}
Expand Down
Binary file modified assets/images/screenshots/add-field.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/screenshots/add-view-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/images/screenshots/beacon.png
Binary file not shown.
Binary file removed assets/images/screenshots/better-field-picker.png
Binary file not shown.
Binary file removed assets/images/screenshots/caps.png
Binary file not shown.
Binary file removed assets/images/screenshots/clock.png
Binary file not shown.
Binary file removed assets/images/screenshots/clone-view.png
Binary file not shown.
Binary file removed assets/images/screenshots/column-widths.jpg
Binary file not shown.
Binary file removed assets/images/screenshots/custom-content-widget.png
Binary file not shown.
Binary file removed assets/images/screenshots/custom-content.png
Binary file not shown.
Binary file removed assets/images/screenshots/data-source.png
Binary file not shown.
Binary file removed assets/images/screenshots/datatables-settings.png
Binary file not shown.
Binary file removed assets/images/screenshots/delete-entry.png
Binary file not shown.
Binary file removed assets/images/screenshots/developing-future.jpg
Binary file not shown.
Binary file removed assets/images/screenshots/edit-entry-link.png
Binary file not shown.
Binary file removed assets/images/screenshots/edit-form-buttons.png
Binary file not shown.
Binary file removed assets/images/screenshots/edit-post-content.png
Binary file not shown.
Binary file removed assets/images/screenshots/edit-tab.png
Binary file not shown.
Binary file removed assets/images/screenshots/embed-entry.png
Binary file not shown.
Binary file removed assets/images/screenshots/form-links.png
Binary file not shown.
Binary file removed assets/images/screenshots/format-number.png
Binary file not shown.
Binary file removed assets/images/screenshots/get.png
Binary file not shown.
Binary file removed assets/images/screenshots/gvlogic.png
Binary file not shown.
Binary file removed assets/images/screenshots/hide-until-search.png
Binary file not shown.
Binary file removed assets/images/screenshots/new-form.jpg
Binary file not shown.
Binary file removed assets/images/screenshots/other-entries.png
Diff not rendered.
Binary file removed assets/images/screenshots/pricing-merge-tags.jpg
Diff not rendered.
Binary file removed assets/images/screenshots/recent-entries.png
Diff not rendered.
Binary file removed assets/images/screenshots/report-bug.png
Diff not rendered.
Binary file removed assets/images/screenshots/search-bar-label.png
Diff not rendered.
Binary file removed assets/images/screenshots/search-bar.png
Diff not rendered.
Binary file removed assets/images/screenshots/search-widget.png
Diff not rendered.
Binary file removed assets/images/screenshots/show-clear-button.png
Diff not rendered.
Binary file removed assets/images/screenshots/single-entry-link.png
Diff not rendered.
Binary file removed assets/images/screenshots/single-list-column.png
Diff not rendered.
Binary file removed assets/images/screenshots/sort-by-column.png
Diff not rendered.
Binary file removed assets/images/screenshots/toolbar.png
Diff not rendered.
Binary file removed assets/images/screenshots/view-tabs.png
Diff not rendered.
Binary file removed assets/images/screenshots/yellow-circle.png
Diff not rendered.
4 changes: 2 additions & 2 deletions assets/js/admin-entries-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
css_class = 'approved';
title_attr = gvGlobals.disapprove_title;
break;
case gvGlobals.status_disapproved:
default:
css_class = 'disapproved';
title_attr = gvGlobals.approve_title;
Expand Down Expand Up @@ -221,7 +220,8 @@
entry_slug: entryID,
form_id: gvGlobals.form_id,
approved: approved,
nonce: gvGlobals.nonce
nonce: gvGlobals.nonce,
admin_nonce: gvGlobals.admin_nonce
};

$.post( ajaxurl, data, function ( response ) {
Expand Down
2 changes: 1 addition & 1 deletion assets/js/admin-entries-list.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 17 additions & 4 deletions assets/js/admin-views.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@
.on( 'dblclick', ".gv-fields", vcfg.openFieldSettings )

// Update checkbox visibility when having dependency checkboxes
.on( 'change', ".gv-setting-list", vcfg.toggleCheckboxes );
.on( 'change', ".gv-setting-list, #gravityview_settings", vcfg.toggleCheckboxes )

.on( 'change', "#gravityview_settings", vcfg.zebraStripeSettings );

// End bind to $('body')

Expand All @@ -162,15 +164,24 @@
viewConfiguration.altKey = e.altKey;
},

/**
* Update zebra striping when settings are changed
* This prevents two gray rows next to each other.
* @since 1.19
*/
zebraStripeSettings: function() {
$( '#gravityview_settings table').find('tr').removeClass('alternate').filter(':visible:even' ).addClass( 'alternate' );
},

/**
* Show/hide checkboxes that have visibility conditionals
* @see GravityView_FieldType_checkboxes
* @param {jQueryEvent} e
* @param {jQuery} e
*/
toggleCheckboxes: function ( e ) {

var $parent = $( this );
$conditionals = $( this ).find( '[data-requires]' );
var $parent = $( e.currentTarget );
$conditionals = $parent.find( '[data-requires]' );

$conditionals.each( function () {
var requires = $( this ).data( 'requires' );
Expand Down Expand Up @@ -312,6 +323,8 @@

vcfg.togglePreviewButton();

vcfg.zebraStripeSettings();

},

/**
Expand Down
2 changes: 1 addition & 1 deletion assets/js/admin-views.min.js

Large diffs are not rendered by default.

193 changes: 193 additions & 0 deletions assets/js/field-approval.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
/**
* Javascript for Entry Approval
*
* @package GravityView
* @license GPL2+
* @author Katz Web Services, Inc.
* @link http://gravityview.co
* @copyright Copyright 2014, Katz Web Services, Inc.
*
* @since 1.0.0
*
* globals jQuery, gvGlobals, ajaxurl
*/

(function( $ ) {

"use strict";

var self = {
'response': { 'status': '' },

/**
* @var {boolean} True: print console logs; false: don't
*/
'debug': false,

/**
* @var {string} jQuery selector used to find if datatables exist
*/
'dt_selector': '.gv-datatables',

/**
* @var {string} The class added and removed based on whether entry is approved
*/
'css_classes': {
'approved': 'gv-approval-approved',
'unapproved': 'gv-approval-unapproved',
'disapproved': 'gv-approval-disapproved',
'loading': 'gv-approval-loading'
},

/**
* @var {string} jQuery selector used to find approval target
*/
'selector': '.gv-approval-toggle'
};

$(function() {
self.setup_triggers();
});

/**
* Checks whether there's DataTables table. If so, uses different trigger.
* @returns {void}
*/
self.setup_triggers = function(){

var maybeDT = $( self.dt_selector );

if ( maybeDT.length > 0 ){
$( '.gv-datatables' ).on( 'draw.dt', self.add_toggle_approval_trigger );
} else {
self.add_toggle_approval_trigger();
}
};

/**
* Bind a trigger to the selector element
*/
self.add_toggle_approval_trigger = function() {
$( self.selector ).on( 'click', function( e ) {
if( $( e.target ).hasClass( self.css_classes.loading ) ) {
e.preventDefault();
if( self.debug ) {
console.log( 'add_toggle_approval_trigger', 'Cannot toggle approval while approval is pending.' );
}
return false;
}
self.toggle_approval( e );
});
};

/**
* Toggle a specific entry
*
* @param e The clicked entry event object
* @returns {boolean}
*/
self.toggle_approval = function ( e ) {
e.preventDefault();

var $link = $( e.target ).is('span') ? $( e.target ).parent() : $( e.target );
var entry_slug = $link.attr('data-entry-slug');
var form_id = $link.attr('data-form-id');
var new_status = self.get_new_status( $link.attr( 'data-current-status') );

if( self.debug ) {
console.log( 'toggle_approval', { 'target': e.target, 'current_approval_value': $link.attr( 'data-current-status'), 'new_status': new_status });
}

$link.addClass( self.css_classes.loading );

self.update_approval( entry_slug, form_id, new_status, $link );

return false;
};

/**
* Get the new status value that should be used when clicking the link, based on current value
*
* @param {string|int} old_status Old status value
*
* @returns {int}
*/
self.get_new_status = function( old_status ) {
var new_status;

// The `+ ""` code converts the value to a string, without requiring `.toString()`
switch( old_status + "" ) {
case gvApproval.status.approved.value + "":
new_status = gvApproval.status.disapproved.value;
break;
default:
new_status = gvApproval.status.approved.value;
break;
}

return new_status;
};

/**
* Update an entry status via AJAX
*/
self.update_approval = function ( entry_slug, form_id, set_approved, $target ) {

var data = {
action: 'gv_update_approved',
entry_slug: entry_slug,
form_id: form_id,
approved: set_approved,
nonce: gvApproval.nonce
};

var css_class, new_status;

$target.attr( 'aria-busy', true );

$.post( gvApproval.ajaxurl, data, function ( response ) {
if( response.success ) {

switch( response.data.status ) {
case gvApproval.status.approved.value:
new_status = gvApproval.status.approved;
css_class = self.css_classes.approved;
break;
case gvApproval.status.disapproved.value:
new_status = gvApproval.status.disapproved;
css_class = self.css_classes.disapproved;
break;
case gvApproval.status.unapproved.value:
new_status = gvApproval.status.unapproved;
css_class = self.css_classes.unapproved;
break;
}

$target
.prop( 'title', new_status.title )
.attr( 'data-current-status', response.data.status )
.removeClass( self.css_classes.disapproved )
.removeClass( self.css_classes.approved )
.removeClass( self.css_classes.unapproved )
.addClass( css_class )
.find('span')
.text( new_status.label );

} else if( '0' !== response ) {
if( self.debug ) {
console.error( 'AJAX Error', response );
}
alert( response.data[0].message );
}

$target.attr( 'aria-busy', false ).removeClass( self.css_classes.loading );

if( self.debug ) {
console.log( 'update_approval', { 'data': data, 'response': response });
}
});

return true;
};

} (jQuery) );
1 change: 1 addition & 0 deletions assets/js/field-approval.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions gravityview.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: GravityView
* Plugin URI: https://gravityview.co
* Description: The best, easiest way to display Gravity Forms entries on your website.
* Version: 1.18.1
* Version: 1.19
* Author: GravityView
* Author URI: https://gravityview.co
* Text Domain: gravityview
Expand All @@ -26,7 +26,7 @@
define( 'GRAVITYVIEW_FILE', __FILE__ );

/**
* The URL to this file
* The URL to this file, with trailing slash
*/
define( 'GRAVITYVIEW_URL', plugin_dir_url( __FILE__ ) );

Expand Down Expand Up @@ -61,7 +61,7 @@
*/
final class GravityView_Plugin {

const version = '1.18.1';
const version = '1.19';

private static $instance;

Expand Down
1 change: 1 addition & 0 deletions includes/admin/class-gravityview-admin-view-item.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ function __construct( $title = '', $item_id, $item = array(), $settings = array(
'adminLabel' => NULL,
'adminOnly' => NULL,
'subtitle' => NULL,
'placeholder' => NULL,
) );

$this->title = $title;
Expand Down
Loading

0 comments on commit f4e16fe

Please sign in to comment.