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