I have a list of snippets for visual studio code that I have been using for a while now. They are customized to fit Bubbles needs and I thought to my self why wouldn’t I share them with everyone.
I guess what I am hoping for here is that anyone who has something to contribute does. This could be anything, like a special script, a technical or a method, code, editor tricks, plugin editor trick…
So I have created a GitHub where we can start to add some out small tricks together. So don’t be shy and get sharing
@emmanuel can we please have this post pinned for a couple of days. Just to get the ball rolling, it would be great for the bubble team to also see whats popular…
They are a set of snippet that do a variety of things. For example the code below reads the bubble progress bar and returns a value. The current user format is in visual studio code snippet file, but can be easily converted to JavaScript
So the snippet here
"Bubble - Get progress bar value": {
"prefix": "Bjs-progressBarValue",
"body": [
"//Get Bubble progress bar value",
"function getBubbleProgress() {",
" if (document.getElementById('nprogress')) {",
" let pWidth = Number($(window).width());",
" let pProgress = Number(",
" $('#nprogress')",
" .children('.bar')",
" .css('transform')",
" .split(',')[4]",
" );",
" let pResult = pProgress / pWidth;",
" //Results are returned as a decimal",
" pResult = pResult + 1;",
" pResult = pResult.toFixed(2);",
" return pResult;",
" }",
"}"
],
"description": "Bubble - Get progress bar value"
Becomes the code here
//Get Bubble progress bar value
function getBubbleProgress() {
if (document.getElementById('nprogress')) {
let pWidth = Number($(window).width());
let pProgress = Number(
$('#nprogress')
.children('.bar')
.css('transform')
.split(',')[4]
);
let pResult = pProgress / pWidth;
//Results are returned as a decimal
pResult = pResult + 1;
pResult = pResult.toFixed(2);
return pResult;
}
}