<commit_before>define(['./module'], function (providers) {
'use strict';

providers.factory('clipboard', ['notify', '$window', function(notify, $window) {

var clipboard = {

  copyClipboard: function(text) {
    var copyDiv = $window.document.createElement('div');
    copyDiv.contentEditable = true;
    copyDiv.style="position: fixed;";
    $window.document.getElementById('fixed').appendChild(copyDiv);
    copyDiv.innerHTML = text;
    copyDiv.unselectable = "off";
    copyDiv.focus();
    $window.document.execCommand('SelectAll');
    $window.document.execCommand("Copy", false, null);
    $window.document.getElementById('fixed').removeChild(copyDiv);
  },
  
  pasteClipboard: function() {
    var pasteDiv = $window.document.createElement('div');
    pasteDiv.contentEditable = true;
    $window.document.getElementById('fixed').appendChild(pasteDiv);
    pasteDiv.innerHTML = '';
    pasteDiv.unselectable = "off";
    pasteDiv.focus();
    $window.document.execCommand("paste");
    var text = pasteDiv.innerText;
    $window.document.getElementById('fixed').removeChild(pasteDiv);
    return text;
  },
  registerScope: function(scope) {
    scope.copyClipboard = function (text) {
        clipboard.copyClipboard(text);
        notify.note('Copied to clipboard');
    };
    scope.pasteClipboard = clipboard.pasteClipboard;
  }

};
return clipboard;
}]);
});<commit_msg>allow adding a custom message with copy to clipboard actions.<commit_after>define(['./module'], function (providers) {
'use strict';

providers.factory('clipboard', ['notify', '$window', function(notify, $window) {

var clipboard = {

  copyClipboard: function(text) {
    var copyDiv = $window.document.createElement('div');
    copyDiv.contentEditable = true;
    copyDiv.style="position: fixed;";
    $window.document.getElementById('fixed').appendChild(copyDiv);
    copyDiv.innerHTML = text;
    copyDiv.unselectable = "off";
    copyDiv.focus();
    $window.document.execCommand('SelectAll');
    $window.document.execCommand("Copy", false, null);
    $window.document.getElementById('fixed').removeChild(copyDiv);
  },
  
  pasteClipboard: function() {
    var pasteDiv = $window.document.createElement('div');
    pasteDiv.contentEditable = true;
    $window.document.getElementById('fixed').appendChild(pasteDiv);
    pasteDiv.innerHTML = '';
    pasteDiv.unselectable = "off";
    pasteDiv.focus();
    $window.document.execCommand("paste");
    var text = pasteDiv.innerText;
    $window.document.getElementById('fixed').removeChild(pasteDiv);
    return text;
  },
  registerScope: function(scope) {
    scope.copyClipboard = function (text, notification) {
        notification = notification || 'Copied to clipboard';
        clipboard.copyClipboard(text);
        notify.note(notification);
    };
    scope.pasteClipboard = clipboard.pasteClipboard;
  }

};
return clipboard;
}]);
});
{'fraction_non_alphanumeric': 0.15181975736568457, 'fraction_numerical': 0.0, 'mean_word_length': 4.354359925788497, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7300692', 'n_tokens_mistral': 844, 'n_tokens_neox': 831, 'n_words': 141}