Plugin Directory

Changeset 3325136


Ignore:
Timestamp:
07/09/2025 04:20:01 PM (8 months ago)
Author:
glewe
Message:

Tagging version 3.9.8

Location:
chordpress
Files:
3 edited
23 copied

Legend:

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

    r3311795 r3325136  
    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.7
     21 * Version:           3.9.8
    2222 * Author:            George Lewe
    2323 * Author URI:        https://www.lewe.com
     
    3838 */
    3939define('CHORDPRESS_NAME', 'ChordPress');
    40 define('CHORDPRESS_VERSION', '3.9.7');
     40define('CHORDPRESS_VERSION', '3.9.8');
    4141define('CHORDPRESS_AUTHOR', 'George Lewe');
    4242define('CHORDPRESS_AUTHOR_URI', 'https://www.lewe.com');
  • chordpress/tags/3.9.8/includes/class-chordpress-renderer.php

    r3311795 r3325136  
    719719
    720720    $songsheetHtml = "\n\n
    721       <!--begin: ChordPress SongSheet -->
     721      <!-- ChordPress -->\n\n
     722      <!-- ChordPress Styles -->
    722723      <div>
    723724      " . $this->songsheetStyles . "
    724       </div>\n";
     725      </div>\n
     726      <!-- /ChordPress Styles -->\n\n";
    725727
    726728    /**
     
    731733    }
    732734
    733     $songsheetHtml .= "<div id=\"%cpressID%\" class=\"cpress\">\n";
     735    $songsheetHtml .= "<!-- ChordPress Song %cpressID% -->\n
     736      <div id=\"%cpressID%\" class=\"cpress\">\n";
    734737
    735738    /**
     
    742745      $songsheetHtml .= '<' . $this->titleLevel . '>' . $this->arrDirectives['title'] . '</' . $this->titleLevel . ">\n";
    743746    } else {
    744       $cpressID = 'ccpress-id-' . $randId;
     747      $cpressID = 'cpress-id-' . $randId;
    745748      $songsheetHtml = str_replace('%cpressID%', $cpressID, $songsheetHtml);
    746749    }
     
    788791     */
    789792    $this->inMonospace = false;
     793    $openSections = []; // Stack to track open sections
    790794    foreach ($text as $line) {
     795      $trimmed = trim($line);
     796
     797      if (strpos($trimmed, '{start_of_verse}') !== false) {
     798        $songsheetHtml .= "<div class=\"cpress_verse\">\n<div class=\"cpress_line\">\n";
     799        $openSections[] = 'verse';
     800        continue; // no need to process further for this line
     801      }
     802
     803      if (strpos($trimmed, '{end_of_verse}') !== false) {
     804        if (!empty($openSections) && end($openSections) === 'verse') {
     805          array_pop($openSections);
     806          $songsheetHtml .= "</div></div>\n";
     807        }
     808        continue; // no need to process further for this line
     809      }
     810
     811      if (strpos($trimmed, '{start_of_chorus}') !== false) {
     812        $songsheetHtml .= "<div class=\"cpress_chorus\">\n<div class=\"cpress_line\">\n";
     813        $openSections[] = 'chorus';
     814        continue; // no need to process further for this line
     815      }
     816
     817      if (strpos($trimmed, '{end_of_chorus}') !== false) {
     818        if (!empty($openSections) && end($openSections) === 'chorus') {
     819          array_pop($openSections);
     820          $songsheetHtml .= "</div></div>\n";
     821        }
     822        continue; // no need to process further for this line
     823      }
     824
    791825      if ($this->inMonospace && strpos($line, "{end_of_monospace}") === false) {
    792826        $songsheetHtml .= $line;
     
    795829      }
    796830    }
     831    // Close any remaining open sections
     832    while (!empty($openSections)) {
     833      $section = array_pop($openSections);
     834      $songsheetHtml .= "</div></div>\n";
     835    }
     836
     837    /**
     838     * End of ChordPress song
     839     */
     840    $songsheetHtml .= "</div>\n
     841    <!-- /ChordPress Song %cpressID% -->\n
     842    <!-- /ChordPress -->\n\n";
     843
    797844    $songsheetHtml = str_replace('%cpressID%', $cpressID, $songsheetHtml);
    798845
    799846    /**
    800      * End of ChordPress song
    801      */
    802     $songsheetHtml .= "</div>\n<!--end: ChordPress SongSheet-->\n";
    803 
    804     /**
    805847     * Build chord sheet if option set to true.
    806848     */
    807849    if ($this->showChordSheet) {
    808       $chordSheetText = "\n<!--begin: ChordPress ChordSheet-->\n";
     850      $chordSheetText = "\n<!-- ChordPress ChordSheet-->\n";
    809851      $chordSheetText .= "<div class='cpress_chordsheet'>\n";
    810852      $chordSheetText .= "<div><hr></div>\n";
     
    817859        }
    818860      }
    819       $chordSheetText .= "</div>\n<div style=\"clear:both; padding: 16px 0 16px 0;\"><hr></div>\n<!--end: ChordPress ChordSheet-->\n\n";
     861      $chordSheetText .= "</div>\n
     862      <div style=\"clear:both; padding: 16px 0 16px 0;\"><hr></div>\n
     863      <!-- /ChordPress ChordSheet-->\n\n";
    820864      if ($this->showChordSheetOnTop) {
    821865        $songsheetHtml = $chordSheetText . $songsheetHtml;
     
    847891   */
    848892  private function buildInteractionMenu(): string {
    849     $interactionForm = "<div class=\"cpress-interaction cpress-row";
     893    $interactionForm = "
     894      <!-- ChordPress Interaction -->
     895      <div class=\"cpress-interaction cpress-row";
     896
    850897    if ($this->fixedInteraction) {
    851898      $interactionForm .= " fixed";
    852899    }
     900
    853901    $interactionForm .= "\">";
    854902
    855903    if (!$this->hideFontsize) {
    856       $interactionForm .= "<div class='cpress-col cpress-mb-2'>" . __('Font Size', 'chordpress') . "<br>
     904      $interactionForm .= "
     905        <div class='cpress-col cpress-mb-2'>" . __('Font Size', 'chordpress') . "<br>
    857906          <div class='cpress-btn-group' role='group'>
    858907            <button type='button' class='cpress-btn cpress-btn-secondary cpress-btn-sm' onclick=\"changeFontSize('%cpressID%', -5);\">-</button>
     
    882931          }
    883932          $interactionForm .= __('Transpose', 'chordpress') . "<br>
    884               <div class='cpress-btn-group' role='group'>
    885                 <button type='button' class='cpress-btn cpress-btn-secondary cpress-btn-sm' onclick=\"transposeChords('%cpressID%', 'btnTranspose-', 'down', " . $songKey . ");\">-</button>
    886                 <button id=\"btnTranspose-%cpressID%\" type='button' class='cpress-btn cpress-btn-outline-secondary cpress-btn-sm' onclick=\"transposeChords('%cpressID%', 'btnTranspose-', 'reset', " . $songKey . ");\" value='0'>" . $initialText . "</button>
    887                 <button type='button' class='cpress-btn cpress-btn-secondary cpress-btn-sm' onclick=\"transposeChords('%cpressID%', 'btnTranspose-', 'up', " . $songKey . ");\">+</button>
    888               </div>";
     933            <div class='cpress-btn-group' role='group'>
     934              <button type='button' class='cpress-btn cpress-btn-secondary cpress-btn-sm' onclick=\"transposeChords('%cpressID%', 'btnTranspose-', 'down', " . $songKey . ");\">-</button>
     935              <button id=\"btnTranspose-%cpressID%\" type='button' class='cpress-btn cpress-btn-outline-secondary cpress-btn-sm' onclick=\"transposeChords('%cpressID%', 'btnTranspose-', 'reset', " . $songKey . ");\" value='0'>" . $initialText . "</button>
     936              <button type='button' class='cpress-btn cpress-btn-secondary cpress-btn-sm' onclick=\"transposeChords('%cpressID%', 'btnTranspose-', 'up', " . $songKey . ");\">+</button>
     937            </div>";
    889938        } else {
    890939          //
     
    9831032      $interactionForm .= "</div>";
    9841033    }
     1034
    9851035    $interactionForm .= "<div class='cpress-col cpress-pr-0'>";
    9861036    if (!$this->hidePrint) {
     
    9911041      $interactionForm .= "<br><button class=\"cpress-btn cpress-btn-secondary cpress-btn-sm\" onclick=\"printElement('%cpressID%', '" . $printTitle . "', '" . $this->songsheetStyles . "');\">" . __('Print', 'chordpress') . "</button>\n";
    9921042    }
    993     $interactionForm .= "</div>";
     1043    $interactionForm .= "</div>
     1044      </div>\n
     1045      <!-- /ChordPress Interaction -->\n";
     1046
    9941047    return $interactionForm;
    9951048  }
  • chordpress/tags/3.9.8/readme.txt

    r3311795 r3325136  
    55Requires at least: 4.0
    66Tested up to: 6.8
    7 Stable tag: 3.9.7
     7Stable tag: 3.9.8
    88Requires PHP: 5.2.4
    99License: GPLv3
     
    130130
    131131== Changelog ==
     132= 3.9.8 =
     133* 2025-07-09
     134* Missing closing div fix
     135
    132136= 3.9.7 =
    133137* 2025-06-15
  • chordpress/trunk/chordpress.php

    r3311795 r3325136  
    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.7
     21 * Version:           3.9.8
    2222 * Author:            George Lewe
    2323 * Author URI:        https://www.lewe.com
     
    3838 */
    3939define('CHORDPRESS_NAME', 'ChordPress');
    40 define('CHORDPRESS_VERSION', '3.9.7');
     40define('CHORDPRESS_VERSION', '3.9.8');
    4141define('CHORDPRESS_AUTHOR', 'George Lewe');
    4242define('CHORDPRESS_AUTHOR_URI', 'https://www.lewe.com');
  • chordpress/trunk/includes/class-chordpress-renderer.php

    r3311795 r3325136  
    719719
    720720    $songsheetHtml = "\n\n
    721       <!--begin: ChordPress SongSheet -->
     721      <!-- ChordPress -->\n\n
     722      <!-- ChordPress Styles -->
    722723      <div>
    723724      " . $this->songsheetStyles . "
    724       </div>\n";
     725      </div>\n
     726      <!-- /ChordPress Styles -->\n\n";
    725727
    726728    /**
     
    731733    }
    732734
    733     $songsheetHtml .= "<div id=\"%cpressID%\" class=\"cpress\">\n";
     735    $songsheetHtml .= "<!-- ChordPress Song %cpressID% -->\n
     736      <div id=\"%cpressID%\" class=\"cpress\">\n";
    734737
    735738    /**
     
    742745      $songsheetHtml .= '<' . $this->titleLevel . '>' . $this->arrDirectives['title'] . '</' . $this->titleLevel . ">\n";
    743746    } else {
    744       $cpressID = 'ccpress-id-' . $randId;
     747      $cpressID = 'cpress-id-' . $randId;
    745748      $songsheetHtml = str_replace('%cpressID%', $cpressID, $songsheetHtml);
    746749    }
     
    788791     */
    789792    $this->inMonospace = false;
     793    $openSections = []; // Stack to track open sections
    790794    foreach ($text as $line) {
     795      $trimmed = trim($line);
     796
     797      if (strpos($trimmed, '{start_of_verse}') !== false) {
     798        $songsheetHtml .= "<div class=\"cpress_verse\">\n<div class=\"cpress_line\">\n";
     799        $openSections[] = 'verse';
     800        continue; // no need to process further for this line
     801      }
     802
     803      if (strpos($trimmed, '{end_of_verse}') !== false) {
     804        if (!empty($openSections) && end($openSections) === 'verse') {
     805          array_pop($openSections);
     806          $songsheetHtml .= "</div></div>\n";
     807        }
     808        continue; // no need to process further for this line
     809      }
     810
     811      if (strpos($trimmed, '{start_of_chorus}') !== false) {
     812        $songsheetHtml .= "<div class=\"cpress_chorus\">\n<div class=\"cpress_line\">\n";
     813        $openSections[] = 'chorus';
     814        continue; // no need to process further for this line
     815      }
     816
     817      if (strpos($trimmed, '{end_of_chorus}') !== false) {
     818        if (!empty($openSections) && end($openSections) === 'chorus') {
     819          array_pop($openSections);
     820          $songsheetHtml .= "</div></div>\n";
     821        }
     822        continue; // no need to process further for this line
     823      }
     824
    791825      if ($this->inMonospace && strpos($line, "{end_of_monospace}") === false) {
    792826        $songsheetHtml .= $line;
     
    795829      }
    796830    }
     831    // Close any remaining open sections
     832    while (!empty($openSections)) {
     833      $section = array_pop($openSections);
     834      $songsheetHtml .= "</div></div>\n";
     835    }
     836
     837    /**
     838     * End of ChordPress song
     839     */
     840    $songsheetHtml .= "</div>\n
     841    <!-- /ChordPress Song %cpressID% -->\n
     842    <!-- /ChordPress -->\n\n";
     843
    797844    $songsheetHtml = str_replace('%cpressID%', $cpressID, $songsheetHtml);
    798845
    799846    /**
    800      * End of ChordPress song
    801      */
    802     $songsheetHtml .= "</div>\n<!--end: ChordPress SongSheet-->\n";
    803 
    804     /**
    805847     * Build chord sheet if option set to true.
    806848     */
    807849    if ($this->showChordSheet) {
    808       $chordSheetText = "\n<!--begin: ChordPress ChordSheet-->\n";
     850      $chordSheetText = "\n<!-- ChordPress ChordSheet-->\n";
    809851      $chordSheetText .= "<div class='cpress_chordsheet'>\n";
    810852      $chordSheetText .= "<div><hr></div>\n";
     
    817859        }
    818860      }
    819       $chordSheetText .= "</div>\n<div style=\"clear:both; padding: 16px 0 16px 0;\"><hr></div>\n<!--end: ChordPress ChordSheet-->\n\n";
     861      $chordSheetText .= "</div>\n
     862      <div style=\"clear:both; padding: 16px 0 16px 0;\"><hr></div>\n
     863      <!-- /ChordPress ChordSheet-->\n\n";
    820864      if ($this->showChordSheetOnTop) {
    821865        $songsheetHtml = $chordSheetText . $songsheetHtml;
     
    847891   */
    848892  private function buildInteractionMenu(): string {
    849     $interactionForm = "<div class=\"cpress-interaction cpress-row";
     893    $interactionForm = "
     894      <!-- ChordPress Interaction -->
     895      <div class=\"cpress-interaction cpress-row";
     896
    850897    if ($this->fixedInteraction) {
    851898      $interactionForm .= " fixed";
    852899    }
     900
    853901    $interactionForm .= "\">";
    854902
    855903    if (!$this->hideFontsize) {
    856       $interactionForm .= "<div class='cpress-col cpress-mb-2'>" . __('Font Size', 'chordpress') . "<br>
     904      $interactionForm .= "
     905        <div class='cpress-col cpress-mb-2'>" . __('Font Size', 'chordpress') . "<br>
    857906          <div class='cpress-btn-group' role='group'>
    858907            <button type='button' class='cpress-btn cpress-btn-secondary cpress-btn-sm' onclick=\"changeFontSize('%cpressID%', -5);\">-</button>
     
    882931          }
    883932          $interactionForm .= __('Transpose', 'chordpress') . "<br>
    884               <div class='cpress-btn-group' role='group'>
    885                 <button type='button' class='cpress-btn cpress-btn-secondary cpress-btn-sm' onclick=\"transposeChords('%cpressID%', 'btnTranspose-', 'down', " . $songKey . ");\">-</button>
    886                 <button id=\"btnTranspose-%cpressID%\" type='button' class='cpress-btn cpress-btn-outline-secondary cpress-btn-sm' onclick=\"transposeChords('%cpressID%', 'btnTranspose-', 'reset', " . $songKey . ");\" value='0'>" . $initialText . "</button>
    887                 <button type='button' class='cpress-btn cpress-btn-secondary cpress-btn-sm' onclick=\"transposeChords('%cpressID%', 'btnTranspose-', 'up', " . $songKey . ");\">+</button>
    888               </div>";
     933            <div class='cpress-btn-group' role='group'>
     934              <button type='button' class='cpress-btn cpress-btn-secondary cpress-btn-sm' onclick=\"transposeChords('%cpressID%', 'btnTranspose-', 'down', " . $songKey . ");\">-</button>
     935              <button id=\"btnTranspose-%cpressID%\" type='button' class='cpress-btn cpress-btn-outline-secondary cpress-btn-sm' onclick=\"transposeChords('%cpressID%', 'btnTranspose-', 'reset', " . $songKey . ");\" value='0'>" . $initialText . "</button>
     936              <button type='button' class='cpress-btn cpress-btn-secondary cpress-btn-sm' onclick=\"transposeChords('%cpressID%', 'btnTranspose-', 'up', " . $songKey . ");\">+</button>
     937            </div>";
    889938        } else {
    890939          //
     
    9831032      $interactionForm .= "</div>";
    9841033    }
     1034
    9851035    $interactionForm .= "<div class='cpress-col cpress-pr-0'>";
    9861036    if (!$this->hidePrint) {
     
    9911041      $interactionForm .= "<br><button class=\"cpress-btn cpress-btn-secondary cpress-btn-sm\" onclick=\"printElement('%cpressID%', '" . $printTitle . "', '" . $this->songsheetStyles . "');\">" . __('Print', 'chordpress') . "</button>\n";
    9921042    }
    993     $interactionForm .= "</div>";
     1043    $interactionForm .= "</div>
     1044      </div>\n
     1045      <!-- /ChordPress Interaction -->\n";
     1046
    9941047    return $interactionForm;
    9951048  }
  • chordpress/trunk/readme.txt

    r3311795 r3325136  
    55Requires at least: 4.0
    66Tested up to: 6.8
    7 Stable tag: 3.9.7
     7Stable tag: 3.9.8
    88Requires PHP: 5.2.4
    99License: GPLv3
     
    130130
    131131== Changelog ==
     132= 3.9.8 =
     133* 2025-07-09
     134* Missing closing div fix
     135
    132136= 3.9.7 =
    133137* 2025-06-15
Note: See TracChangeset for help on using the changeset viewer.