on xenial help sign in
Reorder params to make sure decodeURI doesn't have the problem with arg()
c8e3189Albert Astals Cid
plugins/Dash/CardCreator.js+6−6
@@ -16,9 +16,9 @@
16
16
17.pragma library
17.pragma library
18
18
19−// %1 is the template["card-background"] string
19+// %1 is the template["card-background"]["elements"][0]
20−// %2 is the template["card-background"]["elements"][0]
20+// %2 is the template["card-background"]["elements"][1]
21−// %3 is the template["card-background"]["elements"][1]
21+// %3 is the template["card-background"] string
22var kBackgroundLoaderCode = 'Loader {\n\
22var kBackgroundLoaderCode = 'Loader {\n\
23 id: backgroundLoader; \n\
23 id: backgroundLoader; \n\
24 objectName: "backgroundLoader"; \n\
24 objectName: "backgroundLoader"; \n\
@@ -46,14 +46,14 @@ var kBackgroundLoaderCode = 'Loader {\n\
46 objectName: "backgroundImage"; \n\
46 objectName: "backgroundImage"; \n\
47 source: { \n\
47 source: { \n\
48 if (cardData && typeof cardData["background"] === "string") return cardData["background"]; \n\
48 if (cardData && typeof cardData["background"] === "string") return cardData["background"]; \n\
49− else return %1; \n\
49+ else return %3; \n\
50 } \n\
50 } \n\
51 } \n\
51 } \n\
52 function getColor(index) { \n\
52 function getColor(index) { \n\
53 if (cardData && typeof cardData["background"] === "object" \n\
53 if (cardData && typeof cardData["background"] === "object" \n\
54 && (cardData["background"]["type"] === "color" || cardData["background"]["type"] === "gradient")) { \n\
54 && (cardData["background"]["type"] === "color" || cardData["background"]["type"] === "gradient")) { \n\
55 return cardData["background"]["elements"][index]; \n\
55 return cardData["background"]["elements"][index]; \n\
56− } else return index === 0 ? %2 : %3; \n\
56+ } else return index === 0 ? %1 : %2; \n\
57 } \n\
57 } \n\
58 } \n\
58 } \n\
59 }\n';
59 }\n';
@@ -455,7 +455,7 @@ function cardString(template, components) {
455 backgroundElements1 = '"%1"'.arg(element1);
455 backgroundElements1 = '"%1"'.arg(element1);
456 }
456 }
457 }
457 }
458− code += kBackgroundLoaderCode.arg(templateCardBackground).arg(backgroundElements0).arg(backgroundElements1);
458+ code += kBackgroundLoaderCode.arg(backgroundElements0).arg(backgroundElements1).arg(templateCardBackground);
459 }
459 }
460
460
461 if (hasArt) {
461 if (hasArt) {