Enjoy Instagram feed on website with WordPress Widget and Shortcode - Version 1.5.1

Version Description

* Bugs Fix

Download this release

Release Info

Developer mediabeta
Plugin Icon 128x128 Enjoy Instagram feed on website with WordPress Widget and Shortcode
Version 1.5.1
Comparing to
See all releases

Version 1.5.1

Files changed (49) hide show
  1. css/enjoyinstagram_settings.css +95 -0
  2. css/grid_demo.css +178 -0
  3. css/grid_fallback.css +12 -0
  4. css/grid_style.css +132 -0
  5. css/owl.carousel.css +74 -0
  6. css/owl.theme.css +79 -0
  7. css/owl.transitions.css +163 -0
  8. css/swipebox.css +264 -0
  9. enjoyinstagram.php +505 -0
  10. images/AjaxLoader.gif +0 -0
  11. images/ImageAttribution.txt +2 -0
  12. images/Instagram-icon.png +0 -0
  13. images/bg.jpg +0 -0
  14. images/buymeacoffee.png +0 -0
  15. images/carousel.png +0 -0
  16. images/enjoyinstagram.png +0 -0
  17. images/grabbing.png +0 -0
  18. images/griglia.png +0 -0
  19. images/icon_enjoyinstagram.png +0 -0
  20. images/icons.png +0 -0
  21. images/icons.svg +1 -0
  22. images/light.png +0 -0
  23. images/loader.gif +0 -0
  24. images/loading.gif +0 -0
  25. js/ios-orientationchange-fix.js +56 -0
  26. js/jquery.gridrotator copia.js +756 -0
  27. js/jquery.gridrotator.js +827 -0
  28. js/jquery.swipebox.js +717 -0
  29. js/modernizr.custom.26633.js +4 -0
  30. js/owl.carousel.js +1512 -0
  31. js/shortcode_button.js +41 -0
  32. library/autenticazione.php +156 -0
  33. library/enjoyinstagram_shortcode.php +82 -0
  34. library/enjoyinstagram_shortcode_grid.php +92 -0
  35. library/enjoyinstagram_shortcode_grid_widget.php +88 -0
  36. library/enjoyinstagram_shortcode_widget.php +69 -0
  37. library/impostazioni_shortcode.php +158 -0
  38. library/instagram.class.php +569 -0
  39. library/profile_auth.php +18 -0
  40. library/shortcode_button.php +30 -0
  41. library/widgets.php +116 -0
  42. library/widgets_grid.php +116 -0
  43. readme.txt +118 -0
  44. tinymce/ajax.php +23 -0
  45. tinymce/editor_plugin.js +42 -0
  46. tinymce/enjoyinstagramtinymce.js +26 -0
  47. tinymce/icon_enjoyinstagram.png +0 -0
  48. tinymce/tinymce.php +82 -0
  49. tinymce/window.php +48 -0
css/enjoyinstagram_settings.css ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ei_block {
2
+ display:table;
3
+ width:100%;
4
+ }
5
+ .ei_left_block {
6
+ display:block;
7
+ float:left;
8
+ width:280px;
9
+ }
10
+ .ei_hard_block {
11
+ display:block;
12
+ float:none;
13
+ }
14
+ .ei_twitter_block {
15
+ display:inline-block;
16
+ float:left;
17
+ margin-top:6px;
18
+ }
19
+ .ei_facebook_block {
20
+ display:inline-block;
21
+ float:right;
22
+ }
23
+ #buy_me_a_coffee {
24
+ background-repeat:no-repeat;
25
+ border-left: 4px solid #7ad03a;
26
+ -webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
27
+ box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
28
+ display:block;
29
+ float:right;
30
+ }
31
+ #premium_release{
32
+ padding: 10px;
33
+ border-left: 4px solid #FF7400;
34
+ background: #B6FFB4;
35
+ -webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
36
+ box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
37
+ display:block;
38
+ margin: 10px auto;
39
+ }
40
+ .pad_coffee {
41
+ display:block;
42
+ float:none;
43
+ margin-left:90px;
44
+ width:235px;
45
+ padding:8px;
46
+ }
47
+ .coffee_title {
48
+ font-size:0.8;
49
+ }
50
+
51
+
52
+ #enjoy_user_profile {
53
+ width:124px;
54
+ padding-top:3px;
55
+ margin-right:25px;
56
+ text-align:center;
57
+ display:inline-block;
58
+ float:left;
59
+ }
60
+ .ei_top{
61
+ margin-top:30px;
62
+ }
63
+
64
+ .enjoy_user_profile {
65
+ border-radius: 50%;
66
+ width:120px;
67
+ height:120px;
68
+ margin:auto 0;
69
+ border: 2px solid #e2e2e2;
70
+ margin-bottom:12px;
71
+
72
+ }
73
+
74
+
75
+
76
+
77
+
78
+ .desc {
79
+ padding: 15px;
80
+ }
81
+ .enfasi {
82
+ font-size:1rem;
83
+ }
84
+ .ei_settings_float_block{
85
+ display:inline-block;
86
+ float:left;
87
+ margin-right:1.5rem;
88
+ }
89
+ .ei_fixed {
90
+ width:240px;
91
+ }
92
+ .ei_sel {
93
+ width: 75px;
94
+ }
95
+
css/grid_demo.css ADDED
@@ -0,0 +1,178 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import url(http://fonts.googleapis.com/css?family=Lato:300,400,700);
2
+
3
+ *,
4
+ *:after,
5
+ *:before {
6
+ -webkit-box-sizing: border-box;
7
+ -moz-box-sizing: border-box;
8
+ box-sizing: border-box;
9
+ padding: 0;
10
+ margin: 0;
11
+ }
12
+
13
+ /* General Demo Style */
14
+ body {
15
+ font-family: 'Lato', 'Myriad Pro','Trebuchet MS', sans-serif;
16
+ background: #f9f9f9 url(../images/bg.jpg) repeat top left;
17
+ font-weight: 300;
18
+ font-size: 14px;
19
+ color: #333;
20
+ overflow: scroll;
21
+ overflow-x: hidden;
22
+ }
23
+
24
+ a {
25
+ color: #555;
26
+ text-decoration: none;
27
+ }
28
+
29
+ a img {
30
+ border: none;
31
+ }
32
+
33
+ .container {
34
+ position: relative;
35
+ background: transparent url(../images/light.png) fixed no-repeat center top;
36
+ }
37
+
38
+ .codrops-header{
39
+ margin: 10px;
40
+ padding: 20px 10px 10px 10px;
41
+ position: relative;
42
+ display: block;
43
+ text-align: center;
44
+ text-shadow: 0 1px 1px rgba(255,255,255,0.7);
45
+ }
46
+
47
+ .codrops-header h1,
48
+ .codrops-header-special h1{
49
+ font-size: 26px;
50
+ line-height: 26px;
51
+ margin: 0;
52
+ position: relative;
53
+ font-weight: 700;
54
+ color: #000;
55
+ }
56
+
57
+ .codrops-header h2,
58
+ .codrops-header-special h2{
59
+ font-size: 14px;
60
+ line-height: 14px;
61
+ font-weight: 300;
62
+ margin: 0;
63
+ padding: 3px 5px;
64
+ margin: 10px 0 5px;
65
+ color: #000;
66
+ display: inline-block;
67
+ }
68
+
69
+ /* Header Style */
70
+ .codrops-top {
71
+ line-height: 24px;
72
+ font-size: 11px;
73
+ background: #fff;
74
+ background: rgba(255, 255, 255, 0.8);
75
+ text-transform: uppercase;
76
+ z-index: 9999;
77
+ position: relative;
78
+ box-shadow: 1px 0px 2px rgba(0,0,0,0.2);
79
+ }
80
+
81
+ .codrops-top a {
82
+ padding: 0px 10px;
83
+ letter-spacing: 1px;
84
+ color: #333;
85
+ display: inline-block;
86
+ }
87
+
88
+ .codrops-top a:hover {
89
+ background: rgba(255,255,255,0.3);
90
+ }
91
+
92
+ .codrops-top span.right {
93
+ float: right;
94
+ }
95
+ .codrops-top span.right a {
96
+ float: left;
97
+ display: block;
98
+ }
99
+
100
+ .codrops-info {
101
+ padding: 20px;
102
+ margin: 0 auto;
103
+ text-align: center;
104
+ text-shadow: 0 1px 1px rgba(255,255,255,0.7);
105
+ line-height: 22px;
106
+ }
107
+
108
+ /* Demo Buttons Style */
109
+ .codrops-demos{
110
+ text-align: center;
111
+ display: block;
112
+ line-height: 30px;
113
+ padding: 5px 0px;
114
+ }
115
+ .codrops-demos a{
116
+ display: inline-block;
117
+ margin: 0px 10px;
118
+ font-weight: bold;
119
+ color: #333;
120
+ line-height: 20px;
121
+ font-size: 12px;
122
+ background: #fff;
123
+ background: rgba(255,255,255,0.4);
124
+ padding: 0 4px;
125
+ }
126
+ .codrops-demos a:hover{
127
+ border-bottom: 2px solid #f7bb6d;
128
+ }
129
+ .codrops-demos a.current-demo,
130
+ .codrops-demos a.current-demo:hover{
131
+ border-bottom: 2px solid #f7bb6d;
132
+ color: #777;
133
+ }
134
+
135
+ .codrops-header-special{
136
+ position: absolute;
137
+ top: 80px;
138
+ left: 0px;
139
+ text-align: left;
140
+ }
141
+
142
+ .codrops-header-special h2{
143
+ padding: 5px 20px 5px 10px;
144
+ color: #fff;
145
+ line-height: 26px;
146
+ background: #000;
147
+ background: rgba(0,0,0,0.8);
148
+ }
149
+
150
+ .codrops-header-special h1{
151
+ background: #000;
152
+ background: rgba(0,0,0,0.8);
153
+ display: inline-block;
154
+ font-size: 32px;
155
+ line-height: 32px;
156
+ padding: 20px;
157
+ color: #fff;
158
+ text-shadow: 0 0 1px #fff;
159
+ }
160
+
161
+ .codrops-header-special .codrops-demos{
162
+ text-align: left;
163
+ }
164
+
165
+ .codrops-header-special .codrops-demos a{
166
+ background: rgba(255,255,255,1);
167
+ }
168
+
169
+ .codrops-header-special .codrops-info{
170
+ color: #fff;
171
+ background: #000;
172
+ background: rgba(0,0,0,0.8);
173
+ text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
174
+ padding: 5px 20px 5px 10px;
175
+ line-height: 26px;
176
+ margin-top: 30px;
177
+ text-align: left;
178
+ }
css/grid_fallback.css ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ri-grid{
2
+ width: 600px;
3
+ }
4
+
5
+ .ri-grid ul li,
6
+ .ri-grid ul li a{
7
+ width: 100px;
8
+ height: 100px;
9
+ }
10
+ .ri-grid ul li a img{
11
+ width: 100%;
12
+ }
css/grid_style.css ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ri-grid{
2
+ margin: 30px auto 30px;
3
+ position: relative;
4
+ height: auto;
5
+ }
6
+
7
+ .ri-grid ul {
8
+ list-style: none;
9
+ display: block;
10
+ width: 100%;
11
+ margin: 0;
12
+ padding: 0;
13
+ }
14
+
15
+ /* Clear floats by Nicolas Gallagher: http://nicolasgallagher.com/micro-clearfix-hack/ */
16
+
17
+ .ri-grid ul:before,
18
+ .ri-grid ul:after{
19
+ content: '';
20
+ display: table;
21
+ }
22
+
23
+ .ri-grid ul:after {
24
+ clear: both;
25
+ }
26
+
27
+ .ri-grid ul {
28
+ zoom: 1; /* For IE 6/7 (trigger hasLayout) */
29
+ }
30
+
31
+ .ri-grid ul li {
32
+ -webkit-perspective: 400px;
33
+ -moz-perspective: 400px;
34
+ -o-perspective: 400px;
35
+ -ms-perspective: 400px;
36
+ perspective: 400px;
37
+ margin: 0;
38
+ padding: 0;
39
+ float: left;
40
+ position: relative;
41
+ display: block;
42
+ overflow: hidden;
43
+ background: #000;
44
+ }
45
+
46
+ .ri-grid ul li a{
47
+ display: block;
48
+ outline: none;
49
+ position: absolute;
50
+ left: 0;
51
+ top: 0;
52
+ width: 100%;
53
+ height: 100%;
54
+ -webkit-backface-visibility: hidden;
55
+ -moz-backface-visibility: hidden;
56
+ -o-backface-visibility: hidden;
57
+ -ms-backface-visibility: hidden;
58
+ backface-visibility: hidden;
59
+ -webkit-transform-style: preserve-3d;
60
+ -moz-transform-style: preserve-3d;
61
+ -o-transform-style: preserve-3d;
62
+ -ms-transform-style: preserve-3d;
63
+ transform-style: preserve-3d;
64
+ -webkit-background-size: 100% 100%;
65
+ -moz-background-size: 100% 100%;
66
+ background-size: 100% 100%;
67
+ background-position: center center;
68
+ background-repeat: no-repeat;
69
+ background-color: #333;
70
+ -webkit-box-sizing: content-box;
71
+ -moz-box-sizing: content-box;
72
+ box-sizing: content-box;
73
+ }
74
+
75
+ /* Grid wrapper sizes */
76
+ .ri-grid-size-1{
77
+ width: 55%;
78
+ }
79
+ .ri-grid-size-2{
80
+ width: 100%;
81
+ }
82
+ .ri-grid-size-3{
83
+ width: 100%;
84
+ margin-top: 0px;
85
+ }
86
+
87
+ /* Shadow style */
88
+ .ri-shadow:after,
89
+ .ri-shadow:before{
90
+ content: "";
91
+ position: absolute;
92
+ z-index: -2;
93
+ bottom: 15px;
94
+ left: 10px;
95
+ width: 50%;
96
+ height: 20%;
97
+ max-width: 300px;
98
+ max-height: 100px;
99
+ box-shadow: 0 15px 10px rgba(0, 0, 0, 0.7);
100
+ -webkit-transform: rotate(-3deg);
101
+ -moz-transform: rotate(-3deg);
102
+ -ms-transform: rotate(-3deg);
103
+ -o-transform: rotate(-3deg);
104
+ transform: rotate(-3deg);
105
+ }
106
+ .ri-shadow:after{
107
+ right: 10px;
108
+ left: auto;
109
+ -webkit-transform: rotate(3deg);
110
+ -moz-transform: rotate(3deg);
111
+ -ms-transform: rotate(3deg);
112
+ -o-transform: rotate(3deg);
113
+ transform: rotate(3deg);
114
+ }
115
+
116
+ .ri-grid-loading:after,
117
+ .ri-grid-loading:before{
118
+ display: none;
119
+ }
120
+
121
+ .ri-loading-image{
122
+ display: none;
123
+ }
124
+
125
+ .ri-grid-loading .ri-loading-image{
126
+ position: relative;
127
+ width: 30px;
128
+ height: 30px;
129
+ left: 50%;
130
+ margin: 100px 0 0 -15px;
131
+ display: block;
132
+ }
css/owl.carousel.css ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Core Owl Carousel CSS File
3
+ * v1.3.2
4
+ */
5
+
6
+ /* clearfix */
7
+ .owl-carousel .owl-wrapper:after {
8
+ content: ".";
9
+ display: block;
10
+ clear: both;
11
+ visibility: hidden;
12
+ line-height: 0;
13
+ height: 0;
14
+ }
15
+ /* display none until init */
16
+ .owl-carousel{
17
+ display: none;
18
+ position: relative;
19
+ width: 100%;
20
+ -ms-touch-action: pan-y;
21
+ }
22
+ .owl-carousel .owl-wrapper{
23
+ display: none;
24
+ position: relative;
25
+ -webkit-transform: translate3d(0px, 0px, 0px);
26
+ }
27
+ .owl-carousel .owl-wrapper-outer{
28
+ overflow: hidden;
29
+ position: relative;
30
+ width: 100%;
31
+ }
32
+ .owl-carousel .owl-wrapper-outer.autoHeight{
33
+ -webkit-transition: height 500ms ease-in-out;
34
+ -moz-transition: height 500ms ease-in-out;
35
+ -ms-transition: height 500ms ease-in-out;
36
+ -o-transition: height 500ms ease-in-out;
37
+ transition: height 500ms ease-in-out;
38
+ }
39
+
40
+ .owl-carousel .owl-item{
41
+ float: left;
42
+ }
43
+ .owl-controls .owl-page,
44
+ .owl-controls .owl-buttons div{
45
+ cursor: pointer;
46
+ }
47
+ .owl-controls {
48
+ -webkit-user-select: none;
49
+ -khtml-user-select: none;
50
+ -moz-user-select: none;
51
+ -ms-user-select: none;
52
+ user-select: none;
53
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
54
+ }
55
+
56
+ /* mouse grab icon */
57
+ .grabbing {
58
+ cursor:url(grabbing.png) 8 8, move;
59
+ }
60
+
61
+ /* fix */
62
+ .owl-carousel .owl-wrapper,
63
+ .owl-carousel .owl-item{
64
+ -webkit-backface-visibility: hidden;
65
+ -moz-backface-visibility: hidden;
66
+ -ms-backface-visibility: hidden;
67
+ -webkit-transform: translate3d(0,0,0);
68
+ -moz-transform: translate3d(0,0,0);
69
+ -ms-transform: translate3d(0,0,0);
70
+ }
71
+
72
+ .owl-wrapper {
73
+ text-align:center;
74
+ }
css/owl.theme.css ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Owl Carousel Owl Demo Theme
3
+ * v1.3.2
4
+ */
5
+
6
+ .owl-theme .owl-controls{
7
+ margin-top: 10px;
8
+ text-align: center;
9
+ }
10
+
11
+ /* Styling Next and Prev buttons */
12
+
13
+ .owl-theme .owl-controls .owl-buttons div{
14
+ color: #FFF;
15
+ display: inline-block;
16
+ zoom: 1;
17
+ *display: inline;/*IE7 life-saver */
18
+ margin: 5px;
19
+ padding: 3px 10px;
20
+ font-size: 12px;
21
+ -webkit-border-radius: 30px;
22
+ -moz-border-radius: 30px;
23
+ border-radius: 30px;
24
+ background: #869791;
25
+ filter: Alpha(Opacity=50);/*IE7 fix*/
26
+ opacity: 0.5;
27
+ }
28
+ /* Clickable class fix problem with hover on touch devices */
29
+ /* Use it for non-touch hover action */
30
+ .owl-theme .owl-controls.clickable .owl-buttons div:hover{
31
+ filter: Alpha(Opacity=100);/*IE7 fix*/
32
+ opacity: 1;
33
+ text-decoration: none;
34
+ }
35
+
36
+ /* Styling Pagination*/
37
+
38
+ .owl-theme .owl-controls .owl-page{
39
+ display: inline-block;
40
+ zoom: 1;
41
+ *display: inline;/*IE7 life-saver */
42
+ }
43
+ .owl-theme .owl-controls .owl-page span{
44
+ display: block;
45
+ width: 12px;
46
+ height: 12px;
47
+ margin: 5px 7px;
48
+ filter: Alpha(Opacity=50);/*IE7 fix*/
49
+ opacity: 0.5;
50
+ -webkit-border-radius: 20px;
51
+ -moz-border-radius: 20px;
52
+ border-radius: 20px;
53
+ background: #869791;
54
+ }
55
+
56
+ .owl-theme .owl-controls .owl-page.active span,
57
+ .owl-theme .owl-controls.clickable .owl-page:hover span{
58
+ filter: Alpha(Opacity=100);/*IE7 fix*/
59
+ opacity: 1;
60
+ }
61
+
62
+ /* If PaginationNumbers is true */
63
+
64
+ .owl-theme .owl-controls .owl-page span.owl-numbers{
65
+ height: auto;
66
+ width: auto;
67
+ color: #FFF;
68
+ padding: 2px 10px;
69
+ font-size: 12px;
70
+ -webkit-border-radius: 30px;
71
+ -moz-border-radius: 30px;
72
+ border-radius: 30px;
73
+ }
74
+
75
+ /* preloading images */
76
+ .owl-item.loading{
77
+ min-height: 150px;
78
+ background: url('../images/AjaxLoader.gif') no-repeat center center
79
+ }
css/owl.transitions.css ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Owl Carousel CSS3 Transitions
3
+ * v1.3.2
4
+ */
5
+
6
+ .owl-origin {
7
+ -webkit-perspective: 1200px;
8
+ -webkit-perspective-origin-x : 50%;
9
+ -webkit-perspective-origin-y : 50%;
10
+ -moz-perspective : 1200px;
11
+ -moz-perspective-origin-x : 50%;
12
+ -moz-perspective-origin-y : 50%;
13
+ perspective : 1200px;
14
+ }
15
+ /* fade */
16
+ .owl-fade-out {
17
+ z-index: 10;
18
+ -webkit-animation: fadeOut .7s both ease;
19
+ -moz-animation: fadeOut .7s both ease;
20
+ animation: fadeOut .7s both ease;
21
+ }
22
+ .owl-fade-in {
23
+ -webkit-animation: fadeIn .7s both ease;
24
+ -moz-animation: fadeIn .7s both ease;
25
+ animation: fadeIn .7s both ease;
26
+ }
27
+ /* backSlide */
28
+ .owl-backSlide-out {
29
+ -webkit-animation: backSlideOut 1s both ease;
30
+ -moz-animation: backSlideOut 1s both ease;
31
+ animation: backSlideOut 1s both ease;
32
+ }
33
+ .owl-backSlide-in {
34
+ -webkit-animation: backSlideIn 1s both ease;
35
+ -moz-animation: backSlideIn 1s both ease;
36
+ animation: backSlideIn 1s both ease;
37
+ }
38
+ /* goDown */
39
+ .owl-goDown-out {
40
+ -webkit-animation: scaleToFade .7s ease both;
41
+ -moz-animation: scaleToFade .7s ease both;
42
+ animation: scaleToFade .7s ease both;
43
+ }
44
+ .owl-goDown-in {
45
+ -webkit-animation: goDown .6s ease both;
46
+ -moz-animation: goDown .6s ease both;
47
+ animation: goDown .6s ease both;
48
+ }
49
+ /* scaleUp */
50
+ .owl-fadeUp-in {
51
+ -webkit-animation: scaleUpFrom .5s ease both;
52
+ -moz-animation: scaleUpFrom .5s ease both;
53
+ animation: scaleUpFrom .5s ease both;
54
+ }
55
+
56
+ .owl-fadeUp-out {
57
+ -webkit-animation: scaleUpTo .5s ease both;
58
+ -moz-animation: scaleUpTo .5s ease both;
59
+ animation: scaleUpTo .5s ease both;
60
+ }
61
+ /* Keyframes */
62
+ /*empty*/
63
+ @-webkit-keyframes empty {
64
+ 0% {opacity: 1}
65
+ }
66
+ @-moz-keyframes empty {
67
+ 0% {opacity: 1}
68
+ }
69
+ @keyframes empty {
70
+ 0% {opacity: 1}
71
+ }
72
+ @-webkit-keyframes fadeIn {
73
+ 0% { opacity:0; }
74
+ 100% { opacity:1; }
75
+ }
76
+ @-moz-keyframes fadeIn {
77
+ 0% { opacity:0; }
78
+ 100% { opacity:1; }
79
+ }
80
+ @keyframes fadeIn {
81
+ 0% { opacity:0; }
82
+ 100% { opacity:1; }
83
+ }
84
+ @-webkit-keyframes fadeOut {
85
+ 0% { opacity:1; }
86
+ 100% { opacity:0; }
87
+ }
88
+ @-moz-keyframes fadeOut {
89
+ 0% { opacity:1; }
90
+ 100% { opacity:0; }
91
+ }
92
+ @keyframes fadeOut {
93
+ 0% { opacity:1; }
94
+ 100% { opacity:0; }
95
+ }
96
+ @-webkit-keyframes backSlideOut {
97
+ 25% { opacity: .5; -webkit-transform: translateZ(-500px); }
98
+ 75% { opacity: .5; -webkit-transform: translateZ(-500px) translateX(-200%); }
99
+ 100% { opacity: .5; -webkit-transform: translateZ(-500px) translateX(-200%); }
100
+ }
101
+ @-moz-keyframes backSlideOut {
102
+ 25% { opacity: .5; -moz-transform: translateZ(-500px); }
103
+ 75% { opacity: .5; -moz-transform: translateZ(-500px) translateX(-200%); }
104
+ 100% { opacity: .5; -moz-transform: translateZ(-500px) translateX(-200%); }
105
+ }
106
+ @keyframes backSlideOut {
107
+ 25% { opacity: .5; transform: translateZ(-500px); }
108
+ 75% { opacity: .5; transform: translateZ(-500px) translateX(-200%); }
109
+ 100% { opacity: .5; transform: translateZ(-500px) translateX(-200%); }
110
+ }
111
+ @-webkit-keyframes backSlideIn {
112
+ 0%, 25% { opacity: .5; -webkit-transform: translateZ(-500px) translateX(200%); }
113
+ 75% { opacity: .5; -webkit-transform: translateZ(-500px); }
114
+ 100% { opacity: 1; -webkit-transform: translateZ(0) translateX(0); }
115
+ }
116
+ @-moz-keyframes backSlideIn {
117
+ 0%, 25% { opacity: .5; -moz-transform: translateZ(-500px) translateX(200%); }
118
+ 75% { opacity: .5; -moz-transform: translateZ(-500px); }
119
+ 100% { opacity: 1; -moz-transform: translateZ(0) translateX(0); }
120
+ }
121
+ @keyframes backSlideIn {
122
+ 0%, 25% { opacity: .5; transform: translateZ(-500px) translateX(200%); }
123
+ 75% { opacity: .5; transform: translateZ(-500px); }
124
+ 100% { opacity: 1; transform: translateZ(0) translateX(0); }
125
+ }
126
+ @-webkit-keyframes scaleToFade {
127
+ to { opacity: 0; -webkit-transform: scale(.8); }
128
+ }
129
+ @-moz-keyframes scaleToFade {
130
+ to { opacity: 0; -moz-transform: scale(.8); }
131
+ }
132
+ @keyframes scaleToFade {
133
+ to { opacity: 0; transform: scale(.8); }
134
+ }
135
+ @-webkit-keyframes goDown {
136
+ from { -webkit-transform: translateY(-100%); }
137
+ }
138
+ @-moz-keyframes goDown {
139
+ from { -moz-transform: translateY(-100%); }
140
+ }
141
+ @keyframes goDown {
142
+ from { transform: translateY(-100%); }
143
+ }
144
+
145
+ @-webkit-keyframes scaleUpFrom {
146
+ from { opacity: 0; -webkit-transform: scale(1.5); }
147
+ }
148
+ @-moz-keyframes scaleUpFrom {
149
+ from { opacity: 0; -moz-transform: scale(1.5); }
150
+ }
151
+ @keyframes scaleUpFrom {
152
+ from { opacity: 0; transform: scale(1.5); }
153
+ }
154
+
155
+ @-webkit-keyframes scaleUpTo {
156
+ to { opacity: 0; -webkit-transform: scale(1.5); }
157
+ }
158
+ @-moz-keyframes scaleUpTo {
159
+ to { opacity: 0; -moz-transform: scale(1.5); }
160
+ }
161
+ @keyframes scaleUpTo {
162
+ to { opacity: 0; transform: scale(1.5); }
163
+ }
css/swipebox.css ADDED
@@ -0,0 +1,264 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ html.swipebox {
2
+ overflow: hidden!important;
3
+ }
4
+
5
+ #swipebox-overlay img {
6
+ border: none!important;
7
+ }
8
+
9
+ #swipebox-overlay {
10
+ width: 100%;
11
+ height: 100%;
12
+ position: fixed;
13
+ top: 0;
14
+ left: 0;
15
+ z-index: 99999!important;
16
+ overflow: hidden;
17
+ -webkit-user-select: none;
18
+ -moz-user-select: none;
19
+ user-select: none;
20
+ }
21
+
22
+ #swipebox-slider {
23
+ height: 100%;
24
+ left: 0;
25
+ top: 0;
26
+ width: 100%;
27
+ white-space: nowrap;
28
+ position: absolute;
29
+ display: none;
30
+ }
31
+
32
+ #swipebox-slider .slide {
33
+ background: url("../images/loader.gif") no-repeat center center;
34
+ height: 100%;
35
+ width: 100%;
36
+ line-height: 1px;
37
+ text-align: center;
38
+ display: inline-block;
39
+ }
40
+
41
+ #swipebox-slider .slide:before {
42
+ content: "";
43
+ display: inline-block;
44
+ height: 50%;
45
+ width: 1px;
46
+ margin-right: -1px;
47
+ }
48
+
49
+ #swipebox-slider .slide img,
50
+ #swipebox-slider .slide .swipebox-video-container {
51
+ display: inline-block;
52
+ max-height: 100%;
53
+ max-width: 100%;
54
+ margin: 0;
55
+ padding: 0;
56
+ width: auto;
57
+ height: auto;
58
+ vertical-align: middle;
59
+ }
60
+
61
+ #swipebox-slider .slide .swipebox-video-container {
62
+ background:none;
63
+ max-width: 1140px;
64
+ max-height: 100%;
65
+ width: 100%;
66
+ padding:5%;
67
+ box-sizing: border-box;
68
+ -webkit-box-sizing: border-box;
69
+ -moz-box-sizing: border-box;
70
+ }
71
+
72
+
73
+ #swipebox-slider .slide .swipebox-video-container .swipebox-video{
74
+ width: 100%;
75
+ height: 0;
76
+ padding-bottom: 56.25%;
77
+ overflow: hidden;
78
+ position: relative;
79
+ }
80
+
81
+ #swipebox-slider .slide .swipebox-video-container .swipebox-video iframe{
82
+ width: 100%!important;
83
+ height: 100%!important;
84
+ position: absolute;
85
+ top: 0; left: 0;
86
+ }
87
+
88
+ #swipebox-action, #swipebox-caption {
89
+ position: absolute;
90
+ left: 0;
91
+ z-index: 999;
92
+ height: 50px;
93
+ width: 100%;
94
+ }
95
+
96
+ #swipebox-action {
97
+ bottom: -50px;
98
+ }
99
+ #swipebox-action.visible-bars {
100
+ bottom: 0;
101
+ }
102
+
103
+ #swipebox-action.force-visible-bars {
104
+ bottom: 0!important;
105
+ }
106
+
107
+ #swipebox-caption {
108
+ top: -50px;
109
+ text-align: center;
110
+ }
111
+ #swipebox-caption.visible-bars {
112
+ top: 0;
113
+ }
114
+
115
+ #swipebox-caption.force-visible-bars {
116
+ top: 0!important;
117
+ }
118
+
119
+ #swipebox-action #swipebox-prev, #swipebox-action #swipebox-next,
120
+ #swipebox-action #swipebox-close {
121
+ background-image: url("../images/icons.png") !important;
122
+ background-repeat: no-repeat;
123
+ border: none!important;
124
+ text-decoration: none!important;
125
+ cursor: pointer;
126
+ position: absolute;
127
+ width: 50px;
128
+ height: 50px;
129
+ top: 0;
130
+ }
131
+
132
+ #swipebox-action #swipebox-close {
133
+ background-position: 15px 12px;
134
+ left: 40px;
135
+ }
136
+
137
+ #swipebox-action #swipebox-prev {
138
+ background-position: -32px 13px;
139
+ right: 100px;
140
+ }
141
+
142
+ #swipebox-action #swipebox-next {
143
+ background-position: -78px 13px;
144
+ right: 40px;
145
+ }
146
+
147
+ #swipebox-action #swipebox-prev.disabled,
148
+ #swipebox-action #swipebox-next.disabled {
149
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=30);
150
+ opacity: 0.3;
151
+ }
152
+
153
+ #swipebox-slider.rightSpring {
154
+ -moz-animation: rightSpring 0.3s;
155
+ -webkit-animation: rightSpring 0.3s;
156
+ }
157
+
158
+ #swipebox-slider.leftSpring {
159
+ -moz-animation: leftSpring 0.3s;
160
+ -webkit-animation: leftSpring 0.3s;
161
+ }
162
+
163
+ @-moz-keyframes rightSpring {
164
+ 0% {
165
+ margin-left: 0px;
166
+ }
167
+
168
+ 50% {
169
+ margin-left: -30px;
170
+ }
171
+
172
+ 100% {
173
+ margin-left: 0px;
174
+ }
175
+ }
176
+
177
+ @-moz-keyframes leftSpring {
178
+ 0% {
179
+ margin-left: 0px;
180
+ }
181
+
182
+ 50% {
183
+ margin-left: 30px;
184
+ }
185
+
186
+ 100% {
187
+ margin-left: 0px;
188
+ }
189
+ }
190
+
191
+ @-webkit-keyframes rightSpring {
192
+ 0% {
193
+ margin-left: 0px;
194
+ }
195
+
196
+ 50% {
197
+ margin-left: -30px;
198
+ }
199
+
200
+ 100% {
201
+ margin-left: 0px;
202
+ }
203
+ }
204
+
205
+ @-webkit-keyframes leftSpring {
206
+ 0% {
207
+ margin-left: 0px;
208
+ }
209
+
210
+ 50% {
211
+ margin-left: 30px;
212
+ }
213
+
214
+ 100% {
215
+ margin-left: 0px;
216
+ }
217
+ }
218
+
219
+ @media screen and (max-width: 800px) {
220
+ #swipebox-action #swipebox-close {
221
+ left: 0;
222
+ }
223
+
224
+ #swipebox-action #swipebox-prev {
225
+ right: 60px;
226
+ }
227
+
228
+ #swipebox-action #swipebox-next {
229
+ right: 0;
230
+ }
231
+ }
232
+
233
+
234
+ /* Skin
235
+ --------------------------*/
236
+ #swipebox-overlay {
237
+ background: #0d0d0d;
238
+ }
239
+
240
+ #swipebox-action, #swipebox-caption {
241
+ text-shadow: 1px 1px 1px black;
242
+ background-color: #0d0d0d;
243
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #0d0d0d), color-stop(100%, #000000));
244
+ background-image: -webkit-linear-gradient(#0d0d0d, #000000);
245
+ background-image: -moz-linear-gradient(#0d0d0d, #000000);
246
+ background-image: -o-linear-gradient(#0d0d0d, #000000);
247
+ background-image: linear-gradient(#0d0d0d, #000000);
248
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=95);
249
+ opacity: 0.95;
250
+ }
251
+
252
+ #swipebox-action {
253
+ border-top: 1px solid rgba(255, 255, 255, 0.2);
254
+ }
255
+
256
+ #swipebox-caption {
257
+ border-bottom: 1px solid rgba(255, 255, 255, 0.2);
258
+ color: white!important;
259
+ font-size: 15px;
260
+ line-height: 43px;
261
+ font-family: Helvetica, Arial, sans-serif;
262
+ }
263
+
264
+
enjoyinstagram.php ADDED
@@ -0,0 +1,505 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Enjoy Instagram
4
+ Plugin URI: http://www.mediabeta.com/enjoy-instagram/
5
+ Description: Instagram Responsive Images Gallery and Carousel, works with Shortcodes and Widgets.
6
+ Version: 1.5.1
7
+ Author: F. Prestipino, F. Di Pane - Mediabeta Srl
8
+ Author URI: http://www.mediabeta.com/team/
9
+ */
10
+
11
+ require_once('library/enjoyinstagram_shortcode.php');
12
+ require_once('library/instagram.class.php');
13
+ class Settings_enjoyinstagram_Plugin {
14
+
15
+ private $enjoyinstagram_general_settings_key = 'enjoyinstagram_general_settings';
16
+ private $advanced_settings_key = 'enjoyinstagram_advanced_settings';
17
+ private $plugin_options_key = 'enjoyinstagram_plugin_options';
18
+ private $plugin_settings_tabs = array();
19
+
20
+ function __construct() {
21
+ add_action( 'init', array( &$this, 'load_settings' ) );
22
+ add_action( 'admin_init', array( &$this, 'register_enjoyinstagram_client_id' ) );
23
+ add_action( 'admin_init', array( &$this, 'register_advanced_settings' ) );
24
+ add_action( 'admin_menu', array( &$this, 'add_admin_menus' ) );
25
+ }
26
+
27
+ function load_settings() {
28
+ $this->general_settings = (array) get_option( $this->enjoyinstagram_general_settings_key );
29
+ $this->advanced_settings = (array) get_option( $this->advanced_settings_key );
30
+ $this->general_settings = array_merge( array(
31
+ 'general_option' => 'General value'
32
+ ), $this->general_settings );
33
+
34
+ $this->advanced_settings = array_merge( array(
35
+ 'advanced_option' => 'Advanced value'
36
+ ), $this->advanced_settings );
37
+ }
38
+
39
+ function register_enjoyinstagram_client_id() {
40
+ $this->plugin_settings_tabs[$this->enjoyinstagram_general_settings_key] = 'Profile';
41
+
42
+ register_setting( $this->enjoyinstagram_general_settings_key, $this->enjoyinstagram_general_settings_key );
43
+ add_settings_section( 'section_general', 'General Plugin Settings', array( &$this, 'section_general_desc' ), $this->enjoyinstagram_general_settings_key );
44
+ add_settings_field( 'general_option', 'A General Option', array( &$this, 'field_general_option' ), $this->enjoyinstagram_general_settings_key, 'section_general' );
45
+ }
46
+
47
+
48
+ function register_advanced_settings() {
49
+ $this->plugin_settings_tabs[$this->advanced_settings_key] = 'Settings';
50
+
51
+ register_setting( $this->advanced_settings_key, $this->advanced_settings_key );
52
+ add_settings_section( 'section_advanced', 'Advanced Plugin Settings', array( &$this, 'section_advanced_desc' ), $this->advanced_settings_key );
53
+ add_settings_field( 'advanced_option', 'An Advanced Option', array( &$this, 'field_advanced_option' ), $this->advanced_settings_key, 'section_advanced' );
54
+ }
55
+
56
+
57
+ function section_general_desc() { echo 'Instagram Settings'; }
58
+ function section_advanced_desc() { echo 'Manage Enjoy Instagram.'; }
59
+
60
+
61
+ function field_general_option() {
62
+ ?>
63
+ <input type="text" name="<?php echo $this->enjoyinstagram_general_settings_key; ?>[general_option]" value="<?php echo esc_attr( $this->general_settings['general_option'] ); ?>" /><?php
64
+ }
65
+
66
+
67
+ function field_advanced_option() { ?>
68
+ <input type="text" name="<?php echo $this->advanced_settings_key; ?>[advanced_option]" value="<?php echo esc_attr( $this->advanced_settings['advanced_option'] ); ?>" />
69
+ <?php
70
+ }
71
+
72
+
73
+ function add_admin_menus() {
74
+ add_options_page( 'Enjoy Instagram', 'Enjoy Instagram', 'manage_options', $this->plugin_options_key, array( &$this, 'enjoyinstagram_options_page' ) );
75
+ }
76
+
77
+
78
+ function enjoyinstagram_options_page() {
79
+ $tab = isset( $_GET['tab'] ) ? $_GET['tab'] : $this->enjoyinstagram_general_settings_key;?>
80
+ <div class="wrap">
81
+ <h2><div class="ei_block">
82
+ <div class="ei_left_block">
83
+ <div class="ei_hard_block">
84
+ <?php echo '<img src="' . plugins_url( 'images/enjoyinstagram.png' , __FILE__ ) . '" > '; ?>
85
+ </div>
86
+
87
+ <div class="ei_twitter_block">
88
+ <a href="https://twitter.com/share" class="twitter-share-button" data-url="http://www.mediabeta.com/enjoy-instagram/" data-text="I've just installed Enjoy Instagram for wordpress. Awesome!" data-hashtags="wordpress">Tweet</a>
89
+ <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');
90
+ </script>
91
+ </div>
92
+
93
+ <div id="fb-root"></div>
94
+ <script>(function(d, s, id) {
95
+ var js, fjs = d.getElementsByTagName(s)[0];
96
+ if (d.getElementById(id)) return;
97
+ js = d.createElement(s); js.id = id;
98
+ js.src = "//connect.facebook.net/it_IT/sdk.js#xfbml=1&appId=359330984151581&version=v2.0";
99
+ fjs.parentNode.insertBefore(js, fjs);
100
+ }(document, 'script', 'facebook-jssdk'));</script>
101
+ <div class="ei_facebook_block">
102
+ <div class="fb-like" data-href="http://www.mediabeta.com/enjoy-instagram/" data-layout="button_count" data-action="like" data-show-faces="true" data-share="true">
103
+ </div>
104
+ </div>
105
+ </div>
106
+
107
+ <div id="buy_me_a_coffee" style="background:url(<?php echo plugins_url( 'images/buymeacoffee.png' , __FILE__ ) ; ?>)#fff no-repeat; ">
108
+
109
+ <div class="pad_coffee">
110
+ <span class="coffee_title">Buy me a coffee!</span>
111
+ <p><span>If you liked our work please consider to make a kind donation through Paypal.</span></p>
112
+ <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
113
+ <input type="hidden" name="cmd" value="_s-xclick">
114
+ <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHRwYJKoZIhvcNAQcEoIIHODCCBzQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYA2UD9nEEx7DpSJjZ9cMPpXQcwkplkngz5Om2lrCRndClH2wsLNtoW6zpt0WHv90aE8pabeHs019W7MSA/7lPiNbMr62sSV/b8+80b9wBX9ch7GTKNcgXQ3qO2Gg16+iRa0EkwFZY6wjVu1d6cjYUROR1FYziTkOwZ0rFB1BIpDOTELMAkGBSsOAwIaBQAwgcQGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIxmfBLfx5kLKAgaCjqYuWhMkP5ATABAMc7wK8XgJ3TEvNz/GfgaA5eVLM1+g3CYoDo/gBat7kKhfRUh03V4NLSuk+AwDbOzHUx0M7jQZEINE9Ur0GWj2lBOipRcAFZziUvUg1cavok3gf+pkNbKdToVs51wWgQkVYu6x0rlLvXk8YX5Z5QLNNGwIkYe8wNI+NrEkYwnQ2axflISLL+BSC1yoSgasv1huhd7QUoIIDhzCCA4MwggLsoAMCAQICAQAwDQYJKoZIhvcNAQEFBQAwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMB4XDTA0MDIxMzEwMTMxNVoXDTM1MDIxMzEwMTMxNVowgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBR07d/ETMS1ycjtkpkvjXZe9k+6CieLuLsPumsJ7QC1odNz3sJiCbs2wC0nLE0uLGaEtXynIgRqIddYCHx88pb5HTXv4SZeuv0Rqq4+axW9PLAAATU8w04qqjaSXgbGLP3NmohqM6bV9kZZwZLR/klDaQGo1u9uDb9lr4Yn+rBQIDAQABo4HuMIHrMB0GA1UdDgQWBBSWn3y7xm8XvVk/UtcKG+wQ1mSUazCBuwYDVR0jBIGzMIGwgBSWn3y7xm8XvVk/UtcKG+wQ1mSUa6GBlKSBkTCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb22CAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCBXzpWmoBa5e9fo6ujionW1hUhPkOBakTr3YCDjbYfvJEiv/2P+IobhOGJr85+XHhN0v4gUkEDI8r2/rNk1m0GA8HKddvTjyGw/XqXa+LSTlDYkqI8OwR8GEYj4efEtcRpRYBxV8KxAW93YDWzFGvruKnnLbDAF6VR5w/cCMn5hzGCAZowggGWAgEBMIGUMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMTQwMzE3MTUzNDA2WjAjBgkqhkiG9w0BCQQxFgQULx/mUONLbAeob5jHfwrjw49VOi0wDQYJKoZIhvcNAQEBBQAEgYBJzOmAZY/fXJWt1EHmthZz55pvpW0T1z7F4XVAk85mH/0ZIgRrA9Bj5lsU/3YKvx3LCj4SFRRkTIb0f77/vWtN1BoZi1wWwSMODl9kdbVlQNh61FVXBp1FaKoiq1pn176D2uKGpRloQiWH2jP+TGrS81XTEI4rVai73+Tr5Ms/RQ==-----END PKCS7-----
115
+ ">
116
+ <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
117
+ <img alt="" border="0" src="https://www.paypalobjects.com/it_IT/i/scr/pixel.gif" width="1" height="1">
118
+ </form>
119
+ </div>
120
+ </div>
121
+ </div>
122
+ <div class="ei_block">
123
+
124
+
125
+ <div id="premium_release">
126
+
127
+ <div class="pad_premium_release">
128
+ <span class="coffee_title">Premium Version is <a href="http://www.mediabeta.com/enjoy-instagram-premium/">HERE</a> !</span>
129
+ <p><span style="color:#900; font-weight: bold;">Enjoy Instagram Premium</span> is the only plugin that allows you to <span style="color:#900; font-weight: bold;">moderate</span> the pictures and choose which show.<br />
130
+ Discover now all the features and innovations, <a href="http://www.mediabeta.com/enjoy-instagram-premium/">CLICK HERE</a></p>
131
+
132
+ </div>
133
+
134
+ </div>
135
+ </div>
136
+ </h2>
137
+
138
+
139
+ <?php $this->plugin_options_tabs(); ?>
140
+ <?php
141
+ if($tab == 'enjoyinstagram_general_settings') {
142
+ if(isset($_GET['code']) && $_GET['code']!=''){
143
+
144
+ // get access token
145
+
146
+ $client_id = get_option('enjoyinstagram_client_id');
147
+ $client_secret = get_option('enjoyinstagram_client_secret');
148
+ $redirect_uri = admin_url('options-general.php?page=enjoyinstagram_plugin_options&tab=enjoyinstagram_general_settings');
149
+ $code = $_GET['code'];
150
+
151
+ $apiData = array(
152
+ 'client_id' => $client_id,
153
+ 'client_secret' => $client_secret,
154
+ 'grant_type' => 'authorization_code',
155
+ 'redirect_uri' => $redirect_uri,
156
+ 'code' => $code
157
+ );
158
+
159
+
160
+ $apiHost = 'https://api.instagram.com/oauth/access_token';
161
+
162
+ $ch = curl_init();
163
+ curl_setopt($ch, CURLOPT_URL, $apiHost);
164
+ curl_setopt($ch, CURLOPT_POST, count($apiData));
165
+ curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($apiData));
166
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json'));
167
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
168
+ $jsonData = curl_exec($ch);
169
+ curl_close($ch);
170
+ $user = json_decode($jsonData,true);
171
+
172
+ $enjoyinstagram_user_id = $user['user']['id'];
173
+ $enjoyinstagram_user_username = $user['user']['username'];
174
+ $enjoyinstagram_user_profile_picture = $user['user']['profile_picture'];
175
+ $enjoyinstagram_user_fullname = $user['user']['full_name'];
176
+ $enjoyinstagram_user_website = $user['user']['website'];
177
+ $enjoyinstagram_user_bio = $user['user']['bio'];
178
+ $enjoyinstagram_access_token = $user['access_token'];
179
+
180
+ update_option( 'enjoyinstagram_user_id', $enjoyinstagram_user_id );
181
+ update_option( 'enjoyinstagram_user_username', $enjoyinstagram_user_username );
182
+ update_option( 'enjoyinstagram_user_profile_picture', $enjoyinstagram_user_profile_picture );
183
+ update_option( 'enjoyinstagram_user_fullname', $enjoyinstagram_user_fullname );
184
+ update_option( 'enjoyinstagram_user_website', $enjoyinstagram_user_website );
185
+ update_option( 'enjoyinstagram_user_bio', $enjoyinstagram_user_bio );
186
+ update_option( 'enjoyinstagram_access_token', $enjoyinstagram_access_token );
187
+
188
+
189
+ // get accee token fine
190
+ include('library/profile_auth.php');
191
+
192
+ }else{
193
+
194
+ if(!(get_option('enjoyinstagram_access_token'))){
195
+ include('library/autenticazione.php');
196
+ } else {
197
+ include('library/profile_auth.php');
198
+ }
199
+
200
+ }
201
+ }else if($tab == 'enjoyinstagram_advanced_settings'){
202
+ include('library/impostazioni_shortcode.php');
203
+ } ?>
204
+ </div>
205
+ <?php
206
+ }
207
+
208
+ function plugin_options_tabs() {
209
+ $current_tab = isset( $_GET['tab'] ) ? $_GET['tab'] : $this->enjoyinstagram_general_settings_key;
210
+
211
+ screen_icon();
212
+ echo '<h2 class="nav-tab-wrapper">';
213
+ foreach ( $this->plugin_settings_tabs as $tab_key => $tab_caption ) {
214
+ $active = $current_tab == $tab_key ? 'nav-tab-active' : '';
215
+ echo '<a class="nav-tab ' . $active . '" href="?page=' . $this->plugin_options_key . '&tab=' . $tab_key . '">' . $tab_caption . '</a>';
216
+ }
217
+ echo '</h2>';
218
+ }
219
+ };
220
+
221
+ // Initialize the plugin
222
+ add_action( 'plugins_loaded', create_function( '', '$Settings_enjoyinstagram_Plugin = new Settings_enjoyinstagram_Plugin;' ) );
223
+
224
+
225
+ function enjoyinstagram_default_option()
226
+ {
227
+ add_option('enjoyinstagram_client_id', '');
228
+ add_option('enjoyinstagram_client_secret', '');
229
+ add_option('enjoyinstagram_client_code', '');
230
+ add_option('enjoyinstagram_user_instagram', '');
231
+ add_option('enjoyinstagram_user_id', '');
232
+ add_option('enjoyinstagram_user_username', '');
233
+ add_option('enjoyinstagram_user_profile_picture', '');
234
+ add_option('enjoyinstagram_user_fullname', '');
235
+ add_option('enjoyinstagram_user_website', '');
236
+ add_option('enjoyinstagram_user_bio', '');
237
+ add_option('enjoyinstagram_access_token', '');
238
+ add_option('enjoyinstagram_carousel_items_number', 4);
239
+ add_option('enjoyinstagram_carousel_navigation', 'false');
240
+ add_option('enjoyinstagram_grid_rows', '2');
241
+ add_option('enjoyinstagram_grid_cols', '5');
242
+ add_option('enjoyinstagram_hashtag', '');
243
+ add_option('enjoyinstagram_user_or_hashtag', 'user');
244
+ }
245
+
246
+ register_activation_hook( __FILE__, 'enjoyinstagram_default_option');
247
+
248
+ function enjoyinstagram_register_options_group_auth()
249
+ {
250
+ register_setting('enjoyinstagram_options_group_auth', 'enjoyinstagram_client_id');
251
+ register_setting('enjoyinstagram_options_group_auth', 'enjoyinstagram_client_secret');
252
+ register_setting('enjoyinstagram_options_group_auth', 'enjoyinstagram_client_code');
253
+ register_setting('enjoyinstagram_options_group_auth', 'enjoyinstagram_user_instagram');
254
+ }
255
+
256
+ add_action ('admin_init', 'enjoyinstagram_register_options_group_auth');
257
+
258
+ function enjoyinstagram_register_options_group()
259
+ {
260
+ register_setting('enjoyinstagram_options_group', 'enjoyinstagram_client_id');
261
+ register_setting('enjoyinstagram_options_group', 'enjoyinstagram_user_instagram');
262
+ register_setting('enjoyinstagram_options_group', 'enjoyinstagram_user_id');
263
+ register_setting('enjoyinstagram_options_group', 'enjoyinstagram_user_username');
264
+ register_setting('enjoyinstagram_options_group', 'enjoyinstagram_user_profile_picture');
265
+ register_setting('enjoyinstagram_options_group', 'enjoyinstagram_user_fullname');
266
+ register_setting('enjoyinstagram_options_group', 'enjoyinstagram_user_website');
267
+ register_setting('enjoyinstagram_options_group', 'enjoyinstagram_user_bio');
268
+ register_setting('enjoyinstagram_options_group', 'enjoyinstagram_access_token');
269
+ }
270
+
271
+ add_action ('admin_init', 'enjoyinstagram_register_options_group');
272
+
273
+ function enjoyinstagram_register_options_carousel()
274
+ {
275
+ register_setting('enjoyinstagram_options_carousel_group', 'enjoyinstagram_carousel_items_number');
276
+ register_setting('enjoyinstagram_options_carousel_group', 'enjoyinstagram_carousel_navigation');
277
+ register_setting('enjoyinstagram_options_carousel_group', 'enjoyinstagram_grid_cols');
278
+ register_setting('enjoyinstagram_options_carousel_group', 'enjoyinstagram_grid_rows');
279
+ register_setting('enjoyinstagram_options_carousel_group', 'enjoyinstagram_hashtag');
280
+ register_setting('enjoyinstagram_options_carousel_group', 'enjoyinstagram_user_or_hashtag');
281
+
282
+ }
283
+
284
+ add_action ('admin_init', 'enjoyinstagram_register_options_carousel');
285
+
286
+ function aggiungi_script_instafeed_owl() {
287
+
288
+ if(!is_admin()) {
289
+
290
+ wp_register_script('owl', plugins_url('/js/owl.carousel.js',__FILE__),'jquery','');
291
+ wp_register_script('swipebox', plugins_url('/js/jquery.swipebox.js',__FILE__),'jquery','');
292
+ wp_register_script('gridrotator', plugins_url('/js/jquery.gridrotator.js',__FILE__),'jquery','');
293
+ wp_register_script('modernizr.custom.26633', plugins_url('/js/modernizr.custom.26633.js',__FILE__),'jquery','');
294
+ wp_register_script('orientationchange', plugins_url('/js/ios-orientationchange-fix.js',__FILE__),'jquery','');
295
+
296
+ wp_register_style( 'owl_style', plugins_url('/css/owl.carousel.css',__FILE__) );
297
+ wp_register_style( 'owl_style_2', plugins_url('/css/owl.theme.css',__FILE__) );
298
+ wp_register_style( 'owl_style_3', plugins_url('/css/owl.transitions.css',__FILE__) );
299
+ wp_register_style( 'swipebox_css', plugins_url('/css/swipebox.css',__FILE__) );
300
+ wp_register_style( 'grid_fallback', plugins_url('/css/grid_fallback.css',__FILE__) );
301
+ wp_register_style( 'grid_style', plugins_url('/css/grid_style.css',__FILE__) );
302
+
303
+ wp_enqueue_script( 'jquery' ); // include jQuery
304
+ wp_enqueue_script('owl');
305
+ wp_enqueue_script('swipebox');
306
+ wp_enqueue_script('modernizr.custom.26633');
307
+ wp_enqueue_script('gridrotator');
308
+ wp_enqueue_script('orientationchange');
309
+ wp_enqueue_style( 'owl_style' );
310
+ wp_enqueue_style( 'owl_style_2' );
311
+ wp_enqueue_style( 'owl_style_3' );
312
+ wp_enqueue_style( 'swipebox_css' );
313
+ wp_enqueue_style( 'grid_fallback' );
314
+ wp_enqueue_style( 'grid_style' );
315
+ }
316
+ }
317
+
318
+ add_action( 'wp_enqueue_scripts', 'aggiungi_script_instafeed_owl' );
319
+
320
+ function aggiungi_script_in_admin(){
321
+ wp_register_style( 'enjoyinstagram_settings', plugins_url('/css/enjoyinstagram_settings.css',__FILE__) );
322
+ wp_enqueue_style( 'enjoyinstagram_settings' );
323
+ }
324
+
325
+ add_action( 'admin_enqueue_scripts', 'aggiungi_script_in_admin' );
326
+ add_action( 'admin_head', 'aggiungo_javascript_in_pannello_amministrazione' );
327
+
328
+ function aggiungo_javascript_in_pannello_amministrazione() {
329
+ ?>
330
+ <script type="text/javascript">
331
+
332
+
333
+ function post_to_url(path, method) {
334
+ method = method || "get";
335
+ var params = new Array();
336
+ var client_id = document.getElementById('enjoyinstagram_client_id').value;
337
+ var client_secret = document.getElementById('enjoyinstagram_client_secret').value;
338
+ params['client_id'] = client_id;
339
+ params['redirect_uri'] = '<?php echo admin_url('options-general.php?page=enjoyinstagram_plugin_options&tab=enjoyinstagram_general_settings'); ?>';
340
+ params['scope'] = 'likes';
341
+ params['response_type'] = 'code';
342
+
343
+ var form = document.createElement("form");
344
+ form.setAttribute("method", method);
345
+ form.setAttribute("action", path);
346
+
347
+ for(var key in params) {
348
+ if(params.hasOwnProperty(key)) {
349
+ var hiddenField = document.createElement("input");
350
+ hiddenField.setAttribute("type", "hidden");
351
+ hiddenField.setAttribute("name", key);
352
+ hiddenField.setAttribute("value", params[key]);
353
+
354
+ form.appendChild(hiddenField);
355
+ }
356
+ }
357
+
358
+
359
+ document.body.appendChild(form);
360
+ form.submit();
361
+
362
+ }
363
+
364
+
365
+ </script>
366
+ <?php
367
+ }
368
+
369
+
370
+
371
+ function funzioni_in_head() {
372
+ ?>
373
+ <script type="text/javascript">
374
+ jQuery(function($) {
375
+ $(".swipebox_grid").swipebox({
376
+ hideBarsDelay : 0
377
+ });
378
+
379
+ });
380
+
381
+ jQuery(function(){
382
+ jQuery(document.body)
383
+ .on('click touchend','#swipebox-slider .current img', function(e){
384
+ jQuery('#swipebox-next').click();
385
+ return false;
386
+ })
387
+ .on('click touchend','#swipebox-slider .current', function(e){
388
+ jQuery('#swipebox-close').trigger('click');
389
+ });
390
+ });
391
+
392
+ </script>
393
+ <?php
394
+ }
395
+
396
+
397
+ add_action('wp_head', 'funzioni_in_head');
398
+
399
+
400
+
401
+ function enjoyinstagram_plugin_settings_link($links) {
402
+ $settings_link = '<a href="options-general.php?page=enjoyinstagram_plugin_options">' . __( 'Settings' ) . '</a>';
403
+ $widgets_link = '<a href="widgets.php">' . __( 'Widgets' ) . '</a>';
404
+ $premium_link = '<a href="http://www.mediabeta.com/enjoy-instagram-premium/">' . __( 'Premium Version' ) . '</a>';
405
+ array_push($links, $settings_link);
406
+ array_push($links, $widgets_link);
407
+ array_push($links, $premium_link);
408
+ return $links;
409
+ }
410
+
411
+ $plugin = plugin_basename(__FILE__);
412
+ add_filter("plugin_action_links_$plugin", 'enjoyinstagram_plugin_settings_link');
413
+
414
+
415
+
416
+
417
+
418
+ add_action( 'admin_footer', 'add_option_client_ajax' );
419
+
420
+ function add_option_client_ajax() {
421
+ ?>
422
+ <script type="text/javascript" >
423
+
424
+ jQuery('#button_autorizza_instagram').click(function() {
425
+ var client_id = document.getElementById('enjoyinstagram_client_id').value;
426
+ var client_secret = document.getElementById('enjoyinstagram_client_secret').value;
427
+ var data = {
428
+ action: 'user_option_ajax',
429
+ client_id_value: client_id,
430
+ client_secret_value: client_secret
431
+ };
432
+
433
+
434
+ jQuery.post(ajaxurl, data, function(response) {
435
+ post_to_url('https://api.instagram.com/oauth/authorize/','get');
436
+ });
437
+ });
438
+ </script>
439
+ <?php
440
+ }
441
+
442
+ add_action( 'wp_ajax_user_option_ajax', 'user_option_ajax_callback' );
443
+
444
+ function user_option_ajax_callback() {
445
+ global $wpdb;
446
+
447
+ $client_id = $_POST['client_id_value'];
448
+ $client_secret = $_POST['client_secret_value'];
449
+ echo $client_id."<br />".$client_secret;
450
+ update_option( 'enjoyinstagram_client_id', $client_id );
451
+ update_option( 'enjoyinstagram_client_secret', $client_secret );
452
+
453
+ die();
454
+ }
455
+
456
+
457
+ add_action( 'admin_footer', 'logout_client_ajax' );
458
+
459
+ function logout_client_ajax() {
460
+ ?>
461
+ <script type="text/javascript" >
462
+
463
+ jQuery('#button_logout').click(function() {
464
+ var data = {
465
+ action: 'user_logout_ajax'
466
+ };
467
+
468
+
469
+ jQuery.post(ajaxurl, data, function(response) {
470
+ location.href = '<?php echo get_admin_url(); ?>options-general.php?page=enjoyinstagram_plugin_options&tab=enjoyinstagram_general_settings';
471
+ });
472
+ });
473
+ </script>
474
+ <?php
475
+ }
476
+
477
+ add_action( 'wp_ajax_user_logout_ajax', 'user_logout_ajax_callback' );
478
+
479
+ function user_logout_ajax_callback() {
480
+ global $wpdb;
481
+
482
+ update_option('enjoyinstagram_user_id','');
483
+ update_option('enjoyinstagram_user_username','');
484
+ update_option('enjoyinstagram_user_profile_picture','');
485
+ update_option('enjoyinstagram_user_fullname','');
486
+ update_option('enjoyinstagram_user_website','');
487
+ update_option('enjoyinstagram_user_bio','');
488
+ update_option('enjoyinstagram_access_token','');
489
+
490
+ die();
491
+ }
492
+
493
+
494
+ //require('custom_editor_button/shortcode_button.php');
495
+
496
+ include_once ('tinymce/tinymce.php');
497
+ require_once ('tinymce/ajax.php');
498
+
499
+ require_once('library/widgets.php');
500
+ require_once('library/widgets_grid.php');
501
+ require_once('library/enjoyinstagram_shortcode_grid.php');
502
+ require_once('library/enjoyinstagram_shortcode_widget.php');
503
+ require_once('library/enjoyinstagram_shortcode_grid_widget.php');
504
+
505
+ ?>
images/AjaxLoader.gif ADDED
Binary file
images/ImageAttribution.txt ADDED
@@ -0,0 +1,2 @@
 
 
1
+ Images by Sherman Geronimo-Tan: http://www.flickr.com/people/smanography/
2
+ http://creativecommons.org/licenses/by/2.0/deed.en
images/Instagram-icon.png ADDED
Binary file
images/bg.jpg ADDED
Binary file
images/buymeacoffee.png ADDED
Binary file
images/carousel.png ADDED
Binary file
images/enjoyinstagram.png ADDED
Binary file
images/grabbing.png ADDED
Binary file
images/griglia.png ADDED
Binary file
images/icon_enjoyinstagram.png ADDED
Binary file
images/icons.png ADDED
Binary file
images/icons.svg ADDED
@@ -0,0 +1 @@
 
