mirror of
https://github.com/google/pebble.git
synced 2025-05-24 04:04:53 +00:00
Import the pebble dev site into devsite/
This commit is contained in:
parent
3b92768480
commit
527858cf4c
1359 changed files with 265431 additions and 0 deletions
42
devsite/source/assets/js/docs/c.js
Normal file
42
devsite/source/assets/js/docs/c.js
Normal file
|
@ -0,0 +1,42 @@
|
|||
/**
|
||||
* Copyright 2025 Google LLC
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
$(function () {
|
||||
|
||||
$('.docs__item__tabs a[data-platform]').on('click', function () {
|
||||
var offset = $(this).position().top - $('body').scrollTop();
|
||||
var platform = $(this).data('platform');
|
||||
showPlatform(platform);
|
||||
savePlatform(platform);
|
||||
var newOffset = $(this).position().top - $('body').scrollTop();
|
||||
$('body').scrollTop($('body').scrollTop() + (newOffset - offset));
|
||||
});
|
||||
|
||||
function showPlatform(platform) {
|
||||
$('.docs__item__tabs a[data-platform]').removeClass('active');
|
||||
$('.docs__item__tabs a[data-platform="' + platform + '"]').addClass('active');
|
||||
$('section[data-platform]').hide();
|
||||
$('section[data-platform="' + platform + '"]').show();
|
||||
}
|
||||
|
||||
function savePlatform(platform) {
|
||||
Cookies.set('docs-platform', platform);
|
||||
}
|
||||
|
||||
var defaultPlatform = $('[data-basalt-only]').length ? 'basalt' : 'aplite';
|
||||
showPlatform(Cookies.get('docs-platform') || defaultPlatform);
|
||||
|
||||
});
|
25
devsite/source/assets/js/docs/pebblejs.js
Normal file
25
devsite/source/assets/js/docs/pebblejs.js
Normal file
|
@ -0,0 +1,25 @@
|
|||
/**
|
||||
* Copyright 2025 Google LLC
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
$(function () {
|
||||
var hash = window.location.hash;
|
||||
if (hash.length) {
|
||||
var $link = $('.section-menu a[href$="' + hash + '"]');
|
||||
if ($link && $link.length) {
|
||||
$('.section-menu').scrollTo($link);
|
||||
}
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue