Plugin Directory

Changeset 3305993


Ignore:
Timestamp:
06/03/2025 06:40:53 PM (10 months ago)
Author:
glewe
Message:

Tagging version 3.9.2

Location:
chordpress
Files:
4 edited
23 copied

Legend:

Unmodified
Added
Removed
  • chordpress/tags/3.9.2/chordpress.php

    r3299214 r3305993  
    1919 * Plugin URI:        https://lewe.gitbook.io/lewe-chordpress/
    2020 * Description:       This plugin renders ChordPro formatted text and chord diagrams in WordPress sites.
    21  * Version:           3.9.1
     21 * Version:           3.9.2
    2222 * Author:            George Lewe
    2323 * Author URI:        https://www.lewe.com
     
    3838 */
    3939define('CHORDPRESS_NAME', 'ChordPress');
    40 define('CHORDPRESS_VERSION', '3.9.1');
     40define('CHORDPRESS_VERSION', '3.9.2');
    4141define('CHORDPRESS_AUTHOR', 'George Lewe');
    4242define('CHORDPRESS_AUTHOR_URI', 'https://www.lewe.com');
  • chordpress/tags/3.9.2/includes/class-chordpress-renderer.php

    r3299214 r3305993  
    707707     * Start of ChordPress wrapper
    708708     */
     709    $cpressStyles = "<style>div.cpress { float: " . $this->float . "; } div.cpress_line { " . $this->lineStyle . "; } div.cpress_line_section { display: inline; float: left; } div.cpress_line_section .chord .chordshort { " . $this->chordStyle . "; } div.cpress_line_section .lyric { " . $this->lyricsStyle . "; } div.cpress_chorus { " . $this->chorusStyle . "; } div.cpress_verse { " . $this->verseStyle . "; } div.cpress_clear { clear: both; } div.cpress_meta { " . $this->metaStyle . "; } div.cpress_interaction { float: right; } div.cpress_interaction select { width: auto; } span.cpress_comment { " . $this->commentStyle . "; } div.cpress_chordsheet { text-align: center; }</style>";
     710
    709711    $returnText = "\n\n
    710712      <!--begin: ChordPress SongSheet -->
    711713      <div>
    712         <style>
    713           div.cpress { float: " . $this->float . "; }
    714           div.cpress_line { " . $this->lineStyle . "; }
    715           div.cpress_line_section { display: inline; float: left; }
    716           div.cpress_line_section .chord .chordshort { " . $this->chordStyle . "; }
    717           div.cpress_line_section .lyric { " . $this->lyricsStyle . "; }
    718           div.cpress_chorus { " . $this->chorusStyle . "; }
    719           div.cpress_verse { " . $this->verseStyle . "; }
    720           div.cpress_clear { clear: both; }
    721           div.cpress_meta { " . $this->metaStyle . "; }
    722           div.cpress_interaction { float: right; }
    723           div.cpress_interaction select { width: auto; }
    724           span.cpress_comment { " . $this->commentStyle . "; }
    725           div.cpress_chordsheet { text-align: center; }
    726         </style>
     714      " . $cpressStyles . "
    727715      </div>\n";
    728716
     
    869857      $interactionForm .= "<div class='cpress-col cpress-pr-0'>";
    870858      if (!$this->hidePrint) {
    871         $interactionForm .= "<br><button class='cpress-btn cpress-btn-secondary cpress-btn-sm' onclick=\"window.print();\">" . __('Print', 'chordpress') . "</button>\n";
     859        $printTitle = 'ChordPress SongSheet';
     860        if (strlen($this->arrDirectives['title']) && !$this->hideTitle) {
     861          $printTitle = $this->arrDirectives['title'];
     862        }
     863        $interactionForm .= "<br><button class='cpress-btn cpress-btn-secondary cpress-btn-sm' onclick=\"printElement('%cpressID%', '" . $printTitle . "', '" . $cpressStyles . "');\">" . __('Print', 'chordpress') . "</button>\n";
     864//        $interactionForm .= "<br><button class='cpress-btn cpress-btn-secondary cpress-btn-sm' onclick=\"window.print();\">" . __('Print', 'chordpress') . "</button>\n";
    872865      }
    873866      $interactionForm .= "</div>";
  • chordpress/tags/3.9.2/public/js/chordpress-public.js

    r3298894 r3305993  
    325325
    326326/**
     327 * ----------------------------------------------------------------------------
     328 * Print Element.
     329 * ----------------------------------------------------------------------------
     330 * Prints the content of a specified HTML element in a new browser window.
     331 *
     332 * This function retrieves the inner HTML of the specified element by its ID,
     333 * opens a new browser window, and writes the content into it. The new window
     334 * is styled with basic CSS and given a title, which can be customized via the
     335 * `printTitle` parameter. The function also ensures compatibility with older
     336 * versions of Internet Explorer by closing and focusing the print window.
     337 *
     338 * @param {string} elementId - The ID of the HTML element whose content will be printed.
     339 * @param {string} [printTitle='ChordPress Song'] - The title of the print window. Defaults to 'ChordPress Song'.
     340 *
     341 * @since 3.9.2
     342 */
     343function printElement(elementId, printTitle = 'ChordPress Song', cpressStyles = '') {
     344  const content = document.getElementById(elementId).innerHTML;
     345  const printWindow = window.open('', '', 'height=600,width=800');
     346  printWindow.document.write(`
     347    <html>
     348      <head>
     349        <title>${printTitle}</title>
     350        <style>
     351          body { font-family: Arial, sans-serif; padding: 20px; }
     352        </style>
     353        ${cpressStyles}
     354      </head>
     355      <body>
     356        ${content}
     357      </body>
     358    </html>
     359  `);
     360  printWindow.document.close(); // Necessary for IE >= 10
     361  printWindow.focus();          // Necessary for IE >= 10
     362  printWindow.print();
     363  printWindow.close();
     364}
     365
     366/**
    327367 * Modal Dialog
    328368 *
  • chordpress/tags/3.9.2/readme.txt

    r3299214 r3305993  
    130130
    131131== Changelog ==
     132= 3.9.2 =
     133* 2025-06-02
     134* Print button prints song only incl. custom styles
     135
    132136= 3.9.1 =
    133137* 2025-05-23
  • chordpress/trunk/chordpress.php

    r3299214 r3305993  
    1919 * Plugin URI:        https://lewe.gitbook.io/lewe-chordpress/
    2020 * Description:       This plugin renders ChordPro formatted text and chord diagrams in WordPress sites.
    21  * Version:           3.9.1
     21 * Version:           3.9.2
    2222 * Author:            George Lewe
    2323 * Author URI:        https://www.lewe.com
     
    3838 */
    3939define('CHORDPRESS_NAME', 'ChordPress');
    40 define('CHORDPRESS_VERSION', '3.9.1');
     40define('CHORDPRESS_VERSION', '3.9.2');
    4141define('CHORDPRESS_AUTHOR', 'George Lewe');
    4242define('CHORDPRESS_AUTHOR_URI', 'https://www.lewe.com');
  • chordpress/trunk/includes/class-chordpress-renderer.php

    r3299214 r3305993  
    707707     * Start of ChordPress wrapper
    708708     */
     709    $cpressStyles = "<style>div.cpress { float: " . $this->float . "; } div.cpress_line { " . $this->lineStyle . "; } div.cpress_line_section { display: inline; float: left; } div.cpress_line_section .chord .chordshort { " . $this->chordStyle . "; } div.cpress_line_section .lyric { " . $this->lyricsStyle . "; } div.cpress_chorus { " . $this->chorusStyle . "; } div.cpress_verse { " . $this->verseStyle . "; } div.cpress_clear { clear: both; } div.cpress_meta { " . $this->metaStyle . "; } div.cpress_interaction { float: right; } div.cpress_interaction select { width: auto; } span.cpress_comment { " . $this->commentStyle . "; } div.cpress_chordsheet { text-align: center; }</style>";
     710
    709711    $returnText = "\n\n
    710712      <!--begin: ChordPress SongSheet -->
    711713      <div>
    712         <style>
    713           div.cpress { float: " . $this->float . "; }
    714           div.cpress_line { " . $this->lineStyle . "; }
    715           div.cpress_line_section { display: inline; float: left; }
    716           div.cpress_line_section .chord .chordshort { " . $this->chordStyle . "; }
    717           div.cpress_line_section .lyric { " . $this->lyricsStyle . "; }
    718           div.cpress_chorus { " . $this->chorusStyle . "; }
    719           div.cpress_verse { " . $this->verseStyle . "; }
    720           div.cpress_clear { clear: both; }
    721           div.cpress_meta { " . $this->metaStyle . "; }
    722           div.cpress_interaction { float: right; }
    723           div.cpress_interaction select { width: auto; }
    724           span.cpress_comment { " . $this->commentStyle . "; }
    725           div.cpress_chordsheet { text-align: center; }
    726         </style>
     714      " . $cpressStyles . "
    727715      </div>\n";
    728716
     
    869857      $interactionForm .= "<div class='cpress-col cpress-pr-0'>";
    870858      if (!$this->hidePrint) {
    871         $interactionForm .= "<br><button class='cpress-btn cpress-btn-secondary cpress-btn-sm' onclick=\"window.print();\">" . __('Print', 'chordpress') . "</button>\n";
     859        $printTitle = 'ChordPress SongSheet';
     860        if (strlen($this->arrDirectives['title']) && !$this->hideTitle) {
     861          $printTitle = $this->arrDirectives['title'];
     862        }
     863        $interactionForm .= "<br><button class='cpress-btn cpress-btn-secondary cpress-btn-sm' onclick=\"printElement('%cpressID%', '" . $printTitle . "', '" . $cpressStyles . "');\">" . __('Print', 'chordpress') . "</button>\n";
     864//        $interactionForm .= "<br><button class='cpress-btn cpress-btn-secondary cpress-btn-sm' onclick=\"window.print();\">" . __('Print', 'chordpress') . "</button>\n";
    872865      }
    873866      $interactionForm .= "</div>";
  • chordpress/trunk/public/js/chordpress-public.js

    r3298894 r3305993  
    325325
    326326/**
     327 * ----------------------------------------------------------------------------
     328 * Print Element.
     329 * ----------------------------------------------------------------------------
     330 * Prints the content of a specified HTML element in a new browser window.
     331 *
     332 * This function retrieves the inner HTML of the specified element by its ID,
     333 * opens a new browser window, and writes the content into it. The new window
     334 * is styled with basic CSS and given a title, which can be customized via the
     335 * `printTitle` parameter. The function also ensures compatibility with older
     336 * versions of Internet Explorer by closing and focusing the print window.
     337 *
     338 * @param {string} elementId - The ID of the HTML element whose content will be printed.
     339 * @param {string} [printTitle='ChordPress Song'] - The title of the print window. Defaults to 'ChordPress Song'.
     340 *
     341 * @since 3.9.2
     342 */
     343function printElement(elementId, printTitle = 'ChordPress Song', cpressStyles = '') {
     344  const content = document.getElementById(elementId).innerHTML;
     345  const printWindow = window.open('', '', 'height=600,width=800');
     346  printWindow.document.write(`
     347    <html>
     348      <head>
     349        <title>${printTitle}</title>
     350        <style>
     351          body { font-family: Arial, sans-serif; padding: 20px; }
     352        </style>
     353        ${cpressStyles}
     354      </head>
     355      <body>
     356        ${content}
     357      </body>
     358    </html>
     359  `);
     360  printWindow.document.close(); // Necessary for IE >= 10
     361  printWindow.focus();          // Necessary for IE >= 10
     362  printWindow.print();
     363  printWindow.close();
     364}
     365
     366/**
    327367 * Modal Dialog
    328368 *
  • chordpress/trunk/readme.txt

    r3299214 r3305993  
    130130
    131131== Changelog ==
     132= 3.9.2 =
     133* 2025-06-02
     134* Print button prints song only incl. custom styles
     135
    132136= 3.9.1 =
    133137* 2025-05-23
Note: See TracChangeset for help on using the changeset viewer.