$this->sign
" : ''; - $div .= "About\n"; - $div .= $this->javascript(); - $div .= "© 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 "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(); -?> - -© 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); - -})(); - - -