Changeset 2526038
- Timestamp:
- 05/04/2021 03:07:53 PM (5 years ago)
- Location:
- browser-address-bar-color
- Files:
-
- 5 edited
-
tags/1.2/browserAddressBarColor.php (modified) (2 diffs)
-
trunk/babcScript.js (modified) (4 diffs)
-
trunk/babcSettingsPage.php (modified) (3 diffs)
-
trunk/browserAddressBarColor.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
browser-address-bar-color/tags/1.2/browserAddressBarColor.php
r2521602 r2526038 102 102 <!-- Chrome, Samsung internet --> 103 103 <meta name="theme-color" content="<?php echo $babc_pages_list["all"]; ?>"> 104 <!-- Windows Phone -->105 <meta name="msapplication-navbutton-color" content="<?php echo $babc_pages_list["all"]; ?>">106 <!-- iOS Safari -->107 <meta name="apple-mobile-web-app-status-bar-style" content="<?php echo $babc_pages_list["all"]; ?>">108 <meta name="theme-color" content="<?php echo $babc_pages_list["all"]; ?>">109 104 <?php 110 105 } … … 115 110 ?> 116 111 <!-- Chrome, Samsung internet --> 117 <meta name="theme-color" content="<?php echo $color; ?>">118 <!-- Windows Phone -->119 <meta name="msapplication-navbutton-color" content="<?php echo $color; ?>">120 <!-- iOS Safari -->121 <meta name="apple-mobile-web-app-status-bar-style" content="<?php echo $color; ?>">122 112 <meta name="theme-color" content="<?php echo $color; ?>"> 123 113 <?php -
browser-address-bar-color/trunk/babcScript.js
r2521591 r2526038 3 3 const babc_txt_cover_input = document.getElementsByClassName("txt-cover-input"); 4 4 const babc_check_cover_input = document.getElementsByClassName("check-cover-input"); 5 6 const babc_main_div = document.getElementById("babc_main_div"); 5 7 const babc_inp_all = document.getElementById("input_all"); 6 8 const babc_cbox_all = document.getElementById("cbox_all"); … … 52 54 babc_check_inputs_list[i].style.display = "none"; 53 55 babc_check_cover_input[i].style.display = "inline-block"; 54 babc_txt_cover_input[i].style.display = "block";56 babc_txt_cover_input[i].style.display = "block"; 55 57 } 56 58 if(!babc_cbox_all.checked){ 57 59 babc_check_cover_input[i].style.display = "none"; 58 babc_check_inputs_list[i].style.display = "inline-block";60 babc_check_inputs_list[i].style.display = "inline-block"; 59 61 60 62 if(babc_check_inputs_list[i].checked){ … … 70 72 babc_check_inputs_list[i].addEventListener("click",()=>{ 71 73 if(!babc_cbox_all.checked){ 72 setTimeout(() => {73 74 if(babc_check_inputs_list[i].checked){ 74 75 babc_color_inputs_list[i].style.display = "block"; … … 79 80 babc_txt_cover_input[i].style.display = "block"; 80 81 } 81 }, 1); // making this change async82 82 } 83 83 }); 84 84 }; 85 86 function displaySettings(){ 87 babc_main_div.style.visibility = "visible"; 88 } 89 displaySettings();//display the main div after building all inputs set 90 -
browser-address-bar-color/trunk/babcSettingsPage.php
r2521591 r2526038 1 <div style="margin-right:10%; margin-left: 10px; margin-top: 20px;">1 <div id="babc_main_div" style="visibility:hidden; margin-right:10%; margin-left: 10px; margin-top: 20px;"> 2 2 <div style="color: #6E7274; text-align:left;"> 3 3 <h2 style="margin-left: 10px; color: #6E7274; font-size: 35px; font-weight: 600; text-align:<?php echo (get_user_locale() == "he_IL") ? "right" : "left" ?>;"> <?php echo esc_html_e( 'Browser Address Bar Color', 'browser-address-bar-color' ) ?> … … 13 13 <div style="float: left;"> 14 14 <input type="checkbox" id="cbox_all" name="check-color-all" style=" " <?php echo isset(get_option('babc_pages_list')["all"]) ? "checked" : null; ?>> 15 <p style="color: #3e4347; display: inline; font-weight: 600;"> <?php echo esc_html_e( 'All pages :', 'browser-address-bar-color' ) ?> </p>15 <p style="color: #3e4347; display: inline; font-weight: 600;"> <?php echo esc_html_e( 'All pages and posts: ', 'browser-address-bar-color' ) ?> </p> 16 16 </div> 17 <input type="color" id="input_all" name="input-color-all" style="width:50%; padding: 2px 8px; height:35px; float: right; box-shadow: 0px 0px 13px rgba(0, 0, 0, 0.1);" value="<?php echo get_option('babc_pages_list')["all"];?>">17 <input type="color" id="input_all" name="input-color-all" style="width:50%; padding: 2px 8px; height:35px; float: right; box-shadow: 0px 0px 13px rgba(0, 0, 0, 0.1);" <?php echo 'value="'.get_option('babc_pages_list')["all"].'"';?>> 18 18 <input type="text" id="txt-cover-inp-all" style="width:50%; padding: 2px 8px; height:35px; float: right; display:none;" value="Not Selected" disabled> 19 19 </div> 20 <hr style="width: 80%; font-weight: 600; color: #000; border-width: 2px;"> 20 21 <?php 21 22 22 <?php 23 if(get_pages()[0]->ID){ 24 echo'<hr style="width: 80%; font-weight: 600; color: #000; border-width: 2px;"> 25 <h3>Pages:</h3>'; 26 } 27 23 28 $babcAllPages = get_pages(); 24 29 $babc_curr_pages_arr = get_option('babc_pages_list'); … … 59 64 } 60 65 ?> 66 67 <?php 68 if(get_posts()[0]->ID){ 69 echo'<hr style="width: 80%; font-weight: 600; color: #000; border-width: 2px;"> 70 <h3>Posts:</h3>'; 71 } 72 $babcAllPosts = get_posts(); 73 $babc_curr_pages_arr = get_option('babc_pages_list'); 74 75 foreach ($babcAllPosts as $post) { 76 if(array_key_exists($post->ID , $babc_curr_pages_arr)){ 77 $curr_checked = "checked"; 78 $curr_color = $babc_curr_pages_arr[$post->ID]; 79 }else{ 80 $curr_checked = ""; 81 $curr_color = "#E3E3E3" ; //default color; 82 } 83 84 $babc_option = '<div style="background-color: #fff; padding: 4px; padding-bottom: 0px; direction: ltr; margin-top: 5px; height:40px;">'; 85 86 $babc_option .= '<div style="float: left;">'; 87 $babc_option .= ' <input type="checkbox" id="" class="check-inputs" name="check-color-'; 88 $babc_option .= $post->ID; 89 $babc_option .= '" style="display:inline-block;" '; 90 $babc_option .= $curr_checked; 91 $babc_option .= '>'; 92 $babc_option .= '<input type="checkbox" class="check-cover-input" style="display: none;" checked disabled>'; 93 $babc_option .= '<p style="color: #0970be; display: inline; font-weight: 600;">'; 94 $babc_option .= $post->post_title; 95 $babc_option .= ':</p>'; 96 $babc_option .= '</div>'; 97 98 $babc_option .= '<input type="color" class="color-inputs" name="input-color-'; 99 $babc_option .= $post->ID; 100 $babc_option .= '" style="width:50%; padding: 2px 8px; height:35px; float: right; box-shadow: 0px 0px 13px rgba(0, 0, 0, 0.1);" value="'; 101 $babc_option .= $curr_color; 102 $babc_option .= '">'; 103 $babc_option .= '<input type="text" class="txt-cover-input" style="display: none; width:50%; padding: 2px 8px; height:35px; float: right;" value="Not Selected" disabled> '; 104 105 106 $babc_option .= '</div>'; 107 echo $babc_option; 108 } 109 ?> 61 110 </div> 62 111 -
browser-address-bar-color/trunk/browserAddressBarColor.php
r2521602 r2526038 37 37 } 38 38 39 40 39 function babcLinkToSettingsPage($links) { 41 40 $babc_settings_link = '<a href="themes.php?page=babc-options">Settings</a>'; … … 49 48 50 49 wp_enqueue_script( 'babc-script', plugins_url('babcScript.js', __FILE__ )); 51 wp_enqueue_style( 'Roboto', 'https://fonts.googleapis.com/css?family=Roboto&display=swap');52 50 53 51 if(isset($_POST['color-posted'])){ … … 102 100 <!-- Chrome, Samsung internet --> 103 101 <meta name="theme-color" content="<?php echo $babc_pages_list["all"]; ?>"> 104 <!-- Windows Phone -->105 <meta name="msapplication-navbutton-color" content="<?php echo $babc_pages_list["all"]; ?>">106 <!-- iOS Safari -->107 <meta name="apple-mobile-web-app-status-bar-style" content="<?php echo $babc_pages_list["all"]; ?>">108 <meta name="theme-color" content="<?php echo $babc_pages_list["all"]; ?>">109 102 <?php 110 103 } … … 112 105 }else{ 113 106 foreach ($babc_pages_list as $page => $color) { 114 if (is_page($page) ){107 if (is_page($page) || is_single($page)){ 115 108 ?> 116 109 <!-- Chrome, Samsung internet --> 117 110 <meta name="theme-color" content="<?php echo $color; ?>"> 118 <!-- Windows Phone -->119 <meta name="msapplication-navbutton-color" content="<?php echo $color; ?>">120 <!-- iOS Safari -->121 <meta name="apple-mobile-web-app-status-bar-style" content="<?php echo $color; ?>">122 <meta name="theme-color" content="<?php echo $color; ?>">123 111 <?php 124 112 }; 125 } //loop over $babc_pages_list, check every page , and call by color;113 } //loop over $babc_pages_list, check every page and post, and call by color; 126 114 } 127 115 -
browser-address-bar-color/trunk/readme.txt
r2523609 r2526038 11 11 Requires at least: 4.6 12 12 Tested up to: 5.7 13 Stable tag: 1.213 Stable tag: 2.0 14 14 15 15 == Description == … … 45 45 = 1.0 = 46 46 * First upload 47 = 1.2 = 48 * Prepare for translations 47 = 2.0 = 48 * Option to color single post, bug fixed 49 50 == Upgrade Notice == 51 = 2.0 = 52 bug fixed, color single post- not just pages 49 53 50 54 == Frequently Asked Questions == … … 52 56 = What's your plugin's specialty? = 53 57 54 You can choose different colors for each page of your site , not only one for all of them58 You can choose different colors for each page of your site or even every post, not only one for all of them 55 59 56 60 = Why it doesn't work on desktop browsers? = … … 58 62 For now the plugin is not functional in desktop browsers but according to google it should be available soon in chrome for PC. 59 63 60 == Upgrade Notice ==61 62 64 == Donations ==
Note: See TracChangeset
for help on using the changeset viewer.