Skip to content

Commit

Permalink
uses pinboard 2.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
ajrothwell committed Jan 16, 2025
1 parent cee7082 commit c362f32
Show file tree
Hide file tree
Showing 6 changed files with 138 additions and 5 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@fortawesome/free-solid-svg-icons": "^6.7.2",
"@fortawesome/pro-regular-svg-icons": "^6.7.2",
"@phila/phila-ui-core": "^1.0.15",
"@phila/pinboard": "2.1.5",
"@phila/pinboard": "2.1.6",
"unplugin-auto-import": "^0.18.3",
"unplugin-vue-router": "^0.10.8"
},
Expand Down
10 changes: 10 additions & 0 deletions src/assets/mac-style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

::-webkit-scrollbar {
-webkit-appearance: none;
width: 7px;
}
::-webkit-scrollbar-thumb {
border-radius: 4px;
background-color: rgba(0,0,0,.5);
box-shadow: 0 0 1px rgba(255,255,255,.5);
}
4 changes: 4 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
// (we might not need to use axios with new vue async tools)
// if that is not needed, we can move this info to main.js

import isMac from './util/is-mac';
if (isMac()) {
import('./assets/mac-style.scss')
}

// Font Awesome Icons
import { library } from '@fortawesome/fontawesome-svg-core';
Expand Down
3 changes: 3 additions & 0 deletions src/util/is-mac.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function () {
return /Macintosh/.test(navigator.userAgent);
}
116 changes: 116 additions & 0 deletions src/util/transforms.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
import { format, parseISO } from 'date-fns';

export default {
date: {
transform: function (value) {
let valueTransformed;
// console.log('date transform running, value:', value, 'typeof value:', typeof value);
if (typeof value === 'string') {
valueTransformed = format(parseISO(value), 'MM/dd/yyyy');
} else {
valueTransformed = format(value, 'MM/dd/yyyy');
}
return valueTransformed;
},
},
toLocaleDateString: {
transform: function(epoch){
// console.log('toLocaleDateString transform, epoch:', epoch, typeof epoch);
let value;
if (typeof epoch !== 'number') {
value = epoch;
} else {
let utcDate = new Date(0);
utcDate.setUTCMilliseconds(epoch);
utcDate = new Date(utcDate.getTime() + utcDate.getTimezoneOffset() * 60000);
value = utcDate.toLocaleDateString();
}
return value;
},
},
titleCase: {
transform: function(str) {
let titleCaseFix = {
Llc: "LLC",
Iii: "III",
Lp: "LP",
Usa: "USA",
Trs: "TRS",
"H/w": "H/W",
Of: "of",
Fdr: "FDR",
"S/w": "S/W",
Mcclellan: "McClellan",
"S/m": "S/M",
And: "and",
Cp: "CP",
Us: "US",
Ltd: "LTD",
Al: 'AL',
Ak: 'AK',
Az: 'AZ',
Ar: 'AR',
Ca: 'CA',
Co: 'CO',
Ct: 'CT',
De: 'DE',
Fl: 'FL',
Ga: 'GA',
Hi: 'HI',
Id: 'ID',
Il: 'IL',
In: 'IN',
Ia: 'IA',
Ks: 'KS',
Ky: 'KY',
La: 'LA',
Me: 'ME',
Md: 'MD',
Ma: 'MA',
Mi: 'MI',
Mn: 'MN',
Ms: 'MS',
Mo: 'MO',
Mt: 'MT',
Ne: 'NE',
Nv: 'NV',
Nh: 'NH',
Nj: 'NJ',
Nm: 'NM',
Ny: 'NY',
Nc: 'NC',
Nd: 'ND',
Oh: 'OH',
Ok: 'OK',
Or: 'OR',
Pa: 'PA',
Ri: 'RI',
Sc: 'SC',
Sd: 'SD',
Tn: 'TN',
Tx: 'TX',
Ut: 'UT',
Vt: 'VT',
Va: 'VA',
Wa: 'WA',
Wv: 'WV',
Wi: 'WI',
Wy: 'WY',
};

let fixit = function(str) {
for (let oldCase in titleCaseFix) {
let newCase = titleCaseFix[oldCase];
}
return str;
};

str = str.toLowerCase().split(' ').map(function(word) {
let wordFormatted = word.charAt(0).toUpperCase() + word.slice(1);
wordFormatted = titleCaseFix[wordFormatted] || wordFormatted;
return wordFormatted;
});
return str.join(' ');
},
},
};

0 comments on commit c362f32

Please sign in to comment.