mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/MI-38.git
synced 2026-01-24 02:45:39 +03:00
2304 lines
108 KiB
JavaScript
2304 lines
108 KiB
JavaScript
/* const { parse } = require("path"); */
|
||
|
||
var dmclangcodeicn = document.documentURI;
|
||
var lableclose;
|
||
var labelfragment;
|
||
var labeldontsupportpdf;
|
||
var labeldontsupporthtml;
|
||
var labledownloadpdf
|
||
var labledownloadhtml
|
||
var lalbleforprint;
|
||
var labelcloseprint
|
||
var lablefullscreen;
|
||
|
||
let debug = 0;
|
||
let logger = function (...args) { if (debug == 1) logger(...args || "") };
|
||
|
||
dmclangcodeicn = dmclangcodeicn.substr(-10, 2);
|
||
|
||
switch (dmclangcodeicn) {
|
||
case 'en':
|
||
lableclose = 'Close';
|
||
labelfragment = 'Fragment';
|
||
labeldontsupportpdf = 'This browser does not support PDF embedding, you can download the document here';
|
||
labeldontsupporthtml = 'This browser does not support HTML embedding, you can download the document here';
|
||
labledownloadpdf = 'Download PDF';
|
||
labledownloadhtml = 'Download HTML';
|
||
lalbleforprint = 'Print version';
|
||
labelcloseprint = 'Exit Print Mode';
|
||
lablefullscreen = 'Fullscreen';
|
||
break;
|
||
case 'ru':
|
||
lableclose = 'Закрыть';
|
||
labelfragment = 'Фрагмент';
|
||
labeldontsupportpdf = 'Этот браузер не поддерживает встраивание PDF, Вы можете скачать документ по ссылке';
|
||
labeldontsupporthtml = 'Этот браузер не поддерживает встраивание html, Вы можете скачать документ по ссылке';
|
||
labledownloadpdf = 'Скачать PDF';
|
||
labledownloadhtml = 'Скачать HTML';
|
||
lalbleforprint = 'Версия для печати';
|
||
labelcloseprint = 'Выход из режима печати';
|
||
lablefullscreen = 'Полный экран';
|
||
break;
|
||
case 'es':
|
||
lableclose = 'Cerrar';
|
||
labelfragment = 'Fragmento';
|
||
labeldontsupportpdf = 'Este navegador no soporta la incrustación de PDF, puede descargar el documento siguiendo este enlace';
|
||
labeldontsupporthtml = 'Este navegador no soporta la incrustación de html, puede descargar el documento siguiendo este enlace';
|
||
labledownloadpdf = 'Descargar PDF';
|
||
labledownloadhtml = 'Descargar HTML';
|
||
lalbleforprint = 'Versión para imprimir';
|
||
labelcloseprint = 'Salir del modo de impresión';
|
||
lablefullscreen = 'Pantalla completa';
|
||
break;
|
||
}
|
||
|
||
|
||
|
||
$.fn.scrollTo = function (speed) {
|
||
if (typeof (speed) === 'undefined')
|
||
speed = 1000;
|
||
|
||
$('html, body').animate({
|
||
scrollTop: parseInt($(this).offset().top)
|
||
}, speed);
|
||
};
|
||
|
||
function openExtISN(newstr, htmlString) {
|
||
|
||
var linkcsn = window.open(newstr);
|
||
|
||
var teste = function () {
|
||
var mon = linkcsn.document.getElementById(htmlString);
|
||
if (typeof (mon) != "undefined") {
|
||
//alert(htmlString);
|
||
mon.scrollIntoView();
|
||
mon.classList.add('selected');
|
||
clearInterval(id);
|
||
}
|
||
}
|
||
var id = setInterval(teste, 100);
|
||
|
||
}
|
||
|
||
function cartUpdate() {
|
||
|
||
if (sessionStorage.length > 0) {
|
||
//alert(sessionStorage.length);
|
||
$('.R_icon.cart+span').html(sessionStorage.length);
|
||
$('.R_icon.cart+span').show();
|
||
}
|
||
else {
|
||
$('.R_icon.cart+span').hide();
|
||
}
|
||
|
||
var CartHtml = '';
|
||
|
||
for (i = 0; i < sessionStorage.length; i++) {
|
||
var x = sessionStorage.key(i);
|
||
CartHtml += sessionStorage.getItem(x);
|
||
}
|
||
|
||
$('.cartContent tbody').html(CartHtml);
|
||
$('input[type="number"]').niceNumber();
|
||
}
|
||
|
||
$(document).ready(function () {
|
||
|
||
startActions();
|
||
|
||
$(".popupCont").draggable({ containment: $(this).parent(), scroll: false });
|
||
$('input[type="number"]').niceNumber();
|
||
|
||
var startSettingsObj = Cookies.getJSON('imagePlayerSettings');
|
||
var CookieSettings = Cookies.getJSON('imagePlayerSettings');
|
||
|
||
if (CookieSettings != undefined) {
|
||
$('.popupSett .rColor').val(CookieSettings.rColor);
|
||
$('.popupSett .rWidth').val(CookieSettings.rWidth);
|
||
$('.popupSett .tColor').val(CookieSettings.tColor);
|
||
$('.popupSett .tWidth').val(CookieSettings.tWidth);
|
||
$('.popupSett .hColor').val(CookieSettings.hColor);
|
||
$('.popupSett .hWidth').val(CookieSettings.hWidth);
|
||
}
|
||
|
||
$.each($('.color'), function (key, value) {
|
||
|
||
$(value).paletteColorPicker({
|
||
clear_btn: null,
|
||
close_all_but_this: true,
|
||
colors: [
|
||
{ "#FF0000": "#FF0000" },
|
||
{ "#333333": "#333333" },
|
||
{ "#E91E63": "#E91E63" },
|
||
{ "#C2185B": "#C2185B" },
|
||
{ "#F8BBD0": "#F8BBD0" },
|
||
{ "#CDDC39": "#CDDC39" },
|
||
{ "#212121": "#212121" },
|
||
{ "#727272": "#727272" },
|
||
{ "#B6B6B6": "#B6B6B6" }
|
||
],
|
||
position: 'downside', // default -> 'upside'
|
||
// Callback on change value
|
||
onchange_callback: function (clicked_color) {
|
||
$('.palette-color-picker-bubble').hide();
|
||
}
|
||
});
|
||
});
|
||
|
||
var scrollPage = window.pageYOffset || document.documentElement.scrollTop;
|
||
window.onscroll = function () {
|
||
var scrolled = window.pageYOffset || document.documentElement.scrollTop;
|
||
if (scrolled > scrollPage) {
|
||
$('#dmc').parent().removeClass('visible');
|
||
$('#dmc').removeClass('visible');
|
||
$('.iconsBox').removeClass('moved');
|
||
$('.main-list_inset_c').removeClass('moved');
|
||
$('.iconsBox_item.active').removeClass('active');
|
||
|
||
$('.main-menu-wrapp').css({ 'position': 'absolute', 'top': '-60px', 'transition': 'none', 'z-index': '999' });
|
||
|
||
hideLeftPanel();
|
||
}
|
||
else {
|
||
if (scrolled > 90) {
|
||
$('.main-menu-wrapp').css({ 'position': 'absolute', 'top': '-60px', 'transition': 'none', 'z-index': '999' });
|
||
//$('.main-menu-wrapp').slideDown();
|
||
$('.main-menu-wrapp').css({ 'transition': 'all ease-in 0.3s' });
|
||
$('.main-menu-wrapp').css({ 'position': 'fixed', 'top': '0' });
|
||
|
||
hideLeftPanel();
|
||
}
|
||
else {
|
||
$('.main-menu-wrapp').css({ 'position': 'absolute', 'top': '0px', 'transition': 'none' });
|
||
$('.iconsBox').removeClass('moved');
|
||
}
|
||
$('.iconsBox').removeClass('moved');
|
||
$('.iconsBox_item.active').removeClass('active');
|
||
}
|
||
scrollPage = window.pageYOffset || document.documentElement.scrollTop;
|
||
};
|
||
|
||
|
||
//$('.S1000DIpdTable').on('change','.addToCartLink',function(event){
|
||
//alert('cartVal');
|
||
//var cartVal = $(this).parent('.S1000DISNitem').id;
|
||
|
||
//sessionStorage.setItem("autosave", field.value);
|
||
// });
|
||
|
||
$('body').on('click', '.addToCartLink', function (event) {
|
||
|
||
var partVal = $(this).parent().siblings('.partNum').text();
|
||
var isnVal = $(this).parent().parent('.S1000DISNitem').attr('id');
|
||
var dmVal = $(this).parent().parent('.S1000DISNitem').attr('val');
|
||
var descrVal = $(this).parent().siblings('.partNum').next().text();
|
||
|
||
var full = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '');
|
||
|
||
var urnSplit = '.jsLinkURN[val^="' + dmVal + '"]';
|
||
var urn = $('#loap_tab').find(urnSplit).attr('val');
|
||
|
||
var elem = '#' + isnVal;
|
||
|
||
|
||
newstr = full + '/' + urn + elem;
|
||
|
||
|
||
var htmltd = '<tr id="' + isnVal + '"><td><p><a href="javascript:void(0);" onclick="javascript:openExtISN(' + "'" + newstr + "'" + "," + "'" + isnVal + "'" + ');">' + isnVal + '</a></p></td><td><p>' + partVal + '</p></td><td><p>' + descrVal + '</p></td>' + '<td><p><input type="number" min="1" max="100" value="1"> </input></p></td></tr>';
|
||
|
||
//alert(urn);
|
||
|
||
sessionStorage.setItem(isnVal, htmltd);
|
||
//alert(sessionStorage.getItem(isnVal));
|
||
cartUpdate();
|
||
});
|
||
$('body').on('click', '.cartClean', function (event) {
|
||
|
||
sessionStorage.clear();
|
||
cartUpdate();
|
||
$(".popupCart").hide("fast");
|
||
});
|
||
$('body').on('click', '.cartPDF', function (event) {
|
||
event.stopPropagation();
|
||
//var full = location.protocol+'//'+location.hostname+(location.port ? ':'+location.port: '');
|
||
//var toPDF = $('.cartContent').html();
|
||
|
||
//var withoutA = $('.cartContent').find('a').text();
|
||
|
||
var toPDF = $('.cartContent').html();
|
||
|
||
|
||
$('.cartContent').append('<div class="htmlexport" style="display:none;"></div>');
|
||
$('.htmlexport').html(toPDF);
|
||
|
||
$('.htmlexport').find('a').each(function () {
|
||
var withoutA = $(this).text();
|
||
$(this).replaceWith(withoutA);
|
||
});
|
||
|
||
$('.htmlexport').find('input').each(function () {
|
||
var withoutA = $(this).attr('value');
|
||
$(this).replaceWith(withoutA);
|
||
});
|
||
$('.htmlexport').find('button').each(function () {
|
||
$(this).remove();
|
||
});
|
||
|
||
var cleanedPDF = $('.htmlexport').html();
|
||
$('.htmlexport').remove();
|
||
$(".popupCart").hide("fast");
|
||
|
||
|
||
logger('cleanedPDF', cleanedPDF);
|
||
//alert($('.htmlexport').html());
|
||
toPDF = '<table>' + cleanedPDF + '</table>';
|
||
//toPDF=toPDF.replace(/div/g,'span');
|
||
//toPDF=toPDF.replace(/button/g,'span');
|
||
//toPDF.replace(/input/g,'span');
|
||
|
||
//var newHobj = createElementFromHTML(toPDF);
|
||
//alert(toPDF);
|
||
toPDF = '<html><head><meta charset="utf-8"><script>function openExtISN(newstr,htmlString) {var linkcsn = window.open(newstr);var teste = function(){var mon = linkcsn.document.getElementById(htmlString);if(typeof(mon)!="undefined"){mon.scrollIntoView();mon.classList.add("selected");clearInterval(id);}};var id = setInterval(teste, 100);}</script></head><body>' + toPDF + '</body>';
|
||
|
||
|
||
|
||
var text = toPDF,
|
||
blob = new Blob([text], { type: 'text/html;charset=utf-8' }),
|
||
anchor = document.createElement('a');
|
||
|
||
anchor.download = Date(Date.now());
|
||
anchor.href = (window.webkitURL || window.URL).createObjectURL(blob);
|
||
anchor.dataset.downloadurl = ['text/html', anchor.download, anchor.href].join(':');
|
||
anchor.click();
|
||
|
||
});
|
||
|
||
$('body').on('click', '.closePopup', function (event) {
|
||
$(".popupWindow").hide("fast");
|
||
});
|
||
$('body').on('click', '.R_icon.cart', function (event) {
|
||
event.stopPropagation();
|
||
$('.popupWindow.popupCart').css({ 'display': 'block' });
|
||
/*$('.closePopup').css({':'})*/
|
||
if ($('.popupCart .popupCont').outerHeight() < $('.popupCart.popupWindow').outerHeight()) {
|
||
var tmp = ($('.popupCart.popupWindow').outerHeight() - $('.popupCart .popupCont').outerHeight()) / 2;
|
||
$('.popupCart .popupCont').css({ 'top': tmp + 'px' });
|
||
}
|
||
if ($('.popupCart .popupCont').outerWidth() < $('.popupCart.popupWindow').outerWidth()) {
|
||
var tmp = ($('.popupCart.popupWindow').outerWidth() - $('.popupCart .popupCont').outerWidth()) / 2;
|
||
$('.popupCart .popupCont').css({ 'left': tmp + 'px' });
|
||
}
|
||
cartUpdate();
|
||
});
|
||
|
||
|
||
$('body').on('click', '#Contents ul.parent>li', function (event) {
|
||
event.stopPropagation();
|
||
logger('here');
|
||
$(this).toggleClass('selected');
|
||
$(this).children('ul').toggle('normal');
|
||
return false;
|
||
});
|
||
|
||
|
||
function createElementFromHTML(htmlString) {
|
||
var div = document.createElement('div');
|
||
div.innerHTML = htmlString.trim();
|
||
|
||
// Change this to div.childNodes to support multiple top-level nodes
|
||
return div.firstChild;
|
||
}
|
||
|
||
|
||
////////////////////////Выпадашка
|
||
(function ($) {
|
||
logger('here2');
|
||
$('.main-list_top').each(function () {
|
||
$(this).on('click', function (e) {
|
||
var data = $(this).children('.main-item').attr('data-href-id');
|
||
var dataId = (data.substr(1));
|
||
$(this).addClass('selected');
|
||
$(this).nextAll().removeClass('selected');
|
||
$(this).prevAll().removeClass('selected');
|
||
//$('.main-list_inset').attr("id") == dataId;
|
||
var elem = '#' + dataId;
|
||
$(elem).toggleClass('visible');
|
||
$(elem).nextAll().removeClass('visible');
|
||
$(elem).prevAll().removeClass('visible');
|
||
$(elem).siblings().removeClass('js-wait');
|
||
|
||
$('#dmc').parent().removeClass('visible');
|
||
$('#dmc').removeClass('visible');
|
||
$('.iconsBox').removeClass('moved');
|
||
$('.main-list_inset_c').removeClass('moved');
|
||
$('.iconsBox_item.active').removeClass('active');
|
||
|
||
/*$("body, html").animate({
|
||
scrollTop: 0
|
||
}, 0);*/
|
||
});
|
||
});
|
||
$('.main-list_inset_body_title').click(function () {
|
||
$(this).parent().parent().removeClass('visible').addClass('js-wait');
|
||
$('#dmc').parent().removeClass('visible');
|
||
$('#dmc').removeClass('visible');
|
||
$('.iconsBox').removeClass('moved');
|
||
$('.main-list_inset_c').removeClass('moved');
|
||
$('.iconsBox_item.active').removeClass('active');
|
||
|
||
if ($(this).parent().parent().attr('id') == 'dmc') {
|
||
$(this).parent().parent().parent().removeClass('visible');
|
||
}
|
||
});
|
||
/*$('.main-list_inset_body_title').click(function(){
|
||
$(this).parent().parent().removeClass('visible').addClass('js-wait');
|
||
$('#dmc').parent().removeClass('visible');
|
||
$('#dmc').removeClass('visible');
|
||
$('.iconsBox').removeClass('moved');
|
||
$('.main-list_inset_c').removeClass('moved');
|
||
$('.iconsBox_item.active').removeClass('active');
|
||
|
||
if($(this).parent().parent().attr('id') == 'dmc'){
|
||
$(this).parent().parent().parent().removeClass('visible');
|
||
}
|
||
});*/
|
||
}(jQuery));
|
||
|
||
$(".settSet").click(function () {
|
||
logger('here3');
|
||
var startSettingsObj = {
|
||
rColor: '#FF0000',
|
||
rWidth: 1,
|
||
tColor: '#333333',
|
||
tWidth: 1,
|
||
hColor: '#FF0000',
|
||
hWidth: 1,
|
||
};
|
||
startSettingsObj.rColor = $('.popupSett .rColor').val();
|
||
startSettingsObj.rWidth = $('.popupSett .rWidth').val();
|
||
startSettingsObj.tColor = $('.popupSett .tColor').val();
|
||
startSettingsObj.tWidth = $('.popupSett .tWidth').val();
|
||
startSettingsObj.hColor = $('.popupSett .hColor').val();
|
||
startSettingsObj.hWidth = $('.popupSett .hWidth').val();
|
||
|
||
logger('startSettingsObj', startSettingsObj);
|
||
|
||
Cookies.set('imagePlayerSettings', startSettingsObj);
|
||
location.reload();
|
||
});
|
||
$(".settDefaultSet").click(function () {
|
||
logger('here4');
|
||
var startSettingsObj = {
|
||
rColor: '#FF0000',
|
||
rWidth: 1,
|
||
tColor: '#333333',
|
||
tWidth: 1,
|
||
hColor: '#FF0000',
|
||
hWidth: 1,
|
||
};
|
||
|
||
Cookies.set('imagePlayerSettings', startSettingsObj);
|
||
location.reload();
|
||
});
|
||
$(".settDismiss").click(function () {
|
||
$('.popupWindow.popupSett').hide();
|
||
});
|
||
|
||
$(".toTop").click(function () {
|
||
|
||
$("html, body").animate({ scrollTop: 0 }, "slow");
|
||
//logger('scroll');
|
||
});
|
||
|
||
//CustomScrollbar
|
||
$('.main-list_inset_body_tabs').mCustomScrollbar({
|
||
theme: "custom-theme"
|
||
});
|
||
$('div[id^="tbl"]').mCustomScrollbar({
|
||
theme: "custom-theme"
|
||
});
|
||
|
||
|
||
$('body').on('click', '.S1000DIntRefPara, .S1000DIntRefSupEquip, .scrollTo', function (event) {//, .S1000DIntRefFig
|
||
event.preventDefault();
|
||
event.stopPropagation();
|
||
var hrefThis = $(this).attr('href');
|
||
if ($(hrefThis).length > 0) {
|
||
$(hrefThis).scrollTo();
|
||
}
|
||
});
|
||
|
||
$('body').on('click', '.S1000DISNitem', function (event) {//, .S1000DISNitem
|
||
event.preventDefault();
|
||
event.stopPropagation();
|
||
$(this).closest('.S1000DIpdTable').find('.S1000DISNitem,.S1000DCSNitem').removeClass('selected');
|
||
$(this).addClass('selected');
|
||
});
|
||
|
||
|
||
|
||
$('body').on('click', '.changesRequestClear', function (event) {
|
||
event.preventDefault();
|
||
event.stopPropagation();
|
||
|
||
$('.changesRequest-res input').val("");
|
||
$('.changesRequestForm textarea').val("");
|
||
});
|
||
|
||
$('body').on('click', '.closePopup, .multimediaObjectCloseFullscreen', function (event) {
|
||
$(".popupWindow").hide("fast");
|
||
});
|
||
$(function () {
|
||
$(document).click(function (event) {
|
||
if ($(event.target).closest(".popupWindow .popupCont").length) return;
|
||
$(".popupWindow").hide("fast");
|
||
event.stopPropagation();
|
||
});
|
||
});
|
||
|
||
//Select2
|
||
$(".js-select").select2({
|
||
minimumResultsForSearch: Infinity
|
||
});
|
||
|
||
//Columns descript img
|
||
$('.descript_img').each(function () {
|
||
var count = $(this).children('li').length;
|
||
|
||
if (count <= 30) { colCount = 2; } else { colCount = 4; }
|
||
|
||
var container = document.querySelector('.descript_img'),
|
||
anons = document.querySelectorAll('.descript_img li'),
|
||
columnCnt = colCount, //колличество колонок
|
||
chunk = Math.ceil(anons.length / columnCnt);
|
||
|
||
for (var i = 0, j = anons.length; i < j; i += chunk) {
|
||
var part = [].slice.call(anons, i, i + chunk),
|
||
div = document.createElement('div');
|
||
div.className = 'column';
|
||
for (var k = 0; k < part.length; k++) {
|
||
div.appendChild(part[k]);
|
||
}
|
||
container.appendChild(div);
|
||
}
|
||
|
||
var cont = $(anons).parent('.column').length;
|
||
if (cont == 2) {
|
||
$('.column').css('width', '47%');
|
||
} else {
|
||
$('.column').css('width', '25%');
|
||
}
|
||
});
|
||
$('body').on('click', 'a.S1000DIntRefMultimedia', function (event) {
|
||
event.preventDefault();
|
||
event.stopPropagation();
|
||
|
||
var link = $(this).attr('href');
|
||
var actuate = $(this).attr('actuate');
|
||
var show = $(this).attr('show');
|
||
|
||
var Uhash = window.location.hash;
|
||
var UhashSpl = [];
|
||
UhashSpl = Uhash.split('/');
|
||
var urn = UhashSpl[0];
|
||
logger('show', show);
|
||
|
||
switch (show) {
|
||
case 'replace':
|
||
|
||
$(link).scrollTo();
|
||
link = link.replace('#', '');
|
||
window.location.hash = urn + '/' + link;
|
||
|
||
break;
|
||
case 'new':
|
||
|
||
var loc = Object.assign({}, window.location);
|
||
link = link.replace('#', '');
|
||
|
||
loc.hash = urn + '/' + link;
|
||
loc.href = loc.protocol + '//' + loc.hostname + (loc.port ? ':' + loc.port : '') + loc.pathname + loc.search + loc.hash;
|
||
|
||
$('body').append('<a class="removeMe" href="' + loc.href + '" onclick="window.open(this.href,' + "'_blank'" + '); return false;">click</a>');
|
||
$(".removeMe").click();
|
||
$(".removeMe").remove();
|
||
|
||
break;
|
||
case 'embed':
|
||
if ($(link).closest('.S1000Dmultimedia').find('.jp-video .jp-full-screen').length > 0) {
|
||
logger("GET FULLSCREEN VIDEO");
|
||
logger($(link).parent().find('.jp-full-screen'));
|
||
$(link).parent().find('.jp-full-screen').click();
|
||
$(link).parent().find('.jp-play').click();
|
||
}
|
||
else {
|
||
logger("$('.popupWindow.popupContentPart').length", $('.popupWindow.popupContentPart').length);
|
||
if ($('.popupWindow.popupContentPart').length == 0) {
|
||
logger("createPopup");
|
||
$('body').append('<div class="popupWindow popupContentPart"><div class="popupCont"><div class="closePopup"></div><div class="popupContent"></div></div></div>');
|
||
}
|
||
$('.popupWindow.popupContentPart .popupContent').html('');
|
||
$(link).closest('.S1000Dmultimedia').appendTo($('.popupWindow.popupContentPart .popupContent'));
|
||
$('.popupWindow.popupContentPart').find('.popupContent, .S1000Dmultimedia, .S1000Dmultimediaobj, .pdfPreviewContainer').attr('max-height', '100%');
|
||
/* $('.popupWindow.popupContentPart').find('.jp-jplayer, .jp-video, .jp-audio').remove(); */
|
||
$('.popupWindow.popupContentPart').show();
|
||
getInnerAudioVideo($('.popupWindow.popupContentPart .S1000Dmultimedia'));
|
||
$('.popupContent').find('.jp-play').click();
|
||
}
|
||
break;
|
||
default:
|
||
break;
|
||
}
|
||
});
|
||
$('body').on('click', 'a.S1000DIntRefMultimediaObject', function (event) {
|
||
event.preventDefault();
|
||
event.stopPropagation();
|
||
var link = $(this).attr('href');
|
||
var actuate = $(this).attr('actuate');
|
||
var show = $(this).attr('show');
|
||
|
||
//$(link).scrollTo();
|
||
var Uhash = window.location.hash;
|
||
var UhashSpl = [];
|
||
UhashSpl = Uhash.split('/');
|
||
var urn = UhashSpl[0];
|
||
logger('show', show);
|
||
|
||
switch (show) {
|
||
case 'replace':
|
||
|
||
$(link).scrollTo();
|
||
link = link.replace('#', '');
|
||
window.location.hash = urn + '/' + link;
|
||
|
||
break;
|
||
case 'new':
|
||
|
||
var loc = Object.assign({}, window.location);
|
||
link = link.replace('#', '');
|
||
|
||
loc.hash = urn + '/' + link;
|
||
loc.href = loc.protocol + '//' + loc.hostname + (loc.port ? ':' + loc.port : '') + loc.pathname + loc.search + loc.hash;
|
||
|
||
$('body').append('<a class="removeMe" href="' + loc.href + '" onclick="window.open(this.href,' + "'_blank'" + '); return false;">click</a>');
|
||
$(".removeMe").click();
|
||
$(".removeMe").remove();
|
||
|
||
break;
|
||
case 'embed':
|
||
if ($(link).closest('.S1000Dmultimedia').find('.jp-video .jp-full-screen').length > 0) {
|
||
logger("GET FULLSCREEN VIDEO");
|
||
logger($(link).parent().find('.jp-full-screen'));
|
||
$(link).parent().find('.jp-full-screen').click();
|
||
//$(link).parent().find('.jp-play').click();
|
||
var playlist = $(link).parent().find('.jp-playlist .jp-playlist-item');
|
||
obj = link.split('-obj');
|
||
obj = parseInt(obj[1]);
|
||
logger(obj)
|
||
$(playlist[obj - 1]).click();
|
||
}
|
||
else {
|
||
logger("$('.popupWindow.popupContentPart').length", $('.popupWindow.popupContentPart').length);
|
||
if ($('.popupWindow.popupContentPart').length == 0) {
|
||
logger("createPopup");
|
||
$('body').append('<div class="popupWindow popupContentPart"><div class="popupCont"><div class="closePopup"></div><div class="popupContent"></div></div></div>');
|
||
}
|
||
$('.popupWindow.popupContentPart .popupContent').html('');
|
||
$(link).closest('.S1000Dmultimedia').clone().appendTo($('.popupWindow.popupContentPart .popupContent'));
|
||
$('.popupWindow.popupContentPart').find('.popupContent, .S1000Dmultimedia, .S1000Dmultimediaobj, .pdfPreviewContainer').css({ 'max-height': '100%' });
|
||
$('.popupWindow.popupContentPart').show();
|
||
if ($('.popupWindow.popupContentPart').find('.jp-jplayer, .jp-video, .jp-audio').length > 0) {
|
||
$('.popupWindow.popupContentPart').find('.jp-jplayer, .jp-video, .jp-audio').remove();
|
||
obj = link.split('-obj');
|
||
obj = parseInt(obj[1]);
|
||
getInnerAudioVideo($('.popupWindow.popupContentPart .S1000Dmultimedia'), obj - 1);
|
||
}
|
||
|
||
}
|
||
break;
|
||
default:
|
||
break;
|
||
}
|
||
});
|
||
$('body').on('click', 'a.S1000DIntRefFig', function (event) {
|
||
logger('here6');
|
||
event.preventDefault();
|
||
event.stopPropagation();
|
||
|
||
var link = $(this).attr('href');
|
||
var actuate = $(this).attr('actuate');
|
||
var show = $(this).attr('show');
|
||
|
||
//$(link).scrollTo();
|
||
var Uhash = window.location.hash;
|
||
var UhashSpl = [];
|
||
UhashSpl = Uhash.split('/');
|
||
var urn = UhashSpl[0];
|
||
|
||
switch (show) {
|
||
case 'replace':
|
||
|
||
$(link).scrollTo();
|
||
link = link.replace('#', '');
|
||
window.location.hash = urn + '/' + link;
|
||
|
||
break;
|
||
case 'new':
|
||
|
||
var loc = Object.assign({}, window.location);
|
||
logger('loc', loc);
|
||
link = link.replace('#', '');
|
||
|
||
loc.hash = urn + '/' + link;
|
||
loc.href = loc.protocol + '//' + loc.hostname + (loc.port ? ':' + loc.port : '') + loc.pathname + loc.search + loc.hash;
|
||
logger('loc.location', loc);
|
||
|
||
$('body').append('<a class="removeMe" href="' + loc.href + '" onclick="window.open(this.href,' + "'_blank'" + '); return false;">click</a>');
|
||
logger('$(".removeMe")', $(".removeMe"));
|
||
$(".removeMe").click();
|
||
$(".removeMe").remove();
|
||
break;
|
||
case 'embed':
|
||
$('body').append('<div class="popupWindowFull"><div class="popupImagePlayer"></div></div>');
|
||
$(link).closest('.S1000Dfigure').clone().removeAttr('id').appendTo('.popupWindowFull .popupImagePlayer');
|
||
|
||
|
||
//$('.popupWindowFull .popupImagePlayer .S1000Dfiguregraphic').removeAttr('id');
|
||
for (let i = 0; i < $('.popupWindowFull .popupImagePlayer .S1000Dfiguregraphic').length; i++) {
|
||
if ($($('.popupWindowFull .popupImagePlayer .S1000Dfiguregraphic')[i]).css('display') != 'none') {
|
||
$($('.popupWindowFull .popupImagePlayer .S1000Dfiguregraphic')[i]).imagePlayer('destroy');
|
||
var setts = $($('.popupWindowFull .popupImagePlayer .S1000Dfiguregraphic')[i]).find('.localSettingsC').val();
|
||
logger(setts);
|
||
setts = JSON.parse(setts);
|
||
$($('.popupWindowFull .popupImagePlayer .S1000Dfiguregraphic')[i]).imagePlayer({
|
||
viewType: 'fullScreen',
|
||
url: setts.url,
|
||
legend: setts.legend,
|
||
legendSpots: setts.legendSpots,
|
||
type: setts.type,
|
||
viewBox: setts.viewBox,
|
||
|
||
spots: setts.spots,
|
||
name: setts.name,
|
||
size: setts.size,
|
||
redline: false,
|
||
canResize: false,
|
||
tearWindow: false,
|
||
target: { x: 0, y: 0, show: false },
|
||
shawAllRefs: false,
|
||
});
|
||
}
|
||
}
|
||
break;
|
||
default:
|
||
break;
|
||
}
|
||
});
|
||
$('body').on('click', 'a.S1000DIntRefGraphic', function (event) {
|
||
event.preventDefault();
|
||
event.stopPropagation();
|
||
|
||
var link = $(this).attr('href');
|
||
var actuate = $(this).attr('actuate');
|
||
var show = $(this).attr('show');
|
||
|
||
//$(link).scrollTo();
|
||
var Uhash = window.location.hash;
|
||
var UhashSpl = [];
|
||
UhashSpl = Uhash.split('/');
|
||
var urn = UhashSpl[0];
|
||
|
||
switch (show) {
|
||
case 'replace':
|
||
|
||
$(link).scrollTo();
|
||
link = link.replace('#', '');
|
||
window.location.hash = urn + '/' + link;
|
||
|
||
break;
|
||
case 'new':
|
||
|
||
var loc = Object.assign({}, window.location);
|
||
link = link.replace('#', '');
|
||
|
||
loc.hash = urn + '/' + link;
|
||
loc.href = loc.protocol + '//' + loc.hostname + (loc.port ? ':' + loc.port : '') + loc.pathname + loc.search + loc.hash;
|
||
logger('loc.location', loc);
|
||
|
||
$('body').append('<a class="removeMe" href="' + loc.href + '" onclick="window.open(this.href,' + "'_blank'" + '); return false;">click</a>');
|
||
$(".removeMe").click();
|
||
$(".removeMe").remove();
|
||
break;
|
||
case 'embed':
|
||
$('body').append('<div class="popupWindowFull"><div class="popupImagePlayer"></div></div>');
|
||
$(link).closest('.S1000Dfigure').clone().removeAttr('id').appendTo('.popupWindowFull .popupImagePlayer');
|
||
$('.popupWindowFull .popupImagePlayer').find('.S1000Dfiguregraphic').hide();
|
||
$('.popupWindowFull .popupImagePlayer').find(link).show();
|
||
|
||
for (let i = 0; i < $('.popupWindowFull .popupImagePlayer .S1000Dfiguregraphic').length; i++) {
|
||
if ($($('.popupWindowFull .popupImagePlayer .S1000Dfiguregraphic')[i]).css('display') != 'none') {
|
||
$($('.popupWindowFull .popupImagePlayer .S1000Dfiguregraphic')[i]).imagePlayer('destroy');
|
||
var setts = $($('.popupWindowFull .popupImagePlayer .S1000Dfiguregraphic')[i]).find('.localSettingsC').val();
|
||
setts = JSON.parse(setts);
|
||
$($('.popupWindowFull .popupImagePlayer .S1000Dfiguregraphic')[i]).imagePlayer({
|
||
viewType: 'fullScreen',
|
||
url: setts.url,
|
||
legend: setts.legend,
|
||
legendSpots: setts.legendSpots,
|
||
type: setts.type,
|
||
});
|
||
}
|
||
}
|
||
break;
|
||
default:
|
||
break;
|
||
}
|
||
});
|
||
$('body').on('click', 'a.S1000DIntRefHotspot', function (event) {
|
||
event.preventDefault();
|
||
event.stopPropagation();
|
||
|
||
var eventElement = event.target;
|
||
var searchName = $(eventElement).attr('name');
|
||
|
||
logger('document');
|
||
|
||
var link = $(this).attr('href');
|
||
var actuate = $(this).attr('actuate');
|
||
var show = $(this).attr('show');
|
||
|
||
var parent = $(link);
|
||
logger('$(this)', $(this));
|
||
logger('$(this)', $(this).attr('id'));
|
||
logger('parent', parent);
|
||
|
||
var Uhash = window.location.hash;
|
||
var UhashSpl = [];
|
||
UhashSpl = Uhash.split('/');
|
||
var urn = UhashSpl[0];
|
||
|
||
/*if (eventElement != null) {
|
||
show = false
|
||
}*/
|
||
|
||
switch (show) {
|
||
case 'replace':
|
||
|
||
$(parent).closest('.S1000Dfigure').scrollTo();
|
||
|
||
if ($(parent).closest('.S1000Dfigure').attr('id') != undefined && $(parent).closest('.S1000Dfigure').attr('id') != '') {
|
||
var hash = $(parent).closest('.S1000Dfigure').attr('id');
|
||
hash = hash.replace('#', '');
|
||
window.location.hash = urn + '/' + hash;
|
||
}
|
||
|
||
$(parent).closest('.S1000Dfigure').find('a[href="' + link + '"]').click();
|
||
//logger($(parent).closest('.S1000Dfigure').find('a[href="'+link+'"]'));
|
||
|
||
if ($(parent).closest('.S1000Dfigure').find('a[href="' + link + '"]').length == 0) {
|
||
//logger($(parent).closest('.S1000Dfigure').find(link));
|
||
$(parent).closest('.S1000Dfigure').find(link).click();
|
||
}
|
||
|
||
break;
|
||
case 'new':
|
||
var loc = Object.assign({}, window.location);
|
||
logger('loc', loc);
|
||
//link = link.replace('#','');
|
||
if ($(parent).closest('.S1000Dfigure').attr('id') != undefined && $(parent).closest('.S1000Dfigure').attr('id') != '') {
|
||
var hash = link;
|
||
hash = hash.replace('#', '');
|
||
window.location.hash = urn + '/' + hash;
|
||
|
||
loc.hash = urn + '/' + hash;
|
||
loc.href = loc.protocol + '//' + loc.hostname + (loc.port ? ':' + loc.port : '') + loc.pathname + loc.search + loc.hash;
|
||
|
||
$('body').append('<a class="removeMe" href="' + loc.href + '" onclick="window.open(this.href,' + "'_blank'" + '); return false;">click</a>');
|
||
// logger('$(".removeMe")', $(".removeMe"));
|
||
$(".removeMe").click();
|
||
$(".removeMe").remove();
|
||
}
|
||
break;
|
||
case 'embed':
|
||
if ($(parent).closest('.S1000Dfigure').attr('id') != undefined && $(parent).closest('.S1000Dfigure').attr('id') != '') {
|
||
var hash = $(parent).closest('.S1000Dfigure').attr('id');
|
||
hash = hash.replace('#', '');
|
||
window.location.hash = urn + '/' + hash;
|
||
}
|
||
$('body').append('<div class="popupWindowFull"><div class="popupImagePlayer"></div></div>');
|
||
$(parent).closest('.S1000Dfigure').clone().removeAttr('id').appendTo('.popupWindowFull .popupImagePlayer');
|
||
|
||
for (var i = 0; i < $('.popupWindowFull .popupImagePlayer .S1000Dfiguregraphic').length; i++) {
|
||
if ($($('.popupWindowFull .popupImagePlayer .S1000Dfiguregraphic')[i]).css('display') != 'none') {
|
||
$($('.popupWindowFull .popupImagePlayer .S1000Dfiguregraphic')[i]).imagePlayer('destroy');
|
||
var setts = $($('.popupWindowFull .popupImagePlayer .S1000Dfiguregraphic')[i]).find('.localSettingsC').val();
|
||
setts = JSON.parse(setts);
|
||
|
||
$($('.popupWindowFull .popupImagePlayer .S1000Dfiguregraphic')[i]).imagePlayer({
|
||
viewType: 'fullScreen',
|
||
url: setts.url,
|
||
legend: setts.legend,
|
||
legendSpots: setts.legendSpots,
|
||
type: setts.type,
|
||
viewBox: setts.viewBox,
|
||
|
||
spots: setts.spots,
|
||
name: setts.name,
|
||
size: setts.size,
|
||
redline: false,
|
||
canResize: false,
|
||
tearWindow: false,
|
||
target: { x: 0, y: 0, show: false },
|
||
shawAllRefs: false,
|
||
|
||
ready: function () {
|
||
|
||
if ($('.popupWindowFull .popupImagePlayer').find('a[href="' + link + '"]').length == 0) {
|
||
$('.popupWindowFull .popupImagePlayer').find(link).click();
|
||
} else {
|
||
$('.popupWindowFull .popupImagePlayer').find('a[href="' + link + '"]').click();
|
||
}
|
||
|
||
if ($('.popupWindowFull .popupImagePlayer').closest('.S1000Dfigure').find('a[href="' + link + '"]').length == 0) {
|
||
$('.popupWindowFull .popupImagePlayer').closest('.S1000Dfigure').find(link).click();
|
||
}
|
||
}
|
||
});
|
||
}
|
||
}
|
||
break;
|
||
default:
|
||
break;
|
||
}
|
||
});
|
||
|
||
$('body').on('click', 'a.jsLink', function (event) {
|
||
event.preventDefault();
|
||
event.stopPropagation();
|
||
var link = $(this).attr('href');
|
||
var objText = $(this).html();
|
||
hideLeftPanel();
|
||
getXML(link, '/Modules/S1000D/templates/default/Common.xslt', $(".container_text"), true, false, true, true, objText);
|
||
|
||
//plus icon to minus
|
||
|
||
});
|
||
$('body').on('click', 'a.jsLinkURN', function (event) {
|
||
//logger('jsLinkURN');
|
||
//event.preventDefault();
|
||
var url = $(this).attr("val");
|
||
var urnPart = url.split('#');
|
||
var urnSplit = '.jsLinkURN[val^="' + urnPart[0] + '"]';
|
||
var urn = $('#loap_tab').find(urnSplit).attr('val');
|
||
const currentIframeHref = new URL(document.location.href);
|
||
const urlFilePath = decodeURIComponent(currentIframeHref.pathname);
|
||
var lm_data = urlFilePath.split('/', 5);
|
||
var lm_data_join = lm_data.join("/");
|
||
var full = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '');
|
||
//url= url.replace(/URN:S1000D:/g,'');
|
||
|
||
if (urnPart[1]) {
|
||
if (urnPart[1].substr(0, 3) == 'CSN') {
|
||
url = full + '/' + urn + '#' + urnPart[1];
|
||
openExtISN(url, urnPart[1]);
|
||
}
|
||
}
|
||
else {
|
||
url = full + lm_data_join + '/' + url;
|
||
document.location.href = url;
|
||
};
|
||
|
||
/* event.stopPropagation();
|
||
var folder = '';
|
||
var full = location.protocol+'//'+location.hostname+(location.port ? ':'+location.port: '');
|
||
var stLink = $( ".container_text" ).attr('link');
|
||
var obj = $(this);
|
||
var urn = $(this).attr("val");
|
||
var urnSplit = urn.split('/');
|
||
/!*logger('getURN');
|
||
logger(urn);
|
||
logger(urnSplit[1]);*!/
|
||
var objText = $(this).html();
|
||
|
||
$.ajax({
|
||
type: "POST",
|
||
url: full+"/Resolver/resolver.php",
|
||
data: {url: stLink, function:'urlFolder'},
|
||
success: function(data) {
|
||
//$('#Contents').addClass('visible');
|
||
folder = data;
|
||
regex = /^[.]?[\/]?(.*)/g;
|
||
mat = regex.exec(folder);
|
||
|
||
$.ajax({
|
||
type: "POST",
|
||
url: full+"/Resolver/resolver.php",
|
||
data: {urn: urnSplit[0], folder: './../'+mat[1], function:'urnUrl'},
|
||
success: function(dat) {
|
||
logger('urnUrl - ' + dat);
|
||
$.ajax({
|
||
type: "POST",
|
||
url: full+"/Resolver/resolver.php",
|
||
data: {url: "./../"+mat[1]+'/'+dat, function:'getRdfParamPOST', param: 'title'},
|
||
success: function(datj) {
|
||
getUrl(urnSplit[0], mat[1], obj, datj, undefined, urnSplit[1]);//urn, folder, obj, text, pmc, scrollto
|
||
}
|
||
});
|
||
}
|
||
});
|
||
//$('.copyLink').hide();
|
||
}
|
||
});*/
|
||
});
|
||
|
||
// $('body').on('click','.S1000Dfigure',function(event){
|
||
// event.preventDefault();
|
||
// event.stopPropagation();
|
||
|
||
// logger("on('click','.S1000Dfigure'");
|
||
|
||
// var $this = this;
|
||
|
||
// var stLink = $( ".container_text" ).attr('link');
|
||
|
||
|
||
// //var scrlTo = mainScrollTo;
|
||
// //logger('when start player', scrlTo, mainScrollTo );
|
||
|
||
// if( $($this).hasClass('imagePlayer-init') == false){
|
||
// $($this).addClass('imagePlayer-init');
|
||
// $($this).children('.S1000Dfiguregraphic').each(function (index, item) {
|
||
// //logger($(this));
|
||
// var urnP = $(item).attr("val");
|
||
// var thisObj = $(item);
|
||
// //logger('Item object', item);
|
||
// //logger('$(thisObj)', $(thisObj));
|
||
// var hotspotArray = $(thisObj).find('.S1000DHotspot');
|
||
|
||
// Snap.load(urnP, function ( loadedFragment ) {
|
||
// logger("urnP LOAD SVG", urnP, loadedFragment);
|
||
// thisObj.append( loadedFragment );
|
||
// $(thisObj).find('svg').hide();
|
||
// loadedSvg(thisObj, urnP);
|
||
// //Snap("#"+icnId).zpd();
|
||
// //svgttAddCover(icnId); // Добавление обвязки SVG
|
||
// } );
|
||
// });
|
||
// }
|
||
// return false;
|
||
// });
|
||
|
||
$('body').on('click', '.S1000Dsymbolgraphic', function (event) {
|
||
event.preventDefault();
|
||
event.stopPropagation();
|
||
|
||
var stLink = $(".container_text").attr('link');
|
||
var urnP = $(this).attr("boardnum");
|
||
var thisObj = $(this);
|
||
var full = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '');
|
||
if ($(thisObj).children('img').length <= 1) {
|
||
$.ajax({
|
||
type: "POST",
|
||
url: full + "/Resolver/resolver.php",
|
||
data: { url: stLink, function: 'urlFolder' },
|
||
success: function (data) {
|
||
//$('#Contents').addClass('visible');
|
||
folder = data;
|
||
regex = /^[.]?[\/]?(.*)/g;
|
||
mat = regex.exec(folder);
|
||
$.ajax({
|
||
type: "POST",
|
||
url: full + "/Resolver/resolver.php",
|
||
data: { url: folder, function: 'getFyletype', urn: urnP, type: '.svg,.jpg,.jpeg,.png,.gif' },
|
||
/*data: {url: stLink, function:'getDoctype', urn: urnP},*/
|
||
success: function (data) {
|
||
//logger(data);
|
||
$(thisObj).children('img').hide();
|
||
$(thisObj).append('<img src="' + mat[1] + '/' + data + '" alt="" style="width:100%; height:auto;" sc="0" sized="0" />');
|
||
//$(thisObj).children('img+img').draggable();
|
||
//$(thisObj).css({'min-height': $(thisObj).children('img+img').outerHeight() + 'px'});
|
||
}
|
||
});
|
||
}
|
||
});
|
||
}
|
||
return false;
|
||
});
|
||
|
||
$('body').on('click', '.openVideo', function (event) {
|
||
event.preventDefault();
|
||
event.stopPropagation();
|
||
|
||
var stLink = $(".container_text").attr('link');
|
||
var urnP = $(this).attr("boardnum");
|
||
var thisObj = $(this);
|
||
var full = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '');
|
||
logger('$(thisObj) video', $(thisObj));
|
||
if ($(thisObj).find('.jp-video').length < 1 && !$(thisObj).closest('.S1000Dmultimedia').hasClass('init')) {
|
||
$(thisObj).closest('.S1000Dmultimedia').addClass('init');
|
||
|
||
$.ajax({
|
||
type: "POST",
|
||
url: full + "/Resolver/resolver.php",
|
||
data: { url: stLink, function: 'urlFolder' },
|
||
success: function (data) {
|
||
//$('#Contents').addClass('visible');
|
||
folder = data;
|
||
regex = /^[.]?[\/]?(.*)/g;
|
||
mat = regex.exec(folder);
|
||
$.ajax({
|
||
type: "POST",
|
||
url: full + "/Resolver/resolver.php",
|
||
data: { url: folder, function: 'getFyletype', urn: urnP, type: '.mp4,.webm' },
|
||
success: function (data) {
|
||
$(thisObj).children('img').hide();
|
||
|
||
var tmp = '';
|
||
// tmp+='<div class="videoPlayer"><video class="video-js vjs-default-skin vjs-big-play-centered">';
|
||
// if((data.search('MP4') != -1) || (data.search('mp4') != -1)){
|
||
// tmp += '<source type="video/mp4" src="/'+mat[1]+'/'+data+'"></source>';
|
||
// }
|
||
// if((data.search('WEBM') != -1) || (data.search('webm') != -1)){
|
||
// tmp += '<source type="video/webm" src="/'+mat[1]+'/'+data+'"></source>';
|
||
// }
|
||
// tmp += '</video></div>';
|
||
var l = $(".jp-video").length;
|
||
|
||
tmp += '<div id="jp_container_' + (l + 1) + '" class="jp-video" role="application" aria-label="media player"> <div class="jp-type-single"> <div id="jquery_jplayer_' + (l + 1) + '" class="jp-jplayer"></div><div class="jp-gui"> <div class="jp-video-play"> <button class="jp-video-play-icon" role="button" tabindex="0">play</button> </div><div class="jp-interface"> <div class="jp-progress"> <div class="jp-seek-bar"> <div class="jp-play-bar"></div></div></div><div class="jp-current-time" role="timer" aria-label="time"> </div><div class="jp-duration" role="timer" aria-label="duration"> </div><div class="jp-controls-holder"> <div class="jp-controls"> <button class="jp-play" role="button" tabindex="0">play</button> <button class="jp-stop" role="button" tabindex="0">stop</button> </div><div class="jp-volume-controls"> <button class="jp-mute" role="button" tabindex="0">mute</button> <button class="jp-volume-max" role="button" tabindex="0">max volume</button> <div class="jp-volume-bar"> <div class="jp-volume-bar-value"></div></div></div><div class="jp-toggles"> <button class="jp-repeat" role="button" tabindex="0">repeat</button> <button class="jp-full-screen" role="button" tabindex="0">full screen</button> </div></div><div class="jp-details"> <div class="jp-title" aria-label="title"> </div></div></div></div><div class="jp-no-solution"> <span>Update Required</span> To play the media you will need to either update your browser to a recent version or update your <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash plugin</a>. </div></div></div>';
|
||
|
||
$(thisObj).append(tmp);
|
||
|
||
var setMedia = { title: " " };
|
||
//var playerSettings =
|
||
var supply = '';
|
||
|
||
if ((data.search('MP4') != -1) || (data.search('mp4') != -1)) {
|
||
//var mp4vid = '/'+mat[1]+'/'+data;
|
||
setMedia.m4v = '/' + mat[1] + '/' + data;
|
||
supply += 'M4V';
|
||
//tmp += '<source type="video/mp4" src="/'+mat[1]+'/'+data+'"></source>';
|
||
}
|
||
if ((data.search('WEBM') != -1) || (data.search('webm') != -1)) {
|
||
//var webm = '/'+mat[1]+'/'+data;
|
||
setMedia.webm = '/' + mat[1] + '/' + data;
|
||
if (supply != '') {
|
||
supply += ', ';
|
||
}
|
||
supply += 'webm';
|
||
}
|
||
|
||
var ret = $("#jquery_jplayer_" + (l + 1)).jPlayer({
|
||
ready: function () {
|
||
$(this).jPlayer("setMedia", setMedia);
|
||
},
|
||
cssSelectorAncestor: "#jp_container_" + (l + 1),
|
||
swfPath: "/js",
|
||
supplied: supply,
|
||
});/*.jPlayer({
|
||
ready: function () {
|
||
$(thisObj).children().jPlayer("setMedia", setMedia);
|
||
},
|
||
cssSelectorAncestor: "#jp_container_"+(l+1),
|
||
swfPath: "/js",
|
||
supplied: supply,
|
||
useStateClassSkin: true,
|
||
autoBlur: false,
|
||
smoothPlayBar: true,
|
||
keyEnabled: true,
|
||
remainingDuration: true,
|
||
toggleDuration: true
|
||
});*/
|
||
logger(ret);
|
||
//});
|
||
|
||
|
||
/*videojs(document.querySelector('.video-js'), {
|
||
controls: true,
|
||
autoplay: false,
|
||
preload: 'auto',
|
||
nativeControlsForTouch: true,
|
||
nativeVideoTracks: true,
|
||
fluid: true
|
||
//aspectRatio: "16:9"
|
||
});*/
|
||
// $(thisObj).children().mediaelementplayer({
|
||
// pluginPath: "./Modules/S1000D/templates/default/js/mediaelement-master/build/",
|
||
// // When using jQuery's `mediaelementplayer`, an `instance` argument
|
||
// // is available in the `success` callback
|
||
// success: function(mediaElement, originalNode, instance) {
|
||
// // do things
|
||
// }
|
||
// });
|
||
}
|
||
});
|
||
}
|
||
});
|
||
}
|
||
return false;
|
||
});
|
||
|
||
$('body').on('click', '.openAudio', function (event) {
|
||
event.preventDefault();
|
||
event.stopPropagation();
|
||
|
||
var stLink = $(".container_text").attr('link');
|
||
var urnP = $(this).attr("boardnum");
|
||
var thisObj = $(this);
|
||
var full = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '');
|
||
var onLoad = $(this).attr('actuate');
|
||
logger('$(thisObj) audio', $(thisObj));
|
||
if ($(thisObj).children('.jp-audio').length < 1 && !$(thisObj).closest('.S1000Dmultimedia').hasClass('init')) {
|
||
$(thisObj).closest('.S1000Dmultimedia').addClass('init');
|
||
|
||
$.ajax({
|
||
type: "POST",
|
||
url: full + "/Resolver/resolver.php",
|
||
data: { url: stLink, function: 'urlFolder' },
|
||
success: function (data) {
|
||
//$('#Contents').addClass('visible');
|
||
folder = data;
|
||
regex = /^[.]?[\/]?(.*)/g;
|
||
mat = regex.exec(folder);
|
||
$.ajax({
|
||
type: "POST",
|
||
url: full + "/Resolver/resolver.php",
|
||
data: { url: folder, function: 'getFyletype', urn: urnP, type: '.mp3,.ogg' },
|
||
success: function (data) {
|
||
$(thisObj).children('img').hide();
|
||
|
||
var tmp = '';
|
||
// tmp+='<audio class="video-js"';
|
||
// if (onLoad == 'onLoad'){
|
||
// tmp+=' autoplay controls>';
|
||
// }
|
||
// else{
|
||
// tmp+=' controls>';
|
||
// }
|
||
// if((data.search('MP3') != -1) || (data.search('mp3') != -1)){
|
||
// tmp += '<source src="/'+mat[1]+'/'+data+'"></source>';
|
||
// }
|
||
// if((data.search('OGG') != -1) || (data.search('ogg') != -1)){
|
||
// tmp += '<source src="/'+mat[1]+'/'+data+'"></source>';
|
||
// }
|
||
// tmp += '</audio>';
|
||
var l = $(".jp-audio").length;
|
||
var setMedia = { title: " " };
|
||
//var playerSettings =
|
||
var supply = '';
|
||
|
||
if ((data.search('MP3') != -1) || (data.search('mp3') != -1)) {
|
||
//var mp4vid = '/'+mat[1]+'/'+data;
|
||
setMedia.mp3 = '/' + mat[1] + '/' + data;
|
||
supply += 'mp3';
|
||
//tmp += '<source type="video/mp4" src="/'+mat[1]+'/'+data+'"></source>';
|
||
}
|
||
if ((data.search('OGG') != -1) || (data.search('ogg') != -1)) {
|
||
//var webm = '/'+mat[1]+'/'+data;
|
||
setMedia.oga = '/' + mat[1] + '/' + data;
|
||
if (supply != '') {
|
||
supply += ', ';
|
||
}
|
||
supply += 'oga';
|
||
}
|
||
logger(setMedia);
|
||
|
||
tmp += '<div id="jquery_japlayer_' + (l + 1) + '" class="jp-jplayer"></div><div id="jap_container_' + (l + 1) + '" class="jp-audio" role="application" aria-label="media player"> <div class="jp-type-single"> <div class="jp-gui jp-interface"> <div class="jp-volume-controls"> <button class="jp-mute" role="button" tabindex="0">mute</button> <button class="jp-volume-max" role="button" tabindex="0">max volume</button> <div class="jp-volume-bar"> <div class="jp-volume-bar-value"></div></div></div><div class="jp-controls-holder"> <div class="jp-controls"> <button class="jp-play" role="button" tabindex="0">play</button> <button class="jp-stop" role="button" tabindex="0">stop</button> </div><div class="jp-progress"> <div class="jp-seek-bar"> <div class="jp-play-bar"></div></div></div><div class="jp-current-time" role="timer" aria-label="time"> </div><div class="jp-duration" role="timer" aria-label="duration"> </div><div class="jp-toggles"> <button class="jp-repeat" role="button" tabindex="0">repeat</button> </div></div></div><div class="jp-details"> <div class="jp-title" aria-label="title"> </div></div><div class="jp-no-solution"> <span>Update Required</span> To play the media you will need to either update your browser to a recent version or update your <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash plugin</a>. </div></div></div>';
|
||
$(thisObj).append(tmp);
|
||
|
||
$("#jquery_japlayer_" + (l + 1)).jPlayer({
|
||
ready: function () {
|
||
$(this).jPlayer("setMedia", setMedia);
|
||
if (onLoad == 'onLoad') {
|
||
$(this).jPlayer("play");
|
||
}
|
||
},
|
||
cssSelectorAncestor: "#jap_container_" + (l + 1),
|
||
swfPath: "/js",
|
||
supplied: "mp3, oga",
|
||
useStateClassSkin: true,
|
||
autoBlur: false,
|
||
smoothPlayBar: true,
|
||
keyEnabled: true,
|
||
remainingDuration: true,
|
||
toggleDuration: true
|
||
});
|
||
/*videojs(document.querySelector('.video-js'), {
|
||
controls: true,
|
||
autoplay: false,
|
||
preload: 'auto'
|
||
});*/
|
||
/*$(thisObj).children().mediaelementplayer({
|
||
pluginPath: "./Modules/S1000D/templates/default/js/mediaelement-master/build/",
|
||
// When using jQuery's `mediaelementplayer`, an `instance` argument
|
||
// is available in the `success` callback
|
||
success: function(mediaElement, originalNode, instance) {
|
||
// do things
|
||
}
|
||
});*/
|
||
/*$('.video-js').mediaelementplayer({
|
||
pluginPath: "./Modules/S1000D/templates/default/js/mediaelement-master/build/",
|
||
// When using jQuery's `mediaelementplayer`, an `instance` argument
|
||
// is available in the `success` callback
|
||
success: function(mediaElement, originalNode, instance) {
|
||
// do things
|
||
}
|
||
});*/
|
||
}
|
||
});
|
||
}
|
||
});
|
||
}
|
||
return false;
|
||
});
|
||
|
||
$(".printButton").click(function () {
|
||
window.print();
|
||
});
|
||
|
||
$('body').on('click', 'button.multimediaObjectFullscreen', function (event) {
|
||
event.preventDefault();
|
||
event.stopPropagation();
|
||
//logger('HTML before button - ', $(event.target).parent().prev().get(0).outerHTML);
|
||
|
||
var htmlToShow = $(event.target).parent().prev().get(0).outerHTML;
|
||
htmlToShow = $(event.target).closest('.S1000Dmultimedia').find('.S1000Dobjecttitle').get(0).outerHTML + htmlToShow + '<div class="multimediaPanel"><button class="multimediaObjectCloseFullscreen">' + lableclose + '</button></div>';
|
||
logger('HTML before button - ', htmlToShow);
|
||
openPopup(htmlToShow);
|
||
|
||
});
|
||
|
||
$(".R_icon.lists_img").click(function (event) {
|
||
//var link = $( ".container_text" ).attr('link');
|
||
|
||
//getXML(link, '/Modules/S1000D/templates/default/FIG.xslt', $("#dmc.main-list_inset .tabs__content"), false, false, false, true);
|
||
|
||
reloadRiconCont('.S1000DLOF');
|
||
|
||
var objText = $(this).html();
|
||
|
||
$("#dmc.main-list_inset").addClass('visible');
|
||
$(".main-list_inset_c").addClass('visible');
|
||
$(".iconsBox").addClass('moved');
|
||
|
||
$(".iconsBox_item").removeClass('active');
|
||
$(this).parent().addClass('active');
|
||
});
|
||
$(".R_icon.lists_multi").click(function (event) {
|
||
//var link = $( ".container_text" ).attr('link');
|
||
|
||
//getXML(link, '/Modules/S1000D/templates/default/FIG.xslt', $("#dmc.main-list_inset .tabs__content"), false, false, false, true);
|
||
|
||
reloadRiconCont('.S1000DLOM');
|
||
|
||
var objText = $(this).html();
|
||
|
||
$("#dmc.main-list_inset").addClass('visible');
|
||
$(".main-list_inset_c").addClass('visible');
|
||
$(".iconsBox").addClass('moved');
|
||
|
||
$(".iconsBox_item").removeClass('active');
|
||
$(this).parent().addClass('active');
|
||
});
|
||
|
||
$(".R_icon.lists_tables").click(function (event) {
|
||
/*var link = $( ".container_text" ).attr('link');
|
||
|
||
getXML(link, '/Modules/S1000D/templates/default/TBL.xslt', $("#dmc.main-list_inset .tabs__content"), false, false, false, true);
|
||
*/
|
||
reloadRiconCont('.S1000DLOT');
|
||
|
||
$("#dmc.main-list_inset").addClass('visible');
|
||
$(".main-list_inset_c").addClass('visible');
|
||
$(".iconsBox").addClass('moved');
|
||
|
||
$(".iconsBox_item").removeClass('active');
|
||
$(this).parent().addClass('active');
|
||
});
|
||
|
||
$(".R_icon.lists").click(function (event) {
|
||
//var link = $( ".container_text" ).attr('link');
|
||
//link, template, object, createNew, startfile, mainCont, removeRdf, linkCont, norecursion, scrollto, returnBack
|
||
//getXML(link, '/Modules/S1000D/templates/default/TOC.xslt', $("#dmc.main-list_inset .tabs__content"), false, false, false, true);
|
||
reloadRiconCont('.S1000DTOC');
|
||
|
||
$("#dmc.main-list_inset").addClass('visible');
|
||
$(".main-list_inset_c").addClass('visible');
|
||
$(".iconsBox").addClass('moved');
|
||
|
||
$(".iconsBox_item").removeClass('active');
|
||
$(this).parent().addClass('active');
|
||
});
|
||
$(".R_icon.hidemenu").click(function (event) {
|
||
$("#dmc.main-list_inset").removeClass('visible');
|
||
$(".main-list_inset_c").removeClass('visible');
|
||
$(".iconsBox").removeClass('moved');
|
||
|
||
$(".iconsBox_item").removeClass('active');
|
||
});
|
||
});
|
||
|
||
function startActions() {
|
||
logger('startActionss');
|
||
//change minus to plus
|
||
// minusToPlus();
|
||
// //logger("tinymce_start");
|
||
// tinymce.init({
|
||
// selector:'textarea#editor',
|
||
// toolbar: 'undo redo | subscript superscript',
|
||
// menubar: false,
|
||
// force_br_newlines : false,
|
||
// force_p_newlines : false,
|
||
// forced_root_block : '',
|
||
// });
|
||
|
||
imageClick();
|
||
symbolClick();
|
||
|
||
// //videoClick();
|
||
// //audioClick();
|
||
for (var i = 0; i < $('.S1000Dmultimedia').length; i++) {
|
||
getInnerAudioVideo($('.S1000Dmultimedia')[i]);
|
||
}
|
||
loadInlinedDownload();
|
||
loadInlinedPDF();
|
||
loadInlinedHTML();
|
||
|
||
restartScrolls();
|
||
load3dDivs();
|
||
includeHTML();
|
||
cartUpdate();
|
||
//addIconbox();
|
||
}
|
||
|
||
function setupContents() {
|
||
//var list = $('#contentsContainer').$('.parent').get(0).outerHTML;
|
||
logger('here9');
|
||
$('#loap_tab').html($('#contentsContainer .parent').get(0).outerHTML);
|
||
}
|
||
|
||
/*
|
||
function addIconbox() {
|
||
logger('here12');
|
||
var tmp = '<div class="iconsBox"><div class="iconsBox_item" style="display: block;"><i class="R_icon lists"></i></div><div class="iconsBox_item" style="display: block;"><i class="R_icon lists_img"></i></div><div class="iconsBox_item" style="display: block;"><i class="R_icon lists_multi"><svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#bfbfbf" x="0px" y="0px" width="90px" height="90px" viewBox="0 0 90 90" style="enable-background:new 0 0 90 90;" xml:space="preserve"><g><path id="YouTube__x28_alt_x29_" d="M90,26.958C90,19.525,83.979,13.5,76.55,13.5h-63.1C6.021,13.5,0,19.525,0,26.958v36.084 C0,70.475,6.021,76.5,13.45,76.5h63.1C83.979,76.5,90,70.475,90,63.042V26.958z M36,60.225V26.33l25.702,16.947L36,60.225z"/></g></svg></i></div><div class="iconsBox_item" style="display: block;"><i class="R_icon lists_tables"></i></div><div class="iconsBox_item hidemenu"><i class="R_icon hidemenu"></i></div></div>';
|
||
$('body').append('<div class="main-list_inset_c"><div class="main-list_inset" id="dmc"><div class="main-list_inset_body"><div class="main-list_inset_body_tabs"><div class="tabs__content active dmc-right-panel"></div></div></div></div></div>');
|
||
$('.container').append(tmp);
|
||
|
||
$('.iconsBox').append('<div class="iconsBoxContainer"></div>');
|
||
//logger("$('.S1000DTOC, .S1000DLOF, .S1000DLOM, .S1000DLOT').outerHTML()", $('.S1000DTOC, .S1000DLOF, .S1000DLOM, .S1000DLOT').get(0).outerHTML);
|
||
$('.iconsBoxContainer').append($('.S1000DTOC').get(0).outerHTML);
|
||
$('.iconsBoxContainer').append($('.S1000DLOF').get(0).outerHTML);
|
||
$('.iconsBoxContainer').append($('.S1000DLOM').get(0).outerHTML);
|
||
$('.iconsBoxContainer').append($('.S1000DLOT').get(0).outerHTML);
|
||
$('.S1000DTOC, .S1000DLOF, .S1000DLOM, .S1000DLOT').hide();
|
||
} */
|
||
|
||
function reloadRiconCont(toShow) {
|
||
$("#dmc.main-list_inset .tabs__content").html('');
|
||
logger('$(toShow)', $('.iconsBox').find(toShow));
|
||
$.each($('.iconsBox').find(toShow), function (index, value) {
|
||
$("#dmc.main-list_inset .tabs__content").html($(value).get(0).outerHTML);
|
||
});
|
||
$("#dmc").find(toShow).show();
|
||
}
|
||
|
||
function scrollWindow(scto) {
|
||
$('html, body').animate({
|
||
scrollTop: $("#" + scto).offset().top
|
||
}, 2000);
|
||
}
|
||
|
||
function hideLeftPanel() {
|
||
$('.main-list_inset_body').parent().removeClass('visible').addClass('js-wait');
|
||
$('.main-list_top').removeClass('selected');
|
||
$('.main-list_top').hide().show(0);
|
||
}
|
||
function scrollWindow(scto) {
|
||
$('html, body').animate({
|
||
scrollTop: $("#" + scto).offset().top
|
||
}, 2000);
|
||
}
|
||
|
||
function load3dDivs() {
|
||
logger("ALT START 3D", $('.S1000Dmultimediaobj>.b4webJsonContaine'));
|
||
logger("START load3dDivs", $('.b4webJsonContainer .b4webJsonContainer'));
|
||
for (var i = 0; i < $('.b4webJsonContainer .b4webJsonContainer').length; i++) {
|
||
// var stLink = $( ".container_text" ).attr('link');
|
||
// var urnP = $($('.b4webJsonContainer .b4webJsonContainer')[i]).closest('.S1000Dmultimediaobj').attr("boardnum");
|
||
// var actuate = $($('.b4webJsonContainer .b4webJsonContainer')[i]).closest('.S1000Dmultimediaobj').attr("actuate");
|
||
// var show = $($('.b4webJsonContainer .b4webJsonContainer')[i]).closest('.S1000Dmultimediaobj').attr("show");
|
||
var thisObj = $('.b4webJsonContainer .b4webJsonContainer')[i];
|
||
// var full = location.protocol+'//'+location.hostname+(location.port ? ':'+location.port: '');
|
||
// var serialized = $($('.b4webJsonContainer .b4webJsonContainer')[i]).closest('.S1000Dmultimediaobj').html();
|
||
|
||
logger('load3dDivs', thisObj);
|
||
var tmp = '<div class="multimediaPanel"><button class="multimediaObjectFullscreen">' + lablefullscreen + '</button></div>';
|
||
logger(tmp, $(thisObj));
|
||
$(thisObj).append(tmp);
|
||
}
|
||
//return false;
|
||
|
||
// m_data.unload();
|
||
|
||
// _is_init = false;
|
||
// loadJson($('#main_canvas_container').attr('jsonLink'));
|
||
}
|
||
function restartScrolls() {
|
||
|
||
$('div[id^="tbl"]').mCustomScrollbar({
|
||
theme: "custom-theme",
|
||
axis: "x"
|
||
});
|
||
}
|
||
function getInnerAudioVideo(element, autoplay) {
|
||
autoplay = typeof autoplay !== 'undefined' ? autoplay : false;
|
||
//logger('autoplay',autoplay);
|
||
var multimediaList = [];
|
||
multimediaList = $(element).find('.openAudio, .openVideo');
|
||
var actuate = $(element).attr('actuate');
|
||
//logger('actuate of element', element, $(element).find('.S1000Dmultimediaobj').attr('actuate'));
|
||
|
||
var tmp = '';
|
||
var l = $(".jp-video,.jp-audio").length;
|
||
|
||
//logger($(element));
|
||
//logger($(multimediaList));
|
||
|
||
if ($(multimediaList[0]).hasClass('openAudio')) {
|
||
tmp += '<div id="jquery_jplayer_' + (l) + '" class="jp-jplayer"></div><div id="jp_container_' + (l) + '" class="jp-audio" role="application" aria-label="media player"><div class="jp-type-playlist"><div class="jp-gui jp-interface"><div class="jp-controls"><button class="jp-previous" role="button" tabindex="0">previous</button><button class="jp-play" role="button" tabindex="0">play</button><button class="jp-next" role="button" tabindex="0">next</button><button class="jp-stop" role="button" tabindex="0">stop</button></div><div class="jp-progress"><div class="jp-seek-bar"><div class="jp-play-bar"></div></div></div><div class="jp-volume-controls"><button class="jp-mute" role="button" tabindex="0">mute</button><button class="jp-volume-max" role="button" tabindex="0">max volume</button><div class="jp-volume-bar"><div class="jp-volume-bar-value"></div></div></div><div class="jp-time-holder"><div class="jp-current-time" role="timer" aria-label="time"> </div><div class="jp-duration" role="timer" aria-label="duration"> </div></div><div class="jp-toggles"><button class="jp-repeat" role="button" tabindex="0">repeat</button><button class="jp-shuffle" role="button" tabindex="0">shuffle</button></div></div><div class="jp-playlist"><ul><li> </li></ul></div><div class="jp-no-solution"><span>Update Required</span>To play the media you will need to either update your browser to a recent version or update your <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash plugin</a>.</div></div></div>';
|
||
}
|
||
else {
|
||
tmp += '<div id="jp_container_' + (l) + '" class="jp-video jp-video-360p" role="application" aria-label="media player"><div class="jp-type-playlist"><div id="jquery_jplayer_' + (l) + '" class="jp-jplayer"></div><div class="jp-gui"><div class="jp-video-play"><button class="jp-video-play-icon" role="button" tabindex="0">play</button></div><div class="jp-interface"><div class="jp-progress"><div class="jp-seek-bar"><div class="jp-play-bar"></div></div></div><div class="jp-current-time" role="timer" aria-label="time"> </div><div class="jp-duration" role="timer" aria-label="duration"> </div><div class="jp-controls-holder"><div class="jp-controls"><button class="jp-previous" role="button" tabindex="0">previous</button><button class="jp-play" role="button" tabindex="0">play</button><button class="jp-next" role="button" tabindex="0">next</button><button class="jp-stop" role="button" tabindex="0">stop</button></div><div class="jp-volume-controls"><button class="jp-mute" role="button" tabindex="0">mute</button><button class="jp-volume-max" role="button" tabindex="0">max volume</button><div class="jp-volume-bar"><div class="jp-volume-bar-value"></div></div></div><div class="jp-toggles"><button class="jp-repeat" role="button" tabindex="0">repeat</button><button class="jp-shuffle" role="button" tabindex="0">shuffle</button><button class="jp-full-screen" role="button" tabindex="0">full screen</button></div></div><div class="jp-details"><div class="jp-title" aria-label="title"> </div></div></div></div><div class="jp-playlist"><ul><li> </li></ul></div><div class="jp-no-solution"><span>Update Required</span>To play the media you will need to either update your browser to a recent version or update your <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash plugin</a>.</div></div></div>';
|
||
}
|
||
|
||
if ($(multimediaList).length > 0 && !$(element).hasClass('init')) {
|
||
|
||
var playlistArray = [];
|
||
var loadNow = false;
|
||
for (var i = 0; i < $(multimediaList).length; i++) {
|
||
if ($($(multimediaList)[i]).closest('.S1000Dmultimediaobj').attr('actuate') != 'onRequest') {
|
||
loadNow = true;
|
||
}
|
||
//logger(multimediaList[i]);
|
||
|
||
else {
|
||
logger(multimediaList[i]);
|
||
multimediaList = multimediaList.splice(i, 1);
|
||
}
|
||
}
|
||
if (loadNow) {
|
||
$(element).addClass('init');
|
||
//logger('multimediaList.length > 0');
|
||
$(element).prepend(tmp);
|
||
|
||
for (var i = 0; i < $(multimediaList).length; i++) {
|
||
|
||
var stLink = $(".container_text").attr('link');
|
||
var urnP = $($(multimediaList)[i]).closest('.S1000Dmultimediaobj').attr("val");
|
||
var thisObj = $($(multimediaList)[i]);
|
||
var onLoad = $($(multimediaList)[i]).attr('actuate');
|
||
logger('onLoad', onLoad, urnP, $($(multimediaList)[i]));
|
||
|
||
//if($(element).children('.jp-video').length < 1){
|
||
|
||
$(element).find('img').hide();
|
||
|
||
var setMedia = { title: " " };
|
||
//var playerSettings =
|
||
var supply = '';
|
||
|
||
if (urnP != undefined) {
|
||
if ((urnP.search('MP3') != -1) || (urnP.search('mp3') != -1)) {
|
||
//var mp4vid = '/'+mat[1]+'/'+data;
|
||
setMedia.mp3 = urnP;
|
||
setMedia.title = labelfragment + (playlistArray.length + 1);//data;
|
||
supply += 'mp3';
|
||
//tmp += '<source type="video/mp4" src="/'+mat[1]+'/'+data+'"></source>';
|
||
}
|
||
if ((urnP.search('OGG') != -1) || (urnP.search('ogg') != -1)) {
|
||
//var webm = '/'+mat[1]+'/'+data;
|
||
setMedia.oga = urnP;
|
||
setMedia.title = labelfragment + (playlistArray.length + 1);//data;
|
||
if (supply != '') {
|
||
supply += ', ';
|
||
}
|
||
supply += 'oga';
|
||
}
|
||
if ((urnP.search('MP4') != -1) || (urnP.search('mp4') != -1)) {
|
||
//var mp4vid = '/'+mat[1]+'/'+data;
|
||
setMedia.m4v = urnP;
|
||
setMedia.title = (playlistArray.length + 1);//data;
|
||
if (supply != '') {
|
||
supply += ', ';
|
||
}
|
||
supply += 'M4V';
|
||
//tmp += '<source type="video/mp4" src="/'+mat[1]+'/'+data+'"></source>';
|
||
}
|
||
if ((urnP.search('WEBM') != -1) || (urnP.search('webm') != -1)) {
|
||
//var webm = '/'+mat[1]+'/'+data;
|
||
setMedia.webm = urnP;
|
||
setMedia.title = (playlistArray.length + 1);//data;
|
||
if (supply != '') {
|
||
supply += ', ';
|
||
}
|
||
supply += 'webm';
|
||
}
|
||
}
|
||
|
||
playlistArray.push(setMedia);
|
||
|
||
logger('ADD IN PLAYLIST', setMedia);
|
||
//logger(myPlaylist.playlist);
|
||
if (playlistArray.length == $(multimediaList).length) {
|
||
logger('i+1', i + 1);
|
||
|
||
var myPlaylist = new jPlayerPlaylist({
|
||
jPlayer: "#jquery_jplayer_" + l,
|
||
cssSelectorAncestor: "#jp_container_" + l
|
||
},
|
||
playlistArray, //playlist elements
|
||
{
|
||
playlistOptions: {
|
||
enableRemoveControls: false
|
||
},
|
||
//swfPath: "../../dist/jplayer",
|
||
supplied: "webmv, ogv, m4v, oga, mp3",
|
||
useStateClassSkin: true,
|
||
autoBlur: false,
|
||
smoothPlayBar: true,
|
||
keyEnabled: true,
|
||
audioFullScreen: true,
|
||
ready: function () {
|
||
if (autoplay != false) {
|
||
logger('SET ELEMENT FOR CLICK', autoplay);
|
||
var playlist = $(element).find('.jp-playlist .jp-playlist-item');
|
||
//$()
|
||
if (!$(playlist[autoplay]).hasClass('clicked')) {
|
||
$(playlist[autoplay]).addClass('clicked');//.click();
|
||
var playlist = $(element).find('.jp-playlist .jp-playlist-item').removeClass('jp-playlist-current');
|
||
$(element).find('.jp-playlist li').removeClass('jp-playlist-current');
|
||
|
||
$(playlist[autoplay]).addClass('jp-playlist-current');
|
||
$($(element).find('.jp-playlist li')[autoplay]).addClass('jp-playlist-current');
|
||
$(playlist[autoplay]).click();
|
||
//$(element).find('.jp-play').click();
|
||
}
|
||
}
|
||
}
|
||
});
|
||
}
|
||
}
|
||
}
|
||
else {
|
||
$(element).find('.openAudio, .openVideo').hide();
|
||
multimediaList = $(element).find('.openAudio, .openVideo');
|
||
$(multimediaList[0]).show();
|
||
}
|
||
}
|
||
}
|
||
function symbolClick() {
|
||
logger($("div[actuate='onLoad'].S1000Dsymbolgraphic"));
|
||
$("div[actuate='onLoad'].S1000Dsymbolgraphic").click();
|
||
}
|
||
function imageClick() {
|
||
logger('imc');
|
||
$('.S1000Dfigure').each(function (index, item) {
|
||
logger('imageClick()', item);
|
||
loadGraphic(item);
|
||
});
|
||
}
|
||
function loadInlinedDownload() {
|
||
//logger("$('.downloadContainer').length");
|
||
//logger($('.downloadContainer').length);
|
||
for (var i = 0; i < $('.downloadContainer').length; i++) {
|
||
// event.preventDefault();
|
||
// event.stopPropagation();
|
||
|
||
var stLink = $(".container_text").attr('link');
|
||
var urnP = $($('.downloadContainer')[i]).parent().attr("val");
|
||
var actuate = $($('.downloadContainer')[i]).parent().attr("actuate");
|
||
var show = $($('.downloadContainer')[i]).parent().attr("show");
|
||
var thisObj = $('.downloadContainer')[i];
|
||
var full = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '');
|
||
|
||
if (!$(thisObj).hasClass('loaded') && actuate == 'onLoad' && show == 'embed') {
|
||
$(thisObj).addClass('loaded');
|
||
|
||
var tmp = '';
|
||
|
||
tmp += '<div class="inlineDownloadIconC"><a href="' + urnP + '" class="inlineDownloadIcon"></a></div>';
|
||
//tmp += '<div id="jp_container_'+(l+1)+'" class="jp-video" role="application" aria-label="media player"> <div class="jp-type-single"> <div id="jquery_jplayer_'+(l+1)+'" class="jp-jplayer"></div><div class="jp-gui"> <div class="jp-video-play"> <button class="jp-video-play-icon" role="button" tabindex="0">play</button> </div><div class="jp-interface"> <div class="jp-progress"> <div class="jp-seek-bar"> <div class="jp-play-bar"></div></div></div><div class="jp-current-time" role="timer" aria-label="time"> </div><div class="jp-duration" role="timer" aria-label="duration"> </div><div class="jp-controls-holder"> <div class="jp-controls"> <button class="jp-play" role="button" tabindex="0">play</button> <button class="jp-stop" role="button" tabindex="0">stop</button> </div><div class="jp-volume-controls"> <button class="jp-mute" role="button" tabindex="0">mute</button> <button class="jp-volume-max" role="button" tabindex="0">max volume</button> <div class="jp-volume-bar"> <div class="jp-volume-bar-value"></div></div></div><div class="jp-toggles"> <button class="jp-repeat" role="button" tabindex="0">repeat</button> <button class="jp-full-screen" role="button" tabindex="0">full screen</button> </div></div><div class="jp-details"> <div class="jp-title" aria-label="title"> </div></div></div></div><div class="jp-no-solution"> <span>Update Required</span> To play the media you will need to either update your browser to a recent version or update your <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash plugin</a>. </div></div></div>';
|
||
|
||
$(thisObj).append(tmp);
|
||
}
|
||
return false;
|
||
}
|
||
}
|
||
function loadInlinedPDF() {
|
||
//logger("$('.pdfPreviewContainer').length");
|
||
//logger($('.pdfPreviewContainer').length);
|
||
for (var i = 0; i < $('.pdfPreviewContainer').length; i++) {
|
||
var stLink = $(".container_text").attr('link');
|
||
var urnP = $($('.pdfPreviewContainer')[i]).parent('.S1000Dmultimediaobj').attr("val");
|
||
logger("loadpdf", urnP);
|
||
var actuate = $($('.pdfPreviewContainer')[i]).parent('.S1000Dmultimediaobj').attr("actuate");
|
||
var show = $($('.pdfPreviewContainer')[i]).parent('.S1000Dmultimediaobj').attr("show");
|
||
var thisObj = $('.pdfPreviewContainer')[i];
|
||
var full = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '');
|
||
|
||
if (!$(thisObj).hasClass('loaded') && actuate == 'onLoad' && show == 'embed') {
|
||
$(thisObj).addClass('loaded');
|
||
|
||
|
||
var tmp = '';
|
||
|
||
tmp += '<object data="' + urnP + '" type="application/pdf" width="100%" height="450px"><embed src="' + urnP + '" type="application/pdf"><p>' + labeldontsupportpdf + ': <a href="' + urnP + '">' + labledownloadpdf + '</a>.</p></embed></object><div class="multimediaPanel"><button class="multimediaObjectFullscreen">' + lablefullscreen + '</button></div>';
|
||
|
||
//tmp += '<div id="jp_container_'+(l+1)+'" class="jp-video" role="application" aria-label="media player"> <div class="jp-type-single"> <div id="jquery_jplayer_'+(l+1)+'" class="jp-jplayer"></div><div class="jp-gui"> <div class="jp-video-play"> <button class="jp-video-play-icon" role="button" tabindex="0">play</button> </div><div class="jp-interface"> <div class="jp-progress"> <div class="jp-seek-bar"> <div class="jp-play-bar"></div></div></div><div class="jp-current-time" role="timer" aria-label="time"> </div><div class="jp-duration" role="timer" aria-label="duration"> </div><div class="jp-controls-holder"> <div class="jp-controls"> <button class="jp-play" role="button" tabindex="0">play</button> <button class="jp-stop" role="button" tabindex="0">stop</button> </div><div class="jp-volume-controls"> <button class="jp-mute" role="button" tabindex="0">mute</button> <button class="jp-volume-max" role="button" tabindex="0">max volume</button> <div class="jp-volume-bar"> <div class="jp-volume-bar-value"></div></div></div><div class="jp-toggles"> <button class="jp-repeat" role="button" tabindex="0">repeat</button> <button class="jp-full-screen" role="button" tabindex="0">full screen</button> </div></div><div class="jp-details"> <div class="jp-title" aria-label="title"> </div></div></div></div><div class="jp-no-solution"> <span>Update Required</span> To play the media you will need to either update your browser to a recent version or update your <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash plugin</a>. </div></div></div>';
|
||
|
||
$(thisObj).append(tmp);
|
||
}
|
||
}
|
||
return false;
|
||
}
|
||
function loadInlinedHTML() {
|
||
//logger("$('.htmlContainer').length");
|
||
//logger($('.htmlContainer').length);
|
||
|
||
for (var i = 0; i < $('.htmlContainer').length; i++) {
|
||
// event.preventDefault();
|
||
// event.stopPropagation();
|
||
|
||
var stLink = $(".container_text").attr('link');
|
||
var urnP = $($('.htmlContainer')[i]).parent().attr("boardnum");
|
||
var start = $($('.htmlContainer')[i]).attr("start");
|
||
|
||
if (start == typeof undefined && start == false) {
|
||
start = 'index.html';
|
||
}
|
||
|
||
var thisObj = $('.htmlContainer')[i];
|
||
logger('start HTML', urnP + '/' + start);
|
||
|
||
if (!$(thisObj).hasClass('loaded')) {
|
||
|
||
var tmp = '';
|
||
tmp += '<object data="' + urnP + '/' + start + '" type="text/html" width="100%" height="450px"><embed src="' + urnP + '/' + start + '" type="text/html"><p>' + labeldontsupporthtml + ': <a href="' + urnP + '/' + start + '">' + labledownloadhtml + '</a>.</p></embed></object><div class="multimediaPanel"><button class="multimediaObjectFullscreen">' + lablefullscreen + '</button></div>';
|
||
|
||
logger('start HTML', $(thisObj), tmp);
|
||
$(thisObj).append(tmp);
|
||
$(thisObj).addClass('loaded');
|
||
}
|
||
}
|
||
}
|
||
|
||
function addHashToBookmark() {
|
||
var stLink = $(".container_text").attr('link');
|
||
var linkText = $(".description_body_text span").html();
|
||
|
||
$("#Bookmarks .tabs__content .parent li ul").append('<li><a class="jsLink bookmarkLink active" href="' + stLink + '">' + linkText + '</a><div class="bookmarkLinkClose"></div></li>');
|
||
}
|
||
|
||
function plusToMinus() {
|
||
$(".addContent .svgMinus").show();
|
||
$(".addContent .svgPlus").hide();
|
||
$(".S1000DBookmark").css({ "display": "inline-block" });
|
||
$(".addToCartInput").css({ "display": "block" });
|
||
$(".addToCartLink").css({ "display": "block" });
|
||
}
|
||
function minusToPlus() {
|
||
$(".addContent .svgMinus").hide();
|
||
$(".addContent .svgPlus").show();
|
||
$(".S1000DBookmark").css({ "display": "none" });
|
||
$(".addToCartInput").css({ "display": "none" });
|
||
$(".addToCartLink").css({ "display": "block" });
|
||
}
|
||
function copy(str) {
|
||
var tmp = document.createElement('INPUT'), // Создаём новый текстовой input
|
||
focus = document.activeElement; // Получаем ссылку на элемент в фокусе (чтобы не терять фокус)
|
||
|
||
tmp.value = str; // Временному input вставляем текст для копирования
|
||
|
||
document.body.appendChild(tmp); // Вставляем input в DOM
|
||
tmp.select(); // Выделяем весь текст в input
|
||
//logger($(tmp));
|
||
document.execCommand('copy'); // Магия! Копирует в буфер выделенный текст (см. команду выше)
|
||
document.body.removeChild(tmp); // Удаляем временный input
|
||
focus.focus(); // Возвращаем фокус туда, где был
|
||
}
|
||
function openPopup(html) {
|
||
if ($('.htmlPopup').length > 0) {
|
||
$('.htmlPopup .popupContent').html(html);
|
||
}
|
||
else {
|
||
var newPopup = $('<div class="popupWindow htmlPopup"><div class="popupCont"><div class="popupContent">' + html + '</div></div></div>');
|
||
$('body').append(newPopup);
|
||
}
|
||
|
||
$('.htmlPopup').show();
|
||
|
||
$('.htmlPopup .popupCont').css({ 'height': '98%', 'width': '98%', 'max-height': '98%', 'max-width': '98%' });
|
||
$('.htmlPopup .popupContent').css({ 'height': '100%', 'width': '100%', 'overflow': 'hidden' });
|
||
var oh = $('.htmlPopup .popupContent').innerHeight() - $('.htmlPopup .popupContent .multimediaPanel').outerHeight() - $('.htmlPopup .popupContent .S1000Dobjecttitle').outerHeight();
|
||
$('.htmlPopup .popupCont object, .htmlPopup .popupCont embed').removeAttr('height').css({ 'height': oh + 'px', 'min-height': oh + 'px', 'width': '100%' });
|
||
|
||
if ($('.htmlPopup .popupCont').outerHeight() < $('.htmlPopup.popupWindow').outerHeight()) {
|
||
tmp = ($('.htmlPopup.popupWindow').outerHeight() - $('.htmlPopup .popupCont').outerHeight()) / 2;
|
||
$('.htmlPopup .popupCont').css({ 'top': tmp + 'px' });
|
||
}
|
||
if ($('.htmlPopup .popupCont').outerWidth() < $('.htmlPopup.popupWindow').outerWidth()) {
|
||
tmp = ($('.htmlPopup.popupWindow').outerWidth() - $('.htmlPopup .popupCont').outerWidth()) / 2;
|
||
$('.htmlPopup .popupCont').css({ 'left': tmp + 'px' });
|
||
}
|
||
}
|
||
function loadGraphic(elem) {
|
||
|
||
//elem - figure
|
||
logger('loadGraphic', elem);
|
||
var $this = elem;
|
||
var stLink = $(".container_text").attr('link');
|
||
|
||
//var scrlTo = mainScrollTo;
|
||
//logger('when start player', elem, $($this).children('.S1000Dfiguregraphic') );
|
||
// if( $($this).hasClass('imagePlayer-init') == false){
|
||
// $($this).addClass('imagePlayer-init');
|
||
|
||
$($this).children('.S1000Dfiguregraphic').each(function (index, item) {
|
||
// item - figure's div with svg
|
||
logger('item', item);
|
||
var urnP = $(item).attr("val");
|
||
// urnP - SVG's name
|
||
var thisObj = $(item);
|
||
//thisObj - current object
|
||
|
||
/* if (thisObj[0].getAttribute('val') === 'ICN-MI17V5-A-237001-1-AD92F-08001-A-01-1.svg') {
|
||
for (var i = 0; i < thisObj[0].childNodes.length; i++) {
|
||
logger( thisObj[0].childNodes[i] ); // Text, DIV, Text, UL, ..., SCRIPT
|
||
}
|
||
logger('Item object', thisObj[0].children);
|
||
}*/
|
||
|
||
var hotspotArray = $(thisObj).find('.S1000DHotspot');
|
||
// logger("hotspotArray", hotspotArray);
|
||
|
||
Snap.load(urnP, function (loadedFragment) {
|
||
Snap($(thisObj)[0]).append(loadedFragment);
|
||
$(thisObj).find('svg').hide();
|
||
// logger('hsarr',hotspotArray);
|
||
loadedSvg(thisObj, urnP, hotspotArray);
|
||
//Snap("#"+icnId).zpd();
|
||
//svgttAddCover(icnId); // Добавление обвязки SVG
|
||
});
|
||
});
|
||
// }
|
||
// return false;
|
||
}
|
||
function loadedSvg(thisElement, urnP, hotspotArray) {
|
||
//logger('loadedSvg', thisElement);
|
||
|
||
var svg = $(thisElement).find('svg');
|
||
var hotspots = [];
|
||
|
||
// //console.log(svg[0]);
|
||
//logger('svg', svg.attr('width'));
|
||
hotspots = $(svg).find('text[itedo' + $.escapeSelector(":apstype") + '="grobject"], g[class], circle[itedo' + $.escapeSelector(":apstype") + '="grobject"], ellipse[itedo' + $.escapeSelector(":apstype") + '="grobject"]') // достаем все хотспоты картинки
|
||
|
||
// console.log(hotspots);
|
||
|
||
var viewBox = svg[0].getAttribute('viewBox');
|
||
let parenthot = []
|
||
let hotspotArrToPlayer = [];
|
||
|
||
let trans = false
|
||
let mat = false
|
||
|
||
let parrentrecurseidcurent // содержимое тега хотспота
|
||
let parrentrecurseid // названия тега
|
||
|
||
for (let i = 0; i < hotspots.length; i++) {
|
||
let isMatrix = false
|
||
let isTranslate = false
|
||
const parrentreciursematrix = []
|
||
|
||
|
||
parenthot[i] = hotspots[i].parentElement.id; // текущий хотспот
|
||
parrentrecurseidcurent = hotspots[i];
|
||
|
||
const arr = []
|
||
|
||
// //console.log(parrentrecurseidcurent.getAttribute('y'));
|
||
//console.log(parrentrecurseidcurent);
|
||
// //console.log(svg[0].getElementsByTagName('g')[0]);
|
||
parrentrecurseid = parrentrecurseidcurent.tagName;
|
||
let n = 0
|
||
let uses = svg[0].getElementsByTagName('use')
|
||
|
||
while (parrentrecurseid != 'svg') {
|
||
n++
|
||
let parrentrecurseidcurentwh = parrentrecurseidcurent.parentElement; // содержимое тега родителя (проходится по каждому с конца)
|
||
let transform = parrentrecurseidcurentwh.getAttribute('transform');
|
||
// logger('parrentrecurseidcurentwh',parrentrecurseidcurentwh);
|
||
let idParent = parrentrecurseidcurent.parentElement.getAttribute('id')
|
||
let transformForTranslate
|
||
|
||
const transArr = []
|
||
const arrUses = []
|
||
|
||
if (uses.length > 0) {
|
||
for (let k = 0; k < uses.length; k++) {
|
||
arrUses.push(uses[k])
|
||
let idUse = uses[k].getAttribute('xlink:href')
|
||
if (idUse.slice(1) == idParent) {
|
||
transArr.push(uses[k])
|
||
transformForTranslate = uses[k]
|
||
}
|
||
}
|
||
}
|
||
|
||
if (transform != null) {
|
||
if (transform.indexOf('translate') != -1 && n == 1) {
|
||
isTranslate = true
|
||
} else if (transform.indexOf('matrix') != -1 && !isTranslate) {
|
||
isMatrix = true
|
||
}
|
||
}
|
||
|
||
let parrentrecurseidwh = parrentrecurseidcurent.parentElement.tagName; // имя родительского тега
|
||
|
||
if (parrentrecurseid != "symbol") {
|
||
// //console.log(parrentrecurseidcurent);
|
||
// logger(parrentrecurseidcurent.transform.baseVal.length);
|
||
if (parrentrecurseidcurent.transform.baseVal.length > 0) {
|
||
// console.log(1);
|
||
// console.log(hotspots[i]);
|
||
if (parrentrecurseidcurent.transform.baseVal[0].matrix != null) {
|
||
// //console.log(parrentrecurseidcurent);
|
||
// //console.log(parrentrecurseidcurent.transform.baseVal[0].matrix);
|
||
//logger(parrentrecurseidcurent);
|
||
// console.log(2);
|
||
parrentreciursematrix.push(parrentrecurseidcurent.transform.baseVal[0].matrix)
|
||
//arr.push(parrentrecurseidcurent.transform.baseVal[0].matrix)
|
||
}
|
||
} else if (transArr.length > 0) {
|
||
// } else if (transformForTranslate != null) {
|
||
let currentParent
|
||
let parentUse
|
||
transArr.forEach(elem => {
|
||
const arrTemp = []
|
||
if (currentParent == null) {
|
||
currentParent = elem
|
||
}
|
||
|
||
while (currentParent.tagName != 'svg') {
|
||
parentUse = currentParent.parentElement
|
||
currentParent = parentUse
|
||
// logger(hotspots[i]);
|
||
// logger('currentParent',currentParent.transform.baseVal[0]);
|
||
if (currentParent.transform != undefined) {
|
||
if (currentParent.transform.baseVal[0] != undefined) {
|
||
//parrentreciursematrix.push(currentParent.transform.baseVal[0].matrix)
|
||
arrTemp.push(currentParent.transform.baseVal[0].matrix)
|
||
}
|
||
}
|
||
}
|
||
// logger(hotspots[i]);
|
||
// logger(elem.transform.baseVal[0]);
|
||
//parrentreciursematrix.push(elem.transform.baseVal[0].matrix)
|
||
arrTemp.push(elem.transform.baseVal[0].matrix)
|
||
trans = true
|
||
if (uses[n] != undefined) {
|
||
if (uses[n].getAttribute('transform').indexOf('matrix') != -1) {
|
||
mat = true
|
||
}
|
||
}
|
||
currentParent = null
|
||
arr.push(arrTemp)
|
||
})
|
||
// logger(arr);
|
||
}
|
||
}
|
||
parrentrecurseidcurent = parrentrecurseidcurentwh;
|
||
parrentrecurseid = parrentrecurseidwh;
|
||
//logger('parrentrecurseidcurent',parrentrecurseidcurent);
|
||
}
|
||
// console.log(hotspots[i]);
|
||
// console.log('parrentreciursematrix', parrentreciursematrix);
|
||
|
||
let firstX
|
||
let firstY
|
||
let firstFont
|
||
let currentHot
|
||
|
||
let resultmatrixmp
|
||
|
||
// logger(hotspots[i]);
|
||
// //console.log('parrentreciursematrix', parrentreciursematrix);
|
||
// logger('arr', arr);
|
||
|
||
if (parrentreciursematrix.length != 0) {
|
||
if (parrentreciursematrix.length == 1 && !trans) {
|
||
resultmatrixmp = parrentreciursematrix[0]
|
||
var parenttransformx = 0;
|
||
var parenttransformy = 0;
|
||
var parenttransformsx = 1;
|
||
var parenttransformsy = 1;
|
||
|
||
if (resultmatrixmp != null) {
|
||
parenttransformx = resultmatrixmp.e;
|
||
parenttransformy = resultmatrixmp.f;
|
||
parenttransformsx = resultmatrixmp.a;
|
||
parenttransformsy = resultmatrixmp.d;
|
||
}
|
||
|
||
let origgx
|
||
let origgy
|
||
|
||
if (hotspots[i].getAttribute('x') != null && hotspots[i].getAttribute('y') != null) {
|
||
origgx = parseFloat(hotspots[i].getAttribute('x'));
|
||
origgy = parseFloat(hotspots[i].getAttribute('y'));
|
||
} else {
|
||
try {
|
||
origgx = hotspots[i].querySelector('tspan').getAttribute('x')
|
||
origgy = hotspots[i].querySelector('tspan').getAttribute('y')
|
||
} catch (error) {
|
||
|
||
}
|
||
}
|
||
if (isMatrix && parrentreciursematrix.length > 1) {
|
||
hotspots[i].setAttribute('x', (origgx * parenttransformsx));
|
||
hotspots[i].setAttribute('y', (origgy * parenttransformsy));
|
||
} else {
|
||
if (!mat) {
|
||
// //console.log(parenttransformy + origgy * parenttransformsy);
|
||
hotspots[i].setAttribute('y', (parenttransformy + origgy * parenttransformsy));
|
||
} else {
|
||
hotspots[i].setAttribute('y', (parenttransformy + origgy * parenttransformsy));
|
||
}
|
||
hotspots[i].setAttribute('x', (parenttransformx + origgx * parenttransformsx))
|
||
}
|
||
|
||
// //console.log(origgy);
|
||
// //console.log(origgx);
|
||
|
||
var fontsized = parseFloat(hotspots[i].getAttribute('font-size'));
|
||
hotspots[i].setAttribute('font-size', fontsized * parenttransformsx + 'px')
|
||
|
||
hotspotArrToPlayer.push(hotspots[i].outerHTML);
|
||
} else if (parrentreciursematrix.length > 1 || trans) {
|
||
resultmatrixmp = parrentreciursematrix.reduce(function (sum, current) {
|
||
return sum.multiply(current)
|
||
})
|
||
console.log('resultmatrixmp', resultmatrixmp);
|
||
var origgx = parseFloat(hotspots[i].getAttribute('x'));
|
||
var origgy = parseFloat(hotspots[i].getAttribute('y'));
|
||
var fontsized = parseFloat(hotspots[i].getAttribute('font-size'));
|
||
|
||
// //console.log(origgy);
|
||
// //console.log(origgx);
|
||
|
||
var parenttransformx = 0;
|
||
var parenttransformy = 0;
|
||
var parenttransformsx = 1;
|
||
var parenttransformsy = 1;
|
||
|
||
if (resultmatrixmp != null) {
|
||
parenttransformx = resultmatrixmp.e;
|
||
parenttransformy = resultmatrixmp.f;
|
||
parenttransformsx = resultmatrixmp.a;
|
||
parenttransformsy = resultmatrixmp.d;
|
||
}
|
||
|
||
// console.log(origgx);
|
||
// console.log(origgy);
|
||
|
||
if (isMatrix && parrentreciursematrix.length > 1) {
|
||
hotspots[i].setAttribute('x', (origgx * parenttransformsx));
|
||
hotspots[i].setAttribute('y', (origgy * parenttransformsy));
|
||
} else {
|
||
if (!mat) {
|
||
hotspots[i].setAttribute('y', (parenttransformy + origgy * parenttransformsy));
|
||
} else {
|
||
hotspots[i].setAttribute('y', (parenttransformy + origgy * parenttransformsy));
|
||
}
|
||
hotspots[i].setAttribute('x', (parenttransformx + origgx * parenttransformsx))
|
||
}
|
||
|
||
hotspots[i].setAttribute('font-size', fontsized * parenttransformsx + 'px')
|
||
hotspotArrToPlayer.push(hotspots[i].outerHTML);
|
||
|
||
}
|
||
} else if (arr.length > 0) {
|
||
arr.forEach(array => {
|
||
if (array.length == 1 && !trans) {
|
||
resultmatrixmp = array[0]
|
||
var parenttransformx = 0;
|
||
var parenttransformy = 0;
|
||
var parenttransformsx = 1;
|
||
var parenttransformsy = 1;
|
||
|
||
if (resultmatrixmp != null) {
|
||
parenttransformx = resultmatrixmp.e;
|
||
parenttransformy = resultmatrixmp.f;
|
||
parenttransformsx = resultmatrixmp.a;
|
||
parenttransformsy = resultmatrixmp.d;
|
||
}
|
||
|
||
var origgx = parseFloat(hotspots[i].getAttribute('x'));
|
||
var origgy = parseFloat(hotspots[i].getAttribute('y'));
|
||
if (isMatrix && array.length > 1) {
|
||
hotspots[i].setAttribute('x', (origgx * parenttransformsx));
|
||
hotspots[i].setAttribute('y', (origgy * parenttransformsy));
|
||
} else {
|
||
if (!mat) {
|
||
hotspots[i].setAttribute('y', (parenttransformy + origgy * parenttransformsy));
|
||
} else {
|
||
hotspots[i].setAttribute('y', (parenttransformy + origgy * parenttransformsy));
|
||
}
|
||
hotspots[i].setAttribute('x', (parenttransformx + origgx * parenttransformsx))
|
||
}
|
||
|
||
// //console.log(origgy);
|
||
// //console.log(origgx);
|
||
|
||
var fontsized = parseFloat(hotspots[i].getAttribute('font-size'));
|
||
hotspots[i].setAttribute('font-size', fontsized * parenttransformsx + 'px')
|
||
|
||
hotspotArrToPlayer.push(hotspots[i].outerHTML);
|
||
} else if (array.length > 1 || trans && array.length != 0) {
|
||
|
||
resultmatrixmp = array.reduce(function (sum, current) {
|
||
return sum.multiply(current)
|
||
})
|
||
// console.log('resultmatrixmp',resultmatrixmp);
|
||
var origgx = parseFloat(hotspots[i].getAttribute('x'));
|
||
var origgy = parseFloat(hotspots[i].getAttribute('y'));
|
||
var fontsized = parseFloat(hotspots[i].getAttribute('font-size'));
|
||
|
||
// //console.log(origgy);
|
||
// //console.log(origgx);
|
||
|
||
if (currentHot == undefined) {
|
||
currentHot = hotspots[i]
|
||
firstX = parseFloat(hotspots[i].getAttribute('x'));
|
||
firstY = parseFloat(hotspots[i].getAttribute('y'));
|
||
firstFont = parseFloat(hotspots[i].getAttribute('font-size'));
|
||
}
|
||
|
||
if (currentHot == hotspots[i] && arr.length > 1) {
|
||
origgx = firstX
|
||
origgy = firstY
|
||
fontsized = firstFont
|
||
}
|
||
|
||
var parenttransformx = 0;
|
||
var parenttransformy = 0;
|
||
var parenttransformsx = 1;
|
||
var parenttransformsy = 1;
|
||
|
||
if (resultmatrixmp != null) {
|
||
parenttransformx = resultmatrixmp.e;
|
||
parenttransformy = resultmatrixmp.f;
|
||
parenttransformsx = resultmatrixmp.a;
|
||
parenttransformsy = resultmatrixmp.d;
|
||
}
|
||
|
||
if (isMatrix && array.length > 1) {
|
||
hotspots[i].setAttribute('x', (origgx * parenttransformsx));
|
||
hotspots[i].setAttribute('y', (origgy * parenttransformsy));
|
||
} else {
|
||
if (!mat) {
|
||
hotspots[i].setAttribute('y', (parenttransformy + origgy * parenttransformsy));
|
||
} else {
|
||
hotspots[i].setAttribute('y', (parenttransformy + origgy * parenttransformsy));
|
||
}
|
||
hotspots[i].setAttribute('x', (parenttransformx + origgx * parenttransformsx))
|
||
}
|
||
|
||
hotspots[i].setAttribute('font-size', fontsized * parenttransformsx + 'px')
|
||
// logger(hotspots[i])
|
||
// logger(hotspots[i].getAttribute('font-size'))
|
||
// //console.log(hotspots[i]);
|
||
// //console.log(hotspots[i].getAttribute('x'));
|
||
// //console.log(hotspots[i].getAttribute('y'));
|
||
hotspotArrToPlayer.push(hotspots[i].outerHTML);
|
||
}
|
||
})
|
||
} else if (hotspots[i].getAttribute('cx') != undefined && hotspots[i].getAttribute('cy') != undefined) {
|
||
// console.log(hotspots[i].getAttribute('cx'));
|
||
hotspots[i].setAttribute('x', (hotspots[i].getAttribute('cx')));
|
||
hotspots[i].setAttribute('y', (hotspots[i].getAttribute('cy')));
|
||
console.log('here');
|
||
hotspotArrToPlayer.push(hotspots[i].outerHTML);
|
||
} else {
|
||
|
||
if (hotspots[i].parentElement.tagName != 'symbol') {
|
||
|
||
var origgx = parseFloat(hotspots[i].getAttribute('x'));
|
||
var origgy = parseFloat(hotspots[i].getAttribute('y'));
|
||
var fontsized = parseFloat(hotspots[i].getAttribute('font-size'));
|
||
|
||
// //console.log('------------');
|
||
// //console.log(origgy);
|
||
// //console.log(origgx);
|
||
|
||
hotspots[i].setAttribute('x', (origgx));
|
||
hotspots[i].setAttribute('y', (origgy));
|
||
hotspots[i].setAttribute('font-size', fontsized + 'px')
|
||
hotspotArrToPlayer.push(hotspots[i].outerHTML);
|
||
}
|
||
}
|
||
console.log('x',hotspots[i].getAttribute('x'));
|
||
console.log('y',hotspots[i].getAttribute('y'));
|
||
}
|
||
// console.log(origgy);
|
||
// console.log(origgx);
|
||
// //console.log($(hotspotArray));
|
||
|
||
if (hotspotArrToPlayer.length > $(hotspotArray).length) {
|
||
const hotspotIDs = [];
|
||
for (let i = 0; i < hotspotArrToPlayer.length; i++) {
|
||
let substrI = hotspotArrToPlayer[i].substring(hotspotArrToPlayer[i].indexOf('id="') + 4)
|
||
let currentI = substrI.substring(0, substrI.indexOf('"'))
|
||
if (currentI != undefined && currentI != '') {
|
||
hotspotIDs.push(currentI);
|
||
}
|
||
}
|
||
// logger(hotspotIDs);
|
||
if (hotspotIDs.length > 0) {
|
||
if ($(thisElement).find('.imagePlayer').length < 1) {
|
||
let ready = undefined;
|
||
$(thisElement).imagePlayer({
|
||
viewType: 'inline',
|
||
url: urnP,
|
||
legend: hotspotArrToPlayer,
|
||
legendSpots: Array(hotspotArrToPlayer.length).fill({ todraw: false }),
|
||
type: 'vector',
|
||
viewBox: 'viewBox="' + viewBox + '"',
|
||
ready: ready,
|
||
});
|
||
}
|
||
//logger(hotspotArrToPlayer);
|
||
}
|
||
} else if (hotspotArray.length > 0) {
|
||
// logger('hotspotArray', hotspotArray);
|
||
var hotspotIDs = [];
|
||
for (var i = 0; i < $(hotspotArray).length; i++) {
|
||
if ($($(hotspotArray)[i]).attr('applicationstructureident') != undefined && $($(hotspotArray)[i]).attr('applicationstructureident') != '') {
|
||
hotspotIDs.push($($(hotspotArray)[i]).attr('applicationstructureident'));
|
||
}
|
||
}
|
||
// logger('hotspotIDs.length');
|
||
// logger('hotspotIDs', hotspotIDs);
|
||
if (hotspotIDs.length > 0) {
|
||
hotspotIDs = JSON.stringify(hotspotIDs);
|
||
|
||
if ($(thisElement).find('.imagePlayer').length < 1) {
|
||
|
||
var ready = undefined;
|
||
|
||
logger('ready function', thisElement.height());
|
||
|
||
$(thisElement).imagePlayer({
|
||
viewType: 'inline',
|
||
url: urnP,
|
||
legend: hotspotArrToPlayer,
|
||
legendSpots: Array(hotspotArray.length).fill({ todraw: false }),
|
||
type: 'vector',
|
||
viewBox: 'viewBox="' + viewBox + '"',
|
||
ready: ready,
|
||
});
|
||
}
|
||
}
|
||
else {
|
||
// hotspotIDs = [];
|
||
// //logger('IN ELSE!');
|
||
// for (var i = 0; i < $(hotspotArray).length; i++) {
|
||
// /*if($($(hotspotArray)[i]).attr('applicationstructureident') != undefined
|
||
// && $($(hotspotArray)[i]).attr('applicationstructureident') != ''){
|
||
// hotspotIDs.push($($(hotspotArray)[i]).attr('applicationstructureident'));
|
||
// }*/
|
||
// if($($(hotspotArray)[i]).attr('objectcoordinates') != undefined && $($(hotspotArray)[i]).attr('objectcoordinates') != ''){
|
||
// var coords = $($(hotspotArray)[i]).attr('objectcoordinates');
|
||
// coords = coords.split(',');
|
||
// var outObj = {
|
||
// coords: coords,
|
||
// hotspottitle: $($(hotspotArray)[i]).attr('hotspottitle'),
|
||
// id: $($(hotspotArray)[i]).attr('id'),
|
||
// applicationstructurename: $($(hotspotArray)[i]).attr('applicationstructurename'),
|
||
// };
|
||
|
||
// hotspotIDs.push(outObj);
|
||
// }
|
||
// }
|
||
}
|
||
}
|
||
else {
|
||
//здесь для случая, если хотов нет
|
||
if ($(thisElement).find('.imagePlayer').length < 1) {
|
||
$(thisElement).imagePlayer({
|
||
viewType: 'inline',
|
||
url: urnP,
|
||
legend: false,
|
||
legendSpots: [],
|
||
type: 'vector',
|
||
viewBox: 'viewBox="' + viewBox + '"',
|
||
});
|
||
}
|
||
}
|
||
|
||
|
||
|
||
}
|
||
function learnResult() {
|
||
|
||
doSetValue("cmi.completion_status", "completed");
|
||
doSetValue("cmi.exit", "suspend");
|
||
doTerminate();
|
||
}
|
||
|
||
function includeHTML() {
|
||
var z, i, elmnt, file, xhttp;
|
||
/* Loop through a collection of all HTML elements: */
|
||
z = document.getElementsByTagName("*");
|
||
for (i = 0; i < z.length; i++) {
|
||
elmnt = z[i];
|
||
/*search for elements with a certain atrribute:*/
|
||
file = elmnt.getAttribute("w3-include-html");
|
||
if (file) {
|
||
/* Make an HTTP request using the attribute value as the file name: */
|
||
xhttp = new XMLHttpRequest();
|
||
xhttp.onreadystatechange = function () {
|
||
if (this.readyState == 4) {
|
||
if (this.status == 200) { elmnt.innerHTML = this.responseText; }
|
||
if (this.status == 404) { elmnt.innerHTML = "Page not found."; }
|
||
/* Remove the attribute, and call this function once more: */
|
||
elmnt.removeAttribute("w3-include-html");
|
||
setupContents();
|
||
includeHTML();
|
||
}
|
||
}
|
||
xhttp.open("GET", file, true);
|
||
xhttp.send();
|
||
/* Exit the function: */
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
|
||
$(".toPrint").click(function () {
|
||
//var printContents = document.getElementById('container').innerHTML;
|
||
var newTab = window.open('', '');
|
||
var printContents = $('.S1000D_root').html();
|
||
var printContents2;
|
||
printContents2 = printContents;
|
||
newTab.document.write('<head><meta charset="utf-8" /><title>' + lalbleforprint + '</title><meta name="description" content="' + lalbleforprint + '" /><meta name="author" content="SitePoint" /><link href="app/css/gutenberg.css" rel="stylesheet" /><link rel="stylesheet" href="app/css/fonts.css" /><link rel="stylesheet" href="app/css/animate.css" /><link rel="stylesheet" href="app/css/print.css" /><link rel="stylesheet" href="app/css/styles.css" /></head><body><center><button type=button onclick=window.close(); style="color: red; border: 2px solid black; cursor: pointer;" class="no-print2">' + labelcloseprint + '</button></center>' + printContents2 + '</body>');
|
||
//document.head.innerHTML = ('<head><meta charset="utf-8" /><title>Версия для печати</title><meta name="description" content="Версия для печати" /><meta name="author" content="SitePoint" /><link href="app/css/gutenberg.css" rel="stylesheet" /><link rel="stylesheet" href="app/css/fonts.css" /><link rel="stylesheet" href="app/css/animate.css" /><link rel="stylesheet" href="app/css/print.css" /><link rel="stylesheet" href="app/css/styles.css" /></head>')
|
||
//document.body.innerHTML = ('<center><button type=button onclick=location.reload(); style="color: red; border: 2px solid black; cursor: pointer;" >Выход из режима печати</button></center>'+printContents2);
|
||
//window.print();
|
||
//location.reload();
|
||
//document.body.innerHTML = originalContents;
|
||
/* newTab.onafterprint = function() {
|
||
window.close();
|
||
}; */
|
||
}
|
||
);
|