Neue und erweiterte Plugins für CMSimple_XH ab 1.7

Ein CMSimple Support Forum für deutsch sprechende Nutzer und Entwickler
7sleeper
Posts: 21
Joined: Fri Sep 24, 2010 12:11 pm

Re: Neue und erweiterte Plugins für CMSimple_XH ab 1.7

Post by 7sleeper » Fri Feb 08, 2019 4:03 pm

cmb wrote:
Fri Feb 08, 2019 3:49 pm
Weiß nicht, woher lightbox.js stammt, aber die Variante von Lokesh Dhakar scheint es nicht zu sein.
Nein, denk ich auch. Ich wollte damit eigentlich nur ausschließen, dass der Upload selbst die Ursache ist. Also das mit allen (ähnlichen) Dateien dann sowas in der Art passiert. Tut es scheinbar nicht... ergo müsste doch etwas auf dem Server die Datei verändern?! Oder sie sich selbst?? Das hat schon irgendwie was Paranormales :shock:

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Neue und erweiterte Plugins für CMSimple_XH ab 1.7

Post by cmb » Fri Feb 08, 2019 4:47 pm

7sleeper wrote:
Fri Feb 08, 2019 4:03 pm
ergo müsste doch etwas auf dem Server die Datei verändern?! Oder sie sich selbst?? Das hat schon irgendwie was Paranormales :shock:
Ich könnte mir schon vorstellen, dass ein FTP-Client oder -Server JavaScript-Dateien automatisch minifiziert, aber gehört habe ich noch nicht davon. Du kannst den Inhalt der „komprimierte“ Datei ja mal hier posten.
Christoph M. Becker – Plugins for CMSimple_XH

7sleeper
Posts: 21
Joined: Fri Sep 24, 2010 12:11 pm

Re: Neue und erweiterte Plugins für CMSimple_XH ab 1.7

Post by 7sleeper » Fri Feb 08, 2019 5:03 pm

Also ich nutze Filezilla und selbst wenn es diesen Automatismus gäbe würden ja alle js-Dateien beim Upload komprimiert...

So sieht die Datei nach dem Up- und Download aus:

Code: Select all

