Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hours of Operation Widget #22

Open
wants to merge 91 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
0d4b47e
Hours of operation widget.
EvanHerman Dec 13, 2016
161f710
Refactor.
EvanHerman Dec 13, 2016
2b6d398
Add wpcw_hours_seperator filter to allow users to adjust the divider …
EvanHerman Dec 13, 2016
b61adc7
Refactors, tweaks, new styles, adjusted script, ability to copy acros…
EvanHerman Dec 13, 2016
f4f8b2f
Add microformat to open/close times.
EvanHerman Dec 13, 2016
19e194a
Fix array formatting.
EvanHerman Dec 13, 2016
85be62d
Add additional_content field below the hours of operation widget.
EvanHerman Dec 13, 2016
9e45c18
Update additional_content label, remove store_closed from .js
EvanHerman Dec 14, 2016
9d89524
Repair js_wpcw_apply_hours_to_all dashicon
EvanHerman Dec 14, 2016
ae5944c
First round of 'custom text' section.
EvanHerman Dec 14, 2016
d078738
Prevent form from overflowing and displaying a scroll bar.
EvanHerman Dec 14, 2016
0b4f41a
Refactor overflow issue.
EvanHerman Dec 14, 2016
0d97494
Add initial hours of operation unit tests. Refactor when microformats…
EvanHerman Dec 15, 2016
a7925cd
Update acceptance tests. Increase timeout on customizer screen.
EvanHerman Dec 15, 2016
8a82f3f
Tweak acceptance tests.
EvanHerman Dec 15, 2016
cbf7f2a
Fill out first hours of operation field.
EvanHerman Dec 15, 2016
76d74dd
Remove rogue option.
EvanHerman Dec 15, 2016
f23620f
Update acceptance test.
EvanHerman Dec 15, 2016
48d5ae9
Update.
EvanHerman Dec 15, 2016
f82c4d8
Tweak acceptance tests.
EvanHerman Dec 16, 2016
0552d7f
Pass into shutdown function.
EvanHerman Dec 16, 2016
5fca127
Testing close and custom text checkboxes.
EvanHerman Dec 16, 2016
b25ab37
Remove early return when title field is left empty on hours widget.
EvanHerman Dec 16, 2016
296094d
Remove see check from hours output check
EvanHerman Dec 16, 2016
d2aef42
Tweaks based on UI feedback.
EvanHerman Dec 19, 2016
e9d98d6
Refactor to avoid undefined variable. Add wpcw_hour_increment filter.
EvanHerman Dec 20, 2016
ee6a926
Remove 'hour' from the available hour increment.
EvanHerman Dec 20, 2016
864ccbd
Added wpcw_widget_hours_first_day filter, allowing users to set the f…
EvanHerman Dec 20, 2016
d8cc2f4
Fix array spacing.
EvanHerman Dec 20, 2016
89a17f0
Add dockblocks to new filters.
EvanHerman Dec 20, 2016
bb6d088
Add docblock, introduce new filters, introduce new method is_business…
EvanHerman Dec 20, 2016
0a8ddfb
Refactor, run is_business_open() once for performance.
EvanHerman Dec 20, 2016
6d6fc2d
Add action hooks for before/after each day in the widget.
EvanHerman Dec 20, 2016
5d59db8
Update js files to pass tests.
EvanHerman Dec 20, 2016
23fb005
Resolve warning on front-end display when shop is closed all day.
EvanHerman Dec 20, 2016
3a7c2db
Tweak .js. Adjust styles. Tweak input field render. Add checkbox to a…
EvanHerman Dec 20, 2016
5a93723
Align array data, remove test is_admin().
EvanHerman Dec 20, 2016
202a1cc
Update spacing in .js file.
EvanHerman Dec 20, 2016
180b1c0
Update misspelled work
EvanHerman Dec 21, 2016
665acab
Update misspelled work
EvanHerman Dec 21, 2016
e41cd5f
Update day_order label.
EvanHerman Dec 21, 2016
d4774c6
Prefix content variables with $
EvanHerman Dec 21, 2016
001894c
Change .attr/.removeAttr to .prop()
EvanHerman Dec 21, 2016
8f54b39
Unify .click target
EvanHerman Dec 21, 2016
f427f15
First pass at refector
frankiejarrett Dec 28, 2016
f9f8f6b
Back compat for other widgets
frankiejarrett Dec 28, 2016
74f5b75
Fix social icon sorting and order saving
frankiejarrett Dec 28, 2016
5270625
Fix jshints
frankiejarrett Dec 28, 2016
2aabdc0
Update PHP versions in tests
frankiejarrett Dec 28, 2016
a95995f
Ignore bogus jshint snifs
frankiejarrett Dec 28, 2016
c6f615b
Fix sniff
frankiejarrett Dec 28, 2016
7d3f684
Titles never sortable
frankiejarrett Dec 28, 2016
ff71d5e
Codeception requires 5.6
frankiejarrett Dec 28, 2016
d535b78
Fix checkboxes in contact widget
frankiejarrett Dec 28, 2016
caf836b
Fix spacing sniffs
frankiejarrett Dec 28, 2016
fd557f2
Merge in develop
frankiejarrett Dec 28, 2016
85efef5
Style tweaks on widget button/closed checkbox
EvanHerman Dec 28, 2016
0f43a55
Add support for hidden screen reader labels
frankiejarrett Dec 28, 2016
fe76679
Fix classname on close selects
frankiejarrett Dec 28, 2016
c51e0be
Display the 'Apply to All' link on only the first day in the widget
EvanHerman Dec 28, 2016
eb19705
Remove overflow auto, causing scroll issues in hours of operation wid…
EvanHerman Dec 28, 2016
df306a3
Add method to return an instance schedule
frankiejarrett Dec 28, 2016
d349e90
Populate/Display open sign based on end user time.
EvanHerman Dec 29, 2016
953b350
Add logic to group days together
frankiejarrett Dec 29, 2016
f03c51f
Support grouping on days with multiple time blocks
frankiejarrett Dec 29, 2016
2a2778c
Localize open/closed strings
EvanHerman Dec 29, 2016
75b9fa7
Tweak closed string.
EvanHerman Dec 29, 2016
cc02684
First pass at dynamic time options based on selection
EvanHerman Dec 29, 2016
a5fe450
Tweak admin.js so when the widget is updated, the fields are re-hidde…
EvanHerman Dec 29, 2016
1781a3f
Refactor.
EvanHerman Dec 29, 2016
8b064f1
Abstract datetime logic, use key/value pairs for open times
frankiejarrett Dec 29, 2016
1bfbc9f
Refactor our loop for open business label - front end of site.
EvanHerman Dec 29, 2016
fa0cab0
Update open/closed sign based on end user locale.
EvanHerman Dec 29, 2016
848102b
Remove rogue space.
EvanHerman Dec 29, 2016
4240312
Update js files for acceptance tests
EvanHerman Dec 30, 2016
59ca932
Add globals to the top of js file for localized variable
EvanHerman Dec 30, 2016
b674ad0
update spacing in globals declaration
EvanHerman Dec 30, 2016
9ade607
Update time selector fields.
EvanHerman Dec 30, 2016
33aa7f0
Style, initialization tweaks to timepicker
EvanHerman Dec 30, 2016
f49522a
Support multiple instances of the hours widget with JS
frankiejarrett Dec 30, 2016
13ce03b
Rename hours JS file
frankiejarrett Dec 30, 2016
17b99b6
Update timepicker time format support - inherit from site settings.
EvanHerman Dec 30, 2016
2b53502
Change timeSelect => timePicker
EvanHerman Dec 30, 2016
ddd5710
Unify timepicker background with admin color scheme.
EvanHerman Dec 30, 2016
c7f36f9
Make date ranges translatable and RTL compat
frankiejarrett Dec 30, 2016
ee8eed6
Merge in develop
frankiejarrett Dec 30, 2016
06d70b7
Tweak CSS and open string
frankiejarrett Dec 30, 2016
9883db7
Move assets_url property to Plugin class
frankiejarrett Dec 30, 2016
5d5c4a9
update placeholders
EvanHerman Dec 30, 2016
e3bb055
Initialize time selection fields on initial widget add.
EvanHerman Dec 30, 2016
0ae298f
Add inheritance, move enqueues into respective classes, bump font awe…
EvanHerman Jan 3, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ language:

