withEmailVerifyLink.js

From disqus.com, 7 Months ago, written in JavaScript, viewed 3 times. This paste is a reply to withEmailVerifyLink.js from disqus.com - view diff
URL https://pastebin.freepbx.org/view/12e4822d Embed
Download Paste or View Raw
  1. define('core/mixins/withEmailVerifyLink',[
  2.     'jquery',
  3.     'underscore',
  4.  
  5.     'core/config',
  6.     'core/utils',
  7. ], function (
  8.     $,
  9.     _,
  10.  
  11.     config,
  12.     coreUtils
  13. ) {
  14.     'use strict';
  15.  
  16.     var handler = coreUtils.preventDefaultHandler;
  17.  
  18.     var EmailVerifyLinkMixin = {
  19.         events: {
  20.             'click [data-action=verify-email]': 'showVerifyEmailPopup',
  21.         },
  22.  
  23.         showVerifyEmailPopup: handler(function (evt) {
  24.             var forumId = $(evt.target).attr('data-forum');
  25.             var url = config.urls.verifyEmail;
  26.  
  27.             if (forumId)
  28.                 url = url + '?f=' + forumId;
  29.  
  30.             return coreUtils.openWindow(url, '_blank', {
  31.                 width: 460,
  32.                 height: 355,
  33.             });
  34.         }),
  35.     };
  36.  
  37.     return function withEmailVerifyLink() {
  38.         this.events = _.defaults({}, this.events, EmailVerifyLinkMixin.events);
  39.  
  40.         _.extend(this, _.pick(EmailVerifyLinkMixin, 'showVerifyEmailPopup'));
  41.  
  42.     };
  43. });
  44.  
  45.  

Reply to "withEmailVerifyLink.js"

Here you can reply to the paste above