1
+ <?xml version="1.0" encoding="utf-8"?> <!-- Generator: IcoMoon.io --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="120" height="24" viewBox="0 0 120 24" fill="#ffffff" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M 17.384,17.705q0.00,0.536 -0.375,0.911l-1.821,1.821q-0.375,0.375 -0.911,0.375t-0.911-0.375l-3.938-3.938l-3.938,3.938q-0.375,0.375 -0.911,0.375t-0.911-0.375l-1.821-1.821q-0.375-0.375 -0.375-0.911t 0.375-0.911l 3.938-3.938l-3.938-3.938q-0.375-0.375 -0.375-0.911t 0.375-0.911l 1.821-1.821q 0.375-0.375 0.911-0.375t 0.911,0.375l 3.938,3.938l 3.938-3.938q 0.375-0.375 0.911-0.375t 0.911,0.375l 1.821,1.821q 0.375,0.375 0.375,0.911 t-0.375,0.911l-3.938,3.938l 3.938,3.938q 0.375,0.375 0.375,0.911zM 57.938,21.067l-8.732-8.719q-0.496-0.496 -0.496-1.212t 0.496-1.212l 8.732-8.719q 0.496-0.496 1.212-0.496t 1.212,0.496l 1.004,1.004q 0.496,0.496 0.496,1.212t-0.496,1.212l-6.509,6.509l 6.509,6.496q 0.496,0.509 0.496,1.219t-0.496,1.205l-1.004,1.004q-0.496,0.496 -1.212,0.496t-1.212-0.496zM 110.719,11.143q0.00,0.696 -0.496,1.219l-8.732,8.719q-0.496,0.496 -1.205,0.496t-1.205-0.496l-1.018-1.004q-0.496-0.522 -0.496-1.219q0.00-0.71 0.496-1.205l 6.509-6.509l-6.509-6.496q-0.496-0.522 -0.496-1.219q0.00-0.71 0.496-1.205l 1.018-1.004q 0.482-0.509 1.205-0.509t 1.205,0.509l 8.732,8.719q 0.496,0.496 0.496,1.205z"></path></svg>
images/light.png ADDED
Binary file
images/loader.gif ADDED
Binary file
images/loading.gif ADDED
Binary file
js/ios-orientationchange-fix.js ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! A fix for the iOS orientationchange zoom bug.
2
+ Script by @scottjehl, rebound by @wilto.
3
+ MIT / GPLv2 License.
4
+ */
5
+ (function(w){
6
+
7
+ // This fix addresses an iOS bug, so return early if the UA claims it's something else.
8
+ var ua = navigator.userAgent;
9
+ if( !( /iPhone|iPad|iPod/.test( navigator.platform ) && /OS [1-5]_[0-9_]* like Mac OS X/i.test(ua) && ua.indexOf( "AppleWebKit" ) > -1 ) ){
10
+ return;
11
+ }
12
+
13
+ var doc = w.document;
14
+
15
+ if( !doc.querySelector ){ return; }
16
+
17
+ var meta = doc.querySelector( "meta[name=viewport]" ),
18
+ initialContent = meta && meta.getAttribute( "content" ),
19
+ disabledZoom = initialContent + ",maximum-scale=1",
20
+ enabledZoom = initialContent + ",maximum-scale=10",
21
+ enabled = true,
22
+ x, y, z, aig;
23
+
24
+ if( !meta ){ return; }
25
+
26
+ function restoreZoom(){
27
+ meta.setAttribute( "content", enabledZoom );
28
+ enabled = true;
29
+ }
30
+
31
+ function disableZoom(){
32
+ meta.setAttribute( "content", disabledZoom );
33
+ enabled = false;
34
+ }
35
+
36
+ function checkTilt( e ){
37
+ aig = e.accelerationIncludingGravity;
38
+ x = Math.abs( aig.x );
39
+ y = Math.abs( aig.y );
40
+ z = Math.abs( aig.z );
41
+
42
+ // If portrait orientation and in one of the danger zones
43
+ if( (!w.orientation || w.orientation === 180) && ( x > 7 || ( ( z > 6 && y < 8 || z < 8 && y > 6 ) && x > 5 ) ) ){
44
+ if( enabled ){
45
+ disableZoom();
46
+ }
47
+ }
48
+ else if( !enabled ){
49
+ restoreZoom();
50
+ }
51
+ }
52
+
53
+ w.addEventListener( "orientationchange", restoreZoom, false );
54
+ w.addEventListener( "devicemotion", checkTilt, false );
55
+
56
+ })( this );
js/jquery.gridrotator copia.js ADDED
@@ -0,0 +1,756 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * jquery.gridrotator.js v1.1.0
3
+ * http://www.codrops.com
4
+ *
5
+ * Licensed under the MIT license.
6
+ * http://www.opensource.org/licenses/mit-license.php
7
+ *
8
+ * Copyright 2012, Codrops
9
+ * http://www.codrops.com
10
+ */
11
+ ;( function( $, window, undefined ) {
12
+
13
+ 'use strict';
14
+
15
+ /*
16
+ * debouncedresize: special jQuery event that happens once after a window resize
17
+ *
18
+ * latest version and complete README available on Github:
19
+ * https://github.com/louisremi/jquery-smartresize/blob/master/jquery.debouncedresize.js
20
+ *
21
+ * Copyright 2011 @louis_remi
22
+ * Licensed under the MIT license.
23
+ */
24
+ var $event = $.event,
25
+ $special,
26
+ resizeTimeout;
27
+
28
+ $special = $event.special.debouncedresize = {
29
+ setup: function() {
30
+ $( this ).on( "resize", $special.handler );
31
+ },
32
+ teardown: function() {
33
+ $( this ).off( "resize", $special.handler );
34
+ },
35
+ handler: function( event, execAsap ) {
36
+ // Save the context
37
+ var context = this,
38
+ args = arguments,
39
+ dispatch = function() {
40
+ // set correct event type
41
+ event.type = "debouncedresize";
42
+ $event.dispatch.apply( context, args );
43
+ };
44
+
45
+ if ( resizeTimeout ) {
46
+ clearTimeout( resizeTimeout );
47
+ }
48
+
49
+ execAsap ?
50
+ dispatch() :
51
+ resizeTimeout = setTimeout( dispatch, $special.threshold );
52
+ },
53
+ threshold: 100
54
+ };
55
+
56
+ // http://www.hardcode.nl/subcategory_1/article_317-array-shuffle-function
57
+ Array.prototype.shuffle = function() {
58
+ var i=this.length,p,t;
59
+ while (i--) {
60
+ p = Math.floor(Math.random()*i);
61
+ t = this[i];
62
+ this[i]=this[p];
63
+ this[p]=t;
64
+ }
65
+ return this;
66
+ };
67
+
68
+ // HTML5 PageVisibility API
69
+ // http://www.html5rocks.com/en/tutorials/pagevisibility/intro/
70
+ // by Joe Marini (@joemarini)
71
+ function getHiddenProp(){
72
+ var prefixes = ['webkit','moz','ms','o'];
73
+
74
+ // if 'hidden' is natively supported just return it
75
+ if ('hidden' in document) return 'hidden';
76
+
77
+ // otherwise loop over all the known prefixes until we find one
78
+ for (var i = 0; i < prefixes.length; i++){
79
+ if ((prefixes[i] + 'Hidden') in document)
80
+ return prefixes[i] + 'Hidden';
81
+ }
82
+
83
+ // otherwise it's not supported
84
+ return null;
85
+ }
86
+ function isHidden() {
87
+ var prop = getHiddenProp();
88
+ if (!prop) return false;
89
+
90
+ return document[prop];
91
+ }
92
+
93
+ function isEmpty( obj ) {
94
+ return Object.keys(obj).length === 0;
95
+ }
96
+
97
+ // global
98
+ var $window = $( window ),
99
+ Modernizr = window.Modernizr;
100
+
101
+ $.GridRotator = function( options, element ) {
102
+
103
+ this.$el = $( element );
104
+ if( Modernizr.backgroundsize ) {
105
+
106
+ var self = this;
107
+ this.$el.addClass( 'ri-grid-loading' );
108
+ this._init( options );
109
+
110
+ }
111
+
112
+ };
113
+
114
+ // the options
115
+ $.GridRotator.defaults = {
116
+ // number of rows
117
+ rows : 4,
118
+ // number of columns
119
+ columns : 10,
120
+ w1024 : { rows : 3, columns : 8 },
121
+ w768 : {rows : 3,columns : 7 },
122
+ w480 : {rows : 3,columns : 5 },
123
+ w320 : {rows : 2,columns : 4 },
124
+ w240 : {rows : 2,columns : 3 },
125
+ // step: number of items that are replaced at the same time
126
+ // random || [some number]
127
+ // note: for performance issues, the number "can't" be > options.maxStep
128
+ step : 'random',
129
+ // change it as you wish..
130
+ maxStep : 3,
131
+ // prevent user to click the items
132
+ preventClick : true,
133
+ // animation type
134
+ // showHide || fadeInOut ||
135
+ // slideLeft || slideRight || slideTop || slideBottom ||
136
+ // rotateBottom || rotateLeft || rotateRight || rotateTop ||
137
+ // scale ||
138
+ // rotate3d ||
139
+ // rotateLeftScale || rotateRightScale || rotateTopScale || rotateBottomScale ||
140
+ // random
141
+ animType : 'random',
142
+ // animation speed
143
+ animSpeed : 800,
144
+ // animation easings
145
+ animEasingOut : 'linear',
146
+ animEasingIn: 'linear',
147
+ // the item(s) will be replaced every 3 seconds
148
+ // note: for performance issues, the time "can't" be < 300 ms
149
+ interval : 3000,
150
+ // if false the animations will not start
151
+ // use false if onhover is true for example
152
+ slideshow : true,
153
+ // if true the items will switch when hovered
154
+ onhover : false,
155
+ // ids of elements that shouldn't change
156
+ nochange : []
157
+ };
158
+
159
+ $.GridRotator.prototype = {
160
+
161
+ _init : function( options ) {
162
+
163
+ // options
164
+ this.options = $.extend( true, {}, $.GridRotator.defaults, options );
165
+ // cache some elements + variables
166
+ this._config();
167
+
168
+ },
169
+ _config : function() {
170
+
171
+ var self = this,
172
+ transEndEventNames = {
173
+ 'WebkitTransition' : 'webkitTransitionEnd',
174
+ 'MozTransition' : 'transitionend',
175
+ 'OTransition' : 'oTransitionEnd',
176
+ 'msTransition' : 'MSTransitionEnd',
177
+ 'transition' : 'transitionend'
178
+ };
179
+
180
+ // support CSS transitions and 3d transforms
181
+ this.supportTransitions = Modernizr.csstransitions;
182
+ this.supportTransforms3D = Modernizr.csstransforms3d;
183
+
184
+ this.transEndEventName = transEndEventNames[ Modernizr.prefixed( 'transition' ) ] + '.gridrotator';
185
+
186
+ // all animation types for the random option
187
+ this.animTypes = this.supportTransforms3D ? [
188
+ 'fadeInOut',
189
+ 'slideLeft',
190
+ 'slideRight',
191
+ 'slideTop',
192
+ 'slideBottom',
193
+ 'rotateLeft',
194
+ 'rotateRight',
195
+ 'rotateTop',
196
+ 'rotateBottom',
197
+ 'scale',
198
+ 'rotate3d',
199
+ 'rotateLeftScale',
200
+ 'rotateRightScale',
201
+ 'rotateTopScale',
202
+ 'rotateBottomScale' ] :
203
+ [ 'fadeInOut', 'slideLeft', 'slideRight', 'slideTop', 'slideBottom' ];
204
+
205
+ this.animType = this.options.animType;
206
+
207
+ if( this.animType !== 'random' && !this.supportTransforms3D && $.inArray( this.animType, this.animTypes ) === -1 && this.animType !== 'showHide' ) {
208
+
209
+ // fallback to 'fadeInOut' if user sets a type which is not supported
210
+ this.animType = 'fadeInOut';
211
+
212
+ }
213
+
214
+ this.animTypesTotal = this.animTypes.length;
215
+
216
+ // the <ul> where the items are placed
217
+ this.$list = this.$el.children( 'ul' );
218
+ // remove images and add background-image to anchors
219
+ // preload the images before
220
+ var loaded = 0,
221
+ $imgs = this.$list.find( 'img' ),
222
+ count = $imgs.length;
223
+
224
+ $imgs.each( function() {
225
+
226
+ var $img = $( this ), src = $img.attr( 'src' );
227
+
228
+ $( '<img/>' ).load( function() {
229
+
230
+ ++loaded;
231
+ $img.parent().css( 'background-image', 'url(' + src + ')' );
232
+
233
+ if( loaded === count ) {
234
+
235
+ $imgs.remove();
236
+ self.$el.removeClass( 'ri-grid-loading' );
237
+ // the items
238
+ self.$items = self.$list.children( 'li' );
239
+ // make a copy of the items
240
+ self.$itemsCache = self.$items.clone();
241
+ // total number of items
242
+ self.itemsTotal = self.$items.length;
243
+ // the items that will be out of the grid
244
+ // actually the item's child (anchor element)
245
+ self.outItems= [];
246
+ self._layout( function() {
247
+ self._initEvents();
248
+ } );
249
+ // replace [options.step] items after [options.interval] time
250
+ // the items that go out are randomly chosen, while the ones that get in
251
+ // follow a "First In First Out" logic
252
+ self._start();
253
+
254
+ }
255
+
256
+ } ).attr( 'src', src )
257
+
258
+ } );
259
+
260
+ },
261
+ _layout : function( callback ) {
262
+
263
+ var self = this;
264
+
265
+ // sets the grid dimentions based on the container's width
266
+ this._setGridDim();
267
+
268
+ // reset
269
+ this.$list.empty();
270
+ this.$items = this.$itemsCache.clone().appendTo( this.$list );
271
+
272
+ var $outItems = this.$items.filter( ':gt(' + ( this.showTotal - 1 ) + ')' ),
273
+ $outAItems = $outItems.children( 'a' );
274
+
275
+ this.outItems.length = 0;
276
+
277
+ $outAItems.each( function( i ) {
278
+ self.outItems.push( $( this ) );
279
+ } );
280
+
281
+ $outItems.remove();
282
+
283
+ // container's width
284
+ var containerWidth = ( document.defaultView ) ? parseInt( document.defaultView.getComputedStyle( this.$el.get( 0 ), null ).width ) : this.$el.width(),
285
+ // item's width
286
+ itemWidth = Math.floor( containerWidth / this.columns ),
287
+ // calculate gap
288
+ gapWidth = containerWidth - ( this.columns * Math.floor( itemWidth ) );
289
+
290
+ for( var i = 0; i < this.rows; ++i ) {
291
+
292
+ for( var j = 0; j < this.columns; ++j ) {
293
+
294
+ var idx = this.columns * i + j,
295
+ $item = this.$items.eq( idx );
296
+
297
+ $item.css( {
298
+ width : j < Math.floor( gapWidth ) ? itemWidth + 1 : itemWidth,
299
+ height : itemWidth
300
+ } );
301
+
302
+ if( $.inArray( idx, this.options.nochange ) !== -1 ) {
303
+ $item.addClass( 'ri-nochange' ).data( 'nochange', true );
304
+ }
305
+
306
+ }
307
+
308
+ }
309
+
310
+ if( this.options.preventClick ) {
311
+
312
+ this.$items.children().css( 'cursor', 'default' ).on( 'click.gridrotator', false );
313
+
314
+ }
315
+
316
+ if( callback ) {
317
+ callback.call();
318
+ }
319
+
320
+ },
321
+ // set the grid rows and columns
322
+ _setGridDim : function() {
323
+
324
+ // container's width
325
+ var c_w = this.$el.width();
326
+
327
+ // we will choose the number of rows/columns according to the container's width and the values set in the plugin options
328
+ switch( true ) {
329
+ case ( c_w < 240 ) : this.rows = this.options.w240.rows; this.columns = this.options.w240.columns; break;
330
+ case ( c_w < 320 ) : this.rows = this.options.w320.rows; this.columns = this.options.w320.columns; break;
331
+ case ( c_w < 480 ) : this.rows = this.options.w480.rows; this.columns = this.options.w480.columns; break;
332
+ case ( c_w < 768 ) : this.rows = this.options.w768.rows; this.columns = this.options.w768.columns; break;
333
+ case ( c_w < 1024 ) : this.rows = this.options.w1024.rows; this.columns = this.options.w1024.columns; break;
334
+ default : this.rows = this.options.rows; this.columns = this.options.columns; break;
335
+ }
336
+
337
+ this.showTotal = this.rows * this.columns;
338
+
339
+ },
340
+ // init window resize event
341
+ _initEvents : function() {
342
+
343
+ var self = this;
344
+
345
+ $window.on( 'debouncedresize.gridrotator', function() {
346
+ self._layout();
347
+ } );
348
+
349
+ // use the property name to generate the prefixed event name
350
+ var visProp = getHiddenProp();
351
+
352
+ // HTML5 PageVisibility API
353
+ // http://www.html5rocks.com/en/tutorials/pagevisibility/intro/
354
+ // by Joe Marini (@joemarini)
355
+ if (visProp) {
356
+
357
+ var evtname = visProp.replace(/[H|h]idden/,'') + 'visibilitychange';
358
+ document.addEventListener(evtname, function() { self._visChange(); } );
359
+
360
+ }
361
+
362
+ if( !Modernizr.touch && this.options.onhover ) {
363
+
364
+ self.$items.on( 'mouseenter.gridrotator', function() {
365
+
366
+ var $item = $( this );
367
+ if( !$item.data( 'active' ) && !$item.data( 'hovered' ) && !$item.data( 'nochange' ) ) {
368
+ $item.data( 'hovered', true );
369
+ self._replace( $item );
370
+ }
371
+
372
+ } ).on( 'mouseleave.gridrotator', function() {
373
+
374
+ $( this ).data( 'hovered', false );
375
+
376
+ } );
377
+
378
+ }
379
+
380
+ },
381
+ _visChange : function() {
382
+
383
+ isHidden() ? clearTimeout( this.playtimeout ) : this._start();
384
+
385
+ },
386
+ // start rotating elements
387
+ _start : function() {
388
+
389
+ if( this.showTotal < this.itemsTotal && this.options.slideshow ) {
390
+ this._showNext();
391
+ }
392
+
393
+ },
394
+ // get which type of animation
395
+ _getAnimType : function() {
396
+
397
+ return this.animType === 'random' ? this.animTypes[ Math.floor( Math.random() * this.animTypesTotal ) ] : this.animType;
398
+
399
+ },
400
+ // get css properties for the transition effect
401
+ _getAnimProperties : function( $out ) {
402
+
403
+ var startInProp = {}, startOutProp = {}, endInProp = {}, endOutProp = {},
404
+ animType = this._getAnimType(), speed, delay = 0;
405
+
406
+ switch( animType ) {
407
+
408
+ case 'showHide' :
409
+
410
+ speed = 0;
411
+ endOutProp.opacity = 0;
412
+ break;
413
+
414
+ case 'fadeInOut' :
415
+
416
+ endOutProp.opacity = 0;
417
+ break;
418
+
419
+ case 'slideLeft' :
420
+
421
+ startInProp.left = $out.width();
422
+ endInProp.left = 0;
423
+ endOutProp.left = -$out.width();
424
+ break;
425
+
426
+ case 'slideRight' :
427
+
428
+ startInProp.left = -$out.width();
429
+ endInProp.left = 0;
430
+ endOutProp.left = $out.width();
431
+ break;
432
+
433
+ case 'slideTop' :
434
+
435
+ startInProp.top = $out.height();
436
+ endInProp.top = 0;
437
+ endOutProp.top = -$out.height();
438
+ break;
439
+
440
+ case 'slideBottom' :
441
+
442
+ startInProp.top = -$out.height();
443
+ endInProp.top = 0;
444
+ endOutProp.top = $out.height();
445
+ break;
446
+
447
+ case 'rotateLeft' :
448
+
449
+ speed = this.options.animSpeed / 2;
450
+ startInProp.transform = 'rotateY(90deg)';
451
+ endInProp.transform = 'rotateY(0deg)';
452
+ delay = speed;
453
+ endOutProp.transform = 'rotateY(-90deg)';
454
+ break;
455
+
456
+ case 'rotateRight' :
457
+
458
+ speed = this.options.animSpeed / 2;
459
+ startInProp.transform = 'rotateY(-90deg)';
460
+ endInProp.transform = 'rotateY(0deg)';
461
+ delay = speed;
462
+ endOutProp.transform = 'rotateY(90deg)';
463
+ break;
464
+
465
+ case 'rotateTop' :
466
+
467
+ speed = this.options.animSpeed / 2;
468
+ startInProp.transform= 'rotateX(90deg)';
469
+ endInProp.transform = 'rotateX(0deg)';
470
+ delay = speed;
471
+ endOutProp.transform = 'rotateX(-90deg)';
472
+ break;
473
+
474
+ case 'rotateBottom' :
475
+
476
+ speed = this.options.animSpeed / 2;
477
+ startInProp.transform = 'rotateX(-90deg)';
478
+ endInProp.transform = 'rotateX(0deg)';
479
+ delay = speed;
480
+ endOutProp.transform = 'rotateX(90deg)';
481
+ break;
482
+
483
+ case 'scale' :
484
+
485
+ speed = this.options.animSpeed / 2;
486
+ startInProp.transform = 'scale(0)';
487
+ startOutProp.transform = 'scale(1)';
488
+ endInProp.transform = 'scale(1)';
489
+ delay = speed;
490
+ endOutProp.transform = 'scale(0)';
491
+ break;
492
+
493
+ case 'rotateLeftScale' :
494
+
495
+ startOutProp.transform = 'scale(1)';
496
+ speed = this.options.animSpeed / 2;
497
+ startInProp.transform = 'scale(0.3) rotateY(90deg)';
498
+ endInProp.transform = 'scale(1) rotateY(0deg)';
499
+ delay = speed;
500
+ endOutProp.transform = 'scale(0.3) rotateY(-90deg)';
501
+ break;
502
+
503
+ case 'rotateRightScale' :
504
+
505
+ startOutProp.transform = 'scale(1)';
506
+ speed = this.options.animSpeed / 2;
507
+ startInProp.transform = 'scale(0.3) rotateY(-90deg)';
508
+ endInProp.transform = 'scale(1) rotateY(0deg)';
509
+ delay = speed;
510
+ endOutProp.transform = 'scale(0.3) rotateY(90deg)';
511
+ break;
512
+
513
+ case 'rotateTopScale' :
514
+
515
+ startOutProp.transform = 'scale(1)';
516
+ speed = this.options.animSpeed / 2;
517
+ startInProp.transform = 'scale(0.3) rotateX(90deg)';
518
+ endInProp.transform = 'scale(1) rotateX(0deg)';
519
+ delay = speed;
520
+ endOutProp.transform = 'scale(0.3) rotateX(-90deg)';
521
+ break;
522
+
523
+ case 'rotateBottomScale' :
524
+
525
+ startOutProp.transform = 'scale(1)';
526
+ speed = this.options.animSpeed / 2;
527
+ startInProp.transform = 'scale(0.3) rotateX(-90deg)';
528
+ endInProp.transform = 'scale(1) rotateX(0deg)';
529
+ delay = speed;
530
+ endOutProp.transform = 'scale(0.3) rotateX(90deg)';
531
+ break;
532
+
533
+ case 'rotate3d' :
534
+
535
+ speed = this.options.animSpeed / 2;
536
+ startInProp.transform = 'rotate3d( 1, 1, 0, 90deg )';
537
+ endInProp.transform = 'rotate3d( 1, 1, 0, 0deg )';
538
+ delay = speed;
539
+ endOutProp.transform = 'rotate3d( 1, 1, 0, -90deg )';
540
+ break;
541
+
542
+ }
543
+
544
+ return {
545
+ startInProp : startInProp,
546
+ startOutProp : startOutProp,
547
+ endInProp : endInProp,
548
+ endOutProp : endOutProp,
549
+ delay : delay,
550
+ animSpeed : speed != undefined ? speed : this.options.animSpeed
551
+ };
552
+
553
+ },
554
+ // show next [option.step] elements
555
+ _showNext : function( time ) {
556
+
557
+ var self = this;
558
+
559
+ clearTimeout( this.playtimeout );
560
+
561
+ this.playtimeout = setTimeout( function() {
562
+
563
+ var step = self.options.step, max= self.options.maxStep, min = 1;
564
+
565
+ if( max > self.showTotal ) {
566
+ max = self.showTotal;
567
+ }
568
+
569
+ // number of items to swith at this point of time
570
+ var nmbOut = step === 'random' ? Math.floor( Math.random() * max + min ) : Math.min( Math.abs( step ) , max ) ,
571
+ // array with random indexes. These will be the indexes of the items we will replace
572
+ randArr = self._getRandom( nmbOut, self.showTotal );
573
+
574
+ for( var i = 0; i < nmbOut; ++i ) {
575
+
576
+ // element to go out
577
+ var $out = self.$items.eq( randArr[ i ] );
578
+
579
+ // if element is active, which means it is currently animating,
580
+ // then we need to get different positions..
581
+ if( $out.data( 'active' ) || $out.data( 'nochange' ) ) {
582
+
583
+ // one of the items is active, call again..
584
+ self._showNext( 1 );
585
+ return false;
586
+
587
+ }
588
+
589
+ self._replace( $out );
590
+
591
+ }
592
+
593
+ // again and again..
594
+ self._showNext();
595
+
596
+ }, time || Math.max( Math.abs( this.options.interval ) , 300 ) );
597
+
598
+ },
599
+ _replace : function( $out ) {
600
+
601
+ $out.data( 'active', true );
602
+
603
+ var self = this,
604
+ $outA = $out.children( 'a:last' ),
605
+ newElProp = {
606
+ width : $outA.width(),
607
+ height : $outA.height()
608
+ };
609
+
610
+ // element stays active
611
+ $out.data( 'active', true );
612
+
613
+ // get the element (anchor) that will go in (first one inserted in this.outItems)
614
+ var $inA = this.outItems.shift();
615
+
616
+ // save element that went out
617
+ this.outItems.push( $outA.clone().css( 'transition', 'none' ) );
618
+
619
+ // prepend in element
620
+ $inA.css( newElProp ).prependTo( $out );
621
+
622
+ var animProp = this._getAnimProperties( $outA );
623
+
624
+ $inA.css( animProp.startInProp );
625
+ $outA.css( animProp.startOutProp );
626
+
627
+ this._setTransition( $inA, 'all', animProp.animSpeed, animProp.delay, this.options.animEasingIn );
628
+ this._setTransition( $outA, 'all', animProp.animSpeed, 0, this.options.animEasingOut );
629
+
630
+ this._applyTransition( $inA, animProp.endInProp, animProp.animSpeed, function() {
631
+
632
+ var $el = $( this ),
633
+ t = animProp.animSpeed === self.options.animSpeed && isEmpty( animProp.endInProp ) ? animProp.animSpeed : 0;
634
+
635
+ setTimeout( function() {
636
+
637
+ if( self.supportTransitions ) {
638
+ $el.off( self.transEndEventName );
639
+ }
640
+
641
+ $el.next().remove();
642
+ $el.parent().data( 'active', false );
643
+
644
+ }, t );
645
+
646
+ }, animProp.animSpeed === 0 || isEmpty( animProp.endInProp ) );
647
+ this._applyTransition( $outA, animProp.endOutProp, animProp.animSpeed );
648
+
649
+ },
650
+ _getRandom : function( cnt, limit ) {
651
+
652
+ var randArray = [];
653
+
654
+ for( var i = 0; i < limit; ++i ) {
655
+ randArray.push( i )
656
+ }
657
+
658
+ return randArray.shuffle().slice( 0, cnt );
659
+
660
+ },
661
+ _setTransition : function( el, prop, speed, delay, easing ) {
662
+
663
+ setTimeout( function() {
664
+ el.css( 'transition', prop + ' ' + speed + 'ms ' + delay + 'ms ' + easing );
665
+ }, 25 );
666
+
667
+ },
668
+ _applyTransition : function( el, styleCSS, speed, fncomplete, force ) {
669
+
670
+ var self = this;
671
+ setTimeout( function() {
672
+ $.fn.applyStyle = self.supportTransitions ? $.fn.css : $.fn.animate;
673
+
674
+ if( fncomplete && self.supportTransitions ) {
675
+
676
+ el.on( self.transEndEventName, fncomplete );
677
+
678
+ if( force ) {
679
+ fncomplete.call( el );
680
+ }
681
+
682
+ }
683
+
684
+ fncomplete = fncomplete || function() { return false; };
685
+
686
+ el.stop().applyStyle( styleCSS, $.extend( true, [], { duration : speed + 'ms', complete : fncomplete } ) );
687
+ }, 25 );
688
+
689
+ }
690
+
691
+ };
692
+
693
+ var logError = function( message ) {
694
+
695
+ if ( window.console ) {
696
+
697
+ window.console.error( message );
698
+
699
+ }
700
+
701
+ };
702
+
703
+ $.fn.gridrotator = function( options ) {
704
+
705
+ var instance = $.data( this, 'gridrotator' );
706
+
707
+ if ( typeof options === 'string' ) {
708
+
709
+ var args = Array.prototype.slice.call( arguments, 1 );
710
+
711
+ this.each(function() {
712
+
713
+ if ( !instance ) {
714
+
715
+ logError( "cannot call methods on gridrotator prior to initialization; " +
716
+ "attempted to call method '" + options + "'" );
717
+ return;
718
+
719
+ }
720
+
721
+ if ( !$.isFunction( instance[options] ) || options.charAt(0) === "_" ) {
722
+
723
+ logError( "no such method '" + options + "' for gridrotator instance" );
724
+ return;
725
+
726
+ }
727
+
728
+ instance[ options ].apply( instance, args );
729
+
730
+ });
731
+
732
+ }
733
+ else {
734
+
735
+ this.each(function() {
736
+
737
+ if ( instance ) {
738
+
739
+ instance._init();
740
+
741
+ }
742
+ else {
743
+
744
+ instance = $.data( this, 'gridrotator', new $.GridRotator( options, this ) );
745
+
746
+ }
747
+
748
+ });
749
+
750
+ }
751
+
752
+ return instance;
753
+
754
+ };
755
+
756
+ } )( jQuery, window );
js/jquery.gridrotator.js ADDED
@@ -0,0 +1,827 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * jquery.gridrotator.js v1.1.0
3
+ * http://www.codrops.com
4
+ *
5
+ * Licensed under the MIT license.
6
+ * http://www.opensource.org/licenses/mit-license.php
7
+ *
8
+ * Copyright 2012, Codrops
9
+ * http://www.codrops.com
10
+ */
11
+ ;( function( $, window, undefined ) {
12
+
13
+ 'use strict';
14
+
15
+ /*
16
+ * debouncedresize: special jQuery event that happens once after a window resize
17
+ *
18
+ * latest version and complete README available on Github:
19
+ * https://github.com/louisremi/jquery-smartresize/blob/master/jquery.debouncedresize.js
20
+ *
21
+ * Copyright 2011 @louis_remi
22
+ * Licensed under the MIT license.
23
+ */
24
+ var $event = $.event,
25
+ $special,
26
+ resizeTimeout;
27
+
28
+ $special = $event.special.debouncedresize = {
29
+ setup: function() {
30
+ $( this ).on( "resize", $special.handler );
31
+ },
32
+ teardown: function() {
33
+ $( this ).off( "resize", $special.handler );
34
+ },
35
+ handler: function( event, execAsap ) {
36
+ // Save the context
37
+ var context = this,
38
+ args = arguments,
39
+ dispatch = function() {
40
+ // set correct event type
41
+ event.type = "debouncedresize";
42
+ $event.dispatch.apply( context, args );
43
+ };
44
+
45
+ if ( resizeTimeout ) {
46
+ clearTimeout( resizeTimeout );
47
+ }
48
+
49
+ execAsap ?
50
+ dispatch() :
51
+ resizeTimeout = setTimeout( dispatch, $special.threshold );
52
+ },
53
+ threshold: 100
54
+ };
55
+
56
+ // http://www.hardcode.nl/subcategory_1/article_317-array-shuffle-function
57
+ Array.prototype.shuffle = function() {
58
+ var i=this.length,p,t;
59
+ while (i--) {
60
+ p = Math.floor(Math.random()*i);
61
+ t = this[i];
62
+ this[i]=this[p];
63
+ this[p]=t;
64
+ }
65
+ return this;
66
+ };
67
+
68
+ // HTML5 PageVisibility API
69
+ // http://www.html5rocks.com/en/tutorials/pagevisibility/intro/
70
+ // by Joe Marini (@joemarini)
71
+ function getHiddenProp(){
72
+ var prefixes = ['webkit','moz','ms','o'];
73
+
74
+ // if 'hidden' is natively supported just return it
75
+ if ('hidden' in document) return 'hidden';
76
+
77
+ // otherwise loop over all the known prefixes until we find one
78
+ for (var i = 0; i < prefixes.length; i++){
79
+ if ((prefixes[i] + 'Hidden') in document)
80
+ return prefixes[i] + 'Hidden';
81
+ }
82
+
83
+ // otherwise it's not supported
84
+ return null;
85
+ }
86
+ function isHidden() {
87
+ var prop = getHiddenProp();
88
+ if (!prop) return false;
89
+
90
+ return document[prop];
91
+ }
92
+
93
+ function isEmpty( obj ) {
94
+ return Object.keys(obj).length === 0;
95
+ }
96
+
97
+ // global
98
+ var $window = $( window ),
99
+ Modernizr = window.Modernizr;
100
+
101
+ $.GridRotator = function( options, element ) {
102
+
103
+ this.$el = $( element );
104
+ if( Modernizr.backgroundsize ) {
105
+
106
+ var self = this;
107
+ this.$el.addClass( 'ri-grid-loading' );
108
+ this._init( options );
109
+
110
+ }
111
+
112
+ };
113
+
114
+ // the options
115
+ $.GridRotator.defaults = {
116
+ // number of rows
117
+ rows : 4,
118
+ // number of columns
119
+ columns : 10,
120
+ w1024 : { rows : 3, columns : 8 },
121
+ w768 : {rows : 3,columns : 7 },
122
+ w480 : {rows : 3,columns : 5 },
123
+ w320 : {rows : 2,columns : 4 },
124
+ w240 : {rows : 2,columns : 3 },
125
+ // step: number of items that are replaced at the same time
126
+ // random || [some number]
127
+ // note: for performance issues, the number "can't" be > options.maxStep
128
+ step : 'random',
129
+ // change it as you wish..
130
+ maxStep : 3,
131
+ // prevent user to click the items
132
+ preventClick : true,
133
+ // animation type
134
+ // showHide || fadeInOut ||
135
+ // slideLeft || slideRight || slideTop || slideBottom ||
136
+ // rotateBottom || rotateLeft || rotateRight || rotateTop ||
137
+ // scale ||
138
+ // rotate3d ||
139
+ // rotateLeftScale || rotateRightScale || rotateTopScale || rotateBottomScale ||
140
+ // random
141
+ animType : 'random',
142
+ // animation speed
143
+ animSpeed : 800,
144
+ // animation easings
145
+ animEasingOut : 'linear',
146
+ animEasingIn: 'linear',
147
+ // the item(s) will be replaced every 3 seconds
148
+ // note: for performance issues, the time "can't" be < 300 ms
149
+ interval : 3000,
150
+ // if false the animations will not start
151
+ // use false if onhover is true for example
152
+ slideshow : true,
153
+ // if true the items will switch when hovered
154
+ onhover : false,
155
+ // ids of elements that shouldn't change
156
+ nochange : [],
157
+ // callback function when drawn
158
+ onDraw : function(){},
159
+ // Height to Width Ratio (Height/Width). A 0.5 ratio would be used for an image that is twice as large as it's height. Default is 1 (square images).
160
+ heightToWidthRatio : 1,
161
+ subImg : false
162
+ };
163
+
164
+ $.GridRotator.prototype = {
165
+
166
+ _init : function( options ) {
167
+
168
+ // options
169
+ this.options = $.extend( true, {}, $.GridRotator.defaults, options );
170
+ // cache some elements + variables
171
+ this._config();
172
+
173
+ },
174
+ _config : function() {
175
+
176
+ var self = this,
177
+ transEndEventNames = {
178
+ 'WebkitTransition' : 'webkitTransitionEnd',
179
+ 'MozTransition' : 'transitionend',
180
+ 'OTransition' : 'oTransitionEnd',
181
+ 'msTransition' : 'MSTransitionEnd',
182
+ 'transition' : 'transitionend'
183
+ };
184
+
185
+ // support CSS transitions and 3d transforms
186
+ this.supportTransitions = Modernizr.csstransitions;
187
+ this.supportTransforms3D = Modernizr.csstransforms3d;
188
+
189
+ this.transEndEventName = transEndEventNames[ Modernizr.prefixed( 'transition' ) ] + '.gridrotator';
190
+
191
+ // all animation types for the random option
192
+ this.animTypes = this.supportTransforms3D ? [
193
+ 'fadeInOut',
194
+ 'slideLeft',
195
+ 'slideRight',
196
+ 'slideTop',
197
+ 'slideBottom',
198
+ 'rotateLeft',
199
+ 'rotateRight',
200
+ 'rotateTop',
201
+ 'rotateBottom',
202
+ 'scale',
203
+ 'rotate3d',
204
+ 'rotateLeftScale',
205
+ 'rotateRightScale',
206
+ 'rotateTopScale',
207
+ 'rotateBottomScale' ] :
208
+ [ 'fadeInOut', 'slideLeft', 'slideRight', 'slideTop', 'slideBottom' ];
209
+
210
+ this.animType = this.options.animType;
211
+
212
+ if( this.animType !== 'random' && !this.supportTransforms3D && $.inArray( this.animType, this.animTypes ) === -1 && this.animType !== 'showHide' ) {
213
+
214
+ // fallback to 'fadeInOut' if user sets a type which is not supported
215
+ this.animType = 'fadeInOut';
216
+
217
+ }
218
+
219
+ this.animTypesTotal = this.animTypes.length;
220
+
221
+ // the <ul> where the items are placed
222
+ this.$list = this.$el.children( 'ul' );
223
+ // remove images and add background-image to anchors
224
+ // preload the images before
225
+ var loaded = 0,
226
+ subbed = 0,
227
+ $imgs = this.$list.find( 'img' ),
228
+ count = $imgs.length,
229
+ subColors = ["#D92727", "#FFE433", "#0DB8B5"];
230
+
231
+
232
+ // Check if the substitute image is available
233
+ if( self.options.subImg ) {
234
+
235
+ $( '<img/>' ).error( function() {
236
+
237
+ self.options.subImg = false;
238
+
239
+ } ).attr('src', self.options.subImg);
240
+
241
+ }
242
+
243
+ $imgs.each( function() {
244
+
245
+ var $img = $( this ), src = $img.attr( 'src' );
246
+
247
+ $( '<img/>' ).load( function() {
248
+
249
+ ++loaded;
250
+ $img.parent().css( 'background-image', 'url(' + src + ')' );
251
+
252
+ /*This conditional block should be moved out to remove redundancy =)*/
253
+ if( loaded + subbed === count ) {
254
+
255
+ $imgs.remove();
256
+ self.$el.removeClass( 'ri-grid-loading' );
257
+ // the items
258
+ self.$items = self.$list.children( 'li' );
259
+ // make a copy of the items
260
+ self.$itemsCache = self.$items.clone();
261
+ // total number of items
262
+ self.itemsTotal = self.$items.length;
263
+ // the items that will be out of the grid
264
+ // actually the item's child (anchor element)
265
+ self.outItems= [];
266
+ self._layout( function() {
267
+ self._initEvents();
268
+ } );
269
+ // replace [options.step] items after [options.interval] time
270
+ // the items that go out are randomly chosen, while the ones that get in
271
+ // follow a "First In First Out" logic
272
+ self._start();
273
+
274
+ }
275
+
276
+ } ).attr( 'src', src );
277
+
278
+ // If something is wrong with the image…
279
+ $( '<img/>' ).error( function() {
280
+
281
+ ++subbed;
282
+
283
+ // Are there any substitute images?
284
+ if( self.options.subImg ) {
285
+
286
+ $img.parent().css( 'background-image', 'url(' + self.options.subImg + ')' );
287
+
288
+ }
289
+
290
+ else {
291
+
292
+ var color = Math.floor(Math.random() * 3)
293
+ $img.parent().css( 'background', subColors[color] );
294
+
295
+ }
296
+
297
+ // console.log(self.options)
298
+
299
+ /*This conditional block should be moved out to remove redundancy =)*/
300
+ if( loaded + subbed === count ) {
301
+
302
+ $imgs.remove();
303
+ self.$el.removeClass( 'ri-grid-loading' );
304
+ // the items
305
+ self.$items = self.$list.children( 'li' );
306
+ // make a copy of the items
307
+ self.$itemsCache = self.$items.clone();
308
+ // total number of items
309
+ self.itemsTotal = self.$items.length;
310
+ // the items that will be out of the grid
311
+ // actually the item's child (anchor element)
312
+ self.outItems= [];
313
+ self._layout( function() {
314
+ self._initEvents();
315
+ } );
316
+ // replace [options.step] items after [options.interval] time
317
+ // the items that go out are randomly chosen, while the ones that get in
318
+ // follow a "First In First Out" logic
319
+ self._start();
320
+
321
+ }
322
+
323
+ } ).attr( 'src', src );
324
+
325
+
326
+
327
+ } );
328
+
329
+ },
330
+ _layout : function( callback ) {
331
+
332
+ var self = this;
333
+
334
+ // sets the grid dimentions based on the container's width
335
+ this._setGridDim();
336
+
337
+ // reset
338
+ this.$list.empty();
339
+ this.$items = this.$itemsCache.clone().appendTo( this.$list );
340
+
341
+ var $outItems = this.$items.filter( ':gt(' + ( this.showTotal - 1 ) + ')' ),
342
+ $outAItems = $outItems.children( 'a' );
343
+
344
+ this.outItems.length = 0;
345
+
346
+ $outAItems.each( function( i ) {
347
+ self.outItems.push( $( this ) );
348
+ } );
349
+
350
+ $outItems.remove();
351
+
352
+ // container's width
353
+ var containerWidth = ( document.defaultView ) ? parseInt( document.defaultView.getComputedStyle( this.$el.get( 0 ), null ).width ) : this.$el.width(),
354
+ // item's width
355
+ itemWidth = Math.floor( containerWidth / this.columns ),
356
+ // calculate gap
357
+ gapWidth = containerWidth - ( this.columns * Math.floor( itemWidth ) );
358
+
359
+ for( var i = 0; i < this.rows; ++i ) {
360
+
361
+ for( var j = 0; j < this.columns; ++j ) {
362
+
363
+ var idx = this.columns * i + j,
364
+ $item = this.$items.eq( idx );
365
+
366
+ $item.css( {
367
+ width : j < Math.floor( gapWidth ) ? itemWidth + 1 : itemWidth,
368
+ height : Math.floor( itemWidth * this.options.heightToWidthRatio )
369
+ } );
370
+
371
+ if( $.inArray( idx, this.options.nochange ) !== -1 ) {
372
+ $item.addClass( 'ri-nochange' ).data( 'nochange', true );
373
+ }
374
+
375
+ }
376
+
377
+ }
378
+
379
+ if( this.options.preventClick ) {
380
+
381
+ this.$items.children().css( 'cursor', 'default' ).on( 'click.gridrotator', false );
382
+
383
+ }
384
+
385
+ if( callback ) {
386
+ callback.call();
387
+ }
388
+
389
+ this.options.onDraw.call(this);
390
+
391
+ },
392
+ // set the grid rows and columns
393
+ _setGridDim : function() {
394
+
395
+ // container's width
396
+ var c_w = this.$el.width();
397
+
398
+ // we will choose the number of rows/columns according to the container's width and the values set in the plugin options
399
+ switch( true ) {
400
+ case ( c_w < 240 ) : this.rows = this.options.w240.rows; this.columns = this.options.w240.columns; break;
401
+ case ( c_w < 320 ) : this.rows = this.options.w320.rows; this.columns = this.options.w320.columns; break;
402
+ case ( c_w < 480 ) : this.rows = this.options.w480.rows; this.columns = this.options.w480.columns; break;
403
+ case ( c_w < 768 ) : this.rows = this.options.w768.rows; this.columns = this.options.w768.columns; break;
404
+ case ( c_w < 1024 ) : this.rows = this.options.w1024.rows; this.columns = this.options.w1024.columns; break;
405
+ default : this.rows = this.options.rows; this.columns = this.options.columns; break;
406
+ }
407
+
408
+ this.showTotal = this.rows * this.columns;
409
+
410
+ },
411
+ // init window resize event
412
+ _initEvents : function() {
413
+
414
+ var self = this;
415
+
416
+ $window.on( 'debouncedresize.gridrotator', function() {
417
+ self._layout();
418
+ } );
419
+
420
+ // use the property name to generate the prefixed event name
421
+ var visProp = getHiddenProp();
422
+
423
+ // HTML5 PageVisibility API
424
+ // http://www.html5rocks.com/en/tutorials/pagevisibility/intro/
425
+ // by Joe Marini (@joemarini)
426
+ if (visProp) {
427
+
428
+ var evtname = visProp.replace(/[H|h]idden/,'') + 'visibilitychange';
429
+ document.addEventListener(evtname, function() { self._visChange(); } );
430
+
431
+ }
432
+
433
+ if( !Modernizr.touch && this.options.onhover ) {
434
+
435
+ self.$items.on( 'mouseenter.gridrotator', function() {
436
+
437
+ var $item = $( this );
438
+ if( !$item.data( 'active' ) && !$item.data( 'hovered' ) && !$item.data( 'nochange' ) ) {
439
+ $item.data( 'hovered', true );
440
+ self._replace( $item );
441
+ }
442
+
443
+ } ).on( 'mouseleave.gridrotator', function() {
444
+
445
+ $( this ).data( 'hovered', false );
446
+
447
+ } );
448
+
449
+ }
450
+
451
+ },
452
+ _visChange : function() {
453
+
454
+ isHidden() ? clearTimeout( this.playtimeout ) : this._start();
455
+
456
+ },
457
+ // start rotating elements
458
+ _start : function() {
459
+
460
+ if( this.showTotal < this.itemsTotal && this.options.slideshow ) {
461
+ this._showNext();
462
+ }
463
+
464
+ },
465
+ // get which type of animation
466
+ _getAnimType : function() {
467
+
468
+ return this.animType === 'random' ? this.animTypes[ Math.floor( Math.random() * this.animTypesTotal ) ] : this.animType;
469
+
470
+ },
471
+ // get css properties for the transition effect
472
+ _getAnimProperties : function( $out ) {
473
+
474
+ var startInProp = {}, startOutProp = {}, endInProp = {}, endOutProp = {},
475
+ animType = this._getAnimType(), speed, delay = 0;
476
+
477
+ switch( animType ) {
478
+
479
+ case 'showHide' :
480
+
481
+ speed = 0;
482
+ endOutProp.opacity = 0;
483
+ break;
484
+
485
+ case 'fadeInOut' :
486
+
487
+ endOutProp.opacity = 0;
488
+ break;
489
+
490
+ case 'slideLeft' :
491
+
492
+ startInProp.left = $out.width();
493
+ endInProp.left = 0;
494
+ endOutProp.left = -$out.width();
495
+ break;
496
+
497
+ case 'slideRight' :
498
+
499
+ startInProp.left = -$out.width();
500
+ endInProp.left = 0;
501
+ endOutProp.left = $out.width();
502
+ break;
503
+
504
+ case 'slideTop' :
505
+
506
+ startInProp.top = $out.height();
507
+ endInProp.top = 0;
508
+ endOutProp.top = -$out.height();
509
+ break;
510
+
511
+ case 'slideBottom' :
512
+
513
+ startInProp.top = -$out.height();
514
+ endInProp.top = 0;
515
+ endOutProp.top = $out.height();
516
+ break;
517
+
518
+ case 'rotateLeft' :
519
+
520
+ speed = this.options.animSpeed / 2;
521
+ startInProp.transform = 'rotateY(90deg)';
522
+ endInProp.transform = 'rotateY(0deg)';
523
+ delay = speed;
524
+ endOutProp.transform = 'rotateY(-90deg)';
525
+ break;
526
+
527
+ case 'rotateRight' :
528
+
529
+ speed = this.options.animSpeed / 2;
530
+ startInProp.transform = 'rotateY(-90deg)';
531
+ endInProp.transform = 'rotateY(0deg)';
532
+ delay = speed;
533
+ endOutProp.transform = 'rotateY(90deg)';
534
+ break;
535
+
536
+ case 'rotateTop' :
537
+
538
+ speed = this.options.animSpeed / 2;
539
+ startInProp.transform= 'rotateX(90deg)';
540
+ endInProp.transform = 'rotateX(0deg)';
541
+ delay = speed;
542
+ endOutProp.transform = 'rotateX(-90deg)';
543
+ break;
544
+
545
+ case 'rotateBottom' :
546
+
547
+ speed = this.options.animSpeed / 2;
548
+ startInProp.transform = 'rotateX(-90deg)';
549
+ endInProp.transform = 'rotateX(0deg)';
550
+ delay = speed;
551
+ endOutProp.transform = 'rotateX(90deg)';
552
+ break;
553
+
554
+ case 'scale' :
555
+
556
+ speed = this.options.animSpeed / 2;
557
+ startInProp.transform = 'scale(0)';
558
+ startOutProp.transform = 'scale(1)';
559
+ endInProp.transform = 'scale(1)';
560
+ delay = speed;
561
+ endOutProp.transform = 'scale(0)';
562
+ break;
563
+
564
+ case 'rotateLeftScale' :
565
+
566
+ startOutProp.transform = 'scale(1)';
567
+ speed = this.options.animSpeed / 2;
568
+ startInProp.transform = 'scale(0.3) rotateY(90deg)';
569
+ endInProp.transform = 'scale(1) rotateY(0deg)';
570
+ delay = speed;
571
+ endOutProp.transform = 'scale(0.3) rotateY(-90deg)';
572
+ break;
573
+
574
+ case 'rotateRightScale' :
575
+
576
+ startOutProp.transform = 'scale(1)';
577
+ speed = this.options.animSpeed / 2;
578
+ startInProp.transform = 'scale(0.3) rotateY(-90deg)';
579
+ endInProp.transform = 'scale(1) rotateY(0deg)';
580
+ delay = speed;
581
+ endOutProp.transform = 'scale(0.3) rotateY(90deg)';
582
+ break;
583
+
584
+ case 'rotateTopScale' :
585
+
586
+ startOutProp.transform = 'scale(1)';
587
+ speed = this.options.animSpeed / 2;
588
+ startInProp.transform = 'scale(0.3) rotateX(90deg)';
589
+ endInProp.transform = 'scale(1) rotateX(0deg)';
590
+ delay = speed;
591
+ endOutProp.transform = 'scale(0.3) rotateX(-90deg)';
592
+ break;
593
+
594
+ case 'rotateBottomScale' :
595
+
596
+ startOutProp.transform = 'scale(1)';
597
+ speed = this.options.animSpeed / 2;
598
+ startInProp.transform = 'scale(0.3) rotateX(-90deg)';
599
+ endInProp.transform = 'scale(1) rotateX(0deg)';
600
+ delay = speed;
601
+ endOutProp.transform = 'scale(0.3) rotateX(90deg)';
602
+ break;
603
+
604
+ case 'rotate3d' :
605
+
606
+ speed = this.options.animSpeed / 2;
607
+ startInProp.transform = 'rotate3d( 1, 1, 0, 90deg )';
608
+ endInProp.transform = 'rotate3d( 1, 1, 0, 0deg )';
609
+ delay = speed;
610
+ endOutProp.transform = 'rotate3d( 1, 1, 0, -90deg )';
611
+ break;
612
+
613
+ }
614
+
615
+ return {
616
+ startInProp : startInProp,
617
+ startOutProp : startOutProp,
618
+ endInProp : endInProp,
619
+ endOutProp : endOutProp,
620
+ delay : delay,
621
+ animSpeed : speed != undefined ? speed : this.options.animSpeed
622
+ };
623
+
624
+ },
625
+ // show next [option.step] elements
626
+ _showNext : function( time ) {
627
+
628
+ var self = this;
629
+
630
+ clearTimeout( this.playtimeout );
631
+
632
+ this.playtimeout = setTimeout( function() {
633
+
634
+ var step = self.options.step, max= self.options.maxStep, min = 1;
635
+
636
+ if( max > self.showTotal ) {
637
+ max = self.showTotal;
638
+ }
639
+
640
+ // number of items to swith at this point of time
641
+ var nmbOut = step === 'random' ? Math.floor( Math.random() * max + min ) : Math.min( Math.abs( step ) , max ) ,
642
+ // array with random indexes. These will be the indexes of the items we will replace
643
+ randArr = self._getRandom( nmbOut, self.showTotal );
644
+
645
+ for( var i = 0; i < nmbOut; ++i ) {
646
+
647
+ // element to go out
648
+ var $out = self.$items.eq( randArr[ i ] );
649
+
650
+ // if element is active, which means it is currently animating,
651
+ // then we need to get different positions..
652
+ if( $out.data( 'active' ) || $out.data( 'nochange' ) ) {
653
+
654
+ // one of the items is active, call again..
655
+ self._showNext( 1 );
656
+ return false;
657
+
658
+ }
659
+
660
+ self._replace( $out );
661
+
662
+ }
663
+
664
+ // again and again..
665
+ self._showNext();
666
+
667
+ }, time || Math.max( Math.abs( this.options.interval ) , 300 ) );
668
+
669
+ },
670
+ _replace : function( $out ) {
671
+
672
+ $out.data( 'active', true );
673
+
674
+ var self = this,
675
+ $outA = $out.children( 'a:last' ),
676
+ newElProp = {
677
+ width : $outA.width(),
678
+ height : $outA.height()
679
+ };
680
+
681
+ // element stays active
682
+ $out.data( 'active', true );
683
+
684
+ // get the element (anchor) that will go in (first one inserted in this.outItems)
685
+ var $inA = this.outItems.shift();
686
+
687
+ // save element that went out
688
+ this.outItems.push( $outA.clone().css( 'transition', 'none' ) );
689
+
690
+ // prepend in element
691
+ $inA.css( newElProp ).prependTo( $out );
692
+
693
+ var animProp = this._getAnimProperties( $outA );
694
+
695
+ $inA.css( animProp.startInProp );
696
+ $outA.css( animProp.startOutProp );
697
+
698
+ this._setTransition( $inA, 'all', animProp.animSpeed, animProp.delay, this.options.animEasingIn );
699
+ this._setTransition( $outA, 'all', animProp.animSpeed, 0, this.options.animEasingOut );
700
+
701
+ this._applyTransition( $inA, animProp.endInProp, animProp.animSpeed, function() {
702
+
703
+ var $el = $( this ),
704
+ t = animProp.animSpeed === self.options.animSpeed && isEmpty( animProp.endInProp ) ? animProp.animSpeed : 0;
705
+
706
+ setTimeout( function() {
707
+
708
+ if( self.supportTransitions ) {
709
+ $el.off( self.transEndEventName );
710
+ }
711
+
712
+ $el.next().remove();
713
+ $el.parent().data( 'active', false );
714
+
715
+ }, t );
716
+
717
+ }, animProp.animSpeed === 0 || isEmpty( animProp.endInProp ) );
718
+ this._applyTransition( $outA, animProp.endOutProp, animProp.animSpeed );
719
+
720
+ },
721
+ _getRandom : function( cnt, limit ) {
722
+
723
+ var randArray = [];
724
+
725
+ for( var i = 0; i < limit; ++i ) {
726
+ randArray.push( i )
727
+ }
728
+
729
+ return randArray.shuffle().slice( 0, cnt );
730
+
731
+ },
732
+ _setTransition : function( el, prop, speed, delay, easing ) {
733
+
734
+ setTimeout( function() {
735
+ el.css( 'transition', prop + ' ' + speed + 'ms ' + delay + 'ms ' + easing );
736
+ }, 25 );
737
+
738
+ },
739
+ _applyTransition : function( el, styleCSS, speed, fncomplete, force ) {
740
+
741
+ var self = this;
742
+ setTimeout( function() {
743
+ $.fn.applyStyle = self.supportTransitions ? $.fn.css : $.fn.animate;
744
+
745
+ if( fncomplete && self.supportTransitions ) {
746
+
747
+ el.on( self.transEndEventName, fncomplete );
748
+
749
+ if( force ) {
750
+ fncomplete.call( el );
751
+ }
752
+
753
+ }
754
+
755
+ fncomplete = fncomplete || function() { return false; };
756
+
757
+ el.stop().applyStyle( styleCSS, $.extend( true, [], { duration : speed + 'ms', complete : fncomplete } ) );
758
+ }, 25 );
759
+
760
+ }
761
+
762
+ };
763
+
764
+ var logError = function( message ) {
765
+
766
+ if ( window.console ) {
767
+
768
+ window.console.error( message );
769
+
770
+ }
771
+
772
+ };
773
+
774
+ $.fn.gridrotator = function( options ) {
775
+
776
+ var instance = $.data( this, 'gridrotator' );
777
+
778
+ if ( typeof options === 'string' ) {
779
+
780
+ var args = Array.prototype.slice.call( arguments, 1 );
781
+
782
+ this.each(function() {
783
+
784
+ if ( !instance ) {
785
+
786
+ logError( "cannot call methods on gridrotator prior to initialization; " +
787
+ "attempted to call method '" + options + "'" );
788
+ return;
789
+
790
+ }
791
+
792
+ if ( !$.isFunction( instance[options] ) || options.charAt(0) === "_" ) {
793
+
794
+ logError( "no such method '" + options + "' for gridrotator instance" );
795
+ return;
796
+
797
+ }
798
+
799
+ instance[ options ].apply( instance, args );
800
+
801
+ });
802
+
803
+ }
804
+ else {
805
+
806
+ this.each(function() {
807
+
808
+ if ( instance ) {
809
+
810
+ instance._init();
811
+
812
+ }
813
+ else {
814
+
815
+ instance = $.data( this, 'gridrotator', new $.GridRotator( options, this ) );
816
+
817
+ }
818
+
819
+ });
820
+
821
+ }
822
+
823
+ return instance;
824
+
825
+ };
826
+
827
+ } )( jQuery, window );
js/jquery.swipebox.js ADDED
@@ -0,0 +1,717 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! Swipebox v1.2.7 | Constantin Saguin csag.co | MIT License | github.com/brutaldesign/swipebox */
2
+
3
+ ;( function ( window, document, $, undefined ) {
4
+
5
+ $.swipebox = function( elem, options ) {
6
+
7
+ // Default options
8
+ var defaults = {
9
+ useCSS : true,
10
+ initialIndexOnArray : 0,
11
+ hideBarsDelay : 3000,
12
+ videoMaxWidth : 1140,
13
+ vimeoColor : 'CCCCCC',
14
+ beforeOpen: null,
15
+ afterClose: null
16
+ },
17
+
18
+ plugin = this,
19
+ elements = [], // slides array [ { href:'...', title:'...' }, ...],
20
+ selector = elem.selector,
21
+ $selector = $( selector ),
22
+ isMobile = navigator.userAgent.match( /(iPad)|(iPhone)|(iPod)|(Android)|(PlayBook)|(BB10)|(BlackBerry)|(Opera Mini)|(IEMobile)|(webOS)|(MeeGo)/i ),
23
+ isTouch = isMobile !== null || document.createTouch !== undefined || ( 'ontouchstart' in window ) || ( 'onmsgesturechange' in window ) || navigator.msMaxTouchPoints,
24
+ supportSVG = !! document.createElementNS && !! document.createElementNS( 'http://www.w3.org/2000/svg', "svg").createSVGRect,
25
+ winWidth = window.innerWidth ? window.innerWidth : $( window ).width(),
26
+ winHeight = window.innerHeight ? window.innerHeight : $( window ).height(),
27
+ /* jshint multistr: true */
28
+ html = '<div id="swipebox-overlay">\
29
+ <div id="swipebox-slider"></div>\
30
+ <div id="swipebox-caption"></div>\
31
+ <div id="swipebox-action">\
32
+ <a id="swipebox-close"></a>\
33
+ <a id="swipebox-prev"></a>\
34
+ <a id="swipebox-next"></a>\
35
+ </div>\
36
+ </div>';
37
+
38
+ plugin.settings = {};
39
+
40
+ plugin.init = function() {
41
+
42
+ plugin.settings = $.extend( {}, defaults, options );
43
+
44
+ if ( $.isArray( elem ) ) {
45
+
46
+ elements = elem;
47
+ ui.target = $( window );
48
+ ui.init( plugin.settings.initialIndexOnArray );
49
+
50
+ } else {
51
+
52
+ $( document ).on( 'click', selector, function( event ) {
53
+
54
+ // console.log( isTouch );
55
+
56
+ if ( event.target.parentNode.className === 'slide current' ) {
57
+
58
+ return false;
59
+
60
+ }
61
+
62
+ if ( ! $.isArray( elem ) ) {
63
+ ui.destroy();
64
+ $elem = $( selector );
65
+ ui.actions();
66
+ }
67
+
68
+ elements = [];
69
+ var index , relType, relVal;
70
+
71
+ if ( ! relVal ) {
72
+ relType = 'rel';
73
+ relVal = $( this ).attr( relType );
74
+ }
75
+
76
+ if ( relVal && relVal !== '' && relVal !== 'nofollow' ) {
77
+ $elem = $selector.filter( '[' + relType + '="' + relVal + '"]' );
78
+ } else {
79
+ $elem = $( selector );
80
+ }
81
+
82
+ $elem.each( function() {
83
+
84
+ var title = null,
85
+ href = null;
86
+
87
+ if ( $( this ).attr( 'title' ) ) {
88
+ title = $( this ).attr( 'title' );
89
+ }
90
+
91
+
92
+ if ( $( this ).attr( 'href' ) ) {
93
+ href = $( this ).attr( 'href' );
94
+ }
95
+
96
+ elements.push( {
97
+ href: href,
98
+ title: title
99
+ } );
100
+ } );
101
+
102
+ index = $elem.index( $( this ) );
103
+ event.preventDefault();
104
+ event.stopPropagation();
105
+ ui.target = $( event.target );
106
+ ui.init( index );
107
+ } );
108
+ }
109
+ };
110
+
111
+ /**
112
+ * Refresh method
113
+ */
114
+ plugin.refresh = function() {
115
+ if ( ! $.isArray( elem ) ) {
116
+ ui.destroy();
117
+ $elem = $( selector );
118
+ ui.actions();
119
+ }
120
+ };
121
+
122
+ var ui = {
123
+
124
+ /**
125
+ * Initiate Swipebox
126
+ */
127
+ init : function( index ) {
128
+ if ( plugin.settings.beforeOpen )
129
+ plugin.settings.beforeOpen();
130
+ this.target.trigger( 'swipebox-start' );
131
+ $.swipebox.isOpen = true;
132
+ this.build();
133
+ this.openSlide( index );
134
+ this.openMedia( index );
135
+ this.preloadMedia( index+1 );
136
+ this.preloadMedia( index-1 );
137
+ },
138
+
139
+ /**
140
+ * Built HTML containers and fire main functions
141
+ */
142
+ build : function () {
143
+ var $this = this;
144
+
145
+ $( 'body' ).append( html );
146
+
147
+ if ( $this.doCssTrans() ) {
148
+ $( '#swipebox-slider' ).css( {
149
+ '-webkit-transition' : 'left 0.4s ease',
150
+ '-moz-transition' : 'left 0.4s ease',
151
+ '-o-transition' : 'left 0.4s ease',
152
+ '-khtml-transition' : 'left 0.4s ease',
153
+ 'transition' : 'left 0.4s ease'
154
+ } );
155
+ $( '#swipebox-overlay' ).css( {
156
+ '-webkit-transition' : 'opacity 1s ease',
157
+ '-moz-transition' : 'opacity 1s ease',
158
+ '-o-transition' : 'opacity 1s ease',
159
+ '-khtml-transition' : 'opacity 1s ease',
160
+ 'transition' : 'opacity 1s ease'
161
+ } );
162
+ $( '#swipebox-action, #swipebox-caption' ).css( {
163
+ '-webkit-transition' : '0.5s',
164
+ '-moz-transition' : '0.5s',
165
+ '-o-transition' : '0.5s',
166
+ '-khtml-transition' : '0.5s',
167
+ 'transition' : '0.5s'
168
+ } );
169
+ }
170
+
171
+
172
+ if ( supportSVG ) {
173
+ var bg = $( '#swipebox-action #swipebox-close' ).css( 'background-image' );
174
+ bg = bg.replace( 'png', 'svg' );
175
+ $( '#swipebox-action #swipebox-prev,#swipebox-action #swipebox-next,#swipebox-action #swipebox-close' ).css( {
176
+ 'background-image' : bg
177
+ } );
178
+ }
179
+
180
+ $.each( elements, function() {
181
+ $( '#swipebox-slider' ).append( '<div class="slide"></div>' );
182
+ } );
183
+
184
+ $this.setDim();
185
+ $this.actions();
186
+
187
+ if ( isTouch ) {
188
+ $this.gesture();
189
+ } else {
190
+ $this.keyboard();
191
+ }
192
+
193
+ $this.animBars();
194
+ $this.resize();
195
+
196
+ },
197
+
198
+ /**
199
+ * Set dimensions depending on windows width and height
200
+ */
201
+ setDim : function () {
202
+
203
+ var width, height, sliderCss = {};
204
+
205
+ // Reset dimensions on mobile orientation change
206
+ if ( "onorientationchange" in window ) {
207
+
208
+ window.addEventListener( "orientationchange", function() {
209
+ if ( window.orientation === 0 ) {
210
+ width = winWidth;
211
+ height = winHeight;
212
+ } else if ( window.orientation === 90 || window.orientation === -90 ) {
213
+ width = winHeight;
214
+ height = winWidth;
215
+ }
216
+ }, false );
217
+
218
+
219
+ } else {
220
+
221
+ width = window.innerWidth ? window.innerWidth : $( window ).width();
222
+ height = window.innerHeight ? window.innerHeight : $( window ).height();
223
+ }
224
+
225
+ sliderCss = {
226
+ width : width,
227
+ height : height
228
+ };
229
+
230
+ $( '#swipebox-overlay' ).css( sliderCss );
231
+
232
+ },
233
+
234
+ /**
235
+ * Reset dimensions on window resize envent
236
+ */
237
+ resize : function () {
238
+ var $this = this;
239
+
240
+ $( window ).resize( function() {
241
+ $this.setDim();
242
+ } ).resize();
243
+ },
244
+
245
+ /**
246
+ * Check if device supports CSS transitions
247
+ */
248
+ supportTransition : function () {
249
+
250
+ var prefixes = 'transition WebkitTransition MozTransition OTransition msTransition KhtmlTransition'.split( ' ' );
251
+
252
+ for ( var i = 0; i < prefixes.length; i++ ) {
253
+ if ( document.createElement( 'div' ).style[ prefixes[i] ] !== undefined ) {
254
+ return prefixes[i];
255
+ }
256
+ }
257
+ return false;
258
+ },
259
+
260
+ /**
261
+ * Check if CSS transitions are allowed (options + devicesupport)
262
+ */
263
+ doCssTrans : function () {
264
+ if ( plugin.settings.useCSS && this.supportTransition() ) {
265
+ return true;
266
+ }
267
+ },
268
+
269
+ /**
270
+ * Touch navigation
271
+ */
272
+ gesture : function () {
273
+
274
+ var $this = this,
275
+ distance = null,
276
+ swipMinDistance = 10,
277
+ startCoords = {},
278
+ endCoords = {};
279
+ var bars = $( '#swipebox-caption, #swipebox-action' );
280
+
281
+ bars.addClass( 'visible-bars' );
282
+ $this.setTimeout();
283
+
284
+ $( 'body' ).bind( 'touchstart', function( event ) {
285
+
286
+ $(this).addClass( 'touching' );
287
+
288
+ endCoords = event.originalEvent.targetTouches[0];
289
+ startCoords.pageX = event.originalEvent.targetTouches[0].pageX;
290
+
291
+ $( '.touching' ).bind( 'touchmove',function( event ) {
292
+ event.preventDefault();
293
+ event.stopPropagation();
294
+ endCoords = event.originalEvent.targetTouches[0];
295
+
296
+ } );
297
+
298
+ return false;
299
+
300
+ } ).bind( 'touchend',function( event ) {
301
+ event.preventDefault();
302
+ event.stopPropagation();
303
+
304
+ distance = endCoords.pageX - startCoords.pageX;
305
+
306
+ if ( distance >= swipMinDistance ) {
307
+
308
+ // swipeLeft
309
+ $this.getPrev();
310
+
311
+ } else if ( distance <= - swipMinDistance ) {
312
+
313
+ // swipeRight
314
+ $this.getNext();
315
+
316
+ } else {
317
+ // tap
318
+ if ( ! bars.hasClass( 'visible-bars' ) ) {
319
+ $this.showBars();
320
+ $this.setTimeout();
321
+ } else {
322
+ $this.clearTimeout();
323
+ $this.hideBars();
324
+ }
325
+
326
+ }
327
+
328
+ $( '.touching' ).off( 'touchmove' ).removeClass( 'touching' );
329
+
330
+ } );
331
+
332
+ },
333
+
334
+ /**
335
+ * Set timer to hide the action bars
336
+ */
337
+ setTimeout: function () {
338
+ if ( plugin.settings.hideBarsDelay > 0 ) {
339
+ var $this = this;
340
+ $this.clearTimeout();
341
+ $this.timeout = window.setTimeout( function() {
342
+ $this.hideBars();
343
+ },
344
+
345
+ plugin.settings.hideBarsDelay
346
+ );
347
+ }
348
+ },
349
+
350
+ /**
351
+ * Clear timer
352
+ */
353
+ clearTimeout: function () {
354
+ window.clearTimeout( this.timeout );
355
+ this.timeout = null;
356
+ },
357
+
358
+ /**
359
+ * Show navigation and title bars
360
+ */
361
+ showBars : function () {
362
+ var bars = $( '#swipebox-caption, #swipebox-action' );
363
+ if ( this.doCssTrans() ) {
364
+ bars.addClass( 'visible-bars' );
365
+ } else {
366
+ $( '#swipebox-caption' ).animate( { top : 0 }, 500 );
367
+ $( '#swipebox-action' ).animate( { bottom : 0 }, 500 );
368
+ setTimeout( function() {
369
+ bars.addClass( 'visible-bars' );
370
+ }, 1000 );
371
+ }
372
+ },
373
+
374
+ /**
375
+ * Hide navigation and title bars
376
+ */
377
+ hideBars : function () {
378
+ var bars = $( '#swipebox-caption, #swipebox-action' );
379
+ if ( this.doCssTrans() ) {
380
+ bars.removeClass( 'visible-bars' );
381
+ } else {
382
+ $( '#swipebox-caption' ).animate( { top : '-50px' }, 500 );
383
+ $( '#swipebox-action' ).animate( { bottom : '-50px' }, 500 );
384
+ setTimeout( function() {
385
+ bars.removeClass( 'visible-bars' );
386
+ }, 1000 );
387
+ }
388
+ },
389
+
390
+ /**
391
+ * Animate navigation and top bars
392
+ */
393
+ animBars : function () {
394
+ var $this = this;
395
+ var bars = $( '#swipebox-caption, #swipebox-action' );
396
+
397
+ bars.addClass( 'visible-bars' );
398
+ $this.setTimeout();
399
+
400
+ $( '#swipebox-slider' ).click( function() {
401
+ if ( ! bars.hasClass( 'visible-bars' ) ) {
402
+ $this.showBars();
403
+ $this.setTimeout();
404
+ }
405
+ } );
406
+
407
+ if ( ! isTouch ) {
408
+
409
+ $( '#swipebox-action' ).hover( function() {
410
+ $this.showBars();
411
+ bars.addClass( 'visible-bars' );
412
+ $this.clearTimeout();
413
+
414
+ }, function() {
415
+ bars.removeClass( 'visible-bars' );
416
+ $this.setTimeout();
417
+
418
+ } );
419
+
420
+ }
421
+ },
422
+
423
+ /**
424
+ * Keyboard navigation
425
+ */
426
+ keyboard : function () {
427
+ var $this = this;
428
+ $( window ).bind( 'keyup', function( event ) {
429
+ event.preventDefault();
430
+ event.stopPropagation();
431
+
432
+ if ( event.keyCode === 37 ) {
433
+
434
+ $this.getPrev();
435
+
436
+ } else if ( event.keyCode === 39 ) {
437
+
438
+ $this.getNext();
439
+
440
+ } else if ( event.keyCode === 27 ) {
441
+
442
+ $this.closeSlide();
443
+
444
+ }
445
+ } );
446
+ },
447
+
448
+ /**
449
+ * Navigation events : go to next slide, go to prevous slide and close
450
+ */
451
+ actions : function () {
452
+ var $this = this;
453
+
454
+ var action = isTouch ? 'touchend' : 'click';
455
+
456
+ if ( elements.length < 2 ) {
457
+
458
+ $( '#swipebox-prev, #swipebox-next' ).hide();
459
+
460
+ } else {
461
+ $( '#swipebox-prev' ).bind( action, function( event ) {
462
+ event.preventDefault();
463
+ event.stopPropagation();
464
+ $this.getPrev();
465
+ $this.setTimeout();
466
+ } );
467
+
468
+ $( '#swipebox-next' ).bind( action, function( event ) {
469
+ event.preventDefault();
470
+ event.stopPropagation();
471
+ $this.getNext();
472
+ $this.setTimeout();
473
+ } );
474
+ }
475
+
476
+ $( '#swipebox-close' ).bind( action, function() {
477
+ $this.closeSlide();
478
+ } );
479
+ },
480
+
481
+ /**
482
+ * Set current slide
483
+ */
484
+ setSlide : function ( index, isFirst ) {
485
+ isFirst = isFirst || false;
486
+
487
+ var slider = $( '#swipebox-slider' );
488
+
489
+ if ( this.doCssTrans() ) {
490
+ slider.css( { left : ( -index*100 )+'%' } );
491
+ } else {
492
+ slider.animate( { left : ( -index*100 )+'%' } );
493
+ }
494
+
495
+ $( '#swipebox-slider .slide' ).removeClass( 'current' );
496
+ $( '#swipebox-slider .slide' ).eq( index ).addClass( 'current' );
497
+ this.setTitle( index );
498
+
499
+ if ( isFirst ) {
500
+ slider.fadeIn();
501
+ }
502
+
503
+ $( '#swipebox-prev, #swipebox-next' ).removeClass( 'disabled' );
504
+
505
+ if ( index === 0 ) {
506
+ $( '#swipebox-prev' ).addClass( 'disabled' );
507
+ } else if ( index === elements.length - 1 ) {
508
+ $( '#swipebox-next' ).addClass( 'disabled' );
509
+ }
510
+ },
511
+
512
+ /**
513
+ * Open slide
514
+ */
515
+ openSlide : function ( index ) {
516
+ $( 'html' ).addClass( 'swipebox-html' );
517
+ if ( isTouch ) {
518
+ $( 'html' ).addClass( 'swipebox-touch' );
519
+ }
520
+ $( window ).trigger( 'resize' ); // fix scroll bar visibility on desktop
521
+ this.setSlide( index, true );
522
+ },
523
+
524
+ /**
525
+ * Set a time out if the media is a video
526
+ */
527
+ preloadMedia : function ( index ) {
528
+ var $this = this,
529
+ src = null;
530
+
531
+ if ( elements[index] !== undefined )
532
+ src = elements[index].href;
533
+
534
+ if ( ! $this.isVideo( src ) ) {
535
+ setTimeout( function() {
536
+ $this.openMedia( index );
537
+ }, 1000);
538
+ } else {
539
+ $this.openMedia( index );
540
+ }
541
+ },
542
+
543
+ /**
544
+ * Open
545
+ */
546
+ openMedia : function ( index ) {
547
+ var $this = this,
548
+ src = null;
549
+
550
+ if ( elements[index] !== undefined )
551
+ src = elements[index].href;
552
+
553
+ if (index < 0 || index >= elements.length) {
554
+ return false;
555
+ }
556
+
557
+ if ( ! $this.isVideo( src ) ) {
558
+ $this.loadMedia( src, function() {
559
+ $( '#swipebox-slider .slide' ).eq( index ).html( this );
560
+ } );
561
+ } else {
562
+ $( '#swipebox-slider .slide' ).eq( index ).html( $this.getVideo( src ) );
563
+ }
564
+
565
+ },
566
+
567
+ /**
568
+ * Set link title attribute as caption
569
+ */
570
+ setTitle : function ( index, isFirst ) {
571
+ var title = null;
572
+
573
+ $( '#swipebox-caption' ).empty();
574
+
575
+ if ( elements[index] !== undefined )
576
+ title = elements[index].title;
577
+
578
+ if ( title ) {
579
+ $( '#swipebox-caption' ).append( title );
580
+ }
581
+ },
582
+
583
+ /**
584
+ * Check if the URL is a video
585
+ */
586
+ isVideo : function ( src ) {
587
+
588
+ if ( src ) {
589
+ if ( src.match( /youtube\.com\/watch\?v=([a-zA-Z0-9\-_]+)/) || src.match( /vimeo\.com\/([0-9]*)/ ) || src.match( /youtu\.be\/([a-zA-Z0-9\-_]+)/ ) ) {
590
+ return true;
591
+ }
592
+ }
593
+
594
+ },
595
+
596
+ /**
597
+ * Get video iframe code from URL
598
+ */
599
+ getVideo : function( url ) {
600
+ var iframe = '';
601
+ var output = '';
602
+ var youtubeUrl = url.match( /watch\?v=([a-zA-Z0-9\-_]+)/ );
603
+ var youtubeShortUrl = url.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/);
604
+ var vimeoUrl = url.match( /vimeo\.com\/([0-9]*)/ );
605
+ if ( youtubeUrl || youtubeShortUrl) {
606
+ if ( youtubeShortUrl ) {
607
+ youtubeUrl = youtubeShortUrl;
608
+ }
609
+ iframe = '<iframe width="560" height="315" src="//www.youtube.com/embed/' + youtubeUrl[1] + '" frameborder="0" allowfullscreen></iframe>';
610
+
611
+ } else if ( vimeoUrl ) {
612
+
613
+ iframe = '<iframe width="560" height="315" src="//player.vimeo.com/video/' + vimeoUrl[1] + '?byline=0&amp;portrait=0&amp;color='+plugin.settings.vimeoColor+'" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
614
+
615
+ }
616
+
617
+ return '<div class="swipebox-video-container" style="max-width:' + plugin.settings.videomaxWidth + 'px"><div class="swipebox-video">'+iframe+'</div></div>';
618
+ },
619
+
620
+ /**
621
+ * Load image
622
+ */
623
+ loadMedia : function ( src, callback ) {
624
+ if ( ! this.isVideo( src ) ) {
625
+ var img = $( '<img>' ).on( 'load', function() {
626
+ callback.call( img );
627
+ } );
628
+
629
+ img.attr( 'src', src );
630
+ }
631
+ },
632
+
633
+ /**
634
+ * Get next slide
635
+ */
636
+ getNext : function () {
637
+ var $this = this;
638
+ index = $( '#swipebox-slider .slide' ).index( $( '#swipebox-slider .slide.current' ) );
639
+ if ( index+1 < elements.length ) {
640
+ index++;
641
+ $this.setSlide( index );
642
+ $this.preloadMedia( index+1 );
643
+
644
+ } else {
645
+
646
+ $( '#swipebox-slider' ).addClass( 'rightSpring' );
647
+ setTimeout( function() {
648
+ $( '#swipebox-slider' ).removeClass( 'rightSpring' );
649
+ }, 500 );
650
+ }
651
+ },
652
+
653
+ /**
654
+ * Get previous slide
655
+ */
656
+ getPrev : function () {
657
+ index = $( '#swipebox-slider .slide' ).index( $( '#swipebox-slider .slide.current' ) );
658
+ if ( index > 0 ) {
659
+ index--;
660
+ this.setSlide( index );
661
+ this.preloadMedia( index-1 );
662
+ }
663
+ else {
664
+
665
+ $( '#swipebox-slider' ).addClass( 'leftSpring' );
666
+ setTimeout( function() {
667
+ $( '#swipebox-slider' ).removeClass( 'leftSpring' );
668
+ }, 500 );
669
+ }
670
+ },
671
+
672
+ /**
673
+ * Close
674
+ */
675
+ closeSlide : function () {
676
+ $( 'html' ).removeClass( 'swipebox-html' );
677
+ $( 'html' ).removeClass( 'swipebox-touch' );
678
+ $( window ).trigger( 'resize' );
679
+ this.destroy();
680
+ },
681
+
682
+ /**
683
+ * Destroy the whole thing
684
+ */
685
+ destroy : function () {
686
+ $( window ).unbind( 'keyup' );
687
+ $( 'body' ).unbind( 'touchstart' );
688
+ $( 'body' ).unbind( 'touchmove' );
689
+ $( 'body' ).unbind( 'touchend' );
690
+ $( '#swipebox-slider' ).unbind();
691
+ $( '#swipebox-overlay' ).remove();
692
+ if ( ! $.isArray( elem ) )
693
+ elem.removeData( '_swipebox' );
694
+ if ( this.target )
695
+ this.target.trigger( 'swipebox-destroy' );
696
+ $.swipebox.isOpen = false;
697
+ if ( plugin.settings.afterClose )
698
+ plugin.settings.afterClose();
699
+ }
700
+
701
+ };
702
+
703
+ plugin.init();
704
+
705
+ };
706
+
707
+ $.fn.swipebox = function( options ) {
708
+
709
+ if ( ! $.data( this, '_swipebox' ) ) {
710
+ var swipebox = new $.swipebox( this, options );
711
+ this.data( '_swipebox', swipebox );
712
+ }
713
+ return this.data( '_swipebox' );
714
+
715
+ };
716
+
717
+ }( window, document, jQuery ) );
js/modernizr.custom.26633.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ /* Modernizr 2.6.2 (Custom Build) | MIT & BSD
2
+ * Build: http://modernizr.com/download/#-backgroundsize-csstransforms3d-csstransitions-touch-shiv-cssclasses-prefixed-teststyles-testprop-testallprops-prefixes-domprefixes-load
3
+ */
4
+ ;window.Modernizr=function(a,b,c){function z(a){j.cssText=a}function A(a,b){return z(m.join(a+";")+(b||""))}function B(a,b){return typeof a===b}function C(a,b){return!!~(""+a).indexOf(b)}function D(a,b){for(var d in a){var e=a[d];if(!C(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function E(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:B(f,"function")?f.bind(d||b):f}return!1}function F(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+o.join(d+" ")+d).split(" ");return B(b,"string")||B(b,"undefined")?D(e,b):(e=(a+" "+p.join(d+" ")+d).split(" "),E(e,b,c))}var d="2.6.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n="Webkit Moz O ms",o=n.split(" "),p=n.toLowerCase().split(" "),q={},r={},s={},t=[],u=t.slice,v,w=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["&#173;",'<style id="s',h,'">',a,"</style>"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},x={}.hasOwnProperty,y;!B(x,"undefined")&&!B(x.call,"undefined")?y=function(a,b){return x.call(a,b)}:y=function(a,b){return b in a&&B(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=u.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(u.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(u.call(arguments)))};return e}),q.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:w(["@media (",m.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},q.backgroundsize=function(){return F("backgroundSize")},q.csstransforms3d=function(){var a=!!F("perspective");return a&&"webkitPerspective"in g.style&&w("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b,c){a=b.offsetLeft===9&&b.offsetHeight===3}),a},q.csstransitions=function(){return F("transition")};for(var G in q)y(q,G)&&(v=G.toLowerCase(),e[v]=q[G](),t.push((e[v]?"":"no-")+v));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)y(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},z(""),i=k=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e<g;e++)d.createElement(f[e]);return d}function p(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return r.shivMethods?n(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+l().join().replace(/\w+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(r,b.frag)}function q(a){a||(a=b);var c=m(a);return r.shivCSS&&!f&&!c.hasCSS&&(c.hasCSS=!!k(a,"article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")),j||p(a,c),a}var c=a.html5||{},d=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,e=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,f,g="_html5shiv",h=0,i={},j;(function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,e._prefixes=m,e._domPrefixes=p,e._cssomPrefixes=o,e.testProp=function(a){return D([a])},e.testAllProps=F,e.testStyles=w,e.prefixed=function(a,b,c){return b?F(a,b,c):F(a,"pfx")},g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+t.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i<a.length;i++)j=a[i],e(j)?g(j,0,l,0):w(j)?B(j):Object(j)===j&&h(j,l);else Object(a)===a&&h(a,l)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,null==b.readyState&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))};
js/owl.carousel.js ADDED
@@ -0,0 +1,1512 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery OwlCarousel v1.3.2
3
+ *
4
+ * Copyright (c) 2013 Bartosz Wojciechowski
5
+ * http://www.owlgraphic.com/owlcarousel/
6
+ *
7
+ * Licensed under MIT
8
+ *
9
+ */
10
+
11
+ /*JS Lint helpers: */
12
+ /*global dragMove: false, dragEnd: false, $, jQuery, alert, window, document */
13
+ /*jslint nomen: true, continue:true */
14
+
15
+ if (typeof Object.create !== "function") {
16
+ Object.create = function (obj) {
17
+ function F() {}
18
+ F.prototype = obj;
19
+ return new F();
20
+ };
21
+ }
22
+ (function ($, window, document) {
23
+
24
+ var Carousel = {
25
+ init : function (options, el) {
26
+ var base = this;
27
+
28
+ base.$elem = $(el);
29
+ base.options = $.extend({}, $.fn.owlCarousel.options, base.$elem.data(), options);
30
+
31
+ base.userOptions = options;
32
+ base.loadContent();
33
+ },
34
+
35
+ loadContent : function () {
36
+ var base = this, url;
37
+
38
+ function getData(data) {
39
+ var i, content = "";
40
+ if (typeof base.options.jsonSuccess === "function") {
41
+ base.options.jsonSuccess.apply(this, [data]);
42
+ } else {
43
+ for (i in data.owl) {
44
+ if (data.owl.hasOwnProperty(i)) {
45
+ content += data.owl[i].item;
46
+ }
47
+ }
48
+ base.$elem.html(content);
49
+ }
50
+ base.logIn();
51
+ }
52
+
53
+ if (typeof base.options.beforeInit === "function") {
54
+ base.options.beforeInit.apply(this, [base.$elem]);
55
+ }
56
+
57
+ if (typeof base.options.jsonPath === "string") {
58
+ url = base.options.jsonPath;
59
+ $.getJSON(url, getData);
60
+ } else {
61
+ base.logIn();
62
+ }
63
+ },
64
+
65
+ logIn : function () {
66
+ var base = this;
67
+
68
+ base.$elem.data("owl-originalStyles", base.$elem.attr("style"))
69
+ .data("owl-originalClasses", base.$elem.attr("class"));
70
+
71
+ base.$elem.css({opacity: 0});
72
+ base.orignalItems = base.options.items;
73
+ base.checkBrowser();
74
+ base.wrapperWidth = 0;
75
+ base.checkVisible = null;
76
+ base.setVars();
77
+ },
78
+
79
+ setVars : function () {
80
+ var base = this;
81
+ if (base.$elem.children().length === 0) {return false; }
82
+ base.baseClass();
83
+ base.eventTypes();
84
+ base.$userItems = base.$elem.children();
85
+ base.itemsAmount = base.$userItems.length;
86
+ base.wrapItems();
87
+ base.$owlItems = base.$elem.find(".owl-item");
88
+ base.$owlWrapper = base.$elem.find(".owl-wrapper");
89
+ base.playDirection = "next";
90
+ base.prevItem = 0;
91
+ base.prevArr = [0];
92
+ base.currentItem = 0;
93
+ base.customEvents();
94
+ base.onStartup();
95
+ },
96
+
97
+ onStartup : function () {
98
+ var base = this;
99
+ base.updateItems();
100
+ base.calculateAll();
101
+ base.buildControls();
102
+ base.updateControls();
103
+ base.response();
104
+ base.moveEvents();
105
+ base.stopOnHover();
106
+ base.owlStatus();
107
+
108
+ if (base.options.transitionStyle !== false) {
109
+ base.transitionTypes(base.options.transitionStyle);
110
+ }
111
+ if (base.options.autoPlay === true) {
112
+ base.options.autoPlay = 5000;
113
+ }
114
+ base.play();
115
+
116
+ base.$elem.find(".owl-wrapper").css("display", "block");
117
+
118
+ if (!base.$elem.is(":visible")) {
119
+ base.watchVisibility();
120
+ } else {
121
+ base.$elem.css("opacity", 1);
122
+ }
123
+ base.onstartup = false;
124
+ base.eachMoveUpdate();
125
+ if (typeof base.options.afterInit === "function") {
126
+ base.options.afterInit.apply(this, [base.$elem]);
127
+ }
128
+ },
129
+
130
+ eachMoveUpdate : function () {
131
+ var base = this;
132
+
133
+ if (base.options.lazyLoad === true) {
134
+ base.lazyLoad();
135
+ }
136
+ if (base.options.autoHeight === true) {
137
+ base.autoHeight();
138
+ }
139
+ base.onVisibleItems();
140
+
141
+ if (typeof base.options.afterAction === "function") {
142
+ base.options.afterAction.apply(this, [base.$elem]);
143
+ }
144
+ },
145
+
146
+ updateVars : function () {
147
+ var base = this;
148
+ if (typeof base.options.beforeUpdate === "function") {
149
+ base.options.beforeUpdate.apply(this, [base.$elem]);
150
+ }
151
+ base.watchVisibility();
152
+ base.updateItems();
153
+ base.calculateAll();
154
+ base.updatePosition();
155
+ base.updateControls();
156
+ base.eachMoveUpdate();
157
+ if (typeof base.options.afterUpdate === "function") {
158
+ base.options.afterUpdate.apply(this, [base.$elem]);
159
+ }
160
+ },
161
+
162
+ reload : function () {
163
+ var base = this;
164
+ window.setTimeout(function () {
165
+ base.updateVars();
166
+ }, 0);
167
+ },
168
+
169
+ watchVisibility : function () {
170
+ var base = this;
171
+
172
+ if (base.$elem.is(":visible") === false) {
173
+ base.$elem.css({opacity: 0});
174
+ window.clearInterval(base.autoPlayInterval);
175
+ window.clearInterval(base.checkVisible);
176
+ } else {
177
+ return false;
178
+ }
179
+ base.checkVisible = window.setInterval(function () {
180
+ if (base.$elem.is(":visible")) {
181
+ base.reload();
182
+ base.$elem.animate({opacity: 1}, 200);
183
+ window.clearInterval(base.checkVisible);
184
+ }
185
+ }, 500);
186
+ },
187
+
188
+ wrapItems : function () {
189
+ var base = this;
190
+ base.$userItems.wrapAll("<div class=\"owl-wrapper\">").wrap("<div class=\"owl-item\"></div>");
191
+ base.$elem.find(".owl-wrapper").wrap("<div class=\"owl-wrapper-outer\">");
192
+ base.wrapperOuter = base.$elem.find(".owl-wrapper-outer");
193
+ //base.$elem.css("display", "block");
194
+ },
195
+
196
+ baseClass : function () {
197
+ var base = this,
198
+ hasBaseClass = base.$elem.hasClass(base.options.baseClass),
199
+ hasThemeClass = base.$elem.hasClass(base.options.theme);
200
+
201
+ if (!hasBaseClass) {
202
+ base.$elem.addClass(base.options.baseClass);
203
+ }
204
+
205
+ if (!hasThemeClass) {
206
+ base.$elem.addClass(base.options.theme);
207
+ }
208
+ },
209
+
210
+ updateItems : function () {
211
+ var base = this, width, i;
212
+
213
+ if (base.options.responsive === false) {
214
+ return false;
215
+ }
216
+ if (base.options.singleItem === true) {
217
+ base.options.items = base.orignalItems = 1;
218
+ base.options.itemsCustom = false;
219
+ base.options.itemsDesktop = false;
220
+ base.options.itemsDesktopSmall = false;
221
+ base.options.itemsTablet = false;
222
+ base.options.itemsTabletSmall = false;
223
+ base.options.itemsMobile = false;
224
+ return false;
225
+ }
226
+
227
+ width = $(base.options.responsiveBaseWidth).width();
228
+
229
+ if (width > (base.options.itemsDesktop[0] || base.orignalItems)) {
230
+ base.options.items = base.orignalItems;
231
+ }
232
+ if (base.options.itemsCustom !== false) {
233
+ //Reorder array by screen size
234
+ base.options.itemsCustom.sort(function (a, b) {return a[0] - b[0]; });
235
+
236
+ for (i = 0; i < base.options.itemsCustom.length; i += 1) {
237
+ if (base.options.itemsCustom[i][0] <= width) {
238
+ base.options.items = base.options.itemsCustom[i][1];
239
+ }
240
+ }
241
+
242
+ } else {
243
+
244
+ if (width <= base.options.itemsDesktop[0] && base.options.itemsDesktop !== false) {
245
+ base.options.items = base.options.itemsDesktop[1];
246
+ }
247
+
248
+ if (width <= base.options.itemsDesktopSmall[0] && base.options.itemsDesktopSmall !== false) {
249
+ base.options.items = base.options.itemsDesktopSmall[1];
250
+ }
251
+
252
+ if (width <= base.options.itemsTablet[0] && base.options.itemsTablet !== false) {
253
+ base.options.items = base.options.itemsTablet[1];
254
+ }
255
+
256
+ if (width <= base.options.itemsTabletSmall[0] && base.options.itemsTabletSmall !== false) {
257
+ base.options.items = base.options.itemsTabletSmall[1];
258
+ }
259
+
260
+ if (width <= base.options.itemsMobile[0] && base.options.itemsMobile !== false) {
261
+ base.options.items = base.options.itemsMobile[1];
262
+ }
263
+ }
264
+
265
+ //if number of items is less than declared
266
+ if (base.options.items > base.itemsAmount && base.options.itemsScaleUp === true) {
267
+ base.options.items = base.itemsAmount;
268
+ }
269
+ },
270
+
271
+ response : function () {
272
+ var base = this,
273
+ smallDelay,
274
+ lastWindowWidth;
275
+
276
+ if (base.options.responsive !== true) {
277
+ return false;
278
+ }
279
+ lastWindowWidth = $(window).width();
280
+
281
+ base.resizer = function () {
282
+ if ($(window).width() !== lastWindowWidth) {
283
+ if (base.options.autoPlay !== false) {
284
+ window.clearInterval(base.autoPlayInterval);
285
+ }
286
+ window.clearTimeout(smallDelay);
287
+ smallDelay = window.setTimeout(function () {
288
+ lastWindowWidth = $(window).width();
289
+ base.updateVars();
290
+ }, base.options.responsiveRefreshRate);
291
+ }
292
+ };
293
+ $(window).resize(base.resizer);
294
+ },
295
+
296
+ updatePosition : function () {
297
+ var base = this;
298
+ base.jumpTo(base.currentItem);
299
+ if (base.options.autoPlay !== false) {
300
+ base.checkAp();
301
+ }
302
+ },
303
+
304
+ appendItemsSizes : function () {
305
+ var base = this,
306
+ roundPages = 0,
307
+ lastItem = base.itemsAmount - base.options.items;
308
+
309
+ base.$owlItems.each(function (index) {
310
+ var $this = $(this);
311
+ $this
312
+ .css({"width": base.itemWidth})
313
+ .data("owl-item", Number(index));
314
+
315
+ if (index % base.options.items === 0 || index === lastItem) {
316
+ if (!(index > lastItem)) {
317
+ roundPages += 1;
318
+ }
319
+ }
320
+ $this.data("owl-roundPages", roundPages);
321
+ });
322
+ },
323
+
324
+ appendWrapperSizes : function () {
325
+ var base = this,
326
+ width = base.$owlItems.length * base.itemWidth;
327
+
328
+ base.$owlWrapper.css({
329
+ "width": width * 2,
330
+ "left": 0
331
+ });
332
+ base.appendItemsSizes();
333
+ },
334
+
335
+ calculateAll : function () {
336
+ var base = this;
337
+ base.calculateWidth();
338
+ base.appendWrapperSizes();
339
+ base.loops();
340
+ base.max();
341
+ },
342
+
343
+ calculateWidth : function () {
344
+ var base = this;
345
+ base.itemWidth = Math.round(base.$elem.width() / base.options.items);
346
+ },
347
+
348
+ max : function () {
349
+ var base = this,
350
+ maximum = ((base.itemsAmount * base.itemWidth) - base.options.items * base.itemWidth) * -1;
351
+ if (base.options.items > base.itemsAmount) {
352
+ base.maximumItem = 0;
353
+ maximum = 0;
354
+ base.maximumPixels = 0;
355
+ } else {
356
+ base.maximumItem = base.itemsAmount - base.options.items;
357
+ base.maximumPixels = maximum;
358
+ }
359
+ return maximum;
360
+ },
361
+
362
+ min : function () {
363
+ return 0;
364
+ },
365
+
366
+ loops : function () {
367
+ var base = this,
368
+ prev = 0,
369
+ elWidth = 0,
370
+ i,
371
+ item,
372
+ roundPageNum;
373
+
374
+ base.positionsInArray = [0];
375
+ base.pagesInArray = [];
376
+
377
+ for (i = 0; i < base.itemsAmount; i += 1) {
378
+ elWidth += base.itemWidth;
379
+ base.positionsInArray.push(-elWidth);
380
+
381
+ if (base.options.scrollPerPage === true) {
382
+ item = $(base.$owlItems[i]);
383
+ roundPageNum = item.data("owl-roundPages");
384
+ if (roundPageNum !== prev) {
385
+ base.pagesInArray[prev] = base.positionsInArray[i];
386
+ prev = roundPageNum;
387
+ }
388
+ }
389
+ }
390
+ },
391
+
392
+ buildControls : function () {
393
+ var base = this;
394
+ if (base.options.navigation === true || base.options.pagination === true) {
395
+ base.owlControls = $("<div class=\"owl-controls\"/>").toggleClass("clickable", !base.browser.isTouch).appendTo(base.$elem);
396
+ }
397
+ if (base.options.pagination === true) {
398
+ base.buildPagination();
399
+ }
400
+ if (base.options.navigation === true) {
401
+ base.buildButtons();
402
+ }
403
+ },
404
+
405
+ buildButtons : function () {
406
+ var base = this,
407
+ buttonsWrapper = $("<div class=\"owl-buttons\"/>");
408
+ base.owlControls.append(buttonsWrapper);
409
+
410
+ base.buttonPrev = $("<div/>", {
411
+ "class" : "owl-prev",
412
+ "html" : base.options.navigationText[0] || ""
413
+ });
414
+
415
+ base.buttonNext = $("<div/>", {
416
+ "class" : "owl-next",
417
+ "html" : base.options.navigationText[1] || ""
418
+ });
419
+
420
+ buttonsWrapper
421
+ .append(base.buttonPrev)
422
+ .append(base.buttonNext);
423
+
424
+ buttonsWrapper.on("touchstart.owlControls mousedown.owlControls", "div[class^=\"owl\"]", function (event) {
425
+ event.preventDefault();
426
+ });
427
+
428
+ buttonsWrapper.on("touchend.owlControls mouseup.owlControls", "div[class^=\"owl\"]", function (event) {
429
+ event.preventDefault();
430
+ if ($(this).hasClass("owl-next")) {
431
+ base.next();
432
+ } else {
433
+ base.prev();
434
+ }
435
+ });
436
+ },
437
+
438
+ buildPagination : function () {
439
+ var base = this;
440
+
441
+ base.paginationWrapper = $("<div class=\"owl-pagination\"/>");
442
+ base.owlControls.append(base.paginationWrapper);
443
+
444
+ base.paginationWrapper.on("touchend.owlControls mouseup.owlControls", ".owl-page", function (event) {
445
+ event.preventDefault();
446
+ if (Number($(this).data("owl-page")) !== base.currentItem) {
447
+ base.goTo(Number($(this).data("owl-page")), true);
448
+ }
449
+ });
450
+ },
451
+
452
+ updatePagination : function () {
453
+ var base = this,
454
+ counter,
455
+ lastPage,
456
+ lastItem,
457
+ i,
458
+ paginationButton,
459
+ paginationButtonInner;
460
+
461
+ if (base.options.pagination === false) {
462
+ return false;
463
+ }
464
+
465
+ base.paginationWrapper.html("");
466
+
467
+ counter = 0;
468
+ lastPage = base.itemsAmount - base.itemsAmount % base.options.items;
469
+
470
+ for (i = 0; i < base.itemsAmount; i += 1) {
471
+ if (i % base.options.items === 0) {
472
+ counter += 1;
473
+ if (lastPage === i) {
474
+ lastItem = base.itemsAmount - base.options.items;
475
+ }
476
+ paginationButton = $("<div/>", {
477
+ "class" : "owl-page"
478
+ });
479
+ paginationButtonInner = $("<span></span>", {
480
+ "text": base.options.paginationNumbers === true ? counter : "",
481
+ "class": base.options.paginationNumbers === true ? "owl-numbers" : ""
482
+ });
483
+ paginationButton.append(paginationButtonInner);
484
+
485
+ paginationButton.data("owl-page", lastPage === i ? lastItem : i);
486
+ paginationButton.data("owl-roundPages", counter);
487
+
488
+ base.paginationWrapper.append(paginationButton);
489
+ }
490
+ }
491
+ base.checkPagination();
492
+ },
493
+ checkPagination : function () {
494
+ var base = this;
495
+ if (base.options.pagination === false) {
496
+ return false;
497
+ }
498
+ base.paginationWrapper.find(".owl-page").each(function () {
499
+ if ($(this).data("owl-roundPages") === $(base.$owlItems[base.currentItem]).data("owl-roundPages")) {
500
+ base.paginationWrapper
501
+ .find(".owl-page")
502
+ .removeClass("active");
503
+ $(this).addClass("active");
504
+ }
505
+ });
506
+ },
507
+
508
+ checkNavigation : function () {
509
+ var base = this;
510
+
511
+ if (base.options.navigation === false) {
512
+ return false;
513
+ }
514
+ if (base.options.rewindNav === false) {
515
+ if (base.currentItem === 0 && base.maximumItem === 0) {
516
+ base.buttonPrev.addClass("disabled");
517
+ base.buttonNext.addClass("disabled");
518
+ } else if (base.currentItem === 0 && base.maximumItem !== 0) {
519
+ base.buttonPrev.addClass("disabled");
520
+ base.buttonNext.removeClass("disabled");
521
+ } else if (base.currentItem === base.maximumItem) {
522
+ base.buttonPrev.removeClass("disabled");
523
+ base.buttonNext.addClass("disabled");
524
+ } else if (base.currentItem !== 0 && base.currentItem !== base.maximumItem) {
525
+ base.buttonPrev.removeClass("disabled");
526
+ base.buttonNext.removeClass("disabled");
527
+ }
528
+ }
529
+ },
530
+
531
+ updateControls : function () {
532
+ var base = this;
533
+ base.updatePagination();
534
+ base.checkNavigation();
535
+ if (base.owlControls) {
536
+ if (base.options.items >= base.itemsAmount) {
537
+ base.owlControls.hide();
538
+ } else {
539
+ base.owlControls.show();
540
+ }
541
+ }
542
+ },
543
+
544
+ destroyControls : function () {
545
+ var base = this;
546
+ if (base.owlControls) {
547
+ base.owlControls.remove();
548
+ }
549
+ },
550
+
551
+ next : function (speed) {
552
+ var base = this;
553
+
554
+ if (base.isTransition) {
555
+ return false;
556
+ }
557
+
558
+ base.currentItem += base.options.scrollPerPage === true ? base.options.items : 1;
559
+ if (base.currentItem > base.maximumItem + (base.options.scrollPerPage === true ? (base.options.items - 1) : 0)) {
560
+ if (base.options.rewindNav === true) {
561
+ base.currentItem = 0;
562
+ speed = "rewind";
563
+ } else {
564
+ base.currentItem = base.maximumItem;
565
+ return false;
566
+ }
567
+ }
568
+ base.goTo(base.currentItem, speed);
569
+ },
570
+
571
+ prev : function (speed) {
572
+ var base = this;
573
+
574
+ if (base.isTransition) {
575
+ return false;
576
+ }
577
+
578
+ if (base.options.scrollPerPage === true && base.currentItem > 0 && base.currentItem < base.options.items) {
579
+ base.currentItem = 0;
580
+ } else {
581
+ base.currentItem -= base.options.scrollPerPage === true ? base.options.items : 1;
582
+ }
583
+ if (base.currentItem < 0) {
584
+ if (base.options.rewindNav === true) {
585
+ base.currentItem = base.maximumItem;
586
+ speed = "rewind";
587
+ } else {
588
+ base.currentItem = 0;
589
+ return false;
590
+ }
591
+ }
592
+ base.goTo(base.currentItem, speed);
593
+ },
594
+
595
+ goTo : function (position, speed, drag) {
596
+ var base = this,
597
+ goToPixel;
598
+
599
+ if (base.isTransition) {
600
+ return false;
601
+ }
602
+ if (typeof base.options.beforeMove === "function") {
603
+ base.options.beforeMove.apply(this, [base.$elem]);
604
+ }
605
+ if (position >= base.maximumItem) {
606
+ position = base.maximumItem;
607
+ } else if (position <= 0) {
608
+ position = 0;
609
+ }
610
+
611
+ base.currentItem = base.owl.currentItem = position;
612
+ if (base.options.transitionStyle !== false && drag !== "drag" && base.options.items === 1 && base.browser.support3d === true) {
613
+ base.swapSpeed(0);
614
+ if (base.browser.support3d === true) {
615
+ base.transition3d(base.positionsInArray[position]);
616
+ } else {
617
+ base.css2slide(base.positionsInArray[position], 1);
618
+ }
619
+ base.afterGo();
620
+ base.singleItemTransition();
621
+ return false;
622
+ }
623
+ goToPixel = base.positionsInArray[position];
624
+
625
+ if (base.browser.support3d === true) {
626
+ base.isCss3Finish = false;
627
+
628
+ if (speed === true) {
629
+ base.swapSpeed("paginationSpeed");
630
+ window.setTimeout(function () {
631
+ base.isCss3Finish = true;
632
+ }, base.options.paginationSpeed);
633
+
634
+ } else if (speed === "rewind") {
635
+ base.swapSpeed(base.options.rewindSpeed);
636
+ window.setTimeout(function () {
637
+ base.isCss3Finish = true;
638
+ }, base.options.rewindSpeed);
639
+
640
+ } else {
641
+ base.swapSpeed("slideSpeed");
642
+ window.setTimeout(function () {
643
+ base.isCss3Finish = true;
644
+ }, base.options.slideSpeed);
645
+ }
646
+ base.transition3d(goToPixel);
647
+ } else {
648
+ if (speed === true) {
649
+ base.css2slide(goToPixel, base.options.paginationSpeed);
650
+ } else if (speed === "rewind") {
651
+ base.css2slide(goToPixel, base.options.rewindSpeed);
652
+ } else {
653
+ base.css2slide(goToPixel, base.options.slideSpeed);
654
+ }
655
+ }
656
+ base.afterGo();
657
+ },
658
+
659
+ jumpTo : function (position) {
660
+ var base = this;
661
+ if (typeof base.options.beforeMove === "function") {
662
+ base.options.beforeMove.apply(this, [base.$elem]);
663
+ }
664
+ if (position >= base.maximumItem || position === -1) {
665
+ position = base.maximumItem;
666
+ } else if (position <= 0) {
667
+ position = 0;
668
+ }
669
+ base.swapSpeed(0);
670
+ if (base.browser.support3d === true) {
671
+ base.transition3d(base.positionsInArray[position]);
672
+ } else {
673
+ base.css2slide(base.positionsInArray[position], 1);
674
+ }
675
+ base.currentItem = base.owl.currentItem = position;
676
+ base.afterGo();
677
+ },
678
+
679
+ afterGo : function () {
680
+ var base = this;
681
+
682
+ base.prevArr.push(base.currentItem);
683
+ base.prevItem = base.owl.prevItem = base.prevArr[base.prevArr.length - 2];
684
+ base.prevArr.shift(0);
685
+
686
+ if (base.prevItem !== base.currentItem) {
687
+ base.checkPagination();
688
+ base.checkNavigation();
689
+ base.eachMoveUpdate();
690
+
691
+ if (base.options.autoPlay !== false) {
692
+ base.checkAp();
693
+ }
694
+ }
695
+ if (typeof base.options.afterMove === "function" && base.prevItem !== base.currentItem) {
696
+ base.options.afterMove.apply(this, [base.$elem]);
697
+ }
698
+ },
699
+
700
+ stop : function () {
701
+ var base = this;
702
+ base.apStatus = "stop";
703
+ window.clearInterval(base.autoPlayInterval);
704
+ },
705
+
706
+ checkAp : function () {
707
+ var base = this;
708
+ if (base.apStatus !== "stop") {
709
+ base.play();
710
+ }
711
+ },
712
+
713
+ play : function () {
714
+ var base = this;
715
+ base.apStatus = "play";
716
+ if (base.options.autoPlay === false) {
717
+ return false;
718
+ }
719
+ window.clearInterval(base.autoPlayInterval);
720
+ base.autoPlayInterval = window.setInterval(function () {
721
+ base.next(true);
722
+ }, base.options.autoPlay);
723
+ },
724
+
725
+ swapSpeed : function (action) {
726
+ var base = this;
727
+ if (action === "slideSpeed") {
728
+ base.$owlWrapper.css(base.addCssSpeed(base.options.slideSpeed));
729
+ } else if (action === "paginationSpeed") {
730
+ base.$owlWrapper.css(base.addCssSpeed(base.options.paginationSpeed));
731
+ } else if (typeof action !== "string") {
732
+ base.$owlWrapper.css(base.addCssSpeed(action));
733
+ }
734
+ },
735
+
736
+ addCssSpeed : function (speed) {
737
+ return {
738
+ "-webkit-transition": "all " + speed + "ms ease",
739
+ "-moz-transition": "all " + speed + "ms ease",
740
+ "-o-transition": "all " + speed + "ms ease",
741
+ "transition": "all " + speed + "ms ease"
742
+ };
743
+ },
744
+
745
+ removeTransition : function () {
746
+ return {
747
+ "-webkit-transition": "",
748
+ "-moz-transition": "",
749
+ "-o-transition": "",
750
+ "transition": ""
751
+ };
752
+ },
753
+
754
+ doTranslate : function (pixels) {
755
+ return {
756
+ "-webkit-transform": "translate3d(" + pixels + "px, 0px, 0px)",
757
+ "-moz-transform": "translate3d(" + pixels + "px, 0px, 0px)",
758
+ "-o-transform": "translate3d(" + pixels + "px, 0px, 0px)",
759
+ "-ms-transform": "translate3d(" + pixels + "px, 0px, 0px)",
760
+ "transform": "translate3d(" + pixels + "px, 0px,0px)"
761
+ };
762
+ },
763
+
764
+ transition3d : function (value) {
765
+ var base = this;
766
+ base.$owlWrapper.css(base.doTranslate(value));
767
+ },
768
+
769
+ css2move : function (value) {
770
+ var base = this;
771
+ base.$owlWrapper.css({"left" : value});
772
+ },
773
+
774
+ css2slide : function (value, speed) {
775
+ var base = this;
776
+
777
+ base.isCssFinish = false;
778
+ base.$owlWrapper.stop(true, true).animate({
779
+ "left" : value
780
+ }, {
781
+ duration : speed || base.options.slideSpeed,
782
+ complete : function () {
783
+ base.isCssFinish = true;
784
+ }
785
+ });
786
+ },
787
+
788
+ checkBrowser : function () {
789
+ var base = this,
790
+ translate3D = "translate3d(0px, 0px, 0px)",
791
+ tempElem = document.createElement("div"),
792
+ regex,
793
+ asSupport,
794
+ support3d,
795
+ isTouch;
796
+
797
+ tempElem.style.cssText = " -moz-transform:" + translate3D +
798
+ "; -ms-transform:" + translate3D +
799
+ "; -o-transform:" + translate3D +
800
+ "; -webkit-transform:" + translate3D +
801
+ "; transform:" + translate3D;
802
+ regex = /translate3d\(0px, 0px, 0px\)/g;
803
+ asSupport = tempElem.style.cssText.match(regex);
804
+ support3d = (asSupport !== null && asSupport.length === 1);
805
+
806
+ isTouch = "ontouchstart" in window || window.navigator.msMaxTouchPoints;
807
+
808
+ base.browser = {
809
+ "support3d" : support3d,
810
+ "isTouch" : isTouch
811
+ };
812
+ },
813
+
814
+ moveEvents : function () {
815
+ var base = this;
816
+ if (base.options.mouseDrag !== false || base.options.touchDrag !== false) {
817
+ base.gestures();
818
+ base.disabledEvents();
819
+ }
820
+ },
821
+
822
+ eventTypes : function () {
823
+ var base = this,
824
+ types = ["s", "e", "x"];
825
+
826
+ base.ev_types = {};
827
+
828
+ if (base.options.mouseDrag === true && base.options.touchDrag === true) {
829
+ types = [
830
+ "touchstart.owl mousedown.owl",
831
+ "touchmove.owl mousemove.owl",
832
+ "touchend.owl touchcancel.owl mouseup.owl"
833
+ ];
834
+ } else if (base.options.mouseDrag === false && base.options.touchDrag === true) {
835
+ types = [
836
+ "touchstart.owl",
837
+ "touchmove.owl",
838
+ "touchend.owl touchcancel.owl"
839
+ ];
840
+ } else if (base.options.mouseDrag === true && base.options.touchDrag === false) {
841
+ types = [
842
+ "mousedown.owl",
843
+ "mousemove.owl",
844
+ "mouseup.owl"
845
+ ];
846
+ }
847
+
848
+ base.ev_types.start = types[0];
849
+ base.ev_types.move = types[1];
850
+ base.ev_types.end = types[2];
851
+ },
852
+
853
+ disabledEvents : function () {
854
+ var base = this;
855
+ base.$elem.on("dragstart.owl", function (event) { event.preventDefault(); });
856
+ base.$elem.on("mousedown.disableTextSelect", function (e) {
857
+ return $(e.target).is('input, textarea, select, option');
858
+ });
859
+ },
860
+
861
+ gestures : function () {
862
+ /*jslint unparam: true*/
863
+ var base = this,
864
+ locals = {
865
+ offsetX : 0,
866
+ offsetY : 0,
867
+ baseElWidth : 0,
868
+ relativePos : 0,
869
+ position: null,
870
+ minSwipe : null,
871
+ maxSwipe: null,
872
+ sliding : null,
873
+ dargging: null,
874
+ targetElement : null
875
+ };
876
+
877
+ base.isCssFinish = true;
878
+
879
+ function getTouches(event) {
880
+ if (event.touches !== undefined) {
881
+ return {
882
+ x : event.touches[0].pageX,
883
+ y : event.touches[0].pageY
884
+ };
885
+ }
886
+
887
+ if (event.touches === undefined) {
888
+ if (event.pageX !== undefined) {
889
+ return {
890
+ x : event.pageX,
891
+ y : event.pageY
892
+ };
893
+ }
894
+ if (event.pageX === undefined) {
895
+ return {
896
+ x : event.clientX,
897
+ y : event.clientY
898
+ };
899
+ }
900
+ }
901
+ }
902
+
903
+ function swapEvents(type) {
904
+ if (type === "on") {
905
+ $(document).on(base.ev_types.move, dragMove);
906
+ $(document).on(base.ev_types.end, dragEnd);
907
+ } else if (type === "off") {
908
+ $(document).off(base.ev_types.move);
909
+ $(document).off(base.ev_types.end);
910
+ }
911
+ }
912
+
913
+ function dragStart(event) {
914
+ var ev = event.originalEvent || event || window.event,
915
+ position;
916
+
917
+ if (ev.which === 3) {
918
+ return false;
919
+ }
920
+ if (base.itemsAmount <= base.options.items) {
921
+ return;
922
+ }
923
+ if (base.isCssFinish === false && !base.options.dragBeforeAnimFinish) {
924
+ return false;
925
+ }
926
+ if (base.isCss3Finish === false && !base.options.dragBeforeAnimFinish) {
927
+ return false;
928
+ }
929
+
930
+ if (base.options.autoPlay !== false) {
931
+ window.clearInterval(base.autoPlayInterval);
932
+ }
933
+
934
+ if (base.browser.isTouch !== true && !base.$owlWrapper.hasClass("grabbing")) {
935
+ base.$owlWrapper.addClass("grabbing");
936
+ }
937
+
938
+ base.newPosX = 0;
939
+ base.newRelativeX = 0;
940
+
941
+ $(this).css(base.removeTransition());
942
+
943
+ position = $(this).position();
944
+ locals.relativePos = position.left;
945
+
946
+ locals.offsetX = getTouches(ev).x - position.left;
947
+ locals.offsetY = getTouches(ev).y - position.top;
948
+
949
+ swapEvents("on");
950
+
951
+ locals.sliding = false;
952
+ locals.targetElement = ev.target || ev.srcElement;
953
+ }
954
+
955
+ function dragMove(event) {
956
+ var ev = event.originalEvent || event || window.event,
957
+ minSwipe,
958
+ maxSwipe;
959
+
960
+ base.newPosX = getTouches(ev).x - locals.offsetX;
961
+ base.newPosY = getTouches(ev).y - locals.offsetY;
962
+ base.newRelativeX = base.newPosX - locals.relativePos;
963
+
964
+ if (typeof base.options.startDragging === "function" && locals.dragging !== true && base.newRelativeX !== 0) {
965
+ locals.dragging = true;
966
+ base.options.startDragging.apply(base, [base.$elem]);
967
+ }
968
+
969
+ if ((base.newRelativeX > 8 || base.newRelativeX < -8) && (base.browser.isTouch === true)) {
970
+ if (ev.preventDefault !== undefined) {
971
+ ev.preventDefault();
972
+ } else {
973
+ ev.returnValue = false;
974
+ }
975
+ locals.sliding = true;
976
+ }
977
+
978
+ if ((base.newPosY > 10 || base.newPosY < -10) && locals.sliding === false) {
979
+ $(document).off("touchmove.owl");
980
+ }
981
+
982
+ minSwipe = function () {
983
+ return base.newRelativeX / 5;
984
+ };
985
+
986
+ maxSwipe = function () {
987
+ return base.maximumPixels + base.newRelativeX / 5;
988
+ };
989
+
990
+ base.newPosX = Math.max(Math.min(base.newPosX, minSwipe()), maxSwipe());
991
+ if (base.browser.support3d === true) {
992
+ base.transition3d(base.newPosX);
993
+ } else {
994
+ base.css2move(base.newPosX);
995
+ }
996
+ }
997
+
998
+ function dragEnd(event) {
999
+ var ev = event.originalEvent || event || window.event,
1000
+ newPosition,
1001
+ handlers,
1002
+ owlStopEvent;
1003
+
1004
+ ev.target = ev.target || ev.srcElement;
1005
+
1006
+ locals.dragging = false;
1007
+
1008
+ if (base.browser.isTouch !== true) {
1009
+ base.$owlWrapper.removeClass("grabbing");
1010
+ }
1011
+
1012
+ if (base.newRelativeX < 0) {
1013
+ base.dragDirection = base.owl.dragDirection = "left";
1014
+ } else {
1015
+ base.dragDirection = base.owl.dragDirection = "right";
1016
+ }
1017
+
1018
+ if (base.newRelativeX !== 0) {
1019
+ newPosition = base.getNewPosition();
1020
+ base.goTo(newPosition, false, "drag");
1021
+ if (locals.targetElement === ev.target && base.browser.isTouch !== true) {
1022
+ $(ev.target).on("click.disable", function (ev) {
1023
+ ev.stopImmediatePropagation();
1024
+ ev.stopPropagation();
1025
+ ev.preventDefault();
1026
+ $(ev.target).off("click.disable");
1027
+ });
1028
+ handlers = $._data(ev.target, "events").click;
1029
+ owlStopEvent = handlers.pop();
1030
+ handlers.splice(0, 0, owlStopEvent);
1031
+ }
1032
+ }
1033
+ swapEvents("off");
1034
+ }
1035
+ base.$elem.on(base.ev_types.start, ".owl-wrapper", dragStart);
1036
+ },
1037
+
1038
+ getNewPosition : function () {
1039
+ var base = this,
1040
+ newPosition = base.closestItem();
1041
+
1042
+ if (newPosition > base.maximumItem) {
1043
+ base.currentItem = base.maximumItem;
1044
+ newPosition = base.maximumItem;
1045
+ } else if (base.newPosX >= 0) {
1046
+ newPosition = 0;
1047
+ base.currentItem = 0;
1048
+ }
1049
+ return newPosition;
1050
+ },
1051
+ closestItem : function () {
1052
+ var base = this,
1053
+ array = base.options.scrollPerPage === true ? base.pagesInArray : base.positionsInArray,
1054
+ goal = base.newPosX,
1055
+ closest = null;
1056
+
1057
+ $.each(array, function (i, v) {
1058
+ if (goal - (base.itemWidth / 20) > array[i + 1] && goal - (base.itemWidth / 20) < v && base.moveDirection() === "left") {
1059
+ closest = v;
1060
+ if (base.options.scrollPerPage === true) {
1061
+ base.currentItem = $.inArray(closest, base.positionsInArray);
1062
+ } else {
1063
+ base.currentItem = i;
1064
+ }
1065
+ } else if (goal + (base.itemWidth / 20) < v && goal + (base.itemWidth / 20) > (array[i + 1] || array[i] - base.itemWidth) && base.moveDirection() === "right") {
1066
+ if (base.options.scrollPerPage === true) {
1067
+ closest = array[i + 1] || array[array.length - 1];
1068
+ base.currentItem = $.inArray(closest, base.positionsInArray);
1069
+ } else {
1070
+ closest = array[i + 1];
1071
+ base.currentItem = i + 1;
1072
+ }
1073
+ }
1074
+ });
1075
+ return base.currentItem;
1076
+ },
1077
+
1078
+ moveDirection : function () {
1079
+ var base = this,
1080
+ direction;
1081
+ if (base.newRelativeX < 0) {
1082
+ direction = "right";
1083
+ base.playDirection = "next";
1084
+ } else {
1085
+ direction = "left";
1086
+ base.playDirection = "prev";
1087
+ }
1088
+ return direction;
1089
+ },
1090
+
1091
+ customEvents : function () {
1092
+ /*jslint unparam: true*/
1093
+ var base = this;
1094
+ base.$elem.on("owl.next", function () {
1095
+ base.next();
1096
+ });
1097
+ base.$elem.on("owl.prev", function () {
1098
+ base.prev();
1099
+ });
1100
+ base.$elem.on("owl.play", function (event, speed) {
1101
+ base.options.autoPlay = speed;
1102
+ base.play();
1103
+ base.hoverStatus = "play";
1104
+ });
1105
+ base.$elem.on("owl.stop", function () {
1106
+ base.stop();
1107
+ base.hoverStatus = "stop";
1108
+ });
1109
+ base.$elem.on("owl.goTo", function (event, item) {
1110
+ base.goTo(item);
1111
+ });
1112
+ base.$elem.on("owl.jumpTo", function (event, item) {
1113
+ base.jumpTo(item);
1114
+ });
1115
+ },
1116
+
1117
+ stopOnHover : function () {
1118
+ var base = this;
1119
+ if (base.options.stopOnHover === true && base.browser.isTouch !== true && base.options.autoPlay !== false) {
1120
+ base.$elem.on("mouseover", function () {
1121
+ base.stop();
1122
+ });
1123
+ base.$elem.on("mouseout", function () {
1124
+ if (base.hoverStatus !== "stop") {
1125
+ base.play();
1126
+ }
1127
+ });
1128
+ }
1129
+ },
1130
+
1131
+ lazyLoad : function () {
1132
+ var base = this,
1133
+ i,
1134
+ $item,
1135
+ itemNumber,
1136
+ $lazyImg,
1137
+ follow;
1138
+
1139
+ if (base.options.lazyLoad === false) {
1140
+ return false;
1141
+ }
1142
+ for (i = 0; i < base.itemsAmount; i += 1) {
1143
+ $item = $(base.$owlItems[i]);
1144
+
1145
+ if ($item.data("owl-loaded") === "loaded") {
1146
+ continue;
1147
+ }
1148
+
1149
+ itemNumber = $item.data("owl-item");
1150
+ $lazyImg = $item.find(".lazyOwl");
1151
+
1152
+ if (typeof $lazyImg.data("src") !== "string") {
1153
+ $item.data("owl-loaded", "loaded");
1154
+ continue;
1155
+ }
1156
+ if ($item.data("owl-loaded") === undefined) {
1157
+ $lazyImg.hide();
1158
+ $item.addClass("loading").data("owl-loaded", "checked");
1159
+ }
1160
+ if (base.options.lazyFollow === true) {
1161
+ follow = itemNumber >= base.currentItem;
1162
+ } else {
1163
+ follow = true;
1164
+ }
1165
+ if (follow && itemNumber < base.currentItem + base.options.items && $lazyImg.length) {
1166
+ base.lazyPreload($item, $lazyImg);
1167
+ }
1168
+ }
1169
+ },
1170
+
1171
+ lazyPreload : function ($item, $lazyImg) {
1172
+ var base = this,
1173
+ iterations = 0,
1174
+ isBackgroundImg;
1175
+
1176
+ if ($lazyImg.prop("tagName") === "DIV") {
1177
+ $lazyImg.css("background-image", "url(" + $lazyImg.data("src") + ")");
1178
+ isBackgroundImg = true;
1179
+ } else {
1180
+ $lazyImg[0].src = $lazyImg.data("src");
1181
+ }
1182
+
1183
+ function showImage() {
1184
+ $item.data("owl-loaded", "loaded").removeClass("loading");
1185
+ $lazyImg.removeAttr("data-src");
1186
+ if (base.options.lazyEffect === "fade") {
1187
+ $lazyImg.fadeIn(400);
1188
+ } else {
1189
+ $lazyImg.show();
1190
+ }
1191
+ if (typeof base.options.afterLazyLoad === "function") {
1192
+ base.options.afterLazyLoad.apply(this, [base.$elem]);
1193
+ }
1194
+ }
1195
+
1196
+ function checkLazyImage() {
1197
+ iterations += 1;
1198
+ if (base.completeImg($lazyImg.get(0)) || isBackgroundImg === true) {
1199
+ showImage();
1200
+ } else if (iterations <= 100) {//if image loads in less than 10 seconds
1201
+ window.setTimeout(checkLazyImage, 100);
1202
+ } else {
1203
+ showImage();
1204
+ }
1205
+ }
1206
+
1207
+ checkLazyImage();
1208
+ },
1209
+
1210
+ autoHeight : function () {
1211
+ var base = this,
1212
+ $currentimg = $(base.$owlItems[base.currentItem]).find("img"),
1213
+ iterations;
1214
+
1215
+ function addHeight() {
1216
+ var $currentItem = $(base.$owlItems[base.currentItem]).height();
1217
+ base.wrapperOuter.css("height", $currentItem + "px");
1218
+ if (!base.wrapperOuter.hasClass("autoHeight")) {
1219
+ window.setTimeout(function () {
1220
+ base.wrapperOuter.addClass("autoHeight");
1221
+ }, 0);
1222
+ }
1223
+ }
1224
+
1225
+ function checkImage() {
1226
+ iterations += 1;
1227
+ if (base.completeImg($currentimg.get(0))) {
1228
+ addHeight();
1229
+ } else if (iterations <= 100) { //if image loads in less than 10 seconds
1230
+ window.setTimeout(checkImage, 100);
1231
+ } else {
1232
+ base.wrapperOuter.css("height", ""); //Else remove height attribute
1233
+ }
1234
+ }
1235
+
1236
+ if ($currentimg.get(0) !== undefined) {
1237
+ iterations = 0;
1238
+ checkImage();
1239
+ } else {
1240
+ addHeight();
1241
+ }
1242
+ },
1243
+
1244
+ completeImg : function (img) {
1245
+ var naturalWidthType;
1246
+
1247
+ if (!img.complete) {
1248
+ return false;
1249
+ }
1250
+ naturalWidthType = typeof img.naturalWidth;
1251
+ if (naturalWidthType !== "undefined" && img.naturalWidth === 0) {
1252
+ return false;
1253
+ }
1254
+ return true;
1255
+ },
1256
+
1257
+ onVisibleItems : function () {
1258
+ var base = this,
1259
+ i;
1260
+
1261
+ if (base.options.addClassActive === true) {
1262
+ base.$owlItems.removeClass("active");
1263
+ }
1264
+ base.visibleItems = [];
1265
+ for (i = base.currentItem; i < base.currentItem + base.options.items; i += 1) {
1266
+ base.visibleItems.push(i);
1267
+
1268
+ if (base.options.addClassActive === true) {
1269
+ $(base.$owlItems[i]).addClass("active");
1270
+ }
1271
+ }
1272
+ base.owl.visibleItems = base.visibleItems;
1273
+ },
1274
+
1275
+ transitionTypes : function (className) {
1276
+ var base = this;
1277
+ //Currently available: "fade", "backSlide", "goDown", "fadeUp"
1278
+ base.outClass = "owl-" + className + "-out";
1279
+ base.inClass = "owl-" + className + "-in";
1280
+ },
1281
+
1282
+ singleItemTransition : function () {
1283
+ var base = this,
1284
+ outClass = base.outClass,
1285
+ inClass = base.inClass,
1286
+ $currentItem = base.$owlItems.eq(base.currentItem),
1287
+ $prevItem = base.$owlItems.eq(base.prevItem),
1288
+ prevPos = Math.abs(base.positionsInArray[base.currentItem]) + base.positionsInArray[base.prevItem],
1289
+ origin = Math.abs(base.positionsInArray[base.currentItem]) + base.itemWidth / 2,
1290
+ animEnd = 'webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend';
1291
+
1292
+ base.isTransition = true;
1293
+
1294
+ base.$owlWrapper
1295
+ .addClass('owl-origin')
1296
+ .css({
1297
+ "-webkit-transform-origin" : origin + "px",
1298
+ "-moz-perspective-origin" : origin + "px",
1299
+ "perspective-origin" : origin + "px"
1300
+ });
1301
+ function transStyles(prevPos) {
1302
+ return {
1303
+ "position" : "relative",
1304
+ "left" : prevPos + "px"
1305
+ };
1306
+ }
1307
+
1308
+ $prevItem
1309
+ .css(transStyles(prevPos, 10))
1310
+ .addClass(outClass)
1311
+ .on(animEnd, function () {
1312
+ base.endPrev = true;
1313
+ $prevItem.off(animEnd);
1314
+ base.clearTransStyle($prevItem, outClass);
1315
+ });
1316
+
1317
+ $currentItem
1318
+ .addClass(inClass)
1319
+ .on(animEnd, function () {
1320
+ base.endCurrent = true;
1321
+ $currentItem.off(animEnd);
1322
+ base.clearTransStyle($currentItem, inClass);
1323
+ });
1324
+ },
1325
+
1326
+ clearTransStyle : function (item, classToRemove) {
1327
+ var base = this;
1328
+ item.css({
1329
+ "position" : "",
1330
+ "left" : ""
1331
+ }).removeClass(classToRemove);
1332
+
1333
+ if (base.endPrev && base.endCurrent) {
1334
+ base.$owlWrapper.removeClass('owl-origin');
1335
+ base.endPrev = false;
1336
+ base.endCurrent = false;
1337
+ base.isTransition = false;
1338
+ }
1339
+ },
1340
+
1341
+ owlStatus : function () {
1342
+ var base = this;
1343
+ base.owl = {
1344
+ "userOptions" : base.userOptions,
1345
+ "baseElement" : base.$elem,
1346
+ "userItems" : base.$userItems,
1347
+ "owlItems" : base.$owlItems,
1348
+ "currentItem" : base.currentItem,
1349
+ "prevItem" : base.prevItem,
1350
+ "visibleItems" : base.visibleItems,
1351
+ "isTouch" : base.browser.isTouch,
1352
+ "browser" : base.browser,
1353
+ "dragDirection" : base.dragDirection
1354
+ };
1355
+ },
1356
+
1357
+ clearEvents : function () {
1358
+ var base = this;
1359
+ base.$elem.off(".owl owl mousedown.disableTextSelect");
1360
+ $(document).off(".owl owl");
1361
+ $(window).off("resize", base.resizer);
1362
+ },
1363
+
1364
+ unWrap : function () {
1365
+ var base = this;
1366
+ if (base.$elem.children().length !== 0) {
1367
+ base.$owlWrapper.unwrap();
1368
+ base.$userItems.unwrap().unwrap();
1369
+ if (base.owlControls) {
1370
+ base.owlControls.remove();
1371
+ }
1372
+ }
1373
+ base.clearEvents();
1374
+ base.$elem
1375
+ .attr("style", base.$elem.data("owl-originalStyles") || "")
1376
+ .attr("class", base.$elem.data("owl-originalClasses"));
1377
+ },
1378
+
1379
+ destroy : function () {
1380
+ var base = this;
1381
+ base.stop();
1382
+ window.clearInterval(base.checkVisible);
1383
+ base.unWrap();
1384
+ base.$elem.removeData();
1385
+ },
1386
+
1387
+ reinit : function (newOptions) {
1388
+ var base = this,
1389
+ options = $.extend({}, base.userOptions, newOptions);
1390
+ base.unWrap();
1391
+ base.init(options, base.$elem);
1392
+ },
1393
+
1394
+ addItem : function (htmlString, targetPosition) {
1395
+ var base = this,
1396
+ position;
1397
+
1398
+ if (!htmlString) {return false; }
1399
+
1400
+ if (base.$elem.children().length === 0) {
1401
+ base.$elem.append(htmlString);
1402
+ base.setVars();
1403
+ return false;
1404
+ }
1405
+ base.unWrap();
1406
+ if (targetPosition === undefined || targetPosition === -1) {
1407
+ position = -1;
1408
+ } else {
1409
+ position = targetPosition;
1410
+ }
1411
+ if (position >= base.$userItems.length || position === -1) {
1412
+ base.$userItems.eq(-1).after(htmlString);
1413
+ } else {
1414
+ base.$userItems.eq(position).before(htmlString);
1415
+ }
1416
+
1417
+ base.setVars();
1418
+ },
1419
+
1420
+ removeItem : function (targetPosition) {
1421
+ var base = this,
1422
+ position;
1423
+
1424
+ if (base.$elem.children().length === 0) {
1425
+ return false;
1426
+ }
1427
+ if (targetPosition === undefined || targetPosition === -1) {
1428
+ position = -1;
1429
+ } else {
1430
+ position = targetPosition;
1431
+ }
1432
+
1433
+ base.unWrap();
1434
+ base.$userItems.eq(position).remove();
1435
+ base.setVars();
1436
+ }
1437
+
1438
+ };
1439
+
1440
+ $.fn.owlCarousel = function (options) {
1441
+ return this.each(function () {
1442
+ if ($(this).data("owl-init") === true) {
1443
+ return false;
1444
+ }
1445
+ $(this).data("owl-init", true);
1446
+ var carousel = Object.create(Carousel);
1447
+ carousel.init(options, this);
1448
+ $.data(this, "owlCarousel", carousel);
1449
+ });
1450
+ };
1451
+
1452
+ $.fn.owlCarousel.options = {
1453
+
1454
+ items : 5,
1455
+ itemsCustom : false,
1456
+ itemsDesktop : [1199, 4],
1457
+ itemsDesktopSmall : [979, 3],
1458
+ itemsTablet : [768, 2],
1459
+ itemsTabletSmall : false,
1460
+ itemsMobile : [479, 1],
1461
+ singleItem : false,
1462
+ itemsScaleUp : false,
1463
+
1464
+ slideSpeed : 200,
1465
+ paginationSpeed : 800,
1466
+ rewindSpeed : 1000,
1467
+
1468
+ autoPlay : false,
1469
+ stopOnHover : false,
1470
+
1471
+ navigation : false,
1472
+ navigationText : ["prev", "next"],
1473
+ rewindNav : true,
1474
+ scrollPerPage : false,
1475
+
1476
+ pagination : true,
1477
+ paginationNumbers : false,
1478
+
1479
+ responsive : true,
1480
+ responsiveRefreshRate : 200,
1481
+ responsiveBaseWidth : window,
1482
+
1483
+ baseClass : "owl-carousel",
1484
+ theme : "owl-theme",
1485
+
1486
+ lazyLoad : false,
1487
+ lazyFollow : true,
1488
+ lazyEffect : "fade",
1489
+
1490
+ autoHeight : false,
1491
+
1492
+ jsonPath : false,
1493
+ jsonSuccess : false,
1494
+
1495
+ dragBeforeAnimFinish : true,
1496
+ mouseDrag : true,
1497
+ touchDrag : true,
1498
+
1499
+ addClassActive : false,
1500
+ transitionStyle : false,
1501
+
1502
+ beforeUpdate : false,
1503
+ afterUpdate : false,
1504
+ beforeInit : false,
1505
+ afterInit : false,
1506
+ beforeMove : false,
1507
+ afterMove : false,
1508
+ afterAction : false,
1509
+ startDragging : false,
1510
+ afterLazyLoad: false
1511
+ };
1512
+ }(jQuery, window, document));
js/shortcode_button.js ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ add_action( 'init', 'wptuts_buttons' );
4
+ function wptuts_buttons() {
5
+ add_filter( "mce_external_plugins", "wptuts_add_buttons" );
6
+ add_filter( 'mce_buttons', 'wptuts_register_buttons' );
7
+ }
8
+ function wptuts_add_buttons( $plugin_array ) {
9
+ $plugin_array['wptuts'] = get_template_directory_uri() . '/wptuts-editor-buttons/wptuts-plugin.js';
10
+ return $plugin_array;
11
+ }
12
+ function wptuts_register_buttons( $buttons ) {
13
+ array_push( $buttons, 'dropcap', 'showrecent' ); // dropcap', 'recentposts
14
+ return $buttons;
15
+ }
16
+
17
+
18
+
19
+ add_shortcode( 'recent-posts', 'wptuts_recent_posts' );
20
+ function wptuts_recent_posts( $atts ) {
21
+ extract( shortcode_atts( array(
22
+ 'numbers' => '5',
23
+ ), $atts ) );
24
+ $rposts = new WP_Query( array( 'posts_per_page' => $numbers, 'orderby' => 'date' ) );
25
+ if ( $rposts->have_posts() ) {
26
+ $html = '<h3>Recent Posts</h3><ul class="recent-posts">';
27
+ while( $rposts->have_posts() ) {
28
+ $rposts->the_post();
29
+ $html .= sprintf(
30
+ '<li><a href="%s" title="%s">%s</a></li>',
31
+ get_permalink($rposts->post->ID),
32
+ get_the_title(),
33
+ get_the_title()
34
+ );
35
+ }
36
+ $html .= '</ul>';
37
+ }
38
+ wp_reset_query();
39
+ return $html;
40
+ }
41
+ ?>
library/autenticazione.php ADDED
@@ -0,0 +1,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <p style="font-size:14px;">Thank you for you choise! <strong>Enjoy Instagram - Responsive gallery</strong> is a plugin lovingly developed for you by <a href="http://www.mediabeta.com" target="_blank"> Mediabeta</a>.</p>
2
+
3
+ <p style="font-size:14px;">By using this plugin, you are agreeing to the <a href="http://instagram.com/about/legal/terms/api/" target="_blank">Instagram API Terms of Use</a>.</p>
4
+
5
+
6
+
7
+ <script>
8
+ (function($) {
9
+ $(document).ready(function() {
10
+ var allPanels = $('.enjoy_accordion > dd').hide();
11
+
12
+ $('.enjoy_accordion > dt > a').click(function() {
13
+ allPanels.slideUp();
14
+ if (!$(this).parent().hasClass('enjoyinstagram_active')){
15
+ $('.enjoy_accordion > dd').removeClass('enjoyinstagram_active');
16
+ $(this).parent().next().slideDown();
17
+ $(this).parent().addClass('enjoyinstagram_active');
18
+
19
+
20
+ }else{
21
+ $(this).parent().removeClass('enjoyinstagram_active');
22
+ }
23
+ return false;
24
+ });
25
+ });
26
+ })(jQuery);
27
+ </script>
28
+ <style>
29
+ .enjoy_accordion dt{
30
+ background:rgba(204,204,204,0.5);
31
+ font-size:1.1rem;
32
+ padding-top:1rem;
33
+ padding-bottom:1rem;
34
+ margin-bottom:1px;
35
+ }
36
+ .enjoy_accordion dt a{
37
+ text-decoration:none; padding:1rem;
38
+ }
39
+ .step_number
40
+ {width: 2rem;
41
+ height: 2rem;
42
+ border-radius: 1rem;
43
+
44
+ color: #fff;
45
+ line-height: 2rem;
46
+ text-align: center;
47
+ background: #0074a2;
48
+ display:inline-block;
49
+ }
50
+ .enjoy_accordion {
51
+ margin: 50px;
52
+ dt, dd {
53
+ padding: 10px;
54
+ border: 1px solid black;
55
+ border-bottom: 0;
56
+ &:last-of-type {
57
+ border-bottom: 1px solid black;
58
+ }
59
+ a {
60
+ display: block;
61
+ color: black;
62
+ font-weight: bold;
63
+ }
64
+ }
65
+ dd {
66
+ border-top: 0;
67
+ font-size: 12px;
68
+ &:last-of-type {
69
+ border-top: 1px solid white;
70
+ position: relative;
71
+ top: -1px;
72
+ }
73
+ }
74
+ }
75
+
76
+ .enjoy_open {content: "\f347";}
77
+ .enjoy_close {content: "\f343";}
78
+ .button_accordion {display:inline-block; float:right; margin-right:1rem;}
79
+
80
+
81
+ </style>
82
+
83
+ <dl class="enjoy_accordion">
84
+ <h3>Follow these 2 simple steps to configure the plugin and... enjoy it!</h3>
85
+ <dt><a href=""><span class="step_number">01</span> Create an Instagram Application </a></dt>
86
+ <dd><ol>
87
+ <li>Once you're logged in with your Instagram account go to <a href="http://instagram.com/developer/" target="_blank" rel="nofollow">http://instagram.com/developer/</a></li>
88
+ <li>Enter the data related to your site and the information required by Instagram. Accept API Terms of Use and Brand Guidelines</li>
89
+ <li>Click "Register Your Application" button.</li>
90
+ <li>Click "Register a New Client".</li>
91
+ <li>
92
+ Once you've verified your account fill the form with:
93
+
94
+ <ul>
95
+ <li><br /><strong>Application Name</strong>: Your App Name (Your WebSite for example)</li>
96
+ <li><strong>Description</strong>: Your App Description</li>
97
+ <li><span><strong>Website URL</strong> (copy it exactly as shown below) :</span>
98
+ <br /><font style="font-size:12px; color:#0074A2; font-weight:bold;"><?php echo get_home_url(); ?></font></li>
99
+
100
+ <li><strong>OAuth redirect_uri</strong> (copy it exactly as shown below) : <br /><font style="font-size:12px; color:#0074A2; font-weight:bold;"><?php echo admin_url('options-general.php?page=enjoyinstagram_plugin_options&tab=enjoyinstagram_general_settings'); ?></font><br /></li>
101
+ </ul>
102
+ </li>
103
+ <li><b>Click the "Register" button. Copy Client ID and Client Secret values for the next step.</b></li>
104
+ </ol></dd>
105
+
106
+
107
+
108
+
109
+ <dt><a href=""> <span class="step_number">02</span> Enter Your Client ID and Client Secret</a></dt>
110
+ <dd>
111
+
112
+
113
+
114
+
115
+ <form method="post" action="options.php">
116
+ <?php settings_fields('enjoyinstagram_options_group_auth'); ?>
117
+
118
+
119
+
120
+ <div style="margin-top: 20px;
121
+ padding: 20px;
122
+ border: 1px solid #DDDDDD;"
123
+ >
124
+ Insert your <u>Client ID</u> and your <u>Client Secret</u>
125
+ <p>
126
+
127
+ <label class="enjoy_label" for="enjoyinstagram_client_id"><strong>Client ID:</strong></label>
128
+ <input type="text" id="enjoyinstagram_client_id" value="<?php echo get_option('enjoyinstagram_client_id'); ?>" name="enjoyinstagram_client_id" />
129
+ <span class="description">
130
+ Your Client ID </span></p>
131
+ <p>
132
+ <label class="enjoy_label" for="enjoyinstagram_client_secret"><strong>Client Secret:</strong></label>
133
+ <input type="text" id="enjoyinstagram_client_secret" value="<?php echo get_option('enjoyinstagram_client_secret'); ?>" name="enjoyinstagram_client_secret" />
134
+ <span class="description">
135
+ Your Client Secret </span>
136
+ </p>
137
+ </div>
138
+ <p>
139
+ By clicking this button this plugin will be activated!</p><p>
140
+ <input type="button" class="button-primary" id="button_autorizza_instagram" name="button_autorizza_instagram" value="Authorize Application" />
141
+ </p>
142
+
143
+ </form>
144
+
145
+
146
+
147
+ </dd>
148
+
149
+
150
+
151
+
152
+ </dl>
153
+
154
+
155
+
156
+
library/enjoyinstagram_shortcode.php ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Add Shortcode
3
+ function enjoyinstagram_mb_shortcode($atts) {
4
+ STATIC $i = 1;
5
+
6
+
7
+ if(get_option('enjoyinstagram_client_id') || get_option('enjoyinstagram_client_id') != '') {
8
+ extract( shortcode_atts( array(
9
+ 'n' => '4',
10
+ ), $atts ) );
11
+ ?>
12
+ <script>
13
+ jQuery(function(){
14
+ jQuery(document.body)
15
+ .on('click touchend','#swipebox-slider .current img', function(e){
16
+ jQuery('#swipebox-next').click();
17
+ return false;
18
+ })
19
+ .on('click touchend','#swipebox-slider .current', function(e){
20
+ jQuery('#swipebox-close').trigger('click');
21
+ });
22
+ });
23
+ </script>
24
+ <script type="text/javascript">
25
+ jQuery(function($) {
26
+ $(".swipebox").swipebox({
27
+ hideBarsDelay : 0
28
+ });
29
+
30
+ });
31
+ jQuery(document).ready(function() {
32
+ jQuery("#owl-<?php echo $i; ?>").owlCarousel({
33
+ lazyLoad : true,
34
+ items : <?php echo get_option('enjoyinstagram_carousel_items_number'); ?>,
35
+ itemsDesktop : [1199,<?php echo get_option('enjoyinstagram_carousel_items_number'); ?>],
36
+ itemsDesktopSmall : [980,<?php echo get_option('enjoyinstagram_carousel_items_number'); ?>],
37
+ itemsTablet: [768,<?php echo get_option('enjoyinstagram_carousel_items_number'); ?>],
38
+ itemsMobile : [479,<?php echo get_option('enjoyinstagram_carousel_items_number'); ?>],
39
+ stopOnHover: true,
40
+ navigation: <?php echo get_option('enjoyinstagram_carousel_navigation'); ?>
41
+
42
+ });
43
+ jQuery("#owl-<?php echo $i; ?>").fadeIn();
44
+ });
45
+ </script>
46
+ <?php
47
+ $instagram = new Enjoy_Instagram(get_option('enjoyinstagram_client_id'));
48
+ $instagram->setAccessToken(get_option('enjoyinstagram_access_token'));
49
+ if(get_option('enjoyinstagram_user_or_hashtag')=='hashtag'){
50
+ $result = $instagram->getTagMedia(get_option('enjoyinstagram_hashtag'));
51
+ }else{
52
+ $result = $instagram->getUserMedia(get_option('enjoyinstagram_user_id'));
53
+ }
54
+ $pre_shortcode_content = "<div id=\"owl-".$i."\" class=\"owl-example\" style=\"display:none;\">";
55
+
56
+ foreach ($result->data as $entry) {
57
+
58
+ if(get_option('enjoyinstagram_carousel_items_number')!='1'){
59
+ $shortcode_content .= "<div class=\"box\"><a title=\"{$entry->caption->text}\" rel=\"gallery_swypebox\" class=\"swipebox\" href=\"{$entry->images->standard_resolution->url}\"><img src=\"{$entry->images->standard_resolution->url}\"></a></div>";
60
+ }else{
61
+ $shortcode_content .= "<div class=\"box\"><a title=\"{$entry->caption->text}\" rel=\"gallery_swypebox\" class=\"swipebox\" href=\"{$entry->images->standard_resolution->url}\"><img style=\"width:100%;\" src=\"{$entry->images->standard_resolution->url}\"></a></div>";
62
+ }
63
+ }
64
+
65
+ $post_shortcode_content = "</div>";
66
+
67
+
68
+
69
+ }
70
+ $i++;
71
+
72
+ $shortcode_content = $pre_shortcode_content.$shortcode_content.$post_shortcode_content;
73
+
74
+ return $shortcode_content;
75
+
76
+ }
77
+ add_shortcode( 'enjoyinstagram_mb', 'enjoyinstagram_mb_shortcode' );
78
+
79
+
80
+
81
+
82
+ ?>
library/enjoyinstagram_shortcode_grid.php ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Add Shortcode
3
+ function enjoyinstagram_mb_shortcode_grid() {
4
+ STATIC $i = 1;
5
+ if(get_option('enjoyinstagram_client_id') || get_option('enjoyinstagram_client_id') != '') {
6
+
7
+ $instagram = new Enjoy_Instagram(get_option('enjoyinstagram_client_id'));
8
+ $instagram->setAccessToken(get_option('enjoyinstagram_access_token'));
9
+ if(get_option('enjoyinstagram_user_or_hashtag')=='hashtag'){
10
+ $result = $instagram->getTagMedia(get_option('enjoyinstagram_hashtag'));
11
+ }else{
12
+ $result = $instagram->getUserMedia(get_option('enjoyinstagram_user_id'));
13
+ }
14
+
15
+ $pre_shortcode_content = "<div id=\"grid-".$i."\" class=\"ri-grid ri-grid-size-2 ri-shadow\" style=\"display:none;\"><ul>";
16
+
17
+
18
+
19
+
20
+ foreach ($result->data as $entry) {
21
+
22
+ $shortcode_content .= "<li><a title=\"{$entry->caption->text}\" class=\"swipebox_grid\" href=\"{$entry->images->standard_resolution->url}\"><img src=\"{$entry->images->standard_resolution->url}\"></a></li>";
23
+
24
+ }
25
+
26
+ $post_shortcode_content = "</ul></div>";
27
+
28
+ ?>
29
+
30
+
31
+
32
+ <script type="text/javascript">
33
+
34
+ jQuery(function() {
35
+ jQuery('#grid-<?php echo $i; ?>').gridrotator({
36
+ rows : <?php echo get_option('enjoyinstagram_grid_rows'); ?>,
37
+ columns : <?php echo get_option('enjoyinstagram_grid_cols'); ?>,
38
+ animType : 'fadeInOut',
39
+ onhover : false,
40
+ interval : 7000,
41
+ preventClick : false,
42
+ w1400 : {
43
+ rows : <?php echo get_option('enjoyinstagram_grid_rows'); ?>,
44
+ columns : <?php echo get_option('enjoyinstagram_grid_cols'); ?>
45
+ },
46
+ w1024 : {
47
+ rows : <?php echo get_option('enjoyinstagram_grid_rows'); ?>,
48
+ columns : <?php echo get_option('enjoyinstagram_grid_cols'); ?>
49
+ },
50
+
51
+ w768 : {
52
+ rows : <?php echo get_option('enjoyinstagram_grid_rows'); ?>,
53
+ columns : <?php echo get_option('enjoyinstagram_grid_cols'); ?>
54
+ },
55
+
56
+ w480 : {
57
+ rows : <?php echo get_option('enjoyinstagram_grid_rows'); ?>,
58
+ columns : <?php echo get_option('enjoyinstagram_grid_cols'); ?>
59
+ },
60
+
61
+ w320 : {
62
+ rows : <?php echo get_option('enjoyinstagram_grid_rows'); ?>,
63
+ columns : <?php echo get_option('enjoyinstagram_grid_cols'); ?>
64
+ },
65
+
66
+ w240 : {
67
+ rows : <?php echo get_option('enjoyinstagram_grid_rows'); ?>,
68
+ columns : <?php echo get_option('enjoyinstagram_grid_cols'); ?>
69
+ }
70
+ });
71
+
72
+ jQuery('#grid-<?php echo $i; ?>').fadeIn('1000');
73
+
74
+
75
+ });
76
+
77
+ </script>
78
+ <?php
79
+
80
+ }
81
+ $i++;
82
+
83
+ $shortcode_content = $pre_shortcode_content.$shortcode_content.$post_shortcode_content;
84
+
85
+ return $shortcode_content;
86
+ }
87
+
88
+ add_shortcode( 'enjoyinstagram_mb_grid', 'enjoyinstagram_mb_shortcode_grid' );
89
+
90
+
91
+
92
+ ?>
library/enjoyinstagram_shortcode_grid_widget.php ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Add Shortcode
3
+ function enjoyinstagram_mb_shortcode_grid_widget($atts) {
4
+ if(get_option('enjoyinstagram_client_id') || get_option('enjoyinstagram_client_id') != '') {
5
+ extract( shortcode_atts( array(
6
+ 'id' => 'rigrid_default',
7
+ 'n_c' => '6',
8
+ 'n_r' => '2',
9
+ 'u_or_h' => 'user'
10
+ ), $atts ) );
11
+ $instagram = new Enjoy_Instagram(get_option('enjoyinstagram_client_id'));
12
+ $instagram->setAccessToken(get_option('enjoyinstagram_access_token'));
13
+ if("{$u_or_h}"=='hashtag'){
14
+ $result = $instagram->getTagMedia(get_option('enjoyinstagram_hashtag'));
15
+ }else{
16
+ $result = $instagram->getUserMedia(get_option('enjoyinstagram_user_id'));
17
+ }
18
+ ?>
19
+ <div id="rigrid-<?php echo "{$id}"; ?>" class="ri-grid ri-grid-size-2 ri-shadow" style="display:none">
20
+ <ul>
21
+ <?php
22
+
23
+ if($result->data){
24
+ foreach ($result->data as $entry) {
25
+
26
+ echo "<li><a title=\"{$entry->caption->text}\" class=\"swipebox_grid\" href=\"{$entry->images->standard_resolution->url}\"><img src=\"{$entry->images->standard_resolution->url}\"></a></li>";
27
+
28
+ }
29
+ }
30
+ ?>
31
+ </ul></div>
32
+
33
+ <script type="text/javascript">
34
+
35
+
36
+ jQuery(function() {
37
+
38
+ jQuery('#rigrid-<?php echo "{$id}"; ?>').gridrotator({
39
+ rows : <?php echo "{$n_r}"; ?>,
40
+ columns : <?php echo "{$n_c}"; ?>,
41
+ animType : 'fadeInOut',
42
+ onhover : false,
43
+ interval : 7000,
44
+ preventClick : false,
45
+ w1024 : {
46
+ rows : <?php echo "{$n_r}"; ?>,
47
+ columns : <?php echo "{$n_c}"; ?>
48
+ },
49
+
50
+ w768 : {
51
+ rows : <?php echo "{$n_r}"; ?>,
52
+ columns : <?php echo "{$n_c}"; ?>
53
+ },
54
+
55
+ w480 : {
56
+ rows : <?php echo "{$n_r}"; ?>,
57
+ columns : <?php echo "{$n_c}"; ?>
58
+ },
59
+
60
+ w320 : {
61
+ rows : <?php echo "{$n_r}"; ?>,
62
+ columns : <?php echo "{$n_c}"; ?>
63
+ },
64
+
65
+ w240 : {
66
+ rows : <?php echo "{$n_r}"; ?>,
67
+ columns : <?php echo "{$n_c}"; ?>
68
+ }
69
+ });
70
+ jQuery('#rigrid-<?php echo "{$id}"; ?>').fadeIn('slow');
71
+ });
72
+
73
+
74
+ </script>
75
+ <?php
76
+
77
+ }
78
+ ?>
79
+
80
+
81
+ <?php
82
+ }
83
+
84
+ add_shortcode( 'enjoyinstagram_mb_grid_widget', 'enjoyinstagram_mb_shortcode_grid_widget' );
85
+
86
+
87
+
88
+ ?>
library/enjoyinstagram_shortcode_widget.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Add Shortcode
3
+ function enjoyinstagram_mb_shortcode_widget($atts) {
4
+ if(get_option('enjoyinstagram_client_id') || get_option('enjoyinstagram_client_id') != '') {
5
+ extract( shortcode_atts( array(
6
+ 'n' => '4',
7
+ 'id' => 'owl',
8
+ 'n_y_n' =>'false',
9
+ 'u_or_h' => 'user'
10
+ ), $atts ) );
11
+ ?>
12
+ <script>
13
+ jQuery(function(){
14
+ jQuery(document.body)
15
+ .on('click touchend','#swipebox-slider .current img', function(e){
16
+ jQuery('#swipebox-next').click();
17
+ return false;
18
+ })
19
+ .on('click touchend','#swipebox-slider .current', function(e){
20
+ jQuery('#swipebox-close').trigger('click');
21
+ });
22
+ });
23
+ </script>
24
+ <script type="text/javascript">
25
+ jQuery(function($) {
26
+ $(".swipebox").swipebox({
27
+ hideBarsDelay : 0
28
+ });
29
+
30
+ });
31
+ jQuery(document).ready(function() {
32
+ jQuery("#owl-<?php echo "{$id}"; ?>").owlCarousel({
33
+ items : <?php echo "{$n}"; ?>,
34
+ navigation: <?php echo "{$n_y_n}"; ?>,
35
+ });
36
+ jQuery("#owl-<?php echo "{$id}"; ?>").fadeIn('slow');
37
+ });
38
+ </script>
39
+ <?php
40
+ $instagram = new Enjoy_Instagram(get_option('enjoyinstagram_client_id'));
41
+ $instagram->setAccessToken(get_option('enjoyinstagram_access_token'));
42
+ if("{$u_or_h}"=='hashtag'){
43
+ $result = $instagram->getTagMedia(get_option('enjoyinstagram_hashtag'));
44
+ }else{
45
+ $result = $instagram->getUserMedia(get_option('enjoyinstagram_user_id'));
46
+ }
47
+ ?>
48
+ <div id="owl-<?php echo "{$id}"; ?>" class="owl-example">
49
+ <?php
50
+ if($result->data){
51
+ foreach ($result->data as $entry) {
52
+
53
+ if(get_option('enjoyinstagram_carousel_items_number')!='1'){
54
+ echo "<div class=\"box\"><a title=\"{$entry->caption->text}\" rel=\"gallery_swypebox\" class=\"swipebox\" href=\"{$entry->images->standard_resolution->url}\"><img src=\"{$entry->images->thumbnail->url}\"></a></div>";
55
+ }else{
56
+ echo "<div class=\"box\"><a title=\"{$entry->caption->text}\" rel=\"gallery_swypebox\" class=\"swipebox\" href=\"{$entry->images->standard_resolution->url}\"><img style=\"width:100%;\" src=\"{$entry->images->standard_resolution->url}\"></a></div>";
57
+ }
58
+ }
59
+ }
60
+ ?>
61
+ </div>
62
+ <?php
63
+
64
+ }
65
+ }
66
+ add_shortcode( 'enjoyinstagram_mb_widget', 'enjoyinstagram_mb_shortcode_widget' );
67
+
68
+
69
+ ?>
library/impostazioni_shortcode.php ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <form method="post" action="options.php" novalidate>
2
+ <?php settings_fields('enjoyinstagram_options_carousel_group'); ?>
3
+ <?php echo realpath(home_url()); ?>
4
+
5
+
6
+
7
+ <script type="text/javascript">
8
+ jQuery(document).ready(function($){
9
+ $("input[name$='enjoyinstagram_user_or_hashtag']").click(function() {
10
+ var test = $(this).val();
11
+ if(test=='user'){
12
+ $('#enjoyinstagram_hashtag').attr('disabled',true);
13
+ }else if(test=='hashtag'){
14
+ $('#enjoyinstagram_hashtag').attr('disabled',false);
15
+ }
16
+ $("div.desc").hide();
17
+ $("#enjoyinstagram_user_or_hashtag_" + test).show();
18
+ });});
19
+ </script>
20
+
21
+ <table class="form-table">
22
+ <tbody>
23
+
24
+ <tr valign="top">
25
+ <th scope="row" style="align:left;">
26
+ <label for="enjoyinstagram_user_or_hashtag" class="enfasi">Inclusion mode:</label>
27
+ </th>
28
+ <td><div class="ei_block">
29
+ <div class="ei_settings_float_block">
30
+ Show pics:
31
+ </div>
32
+ <div class="ei_settings_float_block">
33
+ <input type="radio" name="enjoyinstagram_user_or_hashtag" <?php if (get_option('enjoyinstagram_user_or_hashtag')=='user') echo "checked";?> value="user">of Your Profile<br/><br/>
34
+ <input type="radio" name="enjoyinstagram_user_or_hashtag" <?php if (get_option('enjoyinstagram_user_or_hashtag')=='hashtag') echo "checked";?> value="hashtag">by Hashtag<br />
35
+ </div>
36
+ <div class="ei_settings_float_block">
37
+
38
+ <div id="enjoyinstagram_user_or_hashtag_user" class="desc" <?php if (get_option('enjoyinstagram_user_or_hashtag')!='user') echo 'style="display:none;"';?> >
39
+ &nbsp;<input type="text" class="ei_disabled" id="enjoyinstagram_user" disabled value="<?php echo get_option('enjoyinstagram_user_username'); ?>" name="enjoyinstagram_user" />
40
+ </div>
41
+
42
+ <div id="enjoyinstagram_user_or_hashtag_hashtag" class="desc" <?php if (get_option('enjoyinstagram_user_or_hashtag')!='hashtag') echo 'style="display:none;"';?>>
43
+ #<input type="text" id="enjoyinstagram_hashtag" required value="<?php echo get_option('enjoyinstagram_hashtag'); ?>" name="enjoyinstagram_hashtag" />
44
+ <span class="description">insert a hashtag without '#'</span>
45
+
46
+ </div>
47
+ </div> </div>
48
+ </td>
49
+
50
+ </tr>
51
+ </tbody>
52
+ </table>
53
+
54
+ <hr />
55
+
56
+ <table class="form-table">
57
+ <tbody>
58
+ <tr valign="top">
59
+ <th scope="row" style="align:left;">
60
+ <label for="enjoyinstagram_carousel_items_numbe" class="enfasi">Carousel settings:</label>
61
+ </th>
62
+
63
+ <td><div class="ei_block">
64
+ <div class="ei_settings_float_block ei_fixed">
65
+ Images displayed at a time:
66
+ </div>
67
+ <div class="ei_settings_float_block">
68
+ <select name="enjoyinstagram_carousel_items_number" class="ei_sel" id="enjoyinstagram_carousel_items_number">
69
+ <?php for ($i = 1; $i <= 10; $i++) { ?>
70
+ <option value="<?php echo $i?>" <?php if (get_option('enjoyinstagram_carousel_items_number')==$i)
71
+ echo "selected='selected'";?>>
72
+ <?php echo "&nbsp;".$i; ?>
73
+ </option>
74
+
75
+ <?php } ?>
76
+ </select>
77
+ </div>
78
+ </div>
79
+ <div class="ei_block">
80
+ <div class="ei_settings_float_block ei_fixed">
81
+ Navigation buttons:
82
+ </div>
83
+ <div class="ei_settings_float_block">
84
+ <select name="enjoyinstagram_carousel_navigation" class="ei_sel" id="enjoyinstagram_carousel_navigation">
85
+ <option value="true" <?php if (get_option('enjoyinstagram_carousel_navigation')=='true') echo "selected='selected'";?>>Yes
86
+ </option>
87
+ <option value="false" <?php if (get_option('enjoyinstagram_carousel_navigation')=='false') echo "selected='selected'";?>>No
88
+ </option>
89
+ </select>
90
+ </div>
91
+ </div>
92
+ </td>
93
+ </tr>
94
+ </tbody>
95
+ </table>
96
+
97
+ <hr />
98
+
99
+ <!-- SHORTCODE WALL GRID -->
100
+
101
+ <table class="form-table">
102
+ <tbody>
103
+ <tr valign="top">
104
+ <th scope="row" style="align:left;">
105
+ <label for="enjoyinstagram_carousel_grid" class="enfasi">Grid view settings:</label>
106
+ </th>
107
+
108
+ <td><div class="ei_block">
109
+ <div class="ei_settings_float_block ei_fixed">
110
+ Number of Columns:
111
+ </div>
112
+ <div class="ei_settings_float_block">
113
+ <select name="enjoyinstagram_grid_cols" id="enjoyinstagram_grid_cols" class="ei_sel">
114
+
115
+
116
+ <?php for ($i = 1; $i <= 10; $i++) { ?>
117
+ <option value="<?php echo $i?>" <?php if (get_option('enjoyinstagram_grid_cols')==$i)
118
+ echo "selected='selected'";?>>
119
+ <?php echo "&nbsp;".$i; ?>
120
+ </option>
121
+
122
+ <?php } ?>
123
+ </select>
124
+ </div>
125
+ </div>
126
+
127
+ <div class="ei_block">
128
+ <div class="ei_settings_float_block ei_fixed">
129
+ Number of Rows:
130
+ </div>
131
+ <div class="ei_settings_float_block">
132
+ <select name="enjoyinstagram_grid_rows" id="enjoyinstagram_grid_rows" class="ei_sel">
133
+
134
+
135
+ <?php for ($i = 1; $i <= 10; $i++) { ?>
136
+ <option value="<?php echo $i?>" <?php if (get_option('enjoyinstagram_grid_rows')==$i)
137
+ echo "selected='selected'";?>>
138
+ <?php echo "&nbsp;".$i; ?>
139
+ </option>
140
+
141
+ <?php } ?>
142
+ </select>
143
+ </div>
144
+ </div>
145
+
146
+
147
+ </td>
148
+ </tr>
149
+
150
+
151
+
152
+
153
+ </tbody>
154
+ </table>
155
+ <hr/>
156
+ <p><strong>Free version</strong>: Only 20 images allowed.</p>
157
+ <input type="submit" class="button-primary" id="button_enjoyinstagram_advanced" name="button_enjoyinstagram_advanced" value="Save Settings"/>
158
+ </form>
library/instagram.class.php ADDED
@@ -0,0 +1,569 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Instagram API class
5
+ * API Documentation: http://instagram.com/developer/
6
+ * Class Documentation: https://github.com/cosenary/Instagram-PHP-API/tree/dev
7
+ *
8
+ * @author Christian Metz
9
+ * @since 30.10.2011
10
+ * @copyright Christian Metz - MetzWeb Networks 2011-2014
11
+ * @version 2.1
12
+ * @license BSD http://www.opensource.org/licenses/bsd-license.php
13
+ */
14
+ class Enjoy_Instagram {
15
+
16
+ /**
17
+ * The API base URL
18
+ */
19
+ const API_URL = 'https://api.instagram.com/v1/';
20
+
21
+ /**
22
+ * The API OAuth URL
23
+ */
24
+ const API_OAUTH_URL = 'https://api.instagram.com/oauth/authorize';
25
+
26
+ /**
27
+ * The OAuth token URL
28
+ */
29
+ const API_OAUTH_TOKEN_URL = 'https://api.instagram.com/oauth/access_token';
30
+
31
+ /**
32
+ * The Instagram API Key
33
+ *
34
+ * @var string
35
+ */
36
+ private $_apikey;
37
+
38
+ /**
39
+ * The Instagram OAuth API secret
40
+ *
41
+ * @var string
42
+ */
43
+ private $_apisecret;
44
+
45
+ /**
46
+ * The callback URL
47
+ *
48
+ * @var string
49
+ */
50
+ private $_callbackurl;
51
+
52
+ /**
53
+ * The user access token
54
+ *
55
+ * @var string
56
+ */
57
+ private $_accesstoken;
58
+
59
+ /**
60
+ * Available scopes
61
+ *
62
+ * @var array
63
+ */
64
+ private $_scopes = array('basic', 'likes', 'comments', 'relationships');
65
+
66
+ /**
67
+ * Available actions
68
+ *
69
+ * @var array
70
+ */
71
+ private $_actions = array('follow', 'unfollow', 'block', 'unblock', 'approve', 'deny');
72
+
73
+ /**
74
+ * Default constructor
75
+ *
76
+ * @param array|string $config Instagram configuration data
77
+ * @return void
78
+ */
79
+ public function __construct($config) {
80
+ if (true === is_array($config)) {
81
+ // if you want to access user data
82
+ $this->setApiKey($config['apiKey']);
83
+ $this->setApiSecret($config['apiSecret']);
84
+ $this->setApiCallback($config['apiCallback']);
85
+ } else if (true === is_string($config)) {
86
+ // if you only want to access public data
87
+ $this->setApiKey($config);
88
+ } else {
89
+ throw new Exception("Error: __construct() - Configuration data is missing.");
90
+ }
91
+ }
92
+
93
+ /**
94
+ * Generates the OAuth login URL
95
+ *
96
+ * @param array [optional] $scope Requesting additional permissions
97
+ * @return string Instagram OAuth login URL
98
+ */
99
+ public function getLoginUrl($scope = array('basic')) {
100
+ if (is_array($scope) && count(array_intersect($scope, $this->_scopes)) === count($scope)) {
101
+ return self::API_OAUTH_URL . '?client_id=' . $this->getApiKey() . '&redirect_uri=' . urlencode($this->getApiCallback()) . '&scope=' . implode('+', $scope) . '&response_type=code';
102
+ } else {
103
+ throw new Exception("Error: getLoginUrl() - The parameter isn't an array or invalid scope permissions used.");
104
+ }
105
+ }
106
+
107
+ /**
108
+ * Search for a user
109
+ *
110
+ * @param string $name Instagram username
111
+ * @param integer [optional] $limit Limit of returned results
112
+ * @return mixed
113
+ */
114
+ public function searchUser($name, $limit = 0) {
115
+ return $this->_makeCall('users/search', false, array('q' => $name, 'count' => $limit));
116
+ }
117
+
118
+ /**
119
+ * Get user info
120
+ *
121
+ * @param integer [optional] $id Instagram user ID
122
+ * @return mixed
123
+ */
124
+ public function getUser($id = 0) {
125
+ $auth = false;
126
+ if ($id === 0 && isset($this->_accesstoken)) { $id = 'self'; $auth = true; }
127
+ return $this->_makeCall('users/' . $id, $auth);
128
+ }
129
+
130
+ /**
131
+ * Get user activity feed
132
+ *
133
+ * @param integer [optional] $limit Limit of returned results
134
+ * @return mixed
135
+ */
136
+ public function getUserFeed($limit = 0) {
137
+ return $this->_makeCall('users/self/feed', true, array('count' => $limit));
138
+ }
139
+
140
+ /**
141
+ * Get user recent media
142
+ *
143
+ * @param integer [optional] $id Instagram user ID
144
+ * @param integer [optional] $limit Limit of returned results
145
+ * @return mixed
146
+ */
147
+ public function getUserMedia($id = 'self', $limit = 0) {
148
+ return $this->_makeCall('users/' . $id . '/media/recent', ($id === 'self'), array('count' => $limit));
149
+ }
150
+
151
+ /**
152
+ * Get the liked photos of a user
153
+ *
154
+ * @param integer [optional] $limit Limit of returned results
155
+ * @return mixed
156
+ */
157
+ public function getUserLikes($limit = 0) {
158
+ return $this->_makeCall('users/self/media/liked', true, array('count' => $limit));
159
+ }
160
+
161
+ /**
162
+ * Get the list of users this user follows
163
+ *
164
+ * @param integer [optional] $id Instagram user ID
165
+ * @param integer [optional] $limit Limit of returned results
166
+ * @return mixed
167
+ */
168
+ public function getUserFollows($id = 'self', $limit = 0) {
169
+ return $this->_makeCall('users/' . $id . '/follows', true, array('count' => $limit));
170
+ }
171
+
172
+ /**
173
+ * Get the list of users this user is followed by
174
+ *
175
+ * @param integer [optional] $id Instagram user ID
176
+ * @param integer [optional] $limit Limit of returned results
177
+ * @return mixed
178
+ */
179
+ public function getUserFollower($id = 'self', $limit = 0) {
180
+ return $this->_makeCall('users/' . $id . '/followed-by', true, array('count' => $limit));
181
+ }
182
+
183
+ /**
184
+ * Get information about a relationship to another user
185
+ *
186
+ * @param integer $id Instagram user ID
187
+ * @return mixed
188
+ */
189
+ public function getUserRelationship($id) {
190
+ return $this->_makeCall('users/' . $id . '/relationship', true);
191
+ }
192
+
193
+ /**
194
+ * Modify the relationship between the current user and the target user
195
+ *
196
+ * @param string $action Action command (follow/unfollow/block/unblock/approve/deny)
197
+ * @param integer $user Target user ID
198
+ * @return mixed
199
+ */
200
+ public function modifyRelationship($action, $user) {
201
+ if (true === in_array($action, $this->_actions) && isset($user)) {
202
+ return $this->_makeCall('users/' . $user . '/relationship', true, array('action' => $action), 'POST');
203
+ }
204
+ throw new Exception("Error: modifyRelationship() | This method requires an action command and the target user id.");
205
+ }
206
+
207
+ /**
208
+ * Search media by its location
209
+ *
210
+ * @param float $lat Latitude of the center search coordinate
211
+ * @param float $lng Longitude of the center search coordinate
212
+ * @param integer [optional] $distance Distance in metres (default is 1km (distance=1000), max. is 5km)
213
+ * @param long [optional] $minTimestamp Media taken later than this timestamp (default: 5 days ago)
214
+ * @param long [optional] $maxTimestamp Media taken earlier than this timestamp (default: now)
215
+ * @return mixed
216
+ */
217
+ public function searchMedia($lat, $lng, $distance = 1000, $minTimestamp = NULL, $maxTimestamp = NULL) {
218
+ return $this->_makeCall('media/search', false, array('lat' => $lat, 'lng' => $lng, 'distance' => $distance, 'min_timestamp' => $minTimestamp, 'max_timestamp' => $maxTimestamp));
219
+ }
220
+
221
+ /**
222
+ * Get media by its id
223
+ *
224
+ * @param integer $id Instagram media ID
225
+ * @return mixed
226
+ */
227
+ public function getMedia($id) {
228
+ return $this->_makeCall('media/' . $id);
229
+ }
230
+
231
+ /**
232
+ * Get the most popular media
233
+ *
234
+ * @return mixed
235
+ */
236
+ public function getPopularMedia() {
237
+ return $this->_makeCall('media/popular');
238
+ }
239
+
240
+ /**
241
+ * Search for tags by name
242
+ *
243
+ * @param string $name Valid tag name
244
+ * @return mixed
245
+ */
246
+ public function searchTags($name) {
247
+ return $this->_makeCall('tags/search', false, array('q' => $name));
248
+ }
249
+
250
+ /**
251
+ * Get info about a tag
252
+ *
253
+ * @param string $name Valid tag name
254
+ * @return mixed
255
+ */
256
+ public function getTag($name) {
257
+ return $this->_makeCall('tags/' . $name);
258
+ }
259
+
260
+ /**
261
+ * Get a recently tagged media
262
+ *
263
+ * @param string $name Valid tag name
264
+ * @param integer [optional] $limit Limit of returned results
265
+ * @return mixed
266
+ */
267
+ public function getTagMedia($name, $limit = 0) {
268
+ return $this->_makeCall('tags/' . $name . '/media/recent', false, array('count' => $limit));
269
+ }
270
+
271
+ /**
272
+ * Get a list of users who have liked this media
273
+ *
274
+ * @param integer $id Instagram media ID
275
+ * @return mixed
276
+ */
277
+ public function getMediaLikes($id) {
278
+ return $this->_makeCall('media/' . $id . '/likes', true);
279
+ }
280
+
281
+ /**
282
+ * Get a list of comments for this media
283
+ *
284
+ * @param integer $id Instagram media ID
285
+ * @return mixed
286
+ */
287
+ public function getMediaComments($id) {
288
+ return $this->_makeCall('media/' . $id . '/comments', false);
289
+ }
290
+
291
+ /**
292
+ * Add a comment on a media
293
+ *
294
+ * @param integer $id Instagram media ID
295
+ * @param string $text Comment content
296
+ * @return mixed
297
+ */
298
+ public function addMediaComment($id, $text) {
299
+ return $this->_makeCall('media/' . $id . '/comments', true, array('text' => $text), 'POST');
300
+ }
301
+
302
+ /**
303
+ * Remove user comment on a media
304
+ *
305
+ * @param integer $id Instagram media ID
306
+ * @param string $commentID User comment ID
307
+ * @return mixed
308
+ */
309
+ public function deleteMediaComment($id, $commentID) {
310
+ return $this->_makeCall('media/' . $id . '/comments/' . $commentID, true, null, 'DELETE');
311
+ }
312
+
313
+ /**
314
+ * Set user like on a media
315
+ *
316
+ * @param integer $id Instagram media ID
317
+ * @return mixed
318
+ */
319
+ public function likeMedia($id) {
320
+ return $this->_makeCall('media/' . $id . '/likes', true, null, 'POST');
321
+ }
322
+
323
+ /**
324
+ * Remove user like on a media
325
+ *
326
+ * @param integer $id Instagram media ID
327
+ * @return mixed
328
+ */
329
+ public function deleteLikedMedia($id) {
330
+ return $this->_makeCall('media/' . $id . '/likes', true, null, 'DELETE');
331
+ }
332
+
333
+ /**
334
+ * Get information about a location
335
+ *
336
+ * @param integer $id Instagram location ID
337
+ * @return mixed
338
+ */
339
+ public function getLocation($id) {
340
+ return $this->_makeCall('locations/' . $id, false);
341
+ }
342
+
343
+ /**
344
+ * Get recent media from a given location
345
+ *
346
+ * @param integer $id Instagram location ID
347
+ * @return mixed
348
+ */
349
+ public function getLocationMedia($id) {
350
+ return $this->_makeCall('locations/' . $id . '/media/recent', false);
351
+ }
352
+
353
+ /**
354
+ * Get recent media from a given location
355
+ *
356
+ * @param float $lat Latitude of the center search coordinate
357
+ * @param float $lng Longitude of the center search coordinate
358
+ * @param integer [optional] $distance Distance in meter (max. distance: 5km = 5000)
359
+ * @return mixed
360
+ */
361
+ public function searchLocation($lat, $lng, $distance = 1000) {
362
+ return $this->_makeCall('locations/search', false, array('lat' => $lat, 'lng' => $lng, 'distance' => $distance));
363
+ }
364
+
365
+ /**
366
+ * Pagination feature
367
+ *
368
+ * @param object $obj Instagram object returned by a method
369
+ * @param integer $limit Limit of returned results
370
+ * @return mixed
371
+ */
372
+ public function pagination($obj, $limit = 0) {
373
+ if (true === is_object($obj) && !is_null($obj->pagination)) {
374
+ if (!isset($obj->pagination->next_url)) {
375
+ return;
376
+ }
377
+ $apiCall = explode('?', $obj->pagination->next_url);
378
+ if (count($apiCall) < 2) {
379
+ return;
380
+ }
381
+ $function = str_replace(self::API_URL, '', $apiCall[0]);
382
+ $auth = (strpos($apiCall[1], 'access_token') !== false);
383
+ if (isset($obj->pagination->next_max_id)) {
384
+ return $this->_makeCall($function, $auth, array('max_id' => $obj->pagination->next_max_id, 'count' => $limit));
385
+ } else {
386
+ return $this->_makeCall($function, $auth, array('cursor' => $obj->pagination->next_cursor, 'count' => $limit));
387
+ }
388
+ } else {
389
+ throw new Exception("Error: pagination() | This method doesn't support pagination.");
390
+ }
391
+ }
392
+
393
+ /**
394
+ * Get the OAuth data of a user by the returned callback code
395
+ *
396
+ * @param string $code OAuth2 code variable (after a successful login)
397
+ * @param boolean [optional] $token If it's true, only the access token will be returned
398
+ * @return mixed
399
+ */
400
+ public function getOAuthToken($code, $token = false) {
401
+ $apiData = array(
402
+ 'grant_type' => 'authorization_code',
403
+ 'client_id' => $this->getApiKey(),
404
+ 'client_secret' => $this->getApiSecret(),
405
+ 'redirect_uri' => $this->getApiCallback(),
406
+ 'code' => $code
407
+ );
408
+
409
+ $result = $this->_makeOAuthCall($apiData);
410
+ return (false === $token) ? $result : $result->access_token;
411
+ }
412
+
413
+ /**
414
+ * The call operator
415
+ *
416
+ * @param string $function API resource path
417
+ * @param array [optional] $params Additional request parameters
418
+ * @param boolean [optional] $auth Whether the function requires an access token
419
+ * @param string [optional] $method Request type GET|POST
420
+ * @return mixed
421
+ */
422
+ protected function _makeCall($function, $auth = false, $params = null, $method = 'GET') {
423
+ if (false === $auth) {
424
+ // if the call doesn't requires authentication
425
+ $authMethod = '?client_id=' . $this->getApiKey();
426
+ } else {
427
+ // if the call needs an authenticated user
428
+ if (true === isset($this->_accesstoken)) {
429
+ $authMethod = '?access_token=' . $this->getAccessToken();
430
+ } else {
431
+ throw new Exception("Error: _makeCall() | $function - This method requires an authenticated users access token.");
432
+ }
433
+ }
434
+
435
+ if (isset($params) && is_array($params)) {
436
+ $paramString = '&' . http_build_query($params);
437
+ } else {
438
+ $paramString = null;
439
+ }
440
+
441
+ $apiCall = self::API_URL . $function . $authMethod . (('GET' === $method) ? $paramString : null);
442
+
443
+ $ch = curl_init();
444
+ curl_setopt($ch, CURLOPT_URL, $apiCall);
445
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json'));
446
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
447
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
448
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
449
+
450
+ if ('POST' === $method) {
451
+ curl_setopt($ch, CURLOPT_POST, count($params));
452
+ curl_setopt($ch, CURLOPT_POSTFIELDS, ltrim($paramString, '&'));
453
+ } else if ('DELETE' === $method) {
454
+ curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
455
+ }
456
+
457
+ $jsonData = curl_exec($ch);
458
+ if (false === $jsonData) {
459
+ throw new Exception("Error: _makeCall() - cURL error: " . curl_error($ch));
460
+ }
461
+ curl_close($ch);
462
+
463
+ return json_decode($jsonData);
464
+ }
465
+
466
+ /**
467
+ * The OAuth call operator
468
+ *
469
+ * @param array $apiData The post API data
470
+ * @return mixed
471
+ */
472
+ private function _makeOAuthCall($apiData) {
473
+ $apiHost = self::API_OAUTH_TOKEN_URL;
474
+
475
+ $ch = curl_init();
476
+ curl_setopt($ch, CURLOPT_URL, $apiHost);
477
+ curl_setopt($ch, CURLOPT_POST, count($apiData));
478
+ curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($apiData));
479
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json'));
480
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
481
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
482
+
483
+ $jsonData = curl_exec($ch);
484
+ if (false === $jsonData) {
485
+ throw new Exception("Error: _makeOAuthCall() - cURL error: " . curl_error($ch));
486
+ }
487
+ curl_close($ch);
488
+
489
+ return json_decode($jsonData);
490
+ }
491
+
492
+ /**
493
+ * Access Token Setter
494
+ *
495
+ * @param object|string $data
496
+ * @return void
497
+ */
498
+ public function setAccessToken($data) {
499
+ (true === is_object($data)) ? $token = $data->access_token : $token = $data;
500
+ $this->_accesstoken = $token;
501
+ }
502
+
503
+ /**
504
+ * Access Token Getter
505
+ *
506
+ * @return string
507
+ */
508
+ public function getAccessToken() {
509
+ return $this->_accesstoken;
510
+ }
511
+
512
+ /**
513
+ * API-key Setter
514
+ *
515
+ * @param string $apiKey
516
+ * @return void
517
+ */
518
+ public function setApiKey($apiKey) {
519
+ $this->_apikey = $apiKey;
520
+ }
521
+
522
+ /**
523
+ * API Key Getter
524
+ *
525
+ * @return string
526
+ */
527
+ public function getApiKey() {
528
+ return $this->_apikey;
529
+ }
530
+
531
+ /**
532
+ * API Secret Setter
533
+ *
534
+ * @param string $apiSecret
535
+ * @return void
536
+ */
537
+ public function setApiSecret($apiSecret) {
538
+ $this->_apisecret = $apiSecret;
539
+ }
540
+
541
+ /**
542
+ * API Secret Getter
543
+ *
544
+ * @return string
545
+ */
546
+ public function getApiSecret() {
547
+ return $this->_apisecret;
548
+ }
549
+
550
+ /**
551
+ * API Callback URL Setter
552
+ *
553
+ * @param string $apiCallback
554
+ * @return void
555
+ */
556
+ public function setApiCallback($apiCallback) {
557
+ $this->_callbackurl = $apiCallback;
558
+ }
559
+
560
+ /**
561
+ * API Callback URL Getter
562
+ *
563
+ * @return string
564
+ */
565
+ public function getApiCallback() {
566
+ return $this->_callbackurl;
567
+ }
568
+
569
+ }
library/profile_auth.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <p>
2
+ <h2>Your Instagram Profile</h2>
3
+ <hr />
4
+
5
+ <div id="enjoy_user_profile">
6
+ <img class="enjoy_user_profile" src="<?php echo get_option('enjoyinstagram_user_profile_picture'); ?>">
7
+ <input type="button" id="button_logout" value="Unlink Profile" class="button-primary ei_top" />
8
+ </div>
9
+
10
+ <div id="enjoy_user_block" >
11
+ <h3><?php echo get_option('enjoyinstagram_user_username'); ?></h3>
12
+ <p><i><?php echo get_option('enjoyinstagram_user_bio'); ?></i></p>
13
+ <hr/>
14
+ Customize the plugin with our <a href="<?php echo get_admin_url(); ?>options-general.php?page=enjoyinstagram_plugin_options&tab=enjoyinstagram_advanced_settings">settings</a> tab.
15
+
16
+ <hr />
17
+ </div>
18
+ </p>
library/shortcode_button.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) )
4
+ die( "Can't load this file directly" );
5
+
6
+ class MyGallery
7
+ {
8
+ function __construct() {
9
+ add_action( 'admin_init', array( $this, 'action_admin_init' ) );
10
+ }
11
+
12
+ function action_admin_init() {
13
+ if ( current_user_can( 'edit_posts' ) && current_user_can( 'edit_pages' ) ) {
14
+ add_filter( 'mce_buttons', array( $this, 'filter_mce_button' ) );
15
+ add_filter( 'mce_external_plugins', array( $this, 'filter_mce_plugin' ) );
16
+ }
17
+ }
18
+
19
+ function filter_mce_button( $buttons ) {
20
+ array_push( $buttons, '|', 'mygallery_button' );
21
+ return $buttons;
22
+ }
23
+
24
+ function filter_mce_plugin( $plugins ) {
25
+ $plugins['mygallery'] = plugins_url('shortcode_button.js',__FILE__);
26
+ return $plugins;
27
+ }
28
+ }
29
+
30
+ $mygallery = new MyGallery();
library/widgets.php ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Slider_Widget extends WP_Widget {
4
+
5
+
6
+ function __construct() {
7
+ parent::__construct(
8
+ 'Slider_Widget', // Base ID
9
+ __('EnjoyInstagram - Carousel', 'text_domain'), // Name
10
+ array( 'description' => __( 'A Foo Widget', 'text_domain' ), ) // Args
11
+ );
12
+ }
13
+
14
+
15
+
16
+
17
+ public function widget( $args, $instance ) {
18
+ $title = apply_filters( 'widget_title', $instance['title'] );
19
+ $number_images_in_slide = apply_filters( 'widget_content', $instance['number_images_in_slide'] );
20
+ $navigation_y_n = apply_filters( 'widget_content', $instance['navigation_y_n'] );
21
+ $user_or_hashtag = apply_filters( 'widget_content', $instance['user_or_hashtag'] );
22
+
23
+
24
+ echo $args['before_widget'];
25
+ if ( ! empty( $title ) )
26
+ echo $args['before_title'] . $title . $args['after_title'];
27
+ do_shortcode('[enjoyinstagram_mb_widget n="'.$instance['number_images_in_slide'].'" id="'.$args['widget_id'].'" n_y_n="'.$instance['navigation_y_n'].'" u_or_h="'.$instance['user_or_hashtag'].'"]');
28
+ echo $args['after_widget'];
29
+ }
30
+
31
+
32
+
33
+
34
+ public function form( $instance ) {
35
+ if ( isset( $instance[ 'title' ] ) ) {
36
+ $title = $instance[ 'title' ];
37
+ }
38
+ else {
39
+ $title = __( 'New title', 'text_domain' );
40
+ }
41
+
42
+ $instance = wp_parse_args( (array) $instance, array(
43
+ 'number_images_in_slide' => '4',
44
+ 'navigation_y_n' => 'false',
45
+ 'user_or_hashtag' => 'user'
46
+
47
+ ) );
48
+
49
+ ?>
50
+
51
+ <p>
52
+ <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
53
+ <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>">
54
+ </p>
55
+
56
+ <p>
57
+ <label for="<?php echo $this->get_field_id( 'number_images_in_slide' ); ?>"><?php _e( 'Images displayed at a time:' ); ?></label><br />
58
+ <select name="<?php echo $this->get_field_name( 'number_images_in_slide' ); ?>" id="<?php echo $this->get_field_id( 'number_images_in_slide' ); ?>">
59
+ <option value="1" <?php if ($instance['number_images_in_slide']=='1') echo "selected='selected'";?>>1</option>
60
+ <option value="2" <?php if ($instance['number_images_in_slide']=='2') echo "selected='selected'";?>>2</option>
61
+ <option value="3" <?php if ($instance['number_images_in_slide']=='3') echo "selected='selected'";?>>3</option>
62
+ <option value="4" <?php if ($instance['number_images_in_slide']=='4') echo "selected='selected'";?>>4</option>
63
+ <option value="5" <?php if ($instance['number_images_in_slide']=='5') echo "selected='selected'";?>>5</option>
64
+ <option value="6" <?php if ($instance['number_images_in_slide']=='6') echo "selected='selected'";?>>6</option>
65
+ <option value="7" <?php if ($instance['number_images_in_slide']=='7') echo "selected='selected'";?>>7</option>
66
+ <option value="8" <?php if ($instance['number_images_in_slide']=='8') echo "selected='selected'";?>>8</option>
67
+ <option value="9" <?php if ($instance['number_images_in_slide']=='9') echo "selected='selected'";?>>9</option>
68
+ <option value="10" <?php if ($instance['number_images_in_slide']=='10') echo "selected='selected'";?>>10</option>
69
+ </select>
70
+
71
+ </p>
72
+
73
+ <p>
74
+ <label for="<?php echo $this->get_field_id( 'navigation_y_n' ); ?>"><?php _e( 'Navigation buttons:' ); ?></label><br />
75
+ <select name="<?php echo $this->get_field_name( 'navigation_y_n' ); ?>" id="<?php echo $this->get_field_id( 'navigation_y_n' ); ?>">
76
+ <option value="true" <?php if ($instance['navigation_y_n']=='true') echo "selected='selected'";?>>Yes</option>
77
+ <option value="false" <?php if ($instance['navigation_y_n']=='false') echo "selected='selected'";?>>No</option>
78
+ </select>
79
+
80
+ </p>
81
+
82
+ <p>
83
+ Show pics: <br />
84
+ <input type="radio" name="<?php echo $this->get_field_name( 'user_or_hashtag' ); ?>" <?php if ($instance['user_or_hashtag']=='user') echo "checked";?> value="user">of Your Profile<br></p>
85
+ <p>
86
+ <input type="radio" name="<?php echo $this->get_field_name( 'user_or_hashtag' ); ?>" <?php if ($instance['user_or_hashtag']=='hashtag') echo "checked";?> value="hashtag">by Hashtag
87
+ <br /></p>
88
+ <!--
89
+ # <input type="text" id="enjoyinstagram_hashtag" value="<?php echo get_option('enjoyinstagram_hashtag'); ?>" name="enjoyinstagram_hashtag" disabled/>
90
+ <span class="description"></span>
91
+ -->
92
+
93
+ <?php
94
+ }
95
+
96
+
97
+ public function update( $new_instance, $old_instance ) {
98
+ $instance = array();
99
+ $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
100
+ $instance['number_images_in_slide'] = ( ! empty( $new_instance['number_images_in_slide'] ) ) ? strip_tags( $new_instance['number_images_in_slide'] ) : '';
101
+ $instance['navigation_y_n'] = ( ! empty( $new_instance['navigation_y_n'] ) ) ? strip_tags( $new_instance['navigation_y_n'] ) : '';
102
+ $instance['user_or_hashtag'] = ( ! empty( $new_instance['user_or_hashtag'] ) ) ? strip_tags( $new_instance['user_or_hashtag'] ) : '';
103
+
104
+ return $instance;
105
+ }
106
+
107
+ }
108
+
109
+ function register_Slider_Widget() {
110
+ register_widget( 'Slider_Widget' );
111
+ }
112
+ add_action( 'widgets_init', 'register_Slider_Widget' );
113
+
114
+
115
+
116
+ ?>
library/widgets_grid.php ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ class Grid_Widget extends WP_Widget {
5
+
6
+ function __construct() {
7
+ parent::__construct(
8
+ 'Grid_Widget', // Base ID
9
+ __('EnjoyInstagram - Grid', 'text_domain'), // Name
10
+ array( 'description' => __( 'A Foo Widget', 'text_domain' ), ) // Args
11
+ );
12
+ }
13
+
14
+
15
+
16
+
17
+ public function widget( $args, $instance ) {
18
+ $title = apply_filters( 'widget_title', $instance['title'] );
19
+ $number_cols_in_grid = apply_filters( 'widget_content', $instance['number_cols_in_grid'] );
20
+ $number_rows_in_grid = apply_filters( 'widget_content', $instance['number_rows_in_grid'] );
21
+ $user_or_hashtag_in_grid = apply_filters( 'widget_content', $instance['user_or_hashtag_in_grid'] );
22
+
23
+
24
+
25
+ echo $args['before_widget'];
26
+ if ( ! empty( $title ) )
27
+ echo $args['before_title'] . $title . $args['after_title'];
28
+ do_shortcode('[enjoyinstagram_mb_grid_widget id="'.$args['widget_id'].'" n_c="'.$instance['number_cols_in_grid'].'" n_r="'.$instance['number_rows_in_grid'].'" u_or_h="'.$instance['user_or_hashtag_in_grid'].'"]');
29
+ echo $args['after_widget'];
30
+ }
31
+
32
+
33
+
34
+ public function form( $instance ) {
35
+ if ( isset( $instance[ 'title' ] ) ) {
36
+ $title = $instance[ 'title' ];
37
+ }
38
+ else {
39
+ $title = __( 'New title', 'text_domain' );
40
+ }
41
+ $instance = wp_parse_args( (array) $instance, array(
42
+ 'number_cols_in_grid' => '4',
43
+ 'number_rows_in_grid' => '2',
44
+ 'user_or_hashtag_in_grid' => 'user'
45
+
46
+ ) );
47
+
48
+ ?>
49
+ <p>
50
+ <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
51
+ <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>">
52
+ </p>
53
+ <p>
54
+ <label for="<?php echo $this->get_field_id( 'number_cols_in_grid' ); ?>"><?php _e( 'Number of Columns:' ); ?></label><br />
55
+ <select name="<?php echo $this->get_field_name( 'number_cols_in_grid' ); ?>" id="<?php echo $this->get_field_id( 'number_cols_in_grid' ); ?>">
56
+ <option value="1" <?php if ($instance['number_cols_in_grid']=='1') echo "selected='selected'";?>>1</option>
57
+ <option value="2" <?php if ($instance['number_cols_in_grid']=='2') echo "selected='selected'";?>>2</option>
58
+ <option value="3" <?php if ($instance['number_cols_in_grid']=='3') echo "selected='selected'";?>>3</option>
59
+ <option value="4" <?php if ($instance['number_cols_in_grid']=='4') echo "selected='selected'";?>>4</option>
60
+ <option value="5" <?php if ($instance['number_cols_in_grid']=='5') echo "selected='selected'";?>>5</option>
61
+ <option value="6" <?php if ($instance['number_cols_in_grid']=='6') echo "selected='selected'";?>>6</option>
62
+ <option value="7" <?php if ($instance['number_cols_in_grid']=='7') echo "selected='selected'";?>>7</option>
63
+ <option value="8" <?php if ($instance['number_cols_in_grid']=='8') echo "selected='selected'";?>>8</option>
64
+ <option value="9" <?php if ($instance['number_cols_in_grid']=='9') echo "selected='selected'";?>>9</option>
65
+ <option value="10" <?php if ($instance['number_cols_in_grid']=='10') echo "selected='selected'";?>>10</option>
66
+ </select>
67
+
68
+ </p>
69
+ <p>
70
+ <label for="<?php echo $this->get_field_id( 'number_rows_in_grid' ); ?>"><?php _e( 'Number of Rows:' ); ?></label><br />
71
+ <select name="<?php echo $this->get_field_name( 'number_rows_in_grid' ); ?>" id="<?php echo $this->get_field_id( 'number_rows_in_grid' ); ?>">
72
+ <option value="1" <?php if ($instance['number_rows_in_grid']=='1') echo "selected='selected'";?>>1</option>
73
+ <option value="2" <?php if ($instance['number_rows_in_grid']=='2') echo "selected='selected'";?>>2</option>
74
+ <option value="3" <?php if ($instance['number_rows_in_grid']=='3') echo "selected='selected'";?>>3</option>
75
+ <option value="4" <?php if ($instance['number_rows_in_grid']=='4') echo "selected='selected'";?>>4</option>
76
+ <option value="5" <?php if ($instance['number_rows_in_grid']=='5') echo "selected='selected'";?>>5</option>
77
+ <option value="6" <?php if ($instance['number_rows_in_grid']=='6') echo "selected='selected'";?>>6</option>
78
+ <option value="7" <?php if ($instance['number_rows_in_grid']=='7') echo "selected='selected'";?>>7</option>
79
+ <option value="8" <?php if ($instance['number_rows_in_grid']=='8') echo "selected='selected'";?>>8</option>
80
+ <option value="9" <?php if ($instance['number_rows_in_grid']=='9') echo "selected='selected'";?>>9</option>
81
+ <option value="10" <?php if ($instance['number_rows_in_grid']=='10') echo "selected='selected'";?>>10</option>
82
+ </select>
83
+
84
+ </p>
85
+ <p>
86
+ Show pics:
87
+ <br />
88
+ <input type="radio" name="<?php echo $this->get_field_name( 'user_or_hashtag_in_grid' ); ?>" <?php if ($instance['user_or_hashtag_in_grid']=='user') echo "checked";?> value="user">of Your Profile<br></p>
89
+ <p>
90
+ <input type="radio" name="<?php echo $this->get_field_name( 'user_or_hashtag_in_grid' ); ?>" <?php if ($instance['user_or_hashtag_in_grid']=='hashtag') echo "checked";?> value="hashtag">by Hashtag
91
+ <br /></p>
92
+
93
+ <?php
94
+ }
95
+
96
+
97
+ public function update( $new_instance, $old_instance ) {
98
+ $instance = array();
99
+ $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
100
+ $instance['number_cols_in_grid'] = ( ! empty( $new_instance['number_cols_in_grid'] ) ) ? strip_tags( $new_instance['number_cols_in_grid'] ) : '';
101
+ $instance['number_rows_in_grid'] = ( ! empty( $new_instance['number_rows_in_grid'] ) ) ? strip_tags( $new_instance['number_rows_in_grid'] ) : '';
102
+ $instance['user_or_hashtag_in_grid'] = ( ! empty( $new_instance['user_or_hashtag_in_grid'] ) ) ? strip_tags( $new_instance['user_or_hashtag_in_grid'] ) : '';
103
+
104
+ return $instance;
105
+ }
106
+
107
+ }
108
+
109
+ function register_Grid_Widget() {
110
+ register_widget( 'Grid_Widget' );
111
+ }
112
+ add_action( 'widgets_init', 'register_Grid_Widget' );
113
+
114
+
115
+
116
+ ?>
readme.txt ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Enjoy Instagram ===
2
+ Contributors: (mediabeta, frafra85, fabiodipa)
3
+ Donate link: http://www.mediabeta.com/enjoy-instagram/
4
+ Tags: instagram, instagram images, instagram gallery, photos, widgets, gallery, instagram responsive, instagram touch
5
+ Requires at least: 3.0.1
6
+ Tested up to: 4.0
7
+ Version: 1.5.1
8
+ Stable tag: 1.5.1
9
+ License: GPLv2 or later
10
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
+
12
+ Display in your site awesome carousels or images sliders of Instagram photos by user or hashtag.
13
+
14
+ == Description ==
15
+
16
+ Display in your site awesome carousels or images sliders of Instagram photos by user or hashtag. You can easily use Enjoy Instagram in your pages, posts, sidebars with shortcodes or widgets.
17
+
18
+ Each photo can be shown in “Lightbox” mode. Everything is responsive and optimized for mobile devices.
19
+
20
+ Here is Live Demo: http://www.mediabeta.com/enjoy-instagram/
21
+
22
+ = Features =
23
+
24
+ * Connected with your instagram account
25
+ * Use instagram hashtags
26
+ * Shortcodes
27
+ * Widgets
28
+ * Responsive
29
+ * Touch
30
+ * Optimized Mobile Devices
31
+ * Grid View Customizable
32
+ * Carousel View Customizable
33
+ * FadeIn Effect in Grid View
34
+ * Possibility of inserting the Shortcode in a text
35
+ * Very Simple Installation and Configuration
36
+
37
+ = PREMIUM VERSION =
38
+
39
+ * NEW Polaroid View
40
+ * NEW Album View
41
+ * NEW Badge View
42
+ * Autoreload Stream of Photos
43
+ * Moderation Control: you can choose which photos show.
44
+ * Autoplay
45
+ * Loop
46
+ * Possibility to choose what link on the photo: Lightbox, Instagram, Custom URL or nothing.
47
+ * Custom CSS: edit CSS, set border, margin, background and much more
48
+ * Custom Transition Effect
49
+ * Custom JS: set time to autoplay and speed, set name of prev and next buttons and much more.
50
+ * Possibility to choose if show photo’s author, caption and likes number.
51
+ * and many others features..
52
+
53
+ LIVE PREMIUM VERSION DEMO: http://www.mediabeta.com/enjoy-instagram-premium/
54
+
55
+ == Installation ==
56
+
57
+ Installation and Configuration are very simple :
58
+
59
+ 1. After you have installed and activated the plugin , go to Settings - > Enjoy Instagram and follow the instructions on the screen.
60
+ 2. To add shortcode to editor click on the Enjoy Instagram icon and choose where include a Carousel View or a Grid View.
61
+ 3. Configure the display of your shortcodes from the plugin settings page
62
+ 4. To add to the Sidebar Enjoy Instagram go to Appearance - > Widgets and configure to your liking widgets Enjoy Instagram
63
+
64
+
65
+ == Frequently Asked Questions ==
66
+
67
+ = My profile disappeared. What’s happened? =
68
+
69
+ Repeat Step 01 and Step 02 again.
70
+
71
+
72
+ == Screenshots ==
73
+
74
+ 1. Enjoy Instagram settings page
75
+ 2. Enjoy Instagram settings page2
76
+ 3. Your Instagram Profile
77
+ 4. Control Panel for Grid View and Carousel View Settings
78
+ 5. Front End View Example
79
+ 6. Front End View Example
80
+ 7. Front End View Example
81
+ 8. Front End View Example
82
+
83
+ == Changelog ==
84
+
85
+ = 1.0 =
86
+ * Initial Version
87
+ = 1.01 =
88
+ * Bux Fix
89
+ = 1.1 =
90
+ * Bux Fix
91
+ = 1.2 =
92
+ * Bux Fix
93
+ = 1.3 =
94
+ * Bux Fix
95
+ = 1.4 =
96
+ * Fix warning for empty hashtag value
97
+ = 1.5 =
98
+ * Fix shortcode use and setting saving
99
+ = 1.5.1 =
100
+ * Bugs Fix
101
+ == Upgrade Notice ==
102
+
103
+ = 1.0 =
104
+ * Initial Version
105
+ = 1.01 =
106
+ * Bux Fix
107
+ = 1.1 =
108
+ * Bux Fix
109
+ = 1.2 =
110
+ * Bux Fix
111
+ = 1.3 =
112
+ * Bux Fix
113
+ = 1.4 =
114
+ * Fix warning for empty hashtag value
115
+ = 1.5 =
116
+ * Fix shortcode use and setting saving
117
+ = 1.5.1 =
118
+ * Bugs Fix
tinymce/ajax.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * @return string folder content
5
+ */
6
+ add_action('wp_ajax_enjoyinstagram_tinymce', 'enjoyinstagram_ajax_tinymce');
7
+ /**
8
+ * Call TinyMCE window content via admin-ajax
9
+ *
10
+ * @since 1.7.0
11
+ * @return html content
12
+ */
13
+
14
+ function enjoyinstagram_ajax_tinymce() {
15
+ if (!current_user_can('edit_pages') && !current_user_can('edit_posts')) // check for rights
16
+ die(__("You are not allowed to be here"));
17
+ include_once( 'window.php');
18
+ die();
19
+ }
20
+
21
+
22
+
23
+
tinymce/editor_plugin.js ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function() {
2
+ tinymce.create('tinymce.plugins.enjoyinstagram', {
3
+ init: function(ed, url) {
4
+
5
+ ed.addCommand('mceenjoyinstagram', function() {
6
+ ed.windowManager.open({
7
+ // call content via admin-ajax, no need to know the full plugin path
8
+ file: ajaxurl + '?action=enjoyinstagram_tinymce',
9
+ width: 220 + ed.getLang('enjoyinstagram.delta_width', 0),
10
+ height: 210 + ed.getLang('enjoyinstagram.delta_height', 0),
11
+ inline: 1
12
+ }, {
13
+ plugin_url: url // Plugin absolute URL
14
+ });
15
+ });
16
+
17
+ // Register example button
18
+ ed.addButton('enjoyinstagram', {
19
+ title: 'enjoyinstagramshortcodes',
20
+ cmd: 'mceenjoyinstagram',
21
+ image: url + '/icon_enjoyinstagram.png'
22
+ });
23
+
24
+ // Add a node change handler, selects the button in the UI when a image is selected
25
+ ed.onNodeChange.add(function(ed, cm, n) {
26
+ cm.setActive('enjoyinstagram', n.nodeName == 'IMG');
27
+ });
28
+ },
29
+ getInfo: function() {
30
+ return {
31
+ longname: 'Plugin to add Enjoy Instagram Button',
32
+ author: 'Mediabeta Srl',
33
+ authorurl: 'http://www.mediabeta.com/',
34
+ infourl: 'http://www.mediabeta.com/',
35
+ version: "1.0"
36
+ };
37
+ }
38
+ });
39
+
40
+ // Register plugin
41
+ tinymce.PluginManager.add('enjoyinstagram', tinymce.plugins.enjoyinstagram);
42
+ })();
tinymce/enjoyinstagramtinymce.js ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function init() {
2
+ tinyMCEPopup.resizeToInnerSize();
3
+ }
4
+
5
+ function insertenjoyinstagramshortcode() {
6
+ var tagtext;
7
+ var shortcode = jQuery('input[name=newshortcode]:checked').val();
8
+
9
+ tagtext = "[" + shortcode + "]";
10
+
11
+ if(window.tinyMCE) {
12
+
13
+ /* get the TinyMCE version to account for API diffs */
14
+ var tmce_ver=window.tinyMCE.majorVersion;
15
+
16
+ if (tmce_ver>="4") {
17
+ window.tinyMCE.execCommand('mceInsertContent', false, tagtext);
18
+ } else {
19
+ window.tinyMCE.execInstanceCommand('content', 'mceInsertContent', false, tagtext);
20
+ }
21
+
22
+ tinyMCEPopup.editor.execCommand('mceRepaint');
23
+ tinyMCEPopup.close();
24
+ }
25
+ return;
26
+ }
tinymce/icon_enjoyinstagram.png ADDED
Binary file
tinymce/tinymce.php ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class add_enjoyinstagram_button {
4
+
5
+ var $pluginname = 'enjoyinstagram';
6
+ var $path = '';
7
+ var $internalVersion = 200;
8
+ /**
9
+ * add_enjoyinstagram_button::add_enjoyinstagram_button()
10
+ * the constructor
11
+ *
12
+ * @return void
13
+ */
14
+ function add_enjoyinstagram_button() {
15
+ // Set path to editor_plugin.js
16
+ $this->path = plugins_url('/',__FILE__);
17
+
18
+ // Modify the version when tinyMCE plugins are changed.
19
+ add_filter('tiny_mce_version', array(&$this, 'change_tinymce_version'));
20
+
21
+ // init process for button control
22
+ add_action('init', array(&$this, 'addbuttons'));
23
+ }
24
+
25
+ /**
26
+ * add_enjoyinstagram_button::addbuttons()
27
+ *
28
+ * @return void
29
+ */
30
+ function addbuttons() {
31
+ // Don't bother doing this stuff if the current user lacks permissions
32
+ if (!current_user_can('edit_posts') && !current_user_can('edit_pages'))
33
+ return;
34
+ // Check for enjoyinstagram capability
35
+ // if ( !current_user_can('enjoyinstagram Use TinyMCE') )
36
+ // return;
37
+ // Add only in Rich Editor mode
38
+ if (get_user_option('rich_editing') == 'true') {
39
+
40
+ // add the button for wp2.5 in a new way
41
+ add_filter("mce_external_plugins", array(&$this, 'add_tinymce_plugin'), 5);
42
+ add_filter('mce_buttons', array(&$this, 'register_button'), 5);
43
+ }
44
+ }
45
+
46
+ /**
47
+ * add_enjoyinstagram_button::register_button()
48
+ * used to insert button in wordpress 2.5x editor
49
+ *
50
+ * @return $buttons
51
+ */
52
+ function register_button($buttons) {
53
+ array_push($buttons, 'separator', $this->pluginname);
54
+ return $buttons;
55
+ }
56
+
57
+ /**
58
+ * add_enjoyinstagram_button::add_tinymce_plugin()
59
+ * Load the TinyMCE plugin : editor_plugin.js
60
+ *
61
+ * @return $plugin_array
62
+ */
63
+ function add_tinymce_plugin($plugin_array) {
64
+ $plugin_array[$this->pluginname] = $this->path . 'editor_plugin.js';
65
+ return $plugin_array;
66
+ }
67
+
68
+ /**
69
+ * add_enjoyinstagram_button::change_tinymce_version()
70
+ * A different version will rebuild the cache
71
+ *
72
+ * @return $versio
73
+ */
74
+ function change_tinymce_version($version) {
75
+ $version = $version + $this->internalVersion;
76
+ return $version;
77
+ }
78
+ }
79
+
80
+ // Call it now
81
+ $tinymce_button = new add_enjoyinstagram_button();
82
+ ?>
tinymce/window.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ wp_enqueue_script('jquery-ui-core');
3
+ wp_enqueue_script('jquery-ui-widget');
4
+ wp_enqueue_script('jquery-ui-position');
5
+ wp_enqueue_script('jquery');
6
+ global $wp_scripts;
7
+ ?>
8
+
9
+ <html xmlns="http://www.w3.org/1999/xhtml">
10
+ <head>
11
+ <title>enjoyinstagram</title>
12
+ <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
13
+ <script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
14
+
15
+ <script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
16
+
17
+ <script language="javascript" type="text/javascript" src="<?php echo plugins_url('enjoyinstagramtinymce.js',__FILE__); ?>"></script>
18
+ <base target="_self" />
19
+ <?php wp_print_scripts(); ?>
20
+ </head>
21
+
22
+ <body id="link">
23
+ <form name="enjoyinstagram" action="#">
24
+ <table border="0" cellpadding="4" cellspacing="0" style="margin:0 auto;">
25
+ <tr>
26
+ <td colspan="2">Insert Enjoy Instagram Shortcode</td>
27
+ </tr><tr>
28
+ <td colspan="2" style="height:100px;">
29
+ <input type="radio" name="newshortcode" id="id_shortcode_carousel" value="enjoyinstagram_mb" checked/> <label for="id_shortcode_carousel" >Carousel View</label>
30
+ <br />
31
+ <input type="radio" name="newshortcode" id="id_shortcode_grid" value="enjoyinstagram_mb_grid"/> <label for="id_shortcode_grid" >Grid View</label>
32
+ </td>
33
+ </tr>
34
+
35
+ <tr>
36
+ <td style="text-align:center;">
37
+ <input type="submit" id="insert" name="insert" value="<?php _e("Insert", 'enjoyinstagram'); ?>" onClick="insertenjoyinstagramshortcode();" />
38
+
39
+ </td>
40
+ <td style="text-align:center;">
41
+ <input type="button" id="cancel" name="cancel" value="<?php _e("Cancel", 'enjoyinstagram'); ?>" onClick="tinyMCEPopup.close();" />
42
+
43
+ </td>
44
+ </tr>
45
+ </table>
46
+ </form>
47
+ </body>
48
+ </html>