PageSourceSearch

https://tumetscombien.com/Scripts/angular-trix/js/angular-trix.js

js tumetscombien.com collected 2026-10-07 03:46:04 UTC 2,458 bytes, 64 lines download raw bytes

vendor: 2,458 bytes, lines 1-64
1/*! angular-trix - v1.0.0 - 2015-12-09
2* https://github.com/sachinchoolur/angular-trix
3* Copyright (c) 2015 Sachin; Licensed MIT */
4(function () {
5    'use strict';
6    angular.module('angularTrix', []).directive('angularTrix', function () {
7        return {
8            restrict: 'A',
9            require: 'ngModel',
10            scope: {
11                trixInitialize: '&',
12                trixChange: '&',
13                trixSelectionChange: '&',
14                trixFocus: '&',
15                trixBlur: '&',
16                trixFileAccept: '&',
17                trixAttachmentAdd: '&',
18                trixAttachmentRemove: '&'
19            },
20            link: function (scope, element, attrs, ngModel) {
21
22                element.on('trix-initialize', function () {
23                    if (ngModel.$modelValue) {
24                        element[0].editor.loadHTML(ngModel.$modelValue);
25                    }
26                });
27
28                ngModel.$render = function () {
29                    if (element[0].editor) {
30                        element[0].editor.loadHTML(ngModel.$modelValue);
31                    }
32
33                    element.on('trix-change', function () {
34                        ngModel.$setViewValue(element.html());
35                    });
36                };
37
38                var registerEvents = function (type, method) {
39                    element[0].addEventListener(type, function (e) {
40                        if (type === 'trix-file-accept' && attrs.preventTrixFileAccept === 'true') {
41                            e.preventDefault();
42                        }
43
44                        scope[method]({
45                            e: e,
46                            editor: element[0].editor
47                        });
48                    });
49                };
50
51                registerEvents('trix-initialize', 'trixInitialize');
52                registerEvents('trix-change', 'trixChange');
53                registerEvents('trix-selection-change', 'trixSelectionChange');
54                registerEvents('trix-focus', 'trixFocus');
55                registerEvents('trix-blur', 'trixBlur');
56                registerEvents('trix-file-accept', 'trixFileAccept');
57                registerEvents('trix-attachment-add', 'trixAttachmentAdd');
58                registerEvents('trix-attachment-remove', 'trixAttachmentRemove');
59
60            }
61        };
62    });
63
64}());

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.