view.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. <?php
  2. /**
  3. * @var $this \yii\web\View
  4. * @var $model \app\models\front\News
  5. */
  6. use yii\helpers\ArrayHelper;
  7. use app\modules\ldjson\jsonLD;
  8. use yii\web\UrlManager;
  9. use app\models\Authors;
  10. use app\models\base\Image;
  11. use \app\models\news;
  12. use yii\helpers\Url;
  13. /*
  14. $this->registerJsFile('https://platform-api.sharethis.com/js/sharethis.js#property=63ecb32f4a4876001374e328&product=inline-reaction-buttons', [
  15. 'position' => $this::POS_END,
  16. 'async' => 'async',
  17. 'defer' => 'defer'
  18. ]);
  19. */
  20. $preview = $model->image;
  21. $retina = $preview->getUrl(Image::SIZE_1040x586,"jpg");
  22. $normal = $preview->getUrl(Image::SIZE_841x473,"webp");
  23. $bad = $preview->getUrl(Image::SIZE_680x383,'jpg');
  24. $bad = $bad?$bad:'/images/default.jpg';
  25. if( $retina === false || $normal === false ){
  26. $normal = $bad;
  27. $retina = $bad;
  28. }
  29. $normal .= "?v=".$model->rev;
  30. $retina .= "?v=".$model->rev;
  31. $bad .= "?v=".$model->rev;
  32. /*
  33. После этой даты не выводить фото до подтверждения юриста
  34. if( isset( $model->dt_pub ) && strtotime( $model->dt_pub ) < strtotime('2015-01-01 00:00:00') ){
  35. $bad = '/images/default.jpg';
  36. $normal = $bad;
  37. $retina = $bad;
  38. };
  39. */
  40. $txt_date = date( "[Y-m-d] ", strtotime( $model->dt_pub ) );
  41. Yii::$app->og->title =($model->meta_title)?$model->meta_title:$model->title;
  42. Yii::$app->og->description = ($model->lid && trim($model->lid) <> '')?str_replace( '"', "&quot;", strip_tags($model->lid) ):$txt_date.trim(str_replace( '"',"'",substr(strip_tags( $model->text ),0,150)))."...";
  43. if( $model->active == 'N' || $model->dt_pub > date("Y-m-d H:i:s") || $model->noindex == 'Y' ){
  44. Yii::$app->og->noindex = 'Y';
  45. }else{
  46. \Yii::$app->og->canonical = $model->getUrl(true);
  47. \Yii::$app->og->amp = Url::base('https').'/amp/news/'.$model->id;
  48. \Yii::$app->og->og_url = $model->getUrl(true);
  49. \Yii::$app->og->og_image = $model->image->url;
  50. \Yii::$app->og->og_type = "article";
  51. \Yii::$app->og->og_title = htmlspecialchars(($model->meta_title)?strip_tags(str_replace( '"',"&quot;",$model->meta_title)):strip_tags(str_replace( '"',"&quot;",$model->title)));
  52. \Yii::$app->og->og_description = ($model->lid && trim($model->lid) <> '')?str_replace( '"',"&quot;",strip_tags($model->lid)):$txt_date.trim(str_replace( '"',"&quot;",substr(strip_tags( $model->text ),0,150)))."...";
  53. \Yii::$app->og->dtpub = date( "r", strtotime( $model->dt_pub ) );
  54. }
  55. jsonLD::addAmicORG();
  56. jsonLD::news( $model->title, preg_replace('/\s+/', ' ', str_replace( ["\n","\r"],' ',Yii::$app->og->description)), $model->image->url, $model->dt_pub, $model->getUrl(), $model->uid, $model->text, $model->meta_title);
  57. jsonLD::addfaq($model->text, $model->title);
  58. $story = new \app\models\base\Story();
  59. $this->params['breadcrumbs'] = [
  60. [
  61. "text"=>"НОВОСТИ",
  62. "url"=>"/news"
  63. ]
  64. ];
  65. $this->params['context'] = "post-view";
  66. //$topic = ArrayHelper::getValue($model->topics,0);
  67. $topic = Yii::$app->cache->getOrSet('topic-news-'.$model->id, function () use($model){
  68. return $model->getTopics()->andWhere(['show'=>"Y","active"=>1])->orderBy('order asc')->one();
  69. }, News::$keysCache['topic-news-##']);
  70. if($topic instanceof \app\models\base\NewsTopic){
  71. $this->params['breadcrumbs'][] =
  72. [
  73. "text"=>$topic->title,
  74. "url"=>"/news/".mb_strtolower($topic->url)
  75. ];
  76. }
  77. $i = 1;
  78. foreach($this->params['breadcrumbs'] as $el){
  79. jsonLD::addBreadcrumb($i, $el['url'], $el['text']);
  80. $i++;
  81. }
  82. if( $model->show_author == 'Y' )
  83. {
  84. $author = Authors::getAuthor( $model->author );
  85. $authorName = $author->name;
  86. \Yii::$app->og->author =$authorName;
  87. jsonLD::author( $authorName );
  88. }else{
  89. $authorName = 'ИА Амител';
  90. jsonLD::author( $authorName, false );
  91. }
  92. if( strstr( $model->text, 'id="widgetseting"' ) && strstr( $model->text, 'windows="100"' ) ) $model->type = 2; //старый стиль широкой страницы
  93. $GLOBALS['type_long'] = ($model->type == 6); //лонгрид
  94. ?>
  95. <?php if(!is_null($model->embed_url) && $model->embed_url!=''):?>
  96. <div class="row">
  97. <div class="col-md-12 mb-5">
  98. <div class="picture-cont-16x9">
  99. <picture class="w-100 youtube-iframe-placeholder" data-link="<?=$model->getYoutubeEmbedLink()?>">
  100. <source srcset="<?=$preview->getUrl(Image::SIZE_1040x586,"jpg")?>" media="(min-width: 600px)">
  101. <source srcset="<?=$preview->getUrl(Image::SIZE_841x473,"webp")?>" media="(min-width: 600px)">
  102. <source srcset="<?=$preview->getUrl(Image::SIZE_680x383,"webp")?>" media="(min-width: 500px)">
  103. <img src="<?=$preview->getUrl(Image::SIZE_841x473)?>" alt="<?=$model->photo_title?>" srcset="<?=$preview->getUrl(Image::SIZE_841x473)?> 841w, <?=$preview->getUrl(Image::SIZE_1040x586)?> 2x, <?=$preview->getUrl(Image::SIZE_680x383,"webp")?> 680w" class="w-100" loading="lazy">
  104. </picture>
  105. </div>
  106. </div>
  107. </div>
  108. <?php endif;?>
  109. <div class="row">
  110. <div class="<?=($model->type == 2 || $model->type == 6)?'col-md-12':'col-md-8'?>">
  111. <div id="post" class="post">
  112. <?
  113. if( Yii::$app->user->can('editor') ){
  114. ?>
  115. <span style="position: absolute;background-color: #a9a9a924;right: 30px;top: 10px; box-shadow: 2px 5px 5px 3px #888;"><img onclick="location='/manager/news/update?id=<?=$model['id']?>'" src="/img/edit.svg" width="25px" height="25px" style="padding:3px;cursor:pointer;"><img onclick="navigator.clipboard.writeText('https://www.amic.ru/news/<?=$model['id']?>');elementPopup(this,'Ссылка скопирована в буфер обмена');" src="/img/share-boxed.svg" width="25px" height="25px" style="padding:3px;margin-top: 2px;cursor:pointer;" ></span>
  116. <?
  117. }
  118. ?>
  119. <?=$this->render("/layouts/breadcrumbs")?>
  120. <h1><?=$model->title?></h1>
  121. <p class="lead"><?=$model->lid?></p>
  122. <p class="published_at"><?=$model->getPublishedNorm()?>, <?=$authorName?> <?= ($model->mark!="" && !is_null($model->mark)) ? \yii\helpers\Html::tag('span', 'erid: '.$model->mark,['class'=>'float-right']) : ""?></p>
  123. <p class="share_and_comment">
  124. <a href="#comments" class="comments_btn">Комментировать</a>
  125. <a onclick="Share.vkontakte('<?=Yii::$app->og->og_url?>','<?=addslashes(Yii::$app->og->og_title)?>','<?=Yii::$app->og->og_image?>','<?=str_replace( '"',"&quot; ",Yii::$app->og->og_description)?>')" href="#">
  126. <svg class="icon icon-vk"><use xlink:href="/svg/symbol/sprite-clear.svg#vk"></use></svg>
  127. </a>
  128. <a onclick="Share.odnoklassniki('<?=Yii::$app->og->og_url?>','<?=addslashes(Yii::$app->og->og_title)?>','<?=Yii::$app->og->og_image?>','<?=str_replace( '"',"&quot; ",Yii::$app->og->og_description)?>')" href="#">
  129. <svg class="icon icon-ok"><use xlink:href="/svg/symbol/sprite-clear.svg#ok"></use></svg>
  130. </a>
  131. <a onclick="navigator.clipboard.writeText('<?=Yii::$app->og->og_url?>'); elementPopup(this,'Ссылка скопирована в буфер обмена')" class="copy-link" href="#">
  132. <svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 8 8">
  133. <use href="/img/share-boxed.svg#share"></use>
  134. </svg>
  135. </a>
  136. </p>
  137. <p>
  138. <?php if($model->photo_include == 'Y' && $model->image instanceof \app\models\base\Image):?>
  139. <div class="picture-cont-16x9">
  140. <picture class="w-100">
  141. <source srcset="<?=$normal?>, <?=$retina?> 2x" media="(min-width: 600px)">
  142. <img src="<?=$bad?>" alt="<?=htmlentities($model->photo_title,ENT_QUOTES)?>" srcset="<?=$normal?>, <?=$retina?> x2" title="<?=htmlentities($model->photo_title,ENT_QUOTES)?>" class="w-100">
  143. </picture>
  144. </div>
  145. <div class="image-title"><?=$model->photo_title?></div>
  146. <?php endif;?>
  147. </p>
  148. <section class="text">
  149. <?=$model->renderBody()?>
  150. <?=($model->inscription == 2)?'<span class="advertisement">Реклама</span>':''?>
  151. <?=($model->inscription == 1)?'<span class="advertisement">Реклама</span><br><span class="med_advertisement">Имеются противопоказания, необходима консультация специалиста</span>':''?>
  152. <?=($model->inscription == 3)?'<span class="advertisement">Партнёр amic.ru</span>':''?>
  153. </section>
  154. <?php
  155. echo $this->render("@app/views/news/view/tags",["model"=>$model]);
  156. ?>
  157. <?
  158. /*
  159. <section class="share-this">
  160. <!-- ShareThis BEGIN -->
  161. <div class="sharethis-inline-reaction-buttons"></div>
  162. <!-- ShareThis END -->
  163. <div style="clear: both;"></div>
  164. </section>
  165. */
  166. // Временно ок для конкурса
  167. ?>
  168. <section class="share-this">
  169. <center><div id="ok_shareWidget"></div></center>
  170. <div style="clear: both;"></div>
  171. </section>
  172. <script>
  173. !function (d, id, did, st, title, description, image) {
  174. function init(){
  175. OK.CONNECT.insertShareWidget(id,did,st, title, description, image);
  176. }
  177. if (!window.OK || !OK.CONNECT || !OK.CONNECT.insertShareWidget) {
  178. var js = d.createElement("script");
  179. js.src = "https://connect.ok.ru/connect.js";
  180. js.onload = js.onreadystatechange = function () {
  181. if (!this.readyState || this.readyState == "loaded" || this.readyState == "complete") {
  182. if (!this.executed) {
  183. this.executed = true;
  184. setTimeout(init, 0);
  185. }
  186. }};
  187. d.documentElement.appendChild(js);
  188. } else {
  189. init();
  190. }
  191. }(document,"ok_shareWidget",document.URL,'{"sz":30,"st":"oval","ck":1,"bgclr":"ED8207","txclr":"FFFFFF"}',"","","");
  192. </script>
  193. <?
  194. $stn = $story->getForNews($model->id);
  195. if( count($stn) > 0 ){
  196. echo $this->render("@app/views/news/view/story",["model"=>$stn, "id"=>$model->id]);
  197. foreach( $stn as $a ){
  198. jsonLD::story( trim( stripslashes( $a['title'] ) ) );
  199. }
  200. }
  201. ?>
  202. <?php if(Yii::$app->deviceDetect->isMobile()): ?>
  203. <section style="height: 300px;">
  204. <?=$this->render('@app/views/_etc/banners/bannerMobile3')?>
  205. </section>
  206. <?php else:?>
  207. <section style="height: 100px;">
  208. <?=$this->render('@app/views/_etc/banners/transparant5')?>
  209. </section>
  210. <?php endif;?>
  211. <section class="comments" id="comments">
  212. <?=$this->render("view/comments/list",["model"=>$model])?>
  213. </section>
  214. </div>
  215. </div>
  216. <script>
  217. (function (){
  218. let main_view_cont = document.getElementById('post');
  219. let height = main_view_cont.offsetHeight;
  220. console.log(height)
  221. let style = document.createElement("style");
  222. style.innerHTML = "#lenta-container{ max-height:"+height+"px;}";
  223. main_view_cont.parentNode.append(style);
  224. })()
  225. </script>
  226. <div class="<?=($model->type == 2 || $model->type == 6)?'hidden':'col-md-4'?>" id="lenta-container">
  227. <?=$this->render("/layouts/lenta/lenta_right")?>
  228. </div>
  229. <div class="col-md-12">
  230. <h3 class="mt-3" style="font-family: Helvetica,Arial,sans-serif;
  231. font-size: 20px;
  232. font-weight: 700;
  233. line-height: 24px;
  234. color: #373e44;
  235. padding-bottom: 12px;
  236. padding-top: 12px;">Новости партнеров</h3>
  237. <?//=$this->render('@app/views/_etc/banners/partnermetrics')?>
  238. <div id="ferst_partner_block"></div>
  239. <?/*
  240. <?=$this->render('@app/views/_etc/banners/partner3D')?>
  241. <?=$this->render('@app/views/_etc/banners/partner2D')?>
  242. <?=$this->render('@app/views/_etc/banners/partner1D')?>
  243. */?>
  244. <?php
  245. if(Yii::$app->deviceDetect->isMobile()){
  246. echo $this->render('@app/views/_etc/banners/moevideo');
  247. }
  248. ?>
  249. </div>
  250. <div class="col-md-12" id="infinity_newsfeed">
  251. <?=$this->render("view/infinity_newsfeed",['model'=>$model])?>
  252. </div>
  253. <div id="main-carousel" class="splide"></div>
  254. </div>
  255. <?php
  256. if( strpos( $model->text, 'class="InviewElement' ) !== false ){
  257. echo $this->render('view/inview');
  258. }
  259. ?>
  260. <?php
  261. $this->registerJsFile("/js/splide/dist/js/splide.min.js");
  262. $this->registerCssFile("/js/splide/dist/css/splide.min.css")
  263. ?>
  264. <script>
  265. var intersectionObserver = new IntersectionObserver(function(entries) {
  266. if (entries[0].intersectionRatio <= 0 || $(entries[0].target).html().length > 10 ) return;
  267. <?$code = $this->render('@app/views/_etc/banners/mytarget')?>
  268. <?$code .= $this->render('@app/views/_etc/banners/partner3D')?>
  269. <?$code .= $this->render('@app/views/_etc/banners/partner2D')?>
  270. <?$code .= $this->render('@app/views/_etc/banners/partner1D')?>
  271. <?$code .= $this->render('@app/views/_etc/banners/partner4D')?>
  272. var code = <?=json_encode($code)?>;
  273. $(entries[0].target).html(code);
  274. console.log('загрузить партнёрский блок');
  275. });
  276. (function (){
  277. intersectionObserver.observe(document.querySelector('#ferst_partner_block'));
  278. var gallery = document.getElementById("gallery-0");
  279. if(gallery!==null) {
  280. var wrapper = document.createElement("div");
  281. wrapper.classList.add('gallery-wrapper')
  282. gallery.parentNode.insertBefore(wrapper, gallery)
  283. wrapper.append(gallery)
  284. var gallery_items = gallery.getElementsByTagName("img");
  285. var track = document.createElement("div");
  286. var list = document.createElement('ul');
  287. gallery.classList.add("splide")
  288. list.classList.add("splide__list")
  289. track.classList.add("splide__track")
  290. gallery.prepend(track)
  291. track.prepend(list)
  292. for (var i = 0; i < gallery_items.length; i++) {
  293. var img = gallery_items[i];
  294. var img_cont = document.createElement('li')
  295. img_cont.classList.add("splide__slide")
  296. img_cont.append(img)
  297. list.append(img_cont)
  298. }
  299. var main_view = document.createElement("div")
  300. main_view.classList.add("splide", "gallery-view");
  301. main_view.innerHTML = gallery.innerHTML;
  302. gallery.style.paddingBottom = "18px";
  303. gallery.style.marginBottom = 0;
  304. wrapper.prepend(main_view)
  305. }
  306. document.addEventListener( 'DOMContentLoaded', function () {
  307. //return true;
  308. const galleries = document.querySelectorAll('.gallery-view');
  309. if(galleries.length>0){
  310. for (let i=0; i < galleries.length; i++){
  311. let element = galleries[i];
  312. if(element !== null){
  313. var main = new Splide(element, {
  314. type : 'fade',
  315. rewind : true,
  316. pagination: false,
  317. arrows : true,
  318. speed: 1000
  319. } );
  320. var thumbnails =new Splide( element.parentNode.querySelector('.gallery'), {
  321. fixedWidth: 100,
  322. fixedHeight: 60,
  323. gap : 10,
  324. rewind : true,
  325. pagination: false,
  326. isNavigation: true,
  327. arrows : false,
  328. } );
  329. main.sync( thumbnails );
  330. main.mount();
  331. thumbnails.mount();
  332. }
  333. }
  334. }
  335. if(document.querySelector('.gallery-view') !== null){
  336. // var main = new Splide( '.gallery-view', {
  337. // type : 'fade',
  338. // rewind : true,
  339. // pagination: false,
  340. // arrows : true,
  341. // speed: 1000
  342. // } );
  343. // var thumbnails =new Splide( '.gallery', {
  344. // fixedWidth: 100,
  345. // fixedHeight: 60,
  346. // gap : 10,
  347. // rewind : true,
  348. // pagination: false,
  349. // isNavigation: true,
  350. // arrows : false,
  351. // } );
  352. //
  353. // main.sync( thumbnails );
  354. // main.mount();
  355. // thumbnails.mount();
  356. }
  357. let fullscreenBtn = null;
  358. let gallery_wrappers = document.querySelectorAll('.gallery-wrapper');
  359. for (let i = 0; i < gallery_wrappers.length; i++) {
  360. fullscreenBtn = document.createElement('div');
  361. fullscreenBtn.classList.add('fullscreenButton');
  362. gallery_wrappers[i].append(fullscreenBtn)
  363. fullscreenBtn.onclick = function (){
  364. gallery_wrappers[i].classList.toggle('fullscreen')
  365. gallery_wrappers[i].querySelectorAll('.gallery-view img').forEach(function (elem) {
  366. elem.setAttribute('src', elem.dataset.original);
  367. })
  368. }
  369. }
  370. } );
  371. })()
  372. </script>
  373. <script>
  374. Share = {
  375. vkontakte: function(purl, ptitle, pimg, text) {
  376. url = 'https://vkontakte.ru/share.php?';
  377. url += 'url=' + encodeURIComponent(purl);
  378. url += '&title=' + encodeURIComponent(ptitle);
  379. url += '&description=' + encodeURIComponent(text);
  380. url += '&image=' + encodeURIComponent(pimg);
  381. url += '&noparse=true';
  382. Share.popup(url);
  383. },
  384. odnoklassniki: function(purl, text) {
  385. //url = 'https://www.odnoklassniki.ru/dk?st.cmd=addShare&st.s=1';
  386. url = 'https://connect.ok.ru/offer?';
  387. url += '&st.comments=' + encodeURIComponent(text);
  388. url += '&url=' + encodeURIComponent(purl);
  389. Share.popup(url);
  390. },
  391. facebook: function(purl, ptitle, pimg, text) {
  392. url = 'http://www.facebook.com/sharer.php?s=100';
  393. url += '&p[title]=' + encodeURIComponent(ptitle);
  394. url += '&p[summary]=' + encodeURIComponent(text);
  395. url += '&p[url]=' + encodeURIComponent(purl);
  396. url += '&p[images][0]=' + encodeURIComponent(pimg);
  397. Share.popup(url);
  398. },
  399. twitter: function(purl, ptitle) {
  400. url = 'https://twitter.com/share?';
  401. url += 'text=' + encodeURIComponent(ptitle);
  402. url += '&url=' + encodeURIComponent(purl);
  403. url += '&counturl=' + encodeURIComponent(purl);
  404. Share.popup(url);
  405. },
  406. mailru: function(purl, ptitle, pimg, text) {
  407. url = 'http://connect.mail.ru/share?';
  408. url += 'url=' + encodeURIComponent(purl);
  409. url += '&title=' + encodeURIComponent(ptitle);
  410. url += '&description=' + encodeURIComponent(text);
  411. url += '&imageurl=' + encodeURIComponent(pimg);
  412. Share.popup(url)
  413. },
  414. popup: function(url) {
  415. window.open(url,'','toolbar=0,status=0,width=626,height=436');
  416. }
  417. };
  418. const elementPopup = function (element, text)
  419. {
  420. console.log(element)
  421. const positionY = element.offsetTop;
  422. const positionX = element.offsetLeft;
  423. let popup = document.createElement("div")
  424. popup.style.position = 'absolute';
  425. popup.style.top = (positionY - 35) + 'px';
  426. popup.style.left = positionX + "px";
  427. popup.style.color = "white";
  428. popup.style.background = "#00000052";
  429. popup.style.borderRadius = "5px";
  430. popup.style.padding = "1px 20px";
  431. popup.style.opacity = "1";
  432. popup.style.transition = "0.3s";
  433. popup.innerHTML = text
  434. popup.classList.add('element-popup')
  435. element.parentNode.append(popup)
  436. setTimeout(function (){
  437. popup.style.opacity=0
  438. console.log(popup.style.transition)
  439. },3000)
  440. }
  441. </script>
  442. <?php if($model->mark!="" && !is_null($model->mark) && is_null(\Yii::$app->request->get('erid'))):?>
  443. <script>
  444. (function (){
  445. const url = new URL(location.href);
  446. url.searchParams.append('erid','<?=$model->mark?>')
  447. window.history.pushState({},'',url);
  448. })()
  449. </script>
  450. <?php endif;?>
  451. <script>
  452. (function (){
  453. const placeholders = document.getElementsByClassName('youtube-iframe-placeholder');
  454. if(placeholders.length>0){
  455. for(let i =0;i<placeholders.length;i++){
  456. placeholders[i].onclick = function (){
  457. const waiting = document.createElement("div");
  458. waiting.style.position = "absolute";
  459. waiting.style.width = "100%";
  460. waiting.style.height = "100%";
  461. waiting.style.background = "url('/img/loading.gif')";
  462. waiting.style.backgroundPosition = "center";
  463. waiting.style.backgroundRepeat = "no-repeat";
  464. waiting.style.backgroundSize = "contain";
  465. waiting.style.zIndex = 1;
  466. this.replaceWith(waiting);
  467. const iframe = document.createElement("iframe");
  468. iframe.src = this.dataset.link+"?autoplay=1";
  469. iframe.style.position = "absolute";
  470. iframe.style.zIndex = 2;
  471. iframe.width = "100%";
  472. iframe.height = "100%";
  473. iframe.title = "YouTube video player";
  474. iframe.frameBorder = "0";
  475. iframe.allow = "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture";
  476. iframe.allowFullscreen = true;
  477. waiting.parentNode.append(iframe);
  478. }
  479. }
  480. }
  481. })()
  482. </script>
  483. <?
  484. /*
  485. if( Yii::$app->deviceDetect->isMobile() ){
  486. $this->registerJs(
  487. <<<JS
  488. $(function () {
  489. loadScript( 'https://platform-api.sharethis.com/js/sharethis.js#property=63ecb32f4a4876001374e328&product=inline-reaction-buttons', 8000 );
  490. });
  491. JS
  492. ,
  493. $this::POS_READY,
  494. 'sharethis'
  495. );
  496. }else{
  497. $this->registerJs(
  498. <<<JS
  499. $(function () {
  500. loadScript( 'https://platform-api.sharethis.com/js/sharethis.js#property=63ecb32f4a4876001374e328&product=inline-reaction-buttons', 100 );
  501. });
  502. JS
  503. ,
  504. $this::POS_READY,
  505. 'sharethis'
  506. );
  507. }
  508. */