Changeset 2261952
- Timestamp:
- 03/16/2020 05:59:35 PM (6 years ago)
- Location:
- wp-post-rating/trunk
- Files:
-
- 1 added
- 7 edited
-
README.md (modified) (1 diff)
-
assets/css/wp-post-rating.min.css (modified) (1 diff)
-
assets/js/min/wp-post-rating.min.js (modified) (1 diff)
-
assets/js/wp-post-rating.js (modified) (1 diff)
-
package-lock.json (added)
-
readme.txt (modified) (2 diffs)
-
templates/main.php (modified) (3 diffs)
-
wp-post-rating.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-post-rating/trunk/README.md
r1972411 r2261952 12 12 * Wordpress >= 4.9.8 13 13 * PHP >= 5.6 14 15 ## Links ## 16 https://wordpress.org/plugins/wp-post-rating/ 17 14 18 ## License ## 15 19 [MIT](https://raw.githubusercontent.com/shmidtelson/wp-post-rating/master/LICENSE) -
wp-post-rating/trunk/assets/css/wp-post-rating.min.css
r2189001 r2261952 1 @charset "UTF-8";@font-face{font-family:fontello;src:url(../font/fontello.eot?34932983);src:url(../font/fontello.eot?34932983#iefix) format("embedded-opentype"),url(../font/fontello.woff2?34932983) format("woff2"),url(../font/fontello.woff?34932983) format("woff"),url(../font/fontello.ttf?34932983) format("truetype"),url(../font/fontello.svg?34932983#fontello) format("svg");font-weight:400;font-style:normal}[class*=" icon-"]:before,[class^=icon-]:before{font-family:fontello,serif;font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.1em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.1em;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-spin4:before{content:'\e834'}.animate-spin{-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear;display:inline-block}@-webkit-keyframes spin{0%{ -webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.wpr-hide{display:none!important}.icon-star{line-height:0;display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;color:#fdd835}.icon-star:before{content:'\e800'}.icon-star-filled:before{content:'\e801'}.icon-star:before{position:relative}.wpr-wrapp{display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;padding:15px 0}.wpr-wrapp .wpr-rating{overflow:hidden;display:-webkit-box;display:flex;position:relative;max-width:200px;font-size:30px;height:40px;-webkit-box-orient:horizontal;-webkit-box-direction:reverse;flex-direction:row-reverse}.wpr-wrapp .wpr-rating-loader{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center}.wpr-wrapp .wpr-info-container{display:-webkit-box;display:flex;position:relative;-webkit-box-align:center;align-items:center;background:#fff;border:1px solid #000;margin-left:10px;cursor:pointer;padding:0 5px}.wpr-wrapp .wpr-info-container:hover{background:#f5f5f5}.wpr-wrapp .wpr-info-container:before{content:"";position:absolute;width:8px;height:8px;left:-5px;top:auto;z-index:1;background:#fff;border:1px solid #000;-webkit-transform:rotate(45deg);transform:rotate(45deg);border-top:none;border-right:none}.wpr-wrapp .icon-star.checked:before,.wpr-wrapp .icon-star.checked~.icon-star:before{content:'\e801'}.wpr-wrapp .icon-star:hover{cursor:pointer}.wpr-wrapp .icon-star:hover .icon-star:before{content:'\e801'}.wpr-wrapp .icon-star:hover:before,.wpr-wrapp .icon-star:hover~.icon-star:before{content:'\e801';color:#fbc02d}.wpr_rating_list{display:inline-block}.wpr_rating_list .icon-star{float:left}.wpr_rating_list .icon-star:before{content:'\e801'}1 @charset "UTF-8";@font-face{font-family:fontello;src:url(../font/fontello.eot?34932983);src:url(../font/fontello.eot?34932983#iefix) format("embedded-opentype"),url(../font/fontello.woff2?34932983) format("woff2"),url(../font/fontello.woff?34932983) format("woff"),url(../font/fontello.ttf?34932983) format("truetype"),url(../font/fontello.svg?34932983#fontello) format("svg");font-weight:400;font-style:normal}[class*=" icon-"]:before,[class^=icon-]:before{font-family:fontello,serif;font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.1em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.1em;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-spin4:before{content:'\e834'}.animate-spin{-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear;display:inline-block}@-webkit-keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(359deg)}}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(359deg)}}.wpr-hide{display:none!important}.icon-star{line-height:0;display:flex;align-items:center;color:#fdd835}.icon-star:before{content:'\e800'}.icon-star-filled:before{content:'\e801'}.icon-star:before{position:relative}.wpr-wrapp{display:flex;justify-content:center;padding:15px 0}.wpr-wrapp .wpr-rating{overflow:hidden;display:flex;position:relative;max-width:200px;font-size:30px;height:40px;flex-direction:row-reverse}.wpr-wrapp .wpr-rating-loader{display:flex;align-items:center}.wpr-wrapp .wpr-info-container{display:flex;position:relative;align-items:center;background:#fff;border:1px solid #000;margin-left:10px;cursor:pointer;padding:0 5px}.wpr-wrapp .wpr-info-container:hover{background:#f5f5f5}.wpr-wrapp .wpr-info-container:before{content:"";position:absolute;width:8px;height:8px;left:-5px;top:auto;z-index:1;background:#fff;border:1px solid #000;transform:rotate(45deg);border-top:none;border-right:none}.wpr-wrapp .icon-star.checked:before,.wpr-wrapp .icon-star.checked~.icon-star:before{content:'\e801'}.wpr-wrapp .icon-star:hover{cursor:pointer}.wpr-wrapp .icon-star:hover .icon-star:before{content:'\e801'}.wpr-wrapp .icon-star:hover:before,.wpr-wrapp .icon-star:hover~.icon-star:before{content:'\e801';color:#fbc02d}.wpr_rating_list{display:inline-block}.wpr_rating_list .icon-star{float:left}.wpr_rating_list .icon-star:before{content:'\e801'} -
wp-post-rating/trunk/assets/js/min/wp-post-rating.min.js
r2189136 r2261952 1 var AjaxSendRequest=function(){var n=this;this.ajax_response="",this.ajaxVars={ajaxurl:"/wp-admin/admin-ajax.php",nonce:document.querySelector("meta[name='_wpr_nonce']").getAttribute("content")},this.request=new XMLHttpRequest,this.ajax_vote=function(e,t){var s={action:"wpr_voted",nonce:this.ajaxVars.nonce,post_id:e,vote:t},a=Object.keys(s).map(function(e){return[e,s[e]].map(encodeURIComponent).join("=")}).join("&");this.request.open("POST",this.ajaxVars.ajaxurl,!0),this.request.setRequestHeader("Content-type","application/x-www-form-urlencoded"),this.request.onreadystatechange=function(){4===this.readyState&&200===this.status&&(null!=this.responseText?n.ajax_response=this.responseText:console.log("Ajax error: No data received"))},this.request.send(a)}},ajaxClient=new AjaxSendRequest,Stars=function(){var a=this;for(this.stars=document.querySelectorAll(".wpr-wrapp .icon-star"), console.log(this.stars),this.hasClass=function(e,t){return-1<(" "+e.className+" ").indexOf(" "+t+" ")},i=0;i<this.stars.length;i++)this.stars[i].addEventListener("click",function(){var t=this.parentElement,s=t.parentElement.children[1];s.classList.remove("wpr-hide"),t.classList.add("wpr-hide"),childrens=t.children;var e=this.dataset.value;ajaxClient.ajax_vote(t.dataset.id,e),setTimeout(function(){var e=JSON.parse(ajaxClient.ajax_response);for(i in childrens)a.hasClass(childrens[i],"checked")&&childrens[i].classList.remove("checked");childrens[Math.abs(parseInt(e.avg)-5)].classList.add("checked"),document.querySelector("#wpr-widget-"+t.dataset.id+" .wpr-total").innerHTML="("+parseInt(e.total)+")",s.classList.add("wpr-hide"),t.classList.remove("wpr-hide")},500)})};new Stars;1 var AjaxSendRequest=function(){var n=this;this.ajax_response="",this.ajaxVars={ajaxurl:"/wp-admin/admin-ajax.php",nonce:document.querySelector("meta[name='_wpr_nonce']").getAttribute("content")},this.request=new XMLHttpRequest,this.ajax_vote=function(e,t){var s={action:"wpr_voted",nonce:this.ajaxVars.nonce,post_id:e,vote:t},a=Object.keys(s).map(function(e){return[e,s[e]].map(encodeURIComponent).join("=")}).join("&");this.request.open("POST",this.ajaxVars.ajaxurl,!0),this.request.setRequestHeader("Content-type","application/x-www-form-urlencoded"),this.request.onreadystatechange=function(){4===this.readyState&&200===this.status&&(null!=this.responseText?n.ajax_response=this.responseText:console.log("Ajax error: No data received"))},this.request.send(a)}},ajaxClient=new AjaxSendRequest,Stars=function(){var a=this;for(this.stars=document.querySelectorAll(".wpr-wrapp .icon-star"),this.hasClass=function(e,t){return-1<(" "+e.className+" ").indexOf(" "+t+" ")},i=0;i<this.stars.length;i++)this.stars[i].addEventListener("click",function(){var t=this.parentElement,s=t.parentElement.getElementsByClassName("wpr-rating-loader")[0];s.classList.remove("wpr-hide"),t.classList.add("wpr-hide"),childrens=t.children;var e=this.dataset.value;ajaxClient.ajax_vote(t.dataset.id,e),setTimeout(function(){var e=JSON.parse(ajaxClient.ajax_response);for(i in childrens)a.hasClass(childrens[i],"checked")&&childrens[i].classList.remove("checked");childrens[Math.abs(parseInt(e.avg)-5)].classList.add("checked"),document.querySelector("#wpr-widget-"+t.dataset.id+" .wpr-total").innerHTML="("+parseInt(e.total)+")",s.classList.add("wpr-hide"),t.classList.remove("wpr-hide")},500)})};new Stars; -
wp-post-rating/trunk/assets/js/wp-post-rating.js
r2189136 r2261952 48 48 var parent = this.parentElement; 49 49 var superparent = parent.parentElement; 50 var loader = superparent. children[1];50 var loader = superparent.getElementsByClassName('wpr-rating-loader')[0]; 51 51 loader.classList.remove('wpr-hide'); 52 52 parent.classList.add('wpr-hide'); -
wp-post-rating/trunk/readme.txt
r2189136 r2261952 4 4 Tags: 5 star,google rating,postrating,rating,ratings,seo rating,rating snippet 5 5 Requires at least: 4.9.8 6 Tested up to: 5. 2.46 Tested up to: 5.3.2 7 7 Requires PHP: 5.6 8 8 Stable tag: 1.0.0 … … 39 39 40 40 == Changelog == 41 = 1.0.3.1 = 42 * Fixes with loader and display data. Correct SEO schema 41 43 = 1.0.3 = 42 44 * Fix username in widget -
wp-post-rating/trunk/templates/main.php
r2189001 r2261952 1 1 <?php 2 2 $id = get_the_ID(); 3 $title = get_the_title($id); 3 4 $avg = $this->database->get_avg_rating($id, 0); 4 $total = $this->database->get_total_votes($id) 5 $total = $this->database->get_total_votes($id); 5 6 ?> 6 <div class="wpr-wrapp" id="wpr-widget-<?php echo $id ?>" itemscope itemtype="http://schema.org/ WebPage">7 <div class="wpr-wrapp" id="wpr-widget-<?php echo $id ?>" itemscope itemtype="http://schema.org/Product"> 7 8 <div class="wpr-rating" data-id="<?php echo $id ?>" itemprop="aggregateRating" itemscope 8 9 itemtype="http://schema.org/AggregateRating"> … … 13 14 <meta itemprop="worstRating" content="1"> 14 15 <meta itemprop="bestRating" content="5"> 15 <meta itemprop="reviewCount" content="<?php echo $total?>">16 <meta itemprop="ratingValue" content="<?php echo $avg ;?>">16 <meta itemprop="reviewCount" content="<?php echo $total ? $total : '1' ?>"> 17 <meta itemprop="ratingValue" content="<?php echo $avg ? $avg : '5' ?>"> 17 18 </div> 18 19 <div class="wpr-rating-loader wpr-hide"> … … 28 29 <?php endif; ?> 29 30 </div> 31 <meta itemprop="name" content="<?php echo $title; ?>"> 30 32 </div> -
wp-post-rating/trunk/wp-post-rating.php
r2189136 r2261952 5 5 Plugin URI: http://romua1d.ru/wp_post_rating 6 6 Description: Powerful post rating wordpress plugin. 7 Version: 1.0.3 7 Version: 1.0.3.1 8 8 Author: Romua1d 9 9 Author URI: https://romua1d.ru
Note: See TracChangeset
for help on using the changeset viewer.