/*!
    Copyright (C) 2016 Google Inc.
    Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
*/

(function(can, $, Clipboard) {
  "use strict";

  can.Component.extend({
    tag: "clipboard-link",
    scope: {
      text: "@",
      title: "@",
      notify: "@",
      isActive: false,
      timeout: "@",
      notifyText: "Link has been copied to your clipboard."
    },
    template: ["<a data-clipboard-text=\"{{text}}\" {{#isActive}}class=\"active\"{{/isActive}} href=\"#\">",
               "<i class=\"fa fa-link\"></i> {{title}}",
               "</a>"].join(""),
    events: {
      "a click": function (el, evnt) {
        evnt.preventDefault();
      },
      "inserted": function (el, evnt) {
        var timeout = this.scope.attr("timeout") || 10000;
        this._clip = new Clipboard(el.find("a")[0]);

        this._clip.on("success", function () {
          if (this.scope.attr("notify")) {
            $("body").trigger("ajax:flash", {"success": this.scope.attr("notifyText")});
          }
          this.scope.attr("isActive", true);
          setTimeout(function () {
            this.scope.attr("isActive", false);
          }.bind(this), timeout);
        }.bind(this));
      }
    }
  });

})(window.can, window.can.$, window.Clipboard);

@@ -126,16 +126,17 @@
 function
+ 
 (can, $,
@@ -151,17 +151,17 @@
 rd) %7B%0A  
-%22
+'
 use stri
@@ -162,17 +162,17 @@
 e strict
-%22
+'
 ;%0A%0A  can
@@ -200,17 +200,17 @@
    tag: 
-%22
+'
 clipboar
@@ -215,17 +215,17 @@
 ard-link
-%22
+'
 ,%0A    sc
@@ -243,19 +243,19 @@
   text: 
-%22@%22
+'@'
 ,%0A      
@@ -261,19 +261,19 @@
  title: 
-%22@%22
+'@'
 ,%0A      
@@ -280,19 +280,19 @@
 notify: 
-%22@%22
+'@'
 ,%0A      
@@ -327,11 +327,11 @@
 ut: 
-%22@%22
+'@'
 ,%0A  
@@ -346,17 +346,17 @@
 fyText: 
-%22
+'
 Link has
@@ -386,17 +386,17 @@
 ipboard.
-%22
+'
 %0A    %7D,%0A
@@ -410,17 +410,17 @@
 plate: %5B
-%22
+'
 %3Ca data-
@@ -434,17 +434,16 @@
 rd-text=
-%5C
 %22%7B%7Btext%7D
@@ -443,17 +443,16 @@
 %7B%7Btext%7D%7D
-%5C
 %22 %7B%7B#isA
@@ -468,17 +468,15 @@
 ass=
-%5C
 %22active
-%5C
 %22%7B%7B/
@@ -495,15 +495,13 @@
 ref=
-%5C
 %22#
-%5C
 %22%3E
-%22
+'
 ,%0A  
@@ -513,17 +513,17 @@
         
-%22
+'
 %3Ci class
@@ -523,17 +523,16 @@
 i class=
-%5C
 %22fa fa-l
@@ -538,9 +538,8 @@
 link
-%5C
 %22%3E%3C/
@@ -550,17 +550,17 @@
 %7Btitle%7D%7D
-%22
+'
 ,%0A      
@@ -572,23 +572,23 @@
     
-%22
+'
 %3C/a%3E
-%22
+'
 %5D.join(
-%22%22
+''
 ),%0A 
@@ -610,17 +610,17 @@
     
-%22
+'
 a click
-%22
+'
 : fu
@@ -689,17 +689,17 @@
     
-%22
+'
 inserted
 %22: f
@@ -694,17 +694,17 @@
 inserted
-%22
+'
 : functi
@@ -761,17 +761,17 @@
 ttr(
-%22
+'
 timeout
-%22
+'
 ) %7C%7C
@@ -825,11 +825,11 @@
 ind(
-%22a%22
+'a'
 )%5B0%5D
@@ -854,25 +854,25 @@
 clip.on(
-%22
+'
 success
-%22
+'
 , functi
@@ -913,16 +913,16 @@
 ttr(
-%22
+'
 notify
-%22
+'
 )) %7B
@@ -940,14 +940,14 @@
   $(
-%22
+'
 body
-%22
+'
 ).tr
@@ -952,17 +952,17 @@
 trigger(
-%22
+'
 ajax:fla
@@ -967,21 +967,21 @@
 lash
-%22, %7B%22
+', %7B'
 success
-%22
+'
 : th
@@ -994,17 +994,17 @@
 pe.attr(
-%22
+'
 notifyTe
@@ -1005,17 +1005,17 @@
 tifyText
-%22
+'
 )%7D);%0A   
@@ -1049,25 +1049,25 @@
 pe.attr(
-%22
+'
 isActive
 %22, true)
@@ -1058,17 +1058,17 @@
 isActive
-%22
+'
 , true);
@@ -1135,17 +1135,17 @@
 ttr(
-%22
+'
 isActive
 %22, f
@@ -1140,17 +1140,17 @@
 isActive
-%22
+'
 , false)

Fix lint warnings in link_to_clipboard.js