Commit 1ab5c27e authored by Dave Lane's avatar Dave Lane
Browse files

replaced jquery mobile dependency with basic clickable jquery-based tooltip.

parent bbfb5f91
...@@ -15,13 +15,6 @@ class BFFForm extends BFFCourse { ...@@ -15,13 +15,6 @@ class BFFForm extends BFFCourse {
// this starts everything... // this starts everything...
public function init() { public function init() {
$this->log('in init'); $this->log('in init');
/*//$this->register_scripts();
wp_register_script('bff-script', plugins_url('js/script.js', __FILE__));
wp_enqueue_script('jquery');
wp_enqueue_script('bff-script');
//$this->register_styles();
wp_register_style('bff-style', plugins_url('css/style.css', __FILE__));
wp_enqueue_style('bff-style');*/
// register actions // register actions
add_shortcode(BFF_SHORTCODE, array($this, 'shortcode')); add_shortcode(BFF_SHORTCODE, array($this, 'shortcode'));
// allows us to add a class to our post // allows us to add a class to our post
...@@ -47,17 +40,6 @@ class BFFForm extends BFFCourse { ...@@ -47,17 +40,6 @@ class BFFForm extends BFFCourse {
add_action('wp_ajax_nopriv_bff_submit', array($this, 'ajax_submit')); add_action('wp_ajax_nopriv_bff_submit', array($this, 'ajax_submit'));
// this enables the setblogfeed service for authenticated users... // this enables the setblogfeed service for authenticated users...
add_action('wp_ajax_bff_set', array($this, 'ajax_set')); add_action('wp_ajax_bff_set', array($this, 'ajax_set'));
// add jquery mobile js and css loading
if (BFF_DEBUG) {
$js_mobile = BFF_URL.'js/jquery.mobile.custom.js'; // debugging
$css_mobile = BFF_URL.'css/jquery.mobile.custom.structure.css'; // debugging
} else {
$js_mobile = BFF_URL.'js/jquery.mobile.custom.min.js'; // production
$css_mobile = BFF_URL.'css/jquery.mobile.custom.structure.min.css'; // production
}
wp_enqueue_script('bff-mobile-script', $js_mobile, array('jquery'), '1.4.5');
wp_register_style('bff-mobile-style', $css_mobile, '', '1.4.5');
wp_enqueue_style('bff-mobile-style', $css_mobile, '', '1.4.5');
$this->log('finished setting up scripts'); $this->log('finished setting up scripts');
} }
...@@ -75,8 +57,6 @@ class BFFForm extends BFFCourse { ...@@ -75,8 +57,6 @@ class BFFForm extends BFFCourse {
// generate the response // generate the response
header( "Content-Type: application/json" ); header( "Content-Type: application/json" );
$this->ajax_response(array('success' => $this->process())); $this->ajax_response(array('success' => $this->process()));
// IMPORTANT: don't forget to "exit"
//exit;
$this->log('ajax_submit done, dying...'); $this->log('ajax_submit done, dying...');
wp_die(); wp_die();
} }
...@@ -94,8 +74,6 @@ class BFFForm extends BFFCourse { ...@@ -94,8 +74,6 @@ class BFFForm extends BFFCourse {
// generate the response // generate the response
header( "Content-Type: application/json" ); header( "Content-Type: application/json" );
$this->ajax_response(array('success' => $this->process())); $this->ajax_response(array('success' => $this->process()));
// IMPORTANT: don't forget to "exit"
//exit;
$this->log('ajax_set done, dying...'); $this->log('ajax_set done, dying...');
wp_die(); wp_die();
} }
...@@ -115,12 +93,8 @@ class BFFForm extends BFFCourse { ...@@ -115,12 +93,8 @@ class BFFForm extends BFFCourse {
} else { } else {
$this->response['authenticated'] = true; $this->response['authenticated'] = true;
} }
//$this->log('processing submit: returned response object: '. print_r($this->response, true));
// sending the response object to be converted to JSON and returned to
// the calling page // the calling page
$this->ajax_response($this->ajaxfeeds()); $this->ajax_response($this->ajaxfeeds());
//$this->log('back from ajaxfeeds...');
//return true;
} elseif (isset($_POST['action']) && $_POST['action'] == 'bff_set') { } elseif (isset($_POST['action']) && $_POST['action'] == 'bff_set') {
$user = $this->get_current_user(); $user = $this->get_current_user();
$uid = $user->ID; $uid = $user->ID;
...@@ -130,8 +104,6 @@ class BFFForm extends BFFCourse { ...@@ -130,8 +104,6 @@ class BFFForm extends BFFCourse {
$url = $feed['url']; $url = $feed['url'];
$type = $feed['type']; $type = $feed['type'];
$this->log('feed info: '.print_r($feed, true)); $this->log('feed info: '.print_r($feed, true));
// $id = $course['id'];
// $tag = $course['tag'];
$id = $_POST['course_id']; $id = $_POST['course_id'];
$tag = $_POST['course_tag']; $tag = $_POST['course_tag'];
$this->log('setting the feed URL for '.$uid.' in course '.$id.' ('.$tag. $this->log('setting the feed URL for '.$uid.' in course '.$id.' ('.$tag.
...@@ -145,15 +117,12 @@ class BFFForm extends BFFCourse { ...@@ -145,15 +117,12 @@ class BFFForm extends BFFCourse {
} else { } else {
$this->log('no POST action found...'); $this->log('no POST action found...');
} }
//self::form();
//return false;
} }
// define what happens when the shortcode - BFF_SHORTCODE - is fired... // define what happens when the shortcode - BFF_SHORTCODE - is fired...
public function shortcode($atts,$content="") { public function shortcode($atts,$content="") {
$this->log('in shortcode'); $this->log('in shortcode');
ob_start(); ob_start();
//$this->process();
$this->form(); $this->form();
return ob_get_clean(); return ob_get_clean();
} }
...@@ -166,18 +135,12 @@ class BFFForm extends BFFCourse { ...@@ -166,18 +135,12 @@ class BFFForm extends BFFCourse {
// alert the user that they're not logged in // alert the user that they're not logged in
if (!is_user_logged_in()) { if (!is_user_logged_in()) {
//if (is_user_logged_in()) {
$this->log('the current user ++isn\'t++ logged in!'); $this->log('the current user ++isn\'t++ logged in!');
$this->alert_anon_user(); $this->alert_anon_user();
} else { } else {
$this->log('the current user *is* logged in!'); $this->log('the current user *is* logged in!');
$this->inform_auth_user(); $this->inform_auth_user();
//$this->alert_anon_user();
// compile a list of courses the user's registered for
//$this->list_courses();
} }
// compile a list of valid feeds (ideally, just one)
//$feed_list = $this->list_feeds();
// outputs the options form on admin // outputs the options form on admin
?> ?>
...@@ -262,7 +225,6 @@ class BFFForm extends BFFCourse { ...@@ -262,7 +225,6 @@ class BFFForm extends BFFCourse {
."<p>If you have questions, please post in the <a href=".BFF_SUPPORT_FORUM.">blog feed finder topic</a> in our support forum!</p>" ."<p>If you have questions, please post in the <a href=".BFF_SUPPORT_FORUM.">blog feed finder topic</a> in our support forum!</p>"
."[".BFF_SHORTCODE."]" ."[".BFF_SHORTCODE."]"
."<div class='credits'>" ."<div class='credits'>"
//."<p class='credit'>Credits: Emoji icons from the <a href='https://commons.wikimedia.org/wiki/Category:Noto_Color_Emoji_Oreo'>Noto Color Emoji Oreo</a> set (under Apache 2.0 license), and the <a href=\"https://commons.wikimedia.org/wiki/File:Question_Mark_Icon_-_Blue_Box.svg\">question mark icon</a> is by <a href=\"https://commons.wikimedia.org/wiki/User:Willscrlt\">Will Murray</a> (CC-By-SA).</p>"
."<p class='credit'>Credits: Emoji icons from the <a href='https://commons.wikimedia.org/wiki/Category:Noto_Color_Emoji_Oreo'>Noto Color Emoji Oreo</a> set (under Apache 2.0 license).</p>" ."<p class='credit'>Credits: Emoji icons from the <a href='https://commons.wikimedia.org/wiki/Category:Noto_Color_Emoji_Oreo'>Noto Color Emoji Oreo</a> set (under Apache 2.0 license).</p>"
."</div>"; ."</div>";
return $post; return $post;
......
...@@ -58,7 +58,7 @@ define('BFF_ADMIN_MENU', 'BFF Settings'); ...@@ -58,7 +58,7 @@ define('BFF_ADMIN_MENU', 'BFF Settings');
// other useful parameters // other useful parameters
define('BFF_MAX_FILE_READ_CHAR', 100000); define('BFF_MAX_FILE_READ_CHAR', 100000);
// turn on debugging with true, off with false // turn on debugging with true, off with false
define('BFF_DEBUG', false); define('BFF_DEBUG', true);
define('LOG_STREAM', getenv('LOG_STREAM')); define('LOG_STREAM', getenv('LOG_STREAM'));
// include the dependencies // include the dependencies
......
/*
* jQuery Mobile v1.4.5
* http://jquerymobile.com
*
* Copyright 2010, 2014 jQuery Foundation, Inc. and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
*/
/* Some unsets */
.ui-mobile,
.ui-mobile body {
height: 99.9%;
}
.ui-mobile fieldset,
.ui-page {
padding: 0;
margin: 0;
}
.ui-mobile a img,
.ui-mobile fieldset {
border-width: 0;
}
/* Fixes for fieldset issues on IE10 and FF (see #6077) */
.ui-mobile fieldset {
min-width: 0;
}
@-moz-document url-prefix() {
.ui-mobile fieldset {
display: table-column;
vertical-align: middle;
}
}
/* Viewport */
.ui-mobile-viewport {
margin: 0;
overflow-x: visible;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust:none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
/* Issue #2066 */
body.ui-mobile-viewport,
div.ui-mobile-viewport {
overflow-x: hidden;
}
/* "page" containers - full-screen views, one should always be in view post-pageload */
.ui-mobile [data-role=page],
.ui-mobile [data-role=dialog],
.ui-page {
top: 0;
left: 0;
width: 100%;
min-height: 100%;
position: absolute;
display: none;
border: 0;
}
/* On ios4, setting focus on the page element causes flashing during transitions when there is an outline, so we turn off outlines */
.ui-page {
outline: none;
}
.ui-mobile .ui-page-active {
display: block;
overflow: visible;
overflow-x: hidden;
}
@media screen and (orientation: portrait) {
.ui-mobile .ui-page {
min-height: 420px;
}
}
@media screen and (orientation: landscape) {
.ui-mobile .ui-page {
min-height: 300px;
}
}
/* Fouc */
.ui-mobile-rendering > * {
visibility: hidden;
}
/* Non-js content hiding */
.ui-nojs {
position: absolute !important;
height: 1px;
width: 1px;
overflow: hidden;
clip: rect(1px,1px,1px,1px);
}
/* Loading screen */
.ui-loading .ui-loader {
display: block;
}
.ui-loader {
display: none;
z-index: 9999999;
position: fixed;
top: 50%;
left: 50%;
border:0;
}
.ui-loader-default {
background: none;
filter: Alpha(Opacity=18);
opacity: .18;
width: 2.875em;
height: 2.875em;
margin-left: -1.4375em;
margin-top: -1.4375em;
}
.ui-loader-verbose {
width: 12.5em;
filter: Alpha(Opacity=88);
opacity: .88;
box-shadow: 0 1px 1px -1px #fff;
height: auto;
margin-left: -6.875em;
margin-top: -2.6875em;
padding: .625em;
}
.ui-loader-default h1 {
font-size: 0;
width: 0;
height: 0;
overflow: hidden;
}
.ui-loader-verbose h1 {
font-size: 1em;
margin: 0;
text-align: center;
}
.ui-loader .ui-icon-loading {
background-color: #000;
display: block;
margin: 0;
width: 2.75em;
height: 2.75em;
padding: .0625em;
-webkit-border-radius: 2.25em;
border-radius: 2.25em;
}
.ui-loader-verbose .ui-icon-loading {
margin: 0 auto .625em;
filter: Alpha(Opacity=75);
opacity: .75;
}
.ui-loader-textonly {
padding: .9375em;
margin-left: -7.1875em;
}
.ui-loader-textonly .ui-icon-loading {
display: none;
}
.ui-loader-fakefix {
position: absolute;
}
/* Headers, content panels */
.ui-bar,
.ui-body {
position: relative;
padding: .4em 1em;
overflow: hidden;
display: block;
clear: both;
}
.ui-bar h1,
.ui-bar h2,
.ui-bar h3,
.ui-bar h4,
.ui-bar h5,
.ui-bar h6 {
margin: 0;
padding: 0;
font-size: 1em;
display: inline-block;
}
.ui-header,
.ui-footer {
border-width: 1px 0;
border-style: solid;
position: relative;
}
.ui-header:empty,
.ui-footer:empty {
min-height: 2.6875em;
}
.ui-header .ui-title,
.ui-footer .ui-title {
font-size: 1em;
min-height: 1.1em;
text-align: center;
display: block;
margin: 0 30%;
padding: .7em 0;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
outline: 0 !important;
}
.ui-footer .ui-title {
margin: 0 1em;
}
.ui-content {
border-width: 0;
overflow: visible;
overflow-x: hidden;
padding: 1em;
}
/* Corner styling for dialogs and popups */
.ui-corner-all > .ui-header:first-child,
.ui-corner-all > .ui-content:first-child,
.ui-corner-all > .ui-footer:first-child {
-webkit-border-top-left-radius: inherit;
border-top-left-radius: inherit;
-webkit-border-top-right-radius: inherit;
border-top-right-radius: inherit;
}
.ui-corner-all > .ui-header:last-child,
.ui-corner-all > .ui-content:last-child,
.ui-corner-all > .ui-footer:last-child {
-webkit-border-bottom-left-radius: inherit;
border-bottom-left-radius: inherit;
-webkit-border-bottom-right-radius: inherit;
border-bottom-right-radius: inherit;
}
/* Buttons and icons */
.ui-btn {
font-size: 16px;
margin: .5em 0;
padding: .7em 1em;
display: block;
position: relative;
text-align: center;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.ui-btn-icon-notext,
.ui-header button.ui-btn.ui-btn-icon-notext,
.ui-footer button.ui-btn.ui-btn-icon-notext {
padding: 0;
width: 1.75em;
height: 1.75em;
text-indent: -9999px;
white-space: nowrap !important;
}
.ui-mini {
font-size: 12.5px;
}
.ui-mini .ui-btn {
font-size: inherit;
}
/* Make buttons in toolbars default to mini and inline. */
.ui-header .ui-btn,
.ui-footer .ui-btn {
font-size: 12.5px;
display: inline-block;
vertical-align: middle;
}
.ui-header .ui-controlgroup .ui-btn-icon-notext,
.ui-footer .ui-controlgroup .ui-btn-icon-notext {
font-size: 12.5px;
}
/* To ensure same top and left/right position when ui-btn-left/right are added to something other than buttons. */
.ui-header .ui-btn-left,
.ui-header .ui-btn-right {
font-size: 12.5px;
}
.ui-mini.ui-btn-icon-notext,
.ui-mini .ui-btn-icon-notext,
.ui-header .ui-btn-icon-notext,
.ui-footer .ui-btn-icon-notext {
font-size: 16px;
padding: 0;
}
.ui-btn-inline {
display: inline-block;
vertical-align: middle;
margin-right: .625em;
}
.ui-btn-icon-left {
padding-left: 2.5em;
}
.ui-btn-icon-right {
padding-right: 2.5em;
}
.ui-btn-icon-top {
padding-top: 2.5em;
}
.ui-btn-icon-bottom {
padding-bottom: 2.5em;
}
.ui-header .ui-btn-icon-top,
.ui-footer .ui-btn-icon-top,
.ui-header .ui-btn-icon-bottom,
.ui-footer .ui-btn-icon-bottom {
padding-left: .3125em;
padding-right: .3125em;
}
.ui-btn-icon-left:after,
.ui-btn-icon-right:after,
.ui-btn-icon-top:after,
.ui-btn-icon-bottom:after,
.ui-btn-icon-notext:after {
content: "";
position: absolute;
display: block;
width: 22px;
height: 22px;
}
.ui-btn-icon-notext:after,
.ui-btn-icon-left:after,
.ui-btn-icon-right:after {
top: 50%;
margin-top: -11px;
}
.ui-btn-icon-left:after {
left: .5625em;
}
.ui-btn-icon-right:after {
right: .5625em;
}
.ui-mini.ui-btn-icon-left:after,
.ui-mini .ui-btn-icon-left:after,
.ui-header .ui-btn-icon-left:after,
.ui-footer .ui-btn-icon-left:after {
left: .37em;
}
.ui-mini.ui-btn-icon-right:after,
.ui-mini .ui-btn-icon-right:after,
.ui-header .ui-btn-icon-right:after,
.ui-footer .ui-btn-icon-right:after {
right: .37em;
}
.ui-btn-icon-notext:after,
.ui-btn-icon-top:after,
.ui-btn-icon-bottom:after {
left: 50%;
margin-left: -11px;
}
.ui-btn-icon-top:after {
top: .5625em;
}
.ui-btn-icon-bottom:after {
top: auto;
bottom: .5625em;
}
/* Buttons in header position classes */
.ui-header .ui-btn-left,
.ui-header .ui-btn-right,
.ui-btn-left > [class*="ui-"],
.ui-btn-right > [class*="ui-"] {
margin: 0;
}
.ui-btn-left,
.ui-btn-right {
position: absolute;
top: .24em;
}
.ui-btn-left {
left: .4em;
}
.ui-btn-right {
right: .4em;
}
.ui-btn-icon-notext.ui-btn-left {
top: .3125em;
left: .3125em;
}
.ui-btn-icon-notext.ui-btn-right {
top: .3125em;
right: .3125em;
}
/* Button elements */
button.ui-btn,
.ui-controlgroup-controls button.ui-btn-icon-notext {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
-webkit-appearance: none;
-moz-appearance: none;
width: 100%;
}
button.ui-btn-inline,
.ui-header button.ui-btn,
.ui-footer button.ui-btn {
width: auto;
}
/* Firefox adds a 1px border in a button element. We negate this to make sure they have the same height as other buttons in controlgroups. */
button.ui-btn::-moz-focus-inner {
border: 0;
}
button.ui-btn-icon-notext,
.ui-controlgroup-horizontal .ui-controlgroup-controls button.ui-btn {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
width: 1.75em;
}
/* Form labels */
.ui-mobile label,
.ui-controlgroup-label {
display: block;
margin: 0 0 .4em;
}
/* Accessible content hiding */
/* ui-hide-label deprecated in 1.4. TODO: Remove in 1.5 */
.ui-hide-label > label,
.ui-hide-label .ui-controlgroup-label,
.ui-hide-label .ui-rangeslider label,
.ui-hidden-accessible {
position: absolute !important;
height: 1px;
width: 1px;
overflow: hidden;
clip: rect(1px,1px,1px,1px);
}
/* Used for hiding elements by the filterable widget. You can also use this class to hide list items or buttons in controlgroups; this ensures correct corner styling. */
.ui-screen-hidden {
display: none !important;
}
/* Transitions originally inspired by those from jQtouch, nice work, folks */
.ui-mobile-viewport-transitioning,
.ui-mobile-viewport-transitioning .ui-page {
width: 100%;
height: 100%;
overflow: hidden;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;