Snazzy Maps - Version 1.0.0

Version Description

Release Date: March 1st, 2015

  • Initial Release!

=

Download this release

Release Info

Developer atmistinc
Plugin Icon 128x128 Snazzy Maps
Version 1.0.0
Comparing to
See all releases

Version 1.0.0

additional_js/jquery.base64.min.js ADDED
@@ -0,0 +1 @@
 
1
+ "use strict";jQuery.base64=(function($){var _PADCHAR="=",_ALPHA="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_VERSION="1.0";function _getbyte64(s,i){var idx=_ALPHA.indexOf(s.charAt(i));if(idx===-1){throw"Cannot decode base64"}return idx}function _decode(s){var pads=0,i,b10,imax=s.length,x=[];s=String(s);if(imax===0){return s}if(imax%4!==0){throw"Cannot decode base64"}if(s.charAt(imax-1)===_PADCHAR){pads=1;if(s.charAt(imax-2)===_PADCHAR){pads=2}imax-=4}for(i=0;i<imax;i+=4){b10=(_getbyte64(s,i)<<18)|(_getbyte64(s,i+1)<<12)|(_getbyte64(s,i+2)<<6)|_getbyte64(s,i+3);x.push(String.fromCharCode(b10>>16,(b10>>8)&255,b10&255))}switch(pads){case 1:b10=(_getbyte64(s,i)<<18)|(_getbyte64(s,i+1)<<12)|(_getbyte64(s,i+2)<<6);x.push(String.fromCharCode(b10>>16,(b10>>8)&255));break;case 2:b10=(_getbyte64(s,i)<<18)|(_getbyte64(s,i+1)<<12);x.push(String.fromCharCode(b10>>16));break}return x.join("")}function _getbyte(s,i){var x=s.charCodeAt(i);if(x>255){throw"INVALID_CHARACTER_ERR: DOM Exception 5"}return x}function _encode(s){if(arguments.length!==1){throw"SyntaxError: exactly one argument required"}s=String(s);var i,b10,x=[],imax=s.length-s.length%3;if(s.length===0){return s}for(i=0;i<imax;i+=3){b10=(_getbyte(s,i)<<16)|(_getbyte(s,i+1)<<8)|_getbyte(s,i+2);x.push(_ALPHA.charAt(b10>>18));x.push(_ALPHA.charAt((b10>>12)&63));x.push(_ALPHA.charAt((b10>>6)&63));x.push(_ALPHA.charAt(b10&63))}switch(s.length-imax){case 1:b10=_getbyte(s,i)<<16;x.push(_ALPHA.charAt(b10>>18)+_ALPHA.charAt((b10>>12)&63)+_PADCHAR+_PADCHAR);break;case 2:b10=(_getbyte(s,i)<<16)|(_getbyte(s,i+1)<<8);x.push(_ALPHA.charAt(b10>>18)+_ALPHA.charAt((b10>>12)&63)+_ALPHA.charAt((b10>>6)&63)+_PADCHAR);break}return x.join("")}return{decode:_decode,encode:_encode,VERSION:_VERSION}}(jQuery));
admin/explore.php ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) OR exit;
3
+
4
+
5
+ define('PAGE_SIZE', 3);
6
+
7
+ function render_options($options, $selected){
8
+ foreach($options as $value => $text){
9
+ ?>
10
+ <option value="<?php echo $value;?>"
11
+ <?php echo $value == $selected ? 'selected' : '' ?>>
12
+ <?php echo $text;?>
13
+ </option>
14
+ <?php
15
+ }
16
+ }
17
+
18
+ function admin_explore_head($tab){
19
+
20
+ }
21
+
22
+ function admin_explore_tab($tab){
23
+
24
+ $sort = isset($_GET['sort']) ? $_GET['sort'] : '';
25
+ $tag = isset($_GET['tag']) ? $_GET['tag'] : '';
26
+ $color = isset($_GET['color']) ? $_GET['color'] : '';
27
+ $type = isset($_GET['type']) ? $_GET['type'] : 'all';
28
+ ?>
29
+
30
+ <div id="explore-list">
31
+ <div class="tablenav top clearfix">
32
+ <div class="alignleft">
33
+ <select name="type">
34
+ <?php
35
+ $options = array("all" => "All Styles",
36
+ "my-styles" => "My Styles",
37
+ "my-favorites" => "My Favorites");
38
+ render_options($options, $type);
39
+ ?>
40
+ </select>
41
+ <select name="sort">
42
+ <option value="">Sort by...</option>
43
+ <?php
44
+ $options = array("popular" => "Popular",
45
+ "recent" => "Recent",
46
+ "name" => "Name");
47
+ render_options($options, $sort);
48
+ ?>
49
+ </select>
50
+ <select name="tag">
51
+ <option value="">Filter by Tag</option>
52
+ <?php
53
+ $options = array("colorful" => "Colorful",
54
+ "complex" => "Complex",
55
+ "dark" => "Dark",
56
+ "greyscale" => "Greyscale",
57
+ "light" => "Light",
58
+ "monochrome" => "Monochrome",
59
+ "no-labels" => "No Labels",
60
+ "simple" => "Simple",
61
+ "two-tone" => "Dark",
62
+ "dark" => "Two Tone");
63
+ render_options($options, $tag);
64
+ ?>
65
+ </select>
66
+ <select name="color">
67
+ <option value="">Filter By Color</option>
68
+ <?php
69
+ $options = array("black" => "Black",
70
+ "blue" => "Blue",
71
+ "gray" => "Gray",
72
+ "green" => "Green",
73
+ "multi" => "Multi",
74
+ "orange" => "Orange",
75
+ "purple" => "Purple",
76
+ "red" => "Red",
77
+ "white" => "White",
78
+ "yellow" => "Yellow");
79
+ render_options($options, $color);
80
+ ?>
81
+ </select>
82
+ </div>
83
+ <!--
84
+ <div class="pagination col-sm-6">
85
+ </div>
86
+ -->
87
+
88
+ <div class="tablenav-pages">
89
+ <span class="displaying-num"># items</span>
90
+ <span class="pagination-links">
91
+ <a class="first-page" title="Go to the first page" href="#">«</a>
92
+ <a class="prev-page" title="Go to the previous page" href="#">‹</a>
93
+ <span class="paging-input">
94
+ <label for="current-page-selector" class="screen-reader-text">Select Page</label>
95
+ <input class="current-page" id="current-page-selector" title="Current page" type="text" name="paged" value="1" size="1">
96
+ of
97
+ <span class="total-pages">#</span>
98
+ </span>
99
+ <a class="next-page" title="Go to the next page" href="#">›</a>
100
+ <a class="last-page" title="Go to the last page" href="#">»</a>
101
+ </span>
102
+ </div>
103
+ </div>
104
+
105
+ <div class="results row">
106
+ </div>
107
+ <div class="search-error nothing" style="display:none;">
108
+ <p>No styles were found matching your current filters. Try widening your search a bit!</p>
109
+ </div>
110
+
111
+ <div class="tablenav bottom clearfix">
112
+ <div class="tablenav-pages">
113
+ <span class="displaying-num"># items</span>
114
+ <span class="pagination-links">
115
+ <a class="first-page" title="Go to the first page" href="#">«</a>
116
+ <a class="prev-page" title="Go to the previous page" href="#">‹</a>
117
+ <span class="paging-input">
118
+ <label for="current-page-selector" class="screen-reader-text">Select Page</label>
119
+ <input class="current-page" id="current-page-selector" title="Current page" type="text" name="paged" value="1" size="1">
120
+ of
121
+ <span class="total-pages">#</span>
122
+ </span>
123
+ <a class="next-page" title="Go to the next page" href="#">›</a>
124
+ <a class="last-page" title="Go to the last page" href="#">»</a>
125
+ </span>
126
+ </div>
127
+ </div>
128
+ </div>
129
+
130
+
131
+ <?php } ?>
admin/help.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) OR exit;
3
+
4
+
5
+
6
+ function admin_help_head($tab){
7
+
8
+ }
9
+
10
+ function admin_help_tab($tab){
11
+ ?>
12
+
13
+ <div class="row">
14
+ <div class="col-md-10 col-lg-6">
15
+ <h3>Instructions</h4>
16
+ <p>
17
+ Follow the instructions below to apply styles to your Google Maps:
18
+ </p>
19
+ <ol>
20
+ <li>Browse hundreds of free map styles in the <a href="?page=snazzy_maps&tab=1">Explore</a> tab.</li>
21
+ <li>Click "Save Style" to add styles you like to your <a href="?page=snazzy_maps&tab=0">collection</a>.</li>
22
+ <li>Enable a style on the <a href="?page=snazzy_maps&tab=0">Site Styles</a> tab. This will apply the selected style to all Google Maps on your site.</li>
23
+ <li>
24
+ (Optional) Add your <a href="https://snazzymaps.com/account/developer" target="_blank">API key</a>
25
+ in the <a href="?page=snazzy_maps&tab=2">Settings</a> tab to enable your <a href="?page=snazzy_maps&tab=1&type=my-favorites">Favorites</a>.
26
+ </li>
27
+ </ol>
28
+ <h3>Frequently Asked Questions</h3>
29
+ <h4>Is the plugin free to use?</h4>
30
+ <p>
31
+ The Snazzy Maps plugin is free to use for personal and open source projects.
32
+ Business licenses are available for single and multiple sites and can be purchased at
33
+ <a href="https://snazzymaps.com/plugins" target="_blank">https://snazzymaps.com/plugins</a>.
34
+ </p>
35
+ <h4>How do I add a Google Map to my page?</h4>
36
+ <p>
37
+ This plugin does not add a Google Map to your page. It simply adds styles to your existing maps. If you haven't
38
+ added a map yet, search <a href="https://wordpress.org/plugins" target="_blank">WordPress Plugins</a> for a suitable Google Map plugin.
39
+ </p>
40
+ <h4>Snazzy Maps doesn't work with my Google Maps plugin!</h4>
41
+ <p>
42
+ We've tested Snazzy Maps with several different Google Maps plugins. If you happen to find one that our plugin doesn't
43
+ work with please send us an email at <a href="mailto:support@snazzymaps.com" target="_blank">support@snazzymaps.com</a>.
44
+ </p>
45
+ <h4>How can I access my favorites or private styles from Snazzy Maps?</h4>
46
+ <ol>
47
+ <li>Sign up for an account at <a href="https://snazzymaps.com" target="_blank">https://snazzymaps.com</a>.</li>
48
+ <li>Click your email address in the top left corner.</li>
49
+ <li>Click the developer menu item on the left side.</li>
50
+ <li>Click the "Generate API Key" button.</li>
51
+ <li>Copy the long generated API Key.</li>
52
+ <li>Paste the key into the "Settings" tab in the Snazzy Maps plugin.</li>
53
+ <li>You should now be able to access your favorites and private styles in the 'Explore' tab by changing the first filter dropdown.</li>
54
+ </ol>
55
+ </div>
56
+ </div>
57
+
58
+ <?php } ?>
admin/images/checkmark.svg ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="512px" height="512px" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve">
6
+ <g id="icomoon-ignore">
7
+ </g>
8
+ <path fill="#FFFFFF" d="M432,64L192,304L80,192L0,272l192,192l320-320L432,64z"/>
9
+ </svg>
admin/images/eye.svg ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generated by IcoMoon.io -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32" viewBox="0 0 32 32">
5
+ <path d="M15.988 6.403c-5.847 0-10.406 3.659-15.997 9.594 4.816 5.075 8.859 9.6 15.997 9.6s12.384-5.731 15.997-9.494c-3.7-4.406-8.947-9.7-15.997-9.7zM15.988 22.397c-3.528 0-6.397-2.869-6.397-6.397s2.869-6.397 6.397-6.397c3.528 0 6.4 2.869 6.4 6.397-0.003 3.528-2.872 6.397-6.4 6.397zM16 13.253c-1.516 0-2.747 1.234-2.747 2.747 0 1.516 1.234 2.747 2.747 2.747 1.516 0 2.747-1.234 2.747-2.747 0-1.516-1.231-2.747-2.747-2.747z" fill="#000000"></path>
6
+ </svg>
admin/images/facebook.svg ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="32px" height="32px" viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve">
6
+ <path fill="#00BC66" d="M18,32h-6V16H8v-5.5l4,0l0-3.2C12,2.7,13.2,0,18.5,0h4.4v5.5h-2.8c-2.1,0-2.2,0.8-2.2,2.2l0,2.8h5L22.4,16
7
+ L18,16L18,32L18,32z"/>
8
+ </svg>
admin/images/googleplus.svg ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="32px" height="32px" viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve">
6
+ <path fill="#00BC66" d="M17.5,2c0,0-6.3,0-8.4,0C5.3,2,1.8,4.8,1.8,8.1c0,3.4,2.6,6.1,6.4,6.1c0.3,0,0.5,0,0.8,0
7
+ c-0.2,0.5-0.4,1-0.4,1.6c0,0.9,0.5,1.7,1.1,2.3c-0.5,0-0.9,0-1.5,0c-4.6,0-8.2,3-8.2,6c0,3,3.9,4.9,8.6,4.9c5.3,0,8.2-3,8.2-6
8
+ c0-2.4-0.7-3.9-2.9-5.4c-0.8-0.5-2.2-1.8-2.2-2.6c0-0.9,0.3-1.3,1.6-2.4c1.4-1.1,2.4-2.6,2.4-4.4c0-2.1-0.9-4.2-2.7-4.8h2.7L17.5,2
9
+ L17.5,2z M14.5,22.5c0.1,0.3,0.1,0.6,0.1,0.9c0,2.4-1.6,4.4-6.1,4.4c-3.2,0-5.5-2-5.5-4.5c0-2.4,2.9-4.4,6.1-4.4
10
+ c0.8,0,1.4,0.1,2.1,0.3C12.9,20.4,14.2,21.1,14.5,22.5L14.5,22.5z M9.4,13.4C7.2,13.3,5.2,11,4.8,8.1s1.1-5,3.2-4.9
11
+ c2.2,0.1,4.2,2.3,4.6,5.2S11.6,13.4,9.4,13.4z M26,8V2h-2v6h-6v2h6v6h2v-6h6V8H26z"/>
12
+ </svg>
admin/images/logo-snazzymaps.svg ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="220.5px" height="67px" viewBox="0 0 220.5 67" enable-background="new 0 0 220.5 67" xml:space="preserve">
6
+ <path fill="#00BC66" d="M12.5,27.9C5.6,27.9,0,33.7,0,40.9c0,11.8,13.9,17,10,26.1c6.4-4.4,15-17,15-26.1
7
+ C25,33.7,19.4,27.9,12.5,27.9z M12.5,44c-2.8,0-5-2.3-5-5.1s2.2-5.1,5-5.1s5,2.3,5,5.1S15.3,44,12.5,44z M4.2,28.8
8
+ c0,0,2.8-2.5,8.3-2.5c5.6,0,8.3,2.5,8.3,2.5L19.2,0H5.8L4.2,28.8z"/>
9
+ <path fill="#797A7A" d="M44.1,17.5c-0.7-1.3-1.8-1.9-3.2-2c-0.8,0-1.5,0.3-2.1,0.8c-0.6,0.5-0.8,1.1-0.8,1.9c0,0.5,0.3,1,0.8,1.4
10
+ s1.3,0.7,2.4,0.9c2.6,0.5,4.5,1.3,5.7,2.6c1.2,1.3,1.8,2.8,1.8,4.5c0,1.9-0.7,3.5-2.1,5c-1.4,1.4-3.2,2.2-5.3,2.2
11
+ c-3.3,0-5.8-1.7-7.4-5.1L37,28c1,2.1,2.4,3.2,4.2,3.2c1,0,1.9-0.3,2.7-1.1c0.8-0.7,1.1-1.6,1.1-2.6c0-0.7-0.3-1.3-0.9-2
12
+ c-0.6-0.7-1.7-1.1-3.2-1.4c-2.1-0.3-3.7-0.9-4.8-1.9s-1.7-2.1-1.7-3.5c0-1.6,0.5-3.1,1.7-4.4c1.2-1.4,2.7-2,4.6-2
13
+ c2.7,0.1,4.7,1.3,6,3.8L44.1,17.5z M65.8,34.3h-3.1l-8.3-14.8v14.8H51V12.6h3.4l7.9,13.9V12.6h3.4L65.8,34.3L65.8,34.3z M86.2,34.3
14
+ h-3.6l-2.1-6.1h-6.8l-2.1,6.1h-3.7l7.5-21.8h3.4L86.2,34.3z M79.1,24.7L77,18.6l-2.2,6.1H79.1z M102.7,34.3H87.9v-3.1L98,16h-9.3
15
+ v-3.4h14v3.2l-10.3,15h10.3C102.7,30.8,102.7,34.3,102.7,34.3z M119.8,34.3H105v-3.1L115,16h-9.3v-3.4h14v3.2l-10.3,15.1h10.3v3.4
16
+ H119.8z M140.4,12.6l-7.5,12.3v9.5h-3.4v-9.5l-7.6-12.3h4.1l5.2,8.4l5.3-8.4H140.4z M168,34.3h-3.4V21.7l-5,12.6l-5-12.6v12.6H151
17
+ V12.6h3.4l5,12.2l5-12.2h3.4v21.7H168z M188.5,34.3h-3.6l-2.1-6.1H176l-2.1,6.1h-3.7l7.5-21.8h3.4L188.5,34.3z M181.5,24.7l-2.1-6.1
18
+ l-2.2,6.1H181.5z M197.8,24.9h-4.1v9.5h-3.4V12.6h7.2c1.6,0,2.9,0.2,3.9,0.7s1.8,1.2,2.4,2.2c0.6,1,0.9,2.1,0.9,3.2
19
+ s-0.2,2.2-0.7,3.1s-1.3,1.7-2.3,2.3C200.5,24.6,199.3,24.9,197.8,24.9z M201.1,18.7c0-0.8-0.3-1.5-0.8-1.9c-0.5-0.5-1.1-0.7-1.7-0.7
20
+ h-5v5.4h5.2c0.7,0,1.2-0.2,1.7-0.7S201.1,19.6,201.1,18.7z M215.8,17.5c-0.7-1.3-1.8-1.9-3.2-2c-0.8,0-1.5,0.3-2.1,0.8
21
+ c-0.6,0.5-0.8,1.1-0.8,1.9c0,0.5,0.3,1,0.8,1.4s1.3,0.7,2.4,0.9c2.6,0.5,4.5,1.3,5.7,2.6c1.2,1.3,1.8,2.8,1.8,4.5
22
+ c0,1.9-0.7,3.5-2.1,5c-1.4,1.4-3.2,2.2-5.3,2.2c-3.3,0-5.8-1.7-7.4-5.1l3.3-1.7c1,2.1,2.4,3.2,4.2,3.2c1,0,1.9-0.3,2.7-1.1
23
+ c0.8-0.7,1.1-1.6,1.1-2.6c0-0.7-0.3-1.3-0.9-2c-0.6-0.7-1.7-1.1-3.2-1.4c-2.1-0.3-3.7-0.9-4.8-1.9s-1.7-2.1-1.7-3.5
24
+ c0-1.6,0.5-3.1,1.7-4.4c1.2-1.4,2.7-2,4.6-2c2.7,0.1,4.7,1.3,6,3.8L215.8,17.5z"/>
25
+ <path fill="#00994C" d="M35.3,42.6h6.2v0.7h-5.4v4.5h4.6v0.7h-4.6V54h-0.8V42.6z M43.1,45.7h0.7l0.1,1.5H44c0.6-1,1.4-1.8,2.4-1.8
26
+ c0.3,0,0.6,0,0.8,0.2L47,46.3c-0.3-0.1-0.4-0.1-0.8-0.1c-0.7,0-1.6,0.6-2.3,2.1V54h-0.8V45.7z M51.4,45.5c2,0,3.2,1.4,3.2,3.9
27
+ c0,0.2,0,0.4,0,0.6h-6c0,2.1,1.3,3.6,3.1,3.6c0.9,0,1.6-0.3,2.2-0.7l0.3,0.6c-0.7,0.4-1.4,0.8-2.6,0.8c-2.1,0-3.9-1.6-3.9-4.4
28
+ C47.7,47.1,49.5,45.5,51.4,45.5z M53.8,49.3c0-2.1-1-3.2-2.4-3.2s-2.7,1.2-2.9,3.2H53.8z M59.8,45.5c2,0,3.2,1.4,3.2,3.9
29
+ c0,0.2,0,0.4,0,0.6h-6c0,2.1,1.3,3.6,3.1,3.6c0.9,0,1.6-0.3,2.2-0.7l0.3,0.6c-0.7,0.4-1.4,0.8-2.6,0.8c-2.1,0-3.9-1.6-3.9-4.4
30
+ C56.1,47.1,57.9,45.5,59.8,45.5z M62.2,49.3c0-2.1-1-3.2-2.4-3.2s-2.7,1.2-2.9,3.2H62.2z M68.1,52.5c0.7,0.6,1.5,1.1,2.7,1.1
31
+ c1.3,0,2-0.8,2-1.7c0-1-1.1-1.5-2-1.8c-1.3-0.5-2.7-1-2.7-2.4c0-1.2,1-2.2,2.7-2.2c0.9,0,1.8,0.4,2.4,0.9l-0.4,0.5
32
+ c-0.6-0.4-1.1-0.7-2-0.7c-1.3,0-1.9,0.7-1.9,1.5c0,0.9,1,1.3,2,1.7c1.3,0.5,2.7,0.9,2.7,2.6c0,1.3-1,2.3-2.8,2.3
33
+ c-1.2,0-2.3-0.5-3.1-1.1L68.1,52.5z M75.9,46.3h-1.3v-0.6l1.3-0.1l0.1-2.4h0.7v2.4h2.4v0.7h-2.4v5.4c0,1.1,0.3,1.8,1.4,1.8
34
+ c0.3,0,0.7-0.1,1-0.3l0.2,0.6c-0.5,0.2-1,0.3-1.4,0.3c-1.6,0-2.1-1-2.1-2.5v-5.3H75.9z M80.8,57.1c1,0,1.7-0.9,2.1-2.2l0.2-0.7
35
+ l-3.4-8.5h0.8l2,5.2c0.3,0.7,0.6,1.6,0.9,2.3h0.1c0.3-0.7,0.5-1.6,0.8-2.3l1.8-5.2h0.8L83.6,55c-0.5,1.4-1.3,2.8-2.8,2.8
36
+ c-0.3,0-0.6-0.1-0.9-0.2l0.2-0.7C80.3,57,80.5,57.1,80.8,57.1z M88.7,41.5h0.8V53c0,0.4,0.2,0.5,0.4,0.5c0.1,0,0.1,0,0.3,0l0.1,0.6
37
+ c-0.2,0.1-0.3,0.1-0.6,0.1c-0.7,0-1-0.4-1-1.3C88.7,52.9,88.7,41.5,88.7,41.5z M95.7,45.5c2,0,3.2,1.4,3.2,3.9c0,0.2,0,0.4,0,0.6h-6
38
+ c0,2.1,1.3,3.6,3.1,3.6c0.9,0,1.6-0.3,2.2-0.7l0.3,0.6c-0.7,0.4-1.4,0.8-2.6,0.8c-2.1,0-3.9-1.6-3.9-4.4
39
+ C92.1,47.1,93.9,45.5,95.7,45.5z M98.2,49.3c0-2.1-1-3.2-2.4-3.2s-2.7,1.2-2.9,3.2H98.2z M100.6,52.5c0.7,0.6,1.5,1.1,2.7,1.1
40
+ c1.3,0,2-0.8,2-1.7c0-1-1.1-1.5-2-1.8c-1.3-0.5-2.7-1-2.7-2.4c0-1.2,1-2.2,2.7-2.2c0.9,0,1.8,0.4,2.4,0.9l-0.4,0.5
41
+ c-0.6-0.4-1.1-0.7-2-0.7c-1.3,0-1.9,0.7-1.9,1.5c0,0.9,1,1.3,2,1.7c1.3,0.5,2.7,0.9,2.7,2.6c0,1.3-1,2.3-2.8,2.3
42
+ c-1.2,0-2.3-0.5-3.1-1.1L100.6,52.5z M114.9,42.2c-0.3-0.2-0.7-0.2-1-0.2c-0.9,0-1.3,0.7-1.3,1.9v1.8h1.9v0.7h-1.9V54h-0.8v-7.7
43
+ h-1.1v-0.6l1.1-0.1v-1.9c0-1.6,0.7-2.5,2.1-2.5c0.4,0,0.8,0.1,1.2,0.3L114.9,42.2z M119.1,45.5c2,0,3.8,1.6,3.8,4.4
44
+ c0,2.8-1.7,4.4-3.8,4.4c-2,0-3.7-1.6-3.7-4.4S117.1,45.5,119.1,45.5z M119.1,53.5c1.7,0,3-1.5,3-3.7s-1.3-3.7-3-3.7
45
+ s-2.9,1.5-2.9,3.7S117.4,53.5,119.1,53.5z M125.3,45.7h0.7l0.1,1.5h0.1c0.6-1,1.4-1.8,2.4-1.8c0.3,0,0.6,0,0.8,0.2l-0.2,0.7
46
+ c-0.3-0.1-0.4-0.1-0.8-0.1c-0.7,0-1.6,0.6-2.3,2.1V54h-0.8L125.3,45.7L125.3,45.7z M138.6,42.3c1.5,0,2.5,0.7,3.1,1.4l-0.5,0.5
47
+ c-0.6-0.6-1.4-1.2-2.6-1.2c-2.6,0-4.2,2-4.2,5.2s1.5,5.2,4.2,5.2c1,0,2-0.3,2.6-0.9V49h-2.7v-0.7h3.5v4.5c-0.7,0.8-1.9,1.3-3.4,1.3
48
+ c-2.9,0-4.9-2.3-4.9-6C133.6,44.6,135.6,42.3,138.6,42.3z M147.3,45.5c2,0,3.8,1.6,3.8,4.4c0,2.8-1.7,4.4-3.8,4.4
49
+ c-2,0-3.7-1.6-3.7-4.4C143.5,47.1,145.3,45.5,147.3,45.5z M147.3,53.5c1.7,0,3-1.5,3-3.7s-1.3-3.7-3-3.7s-2.9,1.5-2.9,3.7
50
+ C144.3,52,145.6,53.5,147.3,53.5z M156.1,45.5c2,0,3.8,1.6,3.8,4.4c0,2.8-1.7,4.4-3.8,4.4c-2,0-3.7-1.6-3.7-4.4
51
+ C152.4,47.1,154.1,45.5,156.1,45.5z M156.1,53.5c1.7,0,3-1.5,3-3.7s-1.3-3.7-3-3.7s-2.9,1.5-2.9,3.7C153.2,52,154.4,53.5,156.1,53.5
52
+ z M162.5,53.7L162.5,53.7c-0.4-0.3-0.7-0.8-0.7-1.4c0-0.7,0.5-1.3,0.9-1.5v-0.1c-0.5-0.5-1-1.3-1-2.3c0-1.7,1.3-2.9,2.9-2.9
53
+ c0.5,0,0.8,0.1,1.1,0.2h2.8v0.6h-1.9c0.5,0.5,0.9,1.2,0.9,2.1c0,1.7-1.3,2.9-2.9,2.9c-0.5,0-1-0.1-1.4-0.3c-0.4,0.3-0.7,0.6-0.7,1.2
54
+ c0,0.6,0.3,1.1,1.6,1.1h1.8c1.9,0,2.7,0.6,2.7,1.9c0,1.4-1.5,2.8-3.9,2.8c-2.1,0-3.4-0.9-3.4-2.3C161.2,55,161.7,54.2,162.5,53.7z
55
+ M164.7,57.4c1.9,0,3.1-1.1,3.1-2.1c0-0.9-0.7-1.3-1.9-1.3h-1.8c-0.2,0-0.6,0-1-0.1c-0.8,0.5-1.1,1.2-1.1,1.8
56
+ C162,56.7,163,57.4,164.7,57.4z M166.7,48.4c0-1.4-1-2.3-2.2-2.3s-2.2,0.9-2.2,2.3c0,1.4,1,2.3,2.2,2.3S166.7,49.8,166.7,48.4z
57
+ M170.4,41.5h0.8V53c0,0.4,0.2,0.5,0.4,0.5c0.1,0,0.1,0,0.3,0l0.1,0.6c-0.2,0.1-0.3,0.1-0.6,0.1c-0.7,0-1-0.4-1-1.3V41.5z
58
+ M177.4,45.5c2,0,3.2,1.4,3.2,3.9c0,0.2,0,0.4,0,0.6h-6c0,2.1,1.3,3.6,3.1,3.6c0.9,0,1.6-0.3,2.2-0.7l0.3,0.6
59
+ c-0.7,0.4-1.4,0.8-2.6,0.8c-2.1,0-3.9-1.6-3.9-4.4C173.8,47.1,175.6,45.5,177.4,45.5z M179.9,49.3c0-2.1-1-3.2-2.4-3.2
60
+ s-2.7,1.2-2.9,3.2H179.9z M186.4,42.6h1.1l2.4,6.7l0.9,2.5h0.1l0.9-2.5l2.4-6.7h1.1V54h-0.8v-7.5c0-0.9,0.1-2.1,0.1-3.1h-0.1
61
+ l-0.9,2.5l-2.5,6.8h-0.7l-2.5-6.8l-0.9-2.5l0,0c0,1,0.1,2.2,0.1,3.1V54h-0.7L186.4,42.6L186.4,42.6z M202.5,48.8
62
+ c0-1.3-0.3-2.6-2-2.6c-1.1,0-2.1,0.6-2.7,1l-0.3-0.6c0.6-0.4,1.7-1.1,3.1-1.1c2,0,2.6,1.4,2.6,3.2V54h-0.6l-0.1-1.1l0,0
63
+ c-0.9,0.7-1.9,1.3-3,1.3c-1.3,0-2.4-0.7-2.4-2.3C197.1,50.1,198.8,49.2,202.5,48.8z M199.7,53.5c1,0,1.8-0.5,2.8-1.4v-2.8
64
+ c-3.4,0.4-4.6,1.2-4.6,2.5S198.7,53.5,199.7,53.5z M206.6,54.7v3h-0.8v-12h0.7l0.1,1h0.1c0.8-0.6,1.8-1.3,2.8-1.3
65
+ c2.2,0,3.3,1.7,3.3,4.3c0,2.8-1.7,4.5-3.7,4.5c-0.8,0-1.6-0.4-2.5-1L206.6,54.7L206.6,54.7z M209.1,53.5c1.7,0,2.9-1.6,2.9-3.8
66
+ c0-2-0.7-3.6-2.6-3.6c-0.8,0-1.7,0.5-2.7,1.4v4.9C207.5,53.2,208.4,53.5,209.1,53.5z M214.7,52.5c0.7,0.6,1.5,1.1,2.7,1.1
67
+ c1.3,0,2-0.8,2-1.7c0-1-1.1-1.5-2-1.8c-1.3-0.5-2.7-1-2.7-2.4c0-1.2,1-2.2,2.7-2.2c0.9,0,1.8,0.4,2.4,0.9l-0.4,0.5
68
+ c-0.6-0.4-1.1-0.7-2-0.7c-1.3,0-1.9,0.7-1.9,1.5c0,0.9,1,1.3,2,1.7c1.3,0.5,2.7,0.9,2.7,2.6c0,1.3-1,2.3-2.8,2.3
69
+ c-1.2,0-2.3-0.5-3.1-1.1L214.7,52.5z"/>
70
+ </svg>
admin/images/mail.svg ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="32px" height="32px" viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve">
6
+ <path fill="#00BC66" d="M2.5,8.3c0.8,0.4,11.6,6.2,12,6.4C15,14.9,15.5,15,16,15c0.5,0,1-0.1,1.5-0.3c0.4-0.2,11.2-6,12-6.4
7
+ c0.8-0.4,1.5-1.7,0.1-1.7H2.5C1,6.5,1.8,7.8,2.5,8.3L2.5,8.3z M29.8,11.5c-0.9,0.5-11.8,6.2-12.3,6.4s-0.9,0.3-1.5,0.3
8
+ c-0.5,0-0.9,0-1.4-0.3s-11.4-6-12.3-6.4c-0.6-0.3-0.6,0.1-0.6,0.4s0,11.7,0,11.7c0,0.7,0.9,1.5,1.6,1.5h25.6c0.7,0,1.6-0.9,1.6-1.5
9
+ c0,0,0-11.4,0-11.7C30.4,11.5,30.4,11.1,29.8,11.5z"/>
10
+ </svg>
admin/images/star.svg ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generated by IcoMoon.io -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32" viewBox="0 0 32 32">
5
+ <path d="M16 0.934l3.759 11.523h12.248l-9.925 7.089 3.81 11.52-9.893-7.146-9.894 7.146 3.811-11.52-9.925-7.089h12.248l3.76-11.523z" fill="#000000"></path>
6
+ </svg>
admin/images/twitter.svg ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="32px" height="32px" viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve">
6
+ <path fill="#00BC66" d="M32,6.1c-1.2,0.5-2.4,0.9-3.8,1c1.4-0.8,2.4-2.1,2.9-3.6c-1.3,0.8-2.7,1.3-4.2,1.6C25.7,3.8,24,3,22.2,3
7
+ c-3.6,0-6.6,2.9-6.6,6.6c0,0.5,0.1,1,0.2,1.5C10.3,10.8,5.5,8.2,2.2,4.2c-0.6,1-0.9,2.1-0.9,3.3c0,2.3,1.2,4.3,2.9,5.5
8
+ c-1.1,0-2.1-0.3-3-0.8c0,0,0,0.1,0,0.1c0,3.2,2.3,5.8,5.3,6.4c-0.6,0.1-1.1,0.2-1.7,0.2c-0.4,0-0.8,0-1.2-0.1
9
+ c0.8,2.6,3.3,4.5,6.1,4.6c-2.2,1.8-5.1,2.8-8.2,2.8c-0.5,0-1.1,0-1.6-0.1c2.9,1.9,6.4,3,10.1,3c12.1,0,18.7-10,18.7-18.7
10
+ c0-0.3,0-0.6,0-0.8C30,8.5,31.1,7.4,32,6.1L32,6.1z"/>
11
+ </svg>
admin/index.css ADDED
@@ -0,0 +1 @@
 
