enable dynamic share texts for share-column on left side

lektura
max.mehl 2017-09-04 19:20:00 +02:00
parent b78eb1e624
commit 6bbc36a637
2 changed files with 7 additions and 3 deletions

View File

@ -6,7 +6,7 @@
<input name="popup" id="no-share-popup-side" type="radio" /> <input name="popup" id="no-share-popup-side" type="radio" />
<input name="ref" value="pmpc-side" type="hidden" /> <input name="ref" value="pmpc-side" type="hidden" />
<input name="url" value="{{ .Site.Params.url }}{{ .RelPermalink }}" type="hidden" /> <input name="url" value="{{ .Site.Params.url }}{{ .RelPermalink }}" type="hidden" />
<input name="title" value="{{ with .Params.Title }}{{ . }} - {{ end }}{{ .Site.Title }}" type="hidden" /> <input id="sharetitle-side" name="title" value="{{ with .Params.Title }}{{ . }} - {{ end }}{{ .Site.Title }}" type="hidden" />
<input class="n" name="website" placeholder="Please do not put anything here" /> <input class="n" name="website" placeholder="Please do not put anything here" />
{{ range $data.share }} {{ range $data.share }}
@ -16,14 +16,14 @@
<span class="popup {{ .id }}"> <span class="popup {{ .id }}">
<label for="no-share-popup-side"></label> <label for="no-share-popup-side"></label>
<input name="{{ .id }}pod" value="" placeholder="{{ .name }} URL ({{ .id }}.tld)" type="text" /> <input name="{{ .id }}pod" value="" placeholder="{{ .name }} URL ({{ .id }}.tld)" type="text" />
<button type="submit" name="service" value="{{ .id }}">OK</button> <button type="submit" name="service" value="{{ .id }}" onclick="return changeTitleSide('{{if isset . "customText"}}{{.customText}}{{else}}{{$.Site.Params.spread.defaultSocialText}}{{end}}')">OK</button>
</span> </span>
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ range $data.share }} {{ range $data.share }}
{{ if ne .userinput true }} {{ if ne .userinput true }}
<button type="submit" name="service" value="{{ .id }}" class="button share-{{ .id }}" title="{{ .titleBefore}} {{ .name }} {{ .titleAfter }}">&nbsp;</button> <button type="submit" name="service" value="{{ .id }}" class="button share-{{ .id }}" title="{{ .titleBefore}} {{ .name }} {{ .titleAfter }}" onclick="return changeTitleSide('{{if isset . "customText"}}{{.customText}}{{else}}{{$.Site.Params.spread.defaultSocialText}}{{end}}')">&nbsp;</button>
{{ end }} {{ end }}
{{ end }} {{ end }}
</form> </form>

View File

@ -44,3 +44,7 @@ function changeTitle(val){
document.getElementById('sharetitle-spread').value = val; document.getElementById('sharetitle-spread').value = val;
return true; return true;
} }
function changeTitleSide(val){
document.getElementById('sharetitle-side').value = val;
return true;
}