Changeset 1773384
- Timestamp:
- 11/22/2017 06:20:19 PM (8 years ago)
- Location:
- squareoffs/trunk
- Files:
-
- 9 edited
-
js/datepicker.js (modified) (2 diffs)
-
js/media-button.js (modified) (2 diffs)
-
js/templates/modal-insert-content-new.php (modified) (1 diff)
-
php/admin/admin.php (modified) (2 diffs)
-
php/admin/squareoffs.php (modified) (4 diffs)
-
php/class-squareoffs-internal-api.php (modified) (1 diff)
-
php/sanitization.php (modified) (2 diffs)
-
plugin.php (modified) (1 diff)
-
readme.txt (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
squareoffs/trunk/js/datepicker.js
r1759645 r1773384 17 17 18 18 var formatReadableDate = function( date ) { 19 return $.datepicker.formatDate( 'd M yy', date ); 19 if ( typeof( date ) !== "undefined" && date !== "" ) { 20 return $.datepicker.formatDate( 'd M yy', date ); 21 } else { 22 return ""; 23 } 20 24 }; 21 25 … … 24 28 var $dateField = $el.find( '.squareoffs-date-input' ); 25 29 var $timeField = $el.find( '.squareoffs-time-input' ); 26 var date = new Date( $dateField.attr( 'data-date-iso' )); 30 var dateIso = $dateField.attr( 'data-date-iso' ); 31 var date = ""; 32 33 if ( typeof( dateIso ) !== "undefined" && dateIso !== "" ) { 34 date = new Date( dateIso ); 35 } 27 36 28 37 var $visibleField = $( '<input />', { -
squareoffs/trunk/js/media-button.js
r1759645 r1773384 72 72 isReady: function() { 73 73 var ready = true; 74 var requiredProps = [ 'question', 'side_1_title', 'side_2_title', 'category_uuid' , 'end_date'];74 var requiredProps = [ 'question', 'side_1_title', 'side_2_title', 'category_uuid' ]; 75 75 76 76 _.each( requiredProps, function( prop ) { … … 547 547 var date = this.$el.find( '[name="end_date[date]"]' ).val(); 548 548 var time = this.$el.find( '[name="end_date[time]"]' ).val(); 549 550 try { 551 args.end_date = new Date( date + ' ' + time ).toISOString(); 552 } catch ( error ) { 553 var _date = new Date(); 554 _date.setFullYear( new Date().getFullYear() + 1 ); 555 args.end_date = _date.toISOString(); 549 if ( typeof( date ) !== "undefined" && date !== "" ) { 550 try { 551 args.end_date = new Date( date + ' ' + time ).toISOString(); 552 } catch ( error ) { 553 var _date = new Date(); 554 _date.setFullYear( new Date().getFullYear() + 1 ); 555 args.end_date = _date.toISOString(); 556 } 556 557 } 557 558 -
squareoffs/trunk/js/templates/modal-insert-content-new.php
r1759645 r1773384 102 102 <fieldset> 103 103 <legend class="screen-reader-text"><?php esc_html_e( 'End date SquareOff' , 'squareoffs' ); ?></legend> 104 <?php squareoffs_render_date_field( 'end_date', n ew DateTime( '+1 year' ), 'squareoffs-new-end-date-{{ data.cid }}' ); ?>104 <?php squareoffs_render_date_field( 'end_date', null, 'squareoffs-new-end-date-{{ data.cid }}' ); ?> 105 105 </fieldset> 106 106 </div> -
squareoffs/trunk/php/admin/admin.php
r1759645 r1773384 219 219 } 220 220 $class = 'notice notice-error is-dismissible'; 221 $message = __( 'Please connect to your SquareOffs account, or <a href="https://www.squareoffs.com/registration/new/ " target="_blank">create a new account</a> on squareoffs.com.', 'squareoffs' );221 $message = __( 'Please connect to your SquareOffs account, or <a href="https://www.squareoffs.com/registration/new/?platform=wordpress" target="_blank">create a new account</a> on squareoffs.com.', 'squareoffs' ); 222 222 $dismiss = __( 'Dismiss this warning', 'squareoffs' ); 223 223 … … 228 228 'a' => array( 229 229 'href' => array(), 230 'target' => array(), 230 231 'title' => array(), 231 232 ), -
squareoffs/trunk/php/admin/squareoffs.php
r1759645 r1773384 290 290 $date->setTimezone( new DateTimeZone( 'UTC' ) ); 291 291 } else { 292 $date = n ew DateTime( '+1 year' );292 $date = null; 293 293 } 294 294 … … 304 304 * @return void 305 305 */ 306 function squareoffs_render_date_field( $name, $date , $id = null ) {306 function squareoffs_render_date_field( $name, $date = null, $id = null ) { 307 307 308 308 $id = ! empty( $id ) ? $id : 'squareoffs-datepicker-' . uniqid(); … … 320 320 esc_attr( $id . '-date' ), 321 321 esc_attr( $name . '[date]' ), 322 esc_attr( $date->format( 'Y-m-d' ) ),323 esc_attr( $date->format( 'c' ) )322 esc_attr( empty( $date ) ? "" : $date->format( 'Y-m-d' ) ), 323 esc_attr( empty( $date ) ? "" : $date->format( 'c' ) ) 324 324 ); 325 325 … … 334 334 esc_attr( $id . '-time' ), 335 335 esc_attr( $name . '[time]' ), 336 esc_attr( $date->format( 'g:i A' ) )336 esc_attr( empty( $date ) ? "" : $date->format( 'g:i A' ) ) 337 337 ); 338 338 -
squareoffs/trunk/php/class-squareoffs-internal-api.php
r1759645 r1773384 98 98 'required' => true, 99 99 ), 100 'end_date' => array( 101 'required' => true, 102 ), 100 'end_date' => array(), 103 101 'tag_list' => array(), 104 102 ), -
squareoffs/trunk/php/sanitization.php
r1759645 r1773384 211 211 'side_2_photo' => '', 212 212 'side_2_photo_url' => '', 213 'end_date' => '',213 'end_date' => null, 214 214 'category_uuid' => '', 215 215 'tag_list' => '', 216 216 'cover_photo' => '', 217 217 'cover_photo_url' => '', 218 'end_date' => null,219 218 ); 220 219 … … 238 237 239 238 // Convert date. 240 if ( $data['end_date']) {239 if ( ! empty( $data['end_date'] ) && ! empty( $data['end_date']['date'] ) ) { 241 240 $data['end_date'] = squareoffs_convert_date( $data['end_date'] ); 242 241 unset( $date ); 242 } else { 243 unset( $data['end_date'] ); 243 244 } 244 245 -
squareoffs/trunk/plugin.php
r1759645 r1773384 8 8 * Text Domain: squareoffs 9 9 * Domain Path: /languages 10 * Version: 1. 0.010 * Version: 1.1.0 11 11 * 12 12 * @package Squareoffs 13 13 */ 14 14 15 define( 'SQUAREOFFS_PLUGIN_VERSION', '1. 0.0' );15 define( 'SQUAREOFFS_PLUGIN_VERSION', '1.1.0' ); 16 16 defined( 'SQUAREOFFS_PLUGIN_PATH' ) || define( 'SQUAREOFFS_PLUGIN_PATH', plugin_dir_path( __FILE__ ) ); 17 17 defined( 'SQUAREOFFS_PLUGIN_URL' ) || define( 'SQUAREOFFS_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); -
squareoffs/trunk/readme.txt
r1759645 r1773384 1 1 === SquareOffs === 2 2 Contributors: squareoffs, humanmade 3 Donate link: 3 Donate link: 4 4 Tags: squareoff, debate, poll, vote, comment, engagement, forum, opinion, compare, review, discuss, survey 5 5 Requires at least: 4.6 6 Tested up to: 4. 86 Tested up to: 4.9 7 7 Requires PHP: 5.4 8 Stable tag: 1. 0.08 Stable tag: 1.1.0 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 13 13 14 14 == Description == 15 This easy-to-use plugin allows you to embed SquareOffs® directly into your content without ever leaving Wordpress. 15 This easy-to-use plugin allows you to embed SquareOffs® directly into your content without ever leaving Wordpress. 16 16 17 SquareOffs microdebates™ allow digital publishers of all sizes to engage readers, increase traffic, gain insight, and generate new revenue. They are more than just another poll. SquareOffs allow you to engage your readers in an interactive conversational debate where they not only choose a side, but can also explain “why” they made their choice. Readers love it because they can make their voice heard, invite others to join the conversation, vote up top reasons supporting their side, and easily access relevant comments within the innovative dual comment stream. Readers are kept on your site rather than social networks, allowing you to own the conversation. 17 SquareOffs microdebates™ allow digital publishers of all sizes to engage readers, increase traffic, gain insight, and generate new revenue. They are more than just another poll. SquareOffs allow you to engage your readers in an interactive conversational debate where they not only choose a side, but can also explain “why” they made their choice. Readers love it because they can make their voice heard, invite others to join the conversation, vote up top reasons supporting their side, and easily access relevant comments within the innovative dual comment stream. Readers are kept on your site rather than social networks, allowing you to own the conversation. 18 18 19 19 >SquareOffs placed in an article receive 41% more comments than standard commenting systems. … … 28 28 * Graphical representation of the shortcode in the Visual editor allows users to easily coordinate the layout of a post or page. 29 29 * Increase site traffic when voters share on social media, pulling new readers back to your site. 30 * Create simple, bite-sized content with which readers can easily engage. 31 * Easily link your SquareOffs account to the Wordpress plugin during installation. 30 * Create simple, bite-sized content with which readers can easily engage. 31 * Easily link your SquareOffs account to the Wordpress plugin during installation. 32 32 * Configure display settings, colors, font, social sharing, and more. 33 33 … … 55 55 56 56 If you already have a SquareOffs account, simply click on "SquareOffs" in the left navigation. 57 Enter your SquareOffs login information (email and password). 57 Enter your SquareOffs login information (email and password). 58 58 59 59 New Account … … 73 73 == Frequently Asked Questions == 74 74 = What is a SquareOff? = 75 A SquareOff is a piece of content publishers use to engage their audience and allow their readers to share their opinions. Each SquareOff contains a question and two sides. Readers vote for their side, and then comment WHY they voted for that side. 75 A SquareOff is a piece of content publishers use to engage their audience and allow their readers to share their opinions. Each SquareOff contains a question and two sides. Readers vote for their side, and then comment WHY they voted for that side. 76 76 77 77 = Who can use SquareOffs? = 78 SquareOffs is great for digital publishers. From boutique bloggers to high traffic news websites, SquareOffs works with any topic, on any website. SquareOffs is also great for brands and agencies to use as a tool in their toolkit to increase brand engagement and loyalty. 78 SquareOffs is great for digital publishers. From boutique bloggers to high traffic news websites, SquareOffs works with any topic, on any website. SquareOffs is also great for brands and agencies to use as a tool in their toolkit to increase brand engagement and loyalty. 79 79 80 80 = Where do SquareOffs live? = … … 82 82 83 83 = Where should publishers place SquareOffs on a website? = 84 This depends on your website, and how your readers interact on your page. Small SquareOffs work great embedded in-line within articles or right on your homepage. Polls Pages are a great to create a new landing page on your site that had not previously existed. 84 This depends on your website, and how your readers interact on your page. Small SquareOffs work great embedded in-line within articles or right on your homepage. Polls Pages are a great to create a new landing page on your site that had not previously existed. 85 85 86 86 = Why use SquareOffs? = 87 SquareOffs is designed for digital publishers to create user-generated debate on any topic, on any website. From small bloggers to high traffic news sites, SquareOffs is a simple tool to increase engagement, revenue, traffic, and insight. 87 SquareOffs is designed for digital publishers to create user-generated debate on any topic, on any website. From small bloggers to high traffic news sites, SquareOffs is a simple tool to increase engagement, revenue, traffic, and insight. 88 88 89 89 Further support: … … 104 104 == Changelog == 105 105 106 = 1.1.0 = 107 * Tested with WordPress 4.9s 108 * Allow creation of SquareOff with no end date. 109 106 110 = 1.0.0 = 107 111 * Initial release. … … 114 118 == Upgrade Notice == 115 119 116 This is our initial release. Please notify us with any feedback at [email protected]. 120 = 1.1.0 = 121 * Tested with WordPress 4.9
Note: See TracChangeset
for help on using the changeset viewer.