spacevillain (spacevillain) wrote in changelog,
spacevillain
spacevillain
changelog

[livejournal] r23213: LJSUP-14013: Refactoring of LJShare

Committer: atyurin
LJSUP-14013: Refactoring of LJShare
U   trunk/htdocs/js/basic.js
U   trunk/htdocs/js/share.js
Modified: trunk/htdocs/js/basic.js
===================================================================
--- trunk/htdocs/js/basic.js	2012-10-29 13:19:40 UTC (rev 23212)
+++ trunk/htdocs/js/basic.js	2012-10-29 15:06:29 UTC (rev 23213)
@@ -208,27 +208,6 @@
 };
 
 /**
- * Add pub/sub functionality for an object.
- *
- * @param {Object} obj Target object.
- */
-LJ.addPubSub = function(obj) {
-	var o = jQuery({});
-
-	obj.addEventListener = function() {
-		o.on.apply(o, arguments);
-	};
-
-	obj.removeEventListener = function() {
-		o.off.apply(o, arguments);
-	};
-
-	obj.dispatchMessage = function() {
-		o.trigger.apply(o, arguments);
-	};
-};
-
-/**
  * Format number according to locale. E.g. 1000000 becomes 1,000,000.
  *
  * @param {number} num Number to format.

Modified: trunk/htdocs/js/share.js
===================================================================
--- trunk/htdocs/js/share.js	2012-10-29 13:19:40 UTC (rev 23212)
+++ trunk/htdocs/js/share.js	2012-10-29 15:06:29 UTC (rev 23213)
@@ -64,7 +64,6 @@
             * @event
             */
             var event = jQuery.Event('popupClosed', { service: service, shareLink: link });
-            LJShare.dispatchMessage(event);
         } else {
             setTimeout(pollForWindowClose.bind(null, w, service, link), 200);
         }
@@ -145,7 +144,6 @@
     var global_options = $.extend( true, {}, default_options );
 
     // we add messaging system to notify external scripts about popups being closed.
-    LJ.addPubSub(LJShare);
 
     /**
     * Overrides default options for current page.

Tags: atyurin, js, livejournal, spacevillain
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments