LinkPopover.js

From disqus.com, 1 Week ago, written in JavaScript, viewed 3 times. This paste is a reply to LinkPopover.js from disqus.com - view diff
URL https://pastebin.freepbx.org/view/c061b27f Embed
Download Paste or View Raw
  1. define('home/models/formatting/LinkPopover',[
  2.     'backbone',
  3. ], function (
  4.     Backbone
  5. ) {
  6.     'use strict';
  7.  
  8.     var isEmpty = function (val) {
  9.         return !(val && val.trim());
  10.     };
  11.  
  12.     var LinkPopover = Backbone.Model.extend({
  13.         defaults: {
  14.             originalText: '',
  15.             text: '',
  16.             url: '',
  17.         },
  18.  
  19.         validate: function (attrs) {
  20.             if (isEmpty(attrs.text)) {
  21.                 return {
  22.                     attrName: 'text',
  23.                     message: 'Link text is required.',
  24.                 };
  25.             }
  26.  
  27.             if (isEmpty(attrs.url)) {
  28.                 return {
  29.                     attrName: 'url',
  30.                     message: 'Link URL is required.',
  31.                 };
  32.             }
  33.         },
  34.     });
  35.  
  36.     return LinkPopover;
  37. });
  38.  
  39. // https://c.disquscdn.com/next/home/js/models/formatting/LinkPopover.js

Replies to LinkPopover.js rss

Title Name Language When
ChannelCollection.js disqus.com javascript 1 Week ago.

Reply to "LinkPopover.js"

Here you can reply to the paste above