File tree Expand file tree Collapse file tree 5 files changed +1869
-14
lines changed Expand file tree Collapse file tree 5 files changed +1869
-14
lines changed Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 1- <?php
1+ <?php
22
33require_once __DIR__ . '/lib/matomo.php ' ;
44
9696 'en ' => require_once __DIR__ . '/lib/languages/en.php ' ,
9797 'de ' => require_once __DIR__ . '/lib/languages/de.php ' ,
9898 'fr ' => require_once __DIR__ . '/lib/languages/fr.php ' ,
99- 'es ' => require_once __DIR__ . '/lib/languages/es.php ' ,
99+ 'es ' => require_once __DIR__ . '/lib/languages/es.php ' ,
100100 ),
101101 'api ' => array (
102102 'routes ' => require_once __DIR__ . '/lib/routes.php ' ,
Original file line number Diff line number Diff line change 77 "license" : " MIT" ,
88 "scripts" : {
99 "dev" : " parcel watch src/index.js --no-source-maps -d ./" ,
10- "build" : " parcel build src/index.js --no-source-maps --experimental-scope-hoisting -d ./" ,
10+ "parcel-build" : " parcel build src/index.js --no-source-maps --experimental-scope-hoisting --no-minify -d ./" ,
11+ "custom-minify" : " minify index.js -d ./" ,
12+ "build" : " npm run parcel-build && npm run custom-minify" ,
1113 "svg" : " vsvg -s ./src/assets/svg/export -t ./src/assets/svg/compiled"
1214 },
1315 "posthtml" : {
1416 "recognizeSelfClosing" : true
1517 },
1618 "devDependencies" : {
1719 "@vue/component-compiler-utils" : " ^3.0.0" ,
20+ "babel-minify" : " ^0.5.1" ,
1821 "babel-plugin-module-resolver" : " ^3.2.0" ,
1922 "babel-preset-env" : " ^1.7.0" ,
2023 "chart.js" : " ^2.7.2" ,
Original file line number Diff line number Diff line change 44 <div v-if =" loading" class =" loading" ><div class =" loader" ></div ></div >
55 <ul v-else-if =" !loading && !isEmpty" >
66 <li v-for =" (result, index) in results" >
7- <div class =" icon" ><svg ><use :href =" '#icon-matomo-' + findIcon(result)" /></svg ></div >
7+ <div class =" icon" ><svg ><use :href =" findIcon(result)" /></svg ></div >
88 <div class =" text" v-html =" result.label" ></div >
99 <div class =" number" >{{ result.nb_visits }} <span class =" percent" >{{ visitsPercent(result) }}%</span ></div >
1010 </li >
@@ -95,25 +95,23 @@ export default {
9595 return percent
9696 },
9797 findIcon (result ) {
98+ let icon = this .iconsMap [' page' ]
99+
98100 if (result .label ) {
99101 let fromLabel = this .iconsMap [result .label .toLowerCase ()]
100- if (fromLabel) return fromLabel
101- }
102-
103- if (this .widget == ' websites' || this .widget == ' popularPages' ) {
104- return this .iconsMap [' page' ]
102+ if (fromLabel) icon = fromLabel
105103 }
106104
107105 if (this .widget == ' keywords' ) {
108- return this .iconsMap [' search' ]
106+ icon = this .iconsMap [' search' ]
109107 }
110108
111109 if (result .segment ) {
112110 let fromSegment = this .iconsMap [result .segment ]
113- if (fromSegment) return fromSegment
111+ if (fromSegment) icon = fromSegment
114112 }
115113
116- return this . iconsMap [ ' page ' ]
114+ return ' #icon-matomo- ' + icon
117115 },
118116 },
119117}
You can’t perform that action at this time.
0 commit comments