9 Commits
3.4.2 ... 3.5.0

26 changed files with 98 additions and 108 deletions

View File

@ -92,13 +92,13 @@ class RateItArticle extends RateItFrontend {
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/onReadyRateIt.js|static';
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/rateit.js|static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/rateit.css||static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/rateit.min.css||static';
switch ($GLOBALS['TL_CONFIG']['rating_type']) {
case 'hearts' :
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.css||static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.min.css||static';
break;
default:
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.css||static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.min.css||static';
}
}
@ -150,13 +150,13 @@ class RateItArticle extends RateItFrontend {
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/onReadyRateIt.js|static';
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/rateit.js|static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/rateit.css||static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/rateit.min.css||static';
switch ($GLOBALS['TL_CONFIG']['rating_type']) {
case 'hearts' :
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.css||static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.min.css||static';
break;
default:
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.css||static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.min.css||static';
}
}
@ -234,13 +234,13 @@ class RateItArticle extends RateItFrontend {
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/onReadyRateIt.js|static';
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/rateit.js|static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/rateit.css||static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/rateit.min.css||static';
switch ($GLOBALS['TL_CONFIG']['rating_type']) {
case 'hearts' :
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.css||static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.min.css||static';
break;
default:
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.css||static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.min.css||static';
}
}

View File

@ -633,13 +633,9 @@ class rateitBackendModule extends \BackendModule
$cntSql = str_replace('%s', $where, $cntSql);
$count = $this->Database->prepare($cntSql)
->execute()
->fetchRow();
$count = $this->Database->query($cntSql)->fetchRow();
$arrRatingItems = $this->Database->prepare($sql)
->execute()
->fetchAllAssoc();
$arrRatingItems = $this->Database->query($sql)->fetchAllAssoc();
$arrReturn = array();
foreach ($arrRatingItems as $rating) {
if ($rating['active'] != '1') $rating['active'] = '0';

View File

@ -56,13 +56,13 @@ class RateItFaq extends RateItFrontend {
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/onReadyRateIt.js|static';
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/rateit.js|static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/rateit.css||static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/rateit.min.css||static';
switch ($GLOBALS['TL_CONFIG']['rating_type']) {
case 'hearts' :
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.css||static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.min.css||static';
break;
default:
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.css||static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.min.css||static';
}
}
}

View File

@ -68,13 +68,13 @@ abstract class RateItHybrid extends RateItFrontend
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/onReadyRateIt.js|static';
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/rateit.js|static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/rateit.css||static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/rateit.min.css||static';
switch ($this->strType) {
case 'hearts' :
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.css||static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.min.css||static';
break;
default:
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.css||static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.min.css||static';
}
return parent::generate();

View File

@ -71,13 +71,13 @@ class RateItNews extends RateItFrontend {
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/onReadyRateIt.js|static';
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/rateit.js|static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/rateit.css||static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/rateit.min.css||static';
switch ($GLOBALS['TL_CONFIG']['rating_type']) {
case 'hearts' :
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.css||static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.min.css||static';
break;
default:
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.css||static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.min.css||static';
}
}
}

View File

