]> git.mxchange.org Git - friendica.git/blob - view/templates/head.tpl
Merge branch 'friendica:develop' into feature-openwebauth
[friendica.git] / view / templates / head.tpl
1
2 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
3 <base href="{{$baseurl}}/" />
4 <meta name="generator" content="{{$generator}}" />
5 <link rel="stylesheet" href="view/global.css?v={{$smarty.const.FRIENDICA_VERSION}}" type="text/css" media="all" />
6 <link rel="stylesheet" href="view/asset/jquery-colorbox/example5/colorbox.css?v={{$smarty.const.FRIENDICA_VERSION}}" type="text/css" media="screen" />
7 <link rel="stylesheet" href="view/asset/jgrowl/jquery.jgrowl.min.css?v={{$smarty.const.FRIENDICA_VERSION}}" type="text/css" media="screen" />
8 <link rel="stylesheet" href="view/asset/jquery-datetimepicker/build/jquery.datetimepicker.min.css?v={{$smarty.const.FRIENDICA_VERSION}}" type="text/css" media="screen" />
9 <link rel="stylesheet" href="view/asset/perfect-scrollbar/dist/css/perfect-scrollbar.min.css?v={{$smarty.const.FRIENDICA_VERSION}}" type="text/css" media="screen" />
10 <link rel="stylesheet" href="view/js/fancybox/jquery.fancybox.min.css?v={{$smarty.const.FRIENDICA_VERSION}}" type="text/css" media="screen" />
11
12 {{foreach $stylesheets as $stylesheetUrl => $media}}
13         <link rel="stylesheet" href="{{$stylesheetUrl}}" type="text/css" media="{{$media}}" />
14 {{/foreach}}
15
16 <link rel="icon" href="{{$shortcut_icon}}" />
17 <link rel="apple-touch-icon" href="{{$touch_icon}}"/>
18
19 <meta name="apple-mobile-web-app-capable" content="yes" />
20 <link rel="manifest" href="{{$baseurl}}/manifest" />
21 <script>
22 // @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat
23 // Prevents links to switch to Safari in a home screen app - see https://gist.github.com/irae/1042167
24 (function(a,b,c){if(c in b&&b[c]){var d,e=a.location,f=/^(a|html)$/i;a.addEventListener("click",function(a){d=a.target;while(!f.test(d.nodeName))d=d.parentNode;"href"in d&&(chref=d.href).replace("{{$baseurl}}/", "").replace(e.href,"").indexOf("#")&&(!/^[a-z\+\.\-]+:/i.test(chref)||chref.indexOf(e.protocol+"//"+e.host)===0)&&(a.preventDefault(),e.href=d.href)},!1)}})(document,window.navigator,"standalone");
25 // |license-end
26 </script>
27
28 <link rel="search"
29          href="{{$baseurl}}/opensearch"
30          type="application/opensearchdescription+xml"
31          title="Search in Friendica" />
32
33 <!--[if IE]>
34 <script type="text/javascript" src="https://html5shiv.googlecode.com/svn/trunk/html5.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
35 <![endif]-->
36 <script type="text/javascript" src="view/js/modernizr.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
37 <script type="text/javascript" src="view/asset/jquery/dist/jquery.min.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
38 <script type="text/javascript" src="view/js/jquery.textinputs.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
39 <script type="text/javascript" src="view/asset/textcomplete/dist/textcomplete.min.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
40 <script type="text/javascript" src="view/js/autocomplete.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
41 <script type="text/javascript" src="view/asset/jquery-colorbox/jquery.colorbox-min.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
42 <script type="text/javascript" src="view/asset/jgrowl/jquery.jgrowl.min.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
43 <script type="text/javascript" src="view/asset/jquery-datetimepicker/build/jquery.datetimepicker.full.min.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
44 <script type="text/javascript" src="view/asset/perfect-scrollbar/dist/js/perfect-scrollbar.jquery.min.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
45 <script type="text/javascript" src="view/asset/imagesloaded/imagesloaded.pkgd.min.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
46 <script type="text/javascript" src="view/asset/base64/base64.min.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
47 <script type="text/javascript" src="view/asset/dompurify/dist/purify.min.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
48 <script type="text/javascript" src="view/js/fancybox/jquery.fancybox.min.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
49 <script type="text/javascript" src="view/js/fancybox/fancybox.config.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
50 <script type="text/javascript">
51         const updateInterval = {{$update_interval}};
52         const localUser = {{if $local_user}}{{$local_user}}{{else}}false{{/if}};
53 </script>
54 <script type="text/javascript" src="view/js/main.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
55
56 <script>
57
58         // Lifted from https://css-tricks.com/snippets/jquery/move-cursor-to-end-of-textarea-or-input/
59     jQuery.fn.putCursorAtEnd = function() {
60         return this.each(function() {
61             // Cache references
62             var $el = $(this),
63                 el = this;
64
65             // Only focus if input isn't already
66             if (!$el.is(":focus")) {
67                 $el.focus();
68             }
69
70             // If this function exists... (IE 9+)
71             if (el.setSelectionRange) {
72                 // Double the length because Opera is inconsistent about whether a carriage return is one character or two.
73                 var len = $el.val().length * 2;
74
75                 // Timeout seems to be required for Blink
76                 setTimeout(function() {
77                     el.setSelectionRange(len, len);
78                 }, 1);
79             } else {
80                 // As a fallback, replace the contents with itself
81                 // Doesn't work in Chrome, but Chrome supports setSelectionRange
82                 $el.val($el.val());
83             }
84
85             // Scroll to the bottom, in case we're in a tall textarea
86             // (Necessary for Firefox and Chrome)
87             this.scrollTop = 999999;
88         });
89     };
90
91         function confirmDelete() { return confirm("{{$delitem}}"); }
92         function commentExpand(id) {
93                 $("#comment-edit-text-" + id).putCursorAtEnd();
94                 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
95                 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
96                 $("#mod-cmnt-wrap-" + id).show();
97                 openMenu("comment-edit-submit-wrapper-" + id);
98                 return true;
99         }
100         function commentOpen(obj,id) {
101                 if (obj.value == "") {
102                         $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
103                         $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
104                         $("#mod-cmnt-wrap-" + id).show();
105                         openMenu("comment-edit-submit-wrapper-" + id);
106                         return true;
107                 }
108                 return false;
109         }
110         function commentClose(obj,id) {
111                 if (obj.value == "") {
112                         $("#comment-edit-text-" + id).removeClass("comment-edit-text-full");
113                         $("#comment-edit-text-" + id).addClass("comment-edit-text-empty");
114                         $("#mod-cmnt-wrap-" + id).hide();
115                         closeMenu("comment-edit-submit-wrapper-" + id);
116                         return true;
117                 }
118                 return false;
119         }
120
121
122         function commentInsert(obj,id) {
123                 var tmpStr = $("#comment-edit-text-" + id).val();
124                 if (tmpStr == "") {
125                         $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
126                         $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
127                         openMenu("comment-edit-submit-wrapper-" + id);
128                 }
129                 var ins = $(obj).html();
130                 ins = ins.replace("&lt;","<");
131                 ins = ins.replace("&gt;",">");
132                 ins = ins.replace("&amp;","&");
133                 ins = ins.replace("&quot;","\"");
134                 $("#comment-edit-text-" + id).val(tmpStr + ins);
135         }
136
137         function showHideCommentBox(id) {
138                 if ($("#comment-edit-form-" + id).is(":visible")) {
139                         $("#comment-edit-form-" + id).hide();
140                 } else {
141                         $("#comment-edit-form-" + id).show();
142                 }
143         }
144
145
146 </script>
147
148