(function($) {	/**	 * $ is an alias to jQuery object	 *	 */	$.fn.lightBox = function(settings) {		// Settings to configure the jQuery lightBox plugin how you like		settings = jQuery.extend({			// Configuration related to overlay			overlayBgColor: 		'#000',		// (string) Background color to overlay; inform a hexadecimal value like: #RRGGBB. Where RR, GG, and BB are the hexadecimal values for the red, green, and blue values of the color.			overlayOpacity:			0.5,		// (integer) Opacity value to overlay; inform: 0.X. Where X are number from 0 to 9			// Configuration related to navigation			fixedNavigation:		false,		// (boolean) Boolean that informs if the navigation (next and prev button) will be fixed or not in the interface.			// Configuration related to images			imageLoading:			myglobal.path+'lightbox-ico-loading.gif',		// (string) Path and the name of the loading icon			imageBtnPrev:			myglobal.path+'lightbox-btn-prev.gif',			// (string) Path and the name of the prev button image			imageBtnNext:			myglobal.path+'lightbox-btn-next.gif',			// (string) Path and the name of the next button image			imageBtnClose:			myglobal.path+'lightbox-btn-close.gif',		// (string) Path and the name of the close btn			imageBlank:				myglobal.path+'lightbox-blank.gif',			// (string) Path and the name of a blank image (one pixel)			// Configuration related to container image box			containerBorderSize:	10,			// (integer) If you adjust the padding in the CSS for the container, #lightbox-container-image-box, you will need to update this value			containerResizeSpeed:	400,		// (integer) Specify the resize duration of container image. These number are miliseconds. 400 is default.			// Configuration related to texts in caption. For example: Image 2 of 8. You can alter either "Image" and "of" texts.			txtImage:				'Image',	// (string) Specify text "Image"			txtOf:					'of',		// (string) Specify text "of"			// Configuration related to keyboard navigation			keyToClose:				'c',		// (string) (c = close) Letter to close the jQuery lightBox interface. Beyond this letter, the letter X and the SCAPE key is used to.			keyToPrev:				'p',		// (string) (p = previous) Letter to show the previous image			keyToNext:				'n',		// (string) (n = next) Letter to show the next image.			// Don´t alter these variables in any way			imageArray:				[],			//enableKey:				false,			hoverClass:				false,			activeImage:			0		},settings);		var jQueryMatchedObj = this; // This, in this context, refer to jQuery object		/**		 * Initializing the plugin calling the start function		 *		 * @return boolean false		 */		function _initialize() {			myglobal.enableKey = false;      $('body').addClass('stop-scrolling');			//txt.innerHTML = $(this).parent().parent().hasClass("flip-current")+' - '+$(this).parent().parent().attr('class')+' - '+this.id+' - '+settings.hoverClass+' - '+this.title;			_start(this,jQueryMatchedObj);// This, in this context, refer to object (link) which the user have clicked			return false; // Avoid the browser following the link		}		/**		 * Start the jQuery lightBox plugin		 *		 * @param object objClicked The object (link) whick the user have clicked		 * @param object jQueryMatchedObj The jQuery object with all elements matched		 */		function _start(objClicked,jQueryMatchedObj) {			// Hime some elements to avoid conflict with overlay in IE. These elements appear above the overlay.			$('embed, object, select').css({ 'visibility' : 'hidden' });			// Call the function to create the markup structure; style some elements; assign events in some elements.						// Unset total images in imageArray			settings.imageArray.length = 0;			// Unset image active information			settings.activeImage = 0;			if ( jQueryMatchedObj.length == 1 ) {				settings.imageArray.push(new Array(objClicked.getAttribute('href'),objClicked.getAttribute('title'),objClicked.getAttribute('alt')));			} else {				var clickID = objClicked.getAttribute('id');				for ( var i = 0; i < jQueryMatchedObj.length; i++ ) {					var objID = jQueryMatchedObj[i].getAttribute('id');					//txt.innerHTML += clickID+' - '+objID+' | ';					if (clickID == objID) settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'),jQueryMatchedObj[i].getAttribute('title'),jQueryMatchedObj[i].getAttribute('alt')));				}			}			while (settings.imageArray[settings.activeImage][0] != objClicked.getAttribute('href')) {				settings.activeImage++;			}			var erw = settings.imageArray[settings.activeImage][0].substr(settings.imageArray[settings.activeImage][0].lastIndexOf('.')+1).toLowerCase();			_set_interface(settings.imageArray[settings.activeImage][0],erw);			// Call the function that prepares image exibition			_set_image_to_view(settings.activeImage,true);		}		/**		 * Create the jQuery lightBox plugin interface		 *		 * The HTML markup will be like that:			<div id="jquery-overlay"></div>			<div id="jquery-lightbox">				<div id="lightbox-container-image-box">					<div id="lightbox-container-image">						<img src="../fotos/XX.jpg" id="lightbox-image">						<div id="lightbox-nav">							<a href="#" id="lightbox-nav-btnPrev"></a>							<a href="#" id="lightbox-nav-btnNext"></a>						</div>						<div id="lightbox-loading">							<a href="#" id="lightbox-loading-link">								<img src="../images/lightbox-ico-loading.gif">							</a>						</div>					</div>				</div>				<div id="lightbox-container-image-data-box">					<div id="lightbox-container-image-data">						<div id="lightbox-image-details">							<span id="lightbox-image-details-caption"></span>							<span id="lightbox-image-details-currentNumber"></span>						</div>						<div id="lightbox-secNav">							<a href="#" id="lightbox-secNav-btnClose">								<img src="../images/lightbox-btn-close.gif">							</a>						</div>					</div>				</div>			</div>		 *		 */		function _set_interface(pic,erw) {			//var erw = pic.substr(pic.lastIndexOf('.')+1).toLowerCase();			// Apply the HTML markup into body tag			$('body').append('<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="lightbox-container-image-box"><div id="lightbox-container-image">'+_createEmbedObject(pic,erw)+'<div id="lightbox-container-image-data-box"><div id="lightbox-container-image-data"><div id="lightbox-image-details"><span id="lightbox-image-details-caption"></span><span id="lightbox-image-details-currentNumber"></span></div><div id="lightbox-secNav"><a href="#" id="lightbox-secNav-btnClose"><img src="' + settings.imageBtnClose + '"></a></div></div></div></div>');			// Get page sizes			var arrPageSizes = ___getPageSize();			// Style overlay and show it			$('#jquery-overlay').css({				backgroundColor:	settings.overlayBgColor,				opacity:			settings.overlayOpacity,				width:				arrPageSizes[0],				height:				arrPageSizes[1]			}).fadeIn();			// Get page scroll			var arrPageScroll = ___getPageScroll();			// Calculate top and left offset for the jquery-lightbox div object and show it			$('#jquery-lightbox').css({				top:	arrPageScroll[1] + (arrPageSizes[3] / 15),				left:	arrPageScroll[0]			}).show();			var fixFlash = false;			$('#lightbox-container-image-box').mouseenter(function() {				fixFlash = true;			}).mouseleave(function() {				fixFlash = false;			});			// Assigning click events in elements to close overlay			$('#jquery-overlay,#jquery-lightbox').click(function() {				if (!fixFlash) _finish();			});			// Assign the _finish function to lightbox-loading-link and lightbox-secNav-btnClose objects			$('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function() {				_finish();				return false;			});			// If window was resized, calculate the new overlay dimensions			$(window).resize(function() {				// Get page sizes				var arrPageSizes = ___getPageSize();				// Style overlay and show it				$('#jquery-overlay').css({					width:		arrPageSizes[0],					height:		arrPageSizes[1]				});				// Get page scroll				var arrPageScroll = ___getPageScroll();				// Calculate top and left offset for the jquery-lightbox div object and show it				$('#jquery-lightbox').css({					top:	arrPageScroll[1] + (arrPageSizes[3] / 10),					left:	arrPageScroll[0]				});			});		}		// Prepares image exibition; doing a image´s preloader to calculate it´s size		// show the loading		function _set_image_to_view(actID,ft) {			var erw = settings.imageArray[actID][0].substr(settings.imageArray[actID][0].lastIndexOf('.')+1).toLowerCase();			//_set_interface(settings.imageArray[actID][0],erw);			settings.activeImage = actID;			if (!ft) $('#lightbox-container-image').html(_createEmbedObject(settings.imageArray[actID][0],erw));//txt.innerHTML = actID+' - '+ft+' - '+settings.imageArray[settings.activeImage][0]+' - '+erw;			$('#lightbox-loading').show(); // Show the loading			if ( settings.fixedNavigation ) {				$('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();			} else {				// Hide some elements				$('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();			}			// Image preload process			var pageSizes = ___getPageSize();			if (erw == 'jpg' || erw == 'jpeg' || erw == 'png' || erw == 'gif') {				var objImagePreloader = new Image();				objImagePreloader.onload = function() {					$('#lightbox-image').attr('src',settings.imageArray[actID][0]);					// Perfomance an effect in the image container resizing it//txt.innerHTML += ' - '+pageSizes;					var scal = (objImagePreloader.width/objImagePreloader.height > pageSizes[2]/pageSizes[3]) ? pageSizes[2]*100/objImagePreloader.width/1.3 : scal = pageSizes[3]*100/objImagePreloader.height/1.3;					var imgW = Math.round(objImagePreloader.width*scal/100);					var imgH = Math.round(objImagePreloader.height*scal/100);					$('#lightbox-image').css({width: imgW, height: imgH});					_resize_container_image_box(imgW,imgH);					//	clear onLoad, IE behaves irratically with animated gifs otherwise					objImagePreloader.onload=function(){};				};				objImagePreloader.src = settings.imageArray[actID][0];			}else if (erw == 'mp3') {				_resize_container_image_box(320,70);				$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({position: 'absolute'});				$('#lightbox-nav-btnPrev').css({left: -60});				$('#lightbox-nav-btnNext').css({right: -60});			}else if (erw == 'flv' || erw == 'f4v' || erw == 'mp4') {				$('#lightbox-nav').css({'z-index': -1});				_resize_container_image_box(pageSizes[2]/1.3,pageSizes[2]/1.3/1.7);				$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({position: 'absolute'});				$('#lightbox-nav-btnPrev').css({left: -60});				$('#lightbox-nav-btnNext').css({right: -60});			}else if (erw == 'htm' || erw == 'html' || erw == 'wmv') {				_resize_container_image_box(pageSizes[2]/1.3,pageSizes[3]/1.3+20);				$('#lightbox-nav').css({'z-index': -1});				$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({position: 'absolute', width: '70px'});				$('#lightbox-nav-btnPrev').css({left: -60});				$('#lightbox-nav-btnNext').css({right: -60});			}else{				_resize_container_image_box(pageSizes[2]/1.3,pageSizes[3]/1.3+20);				$('#lightbox-nav').css({'z-index': -1});				$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({position: 'absolute'});				$('#lightbox-nav-btnPrev').css({left: -60});				$('#lightbox-nav-btnNext').css({right: -60});			}		};		// Perfomance an effect in the image container resizing it		// @param integer intImageWidth The image´s width that will be showed		// @param integer intImageHeight The image´s height that will be showed		function _resize_container_image_box(intImageWidth,intImageHeight) {			// Get current width and height			var intCurrentWidth = $('#lightbox-container-image-box').width();			var intCurrentHeight = $('#lightbox-container-image-box').height();			// Get the width and height of the selected image plus the padding			var intWidth = (intImageWidth + (settings.containerBorderSize * 2)); // Plus the image´s width and the left and right padding value			var intHeight = (intImageHeight + (settings.containerBorderSize * 2)); // Plus the image´s height and the left and right padding value			// Diferences			var intDiffW = intCurrentWidth - intWidth;			var intDiffH = intCurrentHeight - intHeight;			// Perfomance the effect			$('#lightbox-container-image-box').animate({ width: intWidth, height: intHeight },settings.containerResizeSpeed,function() { _show_image(); });			if ( ( intDiffW == 0 ) && ( intDiffH == 0 ) ) {				//if ( $.browser.msie ) {					___pause(250);				//} else {				//	___pause(100);				//}			}			$('#lightbox-container-image-data-box').css({ width: intWidth });			$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ height: intImageHeight + (settings.containerBorderSize * 2) });		};		/**		 * Show the prepared image		 *		 */		function _show_image() {			$('#lightbox-loading').hide();			$('#lightbox-image').fadeIn(function() {				_show_image_data();				_set_navigation();			});			_preload_neighbor_images();		};		/**		 * Show the image information		 *		 */		function _show_image_data() {			var info = "";			$('#lightbox-container-image-data-box').slideDown('fast');			$('#lightbox-image-details-caption').hide();			if (settings.imageArray[settings.activeImage][1]) {				if (settings.imageArray[settings.activeImage][2]) info = settings.imageArray[settings.activeImage][2];				$('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]+info).show();			}			// If we have a image set, display 'Image X of X'			if ( settings.imageArray.length > 1 ) {				$('#lightbox-image-details-currentNumber').html(settings.txtImage + ' ' + ( settings.activeImage + 1 ) + ' ' + settings.txtOf + ' ' + settings.imageArray.length).show();			}				}		/**		 * Display the button navigations		 *		 */		function _set_navigation() {			$('#lightbox-nav').show();			// Instead to define this configuration in CSS file, we define here. And it´s need to IE. Just.			$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });						// Show the prev button, if not the first image in set			if ( settings.activeImage != 0 ) {				if ( settings.fixedNavigation ) {					$('#lightbox-nav-btnPrev').css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' })						.unbind()						.bind('click',function() {							//settings.activeImage = settings.activeImage - 1;							_set_image_to_view(settings.activeImage - 1);							return false;						});				} else {					// Show the images button for Next buttons					$('#lightbox-nav-btnPrev').unbind().hover(function() {						$(this).css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' });					},function() {						$(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });					}).show().bind('click',function() {						//settings.activeImage = settings.activeImage - 1;						_set_image_to_view(settings.activeImage - 1);						return false;					});				}			}						// Show the next button, if not the last image in set			if ( settings.activeImage != ( settings.imageArray.length -1 ) ) {				if ( settings.fixedNavigation ) {					$('#lightbox-nav-btnNext').css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' })						.unbind()						.bind('click',function() {							//settings.activeImage = settings.activeImage + 1;							_set_image_to_view(settings.activeImage + 1);							return false;						});				} else {					// Show the images button for Next buttons					$('#lightbox-nav-btnNext').unbind().hover(function() {						$(this).css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' });					},function() {						$(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });					}).show().bind('click',function() {						//settings.activeImage = settings.activeImage + 1;						_set_image_to_view(settings.activeImage + 1);						return false;					});				}			}			// Enable keyboard navigation			if (!myglobal.enableKey) _enable_keyboard_navigation();		}		//Enable a support to keyboard navigation		function _enable_keyboard_navigation() {			myglobal.enableKey = true;			$(document).keydown(function(objEvent) {				_keyboard_action(objEvent);			});		}		//Disable the support to keyboard navigation		function _disable_keyboard_navigation() {			myglobal.enableKey = false;			$(document).unbind();		}		//Perform the keyboard actions		function _keyboard_action(objEvent) {			// To ie			if ( objEvent == null ) {				keycode = event.keyCode;				escapeKey = 27;			// To Mozilla			} else {				keycode = objEvent.keyCode;				escapeKey = objEvent.DOM_VK_ESCAPE;			}			// Get the key in lower case form			key = String.fromCharCode(keycode).toLowerCase();			// Verify the keys to close the ligthBox			if ( ( key == settings.keyToClose ) || ( key == 'x' ) || ( keycode == escapeKey ) ) {				_finish();			}			// Verify the key to show the previous image			if ( ( key == settings.keyToPrev ) || ( keycode == 37 ) ) {				if ( settings.activeImage != 0 ) {					_set_image_to_view(settings.activeImage - 1);				}			}			// Verify the key to show the next image			if ( ( key == settings.keyToNext ) || ( keycode == 39 ) ) {				if ( settings.activeImage != ( settings.imageArray.length - 1 ) ) {					_set_image_to_view(settings.activeImage + 1);				}			}		}		//Preload prev and next images being showed		function _preload_neighbor_images() {			if ( (settings.imageArray.length -1) > settings.activeImage ) {				objNext = new Image();				objNext.src = settings.imageArray[settings.activeImage + 1][0];			}			if ( settings.activeImage > 0 ) {				objPrev = new Image();				objPrev.src = settings.imageArray[settings.activeImage -1][0];			}		}		//Remove jQuery lightBox plugin HTML markup		function _finish() {      $('body').removeClass();			_disable_keyboard_navigation();			//txt.innerHTML += $('#wmvPlayer').length+' - '+$('#lightbox-image object').length;			if ($('#wmvPlayer').length) $('#wmvPlayer').hide();			$('#lightbox-image').remove();			$('#jquery-lightbox').remove();			$('#jquery-overlay').fadeOut(function() { $('#jquery-overlay').remove(); });			// Show some elements to avoid conflict with overlay in IE. These elements appear above the overlay.			$('embed, object, select').css({ 'visibility' : 'visible' });		}		/**		 / THIRD FUNCTION		 * getPageSize() by quirksmode.com		 *		 * @return Array Return an array with page width, height and window width, height		 */		function ___getPageSize() {			var xScroll, yScroll;			if (window.innerHeight && window.scrollMaxY) {				xScroll = window.innerWidth + window.scrollMaxX;				yScroll = window.innerHeight + window.scrollMaxY;			} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac				xScroll = document.body.scrollWidth;				yScroll = document.body.scrollHeight;			} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari				xScroll = document.body.offsetWidth;				yScroll = document.body.offsetHeight;			}			var windowWidth, windowHeight;			if (self.innerHeight) {// all except Explorer				if(document.documentElement.clientWidth){					windowWidth = document.documentElement.clientWidth; 				} else {					windowWidth = self.innerWidth;				}				windowHeight = self.innerHeight;			} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode				windowWidth = document.documentElement.clientWidth;				windowHeight = document.documentElement.clientHeight;			} else if (document.body) { // other Explorers				windowWidth = document.body.clientWidth;				windowHeight = document.body.clientHeight;			}				// for small pages with total height less then height of the viewport			if(yScroll < windowHeight){				pageHeight = windowHeight;			} else { 				pageHeight = yScroll;			}			// for small pages with total width less then width of the viewport			if(xScroll < windowWidth){					pageWidth = xScroll;					} else {				pageWidth = windowWidth;			}			arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);			return arrayPageSize;		};		/**		 / THIRD FUNCTION		 * getPageScroll() by quirksmode.com		 *		 * @return Array Return an array with x,y page scroll values.		 */		function ___getPageScroll() {			var xScroll, yScroll;			if (self.pageYOffset) {				yScroll = self.pageYOffset;				xScroll = self.pageXOffset;			} else if (document.documentElement && document.documentElement.scrollTop) {	 // Explorer 6 Strict				yScroll = document.documentElement.scrollTop;				xScroll = document.documentElement.scrollLeft;			} else if (document.body) {// all other Explorers				yScroll = document.body.scrollTop;				xScroll = document.body.scrollLeft;				}			arrayPageScroll = new Array(xScroll,yScroll);			return arrayPageScroll;		};		 /**		  * Stop the code execution from a escified time in milisecond		  *		  */		 function ___pause(ms) {			var date = new Date(); 			curDate = null;			do { var curDate = new Date(); }			while ( curDate - date < ms);		 };	//createEmbedObject: function(){	function _createEmbedObject(url,type) {//txt.innerHTML += ' - '+$('#lightbox-image object').length;		if ($('#wmvPlayer').length) $('#wmvPlayer').hide();		$('#lightbox-image').empty();		$('#lightbox-image').remove();		var pageSizes = ___getPageSize();		var wobj = pageSizes[2]/1.3;		var hobj = pageSizes[3]/1.3;		if(type == 'jpg' || type == 'jpeg' || type == 'png' || type == 'gif'){			this.str = '<img id="lightbox-image"><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="' + settings.imageLoading + '"></a></div></div></div>';		}		if(type == 'swf'){			this.str = '<div id="lightbox-image">';			this.str += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" '			this.str += 'width="'+wobj+'" ';			this.str += 'height="'+hobj+'" ';			this.str += 'title="FlashBox">';  			this.str += '<param name="movie" value="./'+url+'" />'  			this.str += '<param name="quality" value="high" />';			this.str += '<param name="menu" value="false" />';  			this.str += '<embed src="./'+url+'" ';  			this.str += 'quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" ';  			this.str += 'width="'+wobj+'" ';  			this.str += 'height="'+hobj+'"';			this.str += 'menu="false"';			this.str += '></embed>';			this.str += '</object>';			this.str += '</div><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="' + settings.imageLoading + '"></a></div></div></div>';		}		if(type == 'flv' || type == 'f4v'){			var wflv = pageSizes[2]/1.3;			this.str = '<div id="lightbox-image">';			this.str += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" ';			this.str += 'width="'+wflv+'" ';			this.str += 'height="'+wflv/1.72+'" ';			this.str += 'title="FlashBox">';  			this.str += '<param name="movie" value="'+myglobal.path+'movieplayer.swf" />';  			this.str += '<param name="quality" value="high" />';			this.str += '<param name="allowFullScreen" value="true" />';  			//this.str += '<param name="salign" value="TL" />';  			//this.str += '<param name="scale" value="noScale" />';			//this.str += '<param name="wmode" value="opaque" />';  			this.str += '<param name="FlashVars" value="path=../../'+url+'" />';  			this.str += '<embed src="'+myglobal.path+'movieplayer.swf" ';  			this.str += 'quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" ';  			this.str += 'width="'+wflv+'" ';  			this.str += 'height="'+wflv/1.72+'"';			this.str += 'allowFullScreen="true"';  			//this.str += 'salign="TL" ';  			//this.str += 'scale="noScale" ';			//this.str += 'wmode="opaque" ';  			this.str += 'FlashVars="path=../../'+url+'"';  			this.str += '></embed>';			this.str += '</object>';			this.str += '</div><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="' + settings.imageLoading + '"></a></div></div></div>';		}		if(type == 'mp4'){			var wmp4 = pageSizes[2]/1.3;			this.str = '<div id="lightbox-image">';			//this.str += '<video style="width:100%; height:auto" poster="'+myglobal.path+'movie.jpg" controls preload="metadata">';			this.str += '<video width='+wmp4+' height='+wmp4/1.72+' poster="'+myglobal.path+'movie.jpg" controls preload="metadata">';			this.str += '<source src="./'+url+'" type="video/mp4" />';  			this.str += 'Ihr Browser unterstützt das Objekt nicht!';  			this.str += '</video>';			this.str += '</div><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="' + settings.imageLoading + '"></a></div></div></div>';		}/*		if(type == 'flv' || type == 'f4v'){			var wflv = pageSizes[0]/1.3;			this.str = '<script type="text/javascript" src="swfobject2.js"></script>';			this.str += '<script type="text/javascript">';			this.str += 'var flashvars = {};';			this.str += 'flashvars.path = "'+url+'";';			this.str += 'var params = {};';  			this.str += 'params.menu = "false";';  			this.str += 'params.quality = "high";';  			this.str += 'params.allowfullscreen = "true";';  			this.str += 'var attributes = {};';  			this.str += 'attributes.id = "GLPlayer";';  			this.str += 'attributes.name = "FlashBox";';			this.str += 'swfobject.embedSWF("movieplayer.swf", "lightbox-image", "'+wflv+'", "'+wflv/1.72+'", "10.0.0", "expressInstall.swf", flashvars, params, attributes);';			this.str += 'swfobject.addDomLoadEvent(setFocusOnFlash);';			this.str += 'function setFocusOnFlash() {var fl = document.getElementById("GLPlayer");fl.focus();}';			this.str += '</script>';			this.str += '<div id="lightbox-image"><p>Sie benoetigen einen Flashplayer</p>';			this.str += '</div><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="' + settings.imageLoading + '"></a></div></div></div>';		}*/		if(type == 'mp3'){			this.str = '<div id="lightbox-image">';			this.str += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" '			this.str += 'width="'+320+'" ';			this.str += 'height="'+70+'" ';			this.str += 'title="MultiBoxMedia">';  			this.str += '<param name="movie" value="'+myglobal.path+'mp3player.swf" />';  			this.str += '<param name="quality" value="high" />';  			this.str += '<param name="salign" value="TL" />';  			this.str += '<param name="scale" value="noScale" />';  			this.str += '<param name="FlashVars" value="path=./'+url+'" />';  			this.str += '<embed src="'+myglobal.path+'mp3player.swf" ';  			this.str += 'quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" ';  			this.str += 'width="'+320+'" ';  			this.str += 'height="'+70+'"';  			this.str += 'salign="TL" ';  			this.str += 'scale="noScale" ';  			this.str += 'FlashVars="path=./'+url+'"';  			this.str += '></embed>';			this.str += '</object>';			this.str += '</div><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="' + settings.imageLoading + '"></a></div></div></div>';		}		if(type == 'mov'){			this.str = '<div id="lightbox-image">';			this.str += '<object  type="video/quicktime" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab"';			this.str += ' width="'+wobj+'" height="'+hobj+'">';			this.str += '<param name="src" value="./'+url+'" />';			this.str += '<param name="autoplay" value="true" />';			this.str += '<param name="controller" value="true" />';			this.str += '<param name="scale" value="ASPECT" />';			this.str += '<param name="enablejavascript" value="true" />';			this.str += '<embed src="./'+url+'" autoplay="true" pluginspage="http://www.apple.com/quicktime/download/" width="'+wobj+'" height="'+hobj+'" scale="ASPECT"></embed>';			this.str += '</object>';			this.str += '</div><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="' + settings.imageLoading + '"></a></div></div></div>';		}		if(type == 'wmv'){			this.str = '<div id="lightbox-image">';			//this.str += '<object id="wmvPlayer" type="application/x-oleobject" classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95"';			this.str += '<object id="wmvPlayer" type="application/x-oleobject" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"';			this.str += ' width="'+wobj+'" height="'+hobj+'">';			//this.str += '<param name="filename" value="'+url+'" />';			this.str += '<param name="URL" value="./'+url+'"/>';			this.str += '<param name="wmode" value="opaque">';			this.str += '<param name="Showcontrols" value="true" />';			this.str += '<param name="autoStart" value="true" />';			this.str += '<embed type="application/x-mplayer2" src="./'+url+'" Showcontrols="true" autoStart="true" NAME="MediaPlayer" width="'+wobj+'" height="'+hobj+'"></embed>';			this.str += '</object>';			this.str += '</div><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="' + settings.imageLoading + '"></a></div></div></div>';		}		if(type == 'htm' || type == 'html') {			this.str = '<div id="lightbox-image">';			this.str += '<iframe id="lightbox-iframe" frameborder= 1 scrolling= "auto" src="./'+url+'" width= "'+wobj+'" height= "'+hobj+'">';			this.str += '</iframe>';			this.str += '</div><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="' + settings.imageLoading + '"></a></div></div></div>';		}		if(type == 'real'){			this.str = '<div id="lightbox-image">';			this.str += '<object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA"';			this.str += ' width="'+wobj+'" height="'+hobj+'">';			this.str += '<param name="src" value="./'+url+'" />';			this.str += '<param name="controls" value="ImageWindow" />';			this.str += '<param name="autostart" value="true" />';			this.str += '<embed src="./'+url+'" controls="ImageWindow" autostart="true" width="'+wobj+'" height="'+hobj+'"></embed>';			this.str += '</object>';			this.str += '</div><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="' + settings.imageLoading + '"></a></div></div></div>';		}		return this.str;	};// Return the jQuery object for chaining. The unbind method is used to avoid click conflict when the plugin is called more than once		return this.unbind('click').click(_initialize);	};})(jQuery);
Mir scheint es so als ob die Kommentare nicht richtig erkannt werden. Irgendwo beginnt ein // und schließt mit einem http:// . Wenn man den Code im Editor betrachtet erkennt man es durch die Einfärbung ganz gut.

frase
Posts: 5085
Joined: Thu Apr 21, 2016 6:32 am
Location: Saxony
Contact:

Re: Neue und erweiterte Plugins für CMSimple_XH ab 1.7

Post by frase » Fri Feb 08, 2019 5:25 pm

7sleeper wrote:
Fri Feb 08, 2019 5:03 pm
Mir scheint es so als ob die Kommentare nicht richtig erkannt werden. Irgendwo beginnt ein // und schließt mit einem http:// . Wenn man den Code im Editor betrachtet erkennt man es durch die Einfärbung ganz gut.
Der Original-Code zeigt mir im notepad++ als Zeilenende immer [CR] an.
Nehme ich deinen heruntergeladenen Code in notepad++ und lasse ihn durch das Plugin JSTools->JSFormat laufen, passiert überhaupt nichts.
Setze ich nun an jedem Zeilenend händisch einen Zeilenumbruch, dann wird immer ein [CR][LF] angezeigt.
Mache ich das mit dem gesamten Code, dann formatiert JSFormat alles sauber.
Für mich sieht das so aus, als ob die Zeilenschaltungen nicht in Ordnung wären.
Anderes Betriebssystem? Andere Codierung? Falsche Taste?

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Neue und erweiterte Plugins für CMSimple_XH ab 1.7

Post by cmb » Fri Feb 08, 2019 5:42 pm

frase wrote:
Fri Feb 08, 2019 5:25 pm
Der Original-Code zeigt mir im notepad++ als Zeilenende immer [CR] an.
In einer aktuellen lightbox.zip scheint lightbox.js durchgehend CRLF als Zeilenende zu haben.
frase wrote:
Fri Feb 08, 2019 5:25 pm
Für mich sieht das so aus, als ob die Zeilenschaltungen nicht in Ordnung wären.
Anderes Betriebssystem? Andere Codierung? Falsche Taste?
CR ist altes Mac-Format (prä OS X). Das könnte tatsächlich Probleme geben, und genau danach sieht es bei 7sleeper auch aus. Konkretes Problem: vermutlich ist der Filezilla so eingestellt, dass .js als Textdateien übertragen werden, und das bedeutet eben, dass Zeilenenden gemäß dem Zielsystem ersetzt werden – und reines CR wird wohl gar nicht mehr unterstützt, so dass alles in einer Zeile endet, was nicht funktionieren kann. Also bei Bedarf die Zeilenenden vor dem Upload ändern.
cmb wrote:
Fri Feb 08, 2019 2:00 pm
Da besteht also dringender Handlungsbedarf.
Erledigt. Wer möchte, ist gern zum Testen eingeladen, bevor die Version im cmsimple-xh Repo eingespielt wird.
Christoph M. Becker – Plugins for CMSimple_XH

lck
Posts: 2963
Joined: Wed Mar 23, 2011 11:43 am
Contact:

Re: Neue und erweiterte Plugins für CMSimple_XH ab 1.7

Post by lck » Fri Feb 08, 2019 6:36 pm

cmb wrote:
Fri Feb 08, 2019 5:42 pm
cmb wrote:
Fri Feb 08, 2019 2:00 pm
Da besteht also dringender Handlungsbedarf.
Erledigt. Wer möchte, ist gern zum Testen eingeladen, bevor die Version im cmsimple-xh Repo eingespielt wird.
Spitze. Sieht gut aus, Deprecation Meldung ist verschwunden und ansonsten ist mir nichts negatives aufgefallen.
„Bevor du den Pfeil der Wahrheit abschießt, tauche die Spitze in Honig!“   👉 Ludwig's XH-Templates for MultiPage & OnePage

lck
Posts: 2963
Joined: Wed Mar 23, 2011 11:43 am
Contact:

Re: Neue und erweiterte Plugins für CMSimple_XH ab 1.7

Post by lck » Fri Feb 08, 2019 7:10 pm

7sleeper wrote:
Fri Feb 08, 2019 5:03 pm
Also ich nutze Filezilla und selbst wenn es diesen Automatismus gäbe würden ja alle js-Dateien beim Upload komprimiert...
Um das Problem einzugrenzen, würde ich mal FileZilla deinstallieren und neu installieren oder zumindest parallel eine portable Version von FileZilla ausprobieren.
„Bevor du den Pfeil der Wahrheit abschießt, tauche die Spitze in Honig!“   👉 Ludwig's XH-Templates for MultiPage & OnePage

frase
Posts: 5085
Joined: Thu Apr 21, 2016 6:32 am
Location: Saxony
Contact:

Re: Neue und erweiterte Plugins für CMSimple_XH ab 1.7

Post by frase » Fri Feb 08, 2019 7:29 pm

cmb wrote:
Fri Feb 08, 2019 5:42 pm
In einer aktuellen lightbox.zip scheint lightbox.js durchgehend CRLF als Zeilenende zu haben.
Eben nicht.
Heute von hier heruntergeladen.
In der lightbox.js gibt es ausschließlich CR.
Allerdings verändert mein Filezilla (alle Einstellungen Original, Übertragungstyp automatisch) diese Datei nicht.
Weder beim Upload noch beim zurück-Download.
Es liegt also an einer Verknüpfung der (unglücklichen) Umstände.
Falsche Zeilenschaltungen in der JS-Datei UND falsch konfigurierter Filezilla.

lck
Posts: 2963
Joined: Wed Mar 23, 2011 11:43 am
Contact:

Re: Neue und erweiterte Plugins für CMSimple_XH ab 1.7

Post by lck » Fri Feb 08, 2019 8:12 pm

@7sleeper: Hast du zufällig das Antivirenprogramm AVG installiert? Das verursachte auch mal korrupte Dateien.
„Bevor du den Pfeil der Wahrheit abschießt, tauche die Spitze in Honig!“   👉 Ludwig's XH-Templates for MultiPage & OnePage

olape
Posts: 2731
Joined: Fri Mar 13, 2015 8:47 am
Contact:

Re: Neue und erweiterte Plugins für CMSimple_XH ab 1.7

Post by olape » Fri Feb 08, 2019 9:06 pm

frase wrote:
Fri Feb 08, 2019 7:29 pm
Es liegt also an einer Verknüpfung der (unglücklichen) Umstände.
Falsche Zeilenschaltungen in der JS-Datei UND falsch konfigurierter Filezilla.
Ich kann mich erinnern, dass ich ein ähnliches Problem mit js-Dateien hatte, als ich ein Template von Frank für meine Seite angepasst hatte. Vielleicht weiss Frank das auch noch.
Auf der Testseite probiert, runtergeladen und auf die richtige Seite wieder hochgeladen und nix ging mehr.
Ende vom Lied, JS-Dateien waren verändert.

Ich glaube nicht an Probleme bei Filezilla. Virenscanner, das könnte ich mir da schon eher vorstellen.
Aber vielleicht eben auch beim Provider irgendwelche Sicherheits-Automatismen, wobei das wohl unwahrscheinlich ist.
Gruß Olaf, Plugins for CMSimple_XH

Ich habe schon lange den Verdacht, dass so viele so eifrig auf Gender, Trans und Queer machen:
Weil sie für das Fachliche ganz einfach zu doof sind.

Post Reply