How to use elements-sk - 10 common examples

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 / digest-details-sk / digest-details-sk.ts View on Github external
}).then((resp) => {
      if (resp.ok) {
        // Triaging was successful.
        this.status = newStatus;
        this.triageHistory.unshift({
          user: 'me',
          ts: Date.now().toString(),
        });
        this._render();
        sendEndTask(this);
      } else {
        // Triaging did not work (possibly because the user was not logged in). We want to set
        // the status of the triage-sk back to what it was to give a visual indication it did not
        // go through. Additionally, toast error message should catch the user's attention.
        console.error(resp);
        errorMessage(
            `Unexpected error triaging: ${resp.status} ${resp.statusText} ` +
            '(Are you logged in with the right account?)', 8000);
        this.querySelector('triage-sk')!.value = this.status;
        this._render();
        sendEndTask(this);
      }
    }).catch((e) => {
      sendFetchError(this, e, 'triaging')
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 / fiddlek / modules / fiddle-sk / fiddle-sk.ts View on Github external
});
      const results = (await jsonOrThrow(request)) as RunResults;

      // The .text field returned is empty, so repopulate it with the value we
      // stored in body.
      results.text = body.code;
      this.runResults = results;
      this._render();
      this.dispatchEvent(
        new CustomEvent('fiddle-success', {
          detail: this._runResults.fiddleHash,
          bubbles: true,
        }),
      );
    } catch (error) {
      errorMessage(error);
    } finally {
      this.spinner!.active = false;
    }
  }
github google / skia-buildbot / coverage / modules / coverage-page-sk / coverage-page-sk.js View on Github external
constructor() {
    super();
    upgradeProperty(this, 'job');
    upgradeProperty(this, 'commit');
    // Bits of state that get reflected to/from the URL query string.
    this._query = {
      job: '',
      commit: '',
    }
  }
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);

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