AppScreen.prototype.init = function( p_container ) { var scope = this; var showCallBack = function(e){ scope.visible.apply(scope, [true]); // Permet de récupérer l'url pour télécharger // la publication PublishPaper Library var str = window.location.href; var ind = str.indexOf("html5"); var begin = str.indexOf("://"); var res = "publishpaper"; for (i = begin; i < ind; i++) { res += str[i]; } res += "application.zip"; var ind = str.indexOf("html5"); var res1 = ""; for (i = 0; i < ind; i++) { res1 += str[i]; } res1 += "application.zip"; var descd = document.getElementsByClassName("desc")[0]; // Recherche la présence ou non de la publication sur PublishPaper // Affiche le menu adequate $.ajax({ url: res1, //or your url success: function(data){ document.getElementsByClassName("descContent")[0].innerHTML = "Cette publication n'est pas disponible en téléchargement pour une lecture sur PublishPaper Library"; document.getElementsByClassName("descContent")[0].style.paddingTop = "100px"; document.getElementsByClassName("descContent")[0].style.fontSize = "1.0em"; document.getElementsByClassName("option1")[0].remove(); document.getElementsByClassName("option2")[0].remove(); document.getElementById("dmenu").remove(); descd.getElementsByTagName("img")[0].style.display = "none"; descd.style.display = "block"; }, error: function(data){ descd.style.display = "block"; document.getElementById("downloadApp").setAttribute('href', res); }, }) }; //if( isMobile.iOS() ){ var image = document.createElement("img"); image.setAttribute("src","resources/img/ui/app.png"); image.style.width = "80%"; image.style.height = "80%"; image.setAttribute("padding-top", "0"); //} var hideCallBack = function(e){scope.visible.apply(scope, [false]);}; this.signal = new Signal(); this._button = document.getElementById("appButton"); //if( isMobile.iOS() ){ this._button.appendChild(image); this._button = this._button.getElementsByTagName("img")[0]; //} this._popup = document.getElementById("appPopup"); this._container = this._popup.getElementsByClassName("content")[0]; this._close = this._popup.getElementsByClassName("btnClose")[0]; this._button.onclick = showCallBack; this._close.onclick = hideCallBack; this._popup.style.left = ( ( Utils.getInnerWidth() - 520 ) * 0.5 ) + 'px'; this._popup.addEventListener("touchmove", this.cancelHandler ); this._initGestureHandler(); }; //END FUNCTION AppScreen.prototype.onDoubleTap = function(event) { event.preventDefault(); event.stopPropagation(); }; //END FUNCTION AppScreen.prototype._initGestureHandler = function() { var scope = this; var callBackDoubleTap = function(event){ scope.onDoubleTap.apply( scope, [event] ); }; this._gesture = new GestureHandler(); this._gesture.onDoubleTap = callBackDoubleTap; this._gesture.listen(this._container); }; //END FUNCTION AppScreen.prototype.cancelHandler = function(event) { event.preventDefault(); event.stopPropagation(); }; //END FUNCTION AppScreen.prototype.visible = function( value ) { closeOther(this._popup); if(this._popup.style.display == "block") this._popup.style.display = 'none'; else this._popup.style.display = ( value == true ) ? "block" : "none"; }; //END FUNCTION AppScreen.prototype.resize = function() { this._popup.style.top = parseInt( ( Utils.getInnerHeight() - 400 ) * 0.5 )+"px"; this._popup.style.left = ( ( Utils.getInnerWidth() - 520 ) * 0.5 ) + 'px'; }; //END FUNCTION
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question