Skip to content

Commit 4b24aeb

Browse files
committed
Merge branch 'issue-40' into development
2 parents 784088c + e15a4a5 commit 4b24aeb

File tree

9 files changed

+132
-190
lines changed

9 files changed

+132
-190
lines changed

classes/Visualizer/Module/Admin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ public function renderLibraryPage() {
280280
}
281281

282282
// Added by Ash/Upwork
283-
$filterByMeta = filter_input( INPUT_GET, 'filter', FILTER_SANITIZE_STRING );
283+
$filterByMeta = filter_input( INPUT_GET, 's', FILTER_SANITIZE_STRING );
284284
if ( $filterByMeta ) {
285285
$query = array(
286286
'key' => Visualizer_Plugin::CF_SETTINGS,

classes/Visualizer/Module/Chart.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public function getCharts() {
130130
) ),
131131
);
132132

133-
$filter = filter_input( INPUT_GET, 'filter', FILTER_SANITIZE_STRING );
133+
$filter = filter_input( INPUT_GET, 's', FILTER_SANITIZE_STRING );
134134
if ( $filter && in_array( $filter, Visualizer_Plugin::getChartTypes() ) ) {
135135
$query_args['meta_query'] = array(
136136
array(
@@ -329,7 +329,6 @@ private function _handleDataPage() {
329329
wp_enqueue_script( 'visualizer-render' );
330330
wp_localize_script( 'visualizer-render', 'visualizer', array(
331331
'l10n' => array(
332-
'remotecsv_prompt' => esc_html__( 'Please, enter the URL of CSV file:', 'visualizer' ),
333332
'invalid_source' => esc_html__( 'You have entered invalid URL. Please, insert proper URL.', 'visualizer' ),
334333
),
335334
'charts' => array(
@@ -393,7 +392,6 @@ private function _handleDataAndSettingsPage() {
393392
wp_enqueue_script( 'visualizer-render' );
394393
wp_localize_script( 'visualizer-render', 'visualizer', array(
395394
'l10n' => array(
396-
'remotecsv_prompt' => esc_html__( 'Please, enter the URL of CSV file:', 'visualizer' ),
397395
'invalid_source' => esc_html__( 'You have entered invalid URL. Please, insert proper URL.', 'visualizer' ),
398396
),
399397
'charts' => array(

classes/Visualizer/Render/Library.php

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -87,36 +87,37 @@ private function _renderChartBox( $placeholder_id, $chart_id ) {
8787
private function _renderLibrary() {
8888
// Added by Ash/Upwork
8989
$filterBy = null;
90-
if ( isset( $_GET['filter'] ) && strlen( $_GET['filter'] ) > 0 ) {
91-
$filterBy = filter_input( INPUT_GET, 'filter', FILTER_SANITIZE_STRING );
90+
if ( isset( $_GET['s'] ) && strlen( $_GET['s'] ) > 0 ) {
91+
$filterBy = filter_input( INPUT_GET, 's', FILTER_SANITIZE_STRING );
9292
}
93-
echo '<div id="visualizer-search"><form action="" method="get">
94-
<input type="text" name="filter" value="' . $filterBy . '">
95-
<input type="hidden" name="page" value="visualizer">
96-
<input type="submit" class="button button-secondary" value="' . esc_attr__( 'Search', 'visualizer' ) . '">
97-
</form></div>';
93+
9894
// Added by Ash/Upwork
9995
echo '<div id="visualizer-types" class="visualizer-clearfix">';
100-
echo '<ul>';
96+
echo '<ul class="subsubsub">';
10197
foreach ( $this->types as $type => $array ) {
10298
$label = $array['name'];
103-
$link = '<a class="page-numbers" href="' . esc_url( add_query_arg( array( 'type' => $type, 'vpage' => false ) ) ) . '">';
99+
$link = '<a class=" " href="' . esc_url( add_query_arg( array( 'type' => $type, 'vpage' => false ) ) ) . '">';
104100
if ( ! $array['enabled'] ) {
105-
$link = "<a class='pro-upsell page-numbers' href='" . Visualizer_Plugin::PRO_TEASER_URL . "' target='_blank'>";
101+
$link = "<a class=' visualizer-pro-only' href='" . Visualizer_Plugin::PRO_TEASER_URL . "' target='_blank'>";
106102
}
107-
echo '<li class="visualizer-list-item">';
103+
echo '<li class="visualizer-list-item all">';
108104
if ( $type == $this->type ) {
109-
echo '<a class="page-numbers current" href="', esc_url( add_query_arg( 'vpage', false ) ), '">';
105+
echo '<a class=" current" href="', esc_url( add_query_arg( 'vpage', false ) ), '">';
110106
echo $label;
111107
echo '</a>';
112108
} else {
113109
echo $link;
114110
echo $label;
115111
echo '</a>';
116112
}
117-
echo '</li>';
113+
echo ' | </li>';
118114
}
119115
echo '</ul>';
116+
echo '<form action="" method="get"><p id="visualizer-search" class="search-box">
117+
<input type="search" name="s" value="' . $filterBy . '">
118+
<input type="hidden" name="page" value="visualizer">
119+
<input type="submit" id="search-submit" class="button button-secondary" value="' . esc_attr__( 'Search', 'visualizer' ) . '">
120+
</p> </form>';
120121
echo '</div>';
121122

122123
if ( ! empty( $this->charts ) ) {
@@ -127,9 +128,9 @@ private function _renderLibrary() {
127128
echo '</div>';
128129

129130
if ( is_array( $this->pagination ) ) {
130-
echo '<ul class="visualizer-library-pagination">';
131+
echo '<ul class=" subsubsub">';
131132
foreach ( $this->pagination as $page ) {
132-
echo '<li class="visualizer-list-item">', $page, '</li>';
133+
echo '<li class="all">', $page, '</li>';
133134
}
134135
echo '</ul>';
135136
}

classes/Visualizer/Render/Page.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ protected function _renderContent() {}
6464
*/
6565
protected function _renderSidebar() {
6666
echo '<div id="sidebar">';
67-
echo '<ul class="group-wrapper">';
6867
$this->_renderSidebarContent();
69-
echo '</ul>';
7068

7169
echo '<div id="rate-the-plugin">';
7270
echo '<div><b>', esc_html__( 'Like the plugin? Show us your love!', 'visualizer' ), '</b></div>';

classes/Visualizer/Render/Page/Data.php

Lines changed: 60 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -63,63 +63,68 @@ protected function _renderSidebarContent() {
6363
'chart' => $this->chart->ID,
6464
), admin_url( 'admin-ajax.php' ) );
6565

66-
echo '<input type="button" name="back_button" class="return-settings-btn preview-btn hidden-setting" value="&laquo; Back">';
67-
echo '<div class="initial-screen">';
68-
echo '<iframe id="thehole" name="thehole"></iframe>';
69-
echo '<p class="group-description">';
70-
esc_html_e( 'Select and upload your data CSV file here. The first row of the CSV file should contain the column headings. The second one should contain series type (string, number, boolean, date, datetime, timeofday).', 'visualizer' );
71-
echo '</p>';
72-
73-
echo '<p class="group-description">';
74-
esc_html_e( 'If you are unsure about how to format your data CSV then please take a look at this sample:', 'visualizer' );
75-
echo ' <a href="', VISUALIZER_ABSURL, 'samples/', $this->type, '.csv" target="_blank">', $this->type, '.csv</a> ';
76-
printf( esc_html__( 'or read how you can add Google spreadsheet in following %1$sarticle%1$s.', 'visualizer' ), '<a href="https://github.com/madpixelslabs/visualizer/wiki/How-can-I-populate-data-from-Google-Spreadsheet%3F" target="_blank">', '</a>' );
77-
echo '</p>';
78-
79-
echo '<div>';
80-
echo '<form id="csv-form" action="', $upload_link, '" method="post" target="thehole" enctype="multipart/form-data">';
81-
echo '<input type="hidden" id="remote-data" name="remote_data">';
82-
echo '<div class="form-inline">';
83-
echo '<div class="button button-primary file-wrapper computer-btn">';
84-
echo '<input type="file" id="csv-file" class="file" name="local_data">';
85-
esc_attr_e( 'From Computer', 'visualizer' );
86-
echo '</div>';
87-
88-
echo '<a id="remote-file" class="button from-web from-web-btn" href="javascript:;">', esc_html__( 'From Web', 'visualizer' ), '</a>';
89-
// Added by Ash/Upwork
90-
if ( defined( 'Visualizer_Pro' ) ) {
91-
global $Visualizer_Pro;
92-
$Visualizer_Pro->_addFormElements();
93-
} else {
94-
// Added by Ash/Upwork
95-
echo '<div class="just-on-pro"> </div>';
96-
}
97-
echo '</div>';
98-
echo '</form>';
99-
100-
// added by Ash/Upwork
101-
if ( defined( 'Visualizer_Pro' ) ) {
102-
global $Visualizer_Pro;
103-
$Visualizer_Pro->_addEditorElements();
104-
} else {
10566
?>
106-
<a href="<?php echo Visualizer_Plugin::PRO_TEASER_URL;?>" title="<?php echo Visualizer_Plugin::PRO_TEASER_TITLE;?>" class="check-pro-btn" target="_new">
107-
<input type="button" class="button preview preview-btn" id="existing-chart-free" value="<?php esc_attr_e( 'Check PRO Version ', 'visualizer' );?>">
108-
</a>
67+
<iframe id="thehole" name="thehole"></iframe>
68+
<ul class="group-wrapper">
69+
<li class="group">
70+
<h2 class="group-title main-group"><?php _e( 'Chart Source', 'visualizer' );?></h2>
71+
<ul class="group-content">
72+
<ul class="group-wrapper">
73+
<li class="group">
74+
<h2 class="group-title sub-group visualizer-src-tab"><?php _e( 'Create Chart From File', 'visualizer' );?></h2>
75+
<ul class="group-content">
76+
<p class="group-description"><?php esc_html_e( 'Select and upload your data CSV file here. The first row of the CSV file should contain the column headings. The second one should contain series type (string, number, boolean, date, datetime, timeofday).', 'visualizer' );?></p>
77+
<p class="group-description"><?php _e( sprintf( __( 'If you are unsure about how to format your data CSV then please take a look at this sample: %1$s or read how you can add Google spreadsheet in following %1$sarticle%1$s', 'visualizer' ), '<a href="' . VISUALIZER_ABSURL . 'samples/' . $this->type . '.csv" target="_blank">' . $this->type . '.csv</a>', '<a href="https://github.com/madpixelslabs/visualizer/wiki/How-can-I-populate-data-from-Google-Spreadsheet%3F" target="_blank">', '</a>' ) );?></p>
78+
<form id="csv-file-form" action="<?php echo $upload_link?>" method="post" target="thehole" enctype="multipart/form-data">
79+
<input type="hidden" id="remote-data" name="remote_data">
80+
<div class="">
81+
<input type="file" id="csv-file" name="local_data">
82+
<?php esc_attr_e( 'From Computer', 'visualizer' );?>
83+
</div>
84+
<input type="button" class="view-csv-file" value="<?php _e( 'View', 'visualizer' );?>">
85+
</form>
86+
</ul>
87+
</li>
88+
<li class="group">
89+
<h2 class="group-title sub-group visualizer-src-tab"><?php _e( 'Create Chart From URL', 'visualizer' );?></h2>
90+
<ul class="group-content">
91+
<form id="remote-file-form" action="<?php echo $upload_link?>" method="post" target="thehole" enctype="multipart/form-data">
92+
<div class="remote-file-section">
93+
<input type="url" id="remote-data" name="remote_data" placeholder="<?php esc_html_e( 'Please enter the URL of CSV file:', 'visualizer' );?>">
94+
<div class="<?php echo defined( 'Visualizer_Pro' ) ? '' : 'just-on-pro'?>"><?php _e( 'Synchronize each hour', 'visualizer' );?><input type="checkbox" id="remote-sync" name="remote-sync" value="1"></div>
95+
</div>
96+
<input type="button" class="view-remote-file" value="<?php _e( 'View', 'visualizer' );?>">
97+
</form>
98+
</ul>
99+
</li>
100+
<li class="group">
101+
<h2 class="group-title sub-group visualizer-editor-tab" data-current="chart"><?php _e( 'Add data from editor', 'visualizer' );?></h2>
102+
<ul class="group-content">
103+
<?php
104+
if ( defined( 'Visualizer_Pro' ) ) {
105+
global $Visualizer_Pro;
106+
$Visualizer_Pro->_addFormElements( $upload_link );
107+
} else {
108+
// Added by Ash/Upwork
109+
echo '<div class="just-on-pro"> </div>';
110+
}
111+
?>
112+
</ul>
113+
</li>
114+
</ul>
115+
</li>
116+
</ul>
117+
<ul class="group-wrapper">
118+
<li class="group">
119+
<h2 class="group-title main-group"><?php _e( 'Chart Settings', 'visualizer' );?></h2>
120+
<ul class="group-content">
121+
<form id="settings-form" action="<?php echo add_query_arg( 'nonce', wp_create_nonce() );?>" method="post">
122+
<?php echo $this->sidebar;?>
123+
</form>
124+
</ul>
125+
</li>
126+
</ul>
109127
<?php
110-
}
111-
112-
echo'<input type="button" name="advanced_button" class="advanced-settings-btn preview-btn" value="' . __( 'Advanced', 'visualizer' ) . ' &raquo;">';
113-
// Added by Ash/Upwork
114-
echo '</div>';
115-
echo '</div>';
116-
117-
// changed by Ash/Upwork
118-
echo '<div class= "second-screen hidden-setting">';
119-
echo '<form id="settings-form" action="', add_query_arg( 'nonce', wp_create_nonce() ), '" method="post">';
120-
echo $this->sidebar;
121-
echo '</form>';
122-
echo '</div>';
123128
// changed by Ash/Upwork
124129
}
125130

css/frame.css

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
}
8888

8989
.group-title:hover,
90-
.group.open .group-title {
90+
.group.open > .group-title {
9191
color: white;
9292
background: gray;
9393
background-image: -webkit-gradient(linear, left bottom, left top, from(#6d6d6d), to(gray));
@@ -114,19 +114,19 @@
114114
}
115115

116116
.group-title:hover::after,
117-
.group.open .group-title::after {
117+
.group.open > .group-title::after {
118118
border-color: #eee transparent;
119119
}
120120

121121
.group:hover .group-title {
122122
border-top-color: gray;
123123
}
124124

125-
.group.open .group-title {
125+
.group.open > .group-title {
126126
border-top-color: #6d6d6d;
127127
}
128128

129-
.group.open .group-title::after {
129+
.group.open > .group-title::after {
130130
border-width: 0 6px 6px;
131131
}
132132

@@ -142,7 +142,7 @@ div.group-content {
142142
padding: 10px 20px 20px;
143143
}
144144

145-
.group.open .group-content {
145+
.group.open > .group-content {
146146
display: block;
147147
}
148148

css/library.css

Lines changed: 4 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
#visualizer-types {
2121
margin: 20px 0 10px;
2222
}
23-
23+
.visualizer-list-item .visualizer-pro-only{
24+
text-decoration: line-through;
25+
}
2426
#visualizer-library {
2527
margin: 20px 0;
2628
}
@@ -137,59 +139,9 @@
137139
margin-right: 20px;
138140
}
139141

140-
.page-numbers {
141-
padding: 5px 10px;
142-
border-radius: 2px;
143-
color: white !important;
144-
background-color: #aaa;
145-
-webkit-box-shadow: 0 0 5px #ccc;
146-
box-shadow: 0 0 5px #ccc;
147-
font-weight: bold;
148-
text-decoration: none;
149-
}
150-
151-
.page-numbers.current,
152-
a.page-numbers:hover {
153-
background-color: lightcoral;
154-
-webkit-box-shadow: 0 0 5px lightpink;
155-
box-shadow: 0 0 5px lightpink;
156-
}
157142

158-
.visualizer-library-pagination {
159-
display: none;
160-
}
161143

162144
#visualizer-search form {
163-
display: -webkit-box;
164-
display: -webkit-flex;
165-
display: -ms-flexbox;
166-
display: flex;
167-
168-
-webkit-align-items: center;
169-
align-items: center;
170-
-webkit-box-align: center;
171-
-ms-flex-align: center;
172-
}
173-
174-
#visualizer-search > form > input[type="text"]:nth-child(1) {
175-
height: 30px;
176-
}
177-
178-
#visualizer-search .button-secondary {
179-
margin-left: 20px;
180-
padding: 5px 10px;
181-
border-radius: 5px;
182-
color: white;
183-
background-color: lightcoral;
184-
-webkit-box-shadow: 0 0 5px lightpink;
185-
box-shadow: 0 0 5px lightpink;
186-
font-size: 14px;
187-
font-weight: bold;
188-
line-height: 17px;
189-
text-decoration: none;
145+
text-align: right;
190146
}
191147

192-
#visualizer-search .button-secondary:hover {
193-
border-color: lightpink;
194-
background-color: lightpink;
195-
}

0 commit comments

Comments
 (0)