summaryrefslogtreecommitdiffstats
path: root/etherpad/src/plugins/urlIndexer/main.js
diff options
context:
space:
mode:
authorSimon B @piratpartiet <simonb@redhog.org>2010-04-21 23:31:54 +0200
committerSimon B @piratpartiet <simonb@redhog.org>2010-04-21 23:31:54 +0200
commitbeb002e2b700305afae26355018c7f23441451c2 (patch)
tree1311acf84e9be4934108bb47a89797f191ef90a7 /etherpad/src/plugins/urlIndexer/main.js
parent9b3549217642995834d7166456ab8d14e0c99d99 (diff)
parenta1b52bd59f990726178addb42772cf5a4130b808 (diff)
downloadetherpad-beb002e2b700305afae26355018c7f23441451c2.tar.gz
etherpad-beb002e2b700305afae26355018c7f23441451c2.tar.bz2
etherpad-beb002e2b700305afae26355018c7f23441451c2.zip
Merge commit 'mainline/master'
Diffstat (limited to 'etherpad/src/plugins/urlIndexer/main.js')
-rw-r--r--etherpad/src/plugins/urlIndexer/main.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/etherpad/src/plugins/urlIndexer/main.js b/etherpad/src/plugins/urlIndexer/main.js
new file mode 100644
index 0000000..18bdef1
--- /dev/null
+++ b/etherpad/src/plugins/urlIndexer/main.js
@@ -0,0 +1,34 @@
+import("etherpad.log");
+import("plugins.urlIndexer.hooks");
+import("sqlbase.sqlobj");
+import("sqlbase.sqlcommon");
+
+function init() {
+ this.hooks = ['padModelWriteToDB', 'handlePath', 'docbarItemsTagBrowser'];
+ this.description = 'Indexes URLs linked to in pads so that they can be displayed outside pads, searched for etc.';
+ this.padModelWriteToDB = hooks.padModelWriteToDB;
+ this.handlePath = hooks.handlePath;
+ this.docbarItemsTagBrowser = hooks.docbarItemsTagBrowser;
+
+ this.install = install;
+ this.uninstall = uninstall;
+}
+
+function install() {
+ log.info("Installing urlIndexer");
+
+ sqlobj.createTable('PAD_URL', {
+ PAD_ID: 'varchar(128) character set utf8 collate utf8_bin not null references PAD_META(ID)',
+ URL: 'varchar(1024) character set utf8 collate utf8_bin not null',
+ });
+
+ sqlobj.createTable('PAD_URL_CACHE', {
+ PAD_ID: 'varchar(128) character set utf8 collate utf8_bin unique not null references PAD_META(ID)',
+ URLS: 'text collate utf8_bin not null',
+ });
+}
+
+function uninstall() {
+ log.info("Uninstalling urlIndexer");
+}
+