aboutsummaryrefslogtreecommitdiff
path: root/views/default/js/lightbox.php
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2012-08-01 14:17:07 +0200
committerSem <sembrestels@riseup.net>2012-08-01 14:17:07 +0200
commit1bd6ef7e6b6a56ac30dc4b7b1daa9b924a5eddd7 (patch)
tree74360ff6183c192a89733c62464fb893dbcfaa29 /views/default/js/lightbox.php
parent65dfea09a7d7b7d2d8b723eb2c66240e39d2f9c0 (diff)
downloadelgg-1bd6ef7e6b6a56ac30dc4b7b1daa9b924a5eddd7.tar.gz
elgg-1bd6ef7e6b6a56ac30dc4b7b1daa9b924a5eddd7.tar.bz2
Colorbox integration into Elgg.
Diffstat (limited to 'views/default/js/lightbox.php')
-rw-r--r--views/default/js/lightbox.php41
1 files changed, 41 insertions, 0 deletions
diff --git a/views/default/js/lightbox.php b/views/default/js/lightbox.php
new file mode 100644
index 000000000..85fd2b717
--- /dev/null
+++ b/views/default/js/lightbox.php
@@ -0,0 +1,41 @@
+<?php
+/**
+ * Elgg lightbox
+ *
+ * Usage
+ * Apply the class elgg-lightbox to links.
+ *
+ * Advanced Usage
+ * Elgg is distributed with the Colorbox jQuery library. Please go to
+ * http://www.jacklmoore.com/colorbox for more information on the options of this lightbox.
+ *
+ * Overriding
+ * In a plugin, override this view and override the registration for the
+ * lightbox JavaScript and CSS (@see elgg_views_boot()).
+ *
+ * @todo add support for passing options: $('#myplugin-lightbox').elgg.ui.lightbox(options);
+ */
+
+?>
+
+/**
+ * Lightbox initialization
+ */
+
+elgg.provide('elgg.ui.lightbox');
+
+elgg.ui.lightbox.init = function() {
+ $(".elgg-lightbox").colorbox();
+}
+
+elgg.ui.lightbox.close = function() {
+ $.colorbox.close();
+}
+
+elgg.register_hook_handler('init', 'system', elgg.ui.lightbox.init);
+
+<?php
+
+$js_path = elgg_get_config('path');
+$js_path = "{$js_path}vendors/jquery/colorbox/colorbox/jquery.colorbox-min.js";
+include $js_path;