no more piss
This commit is contained in:
parent
34f2a30688
commit
5bb9ceaf94
5 changed files with 8 additions and 8 deletions
|
@ -43,7 +43,7 @@ const AppearanceTab = {
|
||||||
bundledPalettes: [],
|
bundledPalettes: [],
|
||||||
compilationCache: {},
|
compilationCache: {},
|
||||||
fileImporter: newImporter({
|
fileImporter: newImporter({
|
||||||
accept: '.json, .piss',
|
accept: '.json, .iss',
|
||||||
validator: this.importValidator,
|
validator: this.importValidator,
|
||||||
onImport: this.onImport,
|
onImport: this.onImport,
|
||||||
parser: this.importParser,
|
parser: this.importParser,
|
||||||
|
@ -305,14 +305,14 @@ const AppearanceTab = {
|
||||||
importParser (file, filename) {
|
importParser (file, filename) {
|
||||||
if (filename.endsWith('.json')) {
|
if (filename.endsWith('.json')) {
|
||||||
return JSON.parse(file)
|
return JSON.parse(file)
|
||||||
} else if (filename.endsWith('.piss')) {
|
} else if (filename.endsWith('.iss')) {
|
||||||
return deserialize(file)
|
return deserialize(file)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onImport (parsed, filename) {
|
onImport (parsed, filename) {
|
||||||
if (filename.endsWith('.json')) {
|
if (filename.endsWith('.json')) {
|
||||||
this.$store.dispatch('setThemeCustom', parsed.source || parsed.theme)
|
this.$store.dispatch('setThemeCustom', parsed.source || parsed.theme)
|
||||||
} else if (filename.endsWith('.piss')) {
|
} else if (filename.endsWith('.iss')) {
|
||||||
this.$store.dispatch('setStyleCustom', parsed)
|
this.$store.dispatch('setStyleCustom', parsed)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -324,7 +324,7 @@ const AppearanceTab = {
|
||||||
if (filename.endsWith('.json')) {
|
if (filename.endsWith('.json')) {
|
||||||
const version = parsed._pleroma_theme_version
|
const version = parsed._pleroma_theme_version
|
||||||
return version >= 1 || version <= 2
|
return version >= 1 || version <= 2
|
||||||
} else if (filename.endsWith('.piss')) {
|
} else if (filename.endsWith('.iss')) {
|
||||||
if (!Array.isArray(parsed)) return false
|
if (!Array.isArray(parsed)) return false
|
||||||
if (parsed.length < 1) return false
|
if (parsed.length < 1) return false
|
||||||
if (parsed.find(x => x.component === '@meta') == null) return false
|
if (parsed.find(x => x.component === '@meta') == null) return false
|
||||||
|
|
|
@ -604,7 +604,7 @@ export default {
|
||||||
const styleExporter = newExporter({
|
const styleExporter = newExporter({
|
||||||
filename: () => exports.name.value ?? 'pleroma_theme',
|
filename: () => exports.name.value ?? 'pleroma_theme',
|
||||||
mime: 'text/plain',
|
mime: 'text/plain',
|
||||||
extension: 'piss',
|
extension: 'iss',
|
||||||
getExportedObject: () => exportStyleData.value
|
getExportedObject: () => exportStyleData.value
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -636,7 +636,7 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
const styleImporter = newImporter({
|
const styleImporter = newImporter({
|
||||||
accept: '.piss',
|
accept: '.iss',
|
||||||
parser (string) { return deserialize(string) },
|
parser (string) { return deserialize(string) },
|
||||||
onImportFailure (result) {
|
onImportFailure (result) {
|
||||||
console.error('Failure importing style:', result)
|
console.error('Failure importing style:', result)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
"RedmondDX": "/static/styles/Redmond DX.piss",
|
"RedmondDX": "/static/styles/Redmond DX.iss",
|
||||||
"BreezyDX": "/static/styles/Breezy DX.piss"
|
"BreezyDX": "/static/styles/Breezy DX.iss"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue