How to use the elements-sk/define.define function in elements-sk

To help you get started, we’ve selected a few elements-sk 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 google / skia-buildbot / golden / modules / gold-scaffold-sk / gold-scaffold-sk.ts View on Github external
// a CustomEvent here.
    const fetchErrorEvent = e as CustomEvent;
    const error = fetchErrorEvent.detail.error;
    const loadingWhat = fetchErrorEvent.detail.loading;
    if (fetchErrorEvent.detail.error.name !== 'AbortError') {
      // We can ignore AbortError since they fire anytime an AbortController was canceled.
      // Chrome and Firefox report a DOMException in this case:
      // https://developer.mozilla.org/en-US/docs/Web/API/DOMException
      console.error(error);
      errorMessage(`Unexpected error loading ${loadingWhat}: ${error.message}`, 5000);
    }
    this.finishedTask();
  }
}

define('gold-scaffold-sk', GoldScaffoldSk);
github google / skia-buildbot / golden / modules / dots-sk / dots-sk.ts View on Github external
//   - commit 4 has incorrect data
        // In this case, we need to make sure we can create a blamelist that starts on the first
        // real commit after commit 2. Therefore, we include commit 2 in the list, which GitHub
        // and googlesource will automatically elide when we ask for a range of history (in
        // blamelist-panel-sk). If there were no preceding missing digests, this will equal x-1.
        lastNonMissingIndex = i;
        break;
      }
    }
    const blamelist = this._commits.slice(lastNonMissingIndex, x + 1);
    blamelist.reverse();
    return blamelist;
  }
}

define('dots-sk', DotsSk);
github google / skia-buildbot / ct / modules / chromium-builds-sk / chromium-builds-sk.js View on Github external
<div class="triggering-spinner">
        
      </div>
      <button>Queue Task
      </button>
    
  
  
    
      <button id="view_history">View runs history</button>
    
  

`;

define('chromium-builds-sk', class extends ElementSk {
  constructor() {
    super(template);
    this._triggeringTask = false;
    this._moreThanThreeActiveTasks = moreThanThreeActiveTasksChecker();
  }

  connectedCallback() {
    super.connectedCallback();
    this._render();
    // Load LKGR data.
    this._chromiumRevChanged();
    this._skiaRevChanged();
  }


  _chromiumRevChanged() {
github google / skia-buildbot / ct / modules / suggest-input-sk / suggest-input-sk.ts View on Github external
this._suggestionSelected = -1;
    this._render();
  }

  _suggestionClick(e: Event): void {
    const item = e.target as HTMLElement;
    if (item.tagName !== 'LI') {
      return;
    }
    const index = Array.from(item.parentNode!.children).indexOf(item);
    this._suggestionSelected = index;
    this._commit();
  }
}

define('suggest-input-sk', SuggestInputSk);
github google / skia-buildbot / infra-sk / modules / uniform-time-sk / uniform-time-sk.ts View on Github external
this.pauseTime = 0;
    this._render();
  }

  private togglePlaying() {
    if (this.playing) {
      this.pauseTime = this.time;
    } else {
      this.time = this.pauseTime;
    }
    this.playing = !this.playing;
    this._render();
  }
}

define('uniform-time-sk', UniformTimeSk);
github google / skia-buildbot / golden / modules / corpus-selector-sk / corpus-selector-sk.ts View on Github external
this.selectedCorpus = corpus;
      this._sendCorpusSelected();
    }
  }

  private _sendCorpusSelected() {
    this.dispatchEvent(
      new CustomEvent('corpus-selected', {
        detail: this._selectedCorpus!,
        bubbles: true,
      }),
    );
  }
};

define('corpus-selector-sk', CorpusSelectorSk);
github google / skia-buildbot / infra-sk / modules / uniform-imageresolution-sk / uniform-imageresolution-sk.ts View on Github external
return false;
  }

  get uniform(): Uniform {
    return this._uniform;
  }

  set uniform(val: Uniform) {
    if (val.columns !== 3 || val.rows !== 1) {
      throw new Error('The imageresolution uniform must be a float3.');
    }
    this._uniform = val;
  }
}

define('uniform-imageresolution-sk', UniformImageresolutionSk);
github google / skia-buildbot / tree_status / modules / tree-scaffold-sk / tree-scaffold-sk.ts View on Github external
});
    });
    observer.observe(this, { childList: true });
  }

  /** @prop appTitle {string} Reflects the app_title attribute for ease of use. */
  get appTitle(): string { return this.getAttribute('app_title') || ''; }

  set appTitle(val: string) { this.setAttribute('app_title', val); }

  disconnectedCallback(): void {
    super.disconnectedCallback();
  }
}

define('tree-scaffold-sk', TreeScaffoldSk);
github google / skia-buildbot / ct / modules / input-sk / input-sk.ts View on Github external
/**
   * @prop {string} textPrefix - Optional prefix to put before the input box.
   * Mirrors the attribute.
   */
  get textPrefix(): string {
    return this.getAttribute('textPrefix') || '';
  }

  set textPrefix(val: string) {
    this.setAttribute('type', val);
    this._render();
  }
}

define('input-sk', InputSk);
github google / skia-buildbot / ct / modules / chromium-analysis-sk / chromium-analysis-sk.ts View on Github external
},
      body: JSON.stringify(params),
    })
      .then(() => this._gotoRunsHistory())
      .catch((e) => {
        this._triggeringTask = false;
        errorMessage(e);
      });
  }

  _gotoRunsHistory(): void {
    window.location.href = '/chromium_analysis_runs/';
  }
}

define('chromium-analysis-sk', ChromiumAnalysisSk);

elements-sk

A set of light-weight custom elements with a uniform style.

Apache-2.0
Latest version published 1 year ago

Package Health Score

48 / 100
Full package analysis

Similar packages