|
22 | 22 | <div class="col-md-6 mb-3 form-inline">
|
23 | 23 | <label asp-for="BackgroundColor"></label>
|
24 | 24 |
|
25 |
| - <input type="color" asp-for="BackgroundColor" value="#CCCCCC" /> |
| 25 | + <input type="color" asp-for="BackgroundColor" value="@nameof(Model.FontColor)" /> |
26 | 26 | </div>
|
27 | 27 | </div>
|
28 | 28 |
|
|
54 | 54 | FontColor: "@nameof(Model.FontColor)"
|
55 | 55 | };
|
56 | 56 |
|
57 |
| - var log = function (message, params) { |
58 |
| - @if (HostingEnvironment.IsDevelopment()) |
59 |
| - { |
60 |
| -<text>console.log(message, params);</text> |
61 |
| -} |
62 |
| - }; |
63 |
| -
|
64 |
| - (function () { |
65 |
| -
|
66 |
| - //document.getElementById('fontsPanel').style.display = 'none'; |
| 57 | + var log = function (message, params) { |
| 58 | + @if (HostingEnvironment.IsDevelopment()) |
| 59 | + { |
| 60 | + <text>console.log(message, params);</text> |
| 61 | + } |
| 62 | + }; |
67 | 63 |
|
| 64 | + ( |
| 65 | + function () { |
68 | 66 | loadPreview();
|
69 | 67 |
|
70 | 68 | InitPreview();
|
|
83 | 81 | }
|
84 | 82 |
|
85 | 83 | document.getElementById(quickPreviewButton).onclick = loadPreview;
|
86 |
| -
|
87 | 84 | }
|
88 | 85 |
|
| 86 | + function loadPreview() { |
89 | 87 |
|
90 |
| -function loadPreview() { |
91 |
| -
|
92 |
| - const iframeWidth = document.getElementById("widgetPreview").clientWidth - 40; |
93 |
| -
|
94 |
| -
|
95 |
| - var urlTemplate = "/followers/count?"; |
96 |
| - urlTemplate += `${ConfigurationModel.BackgroundColor}=${escape(document.getElementById(ConfigurationModel.BackgroundColor).value)}`; |
97 |
| - urlTemplate += `&${ConfigurationModel.FontColor}=${escape(document.getElementById(ConfigurationModel.FontColor).value)}`; |
98 |
| - //urlTemplate += `&fontName=${escape(fontName)}`; |
99 |
| -
|
100 |
| - document.getElementById("widgetPreview").src = urlTemplate + `&${ConfigurationModel.CurrentValue}=${document.getElementById(ConfigurationModel.CurrentValue).value}` |
101 |
| - log(urlTemplate); |
102 |
| -
|
103 |
| - document.getElementById("outputUrl").textContent = urlTemplate; |
104 |
| - document.getElementById("outputUrl").href = urlTemplate; |
105 |
| - //saveValues(); |
106 |
| -
|
107 |
| -} |
| 88 | + const iframeWidth = document.getElementById("widgetPreview").clientWidth - 40; |
108 | 89 |
|
| 90 | + var urlTemplate = "/followers/count?"; |
| 91 | + urlTemplate += `${ConfigurationModel.BackgroundColor}=${escape(document.getElementById(ConfigurationModel.BackgroundColor).value)}`; |
| 92 | + urlTemplate += `&${ConfigurationModel.FontColor}=${escape(document.getElementById(ConfigurationModel.FontColor).value)}`; |
| 93 | + //urlTemplate += `&fontName=${escape(fontName)}`; |
109 | 94 |
|
| 95 | + document.getElementById("widgetPreview").src = urlTemplate + `&${ConfigurationModel.CurrentValue}=${document.getElementById(ConfigurationModel.CurrentValue).value}` |
| 96 | + log(urlTemplate); |
110 | 97 |
|
| 98 | + document.getElementById("outputUrl").textContent = urlTemplate; |
| 99 | + document.getElementById("outputUrl").href = urlTemplate; |
| 100 | + //saveValues(); |
111 | 101 |
|
| 102 | + } |
112 | 103 |
|
113 | 104 | </script>
|
114 |
| - |
115 | 105 | }
|
0 commit comments