Version Description
- Text button option
- Bug fixes
Download this release
Release Info
Developer | syammohanm |
Plugin | WPFront Scroll Top |
Version | 1.2 |
Comparing to | |
See all releases |
Code changes from version 1.1.1 to 1.2
- classes/base/class-wpfront-base-menu.php +13 -15
- classes/class-wpfront-scroll-top-options.php +35 -18
- classes/class-wpfront-scroll-top.php +16 -5
- css/options.css +12 -0
- jquery-plugins/colorpicker/css/colorpicker.css +172 -0
- jquery-plugins/colorpicker/images/blank.gif +0 -0
- jquery-plugins/colorpicker/images/colorpicker_background.png +0 -0
- jquery-plugins/colorpicker/images/colorpicker_hex.png +0 -0
- jquery-plugins/colorpicker/images/colorpicker_hsb_b.png +0 -0
- jquery-plugins/colorpicker/images/colorpicker_hsb_h.png +0 -0
- jquery-plugins/colorpicker/images/colorpicker_hsb_s.png +0 -0
- jquery-plugins/colorpicker/images/colorpicker_indic.gif +0 -0
- jquery-plugins/colorpicker/images/colorpicker_overlay.png +0 -0
- jquery-plugins/colorpicker/images/colorpicker_rgb_b.png +0 -0
- jquery-plugins/colorpicker/images/colorpicker_rgb_g.png +0 -0
- jquery-plugins/colorpicker/images/colorpicker_rgb_r.png +0 -0
- jquery-plugins/colorpicker/images/colorpicker_select.gif +0 -0
- jquery-plugins/colorpicker/images/colorpicker_submit.png +0 -0
- jquery-plugins/colorpicker/images/custom_background.png +0 -0
- jquery-plugins/colorpicker/images/custom_hex.png +0 -0
- jquery-plugins/colorpicker/images/custom_hsb_b.png +0 -0
- jquery-plugins/colorpicker/images/custom_hsb_h.png +0 -0
- jquery-plugins/colorpicker/images/custom_hsb_s.png +0 -0
- jquery-plugins/colorpicker/images/custom_indic.gif +0 -0
- jquery-plugins/colorpicker/images/custom_rgb_b.png +0 -0
- jquery-plugins/colorpicker/images/custom_rgb_g.png +0 -0
- jquery-plugins/colorpicker/images/custom_rgb_r.png +0 -0
- jquery-plugins/colorpicker/images/custom_submit.png +0 -0
- jquery-plugins/colorpicker/images/select.png +0 -0
- jquery-plugins/colorpicker/images/select2.png +0 -0
- jquery-plugins/colorpicker/images/slider.png +0 -0
- jquery-plugins/colorpicker/js/colorpicker.js +484 -0
- js/wpfront-scroll-top.js +12 -4
- languages/wpfront-scroll-top.mo +0 -0
- languages/wpfront-scroll-top.po +59 -44
- readme.txt +13 -3
- templates/options-template.php +81 -1
- templates/scroll-top-template.php +38 -1
- wpfront-scroll-top.php +1 -1
classes/base/class-wpfront-base-menu.php
CHANGED
@@ -46,24 +46,18 @@ if (!class_exists('WPFront_Base_Menu')) {
|
|
46 |
return '1.0';
|
47 |
}
|
48 |
|
49 |
-
protected function print_column_headers() {
|
50 |
-
echo '<tr
|
51 |
. '<th class="check-column"></th>'
|
52 |
-
. '<th>' . $this->__('Name') . '</th>'
|
53 |
-
. '<th>' . $this->__('Version') . '</th>'
|
54 |
-
. '<th>' . $this->__('Rating') . '</th>'
|
55 |
-
. '<th>' . $this->__('Description') . '</th>'
|
56 |
-
. '</
|
57 |
}
|
58 |
|
59 |
protected function print_column_footers() {
|
60 |
-
|
61 |
-
. '<th class="check-column"></th>'
|
62 |
-
. '<th>' . $this->__('Name') . '</th>'
|
63 |
-
. '<th>' . $this->__('Version') . '</th>'
|
64 |
-
. '<th>' . $this->__('Rating') . '</th>'
|
65 |
-
. '<th>' . $this->__('Description') . '</th>'
|
66 |
-
. '</thead></tr>';
|
67 |
}
|
68 |
|
69 |
protected function wp_star_rating($args) {
|
@@ -127,7 +121,7 @@ if (!class_exists('WPFront_Base_Menu')) {
|
|
127 |
<?php
|
128 |
echo '<div class="wrap wpfront-container">';
|
129 |
echo '<h2>' . $this->__('WPFront Plugins') . '</h2>';
|
130 |
-
echo '<table class="wp-list-table widefat plugins">';
|
131 |
$this->print_column_headers();
|
132 |
|
133 |
foreach ((array) $api->plugins as $plugin) {
|
@@ -223,6 +217,10 @@ if (!class_exists('WPFront_Base_Menu')) {
|
|
223 |
add_submenu_page($menu_slug, $this->__('WPFront Plugins'), $this->__('All Plugins'), 'manage_options', $menu_slug, array('WPFront_Base_Menu', 'plugin_list'));
|
224 |
}
|
225 |
|
|
|
|
|
|
|
|
|
226 |
//$extra_menu = array_pop($submenu[$menu_slug]);
|
227 |
|
228 |
foreach ($menu_data as $value) {
|
46 |
return '1.0';
|
47 |
}
|
48 |
|
49 |
+
protected function print_column_headers($tag = 'thead') {
|
50 |
+
echo '<' . $tag . '><tr>'
|
51 |
. '<th class="check-column"></th>'
|
52 |
+
. '<th scope="col" id="name" class="manage-column column-name">' . $this->__('Name') . '</th>'
|
53 |
+
. '<th scope="col" id="version" class="manage-column column-version">' . $this->__('Version') . '</th>'
|
54 |
+
. '<th scope="col" id="rating" class="manage-column column-rating">' . $this->__('Rating') . '</th>'
|
55 |
+
. '<th scope="col" id="description" class="manage-column column-description">' . $this->__('Description') . '</th>'
|
56 |
+
. '</tr></' . $tag . '>';
|
57 |
}
|
58 |
|
59 |
protected function print_column_footers() {
|
60 |
+
$this->print_column_headers('tfoot');
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
}
|
62 |
|
63 |
protected function wp_star_rating($args) {
|
121 |
<?php
|
122 |
echo '<div class="wrap wpfront-container">';
|
123 |
echo '<h2>' . $this->__('WPFront Plugins') . '</h2>';
|
124 |
+
echo '<table class="wp-list-table widefat plugins plugin-install">';
|
125 |
$this->print_column_headers();
|
126 |
|
127 |
foreach ((array) $api->plugins as $plugin) {
|
217 |
add_submenu_page($menu_slug, $this->__('WPFront Plugins'), $this->__('All Plugins'), 'manage_options', $menu_slug, array('WPFront_Base_Menu', 'plugin_list'));
|
218 |
}
|
219 |
|
220 |
+
if (empty($submenu[$menu_slug])) {
|
221 |
+
return;
|
222 |
+
}
|
223 |
+
|
224 |
//$extra_menu = array_pop($submenu[$menu_slug]);
|
225 |
|
226 |
foreach ($menu_data as $value) {
|
classes/class-wpfront-scroll-top-options.php
CHANGED
@@ -49,41 +49,58 @@ if (!class_exists('WPFront_Scroll_Top_Options')) {
|
|
49 |
$this->addOption('small_device_width', 'int', 640, array($this, 'validate_zero_positive'))->__('Small Device Max Width');
|
50 |
$this->addOption('hide_small_window', 'bit', FALSE)->__('Hide on Small Window');
|
51 |
$this->addOption('small_window_width', 'int', 640, array($this, 'validate_zero_positive'))->__('Small Window Max Width');
|
52 |
-
|
|
|
53 |
$this->addOption('location', 'int', 1, array($this, 'validate_range_1_4'))->__('Location');
|
54 |
$this->addOption('marginX', 'int', 20)->__('Margin X');
|
55 |
$this->addOption('marginY', 'int', 20)->__('Margin Y');
|
56 |
-
|
|
|
|
|
|
|
|
|
|
|
57 |
$this->addOption('image', 'string', '1.png');
|
58 |
$this->addOption('custom_url', 'string', '');
|
59 |
}
|
60 |
|
61 |
-
protected function validate_zero_positive($arg) {
|
62 |
-
if($arg < 0)
|
63 |
-
return 0;
|
64 |
-
|
65 |
-
return $arg;
|
66 |
-
}
|
67 |
-
|
68 |
protected function validate_range_0_100($arg) {
|
69 |
-
if($arg < 0)
|
70 |
return 0;
|
71 |
-
|
72 |
-
if($arg > 100)
|
73 |
return 100;
|
74 |
-
|
75 |
return $arg;
|
76 |
}
|
77 |
-
|
78 |
protected function validate_range_1_4($arg) {
|
79 |
-
if($arg < 1)
|
80 |
return 1;
|
81 |
-
|
82 |
-
if($arg > 4)
|
83 |
return 4;
|
84 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
return $arg;
|
86 |
}
|
|
|
87 |
}
|
88 |
|
89 |
}
|
49 |
$this->addOption('small_device_width', 'int', 640, array($this, 'validate_zero_positive'))->__('Small Device Max Width');
|
50 |
$this->addOption('hide_small_window', 'bit', FALSE)->__('Hide on Small Window');
|
51 |
$this->addOption('small_window_width', 'int', 640, array($this, 'validate_zero_positive'))->__('Small Window Max Width');
|
52 |
+
$this->addOption('button_style', 'string', 'image', array($this, 'validate_button_style'))->__('Button Style');
|
53 |
+
|
54 |
$this->addOption('location', 'int', 1, array($this, 'validate_range_1_4'))->__('Location');
|
55 |
$this->addOption('marginX', 'int', 20)->__('Margin X');
|
56 |
$this->addOption('marginY', 'int', 20)->__('Margin Y');
|
57 |
+
|
58 |
+
$this->addOption('text_button_text', 'string', '')->__('Text');
|
59 |
+
$this->addOption('text_button_text_color', 'string', '#ffffff', array($this, 'validate_color'))->__('Text Color');
|
60 |
+
$this->addOption('text_button_background_color', 'string', '#000000', array($this, 'validate_color'))->__('Background Color');
|
61 |
+
$this->addOption('text_button_css', 'string', '')->__('Custom CSS');
|
62 |
+
|
63 |
$this->addOption('image', 'string', '1.png');
|
64 |
$this->addOption('custom_url', 'string', '');
|
65 |
}
|
66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
protected function validate_range_0_100($arg) {
|
68 |
+
if ($arg < 0)
|
69 |
return 0;
|
70 |
+
|
71 |
+
if ($arg > 100)
|
72 |
return 100;
|
73 |
+
|
74 |
return $arg;
|
75 |
}
|
76 |
+
|
77 |
protected function validate_range_1_4($arg) {
|
78 |
+
if ($arg < 1)
|
79 |
return 1;
|
80 |
+
|
81 |
+
if ($arg > 4)
|
82 |
return 4;
|
83 |
+
|
84 |
+
return $arg;
|
85 |
+
}
|
86 |
+
|
87 |
+
protected function validate_button_style($arg) {
|
88 |
+
if ($arg == 'text')
|
89 |
+
return $arg;
|
90 |
+
|
91 |
+
return 'image';
|
92 |
+
}
|
93 |
+
|
94 |
+
protected function validate_color($arg) {
|
95 |
+
if (strlen($arg) != 7)
|
96 |
+
return '#ffffff';
|
97 |
+
|
98 |
+
if (strpos($arg, '#') != 0)
|
99 |
+
return '#ffffff';
|
100 |
+
|
101 |
return $arg;
|
102 |
}
|
103 |
+
|
104 |
}
|
105 |
|
106 |
}
|
classes/class-wpfront-scroll-top.php
CHANGED
@@ -36,7 +36,7 @@ if (!class_exists('WPFront_Scroll_Top')) {
|
|
36 |
class WPFront_Scroll_Top extends WPFront_Base {
|
37 |
|
38 |
//Constants
|
39 |
-
const VERSION = '1.
|
40 |
const OPTIONS_GROUP_NAME = 'wpfront-scroll-top-options-group';
|
41 |
const OPTION_NAME = 'wpfront-scroll-top-options';
|
42 |
const PLUGIN_SLUG = 'wpfront-scroll-top';
|
@@ -59,7 +59,7 @@ if (!class_exists('WPFront_Scroll_Top')) {
|
|
59 |
|
60 |
add_action('wp_footer', array(&$this, 'write_markup'));
|
61 |
add_action('shutdown', array(&$this, 'write_markup'));
|
62 |
-
|
63 |
$this->add_menu($this->__('WPFront Scroll Top'), $this->__('Scroll Top'));
|
64 |
}
|
65 |
|
@@ -88,13 +88,23 @@ if (!class_exists('WPFront_Scroll_Top')) {
|
|
88 |
|
89 |
public function admin_init() {
|
90 |
register_setting(self::OPTIONS_GROUP_NAME, self::OPTION_NAME);
|
91 |
-
|
92 |
$this->enqueue_styles();
|
93 |
$this->enqueue_scripts();
|
94 |
}
|
95 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
//options page styles
|
97 |
public function enqueue_options_styles() {
|
|
|
|
|
|
|
98 |
$styleRoot = $this->pluginURLRoot . 'css/';
|
99 |
wp_enqueue_style('wpfront-scroll-top-options', $styleRoot . 'options.css', array(), self::VERSION);
|
100 |
}
|
@@ -113,7 +123,7 @@ if (!class_exists('WPFront_Scroll_Top')) {
|
|
113 |
if ($this->scriptLoaded != TRUE) {
|
114 |
return;
|
115 |
}
|
116 |
-
|
117 |
if (WPFront_Static::doing_ajax()) {
|
118 |
return;
|
119 |
}
|
@@ -145,10 +155,11 @@ if (!class_exists('WPFront_Scroll_Top')) {
|
|
145 |
}
|
146 |
|
147 |
private function image() {
|
148 |
-
if($this->options->image() == 'custom')
|
149 |
return $this->options->custom_url();
|
150 |
return $this->iconsURL . $this->options->image();
|
151 |
}
|
|
|
152 |
}
|
153 |
|
154 |
}
|
36 |
class WPFront_Scroll_Top extends WPFront_Base {
|
37 |
|
38 |
//Constants
|
39 |
+
const VERSION = '1.2';
|
40 |
const OPTIONS_GROUP_NAME = 'wpfront-scroll-top-options-group';
|
41 |
const OPTION_NAME = 'wpfront-scroll-top-options';
|
42 |
const PLUGIN_SLUG = 'wpfront-scroll-top';
|
59 |
|
60 |
add_action('wp_footer', array(&$this, 'write_markup'));
|
61 |
add_action('shutdown', array(&$this, 'write_markup'));
|
62 |
+
|
63 |
$this->add_menu($this->__('WPFront Scroll Top'), $this->__('Scroll Top'));
|
64 |
}
|
65 |
|
88 |
|
89 |
public function admin_init() {
|
90 |
register_setting(self::OPTIONS_GROUP_NAME, self::OPTION_NAME);
|
91 |
+
|
92 |
$this->enqueue_styles();
|
93 |
$this->enqueue_scripts();
|
94 |
}
|
95 |
|
96 |
+
public function enqueue_options_scripts() {
|
97 |
+
$this->enqueue_scripts();
|
98 |
+
|
99 |
+
$jsRoot = $this->pluginURLRoot . 'jquery-plugins/colorpicker/js/';
|
100 |
+
wp_enqueue_script('jquery.eyecon.colorpicker', $jsRoot . 'colorpicker.js', array('jquery'), self::VERSION);
|
101 |
+
}
|
102 |
+
|
103 |
//options page styles
|
104 |
public function enqueue_options_styles() {
|
105 |
+
$styleRoot = $this->pluginURLRoot . 'jquery-plugins/colorpicker/css/';
|
106 |
+
wp_enqueue_style('jquery.eyecon.colorpicker.colorpicker', $styleRoot . 'colorpicker.css', array(), self::VERSION);
|
107 |
+
|
108 |
$styleRoot = $this->pluginURLRoot . 'css/';
|
109 |
wp_enqueue_style('wpfront-scroll-top-options', $styleRoot . 'options.css', array(), self::VERSION);
|
110 |
}
|
123 |
if ($this->scriptLoaded != TRUE) {
|
124 |
return;
|
125 |
}
|
126 |
+
|
127 |
if (WPFront_Static::doing_ajax()) {
|
128 |
return;
|
129 |
}
|
155 |
}
|
156 |
|
157 |
private function image() {
|
158 |
+
if ($this->options->image() == 'custom')
|
159 |
return $this->options->custom_url();
|
160 |
return $this->iconsURL . $this->options->image();
|
161 |
}
|
162 |
+
|
163 |
}
|
164 |
|
165 |
}
|
css/options.css
CHANGED
@@ -39,3 +39,15 @@
|
|
39 |
width: 50%;
|
40 |
}
|
41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
width: 50%;
|
40 |
}
|
41 |
|
42 |
+
#wpfront-scroll-top-options table.form-table .color-selector-div
|
43 |
+
{
|
44 |
+
display: inline-block;
|
45 |
+
width: 100px;
|
46 |
+
}
|
47 |
+
|
48 |
+
#wpfront-scroll-top-options table.form-table .color-selector
|
49 |
+
{
|
50 |
+
vertical-align: middle;
|
51 |
+
}
|
52 |
+
|
53 |
+
|
jquery-plugins/colorpicker/css/colorpicker.css
ADDED
@@ -0,0 +1,172 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.colorpicker {
|
2 |
+
width: 356px;
|
3 |
+
height: 176px;
|
4 |
+
overflow: hidden;
|
5 |
+
position: absolute;
|
6 |
+
background: url(../images/colorpicker_background.png);
|
7 |
+
font-family: Arial, Helvetica, sans-serif;
|
8 |
+
display: none;
|
9 |
+
}
|
10 |
+
.colorpicker_color {
|
11 |
+
width: 150px;
|
12 |
+
height: 150px;
|
13 |
+
left: 14px;
|
14 |
+
top: 13px;
|
15 |
+
position: absolute;
|
16 |
+
background: #f00;
|
17 |
+
overflow: hidden;
|
18 |
+
cursor: crosshair;
|
19 |
+
}
|
20 |
+
.colorpicker_color div {
|
21 |
+
position: absolute;
|
22 |
+
top: 0;
|
23 |
+
left: 0;
|
24 |
+
width: 150px;
|
25 |
+
height: 150px;
|
26 |
+
background: url(../images/colorpicker_overlay.png);
|
27 |
+
}
|
28 |
+
.colorpicker_color div div {
|
29 |
+
position: absolute;
|
30 |
+
top: 0;
|
31 |
+
left: 0;
|
32 |
+
width: 11px;
|
33 |
+
height: 11px;
|
34 |
+
overflow: hidden;
|
35 |
+
background: url(../images/colorpicker_select.gif);
|
36 |
+
margin: -5px 0 0 -5px;
|
37 |
+
}
|
38 |
+
.colorpicker_hue {
|
39 |
+
position: absolute;
|
40 |
+
top: 13px;
|
41 |
+
left: 171px;
|
42 |
+
width: 35px;
|
43 |
+
height: 150px;
|
44 |
+
cursor: n-resize;
|
45 |
+
}
|
46 |
+
.colorpicker_hue div {
|
47 |
+
position: absolute;
|
48 |
+
width: 35px;
|
49 |
+
height: 9px;
|
50 |
+
overflow: hidden;
|
51 |
+
background: url(../images/colorpicker_indic.gif) left top;
|
52 |
+
margin: -4px 0 0 0;
|
53 |
+
left: 0px;
|
54 |
+
}
|
55 |
+
.colorpicker_new_color {
|
56 |
+
position: absolute;
|
57 |
+
width: 60px;
|
58 |
+
height: 30px;
|
59 |
+
left: 213px;
|
60 |
+
top: 13px;
|
61 |
+
background: #f00;
|
62 |
+
}
|
63 |
+
.colorpicker_current_color {
|
64 |
+
position: absolute;
|
65 |
+
width: 60px;
|
66 |
+
height: 30px;
|
67 |
+
left: 283px;
|
68 |
+
top: 13px;
|
69 |
+
background: #f00;
|
70 |
+
}
|
71 |
+
.colorpicker input {
|
72 |
+
background-color: transparent;
|
73 |
+
border: 1px solid transparent;
|
74 |
+
position: absolute;
|
75 |
+
font-size: 10px;
|
76 |
+
font-family: Arial, Helvetica, sans-serif;
|
77 |
+
color: #898989;
|
78 |
+
top: 4px;
|
79 |
+
right: 11px;
|
80 |
+
text-align: right;
|
81 |
+
margin: 0;
|
82 |
+
padding: 0;
|
83 |
+
height: 13px;
|
84 |
+
outline: none;
|
85 |
+
}
|
86 |
+
|
87 |
+
.colorpicker_hex {
|
88 |
+
position: absolute;
|
89 |
+
width: 72px;
|
90 |
+
height: 22px;
|
91 |
+
background: url(../images/colorpicker_hex.png) top;
|
92 |
+
left: 212px;
|
93 |
+
top: 142px;
|
94 |
+
}
|
95 |
+
.colorpicker_hex input {
|
96 |
+
right: 6px;
|
97 |
+
}
|
98 |
+
.colorpicker_field {
|
99 |
+
height: 22px;
|
100 |
+
width: 62px;
|
101 |
+
background-position: top;
|
102 |
+
position: absolute;
|
103 |
+
}
|
104 |
+
.colorpicker_field span {
|
105 |
+
position: absolute;
|
106 |
+
width: 12px;
|
107 |
+
height: 22px;
|
108 |
+
overflow: hidden;
|
109 |
+
top: 0;
|
110 |
+
right: 0;
|
111 |
+
cursor: n-resize;
|
112 |
+
}
|
113 |
+
.colorpicker_rgb_r {
|
114 |
+
background-image: url(../images/colorpicker_rgb_r.png);
|
115 |
+
top: 52px;
|
116 |
+
left: 212px;
|
117 |
+
}
|
118 |
+
.colorpicker_rgb_g {
|
119 |
+
background-image: url(../images/colorpicker_rgb_g.png);
|
120 |
+
top: 82px;
|
121 |
+
left: 212px;
|
122 |
+
}
|
123 |
+
.colorpicker_rgb_b {
|
124 |
+
background-image: url(../images/colorpicker_rgb_b.png);
|
125 |
+
top: 112px;
|
126 |
+
left: 212px;
|
127 |
+
}
|
128 |
+
.colorpicker_hsb_h {
|
129 |
+
background-image: url(../images/colorpicker_hsb_h.png);
|
130 |
+
top: 52px;
|
131 |
+
left: 282px;
|
132 |
+
}
|
133 |
+
.colorpicker_hsb_s {
|
134 |
+
background-image: url(../images/colorpicker_hsb_s.png);
|
135 |
+
top: 82px;
|
136 |
+
left: 282px;
|
137 |
+
}
|
138 |
+
.colorpicker_hsb_b {
|
139 |
+
background-image: url(../images/colorpicker_hsb_b.png);
|
140 |
+
top: 112px;
|
141 |
+
left: 282px;
|
142 |
+
}
|
143 |
+
.colorpicker_submit {
|
144 |
+
position: absolute;
|
145 |
+
width: 22px;
|
146 |
+
height: 22px;
|
147 |
+
background: url(../images/colorpicker_submit.png) top;
|
148 |
+
left: 322px;
|
149 |
+
top: 142px;
|
150 |
+
overflow: hidden;
|
151 |
+
}
|
152 |
+
.colorpicker_focus {
|
153 |
+
background-position: center;
|
154 |
+
}
|
155 |
+
.colorpicker_hex.colorpicker_focus {
|
156 |
+
background-position: bottom;
|
157 |
+
}
|
158 |
+
.colorpicker_submit.colorpicker_focus {
|
159 |
+
background-position: bottom;
|
160 |
+
}
|
161 |
+
.colorpicker_slider {
|
162 |
+
background-position: bottom;
|
163 |
+
}
|
164 |
+
|
165 |
+
|
166 |
+
.color-selector
|
167 |
+
{
|
168 |
+
display: inline-block;
|
169 |
+
width: 26px;
|
170 |
+
height: 26px;
|
171 |
+
background: url(../images/select2.png) center;
|
172 |
+
}
|
jquery-plugins/colorpicker/images/blank.gif
ADDED
Binary file
|
jquery-plugins/colorpicker/images/colorpicker_background.png
ADDED
Binary file
|
jquery-plugins/colorpicker/images/colorpicker_hex.png
ADDED
Binary file
|
jquery-plugins/colorpicker/images/colorpicker_hsb_b.png
ADDED
Binary file
|
jquery-plugins/colorpicker/images/colorpicker_hsb_h.png
ADDED
Binary file
|
jquery-plugins/colorpicker/images/colorpicker_hsb_s.png
ADDED
Binary file
|
jquery-plugins/colorpicker/images/colorpicker_indic.gif
ADDED
Binary file
|
jquery-plugins/colorpicker/images/colorpicker_overlay.png
ADDED
Binary file
|
jquery-plugins/colorpicker/images/colorpicker_rgb_b.png
ADDED
Binary file
|
jquery-plugins/colorpicker/images/colorpicker_rgb_g.png
ADDED
Binary file
|
jquery-plugins/colorpicker/images/colorpicker_rgb_r.png
ADDED
Binary file
|
jquery-plugins/colorpicker/images/colorpicker_select.gif
ADDED
Binary file
|
jquery-plugins/colorpicker/images/colorpicker_submit.png
ADDED
Binary file
|
jquery-plugins/colorpicker/images/custom_background.png
ADDED
Binary file
|
jquery-plugins/colorpicker/images/custom_hex.png
ADDED
Binary file
|
jquery-plugins/colorpicker/images/custom_hsb_b.png
ADDED
Binary file
|
jquery-plugins/colorpicker/images/custom_hsb_h.png
ADDED
Binary file
|
jquery-plugins/colorpicker/images/custom_hsb_s.png
ADDED
Binary file
|
jquery-plugins/colorpicker/images/custom_indic.gif
ADDED
Binary file
|
jquery-plugins/colorpicker/images/custom_rgb_b.png
ADDED
Binary file
|
jquery-plugins/colorpicker/images/custom_rgb_g.png
ADDED
Binary file
|
jquery-plugins/colorpicker/images/custom_rgb_r.png
ADDED
Binary file
|
jquery-plugins/colorpicker/images/custom_submit.png
ADDED
Binary file
|
jquery-plugins/colorpicker/images/select.png
ADDED
Binary file
|
jquery-plugins/colorpicker/images/select2.png
ADDED
Binary file
|
jquery-plugins/colorpicker/images/slider.png
ADDED
Binary file
|
jquery-plugins/colorpicker/js/colorpicker.js
ADDED
@@ -0,0 +1,484 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
*
|
3 |
+
* Color picker
|
4 |
+
* Author: Stefan Petre www.eyecon.ro
|
5 |
+
*
|
6 |
+
* Dual licensed under the MIT and GPL licenses
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
(function ($) {
|
10 |
+
var ColorPicker = function () {
|
11 |
+
var
|
12 |
+
ids = {},
|
13 |
+
inAction,
|
14 |
+
charMin = 65,
|
15 |
+
visible,
|
16 |
+
tpl = '<div class="colorpicker"><div class="colorpicker_color"><div><div></div></div></div><div class="colorpicker_hue"><div></div></div><div class="colorpicker_new_color"></div><div class="colorpicker_current_color"></div><div class="colorpicker_hex"><input type="text" maxlength="6" size="6" /></div><div class="colorpicker_rgb_r colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_g colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_h colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_s colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_submit"></div></div>',
|
17 |
+
defaults = {
|
18 |
+
eventName: 'click',
|
19 |
+
onShow: function () {},
|
20 |
+
onBeforeShow: function(){},
|
21 |
+
onHide: function () {},
|
22 |
+
onChange: function () {},
|
23 |
+
onSubmit: function () {},
|
24 |
+
color: 'ff0000',
|
25 |
+
livePreview: true,
|
26 |
+
flat: false
|
27 |
+
},
|
28 |
+
fillRGBFields = function (hsb, cal) {
|
29 |
+
var rgb = HSBToRGB(hsb);
|
30 |
+
$(cal).data('colorpicker').fields
|
31 |
+
.eq(1).val(rgb.r).end()
|
32 |
+
.eq(2).val(rgb.g).end()
|
33 |
+
.eq(3).val(rgb.b).end();
|
34 |
+
},
|
35 |
+
fillHSBFields = function (hsb, cal) {
|
36 |
+
$(cal).data('colorpicker').fields
|
37 |
+
.eq(4).val(hsb.h).end()
|
38 |
+
.eq(5).val(hsb.s).end()
|
39 |
+
.eq(6).val(hsb.b).end();
|
40 |
+
},
|
41 |
+
fillHexFields = function (hsb, cal) {
|
42 |
+
$(cal).data('colorpicker').fields
|
43 |
+
.eq(0).val(HSBToHex(hsb)).end();
|
44 |
+
},
|
45 |
+
setSelector = function (hsb, cal) {
|
46 |
+
$(cal).data('colorpicker').selector.css('backgroundColor', '#' + HSBToHex({h: hsb.h, s: 100, b: 100}));
|
47 |
+
$(cal).data('colorpicker').selectorIndic.css({
|
48 |
+
left: parseInt(150 * hsb.s/100, 10),
|
49 |
+
top: parseInt(150 * (100-hsb.b)/100, 10)
|
50 |
+
});
|
51 |
+
},
|
52 |
+
setHue = function (hsb, cal) {
|
53 |
+
$(cal).data('colorpicker').hue.css('top', parseInt(150 - 150 * hsb.h/360, 10));
|
54 |
+
},
|
55 |
+
setCurrentColor = function (hsb, cal) {
|
56 |
+
$(cal).data('colorpicker').currentColor.css('backgroundColor', '#' + HSBToHex(hsb));
|
57 |
+
},
|
58 |
+
setNewColor = function (hsb, cal) {
|
59 |
+
$(cal).data('colorpicker').newColor.css('backgroundColor', '#' + HSBToHex(hsb));
|
60 |
+
},
|
61 |
+
keyDown = function (ev) {
|
62 |
+
var pressedKey = ev.charCode || ev.keyCode || -1;
|
63 |
+
if ((pressedKey > charMin && pressedKey <= 90) || pressedKey == 32) {
|
64 |
+
return false;
|
65 |
+
}
|
66 |
+
var cal = $(this).parent().parent();
|
67 |
+
if (cal.data('colorpicker').livePreview === true) {
|
68 |
+
change.apply(this);
|
69 |
+
}
|
70 |
+
},
|
71 |
+
change = function (ev) {
|
72 |
+
var cal = $(this).parent().parent(), col;
|
73 |
+
if (this.parentNode.className.indexOf('_hex') > 0) {
|
74 |
+
cal.data('colorpicker').color = col = HexToHSB(fixHex(this.value));
|
75 |
+
} else if (this.parentNode.className.indexOf('_hsb') > 0) {
|
76 |
+
cal.data('colorpicker').color = col = fixHSB({
|
77 |
+
h: parseInt(cal.data('colorpicker').fields.eq(4).val(), 10),
|
78 |
+
s: parseInt(cal.data('colorpicker').fields.eq(5).val(), 10),
|
79 |
+
b: parseInt(cal.data('colorpicker').fields.eq(6).val(), 10)
|
80 |
+
});
|
81 |
+
} else {
|
82 |
+
cal.data('colorpicker').color = col = RGBToHSB(fixRGB({
|
83 |
+
r: parseInt(cal.data('colorpicker').fields.eq(1).val(), 10),
|
84 |
+
g: parseInt(cal.data('colorpicker').fields.eq(2).val(), 10),
|
85 |
+
b: parseInt(cal.data('colorpicker').fields.eq(3).val(), 10)
|
86 |
+
}));
|
87 |
+
}
|
88 |
+
if (ev) {
|
89 |
+
fillRGBFields(col, cal.get(0));
|
90 |
+
fillHexFields(col, cal.get(0));
|
91 |
+
fillHSBFields(col, cal.get(0));
|
92 |
+
}
|
93 |
+
setSelector(col, cal.get(0));
|
94 |
+
setHue(col, cal.get(0));
|
95 |
+
setNewColor(col, cal.get(0));
|
96 |
+
cal.data('colorpicker').onChange.apply(cal, [col, HSBToHex(col), HSBToRGB(col)]);
|
97 |
+
},
|
98 |
+
blur = function (ev) {
|
99 |
+
var cal = $(this).parent().parent();
|
100 |
+
cal.data('colorpicker').fields.parent().removeClass('colorpicker_focus');
|
101 |
+
},
|
102 |
+
focus = function () {
|
103 |
+
charMin = this.parentNode.className.indexOf('_hex') > 0 ? 70 : 65;
|
104 |
+
$(this).parent().parent().data('colorpicker').fields.parent().removeClass('colorpicker_focus');
|
105 |
+
$(this).parent().addClass('colorpicker_focus');
|
106 |
+
},
|
107 |
+
downIncrement = function (ev) {
|
108 |
+
var field = $(this).parent().find('input').focus();
|
109 |
+
var current = {
|
110 |
+
el: $(this).parent().addClass('colorpicker_slider'),
|
111 |
+
max: this.parentNode.className.indexOf('_hsb_h') > 0 ? 360 : (this.parentNode.className.indexOf('_hsb') > 0 ? 100 : 255),
|
112 |
+
y: ev.pageY,
|
113 |
+
field: field,
|
114 |
+
val: parseInt(field.val(), 10),
|
115 |
+
preview: $(this).parent().parent().data('colorpicker').livePreview
|
116 |
+
};
|
117 |
+
$(document).bind('mouseup', current, upIncrement);
|
118 |
+
$(document).bind('mousemove', current, moveIncrement);
|
119 |
+
},
|
120 |
+
moveIncrement = function (ev) {
|
121 |
+
ev.data.field.val(Math.max(0, Math.min(ev.data.max, parseInt(ev.data.val + ev.pageY - ev.data.y, 10))));
|
122 |
+
if (ev.data.preview) {
|
123 |
+
change.apply(ev.data.field.get(0), [true]);
|
124 |
+
}
|
125 |
+
return false;
|
126 |
+
},
|
127 |
+
upIncrement = function (ev) {
|
128 |
+
change.apply(ev.data.field.get(0), [true]);
|
129 |
+
ev.data.el.removeClass('colorpicker_slider').find('input').focus();
|
130 |
+
$(document).unbind('mouseup', upIncrement);
|
131 |
+
$(document).unbind('mousemove', moveIncrement);
|
132 |
+
return false;
|
133 |
+
},
|
134 |
+
downHue = function (ev) {
|
135 |
+
var current = {
|
136 |
+
cal: $(this).parent(),
|
137 |
+
y: $(this).offset().top
|
138 |
+
};
|
139 |
+
current.preview = current.cal.data('colorpicker').livePreview;
|
140 |
+
$(document).bind('mouseup', current, upHue);
|
141 |
+
$(document).bind('mousemove', current, moveHue);
|
142 |
+
},
|
143 |
+
moveHue = function (ev) {
|
144 |
+
change.apply(
|
145 |
+
ev.data.cal.data('colorpicker')
|
146 |
+
.fields
|
147 |
+
.eq(4)
|
148 |
+
.val(parseInt(360*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.y))))/150, 10))
|
149 |
+
.get(0),
|
150 |
+
[ev.data.preview]
|
151 |
+
);
|
152 |
+
return false;
|
153 |
+
},
|
154 |
+
upHue = function (ev) {
|
155 |
+
fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
|
156 |
+
fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
|
157 |
+
$(document).unbind('mouseup', upHue);
|
158 |
+
$(document).unbind('mousemove', moveHue);
|
159 |
+
return false;
|
160 |
+
},
|
161 |
+
downSelector = function (ev) {
|
162 |
+
var current = {
|
163 |
+
cal: $(this).parent(),
|
164 |
+
pos: $(this).offset()
|
165 |
+
};
|
166 |
+
current.preview = current.cal.data('colorpicker').livePreview;
|
167 |
+
$(document).bind('mouseup', current, upSelector);
|
168 |
+
$(document).bind('mousemove', current, moveSelector);
|
169 |
+
},
|
170 |
+
moveSelector = function (ev) {
|
171 |
+
change.apply(
|
172 |
+
ev.data.cal.data('colorpicker')
|
173 |
+
.fields
|
174 |
+
.eq(6)
|
175 |
+
.val(parseInt(100*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.pos.top))))/150, 10))
|
176 |
+
.end()
|
177 |
+
.eq(5)
|
178 |
+
.val(parseInt(100*(Math.max(0,Math.min(150,(ev.pageX - ev.data.pos.left))))/150, 10))
|
179 |
+
.get(0),
|
180 |
+
[ev.data.preview]
|
181 |
+
);
|
182 |
+
return false;
|
183 |
+
},
|
184 |
+
upSelector = function (ev) {
|
185 |
+
fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
|
186 |
+
fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
|
187 |
+
$(document).unbind('mouseup', upSelector);
|
188 |
+
$(document).unbind('mousemove', moveSelector);
|
189 |
+
return false;
|
190 |
+
},
|
191 |
+
enterSubmit = function (ev) {
|
192 |
+
$(this).addClass('colorpicker_focus');
|
193 |
+
},
|
194 |
+
leaveSubmit = function (ev) {
|
195 |
+
$(this).removeClass('colorpicker_focus');
|
196 |
+
},
|
197 |
+
clickSubmit = function (ev) {
|
198 |
+
var cal = $(this).parent();
|
199 |
+
var col = cal.data('colorpicker').color;
|
200 |
+
cal.data('colorpicker').origColor = col;
|
201 |
+
setCurrentColor(col, cal.get(0));
|
202 |
+
cal.data('colorpicker').onSubmit(col, HSBToHex(col), HSBToRGB(col), cal.data('colorpicker').el);
|
203 |
+
},
|
204 |
+
show = function (ev) {
|
205 |
+
var cal = $('#' + $(this).data('colorpickerId'));
|
206 |
+
cal.data('colorpicker').onBeforeShow.apply(this, [cal.get(0)]);
|
207 |
+
var pos = $(this).offset();
|
208 |
+
var viewPort = getViewport();
|
209 |
+
var top = pos.top + this.offsetHeight;
|
210 |
+
var left = pos.left;
|
211 |
+
if (top + 176 > viewPort.t + viewPort.h) {
|
212 |
+
top -= this.offsetHeight + 176;
|
213 |
+
}
|
214 |
+
if (left + 356 > viewPort.l + viewPort.w) {
|
215 |
+
left -= 356;
|
216 |
+
}
|
217 |
+
cal.css({left: left + 'px', top: top + 'px'});
|
218 |
+
if (cal.data('colorpicker').onShow.apply(this, [cal.get(0)]) != false) {
|
219 |
+
cal.show();
|
220 |
+
}
|
221 |
+
$(document).bind('mousedown', {cal: cal}, hide);
|
222 |
+
return false;
|
223 |
+
},
|
224 |
+
hide = function (ev) {
|
225 |
+
if (!isChildOf(ev.data.cal.get(0), ev.target, ev.data.cal.get(0))) {
|
226 |
+
if (ev.data.cal.data('colorpicker').onHide.apply(this, [ev.data.cal.get(0)]) != false) {
|
227 |
+
ev.data.cal.hide();
|
228 |
+
}
|
229 |
+
$(document).unbind('mousedown', hide);
|
230 |
+
}
|
231 |
+
},
|
232 |
+
isChildOf = function(parentEl, el, container) {
|
233 |
+
if (parentEl == el) {
|
234 |
+
return true;
|
235 |
+
}
|
236 |
+
if (parentEl.contains) {
|
237 |
+
return parentEl.contains(el);
|
238 |
+
}
|
239 |
+
if ( parentEl.compareDocumentPosition ) {
|
240 |
+
return !!(parentEl.compareDocumentPosition(el) & 16);
|
241 |
+
}
|
242 |
+
var prEl = el.parentNode;
|
243 |
+
while(prEl && prEl != container) {
|
244 |
+
if (prEl == parentEl)
|
245 |
+
return true;
|
246 |
+
prEl = prEl.parentNode;
|
247 |
+
}
|
248 |
+
return false;
|
249 |
+
},
|
250 |
+
getViewport = function () {
|
251 |
+
var m = document.compatMode == 'CSS1Compat';
|
252 |
+
return {
|
253 |
+
l : window.pageXOffset || (m ? document.documentElement.scrollLeft : document.body.scrollLeft),
|
254 |
+
t : window.pageYOffset || (m ? document.documentElement.scrollTop : document.body.scrollTop),
|
255 |
+
w : window.innerWidth || (m ? document.documentElement.clientWidth : document.body.clientWidth),
|
256 |
+
h : window.innerHeight || (m ? document.documentElement.clientHeight : document.body.clientHeight)
|
257 |
+
};
|
258 |
+
},
|
259 |
+
fixHSB = function (hsb) {
|
260 |
+
return {
|
261 |
+
h: Math.min(360, Math.max(0, hsb.h)),
|
262 |
+
s: Math.min(100, Math.max(0, hsb.s)),
|
263 |
+
b: Math.min(100, Math.max(0, hsb.b))
|
264 |
+
};
|
265 |
+
},
|
266 |
+
fixRGB = function (rgb) {
|
267 |
+
return {
|
268 |
+
r: Math.min(255, Math.max(0, rgb.r)),
|
269 |
+
g: Math.min(255, Math.max(0, rgb.g)),
|
270 |
+
b: Math.min(255, Math.max(0, rgb.b))
|
271 |
+
};
|
272 |
+
},
|
273 |
+
fixHex = function (hex) {
|
274 |
+
var len = 6 - hex.length;
|
275 |
+
if (len > 0) {
|
276 |
+
var o = [];
|
277 |
+
for (var i=0; i<len; i++) {
|
278 |
+
o.push('0');
|
279 |
+
}
|
280 |
+
o.push(hex);
|
281 |
+
hex = o.join('');
|
282 |
+
}
|
283 |
+
return hex;
|
284 |
+
},
|
285 |
+
HexToRGB = function (hex) {
|
286 |
+
var hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16);
|
287 |
+
return {r: hex >> 16, g: (hex & 0x00FF00) >> 8, b: (hex & 0x0000FF)};
|
288 |
+
},
|
289 |
+
HexToHSB = function (hex) {
|
290 |
+
return RGBToHSB(HexToRGB(hex));
|
291 |
+
},
|
292 |
+
RGBToHSB = function (rgb) {
|
293 |
+
var hsb = {
|
294 |
+
h: 0,
|
295 |
+
s: 0,
|
296 |
+
b: 0
|
297 |
+
};
|
298 |
+
var min = Math.min(rgb.r, rgb.g, rgb.b);
|
299 |
+
var max = Math.max(rgb.r, rgb.g, rgb.b);
|
300 |
+
var delta = max - min;
|
301 |
+
hsb.b = max;
|
302 |
+
if (max != 0) {
|
303 |
+
|
304 |
+
}
|
305 |
+
hsb.s = max != 0 ? 255 * delta / max : 0;
|
306 |
+
if (hsb.s != 0) {
|
307 |
+
if (rgb.r == max) {
|
308 |
+
hsb.h = (rgb.g - rgb.b) / delta;
|
309 |
+
} else if (rgb.g == max) {
|
310 |
+
hsb.h = 2 + (rgb.b - rgb.r) / delta;
|
311 |
+
} else {
|
312 |
+
hsb.h = 4 + (rgb.r - rgb.g) / delta;
|
313 |
+
}
|
314 |
+
} else {
|
315 |
+
hsb.h = -1;
|
316 |
+
}
|
317 |
+
hsb.h *= 60;
|
318 |
+
if (hsb.h < 0) {
|
319 |
+
hsb.h += 360;
|
320 |
+
}
|
321 |
+
hsb.s *= 100/255;
|
322 |
+
hsb.b *= 100/255;
|
323 |
+
return hsb;
|
324 |
+
},
|
325 |
+
HSBToRGB = function (hsb) {
|
326 |
+
var rgb = {};
|
327 |
+
var h = Math.round(hsb.h);
|
328 |
+
var s = Math.round(hsb.s*255/100);
|
329 |
+
var v = Math.round(hsb.b*255/100);
|
330 |
+
if(s == 0) {
|
331 |
+
rgb.r = rgb.g = rgb.b = v;
|
332 |
+
} else {
|
333 |
+
var t1 = v;
|
334 |
+
var t2 = (255-s)*v/255;
|
335 |
+
var t3 = (t1-t2)*(h%60)/60;
|
336 |
+
if(h==360) h = 0;
|
337 |
+
if(h<60) {rgb.r=t1; rgb.b=t2; rgb.g=t2+t3}
|
338 |
+
else if(h<120) {rgb.g=t1; rgb.b=t2; rgb.r=t1-t3}
|
339 |
+
else if(h<180) {rgb.g=t1; rgb.r=t2; rgb.b=t2+t3}
|
340 |
+
else if(h<240) {rgb.b=t1; rgb.r=t2; rgb.g=t1-t3}
|
341 |
+
else if(h<300) {rgb.b=t1; rgb.g=t2; rgb.r=t2+t3}
|
342 |
+
else if(h<360) {rgb.r=t1; rgb.g=t2; rgb.b=t1-t3}
|
343 |
+
else {rgb.r=0; rgb.g=0; rgb.b=0}
|
344 |
+
}
|
345 |
+
return {r:Math.round(rgb.r), g:Math.round(rgb.g), b:Math.round(rgb.b)};
|
346 |
+
},
|
347 |
+
RGBToHex = function (rgb) {
|
348 |
+
var hex = [
|
349 |
+
rgb.r.toString(16),
|
350 |
+
rgb.g.toString(16),
|
351 |
+
rgb.b.toString(16)
|
352 |
+
];
|
353 |
+
$.each(hex, function (nr, val) {
|
354 |
+
if (val.length == 1) {
|
355 |
+
hex[nr] = '0' + val;
|
356 |
+
}
|
357 |
+
});
|
358 |
+
return hex.join('');
|
359 |
+
},
|
360 |
+
HSBToHex = function (hsb) {
|
361 |
+
return RGBToHex(HSBToRGB(hsb));
|
362 |
+
},
|
363 |
+
restoreOriginal = function () {
|
364 |
+
var cal = $(this).parent();
|
365 |
+
var col = cal.data('colorpicker').origColor;
|
366 |
+
cal.data('colorpicker').color = col;
|
367 |
+
fillRGBFields(col, cal.get(0));
|
368 |
+
fillHexFields(col, cal.get(0));
|
369 |
+
fillHSBFields(col, cal.get(0));
|
370 |
+
setSelector(col, cal.get(0));
|
371 |
+
setHue(col, cal.get(0));
|
372 |
+
setNewColor(col, cal.get(0));
|
373 |
+
};
|
374 |
+
return {
|
375 |
+
init: function (opt) {
|
376 |
+
opt = $.extend({}, defaults, opt||{});
|
377 |
+
if (typeof opt.color == 'string') {
|
378 |
+
opt.color = HexToHSB(opt.color);
|
379 |
+
} else if (opt.color.r != undefined && opt.color.g != undefined && opt.color.b != undefined) {
|
380 |
+
opt.color = RGBToHSB(opt.color);
|
381 |
+
} else if (opt.color.h != undefined && opt.color.s != undefined && opt.color.b != undefined) {
|
382 |
+
opt.color = fixHSB(opt.color);
|
383 |
+
} else {
|
384 |
+
return this;
|
385 |
+
}
|
386 |
+
return this.each(function () {
|
387 |
+
if (!$(this).data('colorpickerId')) {
|
388 |
+
var options = $.extend({}, opt);
|
389 |
+
options.origColor = opt.color;
|
390 |
+
var id = 'collorpicker_' + parseInt(Math.random() * 1000);
|
391 |
+
$(this).data('colorpickerId', id);
|
392 |
+
var cal = $(tpl).attr('id', id);
|
393 |
+
if (options.flat) {
|
394 |
+
cal.appendTo(this).show();
|
395 |
+
} else {
|
396 |
+
cal.appendTo(document.body);
|
397 |
+
}
|
398 |
+
options.fields = cal
|
399 |
+
.find('input')
|
400 |
+
.bind('keyup', keyDown)
|
401 |
+
.bind('change', change)
|
402 |
+
.bind('blur', blur)
|
403 |
+
.bind('focus', focus);
|
404 |
+
cal
|
405 |
+
.find('span').bind('mousedown', downIncrement).end()
|
406 |
+
.find('>div.colorpicker_current_color').bind('click', restoreOriginal);
|
407 |
+
options.selector = cal.find('div.colorpicker_color').bind('mousedown', downSelector);
|
408 |
+
options.selectorIndic = options.selector.find('div div');
|
409 |
+
options.el = this;
|
410 |
+
options.hue = cal.find('div.colorpicker_hue div');
|
411 |
+
cal.find('div.colorpicker_hue').bind('mousedown', downHue);
|
412 |
+
options.newColor = cal.find('div.colorpicker_new_color');
|
413 |
+
options.currentColor = cal.find('div.colorpicker_current_color');
|
414 |
+
cal.data('colorpicker', options);
|
415 |
+
cal.find('div.colorpicker_submit')
|
416 |
+
.bind('mouseenter', enterSubmit)
|
417 |
+
.bind('mouseleave', leaveSubmit)
|
418 |
+
.bind('click', clickSubmit);
|
419 |
+
fillRGBFields(options.color, cal.get(0));
|
420 |
+
fillHSBFields(options.color, cal.get(0));
|
421 |
+
fillHexFields(options.color, cal.get(0));
|
422 |
+
setHue(options.color, cal.get(0));
|
423 |
+
setSelector(options.color, cal.get(0));
|
424 |
+
setCurrentColor(options.color, cal.get(0));
|
425 |
+
setNewColor(options.color, cal.get(0));
|
426 |
+
if (options.flat) {
|
427 |
+
cal.css({
|
428 |
+
position: 'relative',
|
429 |
+
display: 'block'
|
430 |
+
});
|
431 |
+
} else {
|
432 |
+
$(this).bind(options.eventName, show);
|
433 |
+
}
|
434 |
+
}
|
435 |
+
});
|
436 |
+
},
|
437 |
+
showPicker: function() {
|
438 |
+
return this.each( function () {
|
439 |
+
if ($(this).data('colorpickerId')) {
|
440 |
+
show.apply(this);
|
441 |
+
}
|
442 |
+
});
|
443 |
+
},
|
444 |
+
hidePicker: function() {
|
445 |
+
return this.each( function () {
|
446 |
+
if ($(this).data('colorpickerId')) {
|
447 |
+
$('#' + $(this).data('colorpickerId')).hide();
|
448 |
+
}
|
449 |
+
});
|
450 |
+
},
|
451 |
+
setColor: function(col) {
|
452 |
+
if (typeof col == 'string') {
|
453 |
+
col = HexToHSB(col);
|
454 |
+
} else if (col.r != undefined && col.g != undefined && col.b != undefined) {
|
455 |
+
col = RGBToHSB(col);
|
456 |
+
} else if (col.h != undefined && col.s != undefined && col.b != undefined) {
|
457 |
+
col = fixHSB(col);
|
458 |
+
} else {
|
459 |
+
return this;
|
460 |
+
}
|
461 |
+
return this.each(function(){
|
462 |
+
if ($(this).data('colorpickerId')) {
|
463 |
+
var cal = $('#' + $(this).data('colorpickerId'));
|
464 |
+
cal.data('colorpicker').color = col;
|
465 |
+
cal.data('colorpicker').origColor = col;
|
466 |
+
fillRGBFields(col, cal.get(0));
|
467 |
+
fillHSBFields(col, cal.get(0));
|
468 |
+
fillHexFields(col, cal.get(0));
|
469 |
+
setHue(col, cal.get(0));
|
470 |
+
setSelector(col, cal.get(0));
|
471 |
+
setCurrentColor(col, cal.get(0));
|
472 |
+
setNewColor(col, cal.get(0));
|
473 |
+
}
|
474 |
+
});
|
475 |
+
}
|
476 |
+
};
|
477 |
+
}();
|
478 |
+
$.fn.extend({
|
479 |
+
ColorPicker: ColorPicker.init,
|
480 |
+
ColorPickerHide: ColorPicker.hidePicker,
|
481 |
+
ColorPickerShow: ColorPicker.showPicker,
|
482 |
+
ColorPickerSetColor: ColorPicker.setColor
|
483 |
+
});
|
484 |
+
})(jQuery)
|
js/wpfront-scroll-top.js
CHANGED
@@ -47,21 +47,29 @@
|
|
47 |
data.button_height += "px";
|
48 |
container.children("img").css({"width": data.button_width, "height": data.button_height});
|
49 |
|
|
|
50 |
$(window).scroll(function() {
|
51 |
if ($(this).scrollTop() > data.scroll_offset) {
|
52 |
-
container.stop().
|
|
|
|
|
53 |
} else {
|
54 |
-
container.
|
55 |
-
container.
|
56 |
-
|
|
|
|
|
|
|
57 |
}
|
58 |
});
|
59 |
|
60 |
container
|
61 |
.hover(function() {
|
|
|
62 |
$(this).css("opacity", 1);
|
63 |
}, function() {
|
64 |
$(this).css("opacity", data.button_opacity);
|
|
|
65 |
})
|
66 |
.click(function() {
|
67 |
$("html, body").animate({scrollTop: 0}, data.scroll_duration);
|
47 |
data.button_height += "px";
|
48 |
container.children("img").css({"width": data.button_width, "height": data.button_height});
|
49 |
|
50 |
+
var mouse_over = false;
|
51 |
$(window).scroll(function() {
|
52 |
if ($(this).scrollTop() > data.scroll_offset) {
|
53 |
+
container.stop().css("opacity", 1).show();
|
54 |
+
if (!mouse_over)
|
55 |
+
container.css("opacity", data.button_opacity);
|
56 |
} else {
|
57 |
+
if (container.is(":visible")) {
|
58 |
+
container.stop().fadeTo(data.button_fade_duration, 0, function() {
|
59 |
+
container.hide();
|
60 |
+
mouse_over = false;
|
61 |
+
});
|
62 |
+
}
|
63 |
}
|
64 |
});
|
65 |
|
66 |
container
|
67 |
.hover(function() {
|
68 |
+
mouse_over = true;
|
69 |
$(this).css("opacity", 1);
|
70 |
}, function() {
|
71 |
$(this).css("opacity", data.button_opacity);
|
72 |
+
mouse_over = false;
|
73 |
})
|
74 |
.click(function() {
|
75 |
$("html, body").animate({scrollTop: 0}, data.scroll_duration);
|
languages/wpfront-scroll-top.mo
CHANGED
Binary file
|
languages/wpfront-scroll-top.po
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: WPFront Notification Bar\n"
|
4 |
-
"POT-Creation-Date: 2014-02
|
5 |
-
"PO-Revision-Date: 2014-02
|
6 |
"Last-Translator: \n"
|
7 |
"Language-Team: WPFront <contact@wpfront.com>\n"
|
8 |
"Language: en\n"
|
@@ -17,97 +17,93 @@ msgstr ""
|
|
17 |
"X-Poedit-SearchPath-0: ..\n"
|
18 |
|
19 |
#: ../classes/base/class-wpfront-base-menu.php:52
|
20 |
-
#: ../classes/base/class-wpfront-base-menu.php:62
|
21 |
msgid "Name"
|
22 |
msgstr "Name"
|
23 |
|
24 |
#: ../classes/base/class-wpfront-base-menu.php:53
|
25 |
-
#: ../classes/base/class-wpfront-base-menu.php:63
|
26 |
msgid "Version"
|
27 |
msgstr "Version"
|
28 |
|
29 |
#: ../classes/base/class-wpfront-base-menu.php:54
|
30 |
-
#: ../classes/base/class-wpfront-base-menu.php:64
|
31 |
msgid "Rating"
|
32 |
msgstr "Rating"
|
33 |
|
34 |
#: ../classes/base/class-wpfront-base-menu.php:55
|
35 |
-
#: ../classes/base/class-wpfront-base-menu.php:65
|
36 |
msgid "Description"
|
37 |
msgstr "Description"
|
38 |
|
39 |
-
#: ../classes/base/class-wpfront-base-menu.php:
|
40 |
#, php-format
|
41 |
msgid "based on %s rating(s)"
|
42 |
msgstr "based on %s rating(s)"
|
43 |
|
44 |
-
#: ../classes/base/class-wpfront-base-menu.php:
|
45 |
msgid "Unable to communicate with WordPress.org"
|
46 |
msgstr "Unable to communicate with WordPress.org"
|
47 |
|
48 |
-
#: ../classes/base/class-wpfront-base-menu.php:
|
49 |
-
#: ../classes/base/class-wpfront-base-menu.php:
|
50 |
msgid "WPFront Plugins"
|
51 |
msgstr "WPFront Plugins"
|
52 |
|
53 |
-
#: ../classes/base/class-wpfront-base-menu.php:
|
54 |
#, php-format
|
55 |
msgid "By %s"
|
56 |
msgstr "By %s"
|
57 |
|
58 |
-
#: ../classes/base/class-wpfront-base-menu.php:
|
59 |
#, php-format
|
60 |
msgid "More information about %s"
|
61 |
msgstr "More information about %s"
|
62 |
|
63 |
-
#: ../classes/base/class-wpfront-base-menu.php:
|
64 |
msgid "Details"
|
65 |
msgstr "Details"
|
66 |
|
67 |
-
#: ../classes/base/class-wpfront-base-menu.php:
|
68 |
#, php-format
|
69 |
msgid "Install %s"
|
70 |
msgstr "Install %s"
|
71 |
|
72 |
-
#: ../classes/base/class-wpfront-base-menu.php:
|
73 |
msgid "Install Now"
|
74 |
msgstr "Install Now"
|
75 |
|
76 |
-
#: ../classes/base/class-wpfront-base-menu.php:
|
77 |
#, php-format
|
78 |
msgid "Update to version %s"
|
79 |
msgstr "Update to version %s"
|
80 |
|
81 |
-
#: ../classes/base/class-wpfront-base-menu.php:
|
82 |
msgid "Update Now"
|
83 |
msgstr "Update Now"
|
84 |
|
85 |
-
#: ../classes/base/class-wpfront-base-menu.php:
|
86 |
msgid "This plugin is already installed and is up to date"
|
87 |
msgstr "This plugin is already installed and is up to date"
|
88 |
|
89 |
-
#: ../classes/base/class-wpfront-base-menu.php:
|
90 |
msgid "Installed"
|
91 |
msgstr "Installed"
|
92 |
|
93 |
-
#: ../classes/base/class-wpfront-base-menu.php:
|
94 |
#: ../classes/base/class-wpfront-base.php:105
|
95 |
msgid "Settings"
|
96 |
msgstr "Settings"
|
97 |
|
98 |
-
#: ../classes/base/class-wpfront-base-menu.php:
|
99 |
msgid "Activate"
|
100 |
msgstr "Activate"
|
101 |
|
102 |
-
#: ../classes/base/class-wpfront-base-menu.php:
|
103 |
msgid "Feedback"
|
104 |
msgstr "Feedback"
|
105 |
|
106 |
-
#: ../classes/base/class-wpfront-base-menu.php:
|
107 |
msgid "WPFront"
|
108 |
msgstr "WPFront"
|
109 |
|
110 |
-
#: ../classes/base/class-wpfront-base-menu.php:
|
111 |
msgid "All Plugins"
|
112 |
msgstr "All Plugins"
|
113 |
|
@@ -187,19 +183,40 @@ msgstr "Hide on Small Window"
|
|
187 |
msgid "Small Window Max Width"
|
188 |
msgstr "Small Window Max Width"
|
189 |
|
190 |
-
#: ../classes/class-wpfront-scroll-top-options.php:
|
191 |
-
|
|
|
|
|
|
|
|
|
192 |
msgid "Location"
|
193 |
msgstr "Location"
|
194 |
|
195 |
-
#: ../classes/class-wpfront-scroll-top-options.php:
|
196 |
msgid "Margin X"
|
197 |
msgstr "Margin X"
|
198 |
|
199 |
-
#: ../classes/class-wpfront-scroll-top-options.php:
|
200 |
msgid "Margin Y"
|
201 |
msgstr "Margin Y"
|
202 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
203 |
#: ../classes/class-wpfront-scroll-top.php:63
|
204 |
msgid "WPFront Scroll Top"
|
205 |
msgstr "WPFront Scroll Top"
|
@@ -252,31 +269,35 @@ msgstr "[Button will be hidden on broswer window when the width matches.]"
|
|
252 |
msgid "[Button will be hidden on browser window with lesser or equal width.]"
|
253 |
msgstr "[Button will be hidden on browser window with lesser or equal width.]"
|
254 |
|
255 |
-
#: ../templates/options-template.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
256 |
msgid "Bottom Right"
|
257 |
msgstr "Bottom Right"
|
258 |
|
259 |
-
#: ../templates/options-template.php:
|
260 |
msgid "Bottom Left"
|
261 |
msgstr "Bottom Left"
|
262 |
|
263 |
-
#: ../templates/options-template.php:
|
264 |
msgid "Top Right"
|
265 |
msgstr "Top Right"
|
266 |
|
267 |
-
#: ../templates/options-template.php:
|
268 |
msgid "Top Left"
|
269 |
msgstr "Top Left"
|
270 |
|
271 |
-
#: ../templates/options-template.php:
|
272 |
msgid "[Negative value allowed.]"
|
273 |
msgstr "[Negative value allowed.]"
|
274 |
|
275 |
-
#: ../templates/options-template.php:
|
276 |
-
msgid "Image"
|
277 |
-
msgstr "Image"
|
278 |
-
|
279 |
-
#: ../templates/options-template.php:180
|
280 |
msgid "Custom URL"
|
281 |
msgstr "Custom URL"
|
282 |
|
@@ -322,9 +343,6 @@ msgstr "Custom URL"
|
|
322 |
#~ msgid "From Color"
|
323 |
#~ msgstr "From Color"
|
324 |
|
325 |
-
#~ msgid "To Color"
|
326 |
-
#~ msgstr "To Color"
|
327 |
-
|
328 |
#~ msgid "Button Text Color"
|
329 |
#~ msgstr "Button Text Color"
|
330 |
|
@@ -425,9 +443,6 @@ msgstr "Custom URL"
|
|
425 |
#~ msgid "Color"
|
426 |
#~ msgstr "Color"
|
427 |
|
428 |
-
#~ msgid "Bar Color"
|
429 |
-
#~ msgstr "Bar Color"
|
430 |
-
|
431 |
#~ msgid "[Select two different colors to create a gradient.]"
|
432 |
#~ msgstr "[Select two different colors to create a gradient.]"
|
433 |
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: WPFront Notification Bar\n"
|
4 |
+
"POT-Creation-Date: 2014-03-02 10:49-0700\n"
|
5 |
+
"PO-Revision-Date: 2014-03-02 10:49-0700\n"
|
6 |
"Last-Translator: \n"
|
7 |
"Language-Team: WPFront <contact@wpfront.com>\n"
|
8 |
"Language: en\n"
|
17 |
"X-Poedit-SearchPath-0: ..\n"
|
18 |
|
19 |
#: ../classes/base/class-wpfront-base-menu.php:52
|
|
|
20 |
msgid "Name"
|
21 |
msgstr "Name"
|
22 |
|
23 |
#: ../classes/base/class-wpfront-base-menu.php:53
|
|
|
24 |
msgid "Version"
|
25 |
msgstr "Version"
|
26 |
|
27 |
#: ../classes/base/class-wpfront-base-menu.php:54
|
|
|
28 |
msgid "Rating"
|
29 |
msgstr "Rating"
|
30 |
|
31 |
#: ../classes/base/class-wpfront-base-menu.php:55
|
|
|
32 |
msgid "Description"
|
33 |
msgstr "Description"
|
34 |
|
35 |
+
#: ../classes/base/class-wpfront-base-menu.php:69
|
36 |
#, php-format
|
37 |
msgid "based on %s rating(s)"
|
38 |
msgstr "based on %s rating(s)"
|
39 |
|
40 |
+
#: ../classes/base/class-wpfront-base-menu.php:105
|
41 |
msgid "Unable to communicate with WordPress.org"
|
42 |
msgstr "Unable to communicate with WordPress.org"
|
43 |
|
44 |
+
#: ../classes/base/class-wpfront-base-menu.php:123
|
45 |
+
#: ../classes/base/class-wpfront-base-menu.php:217
|
46 |
msgid "WPFront Plugins"
|
47 |
msgstr "WPFront Plugins"
|
48 |
|
49 |
+
#: ../classes/base/class-wpfront-base-menu.php:147
|
50 |
#, php-format
|
51 |
msgid "By %s"
|
52 |
msgstr "By %s"
|
53 |
|
54 |
+
#: ../classes/base/class-wpfront-base-menu.php:154
|
55 |
#, php-format
|
56 |
msgid "More information about %s"
|
57 |
msgstr "More information about %s"
|
58 |
|
59 |
+
#: ../classes/base/class-wpfront-base-menu.php:154
|
60 |
msgid "Details"
|
61 |
msgstr "Details"
|
62 |
|
63 |
+
#: ../classes/base/class-wpfront-base-menu.php:163
|
64 |
#, php-format
|
65 |
msgid "Install %s"
|
66 |
msgstr "Install %s"
|
67 |
|
68 |
+
#: ../classes/base/class-wpfront-base-menu.php:163
|
69 |
msgid "Install Now"
|
70 |
msgstr "Install Now"
|
71 |
|
72 |
+
#: ../classes/base/class-wpfront-base-menu.php:168
|
73 |
#, php-format
|
74 |
msgid "Update to version %s"
|
75 |
msgstr "Update to version %s"
|
76 |
|
77 |
+
#: ../classes/base/class-wpfront-base-menu.php:168
|
78 |
msgid "Update Now"
|
79 |
msgstr "Update Now"
|
80 |
|
81 |
+
#: ../classes/base/class-wpfront-base-menu.php:173
|
82 |
msgid "This plugin is already installed and is up to date"
|
83 |
msgstr "This plugin is already installed and is up to date"
|
84 |
|
85 |
+
#: ../classes/base/class-wpfront-base-menu.php:173
|
86 |
msgid "Installed"
|
87 |
msgstr "Installed"
|
88 |
|
89 |
+
#: ../classes/base/class-wpfront-base-menu.php:175
|
90 |
#: ../classes/base/class-wpfront-base.php:105
|
91 |
msgid "Settings"
|
92 |
msgstr "Settings"
|
93 |
|
94 |
+
#: ../classes/base/class-wpfront-base-menu.php:177
|
95 |
msgid "Activate"
|
96 |
msgstr "Activate"
|
97 |
|
98 |
+
#: ../classes/base/class-wpfront-base-menu.php:199
|
99 |
msgid "Feedback"
|
100 |
msgstr "Feedback"
|
101 |
|
102 |
+
#: ../classes/base/class-wpfront-base-menu.php:216
|
103 |
msgid "WPFront"
|
104 |
msgstr "WPFront"
|
105 |
|
106 |
+
#: ../classes/base/class-wpfront-base-menu.php:217
|
107 |
msgid "All Plugins"
|
108 |
msgstr "All Plugins"
|
109 |
|
183 |
msgid "Small Window Max Width"
|
184 |
msgstr "Small Window Max Width"
|
185 |
|
186 |
+
#: ../classes/class-wpfront-scroll-top-options.php:52
|
187 |
+
msgid "Button Style"
|
188 |
+
msgstr "Button Style"
|
189 |
+
|
190 |
+
#: ../classes/class-wpfront-scroll-top-options.php:54
|
191 |
+
#: ../templates/options-template.php:183
|
192 |
msgid "Location"
|
193 |
msgstr "Location"
|
194 |
|
195 |
+
#: ../classes/class-wpfront-scroll-top-options.php:55
|
196 |
msgid "Margin X"
|
197 |
msgstr "Margin X"
|
198 |
|
199 |
+
#: ../classes/class-wpfront-scroll-top-options.php:56
|
200 |
msgid "Margin Y"
|
201 |
msgstr "Margin Y"
|
202 |
|
203 |
+
#: ../classes/class-wpfront-scroll-top-options.php:58
|
204 |
+
#: ../templates/options-template.php:135
|
205 |
+
msgid "Text"
|
206 |
+
msgstr "Text"
|
207 |
+
|
208 |
+
#: ../classes/class-wpfront-scroll-top-options.php:59
|
209 |
+
msgid "Text Color"
|
210 |
+
msgstr "Text Color"
|
211 |
+
|
212 |
+
#: ../classes/class-wpfront-scroll-top-options.php:60
|
213 |
+
msgid "Background Color"
|
214 |
+
msgstr "Background Color"
|
215 |
+
|
216 |
+
#: ../classes/class-wpfront-scroll-top-options.php:61
|
217 |
+
msgid "Custom CSS"
|
218 |
+
msgstr "Custom CSS"
|
219 |
+
|
220 |
#: ../classes/class-wpfront-scroll-top.php:63
|
221 |
msgid "WPFront Scroll Top"
|
222 |
msgstr "WPFront Scroll Top"
|
269 |
msgid "[Button will be hidden on browser window with lesser or equal width.]"
|
270 |
msgstr "[Button will be hidden on browser window with lesser or equal width.]"
|
271 |
|
272 |
+
#: ../templates/options-template.php:133 ../templates/options-template.php:218
|
273 |
+
msgid "Image"
|
274 |
+
msgstr "Image"
|
275 |
+
|
276 |
+
#: ../templates/options-template.php:141
|
277 |
+
msgid "Text Button"
|
278 |
+
msgstr "Text Button"
|
279 |
+
|
280 |
+
#: ../templates/options-template.php:191
|
281 |
msgid "Bottom Right"
|
282 |
msgstr "Bottom Right"
|
283 |
|
284 |
+
#: ../templates/options-template.php:192
|
285 |
msgid "Bottom Left"
|
286 |
msgstr "Bottom Left"
|
287 |
|
288 |
+
#: ../templates/options-template.php:193
|
289 |
msgid "Top Right"
|
290 |
msgstr "Top Right"
|
291 |
|
292 |
+
#: ../templates/options-template.php:194
|
293 |
msgid "Top Left"
|
294 |
msgstr "Top Left"
|
295 |
|
296 |
+
#: ../templates/options-template.php:204 ../templates/options-template.php:213
|
297 |
msgid "[Negative value allowed.]"
|
298 |
msgstr "[Negative value allowed.]"
|
299 |
|
300 |
+
#: ../templates/options-template.php:234
|
|
|
|
|
|
|
|
|
301 |
msgid "Custom URL"
|
302 |
msgstr "Custom URL"
|
303 |
|
343 |
#~ msgid "From Color"
|
344 |
#~ msgstr "From Color"
|
345 |
|
|
|
|
|
|
|
346 |
#~ msgid "Button Text Color"
|
347 |
#~ msgstr "Button Text Color"
|
348 |
|
443 |
#~ msgid "Color"
|
444 |
#~ msgstr "Color"
|
445 |
|
|
|
|
|
|
|
446 |
#~ msgid "[Select two different colors to create a gradient.]"
|
447 |
#~ msgstr "[Select two different colors to create a gradient.]"
|
448 |
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
=== WPFront Scroll Top ===
|
2 |
Contributors: syammohanm
|
3 |
Donate link: http://wpfront.com/donate/
|
4 |
Tags: back, back to top, navigation, navigate, page, scroll, scroll to top, scroll top, scroll up, top, up
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 3.8
|
7 |
-
Stable tag: 1.
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -16,9 +16,12 @@ Allows the visitor to easily scroll back to the top of the page, with fully cust
|
|
16 |
### Features
|
17 |
* Displays a button when user scrolls down the page.
|
18 |
* Scrolls the page back to top with animation.
|
|
|
19 |
* Set any image you want.
|
20 |
* Hide on small devices.
|
21 |
|
|
|
|
|
22 |
== Installation ==
|
23 |
|
24 |
1. Click Plugins/Add New from the WordPress admin panel
|
@@ -29,7 +32,7 @@ Allows the visitor to easily scroll back to the top of the page, with fully cust
|
|
29 |
1. Download the .zip package
|
30 |
1. Unzip into the subdirectory 'wpfront-scroll-top' within your local WordPress plugins directory
|
31 |
1. Refresh plugin page and activate plugin
|
32 |
-
1. Configure plugin using *settings* link under plugin name or by going to
|
33 |
|
34 |
== Frequently Asked Questions ==
|
35 |
|
@@ -43,6 +46,10 @@ No one has asked anything yet.
|
|
43 |
|
44 |
== Changelog ==
|
45 |
|
|
|
|
|
|
|
|
|
46 |
= 1.1.1 =
|
47 |
* Stability improvements
|
48 |
* New menu structure
|
@@ -59,6 +66,9 @@ No one has asked anything yet.
|
|
59 |
|
60 |
== Upgrade Notice ==
|
61 |
|
|
|
|
|
|
|
62 |
= 1.1.1 =
|
63 |
* Improved stability
|
64 |
|
1 |
+
=== WPFront Scroll Top ===
|
2 |
Contributors: syammohanm
|
3 |
Donate link: http://wpfront.com/donate/
|
4 |
Tags: back, back to top, navigation, navigate, page, scroll, scroll to top, scroll top, scroll up, top, up
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 3.8
|
7 |
+
Stable tag: 1.2
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
16 |
### Features
|
17 |
* Displays a button when user scrolls down the page.
|
18 |
* Scrolls the page back to top with animation.
|
19 |
+
* Create text or image button.
|
20 |
* Set any image you want.
|
21 |
* Hide on small devices.
|
22 |
|
23 |
+
Visit [WPFront Scroll Top Settings](http://wpfront.com/scroll-top-plugin-settings/) page for detailed option descriptions.
|
24 |
+
|
25 |
== Installation ==
|
26 |
|
27 |
1. Click Plugins/Add New from the WordPress admin panel
|
32 |
1. Download the .zip package
|
33 |
1. Unzip into the subdirectory 'wpfront-scroll-top' within your local WordPress plugins directory
|
34 |
1. Refresh plugin page and activate plugin
|
35 |
+
1. Configure plugin using *settings* link under plugin name or by going to WPFront/Scroll Top
|
36 |
|
37 |
== Frequently Asked Questions ==
|
38 |
|
46 |
|
47 |
== Changelog ==
|
48 |
|
49 |
+
= 1.2 =
|
50 |
+
* Text button option
|
51 |
+
* Bug fixes
|
52 |
+
|
53 |
= 1.1.1 =
|
54 |
* Stability improvements
|
55 |
* New menu structure
|
66 |
|
67 |
== Upgrade Notice ==
|
68 |
|
69 |
+
= 1.2 =
|
70 |
+
* Text based button added
|
71 |
+
|
72 |
= 1.1.1 =
|
73 |
* Improved stability
|
74 |
|
templates/options-template.php
CHANGED
@@ -124,6 +124,60 @@
|
|
124 |
<span class="description"><?php echo $this->__('[Button will be hidden on browser window with lesser or equal width.]'); ?></span>
|
125 |
</td>
|
126 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
</table>
|
128 |
|
129 |
<h3><?php echo $this->__('Location'); ?></h3>
|
@@ -183,4 +237,30 @@
|
|
183 |
</div>
|
184 |
|
185 |
<?php @$this->options_page_footer('scroll-top-plugin-settings/', 'scroll-top-plugin-faq/'); ?>
|
186 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
<span class="description"><?php echo $this->__('[Button will be hidden on browser window with lesser or equal width.]'); ?></span>
|
125 |
</td>
|
126 |
</tr>
|
127 |
+
<tr>
|
128 |
+
<th scope="row">
|
129 |
+
<?php echo $this->options->button_style_label(); ?>
|
130 |
+
</th>
|
131 |
+
<td>
|
132 |
+
<div>
|
133 |
+
<label><input type="radio" name="<?php echo $this->options->button_style_name(); ?>" value="image" <?php echo $this->options->button_style() == 'image' ? 'checked' : ''; ?> /> <?php echo $this->__('Image'); ?></label>
|
134 |
+
<br />
|
135 |
+
<label><input type="radio" name="<?php echo $this->options->button_style_name(); ?>" value="text" <?php echo $this->options->button_style() == 'text' ? 'checked' : ''; ?> /> <?php echo $this->__('Text'); ?></label>
|
136 |
+
</div>
|
137 |
+
</td>
|
138 |
+
</tr>
|
139 |
+
</table>
|
140 |
+
|
141 |
+
<h3><?php echo $this->__('Text Button'); ?></h3>
|
142 |
+
<table class="form-table">
|
143 |
+
<tr>
|
144 |
+
<th scope="row">
|
145 |
+
<?php echo $this->options->text_button_text_label(); ?>
|
146 |
+
</th>
|
147 |
+
<td>
|
148 |
+
<input name="<?php echo $this->options->text_button_text_name(); ?>" value="<?php echo $this->options->text_button_text(); ?>" />
|
149 |
+
</td>
|
150 |
+
</tr>
|
151 |
+
<tr>
|
152 |
+
<th scope="row">
|
153 |
+
<?php echo $this->options->text_button_text_color_label(); ?>
|
154 |
+
</th>
|
155 |
+
<td>
|
156 |
+
<div class="color-selector-div">
|
157 |
+
<div class="color-selector" color="<?php echo $this->options->text_button_text_color(); ?>"></div> <span><?php echo $this->options->text_button_text_color(); ?></span>
|
158 |
+
<input type="hidden" name="<?php echo $this->options->text_button_text_color_name(); ?>" value="<?php echo $this->options->text_button_text_color(); ?>" />
|
159 |
+
</div>
|
160 |
+
</td>
|
161 |
+
</tr>
|
162 |
+
<tr>
|
163 |
+
<th scope="row">
|
164 |
+
<?php echo $this->options->text_button_background_color_label(); ?>
|
165 |
+
</th>
|
166 |
+
<td>
|
167 |
+
<div class="color-selector-div">
|
168 |
+
<div class="color-selector" color="<?php echo $this->options->text_button_background_color(); ?>"></div> <span><?php echo $this->options->text_button_background_color(); ?></span>
|
169 |
+
<input type="hidden" name="<?php echo $this->options->text_button_background_color_name(); ?>" value="<?php echo $this->options->text_button_background_color(); ?>" />
|
170 |
+
</div>
|
171 |
+
</td>
|
172 |
+
</tr>
|
173 |
+
<tr>
|
174 |
+
<th scope="row">
|
175 |
+
<?php echo $this->options->text_button_css_label(); ?>
|
176 |
+
</th>
|
177 |
+
<td>
|
178 |
+
<textarea name="<?php echo $this->options->text_button_css_name(); ?>" rows="5" cols="50"><?php echo $this->options->text_button_css(); ?></textarea>
|
179 |
+
</td>
|
180 |
+
</tr>
|
181 |
</table>
|
182 |
|
183 |
<h3><?php echo $this->__('Location'); ?></h3>
|
237 |
</div>
|
238 |
|
239 |
<?php @$this->options_page_footer('scroll-top-plugin-settings/', 'scroll-top-plugin-faq/'); ?>
|
240 |
+
|
241 |
+
<script type="text/javascript">
|
242 |
+
(function($) {
|
243 |
+
function setColorPicker(div) {
|
244 |
+
div.ColorPicker({
|
245 |
+
color: div.attr('color'),
|
246 |
+
onShow: function(colpkr) {
|
247 |
+
$(colpkr).fadeIn(500);
|
248 |
+
return false;
|
249 |
+
}, onHide: function(colpkr) {
|
250 |
+
$(colpkr).fadeOut(500);
|
251 |
+
return false;
|
252 |
+
},
|
253 |
+
onChange: function(hsb, hex, rgb) {
|
254 |
+
div.css('backgroundColor', '#' + hex);
|
255 |
+
div.next().text('#' + hex).next().val('#' + hex);
|
256 |
+
}
|
257 |
+
}).css('backgroundColor', div.attr('color'));
|
258 |
+
}
|
259 |
+
|
260 |
+
$('#wpfront-scroll-top-options').find(".color-selector").each(function(i, e) {
|
261 |
+
setColorPicker($(e));
|
262 |
+
});
|
263 |
+
|
264 |
+
})(jQuery);
|
265 |
+
</script>
|
266 |
+
|
templates/scroll-top-template.php
CHANGED
@@ -57,4 +57,41 @@
|
|
57 |
</style>
|
58 |
<?php } ?>
|
59 |
|
60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
</style>
|
58 |
<?php } ?>
|
59 |
|
60 |
+
<?php
|
61 |
+
if ($this->options->button_style() == 'text') {
|
62 |
+
?>
|
63 |
+
<div id="wpfront-scroll-top-container">
|
64 |
+
<table>
|
65 |
+
<tr>
|
66 |
+
<td class="button-holder" align="center" valign="middle">
|
67 |
+
<?php echo $this->options->text_button_text(); ?>
|
68 |
+
</td>
|
69 |
+
</tr>
|
70 |
+
</table>
|
71 |
+
</div>
|
72 |
+
|
73 |
+
<style type="text/css">
|
74 |
+
#wpfront-scroll-top-container .button-holder {
|
75 |
+
color: <?php echo $this->options->text_button_text_color(); ?>;
|
76 |
+
background-color: <?php echo $this->options->text_button_background_color(); ?>;
|
77 |
+
padding: 3px 10px;
|
78 |
+
border-radius: 3px;
|
79 |
+
-webkit-border-radius: 3px;
|
80 |
+
-webkit-box-shadow: 4px 4px 5px 0px rgba(50, 50, 50, 0.5);
|
81 |
+
-moz-box-shadow: 4px 4px 5px 0px rgba(50, 50, 50, 0.5);
|
82 |
+
box-shadow: 4px 4px 5px 0px rgba(50, 50, 50, 0.5);
|
83 |
+
width: <?php echo $this->options->button_width() == 0 ? 'auto' : $this->options->button_width() . 'px'; ?>;
|
84 |
+
height: <?php echo $this->options->button_height() == 0 ? 'auto' : $this->options->button_height() . 'px'; ?>;
|
85 |
+
}
|
86 |
+
|
87 |
+
#wpfront-scroll-top-container .button-holder {
|
88 |
+
<?php echo $this->options->text_button_css(); ?>
|
89 |
+
}
|
90 |
+
</style>
|
91 |
+
<?php
|
92 |
+
} else {
|
93 |
+
?>
|
94 |
+
<div id="wpfront-scroll-top-container"><img src="<?php echo $this->image(); ?>" /></div>
|
95 |
+
<?php
|
96 |
+
}
|
97 |
+
?>
|
wpfront-scroll-top.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: WPFront Scroll Top
|
4 |
* Plugin URI: http://wpfront.com/scroll-top-plugin/
|
5 |
* Description: Allows the visitor to easily scroll back to the top of the page.
|
6 |
-
* Version: 1.
|
7 |
* Author: Syam Mohan
|
8 |
* Author URI: http://wpfront.com
|
9 |
* License: GPL v3
|
3 |
* Plugin Name: WPFront Scroll Top
|
4 |
* Plugin URI: http://wpfront.com/scroll-top-plugin/
|
5 |
* Description: Allows the visitor to easily scroll back to the top of the page.
|
6 |
+
* Version: 1.2
|
7 |
* Author: Syam Mohan
|
8 |
* Author URI: http://wpfront.com
|
9 |
* License: GPL v3
|