Changeset 3841934
- Timestamp:
- 12/03/2026 08:45:55 AM (6 hours ago)
- Location:
- projelio
- Files:
-
- 16 added
- 10 edited
-
tags/1.0.1 (added)
-
tags/1.0.1/assets (added)
-
tags/1.0.1/assets/css (added)
-
tags/1.0.1/assets/css/admin.css (added)
-
tags/1.0.1/assets/css/portal.css (added)
-
tags/1.0.1/assets/js (added)
-
tags/1.0.1/assets/js/admin.js (added)
-
tags/1.0.1/assets/js/portal.js (added)
-
tags/1.0.1/includes (added)
-
tags/1.0.1/includes/i18n.php (added)
-
tags/1.0.1/includes/settings.php (added)
-
tags/1.0.1/includes/wizard.php (added)
-
tags/1.0.1/projelio.php (added)
-
tags/1.0.1/readme.txt (added)
-
tags/1.0.1/templates (added)
-
tags/1.0.1/templates/single-projelio-project.php (added)
-
trunk/assets/css/admin.css (modified) (1 diff)
-
trunk/assets/css/portal.css (modified) (4 diffs)
-
trunk/assets/js/admin.js (modified) (1 diff)
-
trunk/assets/js/portal.js (modified) (1 diff)
-
trunk/includes/i18n.php (modified) (4 diffs)
-
trunk/includes/settings.php (modified) (1 diff)
-
trunk/includes/wizard.php (modified) (2 diffs)
-
trunk/projelio.php (modified) (8 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/templates/single-projelio-project.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
projelio/trunk/assets/css/admin.css
r3841189 r3841934 79 79 .pj-field input[type="url"], 80 80 .pj-field input[type="date"], 81 .pj-field input[type="number"], 81 82 .pj-field select, 82 83 .pj-field textarea { -
projelio/trunk/assets/css/portal.css
r3841189 r3841934 77 77 .pj-hero-header { 78 78 position: relative; 79 min-height: 400px;79 min-height: var(--pj-header-height, 400px); 80 80 display: flex; 81 81 flex-direction: column; … … 473 473 .pj-lb-prev { position: fixed; left: 16px; top: 50%; transform: translateY(-50%); z-index: 5; } 474 474 .pj-lb-next { position: fixed; right: 16px; top: 50%; transform: translateY(-50%); z-index: 5; } 475 .pj-lb-stage { flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; }476 .pj-lb-img-box { position: relative; display: inline-block; max-width: 88vw; max-height: 82vh; }475 .pj-lb-stage { flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer; } 476 .pj-lb-img-box { position: relative; display: inline-block; max-width: 88vw; max-height: 82vh; cursor: default; } 477 477 478 478 .pj-lb-img-box img { display: block; max-width: 88vw; max-height: 82vh; border-radius: 8px; user-select: none; } … … 486 486 } 487 487 @media (max-width: 720px) { 488 .pj-hero-header { min-height: 280px; }489 488 .pj-bento-grid, 490 489 .pj-gallery-grid, … … 1080 1079 @media (max-width: 720px) { 1081 1080 .pj-hero-header { 1082 min-height: 290px;1081 min-height: clamp(160px, calc(var(--pj-header-height, 400px) * 0.725), 600px); 1083 1082 padding: 0 0 18px; 1084 1083 } -
projelio/trunk/assets/js/admin.js
r3841189 r3841934 231 231 '<div class="pj-repeater-row"><span class="dashicons dashicons-menu pj-drag"></span>' + 232 232 '<input type="text" name="pj_link_title[]" placeholder="' + tr('link_title_ph', 'Link title') + '" class="pj-grow">' + 233 '<input type=" url" name="pj_link_url[]" placeholder="https://..." class="pj-grow">' +233 '<input type="text" name="pj_link_url[]" placeholder="example.com/..." class="pj-grow">' + 234 234 '<button type="button" class="button pj-remove-row">✕</button></div>' 235 235 ); -
projelio/trunk/assets/js/portal.js
r3841189 r3841934 93 93 lightbox.querySelector('.pj-lb-prev').addEventListener('click', () => { currentIdx--; renderLightbox(); }); 94 94 lightbox.querySelector('.pj-lb-next').addEventListener('click', () => { currentIdx++; renderLightbox(); }); 95 lightbox.addEventListener('click', e => { 96 if (!e.target.closest('#pj-lb-img-box, .pj-lb-topbar, .pj-lb-prev, .pj-lb-next')) { 97 closeLightbox(); 98 } 99 }); 95 100 document.addEventListener('keydown', e => { 96 101 if (!lightbox.classList.contains('is-open')) return; -
projelio/trunk/includes/i18n.php
r3841189 r3841934 98 98 'font_label' => 'Font', 99 99 'preview_label' => 'Preview:', 100 'div_header' => 'Project header (400px)', 100 'div_header' => 'Project header', 101 'header_height_label' => 'Header height (px)', 101 102 'header_bg' => 'Header background', 102 103 'header_solid' => 'Solid color', … … 322 323 'font_label' => 'Schriftart', 323 324 'preview_label' => 'Vorschau:', 324 'div_header' => 'Projekt-Header (400px)', 325 'div_header' => 'Projekt-Header', 326 'header_height_label' => 'Header-Höhe (px)', 325 327 'header_bg' => 'Header-Hintergrund', 326 328 'header_solid' => 'Volltonfarbe', … … 546 548 'font_label' => 'Шрифт', 547 549 'preview_label' => 'Предпросмотр:', 548 'div_header' => 'Шапка проекта (400px)', 550 'div_header' => 'Шапка проекта', 551 'header_height_label' => 'Высота шапки (px)', 549 552 'header_bg' => 'Фон шапки', 550 553 'header_solid' => 'Сплошной цвет', … … 1003 1006 1004 1007 /** 1008 * Normalize user-entered URL so links without https:// or www. work seamlessly 1009 */ 1010 public static function normalize_url( $raw_url ) { 1011 $clean = trim( (string) $raw_url ); 1012 if ( '' === $clean ) { 1013 return ''; 1014 } 1015 if ( ! preg_match( '#^([a-z][a-z0-9+\-.]*:|//|/)#i', $clean ) ) { 1016 $clean = 'https://' . $clean; 1017 } 1018 return esc_url_raw( $clean ); 1019 } 1020 1021 /** 1005 1022 * Format Telegram handle into full URL 1006 1023 */ -
projelio/trunk/includes/settings.php
r3841189 r3841934 32 32 'font' => 'system_sans', 33 33 'header_type' => 'color', 34 'header_height' => 400, 34 35 'header_color' => '#23211E', 35 36 'header_img_id' => 0, -
projelio/trunk/includes/wizard.php
r3841189 r3841934 85 85 $raw_header_type = isset( $_POST['projelio_header_type'] ) ? sanitize_key( wp_unslash( $_POST['projelio_header_type'] ) ) : $d['header_type']; 86 86 $header_type = ( 'image' === $raw_header_type ) ? 'image' : 'color'; 87 $header_height = isset( $_POST['projelio_header_height'] ) ? absint( $_POST['projelio_header_height'] ) : absint( $d['header_height'] ?? 400 ); 88 $header_height = $header_height ? max( 160, min( 800, $header_height ) ) : 400; 87 89 $raw_hdr_color = isset( $_POST['projelio_header_color'] ) ? sanitize_hex_color( wp_unslash( $_POST['projelio_header_color'] ) ) : $d['header_color']; 88 90 update_post_meta( $post_id, '_projelio_header_type', $header_type ); 91 update_post_meta( $post_id, '_projelio_header_height', $header_height ); 89 92 update_post_meta( $post_id, '_projelio_header_color', $raw_hdr_color ?: $d['header_color'] ); 90 93 update_post_meta( $post_id, '_projelio_header_img_id', absint( $_POST['projelio_header_img_id'] ?? $d['header_img_id'] ) ); … … 272 275 </div> 273 276 <div id="pj-header-img-preview" style="margin-top:8px;"> 274 <?php if ( $header_url ) : ?><img src="<?php echo esc_url( $header_url ); ?>" style="max-height:70px;border-radius:6px;"><?php endif; ?>277 <?php if ( $header_url ) : ?><img src="<?php echo esc_url( $header_url ); ?>" alt="" style="max-height:70px;border-radius:6px;"><?php endif; ?> 275 278 </div> 279 </div> 280 <div class="pj-field"> 281 <label for="projelio_header_height"><?php echo esc_html( Projelio_I18n::a( 'header_height_label' ) ); ?></label> 282 <input type="number" id="projelio_header_height" name="projelio_header_height" value="<?php echo esc_attr( absint( $d['header_height'] ?? 400 ) ?: 400 ); ?>" min="160" max="800" step="10"> 276 283 </div> 277 284 </div> -
projelio/trunk/projelio.php
r3841189 r3841934 3 3 * Plugin Name: Projelio 4 4 * Description: Minimalist PIN-protected client portal for interior designers & architects: Project Wizard, EN/DE/RU, Light & Dark themes, GDPR-safe fonts, room galleries, interactive drawings viewer, protected documents, stages, tasks & threaded comments. 5 * Version: 1.0. 05 * Version: 1.0.1 6 6 * Author: Projelio 7 7 * License: GPLv2 or later … … 13 13 } 14 14 15 define( 'PROJELIO_VERSION', '1.0. 0' );15 define( 'PROJELIO_VERSION', '1.0.1' ); 16 16 define( 'PROJELIO_PATH', plugin_dir_path( __FILE__ ) ); 17 17 define( 'PROJELIO_URL', plugin_dir_url( __FILE__ ) ); … … 426 426 427 427 $header_type = get_post_meta( $post->ID, '_projelio_header_type', true ) ?: $d['header_type']; 428 $header_height = absint( get_post_meta( $post->ID, '_projelio_header_height', true ) ) ?: absint( $d['header_height'] ?? 400 ); 428 429 $header_color = get_post_meta( $post->ID, '_projelio_header_color', true ) ?: $d['header_color']; 429 430 $header_img_id = $is_new ? absint( $d['header_img_id'] ) : absint( get_post_meta( $post->ID, '_projelio_header_img_id', true ) ); … … 528 529 <div id="pj-header-img-preview" style="margin-top:8px;"> 529 530 <?php if ( $header_img_url ) : ?> 530 <img src="<?php echo esc_url( $header_img_url ); ?>" style="max-height:70px;border-radius:6px;">531 <img src="<?php echo esc_url( $header_img_url ); ?>" alt="" style="max-height:70px;border-radius:6px;"> 531 532 <?php endif; ?> 532 533 </div> 534 </div> 535 <div class="pj-field"> 536 <label for="projelio_header_height"><?php echo esc_html( Projelio_I18n::a( 'header_height_label' ) ); ?></label> 537 <input type="number" id="projelio_header_height" name="projelio_header_height" value="<?php echo esc_attr( $header_height ); ?>" min="160" max="800" step="10"> 533 538 </div> 534 539 … … 769 774 <span class="dashicons dashicons-menu pj-drag"></span> 770 775 <input type="text" name="pj_link_title[]" value="<?php echo esc_attr( $lnk['title'] ?? '' ); ?>" placeholder="<?php echo esc_attr( Projelio_I18n::a( 'link_title_ph' ) ); ?>" class="pj-grow"> 771 <input type=" url" name="pj_link_url[]" value="<?php echo esc_url( $lnk['url'] ?? '' ); ?>" placeholder="https://..." class="pj-grow">776 <input type="text" name="pj_link_url[]" value="<?php echo esc_attr( $lnk['url'] ?? '' ); ?>" placeholder="example.com/..." class="pj-grow"> 772 777 <button type="button" class="button pj-remove-row">✕</button> 773 778 </div> … … 841 846 $raw_header_type = isset( $_POST['projelio_header_type'] ) ? sanitize_key( wp_unslash( $_POST['projelio_header_type'] ) ) : 'color'; 842 847 $header_type = ( 'image' === $raw_header_type ) ? 'image' : 'color'; 848 $header_height = isset( $_POST['projelio_header_height'] ) ? absint( $_POST['projelio_header_height'] ) : 400; 849 $header_height = $header_height ? max( 160, min( 800, $header_height ) ) : 400; 843 850 $header_color = isset( $_POST['projelio_header_color'] ) ? sanitize_hex_color( wp_unslash( $_POST['projelio_header_color'] ) ) : '#26282A'; 844 851 update_post_meta( $post_id, '_projelio_header_type', $header_type ); 852 update_post_meta( $post_id, '_projelio_header_height', $header_height ); 845 853 update_post_meta( $post_id, '_projelio_header_color', $header_color ?: '#26282A' ); 846 854 update_post_meta( $post_id, '_projelio_header_img_id', absint( $_POST['projelio_header_img_id'] ?? 0 ) ); … … 965 973 // Contacts 966 974 $links = array(); 967 $link_urls = isset( $_POST['pj_link_url'] ) && is_array( $_POST['pj_link_url'] ) ? array_map( ' esc_url_raw', wp_unslash( $_POST['pj_link_url'] ) ) : array();975 $link_urls = isset( $_POST['pj_link_url'] ) && is_array( $_POST['pj_link_url'] ) ? array_map( 'sanitize_text_field', wp_unslash( $_POST['pj_link_url'] ) ) : array(); 968 976 $link_titles = isset( $_POST['pj_link_title'] ) && is_array( $_POST['pj_link_title'] ) ? array_map( 'sanitize_text_field', wp_unslash( $_POST['pj_link_title'] ) ) : array(); 969 foreach ( $link_urls as $i => $ clean_lurl ) {970 $clean_lurl = trim( $clean_lurl );977 foreach ( $link_urls as $i => $raw_lurl ) { 978 $clean_lurl = Projelio_I18n::normalize_url( $raw_lurl ); 971 979 if ( '' === $clean_lurl ) { 972 980 continue; … … 974 982 $ltitle = $link_titles[ $i ] ?? ''; 975 983 $links[] = array( 976 'title' => $ltitle ?: $clean_lurl,984 'title' => $ltitle ?: trim( $raw_lurl ), 977 985 'url' => $clean_lurl, 978 986 ); -
projelio/trunk/readme.txt
r3841306 r3841934 5 5 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 1.0. 07 Stable tag: 1.0.1 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 90 90 == Changelog == 91 91 92 = 1.0.1 = 93 * Flexible link input: `http://`, `https://`, and `www.` are no longer required when adding links. 94 * Lightbox UX: Images in the Design gallery can now be closed by clicking outside the image area, in addition to the close button. 95 * Customizable header height: Added a header height setting in pixels (defaults to 400px). 96 92 97 = 1.0.0 = 93 98 * Initial release of Projelio Free. -
projelio/trunk/templates/single-projelio-project.php
r3841189 r3841934 138 138 // Header 139 139 $header_type = get_post_meta( $post_id, '_projelio_header_type', true ) ?: 'color'; 140 $header_height = absint( get_post_meta( $post_id, '_projelio_header_height', true ) ) ?: absint( $defaults['header_height'] ?? 400 ); 141 $header_height = max( 160, min( 800, $header_height ?: 400 ) ); 140 142 $header_color = get_post_meta( $post_id, '_projelio_header_color', true ) ?: '#23211E'; 141 143 $header_img_id = absint( get_post_meta( $post_id, '_projelio_header_img_id', true ) ); … … 267 269 . '--pj-font:' . $font_css . ';' 268 270 . '--pj-serif:' . $serif_css . ';' 271 . '--pj-header-height:' . (int) $header_height . 'px;' 269 272 . '}'; 270 273 … … 755 758 <div class="pj-extra-links-inline"> 756 759 <?php foreach ( $contacts['links'] as $lnk ) : ?> 757 <a href="<?php echo esc_url( $lnk['url']); ?>" target="_blank" rel="noopener noreferrer"><?php echo esc_html( $lnk['title'] ); ?> ↗</a>760 <a href="<?php echo esc_url( Projelio_I18n::normalize_url( $lnk['url'] ) ); ?>" target="_blank" rel="noopener noreferrer"><?php echo esc_html( $lnk['title'] ); ?> ↗</a> 758 761 <?php endforeach; ?> 759 762 </div>
Note:
See TracChangeset
for help on using the changeset viewer.