diff --git a/src/Resources/contao/classes/RateItArticle.php b/src/Resources/contao/classes/RateItArticle.php index a0e49a7..c65b3ad 100644 --- a/src/Resources/contao/classes/RateItArticle.php +++ b/src/Resources/contao/classes/RateItArticle.php @@ -90,15 +90,15 @@ class RateItArticle extends RateItFrontend { $objTemplate->rateit_rating_after = true; } - $GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/onReadyRateIt.js|static'; - $GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/rateit.js|static'; - $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/rateit.min.css||static'; + $GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/onReadyRateIt.js|static'; + $GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/rateit.js|static'; + $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/rateit.min.css||static'; switch ($GLOBALS['TL_CONFIG']['rating_type']) { case 'hearts' : - $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/heart.min.css||static'; + $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/heart.min.css||static'; break; default: - $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/star.min.css||static'; + $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/star.min.css||static'; } } @@ -148,15 +148,15 @@ class RateItArticle extends RateItFrontend { $article['rateit_rating_after'] = true; } - $GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/onReadyRateIt.js|static'; - $GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/rateit.js|static'; - $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/rateit.min.css||static'; + $GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/onReadyRateIt.js|static'; + $GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/rateit.js|static'; + $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/rateit.min.css||static'; switch ($GLOBALS['TL_CONFIG']['rating_type']) { case 'hearts' : - $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/heart.min.css||static'; + $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/heart.min.css||static'; break; default: - $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/star.min.css||static'; + $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/star.min.css||static'; } } @@ -232,15 +232,15 @@ class RateItArticle extends RateItFrontend { $objTemplate->arrRating = $arrRating; - $GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/onReadyRateIt.js|static'; - $GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/rateit.js|static'; - $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/rateit.min.css||static'; + $GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/onReadyRateIt.js|static'; + $GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/rateit.js|static'; + $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/rateit.min.css||static'; switch ($GLOBALS['TL_CONFIG']['rating_type']) { case 'hearts' : - $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/heart.min.css||static'; + $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/heart.min.css||static'; break; default: - $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/star.min.css||static'; + $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/star.min.css||static'; } } diff --git a/src/Resources/contao/classes/RateItFaq.php b/src/Resources/contao/classes/RateItFaq.php index 2406c7c..2321c40 100644 --- a/src/Resources/contao/classes/RateItFaq.php +++ b/src/Resources/contao/classes/RateItFaq.php @@ -59,15 +59,15 @@ class RateItFaq extends RateItFrontend { $strBuffer = $this->generateForFaqPage($objModule, $strBuffer); } - $GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/onReadyRateIt.js|static'; - $GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/rateit.js|static'; - $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/rateit.min.css||static'; + $GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/onReadyRateIt.js|static'; + $GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/rateit.js|static'; + $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/rateit.min.css||static'; switch ($GLOBALS['TL_CONFIG']['rating_type']) { case 'hearts' : - $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/heart.min.css||static'; + $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/heart.min.css||static'; break; default: - $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/star.min.css||static'; + $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/star.min.css||static'; } } } diff --git a/src/Resources/contao/classes/RateItHybrid.php b/src/Resources/contao/classes/RateItHybrid.php index d2582bf..e80c854 100644 --- a/src/Resources/contao/classes/RateItHybrid.php +++ b/src/Resources/contao/classes/RateItHybrid.php @@ -66,15 +66,15 @@ abstract class RateItHybrid extends RateItFrontend $this->strType = $GLOBALS['TL_CONFIG']['rating_type']; $this->strTextPosition = $GLOBALS['TL_CONFIG']['rating_textposition']; - $GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/onReadyRateIt.js|static'; - $GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/rateit.js|static'; - $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/rateit.min.css||static'; + $GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/onReadyRateIt.js|static'; + $GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/rateit.js|static'; + $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/rateit.min.css||static'; switch ($this->strType) { case 'hearts' : - $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/heart.min.css||static'; + $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/heart.min.css||static'; break; default: - $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/star.min.css||static'; + $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/star.min.css||static'; } return parent::generate(); diff --git a/src/Resources/contao/classes/RateItNews.php b/src/Resources/contao/classes/RateItNews.php index bbd9b10..00dbc0b 100644 --- a/src/Resources/contao/classes/RateItNews.php +++ b/src/Resources/contao/classes/RateItNews.php @@ -69,15 +69,15 @@ class RateItNews extends RateItFrontend { $objTemplate->rateit_rating_after = true; } - $GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/onReadyRateIt.js|static'; - $GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/rateit.js|static'; - $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/rateit.min.css||static'; + $GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/onReadyRateIt.js|static'; + $GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/rateit.js|static'; + $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/rateit.min.css||static'; switch ($GLOBALS['TL_CONFIG']['rating_type']) { case 'hearts' : - $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/heart.min.css||static'; + $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/heart.min.css||static'; break; default: - $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/star.min.css||static'; + $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/star.min.css||static'; } } } diff --git a/src/Resources/contao/classes/RateItPage.php b/src/Resources/contao/classes/RateItPage.php index c1cbdbe..63b8bda 100644 --- a/src/Resources/contao/classes/RateItPage.php +++ b/src/Resources/contao/classes/RateItPage.php @@ -76,7 +76,7 @@ class RateItPage extends \Frontend { $strHeadTags = ''; if (is_array($GLOBALS['TL_CSS'])) { foreach ($GLOBALS['TL_CSS'] as $script) { - if ($this->startsWith($script, 'bundles/cgoitrateit/public/css/rateit') === true) { + if ($this->startsWith($script, 'bundles/cgoitrateit/css/rateit') === true) { $included = true; break; } @@ -84,13 +84,13 @@ class RateItPage extends \Frontend { } if (!$included) { - $strHeadTags = ''; + $strHeadTags = ''; switch ($GLOBALS['TL_CONFIG']['rating_type']) { case 'hearts' : - $strHeadTags .= ''; + $strHeadTags .= ''; break; default: - $strHeadTags .= ''; + $strHeadTags .= ''; } } return $strHeadTags; @@ -101,7 +101,7 @@ class RateItPage extends \Frontend { $strHeadTags = ''; if (is_array($GLOBALS['TL_JAVASCRIPT'])) { foreach ($GLOBALS['TL_JAVASCRIPT'] as $script) { - if ($this->startsWith($script, 'bundles/cgoitrateit/public/js/rateit') === true) { + if ($this->startsWith($script, 'bundles/cgoitrateit/js/rateit') === true) { $included = true; break; } @@ -109,8 +109,8 @@ class RateItPage extends \Frontend { } if (!$included) { - $strHeadTags = 'outputFormat == 'xhtml') ? ' type="text/javascript"' : '') . ' src="' . $this->addStaticUrlTo('bundles/cgoitrateit/public/js/onReadyRateIt.js') . '">' . "\n"; - $strHeadTags .= 'outputFormat == 'xhtml') ? ' type="text/javascript"' : '') . ' src="' . $this->addStaticUrlTo('bundles/cgoitrateit/public/js/rateit.js') . '">' . "\n"; + $strHeadTags = 'outputFormat == 'xhtml') ? ' type="text/javascript"' : '') . ' src="' . $this->addStaticUrlTo('bundles/cgoitrateit/js/onReadyRateIt.js') . '">' . "\n"; + $strHeadTags .= 'outputFormat == 'xhtml') ? ' type="text/javascript"' : '') . ' src="' . $this->addStaticUrlTo('bundles/cgoitrateit/js/rateit.js') . '">' . "\n"; } return $strHeadTags; } diff --git a/src/Resources/contao/classes/RateItTopRatingsModule.php b/src/Resources/contao/classes/RateItTopRatingsModule.php index a315e21..c216350 100644 --- a/src/Resources/contao/classes/RateItTopRatingsModule.php +++ b/src/Resources/contao/classes/RateItTopRatingsModule.php @@ -36,13 +36,13 @@ namespace cgoIT\rateit; class RateItTopRatingsModule extends RateItFrontend { private static $arrUrlCache = array(); - + /** * Initialize the controller */ public function __construct($objElement) { parent::__construct($objElement); - + $this->strKey = "rateit_top_ratings"; } @@ -62,22 +62,22 @@ class RateItTopRatingsModule extends RateItFrontend return $objTemplate->parse(); } - + $this->strTemplate = $this->rateit_template; - + $this->arrTypes = deserialize($this->rateit_types); - $GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/onReadyRateIt.js|static'; - $GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/rateit.js|static'; - $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/rateit.min.css||static'; + $GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/onReadyRateIt.js|static'; + $GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/rateit.js|static'; + $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/rateit.min.css||static'; switch ($GLOBALS['TL_CONFIG']['rating_type']) { case 'hearts' : - $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/heart.min.css||static'; + $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/heart.min.css||static'; break; default: - $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/public/css/star.min.css||static'; + $GLOBALS['TL_CSS'][] = 'bundles/cgoitrateit/css/star.min.css||static'; } - + return parent::generate(); } @@ -86,9 +86,9 @@ class RateItTopRatingsModule extends RateItFrontend */ protected function compile() { $this->Template = new \FrontendTemplate($this->strTemplate); - + $this->Template->setData($this->arrData); - + $this->import("\\Database", "Database"); $arrResult = $this->Database->prepare("SELECT i.id AS item_id, i.rkey AS rkey, @@ -114,32 +114,32 @@ class RateItTopRatingsModule extends RateItFrontend $return = new \stdClass(); $return->title = $result['title']; $return->typ = $result['typ']; - + // ID ermitteln $stars = $this->percentToStars($result['best']); $return->rateItID = 'rateItRating-'.$result['rkey'].'-'.$result['typ'].'-'. $stars.'_'.intval($GLOBALS['TL_CONFIG']['rating_count']); $return->descriptionId = 'rateItRating-'.$result['rkey'].'-description'; - + $return->rateit_class = 'rateItRating'; - + $return->url = $this->getUrl($result); - + // Beschriftung ermitteln $rating = array(); $rating['totalRatings'] = $result['most']; $rating['rating'] = $result['best']; $return->description = $this->getStarMessage($rating); - + $return->rating = $result['best']; $return->count = $result['most']; $return->rel = 'not-rateable'; $objReturn[] = $return; } - + $this->Template->arrRatings = $objReturn; } - + private function getUrl($rating) { if ($rating['typ'] === 'page') { return \PageModel::findById($rating['rkey'])->getAbsoluteUrl(); @@ -153,25 +153,25 @@ class RateItTopRatingsModule extends RateItFrontend if ($rating['typ'] === 'news') { $objNews = \NewsModel::findById($rating['rkey']); $objArticle = \NewsModel::findPublishedByPid($objNews->pid); - + // Internal link if ($objArticle->source != 'external') { return $this->generateNewsUrl($objNews); } - + // Encode e-mail addresses if (substr($objArticle->url, 0, 7) == 'mailto:') { $strArticleUrl = \StringUtil::encodeEmail($objArticle->url); } - + // Ampersand URIs else { $strArticleUrl = ampersand($objArticle->url); } - + /** @var \PageModel $objPage */ global $objPage; - + // External link return $strArticleUrl; } @@ -180,15 +180,15 @@ class RateItTopRatingsModule extends RateItFrontend private function generateNewsUrl($objItem) { $strCacheKey = 'id_' . $objItem->id; - + // Load the URL from cache if (isset(self::$arrUrlCache[$strCacheKey])) { return self::$arrUrlCache[$strCacheKey]; } - + // Initialize the cache self::$arrUrlCache[$strCacheKey] = null; - + switch ($objItem->source) { // Link to an external page case 'external' : @@ -198,7 +198,7 @@ class RateItTopRatingsModule extends RateItFrontend self::$arrUrlCache[$strCacheKey] = ampersand($objItem->url); } break; - + // Link to an internal page case 'internal' : if (($objTarget = $objItem->getRelated('jumpTo')) !== null) { @@ -206,7 +206,7 @@ class RateItTopRatingsModule extends RateItFrontend self::$arrUrlCache[$strCacheKey] = ampersand($objTarget->getFrontendUrl()); } break; - + // Link to an article case 'article' : if (($objArticle = \ArticleModel::findByPk($objItem->articleId, array( @@ -217,25 +217,25 @@ class RateItTopRatingsModule extends RateItFrontend } break; } - + // Link to the default page if (self::$arrUrlCache[$strCacheKey] === null) { $objPage = \PageModel::findWithDetails($objItem->getRelated('pid')->jumpTo); - + if ($objPage === null) { self::$arrUrlCache[$strCacheKey] = ampersand(\Environment::get('request'), true); } else { self::$arrUrlCache[$strCacheKey] = ampersand($objPage->getFrontendUrl(((\Config::get('useAutoItem') && ! \Config::get('disableAlias')) ? '/' : '/items/') . ((! \Config::get('disableAlias') && $objItem->alias != '') ? $objItem->alias : $objItem->id))); } - + // Add the current archive parameter (news archive) if ($blnAddArchive && \Input::get('month') != '') { self::$arrUrlCache[$strCacheKey] .= (\Config::get('disableAlias') ? '&' : '?') . 'month=' . \Input::get('month'); } } - + return self::$arrUrlCache[$strCacheKey]; } } -?> \ No newline at end of file +?> diff --git a/src/Resources/contao/templates/j_colorbox_rateit.html5 b/src/Resources/contao/templates/j_colorbox_rateit.html5 index 73d372a..244cbd8 100644 --- a/src/Resources/contao/templates/j_colorbox_rateit.html5 +++ b/src/Resources/contao/templates/j_colorbox_rateit.html5 @@ -2,7 +2,7 @@ // Add the colorbox style sheet and javascript $GLOBALS['TL_CSS'][] = 'assets/jquery/colorbox/'. COLORBOX .'/css/colorbox.min.css||static'; -$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/jquery/colorbox/colorbox-rateit.min.js|static'; +$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/jquery/colorbox/colorbox-rateit.min.js|static'; ?> diff --git a/src/Resources/contao/templates/j_colorbox_rateit.xhtml b/src/Resources/contao/templates/j_colorbox_rateit.xhtml index 1691d5d..248c51e 100644 --- a/src/Resources/contao/templates/j_colorbox_rateit.xhtml +++ b/src/Resources/contao/templates/j_colorbox_rateit.xhtml @@ -2,7 +2,7 @@ // Add the colorbox style sheet and javascript $GLOBALS['TL_CSS'][] = 'assets/jquery/colorbox/'. COLORBOX .'/css/colorbox.min.css||static'; -$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/jquery/colorbox/colorbox-rateit.min.js|static'; +$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/jquery/colorbox/colorbox-rateit.min.js|static'; ?> diff --git a/src/Resources/contao/templates/moo_mediabox_rateit.html5 b/src/Resources/contao/templates/moo_mediabox_rateit.html5 index b78b0f9..f6c1fd1 100644 --- a/src/Resources/contao/templates/moo_mediabox_rateit.html5 +++ b/src/Resources/contao/templates/moo_mediabox_rateit.html5 @@ -2,7 +2,7 @@ // Add the mediabox style sheet and javascript $GLOBALS['TL_CSS'][] = 'assets/mootools/mediabox/'. MEDIABOX .'/css/mediaboxAdvBlack21.css||static'; -$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/mootools/mediabox/mediabox-rateit.js|static'; +$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/mootools/mediabox/mediabox-rateit.js|static'; ?> diff --git a/src/Resources/contao/templates/moo_mediabox_rateit.xhtml b/src/Resources/contao/templates/moo_mediabox_rateit.xhtml index 1edc5e8..b4ddfc1 100644 --- a/src/Resources/contao/templates/moo_mediabox_rateit.xhtml +++ b/src/Resources/contao/templates/moo_mediabox_rateit.xhtml @@ -2,7 +2,7 @@ // Add the mediabox style sheet $GLOBALS['TL_CSS'][] = 'assets/mootools/mediabox/'. MEDIABOX .'/css/mediaboxAdvBlack21.css||static'; -$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/public/js/mootools/mediabox/mediabox-rateit.js|static'; +$GLOBALS['TL_JAVASCRIPT'][] = 'bundles/cgoitrateit/js/mootools/mediabox/mediabox-rateit.js|static'; ?> diff --git a/src/Resources/public/js/rateit-uncompressed.js b/src/Resources/public/js/rateit-uncompressed.js index 22db8a3..ee8441f 100644 --- a/src/Resources/public/js/rateit-uncompressed.js +++ b/src/Resources/public/js/rateit-uncompressed.js @@ -567,14 +567,14 @@ function doRateIt() { jQuery(document).ready(function() { jQuery.ajax({ type: "GET", - url: "bundles/cgoitrateit/public/js/jquery-ui-effects.custom.min.js", + url: "bundles/cgoitrateit/js/jquery-ui-effects.custom.min.js", dataType: "script", async: false, cache: true }); jQuery.ajax({ type: "GET", - url: "bundles/cgoitrateit/public/js/helper.min.js", + url: "bundles/cgoitrateit/js/helper.min.js", dataType: "script", async: false, cache: true diff --git a/src/Resources/public/js/rateit.js b/src/Resources/public/js/rateit.js index c1d6469..ff597b2 100644 --- a/src/Resources/public/js/rateit.js +++ b/src/Resources/public/js/rateit.js @@ -20,5 +20,5 @@ el.data('selected').css('width',el.data('newFill'));},mouseCrap:function(event){ var fillPercent=self.getVotePercent(fill);var nextStep=Math.ceil((fillPercent/100)*self.options.max);var w=nextStep*self.options.starwidth;if(parseInt(el.data('hover').css('width'))!=w){el.data('selected').css('display','none');el.data('hover').css('width',Math.min(w,self.options.starwidth*self.options.max));el.data('hover').css('display','block');} var newFill=nextStep/self.options.max*100;self.fillVote(newFill,el);},getStarPercent:function(id){var stars=id.match(/(\d*\|?\d*)-(page|article|ce|module|news|faq|galpic|news4ward)-(\d*\.?\d+)_(\d*\.?\d+)$/);if(stars!=null){var score=parseFloat(stars[3]);var scale=parseFloat(stars[4]);var percent=(score/scale)*100;return percent;}else{return 0;}},getFillPercent:function(starPercent){return(starPercent/100)*(this.options.starwidth*this.options.max);},getVotePercent:function(actVote){var starsWidth=this.options.starwidth*this.options.max;var percent=(actVote/starsWidth*100).toFixed(2);return percent;},getRatableId:function(id){var stars=id.match(/(\d*\|?\d*)-(page|article|ce|module|news|faq|galpic|news4ward)-(\d*\.?\d+)_(\d*\.?\d+)$/);return stars!=null?stars[1]:'';},getRatableType:function(id){var stars=id.match(/(\d*\|?\d*)-(page|article|ce|module|news|faq|galpic|news4ward)-(\d*\.?\d+)_(\d*\.?\d+)$/);return stars!=null?stars[2]:'';},getRatableMaxValue:function(id){var stars=id.match(/(\d*\|?\d*)-(page|article|ce|module|news|faq|galpic|news4ward)-(\d*\.?\d+)_(\d*\.?\d+)$/);return stars!=null?parseInt(stars[4]):0;},setBackgroundPosition:function(el,pos){el.css('background-position','0% '+pos+'px');},getBackgroundImagePath:function(el){return el.css("background-image");},getBackgroundImage:function(el){var dfd=jQuery.Deferred();var backgroundImageSize=new Array();var reg_imgFile=/url\s*\(["']?(.*)["']?\)/i;var string=this.getBackgroundImagePath(el);string=string.match(reg_imgFile)[1];string=string.replace('\"','');jQuery('').attr('src',string).load(function(){backgroundImageSize.push(this.width);backgroundImageSize.push(this.height);dfd.resolve(backgroundImageSize);});return dfd.promise();},updateText:function(el,text){error=text.split('ERROR:')[1];el.data('textEl').removeClass('loading');if(error){this.RateItRating.showError(el,error);return false;} el.data('textEl').text(text);if(typeof(jQuery('.mbrateItRating'))!='undefined'&&el.data('id').indexOf('mb')==0){var mbid=el.attr('id');mbid=mbid.replace('mb','');if(typeof(arrRatings)=='object'){for(var ri=0;ri