<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[7261] sites/trunk/wordcamp.org/public_html/wp-content/plugins/wc-post-types: WordCamp Post Types: Add print button and stylesheet to schedule shortcode.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://meta.trac.wordpress.org/changeset/7261">7261</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://meta.trac.wordpress.org/changeset/7261","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>iandunn</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2018-06-01 17:34:59 +0000 (Fri, 01 Jun 2018)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>WordCamp Post Types: Add print button and stylesheet to schedule shortcode.

As a result, UI tabs were introduced, and some corresponding "email" references were renamed, to reflect the more generic nature that the form now has.

Props egmanekki.
See <a href="http://meta.trac.wordpress.org/ticket/2733">#2733</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswcposttypescssshortcodescss">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wc-post-types/css/shortcodes.css</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswcposttypesjsfavouritesessionsjs">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wc-post-types/js/favourite-sessions.js</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswcposttypeswcposttypesphp">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wc-post-types/wc-post-types.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswcposttypescssshortcodescss"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wc-post-types/css/shortcodes.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/plugins/wc-post-types/css/shortcodes.css  2018-06-01 16:36:22 UTC (rev 7260)
+++ sites/trunk/wordcamp.org/public_html/wp-content/plugins/wc-post-types/css/shortcodes.css    2018-06-01 17:34:59 UTC (rev 7261)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -136,6 +136,49 @@
</span><span class="cx" style="display: block; padding: 0 10px">        border-radius: 6px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/* Style the tabs */
+.fav-session-share-tab {
+       overflow: hidden;
+       border: 1px solid #ccc;
+       background-color: #f1f1f1;
+       display: table;
+       table-layout: fixed;
+       width: 100%;
+}
+
+/* Style the buttons inside the tabs */
+.fav-session-share-tab div {
+       background-color: inherit;
+       text-align: center;
+       display: table-cell;
+       border: none;
+       outline: none;
+       cursor: pointer;
+       padding: 12px 16px;
+       transition: 0.3s;
+       font-size: 14px;
+}
+
+/* Change background color of buttons on hover */
+.fav-session-share-tab div:hover {
+       background-color: #ddd;
+}
+
+/* Create an active/current tablink class */
+.fav-session-share-tab div.active {
+       background-color: #ccc;
+}
+
+/* Style the tab content */
+.fav-session-share-tabcontent {
+       display: none;
+       padding: 12px 14px;
+       border: 1px solid #ccc;
+       border-top: none;
+       min-height: 145px;
+       background-color: #ccc;
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> #fav-session-email-form {
</span><span class="cx" style="display: block; padding: 0 10px">        margin: 10px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -253,6 +296,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+@media print {
+       .wcb-session-favourite-icon,
+       .show-email-form,
+       .email-form {
+               display: none !important;
+       }
+
+       .wcpt-schedule td.wcb-favourite-session div {
+               opacity: 1 !important;
+       }
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /*
</span><span class="cx" style="display: block; padding: 0 10px">  * [sessions]
</span><span class="cx" style="display: block; padding: 0 10px">  * [speakers]
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswcposttypesjsfavouritesessionsjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wc-post-types/js/favourite-sessions.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/plugins/wc-post-types/js/favourite-sessions.js    2018-06-01 16:36:22 UTC (rev 7260)
+++ sites/trunk/wordcamp.org/public_html/wp-content/plugins/wc-post-types/js/favourite-sessions.js      2018-06-01 17:34:59 UTC (rev 7261)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -38,11 +38,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">        function switchEmailFavButton() {
</span><span class="cx" style="display: block; padding: 0 10px">                var favSessions = FavSessions.get();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                // Display email form only if there are any selected sessions.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         // Display share form only if there are any selected sessions.
</ins><span class="cx" style="display: block; padding: 0 10px">                 if ( Object.keys( favSessions ).length > 0 ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        $( '.show-email-form' ).show();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        $( '.email-form' ).show();
</ins><span class="cx" style="display: block; padding: 0 10px">                 } else {
</span><span class="cx" style="display: block; padding: 0 10px">                        $( '.show-email-form' ).hide();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        $( '.email-form' ).addClass( 'fav-session-div-hide' ).removeClass( 'fav-session-div-show' );
+                       $( '.email-form' ).hide();
</ins><span class="cx" style="display: block; padding: 0 10px">                 }
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -163,5 +166,43 @@
</span><span class="cx" style="display: block; padding: 0 10px">                } );
</span><span class="cx" style="display: block; padding: 0 10px">        } );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        // In case email tab is hidden, use the next tab as default.
+       var defaultTab = 'email';
+       if ( 0 === $( '#fav-session-tab-email' ).length ) {
+               defaultTab = 'print';
+       }
+
+       $( '#fav-session-tab-' + defaultTab ).show();
+       $( '#fav-session-tab-' + defaultTab ).addClass( 'active' );
+       $( '#fav-session-btn-' + defaultTab ).addClass( 'active' );
+
+       $( '.fav-session-tablinks' ).click( function( event ) {
+               var i, tabContent, tabLinks;
+
+               tabContent = document.getElementsByClassName( 'fav-session-share-tabcontent' );
+
+               for ( i = 0; i < tabContent.length; i++ ) {
+                       $( tabContent[ i ] ).hide();
+               }
+
+               tabLinks = document.getElementsByClassName( 'fav-session-tablinks' );
+
+               $( tabLinks ).removeClass( 'active' );
+
+               var element         = $( this );
+               var idStartPosition = 'fav-session-btn-'.length;
+               var tabName         = 'fav-session-tab-' + element.attr( 'id' ).substring( idStartPosition );
+
+               $( document.getElementById( tabName ) ).show();
+               $( event.currentTarget ).addClass( 'active' )
+       });
+
+
+       $( '#fav-session-print' ).click( function( event ) {
+               $( '.wcpt-schedule td div' ).css( 'opacity', 0.3 );
+               window.print();
+               $( '.wcpt-schedule td div' ).css( 'opacity', 1 );
+       });
+
</ins><span class="cx" style="display: block; padding: 0 10px">         initFavouriteSessions();
</span><span class="cx" style="display: block; padding: 0 10px"> } );
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswcposttypeswcposttypesphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wc-post-types/wc-post-types.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/plugins/wc-post-types/wc-post-types.php   2018-06-01 16:36:22 UTC (rev 7260)
+++ sites/trunk/wordcamp.org/public_html/wp-content/plugins/wc-post-types/wc-post-types.php     2018-06-01 17:34:59 UTC (rev 7261)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -705,7 +705,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $html .= '</tbody>';
</span><span class="cx" style="display: block; padding: 0 10px">                $html .= '</table>';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $html .= $this->fav_session_email_form();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $html .= $this->fav_session_share_form();
</ins><span class="cx" style="display: block; padding: 0 10px">                 return $html;
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -744,11 +744,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @return string HTML code that represents the form to send emails and a link to show and hide it.
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        function fav_session_email_form() {
-               static $email_form_count = 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function fav_session_share_form() {
+               static $share_form_count = 0;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                // Skip email form if it is disabled or it was already added to document.
-               if ( email_fav_sessions_disabled() || $email_form_count !== 0 ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         // Skip share form if it was already added to document.
+               if ( 0 !== $share_form_count ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                         return '';
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -756,16 +756,41 @@
</span><span class="cx" style="display: block; padding: 0 10px">                ?>
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                <div class="email-form fav-session-email-form-hide">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        <div id="fav-session-email-form">
-                               <?php esc_html_e( 'Send me my favorite sessions:', 'wordcamporg' ); ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 <!-- Tab links -->
+                       <div class="fav-session-share-tab">
+                               <?php if ( ! email_fav_sessions_disabled() ) : ?>
+                                       <div class="fav-session-tablinks" id="fav-session-btn-email">
+                                               <?php esc_html_e( 'Email', 'wordcamporg' ); ?>
+                                       </div>
+                               <?php endif; ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                <form id="fav-sessions-form">
-                                       <input type="text" name="email_address" id="fav-sessions-email-address" placeholder="my@email.com" />
-                                       <input type="submit" value="<?php esc_attr_e( 'Send', 'wordcamporg' ); ?>" />
-                               </form>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         <div class="fav-session-tablinks" id="fav-session-btn-print">
+                                       <?php esc_html_e( 'Print', 'wordcamporg' ); ?>
+                               </div>
</ins><span class="cx" style="display: block; padding: 0 10px">                         </div>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        <div class="fav-session-email-wait-spinner"></div>
-                       <div class="fav-session-email-result"></div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+                       <!-- Tab content -->
+                       <?php if ( ! email_fav_sessions_disabled() ) : ?>
+                               <div id="fav-session-tab-email" class="fav-session-share-tabcontent">
+                                       <div id="fav-session-email-form">
+                                               <?php esc_html_e( 'Send me my favorite sessions:', 'wordcamporg' ); ?>
+
+                                               <form id="fav-sessions-form">
+                                                       <input type="text" name="email_address" id="fav-sessions-email-address" placeholder="me@protonmail.com" />
+                                                       <input type="submit" value="<?php esc_attr_e( 'Send', 'wordcamporg' ); ?>" />
+                                               </form>
+                                       </div>
+
+                                       <div class="fav-session-email-wait-spinner"></div>
+                                       <div class="fav-session-email-result"></div>
+                               </div>
+                       <?php endif; ?>
+
+                       <div id="fav-session-tab-print" class="fav-session-share-tabcontent">
+                               <button id="fav-session-print">
+                                       <?php esc_html_e( 'Print favorite sessions', 'wordcamporg' ); ?>
+                               </button>
+                       </div>
</ins><span class="cx" style="display: block; padding: 0 10px">                 </div>
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                <a class="show-email-form" href="javascript:">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -774,11 +799,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">                </a>
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                <?php
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $email_form = ob_get_clean();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $share_form = ob_get_clean();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $email_form_count++;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $share_form_count++;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                return $email_form;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         return $share_form;
</ins><span class="cx" style="display: block; padding: 0 10px">         }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span></span></pre>
</div>
</div>

</body>
</html>