+
+ /**
+ * TimeZome select
+ * FIXME! way too hackish
+ */
+ var toRemove = document.getElementById('timezone-remove');
+ if (toRemove != null) {
+ var firstSelect = toRemove.getElementsByTagName('select')[0];
+ var secondSelect = toRemove.getElementsByTagName('select')[1];
+ toRemove.parentNode.removeChild(toRemove);
+ var toAdd = document.getElementById('timezone-add');
+ var newTimezone = '<span class="timezone-continent">Continent ' + firstSelect.outerHTML + '</span>';
+ newTimezone += ' <span class="timezone-country">Country ' + secondSelect.outerHTML + '</span>';
+ toAdd.innerHTML = newTimezone;
+ }
+
+ /**
+ * Awesomplete trigger.
+ */
+ var tags = document.getElementById('lf_tags');
+ if (tags != null) {
+ awesompleteUniqueTag('#lf_tags');
+ }
+
+ /**
+ * bLazy trigger
+ */
+ var picwall = document.getElementById('picwall_container');
+ if (picwall != null) {
+ var bLazy = new Blazy();
+ }
+
+ /**
+ * Bookmarklet alert
+ */
+ var bookmarkletLinks = document.querySelectorAll('.bookmarklet-link');
+ var bkmMessage = document.getElementById('bookmarklet-alert');
+ [].forEach.call(bookmarkletLinks, function(link) {
+ link.addEventListener('click', function(event) {
+ event.preventDefault();
+ alert(bkmMessage.value);
+ });
+ });
+
+ /**
+ * Firefox Social
+ */
+ var ffButton = document.getElementById('ff-social-button');
+ if (ffButton != null) {
+ ffButton.addEventListener('click', function(event) {
+ activateFirefoxSocial(event.target);
+ });
+ }
+
+ /**
+ * Plugin admin order
+ */
+ var orderPA = document.querySelectorAll('.order');
+ [].forEach.call(orderPA, function(link) {
+ link.addEventListener('click', function(event) {
+ event.preventDefault();
+ if (event.target.classList.contains('order-up')) {
+ return orderUp(event.target.parentNode.parentNode.getAttribute('data-order'));
+ } else if (event.target.classList.contains('order-down')) {
+ return orderDown(event.target.parentNode.parentNode.getAttribute('data-order'));
+ }
+ });
+ });