1
+ .container{margin-right:auto;margin-left:auto;padding-left:10px;padding-right:10px}.container:before,.container:after{content:" ";display:table}.container:after{clear:both}@media (min-width: 768px){.container{width:750px;}}@media (min-width: 992px){.container{width:970px;}}@media (min-width: 1200px){.container{width:1170px;}}.container-fluid{margin-right:auto;margin-left:auto;padding-left:10px;padding-right:10px}.container-fluid:before,.container-fluid:after{content:" ";display:table}.container-fluid:after{clear:both}.row{margin-left:-10px;margin-right:-10px}.row:before,.row:after{content:" ";display:table}.row:after{clear:both}.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12{position:relative;min-height:1px;padding-left:10px;padding-right:10px}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12{float:left}.col-xs-1{width:8.333333333%}.col-xs-2{width:16.666666667%}.col-xs-3{width:25%}.col-xs-4{width:33.333333333%}.col-xs-5{width:41.666666667%}.col-xs-6{width:50%}.col-xs-7{width:58.333333333%}.col-xs-8{width:66.666666667%}.col-xs-9{width:75%}.col-xs-10{width:83.333333333%}.col-xs-11{width:91.666666667%}.col-xs-12{width:100%}.col-xs-pull-0{right:auto}.col-xs-pull-1{right:8.333333333%}.col-xs-pull-2{right:16.666666667%}.col-xs-pull-3{right:25%}.col-xs-pull-4{right:33.333333333%}.col-xs-pull-5{right:41.666666667%}.col-xs-pull-6{right:50%}.col-xs-pull-7{right:58.333333333%}.col-xs-pull-8{right:66.666666667%}.col-xs-pull-9{right:75%}.col-xs-pull-10{right:83.333333333%}.col-xs-pull-11{right:91.666666667%}.col-xs-pull-12{right:100%}.col-xs-push-0{left:auto}.col-xs-push-1{left:8.333333333%}.col-xs-push-2{left:16.666666667%}.col-xs-push-3{left:25%}.col-xs-push-4{left:33.333333333%}.col-xs-push-5{left:41.666666667%}.col-xs-push-6{left:50%}.col-xs-push-7{left:58.333333333%}.col-xs-push-8{left:66.666666667%}.col-xs-push-9{left:75%}.col-xs-push-10{left:83.333333333%}.col-xs-push-11{left:91.666666667%}.col-xs-push-12{left:100%}.col-xs-offset-0{margin-left:0%}.col-xs-offset-1{margin-left:8.333333333%}.col-xs-offset-2{margin-left:16.666666667%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-4{margin-left:33.333333333%}.col-xs-offset-5{margin-left:41.666666667%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-7{margin-left:58.333333333%}.col-xs-offset-8{margin-left:66.666666667%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-10{margin-left:83.333333333%}.col-xs-offset-11{margin-left:91.666666667%}.col-xs-offset-12{margin-left:100%}@media (min-width: 768px){.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12{float:left}.col-sm-1{width:8.333333333%}.col-sm-2{width:16.666666667%}.col-sm-3{width:25%}.col-sm-4{width:33.333333333%}.col-sm-5{width:41.666666667%}.col-sm-6{width:50%}.col-sm-7{width:58.333333333%}.col-sm-8{width:66.666666667%}.col-sm-9{width:75%}.col-sm-10{width:83.333333333%}.col-sm-11{width:91.666666667%}.col-sm-12{width:100%}.col-sm-pull-0{right:auto}.col-sm-pull-1{right:8.333333333%}.col-sm-pull-2{right:16.666666667%}.col-sm-pull-3{right:25%}.col-sm-pull-4{right:33.333333333%}.col-sm-pull-5{right:41.666666667%}.col-sm-pull-6{right:50%}.col-sm-pull-7{right:58.333333333%}.col-sm-pull-8{right:66.666666667%}.col-sm-pull-9{right:75%}.col-sm-pull-10{right:83.333333333%}.col-sm-pull-11{right:91.666666667%}.col-sm-pull-12{right:100%}.col-sm-push-0{left:auto}.col-sm-push-1{left:8.333333333%}.col-sm-push-2{left:16.666666667%}.col-sm-push-3{left:25%}.col-sm-push-4{left:33.333333333%}.col-sm-push-5{left:41.666666667%}.col-sm-push-6{left:50%}.col-sm-push-7{left:58.333333333%}.col-sm-push-8{left:66.666666667%}.col-sm-push-9{left:75%}.col-sm-push-10{left:83.333333333%}.col-sm-push-11{left:91.666666667%}.col-sm-push-12{left:100%}.col-sm-offset-0{margin-left:0%}.col-sm-offset-1{margin-left:8.333333333%}.col-sm-offset-2{margin-left:16.666666667%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-4{margin-left:33.333333333%}.col-sm-offset-5{margin-left:41.666666667%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-7{margin-left:58.333333333%}.col-sm-offset-8{margin-left:66.666666667%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-10{margin-left:83.333333333%}.col-sm-offset-11{margin-left:91.666666667%}.col-sm-offset-12{margin-left:100%}}@media (min-width: 992px){.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12{float:left}.col-md-1{width:8.333333333%}.col-md-2{width:16.666666667%}.col-md-3{width:25%}.col-md-4{width:33.333333333%}.col-md-5{width:41.666666667%}.col-md-6{width:50%}.col-md-7{width:58.333333333%}.col-md-8{width:66.666666667%}.col-md-9{width:75%}.col-md-10{width:83.333333333%}.col-md-11{width:91.666666667%}.col-md-12{width:100%}.col-md-pull-0{right:auto}.col-md-pull-1{right:8.333333333%}.col-md-pull-2{right:16.666666667%}.col-md-pull-3{right:25%}.col-md-pull-4{right:33.333333333%}.col-md-pull-5{right:41.666666667%}.col-md-pull-6{right:50%}.col-md-pull-7{right:58.333333333%}.col-md-pull-8{right:66.666666667%}.col-md-pull-9{right:75%}.col-md-pull-10{right:83.333333333%}.col-md-pull-11{right:91.666666667%}.col-md-pull-12{right:100%}.col-md-push-0{left:auto}.col-md-push-1{left:8.333333333%}.col-md-push-2{left:16.666666667%}.col-md-push-3{left:25%}.col-md-push-4{left:33.333333333%}.col-md-push-5{left:41.666666667%}.col-md-push-6{left:50%}.col-md-push-7{left:58.333333333%}.col-md-push-8{left:66.666666667%}.col-md-push-9{left:75%}.col-md-push-10{left:83.333333333%}.col-md-push-11{left:91.666666667%}.col-md-push-12{left:100%}.col-md-offset-0{margin-left:0%}.col-md-offset-1{margin-left:8.333333333%}.col-md-offset-2{margin-left:16.666666667%}.col-md-offset-3{margin-left:25%}.col-md-offset-4{margin-left:33.333333333%}.col-md-offset-5{margin-left:41.666666667%}.col-md-offset-6{margin-left:50%}.col-md-offset-7{margin-left:58.333333333%}.col-md-offset-8{margin-left:66.666666667%}.col-md-offset-9{margin-left:75%}.col-md-offset-10{margin-left:83.333333333%}.col-md-offset-11{margin-left:91.666666667%}.col-md-offset-12{margin-left:100%}}@media (min-width: 1200px){.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12{float:left}.col-lg-1{width:8.333333333%}.col-lg-2{width:16.666666667%}.col-lg-3{width:25%}.col-lg-4{width:33.333333333%}.col-lg-5{width:41.666666667%}.col-lg-6{width:50%}.col-lg-7{width:58.333333333%}.col-lg-8{width:66.666666667%}.col-lg-9{width:75%}.col-lg-10{width:83.333333333%}.col-lg-11{width:91.666666667%}.col-lg-12{width:100%}.col-lg-pull-0{right:auto}.col-lg-pull-1{right:8.333333333%}.col-lg-pull-2{right:16.666666667%}.col-lg-pull-3{right:25%}.col-lg-pull-4{right:33.333333333%}.col-lg-pull-5{right:41.666666667%}.col-lg-pull-6{right:50%}.col-lg-pull-7{right:58.333333333%}.col-lg-pull-8{right:66.666666667%}.col-lg-pull-9{right:75%}.col-lg-pull-10{right:83.333333333%}.col-lg-pull-11{right:91.666666667%}.col-lg-pull-12{right:100%}.col-lg-push-0{left:auto}.col-lg-push-1{left:8.333333333%}.col-lg-push-2{left:16.666666667%}.col-lg-push-3{left:25%}.col-lg-push-4{left:33.333333333%}.col-lg-push-5{left:41.666666667%}.col-lg-push-6{left:50%}.col-lg-push-7{left:58.333333333%}.col-lg-push-8{left:66.666666667%}.col-lg-push-9{left:75%}.col-lg-push-10{left:83.333333333%}.col-lg-push-11{left:91.666666667%}.col-lg-push-12{left:100%}.col-lg-offset-0{margin-left:0%}.col-lg-offset-1{margin-left:8.333333333%}.col-lg-offset-2{margin-left:16.666666667%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-4{margin-left:33.333333333%}.col-lg-offset-5{margin-left:41.666666667%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-7{margin-left:58.333333333%}.col-lg-offset-8{margin-left:66.666666667%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-10{margin-left:83.333333333%}.col-lg-offset-11{margin-left:91.666666667%}.col-lg-offset-12{margin-left:100%}}.sm-plugin .box-shadow-cell,.sm-plugin h2.nav-tab-wrapper,.sm-plugin h3.nav-tab-wrapper,.sm-plugin .sm-style{background-color:white;border:1px solid #e5e5e5;-webkit-box-shadow:0 1px 1px -1px rgba(0,0,0,0.1);box-shadow:0 1px 1px -1px rgba(0,0,0,0.1)}.sm-plugin *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.sm-plugin .clearfix:after{content:'';display:table;clear:both}.sm-plugin .button-error{background-color:#e74c3c;border-color:#d62c1a;color:white;-webkit-box-shadow:inset 0 1px 0 #ed7669,0 1px 0 rgba(0,0,0,0.08);box-shadow:inset 0 1px 0 #ed7669,0 1px 0 rgba(0,0,0,0.08)}.sm-plugin .button-error:hover,.sm-plugin .button-error:focus{background-color:#df2e1b;border-color:#d62c1a;color:white}.sm-plugin .welcome-panel{position:relative;margin-top:16px;margin-bottom:10px;padding:23px}.sm-plugin .welcome-box-close{position:absolute;top:0;right:0;padding:10px;opacity:0.6;-webkit-transition:opacity 0.15s ease;-o-transition:opacity 0.15s ease;transition:opacity 0.15s ease}.sm-plugin .welcome-box-close:hover,.sm-plugin .welcome-box-close:focus,.sm-plugin .welcome-box-close:active{opacity:1}.sm-plugin .footer{margin-top:20px;padding-top:20px;border-top:1px solid #e5e5e5}.sm-plugin .footer a{opacity:0.75;filter:alpha(opacity=75);-webkit-transition:opacity 0.15s ease;-o-transition:opacity 0.15s ease;transition:opacity 0.15s ease}.sm-plugin .footer a:hover,.sm-plugin .footer a:focus,.sm-plugin .footer a:active{opacity:1;filter:alpha(opacity=100);-webkit-box-shadow:none;box-shadow:none}.sm-plugin .footer .icon-brand{width:180px;height:55px;margin-right:20px}.sm-plugin .footer .social{display:inline-block;margin-top:5px;margin-bottom:5px;vertical-align:middle}.sm-plugin .footer .social a{position:relative;width:20px;height:20px;margin:10px;float:left}.sm-plugin .footer .social a:after{content:'';display:block;position:absolute;top:-10px;right:-10px;bottom:-10px;left:-10px}.sm-plugin h2.nav-tab-wrapper,.sm-plugin h3.nav-tab-wrapper{display:inline-block;width:100%;margin-top:16px;margin-bottom:16px;padding:5px 10px}.sm-plugin .nav-tab{padding:10px;background-color:transparent;border:none;color:#0074a2;font-weight:normal}.sm-plugin .nav-tab:focus{-webkit-box-shadow:none;box-shadow:none}.sm-plugin .nav-tab-active,.sm-plugin .nav-tab-active:hover{background-color:white;border:none;color:#333;font-weight:bold}.sm-plugin .nav-tab-container{margin-top:0;margin-left:0}.sm-plugin .tablenav{height:auto}.sm-plugin .tablenav .alignleft{width:100%}.sm-plugin .tablenav select{width:100%}.sm-plugin .tablenav.bottom{margin-top:-10px}.sm-plugin .tablenav a.disabled{color:lightgray;pointer-events:none;cursor:default}.sm-plugin .nothing{margin-top:80px;margin-bottom:80px;text-align:center}.sm-plugin .nothing p{font-size:18px;color:#999}.sm-plugin .tablenav-pages{margin-top:20px;text-align:center}@media (min-width: 783px){.sm-plugin .tablenav{margin-bottom:20px}.sm-plugin .tablenav .alignleft{width:auto}.sm-plugin .tablenav select{width:auto}.sm-plugin .tablenav.top.row{margin-left:-10px;margin-right:-10px}.sm-plugin .tablenav-pages{margin-top:0;text-align:right}}.sm-plugin .sm-style{position:relative;margin-bottom:20px}.sm-plugin .sm-map{position:relative;width:100%;height:250px;overflow:hidden;border:1px solid #f0f0f0}.sm-plugin .sm-map img{display:block;position:absolute;top:50%;left:50%;z-index:1;-webkit-transform:translate(-50%, -50%);-ms-transform:translate(-50%, -50%);-o-transform:translate(-50%, -50%);transform:translate(-50%, -50%)}.sm-plugin .sm-map .overlay-icon{display:block;position:absolute;top:0;left:0;width:0;height:0;z-index:2;border-top:36px solid rgba(46,162,204,0.85);border-left:36px solid rgba(46,162,204,0.85);border-right:36px solid transparent;border-bottom:36px solid transparent}.sm-plugin .sm-map [class*="icon-"]{position:absolute;top:-26px;left:-26px;width:24px;height:24px}.sm-plugin .sm-content{margin-top:-1px;padding:20px;border:1px solid #f0f0f0}.sm-plugin .sm-content h3{margin:0;font-weight:normal}.sm-plugin .sm-content .author{margin-bottom:4px}.sm-plugin .sm-content .button{margin-top:10px}.sm-plugin .sm-content .views,.sm-plugin .sm-content .favorites{display:block}.sm-plugin .sm-content [class*="icon-"]{width:13px;height:13px;margin-right:4px;margin-bottom:4px;opacity:0.7;filter:alpha(opacity=70)}.sm-plugin .api-form{display:inline-block;margin-bottom:20px;padding:20px}.sm-plugin .api-form>*{vertical-align:middle}@media (min-width: 600px) and (max-width: 767px){.sm-plugin .sm-map{width:50%;left:50%;border-left:none}.sm-plugin .sm-content{position:absolute;top:0;left:0;width:50%;height:100%;margin-top:0}}.sm-plugin [class*="icon-"]{display:inline-block;width:16px;height:16px;background-color:transparent;background-position:center;background-repeat:no-repeat;background-size:100%;vertical-align:middle}.sm-plugin .icon-star{background-image:url(images/star.svg)}.sm-plugin .icon-eye{background-image:url(images/eye.svg)}.sm-plugin .icon-googleplus{background-image:url(images/googleplus.svg)}.sm-plugin .icon-facebook{background-image:url(images/facebook.svg)}.sm-plugin .icon-twitter{background-image:url(images/twitter.svg)}.sm-plugin .icon-mail{background-image:url(images/mail.svg)}.sm-plugin .icon-checkmark{background-image:url(images/checkmark.svg)}.sm-plugin .icon-brand{background-image:url(images/logo-snazzymaps.svg)}.sm-plugin .icon-close{background-image:url(images/close.svg)}
admin/index.js ADDED
@@ -0,0 +1,184 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function($){
2
+
3
+ var showError = function(message){
4
+ $(".search-error").html(message).show();
5
+ $(".results").hide();
6
+ $(".tablenav-pages").hide();
7
+ }
8
+ var hideError = function(){
9
+ $(".search-error").hide();
10
+ $(".results").show();
11
+ $(".tablenav-pages").show();
12
+ }
13
+
14
+ //Style list with pagination and filtering
15
+ var refreshExplore = function(){
16
+ var params = queryString.parse(location.search);
17
+ var data = {};
18
+ data['pageSize'] = 12;
19
+ data['page'] = params.ppage;
20
+ data['sort'] = params.sort;
21
+ data['color'] = params.color;
22
+ data['tag'] = params.tag;
23
+
24
+ var endPoint = '';
25
+ if(params.type == 'my-styles'){
26
+ endPoint = 'my-styles.json';
27
+ data['key'] = USER_API_KEY;
28
+ if(USER_API_KEY == null){
29
+ showError('<p>You need to add your API key in the <a href="?page=snazzy_maps&tab=2">Settings</a> tab.</p>');
30
+ return;
31
+ }
32
+
33
+ }else if(params.type == 'my-favorites'){
34
+ endPoint = 'favorites.json';
35
+ data['key'] = USER_API_KEY;
36
+ if(USER_API_KEY == null){
37
+ showError('<p>You need to add your API key in the <a href="?page=snazzy_maps&tab=2">Settings</a> tab.</p>');
38
+ return;
39
+ }
40
+ }
41
+ else{
42
+ endPoint = 'explore.json';
43
+ data['key'] = API_KEY;
44
+ $('.missing-api-key').hide();
45
+ $('.results').show();
46
+ $('.pagination').show();
47
+ }
48
+
49
+
50
+ var failedTimeout = setTimeout(function(){
51
+ showError("<p>Oops, it seems that Snazzy Maps is temporarily down or your API key is incorrect.</p>");
52
+ }, 3000);
53
+ $.ajax({
54
+ url: API_BASE + endPoint,
55
+ jsonp: 'callback',
56
+ data: data,
57
+ dataType: 'jsonp',
58
+ success: function(response) {
59
+ clearTimeout(failedTimeout);
60
+
61
+ if('statusCode' in response && response['statusCode'] != 200){
62
+ showError("<p>Oops, it seems that Snazzy Maps is temporarily down or your API key is incorrect.</p>");
63
+ }else{
64
+ updatePagination(response['pagination']);
65
+ renderStyles($('#explore-list').find('.results'), response['styles']);
66
+ }
67
+ },
68
+ error: function(response){
69
+ clearTimeout(failedTimeout);
70
+ showError("<p>Oops, it seems that Snazzy Maps is temporarily down or your API key is incorrect.</p>");
71
+ }
72
+ });
73
+
74
+ //JSONP doesn't support native jQuery errors
75
+ };
76
+
77
+ var styleTemplate = $('#style-template').html();
78
+ var renderStyles = function(container, styles){
79
+ container.html('');
80
+ $.each(styles, function(i,style){
81
+ var data = {
82
+ name: style['name'],
83
+ imageUrl: style['imageUrl'],
84
+ url: style['url'],
85
+ author: style['createdBy']['name'],
86
+ views: style['views'],
87
+ favorites: style['favorites']
88
+ };
89
+
90
+ //Add to the last row
91
+ container.append($(Mustache.to_html(styleTemplate, data)).data('style', style));
92
+ });
93
+ };
94
+
95
+ History.Adapter.bind(window,'statechange', function(){
96
+ refreshExplore();
97
+ });
98
+ $(window).trigger('statechange');
99
+
100
+ //An easy way to replace the GET parameters and also replace the state at the same time
101
+ var replaceGET = function(params){
102
+ var oldParams = queryString.parse(location.search);
103
+ for(var key in params)
104
+ {
105
+ oldParams[key] = params[key];
106
+ }
107
+ History.replaceState(oldParams, document.title, '?' + queryString.stringify(oldParams));
108
+ };
109
+
110
+ $(document).on('change', '#explore-list select', function(){
111
+ var q = {};
112
+ q[this.name] = $(this).val();
113
+ q['ppage'] = 1; //Reset the page number because we are changing the results
114
+ replaceGET(q);
115
+ });
116
+
117
+ $(document).on('submit', '.style', function(){
118
+ $(this).find('input[name="new_style"]')
119
+ .val($.base64.encode(JSON.stringify($(this).data('style'))));
120
+ });
121
+
122
+ //Pagination
123
+ $(document).on('click', '.tablenav-pages a', function(){
124
+ replaceGET({ ppage: $(this).data('page') });
125
+ return false;
126
+ });
127
+
128
+ $(document).on('change', '.current-page', function(){
129
+
130
+ var start = $('.first-page').data('page');
131
+ var end = $('.last-page').data('page');
132
+ var page = parseInt($(this).val(), 10);
133
+ if ($(this).val() == page && page >= start && page <= end){
134
+ replaceGET({ ppage: page });
135
+ }
136
+ });
137
+
138
+ var updatePagination = function (options){
139
+
140
+ var page = options['currentPage'];
141
+
142
+ if(options['totalItems'] == 0){
143
+ showError('<p>No styles were found matching your current filters. Try widening your search a bit!</p>');
144
+ return;
145
+ }
146
+ else{
147
+ hideError();
148
+ }
149
+
150
+ $('.first-page').toggleClass('disabled', options['currentPage'] <= 1);
151
+ $('.first-page').data('page', 1);
152
+
153
+ $('.prev-page').toggleClass('disabled', options['currentPage'] <= 1);
154
+ $('.prev-page').data('page', options['currentPage']*1 - 1);
155
+
156
+ $('.next-page').toggleClass('disabled', options['currentPage'] >= options['totalPages']);
157
+ $('.next-page').data('page', options['currentPage']*1 + 1);
158
+
159
+ $('.last-page').toggleClass('disabled', options['currentPage'] >= options['totalPages']);
160
+ $('.last-page').data('page', options['totalPages']);
161
+
162
+ if(options['totalItems'] > 1){
163
+ $('.tablenav-pages .displaying-num').html(options['totalItems'] + ' items');
164
+ }
165
+ else if(options['totalItems'] == 1){
166
+ $('.tablenav-pages .displaying-num').html('1 item');
167
+ }
168
+ else{
169
+ $('.tablenav-pages .displaying-num').html('0 items');
170
+ }
171
+
172
+ $('.tablenav-pages .total-pages').html(options['totalPages']);
173
+ if(options['totalPages'] > 0){
174
+ $('.current-page').val(options['currentPage']);
175
+ $('.current-page').prop('disabled', false);
176
+ }
177
+ else{
178
+ $('.current-page').val(0);
179
+ $('.current-page').prop('disabled', true);
180
+ }
181
+
182
+ }
183
+ });
184
+
admin/index.php ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) OR exit;
3
+
4
+
5
+
6
+ include(plugin_dir_path(__FILE__) . DIRECTORY_SEPARATOR . 'styles.php');
7
+ include(plugin_dir_path(__FILE__) . DIRECTORY_SEPARATOR . 'explore.php');
8
+ include(plugin_dir_path(__FILE__) . DIRECTORY_SEPARATOR . 'settings.php');
9
+ include(plugin_dir_path(__FILE__) . DIRECTORY_SEPARATOR . 'help.php');
10
+
11
+
12
+ function admin_perform_post (){
13
+ if($_SERVER['REQUEST_METHOD'] === 'POST'){
14
+
15
+ //Perform the post for the tab that was selected
16
+ $active_tab = isset($_GET['tab']) ? $_GET['tab'] : null;
17
+
18
+ if($active_tab == 0){ admin_styles_head(0); }
19
+ if($active_tab == 1){ admin_explore_head(1); }
20
+ if($active_tab == 2){ admin_my_snazzymaps_head(2); }
21
+ if($active_tab == 3){ admin_help_head(3); }
22
+
23
+ //Redirect to the next page
24
+ header('Location: '. $_SERVER['REQUEST_URI']);
25
+ exit();
26
+ }
27
+ }
28
+
29
+ function admin_enqueue_script($hook){
30
+
31
+ //Only include the javascript in our page
32
+ if($hook != 'appearance_page_snazzy_maps') return;
33
+
34
+ //Include the javascript
35
+ $handle = 'admin-snazzymaps-js';
36
+ echo wp_register_script($handle, plugins_url('index.js', __FILE__), array('jquery'));
37
+ echo wp_enqueue_script($handle, $deps = array('jquery'));
38
+ wp_localize_script($handle, 'API_KEY', API_KEY);
39
+ wp_localize_script($handle, 'API_BASE', API_BASE);
40
+ wp_localize_script($handle, 'USER_API_KEY', get_option('MySnazzyAPIKey', null));
41
+
42
+ //Include the node modules
43
+ $node_modules = array(
44
+ 'query-string' . DIRECTORY_SEPARATOR . 'query-string.js',
45
+ 'mustache' . DIRECTORY_SEPARATOR . 'mustache.min.js'
46
+ );
47
+ foreach($node_modules as $index => $node_module){
48
+ $handle = "admin-node-module-$index";
49
+ echo wp_register_script($handle,
50
+ resourceURL('node_modules' . DIRECTORY_SEPARATOR . $node_module));
51
+ echo wp_enqueue_script($handle);
52
+ }
53
+
54
+ //Include the bower components
55
+ $bower_components = array(
56
+ 'history.js' . DIRECTORY_SEPARATOR . 'scripts' .
57
+ DIRECTORY_SEPARATOR . 'bundled' . DIRECTORY_SEPARATOR . 'html5' .
58
+ DIRECTORY_SEPARATOR . 'native.history.js'
59
+ );
60
+ foreach($bower_components as $index => $bower_component){
61
+ $handle = "admin-bower-component-$index";
62
+ echo wp_register_script($handle,
63
+ resourceURL('bower_components' . DIRECTORY_SEPARATOR . $bower_component));
64
+ echo wp_enqueue_script($handle);
65
+ }
66
+
67
+
68
+ //Include additional javascript
69
+ $additional_js = array('jquery.base64.min.js');
70
+ foreach($additional_js as $index => $js){
71
+ $handle = "additional-js-$index";
72
+ echo wp_register_script($handle, resourceURL('additional_js' . DIRECTORY_SEPARATOR . $js));
73
+ echo wp_enqueue_script($handle);
74
+ }
75
+
76
+ //Include the css
77
+ wp_enqueue_style('admin-snazzymaps-css', plugins_url('index.css', __FILE__));
78
+ }
79
+
80
+ function admin_add_custom_content(){
81
+ $active_tab = isset($_GET['tab']) ? $_GET['tab'] : '0';
82
+
83
+ if(isset($_GET['welcome'])) {
84
+ update_option('HideWelcomeMessage', $_GET['welcome'] == 'hide');
85
+ }
86
+ ?>
87
+ <div class="wrap sm-plugin">
88
+ <h2>Snazzy Maps</h2>
89
+ <script id="style-template" type="text/template">
90
+ <form action="?page=snazzy_maps&tab=0" method="POST" class="col-sm-6 col-md-4 style">
91
+ <div class="sm-style">
92
+ <div class="sm-map">
93
+ <img src="{{imageUrl}}" alt="{{name}}"/>
94
+ </div>
95
+ <div class="sm-content info">
96
+ <h3><a href="{{url}}" class="title" target="_blank" title="Check out {{name}} on Snazzy Maps">{{name}}</a></h3>
97
+ <div class="author">by {{author}}</div>
98
+ <div class="stats">
99
+ <div class="views"><span class="icon-eye" title="Views"></span>{{views}}</div>
100
+ <div class="favorites"><span class="icon-star" title="Favorites"></span>{{favorites}} favorites</div>
101
+ </div>
102
+ <button class="button button-primary button-large" type="submit">SAVE STYLE</button>
103
+ <input type="hidden" name="new_style" value=""/>
104
+ </div>
105
+ </div>
106
+ </form>
107
+ </script>
108
+ <?php if(!get_option('HideWelcomeMessage', false)) { ?>
109
+ <div id="welcome-panel" class="box-shadow-cell welcome-panel">
110
+ <a href="?page=snazzy_maps&tab=<?php echo $active_tab; ?>&welcome=hide" class="welcome-panel-close">Dismiss</a>
111
+ <div class="row">
112
+ <div class="col-md-10 col-lg-6">
113
+ <h3>Welcome!</h3>
114
+ <p>
115
+ Thanks for installing the Snazzy Maps plugin! <a href="?page=snazzy_maps&tab=1">Explore</a> some styles to get started
116
+ or check out the <a href="?page=snazzy_maps&tab=3">Help</a> page for detailed instructions and frequently asked questions.
117
+ </p>
118
+ </div>
119
+ </div>
120
+ </div>
121
+ <?php } ?>
122
+ <div class="row">
123
+ <div class="nav-tab-container col-md-12">
124
+ <h2 class="nav-tab-wrapper">
125
+ <?php
126
+ $tabs = array('Site Styles', 'Explore', 'Settings', 'Help');
127
+ foreach($tabs as $index => $tab){
128
+ ?>
129
+ <a href="?page=snazzy_maps&tab=<?php echo $index;?>"
130
+ class="nav-tab <?php echo $active_tab == $index ? 'nav-tab-active' : '';?>">
131
+ <?php echo $tab;?>
132
+ </a>
133
+ <?php
134
+ }
135
+ ?>
136
+ </h2>
137
+ <?php if($active_tab == 0) { admin_styles_tab(0); } ?>
138
+ <?php if($active_tab == 1) { admin_explore_tab(1); } ?>
139
+ <?php if($active_tab == 2) { admin_my_snazzymaps_tab(2); } ?>
140
+ <?php if($active_tab == 3) { admin_help_tab(3); } ?>
141
+ </div>
142
+ </div>
143
+ <div class="footer">
144
+ <div class="container-fluid">
145
+ <a href="https://snazzymaps.com/" class="icon-brand" target="_blank"></a>
146
+ <div class="social clearfix">
147
+ <a href="https://twitter.com/snazzymaps" class="icon-twitter" target="_blank"></a>
148
+ <a href="https://www.facebook.com/SnazzyMaps" class="icon-facebook" target="_blank"></a>
149
+ <a href="https://google.com/+SnazzyMaps" class="icon-googleplus" target="_blank"></a>
150
+ <a href="mailto:support@snazzymaps.com" class="icon-mail" target="_blank"></a>
151
+ </div>
152
+ </div>
153
+ </div>
154
+ </div>
155
+ <?php } ?>
admin/settings.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) OR exit;
3
+
4
+
5
+
6
+ function admin_my_snazzymaps_head($tab){
7
+ if(isset($_POST['api_key'])){
8
+ update_option('MySnazzyAPIKey', $_POST['api_key']);
9
+ }
10
+ }
11
+
12
+ function admin_my_snazzymaps_tab($tab){
13
+ if(isset($_GET['action']) && $_GET['action'] == 'delete_key'){
14
+ delete_option('MySnazzyAPIKey');
15
+ }
16
+ $api_key = get_option('MySnazzyAPIKey', null);
17
+ ?>
18
+
19
+ <div class="message row">
20
+ <div class="col-md-8">
21
+ <h3>API Key</h3>
22
+ <p>
23
+ If you have a <a href="https://snazzymaps.com" target="_blank">Snazzy Maps</a> account you can access your favorites and private styles from within the plugin.
24
+ Sign up for an <a href="https://snazzymaps.com/account/developer" target="_blank">API Key</a> and paste it into the text box below to access these styles on the <a href="?page=snazzy_maps&tab=1">Explore</a> tab.
25
+ </p>
26
+
27
+ <form action="?page=snazzy_maps&tab=2" method="post" class="pure-form pure-form-stacked api-form box-shadow-cell">
28
+
29
+ <label for="api_key"><strong>API Key</strong></label>
30
+ <input type="text" id="api_key" name="api_key"
31
+ placeholder="Enter your API Key" value="<?php echo $api_key; ?>"/>
32
+ <button type="submit" class="button button-primary">SAVE</button>
33
+ <?php if(!is_null($api_key)){ ?>
34
+ <a href="?page=snazzy_maps&tab=2&action=delete_key"
35
+ class="button button-error">DELETE</a>
36
+ <?php } ?>
37
+ </form>
38
+ </div>
39
+ </div>
40
+
41
+ <?php } ?>
admin/styles.php ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) OR exit;
3
+
4
+
5
+
6
+ function admin_styles_head($tab){
7
+
8
+ $styles = get_option('SnazzyMapStyles', null);
9
+ if($styles == null){
10
+ $styles = array();
11
+ }
12
+ //Used to get a style by an id from the style array
13
+ $getStyleIndex = function($id) use ($styles){
14
+ foreach($styles as $index => $style){
15
+ if($style['id'] == $id){
16
+ return $index;
17
+ }
18
+ }
19
+ return null;
20
+ };
21
+
22
+ $getStyle = function($id) use ($styles, $getStyleIndex){
23
+ $index = $getStyleIndex($id);
24
+ return !is_null($index) ? $styles[$index] : null;
25
+ };
26
+
27
+ //When a new style is selected we have to go through some checks
28
+ if(isset($_POST['new_style'])){
29
+ $newStyle = json_decode(base64_decode($_POST['new_style']), true);
30
+ if(!$getStyle($newStyle['id'])){
31
+ $styles[] = $newStyle;
32
+ update_option('SnazzyMapStyles', $styles);
33
+ }
34
+ }
35
+ }
36
+
37
+ function admin_styles_tab($tab){
38
+
39
+ $styles = get_option('SnazzyMapStyles', null);
40
+ if($styles == null){
41
+ $styles = array();
42
+ }
43
+
44
+ //Used to get a style by an id from the style array
45
+ $getStyleIndex = function($id) use ($styles){
46
+ foreach($styles as $index => $style){
47
+ if($style['id'] == $id){
48
+ return $index;
49
+ }
50
+ }
51
+ return null;
52
+ };
53
+
54
+ $getStyle = function($id) use ($styles, $getStyleIndex){
55
+ $index = $getStyleIndex($id);
56
+ return !is_null($index) ? $styles[$index] : null;
57
+ };
58
+
59
+ //Delete the specified style from the array
60
+ if(isset($_GET['action']) && $_GET['action'] == 'delete_style'){
61
+ $index = $getStyleIndex($_GET['style']);
62
+ $defaultStyle = get_option('SnazzyMapDefaultStyle', null);
63
+ if(!is_null($index)){
64
+ $oldStyle = $styles[$index];
65
+ array_splice($styles, $index, 1);
66
+ update_option('SnazzyMapStyles', $styles);
67
+
68
+ //Delete the default style when it is removed from this list
69
+ if(!is_null($defaultStyle) && $defaultStyle['id'] == $oldStyle['id']){
70
+ delete_option('SnazzyMapDefaultStyle');
71
+ }
72
+ }
73
+ }
74
+
75
+ //Enable the specified style
76
+ if(isset($_GET['action']) && $_GET['action'] == 'enable_style'){
77
+ $index = $getStyleIndex($_GET['style']);
78
+ if(!is_null($index)){
79
+ update_option('SnazzyMapDefaultStyle', $styles[$index]);
80
+ }
81
+ }
82
+
83
+ //Disable the specified style
84
+ if(isset($_GET['action']) && $_GET['action'] == 'disable_style'){
85
+ $index = $getStyleIndex($_GET['style']);
86
+ $defaultStyle = get_option('SnazzyMapDefaultStyle', null);
87
+ if(!is_null($index) && !is_null($defaultStyle)
88
+ && $styles[$index]['id'] == $defaultStyle['id']){
89
+ delete_option('SnazzyMapDefaultStyle');
90
+ }
91
+ }
92
+
93
+
94
+ $defaultStyle = get_option('SnazzyMapDefaultStyle', null);
95
+
96
+ //Used during testing
97
+ if(isset($_GET['clear_styles'])){
98
+ delete_option('SnazzyMapStyles');
99
+ }
100
+ ?>
101
+
102
+ <?php if (count($styles) > 0) { ?>
103
+ <div class="results row">
104
+ <?php foreach($styles as $index => $style){
105
+ $isEnabled = !is_null($defaultStyle) && $defaultStyle['id'] == $style['id'];
106
+
107
+ $styleAction = function($action) use ($style){
108
+ return "?page=snazzy_maps&tab=0&action=$action&style=" . $style['id'];
109
+ };
110
+ ?>
111
+ <div class="style col-sm-6 col-md-4 <?php echo $isEnabled ? 'enabled' : '';?>">
112
+ <div class="sm-style">
113
+ <div class="sm-map">
114
+ <img src="<?php echo $style['imageUrl']; ?>"
115
+ alt="<?php echo $style['name']; ?>"/>
116
+ <?php
117
+ if($isEnabled) {
118
+ ?>
119
+ <span class="overlay-icon">
120
+ <span class="icon-checkmark"></span>
121
+ </span>
122
+ <?php
123
+ } ?>
124
+ </div>
125
+ <div class="sm-content info">
126
+ <h3>
127
+ <a href="<?php echo $style['url']; ?>" class="title" target="_blank">
128
+ <?php echo $style['name']; ?>
129
+ </a>
130
+ </h3>
131
+ <div class="author">
132
+ by <?php echo $style['createdBy']['name'];?></span>
133
+ </div>
134
+ <div class="stats">
135
+ <div class="views">
136
+ <span class="icon-eye"></span>
137
+ <?php echo $style['views']; ?> views
138
+ </div>
139
+ <div class="favorites">
140
+ <span class="icon-star"></span>
141
+ <?php echo $style['favorites']; ?> favorites
142
+ </div>
143
+ </div>
144
+ <?php
145
+ if($isEnabled){
146
+ ?>
147
+ <a href="<?php echo $styleAction('disable_style'); ?>"
148
+ class="button button-secondary button-large">Disable</a>
149
+ <?php
150
+ }
151
+ else{
152
+ ?>
153
+ <a href="<?php echo $styleAction('enable_style'); ?>"
154
+ class="button button-primary button-large">Enable</a>
155
+ <?php
156
+ } ?>
157
+ <a href="<?php echo $styleAction('delete_style'); ?>"
158
+ class="delete button button-error button-large">Remove</a>
159
+ </div>
160
+ </div>
161
+ </div>
162
+ <?php } ?>
163
+ </div>
164
+ <?php }else{ ?>
165
+ <div class="nothing">
166
+ <p>Looks like you haven't picked any styles yet.</p>
167
+ <p><a href="?page=snazzy_maps&tab=1">Explore</a> and choose some styles for your site!</p>
168
+ </div>
169
+ <?php } ?>
170
+
171
+ <?php } ?>
bower_components/history.js/scripts/bundled/html5/native.history.js ADDED
@@ -0,0 +1 @@
 
1
+ (function(e,t){"use strict";var n=e.History=e.History||{};if(typeof n.Adapter!="undefined")throw new Error("History.js Adapter has already been loaded...");n.Adapter={handlers:{},_uid:1,uid:function(e){return e._uid||(e._uid=n.Adapter._uid++)},bind:function(e,t,r){var i=n.Adapter.uid(e);n.Adapter.handlers[i]=n.Adapter.handlers[i]||{},n.Adapter.handlers[i][t]=n.Adapter.handlers[i][t]||[],n.Adapter.handlers[i][t].push(r),e["on"+t]=function(e,t){return function(r){n.Adapter.trigger(e,t,r)}}(e,t)},trigger:function(e,t,r){r=r||{};var i=n.Adapter.uid(e),s,o;n.Adapter.handlers[i]=n.Adapter.handlers[i]||{},n.Adapter.handlers[i][t]=n.Adapter.handlers[i][t]||[];for(s=0,o=n.Adapter.handlers[i][t].length;s<o;++s)n.Adapter.handlers[i][t][s].apply(this,[r])},extractEventData:function(e,n){var r=n&&n[e]||t;return r},onDomLoad:function(t){var n=e.setTimeout(function(){t()},2e3);e.onload=function(){clearTimeout(n),t()}}},typeof n.init!="undefined"&&n.init()})(window),function(e,t){"use strict";var n=e.console||t,r=e.document,i=e.navigator,s=e.sessionStorage||!1,o=e.setTimeout,u=e.clearTimeout,a=e.setInterval,f=e.clearInterval,l=e.JSON,c=e.alert,h=e.History=e.History||{},p=e.history;try{s.setItem("TEST","1"),s.removeItem("TEST")}catch(d){s=!1}l.stringify=l.stringify||l.encode,l.parse=l.parse||l.decode;if(typeof h.init!="undefined")throw new Error("History.js Core has already been loaded...");h.init=function(e){return typeof h.Adapter=="undefined"?!1:(typeof h.initCore!="undefined"&&h.initCore(),typeof h.initHtml4!="undefined"&&h.initHtml4(),!0)},h.initCore=function(d){if(typeof h.initCore.initialized!="undefined")return!1;h.initCore.initialized=!0,h.options=h.options||{},h.options.hashChangeInterval=h.options.hashChangeInterval||100,h.options.safariPollInterval=h.options.safariPollInterval||500,h.options.doubleCheckInterval=h.options.doubleCheckInterval||500,h.options.disableSuid=h.options.disableSuid||!1,h.options.storeInterval=h.options.storeInterval||1e3,h.options.busyDelay=h.options.busyDelay||250,h.options.debug=h.options.debug||!1,h.options.initialTitle=h.options.initialTitle||r.title,h.options.html4Mode=h.options.html4Mode||!1,h.options.delayInit=h.options.delayInit||!1,h.intervalList=[],h.clearAllIntervals=function(){var e,t=h.intervalList;if(typeof t!="undefined"&&t!==null){for(e=0;e<t.length;e++)f(t[e]);h.intervalList=null}},h.debug=function(){(h.options.debug||!1)&&h.log.apply(h,arguments)},h.log=function(){var e=typeof n!="undefined"&&typeof n.log!="undefined"&&typeof n.log.apply!="undefined",t=r.getElementById("log"),i,s,o,u,a;e?(u=Array.prototype.slice.call(arguments),i=u.shift(),typeof n.debug!="undefined"?n.debug.apply(n,[i,u]):n.log.apply(n,[i,u])):i="\n"+arguments[0]+"\n";for(s=1,o=arguments.length;s<o;++s){a=arguments[s];if(typeof a=="object"&&typeof l!="undefined")try{a=l.stringify(a)}catch(f){}i+="\n"+a+"\n"}return t?(t.value+=i+"\n-----\n",t.scrollTop=t.scrollHeight-t.clientHeight):e||c(i),!0},h.getInternetExplorerMajorVersion=function(){var e=h.getInternetExplorerMajorVersion.cached=typeof h.getInternetExplorerMajorVersion.cached!="undefined"?h.getInternetExplorerMajorVersion.cached:function(){var e=3,t=r.createElement("div"),n=t.getElementsByTagName("i");while((t.innerHTML="<!--[if gt IE "+ ++e+"]><i></i><![endif]-->")&&n[0]);return e>4?e:!1}();return e},h.isInternetExplorer=function(){var e=h.isInternetExplorer.cached=typeof h.isInternetExplorer.cached!="undefined"?h.isInternetExplorer.cached:Boolean(h.getInternetExplorerMajorVersion());return e},h.options.html4Mode?h.emulated={pushState:!0,hashChange:!0}:h.emulated={pushState:!Boolean(e.history&&e.history.pushState&&e.history.replaceState&&!/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(i.userAgent)&&!/AppleWebKit\/5([0-2]|3[0-2])/i.test(i.userAgent)),hashChange:Boolean(!("onhashchange"in e||"onhashchange"in r)||h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8)},h.enabled=!h.emulated.pushState,h.bugs={setHash:Boolean(!h.emulated.pushState&&i.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),safariPoll:Boolean(!h.emulated.pushState&&i.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),ieDoubleCheck:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8),hashEscape:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<7)},h.isEmptyObject=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},h.cloneObject=function(e){var t,n;return e?(t=l.stringify(e),n=l.parse(t)):n={},n},h.getRootUrl=function(){var e=r.location.protocol+"//"+(r.location.hostname||r.location.host);if(r.location.port||!1)e+=":"+r.location.port;return e+="/",e},h.getBaseHref=function(){var e=r.getElementsByTagName("base"),t=null,n="";return e.length===1&&(t=e[0],n=t.href.replace(/[^\/]+$/,"")),n=n.replace(/\/+$/,""),n&&(n+="/"),n},h.getBaseUrl=function(){var e=h.getBaseHref()||h.getBasePageUrl()||h.getRootUrl();return e},h.getPageUrl=function(){var e=h.getState(!1,!1),t=(e||{}).url||h.getLocationHref(),n;return n=t.replace(/\/+$/,"").replace(/[^\/]+$/,function(e,t,n){return/\./.test(e)?e:e+"/"}),n},h.getBasePageUrl=function(){var e=h.getLocationHref().replace(/[#\?].*/,"").replace(/[^\/]+$/,function(e,t,n){return/[^\/]$/.test(e)?"":e}).replace(/\/+$/,"")+"/";return e},h.getFullUrl=function(e,t){var n=e,r=e.substring(0,1);return t=typeof t=="undefined"?!0:t,/[a-z]+\:\/\//.test(e)||(r==="/"?n=h.getRootUrl()+e.replace(/^\/+/,""):r==="#"?n=h.getPageUrl().replace(/#.*/,"")+e:r==="?"?n=h.getPageUrl().replace(/[\?#].*/,"")+e:t?n=h.getBaseUrl()+e.replace(/^(\.\/)+/,""):n=h.getBasePageUrl()+e.replace(/^(\.\/)+/,"")),n.replace(/\#$/,"")},h.getShortUrl=function(e){var t=e,n=h.getBaseUrl(),r=h.getRootUrl();return h.emulated.pushState&&(t=t.replace(n,"")),t=t.replace(r,"/"),h.isTraditionalAnchor(t)&&(t="./"+t),t=t.replace(/^(\.\/)+/g,"./").replace(/\#$/,""),t},h.getLocationHref=function(e){return e=e||r,e.URL===e.location.href?e.location.href:e.location.href===decodeURIComponent(e.URL)?e.URL:e.location.hash&&decodeURIComponent(e.location.href.replace(/^[^#]+/,""))===e.location.hash?e.location.href:e.URL.indexOf("#")==-1&&e.location.href.indexOf("#")!=-1?e.location.href:e.URL||e.location.href},h.store={},h.idToState=h.idToState||{},h.stateToId=h.stateToId||{},h.urlToId=h.urlToId||{},h.storedStates=h.storedStates||[],h.savedStates=h.savedStates||[],h.normalizeStore=function(){h.store.idToState=h.store.idToState||{},h.store.urlToId=h.store.urlToId||{},h.store.stateToId=h.store.stateToId||{}},h.getState=function(e,t){typeof e=="undefined"&&(e=!0),typeof t=="undefined"&&(t=!0);var n=h.getLastSavedState();return!n&&t&&(n=h.createStateObject()),e&&(n=h.cloneObject(n),n.url=n.cleanUrl||n.url),n},h.getIdByState=function(e){var t=h.extractId(e.url),n;if(!t){n=h.getStateString(e);if(typeof h.stateToId[n]!="undefined")t=h.stateToId[n];else if(typeof h.store.stateToId[n]!="undefined")t=h.store.stateToId[n];else{for(;;){t=(new Date).getTime()+String(Math.random()).replace(/\D/g,"");if(typeof h.idToState[t]=="undefined"&&typeof h.store.idToState[t]=="undefined")break}h.stateToId[n]=t,h.idToState[t]=e}}return t},h.normalizeState=function(e){var t,n;if(!e||typeof e!="object")e={};if(typeof e.normalized!="undefined")return e;if(!e.data||typeof e.data!="object")e.data={};return t={},t.normalized=!0,t.title=e.title||"",t.url=h.getFullUrl(e.url?e.url:h.getLocationHref()),t.hash=h.getShortUrl(t.url),t.data=h.cloneObject(e.data),t.id=h.getIdByState(t),t.cleanUrl=t.url.replace(/\??\&_suid.*/,""),t.url=t.cleanUrl,n=!h.isEmptyObject(t.data),(t.title||n)&&h.options.disableSuid!==!0&&(t.hash=h.getShortUrl(t.url).replace(/\??\&_suid.*/,""),/\?/.test(t.hash)||(t.hash+="?"),t.hash+="&_suid="+t.id),t.hashedUrl=h.getFullUrl(t.hash),(h.emulated.pushState||h.bugs.safariPoll)&&h.hasUrlDuplicate(t)&&(t.url=t.hashedUrl),t},h.createStateObject=function(e,t,n){var r={data:e,title:t,url:n};return r=h.normalizeState(r),r},h.getStateById=function(e){e=String(e);var n=h.idToState[e]||h.store.idToState[e]||t;return n},h.getStateString=function(e){var t,n,r;return t=h.normalizeState(e),n={data:t.data,title:e.title,url:e.url},r=l.stringify(n),r},h.getStateId=function(e){var t,n;return t=h.normalizeState(e),n=t.id,n},h.getHashByState=function(e){var t,n;return t=h.normalizeState(e),n=t.hash,n},h.extractId=function(e){var t,n,r,i;return e.indexOf("#")!=-1?i=e.split("#")[0]:i=e,n=/(.*)\&_suid=([0-9]+)$/.exec(i),r=n?n[1]||e:e,t=n?String(n[2]||""):"",t||!1},h.isTraditionalAnchor=function(e){var t=!/[\/\?\.]/.test(e);return t},h.extractState=function(e,t){var n=null,r,i;return t=t||!1,r=h.extractId(e),r&&(n=h.getStateById(r)),n||(i=h.getFullUrl(e),r=h.getIdByUrl(i)||!1,r&&(n=h.getStateById(r)),!n&&t&&!h.isTraditionalAnchor(e)&&(n=h.createStateObject(null,null,i))),n},h.getIdByUrl=function(e){var n=h.urlToId[e]||h.store.urlToId[e]||t;return n},h.getLastSavedState=function(){return h.savedStates[h.savedStates.length-1]||t},h.getLastStoredState=function(){return h.storedStates[h.storedStates.length-1]||t},h.hasUrlDuplicate=function(e){var t=!1,n;return n=h.extractState(e.url),t=n&&n.id!==e.id,t},h.storeState=function(e){return h.urlToId[e.url]=e.id,h.storedStates.push(h.cloneObject(e)),e},h.isLastSavedState=function(e){var t=!1,n,r,i;return h.savedStates.length&&(n=e.id,r=h.getLastSavedState(),i=r.id,t=n===i),t},h.saveState=function(e){return h.isLastSavedState(e)?!1:(h.savedStates.push(h.cloneObject(e)),!0)},h.getStateByIndex=function(e){var t=null;return typeof e=="undefined"?t=h.savedStates[h.savedStates.length-1]:e<0?t=h.savedStates[h.savedStates.length+e]:t=h.savedStates[e],t},h.getCurrentIndex=function(){var e=null;return h.savedStates.length<1?e=0:e=h.savedStates.length-1,e},h.getHash=function(e){var t=h.getLocationHref(e),n;return n=h.getHashByUrl(t),n},h.unescapeHash=function(e){var t=h.normalizeHash(e);return t=decodeURIComponent(t),t},h.normalizeHash=function(e){var t=e.replace(/[^#]*#/,"").replace(/#.*/,"");return t},h.setHash=function(e,t){var n,i;return t!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.setHash,args:arguments,queue:t}),!1):(h.busy(!0),n=h.extractState(e,!0),n&&!h.emulated.pushState?h.pushState(n.data,n.title,n.url,!1):h.getHash()!==e&&(h.bugs.setHash?(i=h.getPageUrl(),h.pushState(null,null,i+"#"+e,!1)):r.location.hash=e),h)},h.escapeHash=function(t){var n=h.normalizeHash(t);return n=e.encodeURIComponent(n),h.bugs.hashEscape||(n=n.replace(/\%21/g,"!").replace(/\%26/g,"&").replace(/\%3D/g,"=").replace(/\%3F/g,"?")),n},h.getHashByUrl=function(e){var t=String(e).replace(/([^#]*)#?([^#]*)#?(.*)/,"$2");return t=h.unescapeHash(t),t},h.setTitle=function(e){var t=e.title,n;t||(n=h.getStateByIndex(0),n&&n.url===e.url&&(t=n.title||h.options.initialTitle));try{r.getElementsByTagName("title")[0].innerHTML=t.replace("<","&lt;").replace(">","&gt;").replace(" & "," &amp; ")}catch(i){}return r.title=t,h},h.queues=[],h.busy=function(e){typeof e!="undefined"?h.busy.flag=e:typeof h.busy.flag=="undefined"&&(h.busy.flag=!1);if(!h.busy.flag){u(h.busy.timeout);var t=function(){var e,n,r;if(h.busy.flag)return;for(e=h.queues.length-1;e>=0;--e){n=h.queues[e];if(n.length===0)continue;r=n.shift(),h.fireQueueItem(r),h.busy.timeout=o(t,h.options.busyDelay)}};h.busy.timeout=o(t,h.options.busyDelay)}return h.busy.flag},h.busy.flag=!1,h.fireQueueItem=function(e){return e.callback.apply(e.scope||h,e.args||[])},h.pushQueue=function(e){return h.queues[e.queue||0]=h.queues[e.queue||0]||[],h.queues[e.queue||0].push(e),h},h.queue=function(e,t){return typeof e=="function"&&(e={callback:e}),typeof t!="undefined"&&(e.queue=t),h.busy()?h.pushQueue(e):h.fireQueueItem(e),h},h.clearQueue=function(){return h.busy.flag=!1,h.queues=[],h},h.stateChanged=!1,h.doubleChecker=!1,h.doubleCheckComplete=function(){return h.stateChanged=!0,h.doubleCheckClear(),h},h.doubleCheckClear=function(){return h.doubleChecker&&(u(h.doubleChecker),h.doubleChecker=!1),h},h.doubleCheck=function(e){return h.stateChanged=!1,h.doubleCheckClear(),h.bugs.ieDoubleCheck&&(h.doubleChecker=o(function(){return h.doubleCheckClear(),h.stateChanged||e(),!0},h.options.doubleCheckInterval)),h},h.safariStatePoll=function(){var t=h.extractState(h.getLocationHref()),n;if(!h.isLastSavedState(t))return n=t,n||(n=h.createStateObject()),h.Adapter.trigger(e,"popstate"),h;return},h.back=function(e){return e!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.back,args:arguments,queue:e}),!1):(h.busy(!0),h.doubleCheck(function(){h.back(!1)}),p.go(-1),!0)},h.forward=function(e){return e!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.forward,args:arguments,queue:e}),!1):(h.busy(!0),h.doubleCheck(function(){h.forward(!1)}),p.go(1),!0)},h.go=function(e,t){var n;if(e>0)for(n=1;n<=e;++n)h.forward(t);else{if(!(e<0))throw new Error("History.go: History.go requires a positive or negative integer passed.");for(n=-1;n>=e;--n)h.back(t)}return h};if(h.emulated.pushState){var v=function(){};h.pushState=h.pushState||v,h.replaceState=h.replaceState||v}else h.onPopState=function(t,n){var r=!1,i=!1,s,o;return h.doubleCheckComplete(),s=h.getHash(),s?(o=h.extractState(s||h.getLocationHref(),!0),o?h.replaceState(o.data,o.title,o.url,!1):(h.Adapter.trigger(e,"anchorchange"),h.busy(!1)),h.expectedStateId=!1,!1):(r=h.Adapter.extractEventData("state",t,n)||!1,r?i=h.getStateById(r):h.expectedStateId?i=h.getStateById(h.expectedStateId):i=h.extractState(h.getLocationHref()),i||(i=h.createStateObject(null,null,h.getLocationHref())),h.expectedStateId=!1,h.isLastSavedState(i)?(h.busy(!1),!1):(h.storeState(i),h.saveState(i),h.setTitle(i),h.Adapter.trigger(e,"statechange"),h.busy(!1),!0))},h.Adapter.bind(e,"popstate",h.onPopState),h.pushState=function(t,n,r,i){if(h.getHashByUrl(r)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(i!==!1&&h.busy())return h.pushQueue({scope:h,callback:h.pushState,args:arguments,queue:i}),!1;h.busy(!0);var s=h.createStateObject(t,n,r);return h.isLastSavedState(s)?h.busy(!1):(h.storeState(s),h.expectedStateId=s.id,p.pushState(s.id,s.title,s.url),h.Adapter.trigger(e,"popstate")),!0},h.replaceState=function(t,n,r,i){if(h.getHashByUrl(r)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(i!==!1&&h.busy())return h.pushQueue({scope:h,callback:h.replaceState,args:arguments,queue:i}),!1;h.busy(!0);var s=h.createStateObject(t,n,r);return h.isLastSavedState(s)?h.busy(!1):(h.storeState(s),h.expectedStateId=s.id,p.replaceState(s.id,s.title,s.url),h.Adapter.trigger(e,"popstate")),!0};if(s){try{h.store=l.parse(s.getItem("History.store"))||{}}catch(m){h.store={}}h.normalizeStore()}else h.store={},h.normalizeStore();h.Adapter.bind(e,"unload",h.clearAllIntervals),h.saveState(h.storeState(h.extractState(h.getLocationHref(),!0))),s&&(h.onUnload=function(){var e,t,n;try{e=l.parse(s.getItem("History.store"))||{}}catch(r){e={}}e.idToState=e.idToState||{},e.urlToId=e.urlToId||{},e.stateToId=e.stateToId||{};for(t in h.idToState){if(!h.idToState.hasOwnProperty(t))continue;e.idToState[t]=h.idToState[t]}for(t in h.urlToId){if(!h.urlToId.hasOwnProperty(t))continue;e.urlToId[t]=h.urlToId[t]}for(t in h.stateToId){if(!h.stateToId.hasOwnProperty(t))continue;e.stateToId[t]=h.stateToId[t]}h.store=e,h.normalizeStore(),n=l.stringify(e);try{s.setItem("History.store",n)}catch(i){if(i.code!==DOMException.QUOTA_EXCEEDED_ERR)throw i;s.length&&(s.removeItem("History.store"),s.setItem("History.store",n))}},h.intervalList.push(a(h.onUnload,h.options.storeInterval)),h.Adapter.bind(e,"beforeunload",h.onUnload),h.Adapter.bind(e,"unload",h.onUnload));if(!h.emulated.pushState){h.bugs.safariPoll&&h.intervalList.push(a(h.safariStatePoll,h.options.safariPollInterval));if(i.vendor==="Apple Computer, Inc."||(i.appCodeName||"")==="Mozilla")h.Adapter.bind(e,"hashchange",function(){h.Adapter.trigger(e,"popstate")}),h.getHash()&&h.Adapter.onDomLoad(function(){h.Adapter.trigger(e,"hashchange")})}},(!h.options||!h.options.delayInit)&&h.init()}(window)
node_modules/mustache/mustache.min.js ADDED
@@ -0,0 +1 @@
 
1
+ (function(global,factory){if(typeof exports==="object"&&exports){factory(exports)}else if(typeof define==="function"&&define.amd){define(["exports"],factory)}else{factory(global.Mustache={})}})(this,function(mustache){var Object_toString=Object.prototype.toString;var isArray=Array.isArray||function(object){return Object_toString.call(object)==="[object Array]"};function isFunction(object){return typeof object==="function"}function escapeRegExp(string){return string.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var RegExp_test=RegExp.prototype.test;function testRegExp(re,string){return RegExp_test.call(re,string)}var nonSpaceRe=/\S/;function isWhitespace(string){return!testRegExp(nonSpaceRe,string)}var entityMap={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function escapeHtml(string){return String(string).replace(/[&<>"'\/]/g,function(s){return entityMap[s]})}var whiteRe=/\s*/;var spaceRe=/\s+/;var equalsRe=/\s*=/;var curlyRe=/\s*\}/;var tagRe=/#|\^|\/|>|\{|&|=|!/;function parseTemplate(template,tags){if(!template)return[];var sections=[];var tokens=[];var spaces=[];var hasTag=false;var nonSpace=false;function stripSpace(){if(hasTag&&!nonSpace){while(spaces.length)delete tokens[spaces.pop()]}else{spaces=[]}hasTag=false;nonSpace=false}var openingTagRe,closingTagRe,closingCurlyRe;function compileTags(tags){if(typeof tags==="string")tags=tags.split(spaceRe,2);if(!isArray(tags)||tags.length!==2)throw new Error("Invalid tags: "+tags);openingTagRe=new RegExp(escapeRegExp(tags[0])+"\\s*");closingTagRe=new RegExp("\\s*"+escapeRegExp(tags[1]));closingCurlyRe=new RegExp("\\s*"+escapeRegExp("}"+tags[1]))}compileTags(tags||mustache.tags);var scanner=new Scanner(template);var start,type,value,chr,token,openSection;while(!scanner.eos()){start=scanner.pos;value=scanner.scanUntil(openingTagRe);if(value){for(var i=0,valueLength=value.length;i<valueLength;++i){chr=value.charAt(i);if(isWhitespace(chr)){spaces.push(tokens.length)}else{nonSpace=true}tokens.push(["text",chr,start,start+1]);start+=1;if(chr==="\n")stripSpace()}}if(!scanner.scan(openingTagRe))break;hasTag=true;type=scanner.scan(tagRe)||"name";scanner.scan(whiteRe);if(type==="="){value=scanner.scanUntil(equalsRe);scanner.scan(equalsRe);scanner.scanUntil(closingTagRe)}else if(type==="{"){value=scanner.scanUntil(closingCurlyRe);scanner.scan(curlyRe);scanner.scanUntil(closingTagRe);type="&"}else{value=scanner.scanUntil(closingTagRe)}if(!scanner.scan(closingTagRe))throw new Error("Unclosed tag at "+scanner.pos);token=[type,value,start,scanner.pos];tokens.push(token);if(type==="#"||type==="^"){sections.push(token)}else if(type==="/"){openSection=sections.pop();if(!openSection)throw new Error('Unopened section "'+value+'" at '+start);if(openSection[1]!==value)throw new Error('Unclosed section "'+openSection[1]+'" at '+start)}else if(type==="name"||type==="{"||type==="&"){nonSpace=true}else if(type==="="){compileTags(value)}}openSection=sections.pop();if(openSection)throw new Error('Unclosed section "'+openSection[1]+'" at '+scanner.pos);return nestTokens(squashTokens(tokens))}function squashTokens(tokens){var squashedTokens=[];var token,lastToken;for(var i=0,numTokens=tokens.length;i<numTokens;++i){token=tokens[i];if(token){if(token[0]==="text"&&lastToken&&lastToken[0]==="text"){lastToken[1]+=token[1];lastToken[3]=token[3]}else{squashedTokens.push(token);lastToken=token}}}return squashedTokens}function nestTokens(tokens){var nestedTokens=[];var collector=nestedTokens;var sections=[];var token,section;for(var i=0,numTokens=tokens.length;i<numTokens;++i){token=tokens[i];switch(token[0]){case"#":case"^":collector.push(token);sections.push(token);collector=token[4]=[];break;case"/":section=sections.pop();section[5]=token[2];collector=sections.length>0?sections[sections.length-1][4]:nestedTokens;break;default:collector.push(token)}}return nestedTokens}function Scanner(string){this.string=string;this.tail=string;this.pos=0}Scanner.prototype.eos=function(){return this.tail===""};Scanner.prototype.scan=function(re){var match=this.tail.match(re);if(!match||match.index!==0)return"";var string=match[0];this.tail=this.tail.substring(string.length);this.pos+=string.length;return string};Scanner.prototype.scanUntil=function(re){var index=this.tail.search(re),match;switch(index){case-1:match=this.tail;this.tail="";break;case 0:match="";break;default:match=this.tail.substring(0,index);this.tail=this.tail.substring(index)}this.pos+=match.length;return match};function Context(view,parentContext){this.view=view==null?{}:view;this.cache={".":this.view};this.parent=parentContext}Context.prototype.push=function(view){return new Context(view,this)};Context.prototype.lookup=function(name){var cache=this.cache;var value;if(name in cache){value=cache[name]}else{var context=this,names,index;while(context){if(name.indexOf(".")>0){value=context.view;names=name.split(".");index=0;while(value!=null&&index<names.length)value=value[names[index++]]}else if(typeof context.view=="object"){value=context.view[name]}if(value!=null)break;context=context.parent}cache[name]=value}if(isFunction(value))value=value.call(this.view);return value};function Writer(){this.cache={}}Writer.prototype.clearCache=function(){this.cache={}};Writer.prototype.parse=function(template,tags){var cache=this.cache;var tokens=cache[template];if(tokens==null)tokens=cache[template]=parseTemplate(template,tags);return tokens};Writer.prototype.render=function(template,view,partials){var tokens=this.parse(template);var context=view instanceof Context?view:new Context(view);return this.renderTokens(tokens,context,partials,template)};Writer.prototype.renderTokens=function(tokens,context,partials,originalTemplate){var buffer="";var token,symbol,value;for(var i=0,numTokens=tokens.length;i<numTokens;++i){value=undefined;token=tokens[i];symbol=token[0];if(symbol==="#")value=this._renderSection(token,context,partials,originalTemplate);else if(symbol==="^")value=this._renderInverted(token,context,partials,originalTemplate);else if(symbol===">")value=this._renderPartial(token,context,partials,originalTemplate);else if(symbol==="&")value=this._unescapedValue(token,context);else if(symbol==="name")value=this._escapedValue(token,context);else if(symbol==="text")value=this._rawValue(token);if(value!==undefined)buffer+=value}return buffer};Writer.prototype._renderSection=function(token,context,partials,originalTemplate){var self=this;var buffer="";var value=context.lookup(token[1]);function subRender(template){return self.render(template,context,partials)}if(!value)return;if(isArray(value)){for(var j=0,valueLength=value.length;j<valueLength;++j){buffer+=this.renderTokens(token[4],context.push(value[j]),partials,originalTemplate)}}else if(typeof value==="object"||typeof value==="string"){buffer+=this.renderTokens(token[4],context.push(value),partials,originalTemplate)}else if(isFunction(value)){if(typeof originalTemplate!=="string")throw new Error("Cannot use higher-order sections without the original template");value=value.call(context.view,originalTemplate.slice(token[3],token[5]),subRender);if(value!=null)buffer+=value}else{buffer+=this.renderTokens(token[4],context,partials,originalTemplate)}return buffer};Writer.prototype._renderInverted=function(token,context,partials,originalTemplate){var value=context.lookup(token[1]);if(!value||isArray(value)&&value.length===0)return this.renderTokens(token[4],context,partials,originalTemplate)};Writer.prototype._renderPartial=function(token,context,partials){if(!partials)return;var value=isFunction(partials)?partials(token[1]):partials[token[1]];if(value!=null)return this.renderTokens(this.parse(value),context,partials,value)};Writer.prototype._unescapedValue=function(token,context){var value=context.lookup(token[1]);if(value!=null)return value};Writer.prototype._escapedValue=function(token,context){var value=context.lookup(token[1]);if(value!=null)return mustache.escape(value)};Writer.prototype._rawValue=function(token){return token[1]};mustache.name="mustache.js";mustache.version="1.1.0";mustache.tags=["{{","}}"];var defaultWriter=new Writer;mustache.clearCache=function(){return defaultWriter.clearCache()};mustache.parse=function(template,tags){return defaultWriter.parse(template,tags)};mustache.render=function(template,view,partials){return defaultWriter.render(template,view,partials)};mustache.to_html=function(template,view,partials,send){var result=mustache.render(template,view,partials);if(isFunction(send)){send(result)}else{return result}};mustache.escape=escapeHtml;mustache.Scanner=Scanner;mustache.Context=Context;mustache.Writer=Writer});
node_modules/query-string/query-string.js ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ query-string
3
+ Parse and stringify URL query strings
4
+ https://github.com/sindresorhus/query-string
5
+ by Sindre Sorhus
6
+ MIT License
7
+ */
8
+ (function () {
9
+ 'use strict';
10
+ var queryString = {};
11
+
12
+ queryString.parse = function (str) {
13
+ if (typeof str !== 'string') {
14
+ return {};
15
+ }
16
+
17
+ str = str.trim().replace(/^(\?|#)/, '');
18
+
19
+ if (!str) {
20
+ return {};
21
+ }
22
+
23
+ return str.trim().split('&').reduce(function (ret, param) {
24
+ var parts = param.replace(/\+/g, ' ').split('=');
25
+ var key = parts[0];
26
+ var val = parts[1];
27
+
28
+ key = decodeURIComponent(key);
29
+ // missing `=` should be `null`:
30
+ // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters
31
+ val = val === undefined ? null : decodeURIComponent(val);
32
+
33
+ if (!ret.hasOwnProperty(key)) {
34
+ ret[key] = val;
35
+ } else if (Array.isArray(ret[key])) {
36
+ ret[key].push(val);
37
+ } else {
38
+ ret[key] = [ret[key], val];
39
+ }
40
+
41
+ return ret;
42
+ }, {});
43
+ };
44
+
45
+ queryString.stringify = function (obj) {
46
+ return obj ? Object.keys(obj).map(function (key) {
47
+ var val = obj[key];
48
+
49
+ if (Array.isArray(val)) {
50
+ return val.map(function (val2) {
51
+ return encodeURIComponent(key) + '=' + encodeURIComponent(val2);
52
+ }).join('&');
53
+ }
54
+
55
+ return encodeURIComponent(key) + '=' + encodeURIComponent(val);
56
+ }).join('&') : '';
57
+ };
58
+
59
+ if (typeof define === 'function' && define.amd) {
60
+ define(function() { return queryString; });
61
+ } else if (typeof module !== 'undefined' && module.exports) {
62
+ module.exports = queryString;
63
+ } else {
64
+ window.queryString = queryString;
65
+ }
66
+ })();
readme.txt ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Snazzy Maps ===
2
+ Contributors: atmistinc
3
+ Donate link: https://snazzymaps.com/about
4
+ Tags: google,maps,google maps,styled maps,styles,color,schemes,themes
5
+ Requires at least: 3.5
6
+ Tested up to: 4.1
7
+ Stable tag: 1.0.0
8
+ License: GPLv2 or later
9
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
+
11
+ Apply styles to your Google Maps with the official Snazzy Maps WordPress plugin.
12
+
13
+ == Description ==
14
+
15
+ [Snazzy Maps](https://snazzymaps.com/plugins) adds styles to your existing Google Maps with the click of a button.
16
+
17
+ **Features**
18
+
19
+ - Browse through hundreds of free styles.
20
+ - Quickly apply styles to all of the Google Maps on your WordPress site.
21
+ - Works with most Google Maps plugins.
22
+ - Access your favorites from Snazzy Maps by signing up for an [API key](https://snazzymaps.com/account/developer).
23
+ - Build and customize your own styles on Snazzy Maps and access them through the plugin.
24
+ - Free to use for personal and open source projects. Affordable licenses for businesses.
25
+
26
+ *Please note this plugin does not add a Google Map to your page. It simply adds styles to any existing maps that you
27
+ already have on your site.*
28
+
29
+ == Installation ==
30
+
31
+ 1. Install Snazzy Maps by uploading the files to your server.
32
+ 1. Activate the plugin through the 'Plugins' menu in WordPress
33
+ 1. Access Appearance > Snazzy Maps in the WordPress menu.
34
+ 1. Choose a collection of styles in the 'Explore' tab.
35
+ 1. Apply your chosen style by clicking 'Enable' in the 'Site Styles' page.
36
+ 1. Enjoy your newly styled Snazzy Maps!
37
+
38
+ *Please note this plugin does not add a Google Map to your page. It simply adds styles to any existing maps that you
39
+ have already added.*
40
+
41
+ == Frequently Asked Questions ==
42
+
43
+ = Is the plugin free to use? =
44
+
45
+ The Snazzy Maps plugin is free to use for personal and open source projects. Business licenses are available for
46
+ single and multiple sites and can be purchased at https://snazzymaps.com/plugins
47
+
48
+ = How do I add a Google Map? =
49
+
50
+ This plugin does not add a Google Map to your page. It simply adds styles to your existing maps. If you haven't
51
+ added a map yet, search [WordPress Plugins](https://wordpress.org/plugins) for a suitable Google Map plugin.
52
+
53
+ = Snazzy Maps doesn't work with my Google Maps plugin! =
54
+
55
+ We've tested Snazzy Maps with several different Google Maps plugins. If you happen to find one that our plugin doesn't
56
+ work with please send us an email at support@snazzymaps.com.
57
+
58
+ = How can I access my favorites or private styles from SnazzyMaps.com? =
59
+
60
+ 1. Sign up for an account at [SnazzyMaps.com](https://snazzymaps.com).
61
+ 1. Click your email address in the top left corner.
62
+ 1. Click the developer menu item on the left side.
63
+ 1. Click the "Generate API Key" button.
64
+ 1. Copy the long generated API Key.
65
+ 1. Paste the key into the 'Settings' tab in the Snazzy Maps plugin.
66
+ 1. You should now be able to access your favorites and private styles in the 'Explore' tab by changing the first filter dropdown.
67
+
68
+ == Screenshots ==
69
+
70
+ 1. Explore hundreds of different styles.
71
+ 2. Select a style to use for the Google Maps on your site.
72
+ 3. Your Google Map is now a Snazzy Map!
73
+
74
+ == Changelog ==
75
+
76
+ = 1.0.0 =
77
+ Release Date: March 1st, 2015
78
+
79
+ * Initial Release!
80
+
81
+ == Upgrade Notice ==
82
+
83
+ There is no need to upgrade just yet.
snazzymaps.js ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function($){
2
+ try{
3
+ var style = JSON.parse(SnazzyMapDefaultStyle['json']);
4
+ (function(g, s) {
5
+ var _map = g.Map;
6
+ g.Map = function(map, options) {
7
+ var that = Object.create(_map.prototype);
8
+ options.styles = s;
9
+ _map.apply(that, arguments);
10
+ return that;
11
+ };
12
+ })(google.maps, style);
13
+ }catch(error){/*Quietly die and leave the maps unstyled*/}
14
+ });
15
+
snazzymaps.php ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Plugin Name: Snazzy Maps
4
+ * Plugin URI: https://snazzymaps.com/plugins
5
+ * Description: Apply styles to your Google Maps with the official Snazzy Maps WordPress plugin.
6
+ * Version: 1.0.0
7
+ * Author: Atmist
8
+ * Author URI: http://atmist.com/
9
+ * License: GPL2
10
+ */
11
+ /* Copyright 2014 Atmist (email : hello@atmist.com)
12
+
13
+ This program is free software; you can redistribute it and/or modify
14
+ it under the terms of the GNU General Public License, version 2, as
15
+ published by the Free Software Foundation.
16
+
17
+ This program is distributed in the hope that it will be useful,
18
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
+ GNU General Public License for more details.
21
+
22
+ You should have received a copy of the GNU General Public License
23
+ along with this program; if not, write to the Free Software
24
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
+ */
26
+
27
+ //Recommended by wordpress
28
+ defined( 'ABSPATH' ) OR exit;
29
+
30
+ //This API key is used to explore the styles in snazzy maps
31
+ define('API_BASE', 'https://snazzymaps.com/');
32
+ define('API_KEY', 'ecaccc3c-44fa-486c-9503-5d473587a493');
33
+
34
+
35
+ include(plugin_dir_path(__FILE__) . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR . 'index.php');
36
+
37
+ function resourceURL($file){
38
+ return plugins_url($file, __FILE__);
39
+ }
40
+
41
+
42
+ function init_plugin(){
43
+ add_option('SnazzyMapUniqueStyle');
44
+ }
45
+ add_action('init', 'init_plugin');
46
+
47
+ //Pass the style information into the javascript file on the main page
48
+ function enqueue_script() {
49
+
50
+ $uniqueStyle = get_option('SnazzyMapDefaultStyle');
51
+ if(!empty($uniqueStyle) && !is_null($uniqueStyle)){
52
+ $handle = 'snazzymaps-js';
53
+ wp_register_script($handle, plugins_url('snazzymaps.js', __FILE__), array('jquery'));
54
+ wp_enqueue_script($handle, $in_footer = true);
55
+ wp_localize_script($handle, 'SnazzyMapDefaultStyle', $uniqueStyle);
56
+ }
57
+ }
58
+ add_action( 'wp_enqueue_scripts', 'enqueue_script');
59
+
60
+
61
+ //Found in admin/index.php
62
+ add_action( 'admin_enqueue_scripts', 'admin_enqueue_script');
63
+
64
+ function admin_add_custom_menu(){
65
+ add_theme_page('Snazzy Maps', 'Snazzy Maps', 'edit_theme_options', 'snazzy_maps', 'admin_add_custom_content');
66
+ }
67
+ add_action( 'admin_menu', 'admin_add_custom_menu');
68
+
69
+ // Add a settings link to the plugin listing page
70
+ add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), 'my_plugin_action_links' );
71
+
72
+ function my_plugin_action_links( $links ) {
73
+ array_unshift($links, '<a href="'. get_admin_url(null, 'themes.php?page=snazzy_maps') .'">Settings</a>');
74
+ return $links;
75
+ }
76
+
77
+ //The post method is performed by the tab before redirecting
78
+ add_action ('admin_head-appearance_page_snazzy_maps', 'admin_perform_post');
79
+ ?>