Merge branch 'feature/theming2' into shigusegubu

* feature/theming2: (124 commits)
  whoops
  whoops
  redmond update
  better preview, collateral fixes
  theme separation
  more styles
  cosmetic fixes
  font control args to allow passing an option list of fonts, for future use
  more fonts
  initial font support
  clean up
  validity checks, no longer exploding when something is invalid
  DM timeline: stream new statuses
  collateral fixes
  fixed indentation
  some help strings
  reset buttons, better disabled for shadows
  added "keep opacity" option, fixed opacity loading, fixed missing shadows not affecting the preview (i.e. previewing pleroma-dark when redmond is applied)
  fix v1->v2 transition for localstorage
  radii v1 fixes
  ...
This commit is contained in:
Henry Jameson 2018-11-26 18:20:19 +03:00
commit a3b20fbd1a
96 changed files with 6465 additions and 1036 deletions

View file

@ -15,6 +15,7 @@ const STATUS_URL = '/api/statuses/show'
const MEDIA_UPLOAD_URL = '/api/statusnet/media/upload'
const CONVERSATION_URL = '/api/statusnet/conversation'
const MENTIONS_URL = '/api/statuses/mentions.json'
const DM_TIMELINE_URL = '/api/statuses/dm_timeline.json'
const FOLLOWERS_URL = '/api/statuses/followers.json'
const FRIENDS_URL = '/api/statuses/friends.json'
const FOLLOWING_URL = '/api/friendships/create.json'
@ -52,16 +53,6 @@ let fetch = (url, options) => {
return oldfetch(fullUrl, options)
}
// from https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding
let utoa = (str) => {
// first we use encodeURIComponent to get percent-encoded UTF-8,
// then we convert the percent encodings into raw bytes which
// can be fed into btoa.
return btoa(encodeURIComponent(str)
.replace(/%([0-9A-F]{2})/g,
(match, p1) => { return String.fromCharCode('0x' + p1) }))
}
// Params
// cropH
// cropW
@ -175,9 +166,9 @@ const register = (params) => {
})
}
const authHeaders = (user) => {
if (user && user.username && user.password) {
return { 'Authorization': `Basic ${utoa(`${user.username}:${user.password}`)}` }
const authHeaders = (accessToken) => {
if (accessToken) {
return { 'Authorization': `Bearer ${accessToken}` }
} else {
return { }
}
@ -302,6 +293,7 @@ const fetchTimeline = ({timeline, credentials, since = false, until = false, use
public: PUBLIC_TIMELINE_URL,
friends: FRIENDS_TIMELINE_URL,
mentions: MENTIONS_URL,
dms: DM_TIMELINE_URL,
notifications: QVITTER_USER_NOTIFICATIONS_URL,
'publicAndExternal': PUBLIC_AND_EXTERNAL_TIMELINE_URL,
user: QVITTER_USER_TIMELINE_URL,