From 228b819b0fc697833513000832c3844835e7a5f5 Mon Sep 17 00:00:00 2001 From: Joshua Bell Date: Thu, 15 Aug 2013 20:59:43 -0700 Subject: [PATCH] Remove unused paddle code --- paddles.js | 140 ----------------------------------------------------- styles.css | 50 +------------------ 2 files changed, 1 insertion(+), 189 deletions(-) delete mode 100644 paddles.js diff --git a/paddles.js b/paddles.js deleted file mode 100644 index fdeb8e1..0000000 --- a/paddles.js +++ /dev/null @@ -1,140 +0,0 @@ -// -// Applesoft BASIC in Javascript -// Paddle and Joystick Emulation -// - -// Copyright (C) 2009-2011 Joshua Bell -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -// Usage: -// -// initPaddle( device_element, thumb_element, callback_function ); -// initJoystick( device_element, thumb_element, callback_function_x, callback_function_y ); -// -// Example: -// -// -// -//
Slide the Paddle!
-//
Twiddle me!
- -/*extern document,window,addEvent,removeEvent */ - -function initDevice(device, thumb, fn_x, fn_y) { - device.style.position = "relative"; - device.style.overflow = "hidden"; - - thumb.style.position = "absolute"; - thumb.style.left = 0; - thumb.style.top = 0; - - thumb.last_x = 0; - thumb.last_y = 0; - - var onStickDrag = function (e) { - e.returnValue = false; - e.cancelBubble = true; - if (e.stopPropagation) { e.stopPropagation(); } - if (e.preventDefault) { e.preventDefault(); } - - if (fn_x) { - var x = e.clientX - thumb.originX + thumb.posX; - var min_x = 0; - var max_x = device.clientWidth - thumb.offsetWidth; - if (x < min_x) { x = min_x; } - if (x > max_x) { x = max_x; } - - if (x != thumb.last_x) { - thumb.last_x = x; - thumb.style.left = x + "px"; - fn_x((x - min_x) / (max_x - min_x)); - } - } - - if (fn_y) { - var y = e.clientY - thumb.originY + thumb.posY; - var min_y = 0; - var max_y = device.clientHeight - thumb.offsetHeight; - if (y < min_y) { y = min_y; } - if (y > max_y) { y = max_y; } - - if (y != thumb.last_y) { - thumb.last_y = y; - thumb.style.top = y + "px"; - fn_y((y - min_y) / (max_y - min_y)); - } - } - - return false; - }; - - var onStickUp = function (e) { - e.returnValue = false; - e.cancelBubble = true; - if (e.stopPropagation) { e.stopPropagation(); } - if (e.preventDefault) { e.preventDefault(); } - - removeEvent(document, "mousemove", onStickDrag); - removeEvent(document, "mouseup", onStickUp); - if (thumb.releaseCapture) { thumb.releaseCapture(true); } - - return false; - }; - - var onStickDown = function (e) { - e.returnValue = false; - e.cancelBubble = true; - if (e.stopPropagation) { e.stopPropagation(); } - if (e.preventDefault) { e.preventDefault(); } - - addEvent(document, "mousemove", onStickDrag); - addEvent(document, "mouseup", onStickUp); - if (thumb.setCapture) { thumb.setCapture(true); } - - if (fn_x) { - thumb.originX = e.clientX; - thumb.posX = parseInt(thumb.style.left, 10); - } - - if (fn_y) { - thumb.originY = e.clientY; - thumb.posY = parseInt(thumb.style.top, 10); - } - - return false; - }; - - device.appendChild(thumb); - - addEvent(thumb, "mousedown", onStickDown); -} - -function initPaddle(device, control, fn) { - initDevice(device, control, fn); -} - -function initJoystick(device, control, fn_x, fn_y) { - initDevice(device, control, fn_x, fn_y); -} diff --git a/styles.css b/styles.css index 61ca41a..8a65c4c 100644 --- a/styles.css +++ b/styles.css @@ -913,57 +913,9 @@ td { vertical-align: top; } .tty_80col .a2c286 { background-position: -224px -372px } .tty_80col .a2c287 { background-position: -224px -398px } -/* For non-canvas based hires implementations */ -.hiresPixel { width: 4px; height: 2px; background-color: black; } - .loresPixel { width: 14px; height: 8px; margin: 0; padding: 0; } .loresRow { height: 8px; margin: 0; padding: 0; } .loresDisplay { table-layout: fixed; border-collapse: collapse; } - - /* Input Devices */ -.keyboard { width: 1px; height: 1px; border: none; position: absolute; left: -100px; top: -100px; } -td.controlbox { vertical-align: middle; padding-left: 12px; padding-right: 12px; } - -#paddle0, #paddle1 -{ - border-style: inset; - border-width: 2px; - border-color: gray; - background-color: #c0c0c0; - height: 20px; - width: 245px; - text-align: center; -} -#knob0, #knob1 -{ - border-style: outset; - border-width: 2px; - border-color: gray; - background-color: #404040; - height: 16px; - width: 10px; -} - -#joystick -{ - border-style: inset; - border-width: 2px; - border-color: gray; - background-color: #c0c0c0; - width: 100px; - height: 100px; - text-align: center; - vertical-align: middle; - line-height: 100px; -} -#stick -{ - border-style: outset; - border-width: 2px; - border-color: gray; - background-color: #404040; - height: 16px; - width: 16px; -} +.keyboard { width: 1px; height: 1px; border: none; position: absolute; left: -100px; top: -100px; } \ No newline at end of file