diff --git a/.htacess b/.htacess deleted file mode 100644 index eedc535..0000000 --- a/.htacess +++ /dev/null @@ -1,8 +0,0 @@ - - - - RewriteEngine On - RewriteCond %{REQUEST_FILENAME} !-d - RewriteCond %{REQUEST_FILENAME} !-f - RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] - diff --git a/includes/BSM.js b/includes/BSM.js deleted file mode 100644 index 7644a5f..0000000 --- a/includes/BSM.js +++ /dev/null @@ -1,94 +0,0 @@ -/* British Sign Machine Javascript. Copyright 2008-08-30, -09-16 N.D.Freear. -*/ -var BSM = function(id, timeout) { - - var imgSize = 200; - - if (!document.getElementById) return false; - var div = document.getElementById(id); - var images= div.getElementsByTagName('img'); - - this.pfx = id; - this.timeout = timeout; - this.timer = null; - this.counter = 0; - this.nImages = images.length; - - for (var nm=0; nm 0) { - var lal = document.getElementById(this.pfx + (this.counter-1)); - if (lal) { - lal.style.display = 'none'; - } - } - if (this.counter < this.nImages) { - //this.timer = window.setTimeout(this.pfx+'.handler()', this.timeout); - this.counter++; - } else { - clearInterval(this.timer); - } - } - - this.play = function() { - clearInterval(this.timer); - var lal = document.getElementById(this.pfx + (this.counter-1)); - if (lal) { - lal.style.display = 'none'; - } - this.counter = 0; - //this.handler(); - this.timer = setInterval(function() { that.handler.call(that); }, this.timeout); - - this.pauseBtn.disabled = false; - //document.getElementById(this.pfx+'pause').disabled =false; - } - - - this.play.call(this); -}; - - -/*BSM.prototype.play = function() { - clearInterval(this.timer); //this.pause(); - var lal = document.getElementById(this.pfx + (this.counter-1)); - if (lal) { - lal.style.display = 'none'; - } - this.counter = 0; - //this.handler(); - //that = this; - this.timer = setInterval(function() { that.handler.call(that); }, this.timeout); - - document.getElementById('pause').disabled =false; -}*/ diff --git a/includes/bsm.css b/includes/bsm.css deleted file mode 100644 index 7d15466..0000000 --- a/includes/bsm.css +++ /dev/null @@ -1,21 +0,0 @@ -/* Sign Machine styles. */ - -body { font-family: Tahoma,Arial,sans-serif; background: #fff; - color: #000; margin: 2em; line-height: 1.5em; } -li { margin-top: .4em; } -acronym, abbr { border-bottom: 1px dotted #333; cursor: help; } -a:link { color: #00d; padding: 2px; } -a:hover, a:focus, a:active { text-decoration: none; padding: 1px; color: #b00; border: 2px solid #a55; } -h1 span { font-size: .7em; color: gray; } -.foot { font-size: small; letter-spacing: .2em; text-align: right; - margin-top: 3.2em; padding-top: .4em; border-top: 1px solid #aaa; } - -.bsm, #bsm1 { width: 200px; height: 300px; - vertical-align: bottom; line-height: 1em; } -.bsm img, #bsm1 img { __width: 200px; height: 200px; } -.bsm a, #bsm1 a { font-size: small; } - -body.bsm-popup { margin: 4px; padding: 0; } -body.__bsm-page { margin: 2em; } - -body.bsm-page .bsm { border: 2px solid #ccc; padding: 4px; } \ No newline at end of file diff --git a/lib/BSM.class.php b/lib/BSM.class.php deleted file mode 100644 index 59dfbf0..0000000 --- a/lib/BSM.class.php +++ /dev/null @@ -1,191 +0,0 @@ -(experimental)'; #'British Sign Language' #get_class($this) - - function BritishSignMachine() { #__construct() - $this->url = $url = 'http://'.$_SERVER['HTTP_HOST'].(80!=$_SERVER['SERVER_PORT'] ? ':'.$_SERVER['SERVER_PORT'] :'').dirname($_SERVER['PHP_SELF']); - #$this->url = $url = 'http://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['PHP_SELF']); - $this->parseQuery(); - $this->parseText(); - $meta = $this->headers(); - $this->render($meta); - } - - function isPageView() { - return 'html/div' != $this->view; - } - - function isPopupView() { - return 'html/popup' == $this->view; - } - - function parseQuery() { - $this->text = $this->get('text'); - $this->view = $this->get('view', 'html/page', array('html/div')); - $t = $this->jsTimeout = $this->get('timeps', 1300); - if ($t < 500 || $t > 2500) { - $this->jsTimeout = 1300; - } - } - - function parseText() { - #@todo, At the moment removes non-alpha including numbers. - $this->sign = preg_replace('#[^a-zA-Z ]*#', '', $this->text); #@todo:PHP 5, -1, $count); - $this->sign = substr(trim($this->sign), 0, BSM_MAX_CHAR); - } - - function headers() { - $headers = array( - 'Content-Type'=> 'text/html; charset=UTF-8', - 'Content-Script-Type'=> 'application/javascript', - 'Content-Language'=> 'en-GB,sgn-GB', #,bfi,British-Sign-Language' - 'X-BSM-Sign'=> ($this->sign ? $this->sign : '[null]'), - 'X-BSM-Duration'=> $this->jsTimeout*strlen($this->sign), #? count(str_split($this->sign, 1)); - #@header('X-BSM-Max-Chars: '.BSM_MAX_CHAR); - ); - header('Content-Type: text/html; charset=UTF-8'); - @header('X-Powered-By:'); - $meta = null; - foreach ($headers as $key => $content) { - if (!$this->isPageView()) @header($key.': '.$content); - $meta .= '\n"; - } - return $meta; - #$h = implode("", $headers); - } - - function render($meta) { - $pfx = 'http://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['PHP_SELF']); - $div = "
"; - $elems = preg_split('//', $this->sign, -1, PREG_SPLIT_NO_EMPTY); #@todo:PHP 5, str_split($this->sign, 1); - foreach ($elems as $elem) { - $elem = strtolower($elem); #Portable. - $class = null; - if (' '==$elem) { - #$div .= "    "; - $elem = '_space'; - $class = ' class="space"'; - } - $div .= ""; - } - $div .= $this->sign ? "$this->sign

" : ''; - $div .= "About\n"; - $div .= $this->javascript(); - $div .= "
\n"; - - if ($this->isPageView()) { - $this->page($div, $meta); - } else { - @header('Content-Length: '.strlen($div)); - echo $div; - } - } - - function javascript() { - $j = "\n"; - if ($this->sign) { - $j.=""; - } return $j; /*<< - -EOT;*/ - } - - function page($div, $meta = null) { - $title = $this->sign ? $this->sign.' - ' : ''; - $title.= $this->isPopupView() ? 'BSL α' : $this->title; #'British Sign Language'; - $value = $this->text ? htmlspecialchars($this->text) : 'Hello!'; #'Hello world!'; - - $margin = null; #$this->isPopupView() ? 'margin:4px; padding:0;' : 'margin:1em;'; - $border = null; #$this->isPopupView() ? null : 'border:2px solid #ccc; padding:4px;'; - $imgSize = null; #200; - - $self = urlencode('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); - ?> - - - - echo $meta; -?> - -<?php echo strip_tags($title) ?> - - - - - - - - - - - - - - -isPopupView()) { ?> -

-
-

- - ?> - -

-
- - - - - -isPopupView()): ?> -

© 2008 N.D.Freear

- - - - - \ No newline at end of file diff --git a/lib/SignWriter.class.php b/lib/SignWriter.class.php deleted file mode 100644 index 2e5c166..0000000 --- a/lib/SignWriter.class.php +++ /dev/null @@ -1,167 +0,0 @@ -59, - 'EN-GB'=>59, - 'GB' =>59, - 'GB-D'=>59, #Dictionary - 'BSL' =>59, - - 'SGN' =>4, - 'EN-US'=>4, - 'US' =>4, - 'US-D'=>4, - 'ASL' =>4, - 'US-L'=>5, #Literature - 'US-E'=>21, #Encyclopedia - #... -); -$langIds = array( - 59 => 'BSL/en-GB', - 4 => 'ASL/en-US', - 5 => 'ASL/en-US/US-L', -); - - -$search = _get('q', 'sign'); -$ui = _get('ui', 1); - -$lang= null; -$sgn = _get('sgn', null); #59. -if (!$sgn) { - $lang = str_replace('_', '-', strtoupper(_get('lang', 'sgn-gb'))); - if (isset($sgnLangs[$lang])) { - $sgn = $sgnLangs[$lang]; - } -} -$langId = null; -if (isset($langIds[$sgn])) { - $langId = $langIds[$sgn]; -} -if (!$lang) { - $lang = substr($langId, 0,3); -} - -$file = $url .'_sgn-'.$sgn.'_sbml.xml'; -$file = str_replace('http://', '', $file); -$file = str_replace('www', '', $file); -$file = str_replace('/', '_', $file); - -echo "\n"; -#_dump($xr); - -return ob_get_clean(); -} #End:function. -$page = signWriter(); - - -$title = 'SignWriting'; -ob_start(); -?> - -
-

- - -

-
- - - -

Thanks to Sign Bank®

- - - - - \ No newline at end of file diff --git a/lib/bookmarklet.php b/lib/bookmarklet.php deleted file mode 100644 index 0f53cd4..0000000 --- a/lib/bookmarklet.php +++ /dev/null @@ -1,81 +0,0 @@ -*\/ javascript... - - @copyright 2008-09-22 N.D.Freear. - @param string $jsFile Javascript file. - @param string $name Bookmarklet name (to appear in Favourites/Bookmarks). - @param boolean $iexplore Is bookmarklet for Internet Explorer? [false]. - @return string HTML link. -*/ -require_once 'bsm.template.php'; - - -function bookmarklet($jsFile, $name='My Marker', $iexplore=false) { - $link = null; - $attrs = "class='bookmarklet' onclick='alert(\"Please drag the link to your toolbar before clicking\");return false'"; - - #$iexplore = false; - $browser = 'Safari, Firefox, Chrome...'; - if ($iexplore) { - $browser = 'Internet Explorer'; - } - #for ($idx=0; $idx < 2; $idx++) { - - ob_start(); - require $jsFile; - $js = ob_get_clean(); - - $js = preg_replace('#/\*.*?\*/#ms', '', $js); #Multi-line comments. - $js = preg_replace('#^//.*?[\r|\n]#','', $js); #Single-line comments. - $js = str_replace('else if', 'else%20if', $js); - $js = preg_replace('# {1,}#', '', $js); #{2,} - $js = str_replace("\r", '', $js); - $js = str_replace("\n", '', $js); - $js = str_replace("\t", '', $js); - #$js = str_replace(' ','%20',$js); - $js = htmlspecialchars($js); - - $link .= "For $browser $name\n"; - - if (!$iexplore) { - $iexplore = true; - $browser = 'Internet Explorer'; - #} - } - return $link; -} - - - -$jsfile = 'bsm.bookmarklet.js'; -$name = "BSL Speller"; - - -$title = 'Sign Machine Bookmarklets'; -ob_start(); -?> - - - - -

Getting started

-
    -
  1. Choose the link above appropriate to your browser (in Windows, the browser -name is normally displayed in the title bar next to a website title).
  2. - -
  3. To install, right-click on the bookmarklet link, choose "Add to Favourites"/ -"Bookmark this link" (Firefox) press OK.
  4. - -
  5. To use, select some text on a web-page, goto Favourites/Bookmarks in the browser -menu-bar, and press "BSL Speller". A popup window will appear with animated -signing for the selected text.
  6. -
- - - \ No newline at end of file diff --git a/lib/bsm.bookmarklet.js b/lib/bsm.bookmarklet.js deleted file mode 100644 index b427102..0000000 --- a/lib/bsm.bookmarklet.js +++ /dev/null @@ -1,25 +0,0 @@ -/* BSL Speller bookmarklet. Copyright 2008-09-22 N.D.Freear -*/ -b = 'http://freear.org.uk/sign/'; -f='menubar=no,location=no,resizable=yes,scrollbars=no,status=no,width=210,height=320'; -t=document.getElementsByTagName('title')[0].innerHTML; - -/* */ -s=document.selection.createRange().text; - -/**/ -s=window.getSelection(); - -/**/ - -tx=''; -if(s!=''){tx=s;} -else if(t!=''){tx=t;} -if(tx!=''){ - u=encodeURI(b+'?view=html/popup&text='+tx); - w=window.open(u,'speller',f); -} -/*(function(){ - setTimeout('w.focus()',1000); -} )();";*/ -w.focus(); \ No newline at end of file diff --git a/lib/bsm.template.php b/lib/bsm.template.php deleted file mode 100644 index 4a70057..0000000 --- a/lib/bsm.template.php +++ /dev/null @@ -1,99 +0,0 @@ - (experimental)"; - $url = dirname(dirname($_SERVER['PHP_SELF'])); - - header('Content-Type: text/html; charset=UTF-8'); - @header('Content-Language: en'); - @header('X-Powered-By:'); -?> - - - - - - - -<?php echo strip_tags($title) ?> - - - - - - - -

- - - -

© 2008 N.D.Freear

- - -$text\n"; -} -function _u($url) { - return htmlspecialchars($url); -} -function _dump($var) { - echo "
";
-  var_dump($var);
-  echo "
"; -} - -function _get($name, $default) { - if (isset($_GET[$name])) { - return $_GET[$name]; - } - return $default; -} - - - -#PHP4 compatibility. -return; - -if (!function_exists('_str_split') && function_exists('preg_split')) { - function _str_split($string, $split_length=1) { - return preg_split("/(.{{$split_length}})/", $string, -1, PREG_SPLIT_NO_EMPTY|PREG_SPLIT_DELIM_CAPTURE); - } -} -if (!function_exists('_stripos')) { - function _stripos($haystack, $needle, $offset=0) { - return strpos(strtolower($haystack), strtolower($needle), $offset); - } - function _strripos($haystack, $needle, $offset=0) { - return strrpos(strtolower($haystack), strtolower($needle), $offset); - } -} - - -$test = "Hello\nworld !"; -$needle = "WORLD"; - -echo '
';
-var_dump(str_split($test, 2));
-var_dump(_str_split($test, 2));
-
-echo stripos($test, $needle),"\n";
-echo _stripos($test, $needle);
-
-?>
\ No newline at end of file
diff --git a/lib/finger_speller.user.copy.js b/lib/finger_speller.user.copy.js
deleted file mode 100644
index 0818625..0000000
--- a/lib/finger_speller.user.copy.js
+++ /dev/null
@@ -1,46 +0,0 @@
-// ==UserScript==
-// @name           Finger speller
-// @namespace      http://freear.org.uk
-// @description    Uses BSM server.
-// @include       *
-// ==/UserScript==
-// @exclude        http://localhost:8888/bsl/*
-// @exclude       http://diveintogreasemonkey.org/*
-// @exclude       http://www.diveintogreasemonkey.org/*
-
-
-//http://diveintogreasemonkey.org/api/gm_xmlhttprequest.html
-
-//GM_log(' Finger speller ');
-
-(function() {
-
-var baseUrl = 'http://localhost:8888/bsl/';
-
-function copyit() {
-  var selObj = window.getSelection(); 
-  //var selRange = selObj.getRangeAt(0);
-  // do stuff with the range
-  GM_log('" '+selObj+' "' );
-
-  var sUrl = encodeURI(baseUrl+'?view=html/div&text='+selObj);
-  var sFeatures="menubar=no,location=no,resizable=yes,scrollbars=no,status=no,width=210,height=320";
-  var r = window.open(sUrl, 'speller', sFeatures);
-
-};
-
-var btn = document.createElement('input');
-btn.setAttribute('type', 'image');
-btn.alt = btn.title = 'Finger spell';
-btn.src = baseUrl+'hand-01.png';
-//btn.innerHTML = 'Finger spell';
-//btn.style = //{ position: 'absolute', top: 0, left: 0 };
-btn.setAttribute('style', 'position:absolute;top:0;left:0;border:2px solid #ccc');
-btn.addEventListener('click', copyit, true);
-
-document.getElementsByTagName('body')[0].appendChild(btn);
-
-})();
-
-
-