How to use the tui-code-snippet.stamp function in tui-code-snippet

To help you get started, weโ€™ve selected a few tui-code-snippet examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nhn / tui.calendar / src / js / controller / viewMixin / core.js View on Github external
forEachArr(collisionGroups.slice(0).reverse(), function(group) {
                        if (~util.inArray(util.stamp(previous.valueOf()), group)) {
                            // If you find a previous schedule that overlaps, include it in the Collision Group to which it belongs.
                            group.push(util.stamp(schedule.valueOf()));

                            return false; // returning false can stop this loop
                        }

                        return true;
                    });
github nhn / tui.calendar / src / js / model / schedule.js View on Github external
this.goingDuration = 0;

    /**
     * travelTime: coming-Duration minutes
     * @type {number}
     */
    this.comingDuration = 0;

    /**
     * Separate data storage space independent of rendering.
     * @type {object}
     */
    this.raw = null;

    // initialize model id
    util.stamp(this);
}
github nhn / tui.calendar / test / app / factory / calendar.spec.js View on Github external
it('updateSchedule() can update Schedule model', function() {
            var schedule = jasmine.createSpyObj('Schedule', ['set', 'cid', 'dirty']);
            var id = util.stamp(schedule);
            var calendarId = schedule.calendarId;
            schedule.id = id;
            schedule.cid.and.returnValue(id);
            controller.schedules.add(schedule);
            spyOn(controller, 'updateSchedule');

            inst.updateSchedule(id, calendarId, {'hello': 'world'});

            expect(controller.updateSchedule).toHaveBeenCalledWith(schedule, {'hello': 'world'});
            expect(inst.render).toHaveBeenCalled();
        });
github nhn / tui.calendar / test / app / factory / calendar.spec.js View on Github external
it('can return the HTMLElement by schedule id and calendar id', function() {
            var schedule = jasmine.createSpyObj('Schedule', ['set', 'cid', 'dirty']);
            var id = util.stamp(schedule);
            var calendarId = schedule.calendarId;
            schedule.id = id;
            schedule.cid.and.returnValue(id);

            inst._controller.schedules.add(schedule);
            spyOn(document, 'querySelector').and.callThrough();

            inst.getElement(id, calendarId);

            expect(document.querySelector).toHaveBeenCalled();
        });
    });
github nhn / tui.calendar / test / app / view / view.spec.js View on Github external
it('Can remove child view.', function() {
            view.removeChild(util.stamp(view2));
            expect(view.children.length).toBe(0);
        });
github nhn / tui.image-editor / test / command.spec.js View on Github external
it('"undo()" should restore the removed object', done => {
            canvas.setActiveObject(object);

            invoker.execute(commands.REMOVE_OBJECT, graphics, snippet.stamp(object)).then(() => (
                invoker.undo()
            )).then(() => {
                expect(canvas.contains(object)).toBe(true);
                done();
            });
        });
github samuelbetio / storyofmylife / test / app / factory / calendar.spec.js View on Github external
it('deleteSchedule() can delete Schedule model in collection.', function() {
            var schedule = jasmine.createSpyObj('Schedule', ['set', 'cid', 'dirty']);
            var id = util.stamp(schedule);
            var calendarId = schedule.calendarId;
            schedule.id = id;
            schedule.cid.and.returnValue(id);
            controller.schedules.add(schedule);

            expect(controller.schedules.length).toBe(1);

            inst.deleteSchedule(id, calendarId);

            expect(controller.schedules.length).toBe(0);
        });
    });
github nhn / tui.calendar / test / app / controller / viewMixin / core.spec.js View on Github external
collection = new Collection(function(model) {
                return util.stamp(model);
            });
            collection.add.apply(collection, scheduleList);
github nhn / tui.date-picker / src / js / datepicker / index.js View on Github external
*/
      this._openers = [];

      /**
       * State of picker enable
       * @type {boolean}
       * @private
       */
      this._isEnabled = true;

      /**
       * ID of instance
       * @private
       * @type {number}
       */
      this._id = 'tui-datepicker-' + snippet.stamp(this);

      /**
       * DatePicker type
       * @type {TYPE_DATE|TYPE_MONTH|TYPE_YEAR}
       * @private
       */
      this._type = options.type;

      /**
       * Show always or not
       * @type {boolean}
       */
      this.showAlways = options.showAlways;

      /**
       * Close after select a date
github nhn / tui.calendar / src / js / common / domevent.js View on Github external
_off: function(obj, type, fn, context) {
        var id = type + util.stamp(fn) + (context ? '_' + util.stamp(context) : ''),
            handler = obj[eventKey] && obj[eventKey][id];

        if (!handler) {
            return;
        }

        if ('removeEventListener' in obj) {
            if (type === 'mouseenter' || type === 'mouseleave') {
                obj.removeEventListener((type === 'mouseenter') ?
                    'mouseover' : 'mouseout', handler, false);
            } else {
                if (type === 'mousewheel') {
                    obj.removeEventListener('DOMMouseScroll', handler, false);
                }

                obj.removeEventListener(type, handler, false);