JSFiddle - React, Tailwind, and code Playground
by Bala_chandran
JavaScript
/******************************************************************
@Filename : Lesson.js
@Author : Balachandran.v
@Purpose : BubbleShooter.js holds the functions and methods for
proof of BubbleShooter theoram
@Date Created: 05-Jul-2013
******************************************************************/
var _BubbleShooter = null;
// Function for document ready
$(function () {
_BubbleShooter = new BubbleShooter();
});
/**
* class to handle BubbleShooter theoram
* @constructor
*/
function BubbleShooter() {
_BubbleShooter = this;
_BubbleShooter.initialize();
_BubbleShooter.addNavigationController();
_BubbleShooter.loadScreen();
_BubbleShooter.enableMouseEvent();
}
/*
* function to declare and define variables, constants and namespaces
*/
BubbleShooter.prototype.initialize = function () {
// For touchevent
this.isTouch = /Android|iPad/i.test(navigator.userAgent);
this.isMSPointer = (window.navigator.msPointerEnabled != undefined) ? true : false;
/* user agent for all browser */
this.isAndroid = /Android/i.test(navigator.userAgent); // to assign for Android device
this.isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0; // check for mac
this.isIpad = navigator.userAgent.match(/iPad/i) != null;
this.isWindows8 = navigator.userAgent.match(/(MSIE 10.0)/);
this.isIE10 = window.navigator.msPointerEnabled; //----both surface and win8
this.surface = navigator.userAgent.indexOf('Touch') > -1; //surface
/** Mouse Touch for touch devices */
// this.CIRCLE_DRAG_AREA = (!this.isMSPointer) ? ((this.isTouch) ? this.CIRCLE_CONSTANTS.TOUCH_AREA_FOR_DEVICES : this.CIRCLE_CONSTANTS.MOUSE_CLICK_AREA) : this.CIRCLE_CONSTANTS.TOUCH_AREA_FOR_DEVICES;
this.bubbleCanvas = $("#bubble");
this.gunPlaceCanvas = $("#gunPlace");
this.bubbleContext = this.bubbleCanvas[0].getContext("2d"); // canvas objects
this.gunPlaceContext =...