php:
- 5.6
- 7.0
- 7.1

env:
- WP_VERSION=4.4 WP_MULTISITE=0
Expand Down
16 changes: 12 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ module.exports = function(grunt) {
files: [{
expand: true,
cwd: 'assets/css',
src: ['*.css', '!*.min.css'],
src: ['*.css', '!*.min.css', '!*.timepicker.css'],
dest: 'assets/css',
ext: '.min.css'
},
{
'assets/css/jquery.timepicker.min.css': ['assets/css/jquery.timepicker.css']
}]
}
},
Expand All @@ -45,8 +48,13 @@ module.exports = function(grunt) {
cwd: 'assets/js',
dest: 'assets/js',
ext: '.min.js',
src: ['*.js', '!*.min.js']
}
src: ['*.js', '!*.min.js', '!*.timepicker.js']
},
timepicker: {
files: {
'assets/js/jquery.timepicker.min.js': ['assets/js/jquery.timepicker.js']
}
},
},

watch: {
Expand All @@ -59,7 +67,7 @@ module.exports = function(grunt) {
tasks: ['cssmin']
},
uglify: {
files: ['*.js', '!*.js.css'],
files: ['*.js', '!*.min.js'],
options: {
cwd: 'assets/js',
nospawn: true
Expand Down
103 changes: 102 additions & 1 deletion assets/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* Form fields
*/
.wpcw-widget .form {
overflow: auto;
margin-bottom: 1em;
}
.wpcw-widget .title {
Expand Down Expand Up @@ -93,3 +92,105 @@
.wpcw-widget-social .icons a.inactive:not(:hover) {
color: #ccc;
}

/**
* Hours of Operation Widget
*/
.wpcw-widget-hours .day-row {
display: inline-block;
width: 100%;
padding: 6px 0;
border-bottom: 1px solid #e5e5e5;
}

.wpcw-widget-hours [class~='day-row']:last-of-type {
margin-bottom: 1em;
border-bottom: none;
}

.wpcw-widget-hours .day-row-top {
padding: 6px 0;
}

.wpcw-widget-hours .day-row-top:hover {
cursor: pointer;
}

.wpcw-widget-hours .day-row-top strong {
font-weight: 500;
}

.wpcw-widget-hours .toggle-icon {
float: right;
margin-top: -3px;
}

.wpcw-widget-hours .status-open-label,
.wpcw-widget-hours .status-closed-label {
float: right;
width: 40%;
margin-right: 5px;
font-weight: 500;
font-size: 12px;
text-transform: uppercase;
}

.wpcw-widget-hours .status-open-label {
color: #59CE45;
}

.wpcw-widget-hours .status-closed-label {
opacity: 0.5;
}

.wpcw-widget-hours .day-row.status-open .status-open-label,
.wpcw-widget-hours .day-row.status-closed .status-closed-label {
display: block;
}

.wpcw-widget-hours .day-row.status-open .status-closed-label,
.wpcw-widget-hours .day-row.status-closed .status-open-label {
display: none;
}

.wpcw-widget-hours .day-row-container {
display: none;
float: left;
width: 100%;
margin: 10px 0 6px;
}

.wpcw-widget-hours .time-block {
width: 100%;
float: left;
margin-bottom: 10px;
}

.wpcw-widget-hours .day-row-container div:last-of-type {
margin-bottom: 15px;
}

.wpcw-widget-hours .time-block .timeselect {
width: calc(40% - 5px);
margin-right: 5px;
min-height: 28px;
}

.wpcw-widget-hours .time-block .button {
width: calc(19% - 5px);
font-size: 18px;
text-align: center;
line-height: 1.2;
}

.wpcw-widget-hours .apply-to-all {
float: left;
}

.wpcw-widget-hours .status-closed-checkbox {
float: right;
}

.wpcw-widget-hours .status-closed-checkbox input {
margin: 0px 0 0 5px;
}
2 changes: 1 addition & 1 deletion assets/css/admin.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

72 changes: 72 additions & 0 deletions assets/css/jquery.timepicker.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
.ui-timepicker-wrapper {
overflow-y: auto;
height: 150px;
width: 6.5em;
background: #fff;
border: 1px solid #ddd;
-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);
-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);
box-shadow:0 5px 10px rgba(0,0,0,0.2);
outline: none;
z-index: 10001;
margin: 0;
}

.ui-timepicker-wrapper.ui-timepicker-with-duration {
width: 13em;
}

.ui-timepicker-wrapper.ui-timepicker-with-duration.ui-timepicker-step-30,
.ui-timepicker-wrapper.ui-timepicker-with-duration.ui-timepicker-step-60 {
width: 11em;
}

.ui-timepicker-list {
margin: 0;
padding: 0;
list-style: none;
}

.ui-timepicker-duration {
margin-left: 5px; color: #888;
}

.ui-timepicker-list:hover .ui-timepicker-duration {
color: #888;
}

.ui-timepicker-list li {
padding: 3px 0 3px 5px;
cursor: pointer;
white-space: nowrap;
color: #000;
list-style: none;
margin: 0;
}

.ui-timepicker-list:hover .ui-timepicker-selected {
background: #fff; color: #000;
}

li.ui-timepicker-selected,
.ui-timepicker-list li:hover,
.ui-timepicker-list .ui-timepicker-selected:hover {
background: #1980EC; color: #fff;
}

li.ui-timepicker-selected .ui-timepicker-duration,
.ui-timepicker-list li:hover .ui-timepicker-duration {
color: #ccc;
}

.ui-timepicker-list li.ui-timepicker-disabled,
.ui-timepicker-list li.ui-timepicker-disabled:hover,
.ui-timepicker-list li.ui-timepicker-selected.ui-timepicker-disabled {
color: #888;
cursor: default;
}

.ui-timepicker-list li.ui-timepicker-disabled:hover,
.ui-timepicker-list li.ui-timepicker-selected.ui-timepicker-disabled {
background: #f2f2f2;
}
1 change: 1 addition & 0 deletions assets/css/jquery.timepicker.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 20 additions & 4 deletions assets/css/style.css
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
.wpcw-widget-contact ul,
.wpcw-widget-social ul {
.wpcw-widget-social ul,
.wpcw-widget-hours ul {
margin: 0;
padding: 0;
list-style: none;
}
.wpcw-widget-contact ul li,
.wpcw-widget-social ul li.has-label {
.wpcw-widget-social ul li.has-label,
.wpcw-widget-hours ul li {
padding: 10px 0;
}
.wpcw-widget-contact ul li:before,
.wpcw-widget-contact ul li:after,
.wpcw-widget-social ul li:before,
.wpcw-widget-social ul li:after {
.wpcw-widget-social ul li:after,
.wpcw-widget-hours ul li:before,
.wpcw-widget-hours ul li:after {
display: none;
}
.wpcw-widget-contact ul li div {
Expand All @@ -22,9 +26,21 @@
margin: 0 0.75em 0.75em 0;
border: none;
}
.wpcw-widget-social ul li.has-label a {
.wpcw-widget-social ul li.has-label a,
.wpcw-widget-hours ul li strong.day,
.wpcw-widget-hours ul li time {
display: block;
}
.wpcw-widget-social ul li.has-label span {
margin-right: 0.25em;
}
.wpcw-widget-hours .wpcw-open-sign {
font-weight: bold;
text-transform: uppercase;
}
.wpcw-widget-hours .wpcw-open-sign.open {
color: #32cd32;
}
.wpcw-widget-hours .wpcw-open-sign.closed {
color: #ccc;
}
2 changes: 1 addition & 1 deletion assets/css/style.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading