-
Notifications
You must be signed in to change notification settings - Fork 0
/
infiniteAjaxScroll.php
executable file
·115 lines (109 loc) · 2.87 KB
/
infiniteAjaxScroll.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?php
/**
* Classe infiniteAjaxScroll
*
* @version 1.2
* @date 19/11/2013
* @author i M@N
**/
class infiniteAjaxScroll extends plxPlugin {
/**
* Constructeur de la classe
*
* @return null
* @author i M@N
**/
public function __construct($default_lang) {
# Appel du constructeur de la classe plxPlugin (obligatoire)
parent::__construct($default_lang);
$this->setConfigProfil(PROFIL_ADMIN);
# Ajouts des hooks
$this->addHook('ThemeEndHead', 'ThemeEndHead');
$this->addHook('ThemeEndBody', 'ThemeEndBody');
}
/**
* Méthode pour afficher la mise en page
*
* @author i M@N
*/
public function ThemeEndHead()
{
echo "\t".'<link rel="stylesheet" type="text/css" href="'.PLX_PLUGINS.'infiniteAjaxScroll/ias.css" media="screen" />'."\n";
}
/**
* Méthode pour afficher le javascript
*
* @author i M@N
*/
public function ThemeEndBody()
{
/*require PluXML jQuery plugin*/
echo '<script type="text/javascript">
/* <![CDATA[ */
!window.jQuery && document.write(\'<script type="text/javascript" src="<?php echo PLX_PLUGINS;?>jquery/jquery.min.js"><\/script>\');
/* !]]> */
</script>
<script type="text/javascript" src="'.PLX_PLUGINS.'infiniteAjaxScroll/jquery.ias.js"></script>
<script type="text/javascript">
$(document).ready(function() {
/* ias */
$.ias({
container : \'#article\',
item: \'.article\',
pagination: \'#pagination\',
next: \'span.p_next a\',
loader: \'<img src="'.PLX_PLUGINS.'infiniteAjaxScroll/loader.gif" />\',
history: false,
triggerPageThreshold: 100,
//trigger: "Charger plus d\'articles",
thresholdMargin: -200,
//noneleft: "Fin",
/* plugins */
onRenderComplete: function(items) {
/* zoombox */
if($.isFunction($.zoombox)) {
$(\'a.zoombox\').zoombox();
// You can also use specific options
$(\'a.zoombox\').zoombox({
theme : \'zoombox\', // available themes : zoombox, lightbox, prettyphoto, darkprettyphoto, simple
opacity : 0.8, // Black overlay opacity
duration : 800, // Animation duration
animation : true, // Do we have to animate the box ?
width : 800, // Default width
height : 600, // Default height
gallery : true, // Allow gallery thumb view
autoplay : false // Autoplay for video
});
}
else {
/* doesnt exists... cry?!? */
return false;
}
/* fitvids */
if($(".fitvids").fitVids()) {
$(".fitvids").fitVids();
}
else {
/* doesnt exists... cry?!? */
return false;
}
/* SyntaxHighlighter */
if($(\'pre\').each(function(i){})) {
var reg = RegExp(\'<br>\',\'g\');
$(\'pre\').each(function(i) {
var content = $(this).html();
content = content.replace(reg,"\n");
$(this).html(content);
});
SyntaxHighlighter.highlight({\'toolbar\' : \'false\'});
}
else {
/* doesnt exists... cry?!? */
return false;
}
}
});
})
</script>'."\n";
}
}