From 6f85628482f3351e35b2544aad7f9fc61286205c Mon Sep 17 00:00:00 2001 From: Shish Moom Date: Tue, 7 Jul 2009 07:53:00 -0700 Subject: [PATCH] these are long dead... --- contrib/autocomplete/main.php | 31 ----------- contrib/autocomplete/script.js | 98 ---------------------------------- contrib/notes/main.php | 52 ------------------ contrib/notes/theme.php | 13 ----- 4 files changed, 194 deletions(-) delete mode 100644 contrib/autocomplete/main.php delete mode 100644 contrib/autocomplete/script.js delete mode 100644 contrib/notes/main.php delete mode 100644 contrib/notes/theme.php diff --git a/contrib/autocomplete/main.php b/contrib/autocomplete/main.php deleted file mode 100644 index cee08e4e..00000000 --- a/contrib/autocomplete/main.php +++ /dev/null @@ -1,31 +0,0 @@ - - * License: GPLv2 - * Description: Auto-complete for search and upload tags - * Documentation: - * Just enable and things should start autocompleting as if - * by magic. That is, if this extension actually worked... - */ - -class AutoComplete implements Extension { - public function receive_event(Event $event) { - if(($event instanceof PageRequestEvent) && ($event->page_matches("index") || $event->page_matches("view"))) { - $event->page->add_header(""); - } - if(($event instanceof PageRequestEvent) && $event->page_matches("autocomplete")) { - $event->page->set_mode("data"); - $event->page->set_type("text/plain"); - $event->page->set_data($this->get_completions($event->get_arg(0))); - } - } - - private function get_completions($start) { - global $database; - $tags = $database->db->GetCol("SELECT tag,count FROM tags WHERE tag LIKE ? ORDER BY count DESC", array($start.'%')); - return implode("\n", $tags); - } -} -add_event_listener(new AutoComplete()); -?> diff --git a/contrib/autocomplete/script.js b/contrib/autocomplete/script.js deleted file mode 100644 index 081d8b47..00000000 --- a/contrib/autocomplete/script.js +++ /dev/null @@ -1,98 +0,0 @@ - -// addEvent(window, "load", function() { -// initAjax("searchBox", "search_completions"); -// initAjax("tagBox", "upload_completions"); -// }); - -function endWord(sentance) { - words = sentance.split(" "); - return words[words.length-1]; -} - -var resultCache = new Array(); -resultCache[""] = new Array(); - -function complete(boxname, text) { - box = byId(boxname); - words = box.value.split(" "); - box.value = ""; - for(n=0; n"+results[i]+""; - } -} - -function initAjax(boxname, areaname) { - var box = byId(boxname); - if(!box) return; - - addEvent( - box, - "keyup", - function f() { - starter = endWord(box.value); - - if(resultCache[starter]) { - fillCompletionZone(boxname, areaname, resultCache[starter]); - } - else { - ajaxRequest( - "ajax.php?start="+starter, - function g(text) { - resultCache[starter] = text.split("\n"); - fillCompletionZone(boxname, areaname, resultCache[starter]); - } - ); - } - }, - false - ); -} - - -//completion_cache = new array(); - -input = byId("search_input"); -output = byId("search_completions"); - -function get_cached_completions(start) { -// if(completion_cache[start]) { -// return completion_cache[start]; -// } -// else { - return null; -// } -} -function get_completions(start) { - cached = get_cached_completions(start); - if(cached) { - output.innerHTML = cached; - } - else { - ajaxRequest(autocomplete_url+"/"+start, function(data) {set_completions(start, data);}); - } -} -function set_completions(start, data) { -// completion_cache[start] = data; - output.innerHTML = data; -} - -if(input) { - input.onkeyup = function() { - if(input.value.length < 3) { - output.innerHTML = ""; - } - else { - get_completions(input.value); - } - }; -} diff --git a/contrib/notes/main.php b/contrib/notes/main.php deleted file mode 100644 index 52049ae8..00000000 --- a/contrib/notes/main.php +++ /dev/null @@ -1,52 +0,0 @@ - - * License: GPLv2 - * Description: Adds notes overlaid on the images - * Documentation: - * This is quite broken :( - */ - -class Notes implements Extension { - var $theme; - - public function receive_event(Event $event) { - global $config, $database, $page, $user; - if(is_null($this->theme)) $this->theme = get_theme_object($this); - - if($event instanceof InitExtEvent) { - if($config->get_int("ext_notes_version") < 1) { - $this->install(); - } - } - - if($event instanceof DisplayingImageEvent) { - $notes = $database->get_all("SELECT * FROM image_notes WHERE image_id = ?", array($event->image->id)); - $this->theme->display_notes($page, $notes); - } - } - - protected function install() { - global $database; - global $config; - $database->create_table("image_notes", " - id SCORE_AIPK, - image_id INTEGER NOT NULL, - user_id INTEGER NOT NULL, - owner_ip SCORE_INET NOT NULL, - created_at DATETIME NOT NULL, - updated_at DATETIME NOT NULL, - version INTEGER DEFAULT 1 NOT NULL, - is_active SCORE_BOOL DEFAULT SCORE_BOOL_Y NOT NULL, - x INTEGER NOT NULL, - y INTEGER NOT NULL, - w INTEGER NOT NULL, - h INTEGER NOT NULL, - body TEXT NOT NULL - "); - $config->set_int("ext_notes_version", 1); - } -} -add_event_listener(new Notes()); -?> diff --git a/contrib/notes/theme.php b/contrib/notes/theme.php deleted file mode 100644 index 178b9fb9..00000000 --- a/contrib/notes/theme.php +++ /dev/null @@ -1,13 +0,0 @@ - -img = byId("main_image"); - -EOD; - $page->add_block(new Block(null, $html)); - } -} -?>