@ -40,10 +40,8 @@ class RateItPage extends \Frontend {
$this->loadDataContainer('settings');
}
public function outputFrontendTemplate($strContent, $strTemplate) {
global $objPage;
if ($objPage->addRating && !($strTemplate == $GLOBALS['TL_CONFIG']['rating_template'])) {
public function generatePage($objPage, $objLayout, $objPageType) {
if ($objPage->addRating) {
$actRecord = $this->Database->prepare("SELECT * FROM tl_rateit_items WHERE rkey=? and typ='page'")
->execute($objPage->id)
->fetchAssoc();
@ -57,16 +55,16 @@ class RateItPage extends \Frontend {
$rating .= $this->includeJs();
$rating .= $this->includeCss();
$posMainDiv = strpos($strContent, '<div id="main">');
$posInsideDiv = strpos($strContent, '<div class="inside">', $posMainDiv);
$return = substr($strContent, 0, $posInsideDiv).'<div class="inside">';
$return .= $rating;
$return .= substr($strContent, $posInsideDiv + strlen('<div id="inside">') + 3);
$strContent = $return;
$objTemplate = $objPageType->Template;
if ($objTemplate) {
if ($objPage->rateit_position == 'after') {
$objTemplate->main .= $rating;
} else {
$objTemplate->main = $rating.$objTemplate->main;
}
}
}
}
return $strContent;
}
private function includeCss() {

View File

@ -69,13 +69,13 @@ class RateItTopRatingsModule extends RateItFrontend
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/onReadyRateIt.js|static';
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/rateit.js|static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/rateit.css||static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/rateit.min.css||static';
switch ($GLOBALS['TL_CONFIG']['rating_type']) {
case 'hearts' :
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.css||static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/heart.min.css||static';
break;
default:
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.css||static';
$GLOBALS['TL_CSS'][] = 'system/modules/rateit/public/css/star.min.css||static';
}
return parent::generate();

View File

@ -22,11 +22,11 @@
"php":">=5.3",
"contao/core":">=3.0",
"contao-community-alliance/composer-plugin": "~2.0",
"cgo-it/simple_ajax":"1.0.1",
"leounglaub/contao-simple-ajax":"3.2.x-dev",
"cgo-it/xls_export":"3.0.0"
},
"replace": {
"cgo-it/rate-it": "self.version"
"cgo-it/rate-it": "<3.4.3"
},
"conflict": {
"contao/core": "2.11.*"

View File

@ -33,7 +33,7 @@ use cgoIT\rateit\RateItBackend;
/**
* Hooks
*/
$GLOBALS['TL_HOOKS']['outputFrontendTemplate'][] = array('rateit\\RateItPage', 'outputFrontendTemplate');
$GLOBALS['TL_HOOKS']['generatePage'][] = array('rateit\\RateItPage', 'generatePage');
$GLOBALS['TL_HOOKS']['simpleAjax'][] = array('rateit\\RateIt', 'doVote');
$GLOBALS['TL_HOOKS']['parseArticles'][] = array('rateit\\RateItNews', 'parseArticle');
$GLOBALS['TL_HOOKS']['getContentElement'][] = array('rateit\\RateItFaq', 'getContentElementRateIt');

View File

@ -75,6 +75,9 @@ class tl_content_rateit extends rateit\DcaHelper {
if ($dc->activeRecord->type == "gallery") {
$type = 'galpic';
// Alle vorherigen Bilder erst mal auf inaktiv setzen
$this->Database->prepare("UPDATE tl_rateit_items SET active='' WHERE rkey LIKE ? AND typ=?")->execute($dc->activeRecord->id.'|%', $type);
if (version_compare(VERSION, '3.2', '>=')) {
$objFiles = \FilesModel::findMultipleByUuids(deserialize($dc->activeRecord->multiSRC));
} else {
@ -131,56 +134,9 @@ class tl_content_rateit extends rateit\DcaHelper {
public function delete(\DC_Table $dc) {
if ($dc->activeRecord->type == "gallery") {
if (version_compare(VERSION, '3.2', '>=')) {
$objFiles = \FilesModel::findMultipleByUuids(deserialize($dc->activeRecord->multiSRC));
} else {
$objFiles = \FilesModel::findMultipleByIds(deserialize($dc->activeRecord->multiSRC));
}
// Get all images
while ($objFiles->next()) {
// Single files
if ($objFiles->type == 'file') {
$objFile = new \File($objFiles->path, true);
if (!$objFile->isGdImage) {
continue;
}
$rkey = $dc->activeRecord->id.'_'.$objFiles->id;
$this->Database->prepare("DELETE FROM tl_rateit_items WHERE rkey=? and typ=?")
->execute($rkey, 'galpic');
}
// Folders
else {
if (version_compare(VERSION, '3.2', '>=')) {
$objSubfiles = \FilesModel::findByPid($objFiles->uuid);
} else {
$objSubfiles = \FilesModel::findByPid($objFiles->id);
}
if ($objSubfiles === null) {
continue;
}
while ($objSubfiles->next()) {
// Skip subfolders
if ($objSubfiles->type == 'folder') {
continue;
}
$objFile = new \File($objSubfiles->path, true);
if (!$objFile->isGdImage) {
continue;
}
$rkey = $dc->activeRecord->id.'_'.$objSubfiles->id;
$this->Database->prepare("DELETE FROM tl_rateit_items WHERE rkey=? and typ=?")
->execute($rkey, 'galpic');
}
}
}
$this->Database->prepare("DELETE FROM tl_rateit_ratings WHERE pid IN (SELECT `id` FROM tl_rateit_items WHERE rkey LIKE ? AND typ=?)")
->execute($dc->activeRecord->id.'|%', 'galpic');
$this->Database->prepare("DELETE FROM tl_rateit_items WHERE rkey LIKE ? AND typ=?")->execute($dc->activeRecord->id.'|%', 'galpic');
return true;
} else {
return $this->deleteRatingKey($dc, 'ce');

View File

@ -65,7 +65,7 @@ $GLOBALS['TL_DCA']['tl_module']['fields']['rateit_types'] = array
'label' => &$GLOBALS['TL_LANG']['tl_module']['rateit_types'],
'exclude' => true,
'inputType' => 'checkboxWizard',
'options' => array('page', 'article', 'ce', 'module', 'news', 'faq', 'galpic'),
'options' => array('page', 'article', 'ce', 'module', 'news', 'faq', 'galpic', 'news4ward'),
'eval' => array('multiple'=>true, 'mandatory'=>true),
'reference' => &$GLOBALS['TL_LANG']['tl_module']['rateit_types'],
'sql' => "varchar(255) NOT NULL default ''"

View File

@ -39,6 +39,7 @@ $GLOBALS['TL_DCA']['tl_page']['config']['ondelete_callback'][] = array('tl_page_
/**
* Palettes
*/
$GLOBALS['TL_DCA']['tl_page']['palettes']['__selector__'][] = 'addRating';
foreach ($GLOBALS['TL_DCA']['tl_page']['palettes'] as $keyPalette => $valuePalette)
{
// Skip if we have a array or the palettes for subselections
@ -53,13 +54,31 @@ foreach ($GLOBALS['TL_DCA']['tl_page']['palettes'] as $keyPalette => $valuePalet
$GLOBALS['TL_DCA']['tl_page']['palettes'][$keyPalette] = $valuePalette;
}
/**
* Add subpalettes to tl_page
*/
$GLOBALS['TL_DCA']['tl_page']['subpalettes']['addRating'] = 'rateit_position';
// Fields
$GLOBALS['TL_DCA']['tl_page']['fields']['addRating'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_page']['addRating'],
'label' => &$GLOBALS['TL_LANG']['tl_page']['addRating'],
'exclude' => true,
'inputType' => 'checkbox',
'sql' => "char(1) NOT NULL default ''",
'eval' => array('tl_class'=>'w50 m12', 'submitOnChange'=>true)
);
$GLOBALS['TL_DCA']['tl_page']['fields']['rateit_position'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_page']['rateit_position'],
'default' => 'before',
'exclude' => true,
'inputType' => 'select',
'options' => array('after', 'before'),
'reference' => &$GLOBALS['TL_LANG']['tl_page'],
'sql' => "varchar(6) NOT NULL default ''",
'eval' => array('mandatory'=>true, 'tl_class'=>'w50')
);
class tl_page_rateit extends rateit\DcaHelper {

View File

@ -38,7 +38,7 @@ $GLOBALS['TL_LANG']['tl_module']['rateit_legend'] = 'Rate It-Einstellungen';
*/
$GLOBALS['TL_LANG']['tl_module']['rateit_title'] = array('Titel der Bewertung', 'Titel der Bewertung (wird im Backend angezeigt).');
$GLOBALS['TL_LANG']['tl_module']['rateit_active'] = array('Aktiv', 'Aktiv bedeutet, dass die Bewertung sichtbar für den Frontend-Nutzer ist.');
$GLOBALS['TL_LANG']['tl_module']['rateit_types'] = array('Seite', 'Artikel', 'Inhaltselement', 'Modul', 'Nachrichten', 'FAQ', 'Galeriebild');
$GLOBALS['TL_LANG']['tl_module']['rateit_types'] = array('Typen', 'Art der Bewertung');
$GLOBALS['TL_LANG']['tl_module']['rateit_count'] = array('Max. Anzahl', 'Max. Anzahl anzuzeigender Einträge.');
$GLOBALS['TL_LANG']['tl_module']['rateit_toptype'] = array('Art der Liste', 'Die x bestbewerteten Einträge oder die x meistbewerteten Einträge.');
$GLOBALS['TL_LANG']['tl_module']['rateit_template'] = array('Template', 'Hier können Sie das Template für die Bewertung des Artikels auswählen.');
@ -50,6 +50,7 @@ $GLOBALS['TL_LANG']['tl_module']['rateit_types']['module'] = 'Modul';
$GLOBALS['TL_LANG']['tl_module']['rateit_types']['news'] = 'Nachrichten';
$GLOBALS['TL_LANG']['tl_module']['rateit_types']['faq'] = 'FAQ';
$GLOBALS['TL_LANG']['tl_module']['rateit_types']['galpic'] = 'Galeriebild';
$GLOBALS['TL_LANG']['tl_module']['rateit_types']['news4ward'] = 'Beitrag';
$GLOBALS['TL_LANG']['tl_module']['rateit_toptype']['best'] = 'Beste Bewertungen';
$GLOBALS['TL_LANG']['tl_module']['rateit_toptype']['most'] = 'Meiste Bewertungen';

View File

@ -31,6 +31,10 @@
$GLOBALS['TL_LANG']['tl_page']['rateit_legend'] = 'Rate It-Einstellungen';
$GLOBALS['TL_LANG']['tl_page']['addRating'] = array('Rating aktivieren', 'Aktiviert das Rating für diese Seite');
$GLOBALS['TL_LANG']['tl_page']['addRating'] = array('Rating aktivieren', 'Aktiviert das Rating für diese Seite');
$GLOBALS['TL_LANG']['tl_page']['rateit_position'] = array('Position', 'Position des Rating (ober- oder unterhalb) der Seite.');
$GLOBALS['TL_LANG']['tl_page']['before'] = array('oberhalb', 'Anzeige des Texts oberhalb der Seite');
$GLOBALS['TL_LANG']['tl_page']['after'] = array('unterhalb', 'Anzeige des Texts unterhalb der Seite');
?>

View File

@ -50,6 +50,7 @@ $GLOBALS['TL_LANG']['tl_module']['rateit_types']['module'] = 'Module';
$GLOBALS['TL_LANG']['tl_module']['rateit_types']['news'] = 'News';
$GLOBALS['TL_LANG']['tl_module']['rateit_types']['faq'] = 'FAQ';
$GLOBALS['TL_LANG']['tl_module']['rateit_types']['galpic'] = 'Gallery Picture';
$GLOBALS['TL_LANG']['tl_module']['rateit_types']['news4ward'] = 'Blog entry';
$GLOBALS['TL_LANG']['tl_module']['rateit_toptype']['best'] = 'Best votes';
$GLOBALS['TL_LANG']['tl_module']['rateit_toptype']['most'] = 'Most votes';

View File

@ -31,6 +31,10 @@
$GLOBALS['TL_LANG']['tl_page']['rateit_legend'] = 'Rate It-Settings';
$GLOBALS['TL_LANG']['tl_page']['addRating'] = array('activate rating', 'Enables the rating for this page');
$GLOBALS['TL_LANG']['tl_page']['addRating'] = array('activate rating', 'Enables the rating for this page');
$GLOBALS['TL_LANG']['tl_page']['rateit_position'] = array('position', 'position of the rating (before or above) the page.');
$GLOBALS['TL_LANG']['tl_page']['before'] = array('above', 'Display the text above the page');
$GLOBALS['TL_LANG']['tl_page']['after'] = array('below', 'Display the text below the page');
?>

1
public/css/heart.min.css vendored Normal file
View File

@ -0,0 +1 @@
.mbrateItRating .wrapper,.rateItRating .wrapper{background:url(../images/heart.gif)}div.mbrateItRating div.rateItRating-hover,div.mbrateItRating div.rateItRating-selected,div.rateItRating div.rateItRating-hover,div.rateItRating div.rateItRating-selected{background:url(../images/heart.gif) left}

1
public/css/rateit.min.css vendored Normal file
View File

@ -0,0 +1 @@
.rateItRating{position:relative;display:inline-block}.mbrateItRating{position:relative;opacity:1}.mbrateItRating .wrapper,.rateItRating .wrapper{cursor:pointer;position:relative;diplay:inline-block;height:16px}.rateItRating[rel=not-rateable]{float:right}.rateItRating[rel=not-rateable] .wrapper{cursor:default}div.mod_rateit_top_ratings ul{padding:0}div.mod_rateit_top_ratings li{list-style-type:none}div.mod_rateit_top_ratings div.rateItTitle{display:inline-block;max-width:40%;min-height:30px}div.mbrateItRating div.rateItRating-hover,div.mbrateItRating div.rateItRating-selected,div.rateItRating div.rateItRating-hover,div.rateItRating div.rateItRating-selected{position:absolute}.rateItRating .ratingText{color:#000}.mbrateItRating .mbratingText{display:inline-block;color:#ccc}.ratingText.ratingError{color:red}.mbrateItRating .mbratingText.loading,.rateItRating .ratingText.loading{background:url(../images/ajax-loading.gif) no-repeat}span.rating-microdata{display:none}

1
public/css/star.min.css vendored Normal file
View File

@ -0,0 +1 @@
.mbrateItRating .wrapper,.rateItRating .wrapper{background:url(../images/star.gif)}div.mbrateItRating div.rateItRating-hover,div.mbrateItRating div.rateItRating-selected,div.rateItRating div.rateItRating-hover,div.rateItRating div.rateItRating-selected{background:url(../images/star.gif) left}

8
public/js/helper.min.js vendored Normal file
View File

@ -0,0 +1,8 @@
if(typeof Object.create!=='function'){Object.create=function(o){function F(){}
F.prototype=o;return new F();};}
function $tryCatch(){for(var i=0,l=arguments.length;i<l;i++){try{return arguments[i]();}catch(e){}}
return null;};var Browser={Engine:{name:'unknown',version:0},Platform:{name:(window.orientation!=undefined)?'ipod':(navigator.platform.match(/mac|win|linux/i)||['other'])[0].toLowerCase()},Features:{xpath:!!(document.evaluate),air:!!(window.runtime),query:!!(document.querySelector)},Plugins:{},Engines:{presto:function(){return(!window.opera)?false:((arguments.callee.caller)?960:((document.getElementsByClassName)?950:925));},trident:function(){return(!window.ActiveXObject)?false:((window.XMLHttpRequest)?((document.querySelectorAll)?6:5):4);},webkit:function(){return(navigator.taintEnabled)?false:((Browser.Features.xpath)?((Browser.Features.query)?525:420):419);},gecko:function(){return(!document.getBoxObjectFor&&window.mozInnerScreenX==null)?false:((document.getElementsByClassName)?19:18);}}};Browser.Platform[Browser.Platform.name]=true;Browser.detect=function(){for(var engine in this.Engines){var version=this.Engines[engine]();if(version){this.Engine={name:engine,version:version};this.Engine[engine]=this.Engine[engine+version]=true;break;}}
return{name:engine,version:version};};Browser.detect();Browser.Request=function(){return $tryCatch(function(){return new XMLHttpRequest();},function(){return new ActiveXObject('MSXML2.XMLHTTP');},function(){return new ActiveXObject('Microsoft.XMLHTTP');});};Browser.Features.xhr=!!(Browser.Request());Browser.Plugins.Flash=(function(){var version=($tryCatch(function(){return navigator.plugins['Shockwave Flash'].description;},function(){return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version');})||'0 r0').match(/\d+/g);return{version:parseInt(version[0]||0+'.'+version[1],10)||0,build:parseInt(version[2],10)||0};})();function $exec(text){if(!text)return text;if(window.execScript){window.execScript(text);}else{var script=document.createElement('script');script.setAttribute('type','text/javascript');script[(Browser.Engine.webkit&&Browser.Engine.version<420)?'innerText':'text']=text;document.head.appendChild(script);document.head.removeChild(script);}
return text;};function getPosition(element){var xPosition=0;var yPosition=0;while(element){xPosition+=(element.offsetLeft-element.scrollLeft+element.clientLeft);yPosition+=(element.offsetTop-element.scrollTop+element.clientTop);element=element.offsetParent;}
return{x:xPosition,y:yPosition};}

View File

@ -574,7 +574,7 @@ function doRateIt() {
});
jQuery.ajax({
type: "GET",
url: "system/modules/rateit/public/js/helper.js",
url: "system/modules/rateit/public/js/helper.min.js",
dataType: "script",
async: false,
cache: true

View File

@ -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('<img/>').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<arrRatings.length;ri++){if(arrRatings[ri].rateItID==mbid){arrRatings[ri].description=text;break;}}}
if(typeof(jQuery('#'+jEscape(mbid)))!='undefined'){jQuery('#'+jEscape(mbid)).find('.ratingText').text(text);}}else{if(typeof(arrRatings)=='object'){for(var ri=0;ri<arrRatings.length;ri++){if(arrRatings[ri].rateItID==el.data('id')){arrRatings[ri].description=text;break;}}}}},showError:function(el,error){el.data('textEl').addClass('ratingError');el.data('textEl').text(error);setTimeout(function(){el.data('textEl').text(el.data('oldTxt'));el.data('textEl').removeClass('ratingError');},2000);}};})(jQuery);jQuery(document).ready(function(){jQuery.ajax({type:"GET",url:"system/modules/rateit/public/js/jquery-ui-effects.custom.min.js",dataType:"script",async:false,cache:true});jQuery.ajax({type:"GET",url:"system/modules/rateit/public/js/helper.js",dataType:"script",async:false,cache:true});RateItRating=Object.create(RateItRatings).initialize({url:'SimpleAjax.php'});});var jEscape=function(jquery){jquery=jquery.replace(new RegExp("\\$","g"),"\\$");jquery=jquery.replace(new RegExp("\~","g"),"\\~");jquery=jquery.replace(new RegExp("\\[","g"),"\\[");jquery=jquery.replace(new RegExp("\\]","g"),"\\]");jquery=jquery.replace(new RegExp("\\|","g"),"\\|");jquery=jquery.replace(new RegExp("\\.","g"),"\\.");jquery=jquery.replace(new RegExp("#","g"),"\\#");return jquery;};}}
if(typeof(jQuery('#'+jEscape(mbid)))!='undefined'){jQuery('#'+jEscape(mbid)).find('.ratingText').text(text);}}else{if(typeof(arrRatings)=='object'){for(var ri=0;ri<arrRatings.length;ri++){if(arrRatings[ri].rateItID==el.data('id')){arrRatings[ri].description=text;break;}}}}},showError:function(el,error){el.data('textEl').addClass('ratingError');el.data('textEl').text(error);setTimeout(function(){el.data('textEl').text(el.data('oldTxt'));el.data('textEl').removeClass('ratingError');},2000);}};})(jQuery);jQuery(document).ready(function(){jQuery.ajax({type:"GET",url:"system/modules/rateit/public/js/jquery-ui-effects.custom.min.js",dataType:"script",async:false,cache:true});jQuery.ajax({type:"GET",url:"system/modules/rateit/public/js/helper.min.js",dataType:"script",async:false,cache:true});RateItRating=Object.create(RateItRatings).initialize({url:'SimpleAjax.php'});});var jEscape=function(jquery){jquery=jquery.replace(new RegExp("\\$","g"),"\\$");jquery=jquery.replace(new RegExp("\~","g"),"\\~");jquery=jquery.replace(new RegExp("\\[","g"),"\\[");jquery=jquery.replace(new RegExp("\\]","g"),"\\]");jquery=jquery.replace(new RegExp("\\|","g"),"\\|");jquery=jquery.replace(new RegExp("\\.","g"),"\\.");jquery=jquery.replace(new RegExp("#","g"),"\\#");return jquery;};}}
onReadyRateIt(function(){doRateIt();});

View File

@ -1,11 +1,11 @@
<?php
// Add the colorbox style sheet
// Add the colorbox style sheet and javascript
$GLOBALS['TL_CSS'][] = 'assets/jquery/colorbox/'. COLORBOX .'/css/colorbox.min.css||static';
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/jquery/colorbox/colorbox-rateit.min.js|static';
?>
<script src="system/modules/rateit/public/js/jquery/colorbox/colorbox-rateit.min.js"></script>
<script>
(function($) {
$(document).ready(function() {

View File

@ -1,11 +1,11 @@
<?php
// Add the colorbox style sheet
// Add the colorbox style sheet and javascript
$GLOBALS['TL_CSS'][] = 'assets/jquery/colorbox/'. COLORBOX .'/css/colorbox.min.css||static';
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/jquery/colorbox/colorbox-rateit.min.js|static';
?>
<script type="text/javascript" src="system/modules/rateit/public/js/jquery/colorbox/colorbox-rateit.min.js"></script>
<script type="text/javascript">
/* <![CDATA[ */
(function($) {

View File

@ -1,11 +1,11 @@
<?php
// Add the mediabox style sheet
// Add the mediabox style sheet and javascript
$GLOBALS['TL_CSS'][] = 'assets/mootools/mediabox/'. MEDIABOX .'/css/mediaboxAdvBlack21.css||static';
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/mootools/mediabox/mediabox-rateit.js|static';
?>
<script src="system/modules/rateit/public/js/mootools/mediabox/mediabox-rateit.js"></script>
<script>
(function($) {
window.addEvent('domready', function() {

View File

@ -2,10 +2,10 @@
// Add the mediabox style sheet
$GLOBALS['TL_CSS'][] = 'assets/mootools/mediabox/'. MEDIABOX .'/css/mediaboxAdvBlack21.css||static';
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rateit/public/js/mootools/mediabox/mediabox-rateit.js|static';
?>
<script type="text/javascript" src="system/modules/rateit/public/js/mootools/mediabox/mediabox-rateit.js"></script>
<script type="text/javascript">
/* <![CDATA[ */
(function($) {