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

Fixed the issues with the timepicker (jQuery) not working properly #1193

Open
wants to merge 2 commits into
base: leftNav
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions javascript/studentSearch/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
*/

$studentSearch = PHPWS_SOURCE_HTTP . 'mod/hms/javascript/studentSearch/script.js';
\Layout::addJSHeader('<script type="text/javascript" src="' . PHPWS_SOURCE_HTTP . 'mod/hms/bower_components/typeahead.js/dist/typeahead.bundle.js"></script>');
\Layout::addJSHeader("<script type='text/javascript' src='$studentSearch'></script>");
\Layout::addJSHeader('<script type="text/javascript" src="' . PHPWS_SOURCE_HTTP . 'mod/hms/node_modules/corejs-typeahead/dist/typeahead.bundle.js"></script>');
\Layout::addJSHeader("<script type='text/javascript' src='$studentSearch'></script>");
39 changes: 39 additions & 0 deletions javascript/timePicker/jquery.timePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,45 @@
* show24Hours: use a 24-hour scheme
*/

/*
The code below is the $.browser intitalization, since the .browser method was removed in the newest jquery update
*/
var matched, browser;

jQuery.uaMatch = function( ua ) {
ua = ua.toLowerCase();

var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
/(webkit)[ \/]([\w.]+)/.exec( ua ) ||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
/(msie) ([\w.]+)/.exec( ua ) ||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
[];

return {
browser: match[ 1 ] || "",
version: match[ 2 ] || "0"
};
};

matched = jQuery.uaMatch( navigator.userAgent );
browser = {};

if ( matched.browser ) {
browser[ matched.browser ] = true;
browser.version = matched.version;
}

// Chrome is Webkit, but Webkit is also Safari.
if ( browser.chrome ) {
browser.webkit = true;
} else if ( browser.webkit ) {
browser.safari = true;
}

jQuery.browser = browser;


(function($){
$.fn.timePicker = function(options) {
// Build main options before element iteration
Expand Down
4 changes: 2 additions & 2 deletions javascript/timePicker/timePicker.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ div.time-picker ul {
}
div.time-picker li {
cursor: pointer;
height: 10px;
height: 20px;
font: 12px/1 Helvetica, Arial, sans-serif;
padding: 4px 3px;
}
div.time-picker li.selected {
background: #0063CE;
color: #fff;
}
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"dependencies": {
"chartist": "^0.11.0",
"corejs-typeahead": "^1.1.1",
"flot": "^0.8.0-alpha"
"flot": "^0.8.0-alpha",
"react-data-grid-addons": "^2.0.73"
},
"devDependencies": {
"assets-webpack-plugin": "^3.4.0",
Expand Down