From 0ed5a3d8ea02bcd2a5d6ed22d03b3ea56358f64f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Ra=C3=B1a?= Date: Mon, 30 Aug 2010 19:54:08 +0200 Subject: [PATCH] update plugin googlemaps to 1.98 ver --- .../plugins/googlemaps/dialog/googleMaps.html | 241 ++- .../plugins/googlemaps/dialog/googleMaps.js | 1048 ++++++------ .../plugins/googlemaps/dialog/polyline.js | 8 +- .../editor/plugins/googlemaps/fckplugin.js | 1504 ++++++++--------- .../googlemaps/fckplugin_compressed.js | 2 +- .../editor/plugins/googlemaps/lang/en.js | 88 +- .../editor/plugins/googlemaps/lang/es.js | 88 +- .../editor/plugins/googlemaps/lang/fr.js | 88 +- .../editor/plugins/googlemaps/lang/it.js | 88 +- .../editor/plugins/googlemaps/lang/nl.js | 88 +- .../editor/plugins/googlemaps/lang/no.js | 91 +- .../editor/plugins/googlemaps/lang/zh.js | 91 +- 12 files changed, 1709 insertions(+), 1716 deletions(-) mode change 100644 => 100755 main/inc/lib/fckeditor/editor/plugins/googlemaps/dialog/googleMaps.html mode change 100644 => 100755 main/inc/lib/fckeditor/editor/plugins/googlemaps/dialog/googleMaps.js mode change 100644 => 100755 main/inc/lib/fckeditor/editor/plugins/googlemaps/dialog/polyline.js mode change 100644 => 100755 main/inc/lib/fckeditor/editor/plugins/googlemaps/fckplugin.js mode change 100644 => 100755 main/inc/lib/fckeditor/editor/plugins/googlemaps/fckplugin_compressed.js mode change 100644 => 100755 main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/en.js mode change 100644 => 100755 main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/es.js mode change 100644 => 100755 main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/fr.js mode change 100644 => 100755 main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/it.js mode change 100644 => 100755 main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/nl.js mode change 100644 => 100755 main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/no.js mode change 100644 => 100755 main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/zh.js diff --git a/main/inc/lib/fckeditor/editor/plugins/googlemaps/dialog/googleMaps.html b/main/inc/lib/fckeditor/editor/plugins/googlemaps/dialog/googleMaps.html old mode 100644 new mode 100755 index fd9168f31e..062805b8e4 --- a/main/inc/lib/fckeditor/editor/plugins/googlemaps/dialog/googleMaps.html +++ b/main/inc/lib/fckeditor/editor/plugins/googlemaps/dialog/googleMaps.html @@ -1,123 +1,118 @@ - - - - - Google Maps - - - - - - - - - - -
- - - - - - - -
- - - - - - - Zoom Level - - - - -
- - - - - -
- - - - - -
-
- - - - - - - - - -
- - - + + + + + Google Maps + + + + + + + +
+ + + + + + + +
+ + + + + + + Zoom Level + + + + +
+ + + + + +
+ + + + + +
+
+ + + + + + + + + +
+ + + diff --git a/main/inc/lib/fckeditor/editor/plugins/googlemaps/dialog/googleMaps.js b/main/inc/lib/fckeditor/editor/plugins/googlemaps/dialog/googleMaps.js old mode 100644 new mode 100755 index d32240fecc..353605864c --- a/main/inc/lib/fckeditor/editor/plugins/googlemaps/dialog/googleMaps.js +++ b/main/inc/lib/fckeditor/editor/plugins/googlemaps/dialog/googleMaps.js @@ -1,525 +1,525 @@ -/* - GoogleMaps Plugin for FCKeditor -*/ - -// Rounds a number to just "precission" decimals -Number.prototype.RoundTo = function( precission ) -{ - var base = Math.pow(10, precission) ; - return Math.round( this * base ) / base ; -} ; - -function Import(aSrc) { - document.write(''); -} - -var oEditor = window.parent.InnerDialogLoaded() ; -var FCK = oEditor.FCK ; -var FCKLang = oEditor.FCKLang ; -var FCKConfig = oEditor.FCKConfig ; -var FCKTools = oEditor.FCKTools ; - -Import(FCKConfig.FullBasePath + 'dialog/common/fck_dialog_common.js'); - -Import('http://maps.google.com/maps?file=api&v=2&key=' + FCKConfig.GoogleMaps_Key); - -Import('polyline.js'); - -window.parent.AddTab( 'Map', FCKLang.GMapsMap ) ; -window.parent.AddTab( 'Search', FCKLang.GMapsSearch ) ; -window.parent.AddTab( 'Marker', FCKLang.GMapsMarker ) ; -window.parent.AddTab( 'Line', FCKLang.GMapsLine ) ; - -var ActiveTab ; - -// Function called when a dialog tag is selected. -function OnDialogTabChange( tabCode ) -{ - ActiveTab = tabCode ; - - ShowE('MapInfo', ( tabCode == 'Map' ) ) ; - ShowE('SearchInfo', ( tabCode == 'Search' ) ) ; - ShowE('MarkerInfo', ( tabCode == 'Marker' ) ) ; - ShowE('LineInfo', ( tabCode == 'Line' ) ) ; - - if (tabCode == 'Line') - ShowLinePoints() - else - HideLinePoints(); - - if (tabCode != 'Marker') - FinishAddMarker() ; - - ResizeParent() ; -} - - -// Get the selected map (if available). -var oFakeImage = FCK.Selection.GetSelectedElement() ; -var oParsedMap ; - -if ( oFakeImage ) -{ - if ( oFakeImage.getAttribute( 'MapNumber' ) ) - { - oParsedMap = FCK.GoogleMapsHandler.getMap( oFakeImage.getAttribute( 'MapNumber' ) ); - oParsedMap.updateDimensions( oFakeImage ); - } - else - oFakeImage = null ; -} -if ( !oParsedMap ) - oParsedMap = FCK.GoogleMapsHandler.createNew() ; - - -window.onload = function() -{ - // Garbage collection. The imported function won't be available inmediately. - window.onunload = GUnload ; - - // Translate the dialog box texts. - oEditor.FCKLanguageManager.TranslatePage(document) ; - var btn = GetE('btnAddNewMarker') ; - btn.alt = btn.title = FCKLang.GMapsAddMarker ; - - // Load the selected element information (if any). - LoadSelection() ; - - if ( GetE('apiKey').value.length>0 ) - { - GetE('apiKey').style.display = 'none' ; - GetE('lblApiKey').style.display = 'none' ; - } - - ConfigureEvents() ; - - // Activate the "OK" button. - SetupHelpButton( oEditor.FCKPlugins.Items['googlemaps'].Path + 'docs/' + FCKLang.GMapsUserHelpFile ) ; - window.parent.SetOkButton( true ) ; -//2.6 - if (window.parent.Sizer) window.parent.SetAutoSize( true ) ; -} ; - -function ConfigureEvents() -{ - GetE('txtWidth').onblur = UpdateDimensions ; - GetE('txtHeight').onblur = UpdateDimensions ; - - GetE('cmbZoom').onchange = UpdatePreview ; - - GetE('btnAddNewMarker').onclick = function () {AddMarker(); return false;}; - - FCKTools.AddEventListener(GetE('searchDirection') , 'keydown', searchDirection_keydown) ; - GetE('searchButton').onclick = function () {doSearch(); return false;}; -} - -function searchDirection_keydown(e) -{ - if (!e) e = window.event ; - if ( e.keyCode == 13 ) - { - doSearch(); - if (e.preventDefault) e.preventDefault() ; - if (e.stopPropagation) e.stopPropagation() ; - return false; - } -} - -function LoadSelection() -{ - GetE('apiKey').value = FCK.GoogleMapsHandler.publicKey ; - - GetE('txtWidth').value = oParsedMap.width ; - GetE('txtHeight').value = oParsedMap.height ; - - GetE('cmbZoom').value = oParsedMap.zoom ; - GetE('txtCenterLatitude').value = oParsedMap.centerLat ; - GetE('txtCenterLongitude').value = oParsedMap.centerLon ; - - var markerPoints = oParsedMap.markerPoints; - - GetE('encodedPolyline').value = oParsedMap.LinePoints ; - GetE('encodedLevels').value = oParsedMap.LineLevels ; - - SetPreviewElement( oParsedMap.mapType ) ; - UpdatePreview() ; - // Only after we have set the center. - map.setMapType( allMapTypes[ oParsedMap.mapType ] ); - - for (var i=0; i' + - '
' + - '
' + - '
' + - '
' + - '
' + - '' - ; - -} - -function doSearch() -{ - if (!geocoder) geocoder = new GClientGeocoder(); - - function processPoint(point) - { - if (point) - { - GetE("txtCenterLatitude").value = point.lat().RoundTo(5) ; - GetE("txtCenterLongitude").value = point.lng().RoundTo(5) ; - - // Create a marker at that direction - AddMarkerAtPoint( point, GetE('searchDirection').value ) ; - - UpdatePreview() ; - } - else { - alert( FCKLang.GMapsNotFound.replace("%s", GetE('searchDirection').value) ) ; - } - } - - geocoder.getLatLng ( GetE('searchDirection').value, processPoint ) ; -} - -// Change mode to enable addition of a new marker. -function AddMarker() -{ - if (Mode=='AddMarker') - { - FinishAddMarker() ; - return ; - } - - GetE( 'btnAddNewMarker' ).src = '../images/AddMarkerDown.png' ; - GetE( 'instructions' ).innerHTML = FCKLang.GMapsClickToAddMarker ; - Mode = 'AddMarker' ; - // Change cursor type - mapDiv.firstChild.firstChild.style.cursor = "crosshair" ; -} - -function AddMarkerAtPoint( point, text, interactive ) -{ - var marker = createMarker(point, text) ; - map.addOverlay( marker ) ; - markers.push( marker ); - FinishAddMarker(); - - if (interactive) - EditMarker( marker ); -} - -function FinishAddMarker() -{ - Mode = ''; - GetE( 'btnAddNewMarker' ).src = '../images/AddMarker.png' ; - GetE( 'instructions' ).innerHTML = ''; - // Change cursor type - mapDiv.firstChild.firstChild.style.cursor = "default" ; -} - - -function EditMarker(obj) -{ - if (ActiveTab!='Marker') - { - obj.openInfoWindowHtml(obj.text) ; - return; - } - // We are really editing. - activeMarker = obj ; - Mode = 'EditMarker' ; - obj.openInfoWindowHtml(generateEditPopupString(obj.text)); -} - -function CloseInfoWindow() -{ - Mode = '' ; - - map.closeInfoWindow() ; - activeMarker = null ; -} - -function UpdateCurrentMarker() -{ - activeMarker.text = GetE( 'txtMarkerText' ).value.replace(/\n/g, '
'); - CloseInfoWindow(); -} - -function DeleteCurrentMarker() -{ - // Remove it from the global array - for ( var j = 0 ; j < markers.length ; j++ ) - { - if ( markers[j] == activeMarker) - { - markers.splice(j, 1); - break ; - } - } - var tmp = activeMarker ; - CloseInfoWindow() ; - - // Remove it from the map - map.removeOverlay(tmp); -} - -// Full resize in x and y and centering -function ResizeParent() -{ - var oParentWindow = window.parent; -//2.6 - if (window.parent.Sizer) { - oParentWindow.Sizer.RefreshSize() ; - return; -} - var oInnerWindow = window ; - var oInnerDoc = oInnerWindow.document ; - var iDiff, iFrameHeight, iFrameWidth ; - - if ( document.all ) - iFrameHeight = oInnerDoc.body.offsetHeight ; - else - iFrameHeight = oInnerWindow.innerHeight ; - - var iInnerHeight = oInnerDoc.body.scrollHeight ; - iDiff = iInnerHeight - iFrameHeight ; - - if ( iDiff !== 0 ) - { - if ( document.all ) - oParentWindow.dialogHeight = ( parseInt( oParentWindow.dialogHeight, 10 ) + iDiff ) + 'px' ; - else - oParentWindow.resizeBy( 0, iDiff ) ; - } - - // Width: - if ( document.all ) - iFrameWidth = oInnerDoc.body.offsetWidth ; - else - iFrameWidth = oInnerWindow.innerWidth ; - - var iInnerWidth = oInnerDoc.body.scrollWidth ; - iDiff = iInnerWidth - iFrameWidth ; - - if ( iDiff !== 0 ) - { - if ( document.all ) - oParentWindow.dialogWidth = ( parseInt( oParentWindow.dialogWidth, 10 ) + iDiff ) + 'px' ; - else - oParentWindow.resizeBy( iDiff, 0 ) ; - } - -} - -// Adds a Help button to the parent dialog pointing to the provided url -function SetupHelpButton( url ) -{ - var doc = window.parent.document ; - var helpButton = doc.createElement( 'INPUT' ) ; - helpButton.type = 'button' ; - helpButton.value = FCKLang.Help ; - helpButton.className = 'Button' ; - helpButton.onclick = function () { window.open( url ); return false; }; - - var okButton = doc.getElementById( 'btnOk' ) ; - var cell = okButton.parentNode.previousSibling ; - if (cell.nodeName != 'TD') - cell = cell.previousSibling ; - cell.appendChild( helpButton ); +/* + GoogleMaps Plugin for FCKeditor +*/ + +// Rounds a number to just "precission" decimals +Number.prototype.RoundTo = function( precission ) +{ + var base = Math.pow(10, precission) ; + return Math.round( this * base ) / base ; +} ; + +function Import(aSrc) { + document.write(''); +} + +var oEditor = window.parent.InnerDialogLoaded() ; +var FCK = oEditor.FCK ; +var FCKLang = oEditor.FCKLang ; +var FCKConfig = oEditor.FCKConfig ; +var FCKTools = oEditor.FCKTools ; + +Import(FCKConfig.FullBasePath + 'dialog/common/fck_dialog_common.js'); + +Import('http://maps.google.com/maps?file=api&v=2&key=' + FCKConfig.GoogleMaps_Key); + +Import('polyline.js'); + +window.parent.AddTab( 'Map', FCKLang.GMapsMap ) ; +window.parent.AddTab( 'Search', FCKLang.GMapsSearch ) ; +window.parent.AddTab( 'Marker', FCKLang.GMapsMarker ) ; +window.parent.AddTab( 'Line', FCKLang.GMapsLine ) ; + +var ActiveTab ; + +// Function called when a dialog tag is selected. +function OnDialogTabChange( tabCode ) +{ + ActiveTab = tabCode ; + + ShowE('MapInfo', ( tabCode == 'Map' ) ) ; + ShowE('SearchInfo', ( tabCode == 'Search' ) ) ; + ShowE('MarkerInfo', ( tabCode == 'Marker' ) ) ; + ShowE('LineInfo', ( tabCode == 'Line' ) ) ; + + if (tabCode == 'Line') + ShowLinePoints() + else + HideLinePoints(); + + if (tabCode != 'Marker') + FinishAddMarker() ; + + ResizeParent() ; +} + + +// Get the selected map (if available). +var oFakeImage = FCK.Selection.GetSelectedElement() ; +var oParsedMap ; + +if ( oFakeImage ) +{ + if ( oFakeImage.getAttribute( 'MapNumber' ) ) + { + oParsedMap = FCK.GoogleMapsHandler.getMap( oFakeImage.getAttribute( 'MapNumber' ) ); + oParsedMap.updateDimensions( oFakeImage ); + } + else + oFakeImage = null ; +} +if ( !oParsedMap ) + oParsedMap = FCK.GoogleMapsHandler.createNew() ; + + +window.onload = function() +{ + // Garbage collection. The imported function won't be available inmediately. + window.onunload = GUnload ; + + // Translate the dialog box texts. + oEditor.FCKLanguageManager.TranslatePage(document) ; + var btn = GetE('btnAddNewMarker') ; + btn.alt = btn.title = FCKLang.GMapsAddMarker ; + + // Load the selected element information (if any). + LoadSelection() ; + + if ( GetE('apiKey').value.length>0 ) + { + GetE('apiKey').style.display = 'none' ; + GetE('lblApiKey').style.display = 'none' ; + } + + ConfigureEvents() ; + + // Activate the "OK" button. + SetupHelpButton( oEditor.FCKPlugins.Items['googlemaps'].Path + 'docs/' + FCKLang.GMapsUserHelpFile ) ; + window.parent.SetOkButton( true ) ; +//2.6 + if (window.parent.Sizer) window.parent.SetAutoSize( true ) ; +} ; + +function ConfigureEvents() +{ + GetE('txtWidth').onblur = UpdateDimensions ; + GetE('txtHeight').onblur = UpdateDimensions ; + + GetE('cmbZoom').onchange = UpdatePreview ; + + GetE('btnAddNewMarker').onclick = function () {AddMarker(); return false;}; + + FCKTools.AddEventListener(GetE('searchDirection') , 'keydown', searchDirection_keydown) ; + GetE('searchButton').onclick = function () {doSearch(); return false;}; +} + +function searchDirection_keydown(e) +{ + if (!e) e = window.event ; + if ( e.keyCode == 13 ) + { + doSearch(); + if (e.preventDefault) e.preventDefault() ; + if (e.stopPropagation) e.stopPropagation() ; + return false; + } +} + +function LoadSelection() +{ + GetE('apiKey').value = FCK.GoogleMapsHandler.publicKey ; + + GetE('txtWidth').value = oParsedMap.width ; + GetE('txtHeight').value = oParsedMap.height ; + + GetE('cmbZoom').value = oParsedMap.zoom ; + GetE('txtCenterLatitude').value = oParsedMap.centerLat ; + GetE('txtCenterLongitude').value = oParsedMap.centerLon ; + + var markerPoints = oParsedMap.markerPoints; + + GetE('encodedPolyline').value = oParsedMap.LinePoints ; + GetE('encodedLevels').value = oParsedMap.LineLevels ; + + SetPreviewElement( oParsedMap.mapType ) ; + UpdatePreview() ; + // Only after we have set the center. + map.setMapType( allMapTypes[ oParsedMap.mapType ] ); + + for (var i=0; i' + + '
' + + '
' + + '
' + + '
' + + '
' + + '' + ; + +} + +function doSearch() +{ + if (!geocoder) geocoder = new GClientGeocoder(); + + function processPoint(point) + { + if (point) + { + GetE("txtCenterLatitude").value = point.lat().RoundTo(5) ; + GetE("txtCenterLongitude").value = point.lng().RoundTo(5) ; + + // Create a marker at that direction + AddMarkerAtPoint( point, GetE('searchDirection').value ) ; + + UpdatePreview() ; + } + else { + alert( FCKLang.GMapsNotFound.replace("%s", GetE('searchDirection').value) ) ; + } + } + + geocoder.getLatLng ( GetE('searchDirection').value, processPoint ) ; +} + +// Change mode to enable addition of a new marker. +function AddMarker() +{ + if (Mode=='AddMarker') + { + FinishAddMarker() ; + return ; + } + + GetE( 'btnAddNewMarker' ).src = '../images/AddMarkerDown.png' ; + GetE( 'instructions' ).innerHTML = FCKLang.GMapsClickToAddMarker ; + Mode = 'AddMarker' ; + // Change cursor type + mapDiv.firstChild.firstChild.style.cursor = "crosshair" ; +} + +function AddMarkerAtPoint( point, text, interactive ) +{ + var marker = createMarker(point, text) ; + map.addOverlay( marker ) ; + markers.push( marker ); + FinishAddMarker(); + + if (interactive) + EditMarker( marker ); +} + +function FinishAddMarker() +{ + Mode = ''; + GetE( 'btnAddNewMarker' ).src = '../images/AddMarker.png' ; + GetE( 'instructions' ).innerHTML = ''; + // Change cursor type + mapDiv.firstChild.firstChild.style.cursor = "default" ; +} + + +function EditMarker(obj) +{ + if (ActiveTab!='Marker') + { + obj.openInfoWindowHtml(obj.text) ; + return; + } + // We are really editing. + activeMarker = obj ; + Mode = 'EditMarker' ; + obj.openInfoWindowHtml(generateEditPopupString(obj.text)); +} + +function CloseInfoWindow() +{ + Mode = '' ; + + map.closeInfoWindow() ; + activeMarker = null ; +} + +function UpdateCurrentMarker() +{ + activeMarker.text = GetE( 'txtMarkerText' ).value.replace(/\n/g, '
'); + CloseInfoWindow(); +} + +function DeleteCurrentMarker() +{ + // Remove it from the global array + for ( var j = 0 ; j < markers.length ; j++ ) + { + if ( markers[j] == activeMarker) + { + markers.splice(j, 1); + break ; + } + } + var tmp = activeMarker ; + CloseInfoWindow() ; + + // Remove it from the map + map.removeOverlay(tmp); +} + +// Full resize in x and y and centering +function ResizeParent() +{ + var oParentWindow = window.parent; +//2.6 + if (window.parent.Sizer) { + oParentWindow.Sizer.RefreshSize() ; + return; +} + var oInnerWindow = window ; + var oInnerDoc = oInnerWindow.document ; + var iDiff, iFrameHeight, iFrameWidth ; + + if ( document.all ) + iFrameHeight = oInnerDoc.body.offsetHeight ; + else + iFrameHeight = oInnerWindow.innerHeight ; + + var iInnerHeight = oInnerDoc.body.scrollHeight ; + iDiff = iInnerHeight - iFrameHeight ; + + if ( iDiff !== 0 ) + { + if ( document.all ) + oParentWindow.dialogHeight = ( parseInt( oParentWindow.dialogHeight, 10 ) + iDiff ) + 'px' ; + else + oParentWindow.resizeBy( 0, iDiff ) ; + } + + // Width: + if ( document.all ) + iFrameWidth = oInnerDoc.body.offsetWidth ; + else + iFrameWidth = oInnerWindow.innerWidth ; + + var iInnerWidth = oInnerDoc.body.scrollWidth ; + iDiff = iInnerWidth - iFrameWidth ; + + if ( iDiff !== 0 ) + { + if ( document.all ) + oParentWindow.dialogWidth = ( parseInt( oParentWindow.dialogWidth, 10 ) + iDiff ) + 'px' ; + else + oParentWindow.resizeBy( iDiff, 0 ) ; + } + +} + +// Adds a Help button to the parent dialog pointing to the provided url +function SetupHelpButton( url ) +{ + var doc = window.parent.document ; + var helpButton = doc.createElement( 'INPUT' ) ; + helpButton.type = 'button' ; + helpButton.value = FCKLang.Help ; + helpButton.className = 'Button' ; + helpButton.onclick = function () { window.open( url ); return false; }; + + var okButton = doc.getElementById( 'btnOk' ) ; + var cell = okButton.parentNode.previousSibling ; + if (cell.nodeName != 'TD') + cell = cell.previousSibling ; + cell.appendChild( helpButton ); } \ No newline at end of file diff --git a/main/inc/lib/fckeditor/editor/plugins/googlemaps/dialog/polyline.js b/main/inc/lib/fckeditor/editor/plugins/googlemaps/dialog/polyline.js old mode 100644 new mode 100755 index 13bb0a2e8b..501eb58acb --- a/main/inc/lib/fckeditor/editor/plugins/googlemaps/dialog/polyline.js +++ b/main/inc/lib/fckeditor/editor/plugins/googlemaps/dialog/polyline.js @@ -25,7 +25,7 @@ function createPoint(lat, lng, pLevel) { Level: pLevel }; - if (currentIndex>-1) + if (currentIndex>-1) points.splice(currentIndex+1, 0, newPoint) ; else points.push(newPoint); @@ -34,7 +34,7 @@ function createPoint(lat, lng, pLevel) { point_marker.focusable = true ; // To signal that the map must get the focus. map.addOverlay(point_marker); - if (currentIndex>-1) + if (currentIndex>-1) point_markers.splice(currentIndex+1, 0, point_marker) ; else point_markers.push(point_marker); @@ -155,9 +155,9 @@ function deletePoint() { } -// Create the encoded polyline and level strings. +// Create the encoded polyline and level strings. function createEncodings() { - if (points.length==0) + if (points.length==0) { document.getElementById('encodedLevels').value = ''; document.getElementById('encodedPolyline').value = ''; diff --git a/main/inc/lib/fckeditor/editor/plugins/googlemaps/fckplugin.js b/main/inc/lib/fckeditor/editor/plugins/googlemaps/fckplugin.js old mode 100644 new mode 100755 index 76356dcd4f..9b0b70c20c --- a/main/inc/lib/fckeditor/editor/plugins/googlemaps/fckplugin.js +++ b/main/inc/lib/fckeditor/editor/plugins/googlemaps/fckplugin.js @@ -1,752 +1,752 @@ -/* - GoogleMaps Plugin for FCKeditor - Dialog plugin to handle insertion and modification of Google Maps in FCKeditor - - File Author: - Alfonso Martinez de Lizarrondo amla70 at gmail dot com - - version 1.97 - - See readme.html -*/ - -// Check that the Google key is defined -if ( typeof( FCKConfig.GoogleMaps_Key ) != 'string') -{ - alert( 'Error.\r\nThe configuration doesn\'t contain the Google Maps key.\r\n' + - 'Please read the Configuration section.') ; - - window.open(FCKPlugins.Items['googlemaps'].Path + 'docs/' + FCKLang.GMapsHelpFile + '#configure'); -} - -// If it's empty automatically remove the button from any toolbar. -if ( !FCKConfig.GoogleMaps_Key || FCKConfig.GoogleMaps_Key.length === 0) -{ - for( var name in FCKConfig.ToolbarSets ) - RemoveButtonFromToolbarSet( FCKConfig.ToolbarSets[name], 'googlemaps' ) ; -} - -/** - Helper function - It does remove a button from an toolbarset. - It's better than leaving it disabled as it will avoid questions about why some button is always disabled. -*/ -function RemoveButtonFromToolbarSet(ToolbarSet, CommandName) -{ - if (!ToolbarSet) - return; - - for ( var x = 0 ; x < ToolbarSet.length ; x++ ) - { - var oToolbarItems = ToolbarSet[x] ; - - // If the configuration for the toolbar is missing some element or has any extra comma - // this item won't be valid, so skip it and keep on processing. - if ( !oToolbarItems ) - continue ; - - if ( typeof( oToolbarItems ) == 'object' ) - { - for ( var j = 0 ; j < oToolbarItems.length ; j++ ) - { - if ( oToolbarItems[j] == CommandName) - { - oToolbarItems.splice(j, 1); - ToolbarSet[x] = oToolbarItems ; - return; - } - } - } - } -} - -// Toolbar button - -// Register the related command. -FCKCommands.RegisterCommand( 'googlemaps', new FCKDialogCommand( 'googlemaps', FCKLang.DlgGMapsTitle, FCKPlugins.Items['googlemaps'].Path + 'dialog/googleMaps.html', 450, 428 ) ) ; - -// Create the "googlemaps" toolbar button. -var oGoogleMapsButton = new FCKToolbarButton( 'googlemaps', FCKLang.GMapsBtn, FCKLang.GMapsBtnTooltip) ; -oGoogleMapsButton.IconPath = FCKPlugins.Items['googlemaps'].Path + 'images/mapIcon.gif' ; - -FCKToolbarItems.RegisterItem( 'googlemaps', oGoogleMapsButton ) ; - - -// Detection of existing maps -/** - FCKCommentsProcessor - --------------------------- - It's run after a document has been loaded, it detects all the protected source elements - - In order to use it, you add your comment parser with - FCKCommentsProcessor.AddParser( function ) -*/ -if (typeof FCKCommentsProcessor === 'undefined') -{ - var FCKCommentsProcessor = FCKDocumentProcessor.AppendNew() ; - FCKCommentsProcessor.ProcessDocument = function( oDoc ) - { - if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG ) - return ; - - if ( !oDoc ) - return ; - - //Find all the comments: - //try to choose the best approach according to the browser: - if ( oDoc.evaluate ) - this.findCommentsXPath( oDoc ); - else - { - if (oDoc.all) - this.findCommentsIE( oDoc.body ) ; - else - this.findComments( oDoc.body ) ; - } - - } - - FCKCommentsProcessor.findCommentsXPath = function(oDoc) { - var nodesSnapshot = oDoc.evaluate('//body//comment()', oDoc.body, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null ); - - for ( var i=0 ; i < nodesSnapshot.snapshotLength; i++ ) - { - this.parseComment( nodesSnapshot.snapshotItem(i) ) ; - } - } - - FCKCommentsProcessor.findCommentsIE = function(oNode) { - var aComments = oNode.getElementsByTagName( '!' ); - for(var i=aComments.length-1; i >=0 ; i--) - { - var comment = aComments[i] ; - if (comment.nodeType == 8 ) // oNode.COMMENT_NODE) - this.parseComment( comment ) ; - } - } - - // Fallback function, iterate all the nodes and its children searching for comments. - FCKCommentsProcessor.findComments = function( oNode ) - { - if (oNode.nodeType == 8 ) // oNode.COMMENT_NODE) - { - this.parseComment( oNode ) ; - } - else - { - if (oNode.hasChildNodes()) - { - var children = oNode.childNodes ; - for (var i = children.length-1; i >=0 ; i--) - this.findComments( children[ i ] ); - } - } - } - - // We get a comment node - // Check that it's one that we are interested on: - FCKCommentsProcessor.parseComment = function( oNode ) - { - var value = oNode.nodeValue ; - - // Difference between 2.4.3 and 2.5 - var prefix = ( FCKConfig.ProtectedSource._CodeTag || 'PS\\.\\.' ) ; - - var regex = new RegExp( "\\{" + prefix + "(\\d+)\\}", "g" ) ; - - if ( regex.test( value ) ) - { - var index = RegExp.$1 ; - var content = FCKTempBin.Elements[ index ] ; - - // Now call the registered parser handlers. - var oCalls = this.ParserHandlers ; - if ( oCalls ) - { - for ( var i = 0 ; i < oCalls.length ; i++ ) - oCalls[ i ]( oNode, content, index ) ; - - } - - } - } - - /** - The users of the object will add a parser here, the callback function gets two parameters: - oNode: it's the node in the editorDocument that holds the position of our content - oContent: it's the node (removed from the document) that holds the original contents - index: the reference in the FCKTempBin of our content - */ - FCKCommentsProcessor.AddParser = function( handlerFunction ) - { - if ( !this.ParserHandlers ) - this.ParserHandlers = [ handlerFunction ] ; - else - { - // Check that the event handler isn't already registered with the same listener - // It doesn't detect function pointers belonging to an object (at least in Gecko) - if ( this.ParserHandlers.IndexOf( handlerFunction ) == -1 ) - this.ParserHandlers.push( handlerFunction ) ; - } - } -} -/** - END of FCKCommentsProcessor - --------------------------- -*/ - - - - -// Check if the comment it's one of our scripts: -var GoogleMaps_CommentsProcessorParser = function( oNode, oContent, index) -{ - if ( FCK.GoogleMapsHandler.detectMapScript( oContent ) ) - { - var oMap = FCK.GoogleMapsHandler.createNew() ; - oMap.parse( oContent ) ; - oMap.createHtmlElement( oNode, index ) ; - } - else - { - if ( FCK.GoogleMapsHandler.detectGoogleScript( oContent ) ) - oNode.parentNode.removeChild( oNode ); - } -} - -FCKCommentsProcessor.AddParser( GoogleMaps_CommentsProcessorParser ); - - - -// Context menu -FCK.ContextMenu.RegisterListener( { - AddItems : function( menu, tag, tagName ) - { - // under what circumstances do we display this option - if ( tagName == 'IMG' && tag.getAttribute( 'MapNumber' ) ) - { - // No other options: - menu.RemoveAllItems() ; - // the command needs the registered command name, the title for the context menu, and the icon path - menu.AddItem( 'googlemaps', FCKLang.DlgGMapsTitle, oGoogleMapsButton.IconPath ) ; - } - }} -); - -// Double click -FCK.RegisterDoubleClickHandler( editMap, 'IMG' ) ; - -function editMap( oNode ) -{ - if ( !oNode.getAttribute( 'MapNumber' )) - return ; - - FCK.Commands.GetCommand( 'googlemaps' ).Execute() ; -} - - -// Object that handles the common functions about all the maps -FCK.GoogleMapsHandler = { - // Object to store a reference to each map - maps: {}, - - getMap: function(id){ - return this.maps[id]; - }, - - // Verify that the node is a script generated by this plugin. - detectMapScript: function( script ) - { - // We only know about version 1: - if ( !(/FCK googlemaps v1\.(\d+)/.test(script)) ) - return false; - - return true - }, - - // Self-executed function, we want to run it once at initialization only. - // Public key that will be used for the generated maps, - // while we are editing we will use only FCKConfig.GoogleMaps_Key - publicKey : function() { - // if FCKConfig.GoogleMaps_PublicKey is set to something, then use it - if ( FCKConfig.GoogleMaps_PublicKey ) - return FCKConfig.GoogleMaps_PublicKey ; - - // else we will use GoogleMaps_Key for both the public and private side. - return FCKConfig.GoogleMaps_Key ; - }(), - - // Detects both the google script as well as our ending block - // both must be removed and then added later only if neccesary - detectGoogleScript: function( script ) - { - // Our final script - if (/FCK googlemapsEnd v1\./.test(script) ) - return true ; - - // If it is the Google Maps script, get the public key from here: - if ( !/^' ; - }, - - // This can be called from the dialog - createNew: function() - { - var map = new FCKGoogleMap() ; - this.maps[ map.number ] = map; - return map; - }, - - BuildEndingScript: function() - { - var versionMarker = '// FCK googlemapsEnd v1.97'; - - var aScript = [] ; - aScript.push('\r\n'); - - return aScript.join('\r\n'); - }, - - // We will use this to track the number of maps that are generated - // This way we know if we must add the Google Script or not. - // We store their names so they are called properly from BuildEndingScript - CreatedMapsNames : [], - - // Function that will be injected into the normal core - GetXHTMLAfter: function( node, includeNode, format, Result ) - { - if (FCK.GoogleMapsHandler.CreatedMapsNames.length > 0) - { - Result += FCK.GoogleMapsHandler.BuildEndingScript() ; - } - // Reset the counter each time the GetXHTML function is called - FCK.GoogleMapsHandler.CreatedMapsNames = []; - - return Result ; - }, - - // Store any previous processor so nothing breaks - previousProcessor: FCKXHtml.TagProcessors[ 'img' ] -} - - -// Our object that will handle parsing of the script and creating the new one. -var FCKGoogleMap = function() -{ - var now = new Date() ; - this.number = '' + now.getFullYear() + now.getMonth() + now.getDate() + now.getHours() + now.getMinutes() + now.getSeconds() ; - - this.width = FCKConfig.GoogleMaps_Width || 400 ; - this.height = FCKConfig.GoogleMaps_Height || 240 ; - - this.centerLat = FCKConfig.GoogleMaps_CenterLat || 37.4419 ; - this.centerLon = FCKConfig.GoogleMaps_CenterLon || -122.1419 ; - this.zoom = FCKConfig.GoogleMaps_Zoom || 11 ; - - this.markerPoints = [] ; - - this.LinePoints = '' ; - this.LineLevels = '' ; - - this.mapType = 0 ; - - this.WrapperClass = FCKConfig.GoogleMaps_WrapperClass || '' ; -} - - -FCKGoogleMap.prototype.createHtmlElement = function( oReplacedNode, index) -{ - var oFakeNode = FCK.EditorDocument.createElement( 'IMG' ) ; - - // Are we creating a new map? - if ( !oReplacedNode ) - { - index = FCKTempBin.AddElement( this.BuildScript() ) ; - var prefix = ( FCKConfig.ProtectedSource._CodeTag || 'PS..' ) ; - oReplacedNode = FCK.EditorDocument.createComment( '{' + prefix + index + '}' ) ; - FCK.InsertElement(oReplacedNode); - } - oFakeNode.contentEditable = false ; -// oFakeNode.setAttribute( '_fckfakelement', 'true', 0 ) ; - - oFakeNode.setAttribute( '_fckrealelement', FCKTempBin.AddElement( oReplacedNode ), 0 ) ; - oFakeNode.setAttribute( '_fckBinNode', index, 0 ) ; - - oFakeNode.src = FCKConfig.FullBasePath + 'images/spacer.gif' ; - oFakeNode.style.display = 'block' ; - oFakeNode.style.border = '1px solid black' ; - oFakeNode.style.background = 'white center center url("' + FCKPlugins.Items['googlemaps'].Path + 'images/maps_res_logo.png' + '") no-repeat' ; - - oFakeNode.setAttribute("MapNumber", this.number, 0) ; - - oReplacedNode.parentNode.insertBefore( oFakeNode, oReplacedNode ) ; - oReplacedNode.parentNode.removeChild( oReplacedNode ) ; - - // dimensions - this.updateHTMLElement( oFakeNode ); - - return oFakeNode ; -} - -FCKGoogleMap.prototype.updateScript = function( oFakeNode ) -{ - this.updateDimensions( oFakeNode ) ; - - var index = oFakeNode.getAttribute( '_fckBinNode' ); - FCKTempBin.Elements[ index ] = this.BuildScript() ; -} - -FCKGoogleMap.prototype.updateHTMLElement = function( oFakeNode ) -{ - oFakeNode.width = this.width ; - oFakeNode.height = this.height ; - - // Static maps preview :-) - oFakeNode.src = this.generateStaticMap() ; - oFakeNode.style.border = 0 ; - - // The wrapper class is applied to the IMG not to a wrapping DIV !!! - if ( this.WrapperClass !== '') - oFakeNode.className = this.WrapperClass ; -} - -FCKGoogleMap.prototype.generateStaticMap = function() -{ - var w = Math.min(this.width, 640); - var h = Math.min(this.height, 640); - var staticMapTypes = ['roadmap', 'satellite', 'hybrid', 'terrain'] ; - - return 'http://maps.google.com/staticmap?center=' + this.centerLat + ',' + this.centerLon - + '&zoom=' + this.zoom + '&size=' + w + 'x' + h - + '&maptype=' + staticMapTypes[ this.mapType ] - + this.generateStaticMarkers() - + '&key=' + FCKConfig.GoogleMaps_Key -} - -FCKGoogleMap.prototype.generateStaticMarkers = function() -{ - if (this.markerPoints.length==0) - return ''; - - var aPoints = []; - for (var i=0; i.'); - var regexpDimensions = /
/ ; - if (regexpDimensions.test( script ) ) - { - delete FCK.GoogleMapsHandler.maps[this.number] ; - this.number = RegExp.$1 ; - FCK.GoogleMapsHandler.maps[this.number] = this ; - - this.width = RegExp.$2 ; - this.height = RegExp.$3 ; - } - -// map.setCenter(new GLatLng(42.4298,-8.07756), 8); - var regexpPosition = /map\.setCenter\(new GLatLng\((-?\d{1,3}\.\d{1,6}),(-?\d{1,3}\.\d{1,6})\), (\d{1,2})\);/ ; - if (regexpPosition.test( script ) ) - { - this.centerLat = RegExp.$1 ; - this.centerLon = RegExp.$2 ; - this.zoom = RegExp.$3 ; - } - -// v <= 1.5 - if ( version<=5 ) - { - // var text = 'En O Carballino ha estado la d\'elegacion diplomatica japonesa'; - var markerText, markerLat=0, markerLon=0; - var regexpText = /var text\s*=\s*("|')(.*)\1;\s*\n/ ; - if (regexpText.test( script ) ) - { - markerText = RegExp.$2 ; - } - - // var point = new GLatLng(42.4298,-8.07756); - var regexpMarker = /var point\s*=\s*new GLatLng\((-?\d{1,3}\.\d{1,6}),(-?\d{1,3}\.\d{1,6})\)/ ; - if (regexpMarker.test( script ) ) - { - markerLat = RegExp.$1 ; - markerLon = RegExp.$2 ; - } - if (markerLat!=0 && markerLon!=0) - this.markerPoints.push( {lat:markerLat, lon:markerLon, text:this.decodeText(markerText)} ) ; - } - else - { - // v > 1.5. multiple points. - - // AddMarkers( [{lat:37.45088, lon:-122.21123, text:'Write your text'}] ) ; - var regexpMarkers = /\{lat\:(-?\d{1,3}\.\d{1,6}),\s*lon\:(-?\d{1,3}\.\d{1,6}),\s*text\:("|')(.*)\3}(?:,|])/ ; - var point; - var sampleText = script ; - var startIndex = 0; - var totalLength = sampleText.length; - var result, pos; - while (startIndex != totalLength) { - result = regexpMarkers.exec(sampleText); - if (result && result.length > 0) { - pos = sampleText.indexOf(result[0]); - startIndex += pos; - - this.markerPoints.push( {lat:result[1], lon:result[2], text:this.decodeText(result[4])} ) ; - - sampleText = sampleText.substr(pos + result[0].length); - startIndex += result[0].length; - } else { - break; - } - } - /* - while (result = regexpMarkers.exec( script ) ) - { - this.markerPoints.push( {lat:result[1], lon:result[2], text:result[4]} ) ; - } - */ - } - -// var encodedPoints = "iuowFf{kbMzH}N`IbJb@zBpYzO{dAvfF{LwDyN`_@`NzKqB|Ec@|L}BKmBbCoPjrBeEdy@uJ`Mn@zoAer@bjA~Xz{JczBa]pIps@de@tW}rCdxSwhPl`XgikCl{soA{dLdAaaF~cCyxCk_Aao@jp@kEvnCgoJ`]y[pVguKhCkUflAwrEzKk@yzCv^k@?mI"; - var regexpLinePoints = /var encodedPoints\s*=\s*("|')(.*)\1;\s*\n/ ; - if (regexpLinePoints.test( script ) ) - { - this.LinePoints = RegExp.$2 ; - } - -// var encodedLevels = "B????????????????????????????????????B"; - var regexpLineLevels = /var encodedLevels\s*=\s*("|')(.*)\1;\s*\n/ ; - if (regexpLineLevels.test( script ) ) - { - this.LineLevels = RegExp.$2 ; - } - -// 1.8 mapType -// map.setMapType( allMapTypes[ 1 ] ); - var regexpMapType = /setMapType\([^\[]*\[\s*(\d+)\s*\]\s*\)/ ; - if (regexpMapType.test( script ) ) - { - this.mapType = RegExp.$1 ; - } - -// 1.9 wrapper div with custom class - if ( version >= 9 ) - { - var regexpWrapper = /
') ; - aScript.push( versionMarker ) ; - - if ( this.WrapperClass !== '') - aScript.push('document.write(\'
\'); //wrapper'); - - aScript.push('document.write(\'
.<\\\/div>\');'); - - if ( this.WrapperClass !== '') - aScript.push('document.write(\'<\\\/div>\'); '); - - aScript.push('function CreateGMap' + this.number + '() {'); - aScript.push(' if(!GBrowserIsCompatible()) return;'); - - aScript.push(' var allMapTypes = [G_NORMAL_MAP, G_SATELLITE_MAP, G_HYBRID_MAP, G_PHYSICAL_MAP] ;'); - aScript.push(' var map = new GMap2(document.getElementById("gmap' + this.number + '"), {mapTypes:allMapTypes});'); - aScript.push(' map.setCenter(new GLatLng(' + this.centerLat + ',' + this.centerLon + '), ' + this.zoom + ');'); - - aScript.push(' map.setMapType( allMapTypes[ ' + this.mapType + ' ] );'); - - aScript.push(' map.addControl(new GSmallMapControl());'); - aScript.push(' map.addControl(new GMapTypeControl());'); - - - var aPoints = []; - for (var i=0; i'); - - return aScript.join('\r\n'); -} - - - -// Modifications of the core routines of FCKeditor: - -FCKXHtml.GetXHTML = Inject(FCKXHtml.GetXHTML, null, FCK.GoogleMapsHandler.GetXHTMLAfter ) ; - -FCKXHtml.TagProcessors.img = function( node, htmlNode, xmlNode ) -{ - if ( htmlNode.getAttribute( 'MapNumber' ) ) - { - var oMap = FCK.GoogleMapsHandler.getMap( htmlNode.getAttribute( 'MapNumber' ) ) ; - FCK.GoogleMapsHandler.CreatedMapsNames.push( oMap.number ) ; - - oMap.updateScript( htmlNode ); - node = FCK.GetRealElement( htmlNode ) ; - if ( FCK.GoogleMapsHandler.CreatedMapsNames.length == 1 ) - { - // If it is the first map, insert the google maps script - var index = FCKTempBin.AddElement( FCK.GoogleMapsHandler.GenerateGoogleScript() ) ; - var prefix = ( FCKConfig.ProtectedSource._CodeTag || 'PS..' ) ; - oScriptCommentNode = xmlNode.ownerDocument.createComment( '{' + prefix + index + '}' ) ; - xmlNode.appendChild( oScriptCommentNode ) ; - } - - return xmlNode.ownerDocument.createComment( node.nodeValue ) ; - } - - if (typeof FCK.GoogleMapsHandler.previousProcessor == 'function') - node = FCK.GoogleMapsHandler.previousProcessor( node, htmlNode, xmlNode ) ; - else - node = FCKXHtml._AppendChildNodes( node, htmlNode, false ) ; - - return node ; -}; - -/** - @desc inject the function - @author Aimingoo&Riceball -*/ -function Inject( aOrgFunc, aBeforeExec, aAtferExec ) { - return function() { - if (typeof(aBeforeExec) == 'function') arguments = aBeforeExec.apply(this, arguments) || arguments; - //convert arguments object to array - var Result, args = [].slice.call(arguments); - args.push(aOrgFunc.apply(this, args)); - if (typeof(aAtferExec) == 'function') Result = aAtferExec.apply(this, args); - return (typeof(Result) != 'undefined')?Result:args.pop(); - } ; -} +/* + GoogleMaps Plugin for FCKeditor + Dialog plugin to handle insertion and modification of Google Maps in FCKeditor + + File Author: + Alfonso Martinez de Lizarrondo amla70 at gmail dot com + + version 1.98 + + See readme.html +*/ + +// Check that the Google key is defined +if ( typeof( FCKConfig.GoogleMaps_Key ) != 'string') +{ + alert( 'Error.\r\nThe configuration doesn\'t contain the Google Maps key.\r\n' + + 'Please read the Configuration section.') ; + + window.open(FCKPlugins.Items['googlemaps'].Path + 'docs/' + FCKLang.GMapsHelpFile + '#configure'); +} + +// If it's empty automatically remove the button from any toolbar. +if ( !FCKConfig.GoogleMaps_Key || FCKConfig.GoogleMaps_Key.length === 0) +{ + for( var name in FCKConfig.ToolbarSets ) + RemoveButtonFromToolbarSet( FCKConfig.ToolbarSets[name], 'googlemaps' ) ; +} + +/** + Helper function + It does remove a button from an toolbarset. + It's better than leaving it disabled as it will avoid questions about why some button is always disabled. +*/ +function RemoveButtonFromToolbarSet(ToolbarSet, CommandName) +{ + if (!ToolbarSet) + return; + + for ( var x = 0 ; x < ToolbarSet.length ; x++ ) + { + var oToolbarItems = ToolbarSet[x] ; + + // If the configuration for the toolbar is missing some element or has any extra comma + // this item won't be valid, so skip it and keep on processing. + if ( !oToolbarItems ) + continue ; + + if ( typeof( oToolbarItems ) == 'object' ) + { + for ( var j = 0 ; j < oToolbarItems.length ; j++ ) + { + if ( oToolbarItems[j] == CommandName) + { + oToolbarItems.splice(j, 1); + ToolbarSet[x] = oToolbarItems ; + return; + } + } + } + } +} + +// Toolbar button + +// Register the related command. +FCKCommands.RegisterCommand( 'googlemaps', new FCKDialogCommand( 'googlemaps', FCKLang.DlgGMapsTitle, FCKPlugins.Items['googlemaps'].Path + 'dialog/googleMaps.html', 450, 428 ) ) ; + +// Create the "googlemaps" toolbar button. +var oGoogleMapsButton = new FCKToolbarButton( 'googlemaps', FCKLang.GMapsBtn, FCKLang.GMapsBtnTooltip) ; +oGoogleMapsButton.IconPath = FCKPlugins.Items['googlemaps'].Path + 'images/mapIcon.gif' ; + +FCKToolbarItems.RegisterItem( 'googlemaps', oGoogleMapsButton ) ; + + +// Detection of existing maps +/** + FCKCommentsProcessor + --------------------------- + It's run after a document has been loaded, it detects all the protected source elements + + In order to use it, you add your comment parser with + FCKCommentsProcessor.AddParser( function ) +*/ +if (typeof FCKCommentsProcessor === 'undefined') +{ + var FCKCommentsProcessor = FCKDocumentProcessor.AppendNew() ; + FCKCommentsProcessor.ProcessDocument = function( oDoc ) + { + if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG ) + return ; + + if ( !oDoc ) + return ; + + //Find all the comments: + //try to choose the best approach according to the browser: + if ( oDoc.evaluate ) + this.findCommentsXPath( oDoc ); + else + { + if (oDoc.all) + this.findCommentsIE( oDoc.body ) ; + else + this.findComments( oDoc.body ) ; + } + + } + + FCKCommentsProcessor.findCommentsXPath = function(oDoc) { + var nodesSnapshot = oDoc.evaluate('//body//comment()', oDoc.body, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null ); + + for ( var i=0 ; i < nodesSnapshot.snapshotLength; i++ ) + { + this.parseComment( nodesSnapshot.snapshotItem(i) ) ; + } + } + + FCKCommentsProcessor.findCommentsIE = function(oNode) { + var aComments = oNode.getElementsByTagName( '!' ); + for(var i=aComments.length-1; i >=0 ; i--) + { + var comment = aComments[i] ; + if (comment.nodeType == 8 ) // oNode.COMMENT_NODE) + this.parseComment( comment ) ; + } + } + + // Fallback function, iterate all the nodes and its children searching for comments. + FCKCommentsProcessor.findComments = function( oNode ) + { + if (oNode.nodeType == 8 ) // oNode.COMMENT_NODE) + { + this.parseComment( oNode ) ; + } + else + { + if (oNode.hasChildNodes()) + { + var children = oNode.childNodes ; + for (var i = children.length-1; i >=0 ; i--) + this.findComments( children[ i ] ); + } + } + } + + // We get a comment node + // Check that it's one that we are interested on: + FCKCommentsProcessor.parseComment = function( oNode ) + { + var value = oNode.nodeValue ; + + // Difference between 2.4.3 and 2.5 + var prefix = ( FCKConfig.ProtectedSource._CodeTag || 'PS\\.\\.' ) ; + + var regex = new RegExp( "\\{" + prefix + "(\\d+)\\}", "g" ) ; + + if ( regex.test( value ) ) + { + var index = RegExp.$1 ; + var content = FCKTempBin.Elements[ index ] ; + + // Now call the registered parser handlers. + var oCalls = this.ParserHandlers ; + if ( oCalls ) + { + for ( var i = 0 ; i < oCalls.length ; i++ ) + oCalls[ i ]( oNode, content, index ) ; + + } + + } + } + + /** + The users of the object will add a parser here, the callback function gets two parameters: + oNode: it's the node in the editorDocument that holds the position of our content + oContent: it's the node (removed from the document) that holds the original contents + index: the reference in the FCKTempBin of our content + */ + FCKCommentsProcessor.AddParser = function( handlerFunction ) + { + if ( !this.ParserHandlers ) + this.ParserHandlers = [ handlerFunction ] ; + else + { + // Check that the event handler isn't already registered with the same listener + // It doesn't detect function pointers belonging to an object (at least in Gecko) + if ( this.ParserHandlers.IndexOf( handlerFunction ) == -1 ) + this.ParserHandlers.push( handlerFunction ) ; + } + } +} +/** + END of FCKCommentsProcessor + --------------------------- +*/ + + + + +// Check if the comment it's one of our scripts: +var GoogleMaps_CommentsProcessorParser = function( oNode, oContent, index) +{ + if ( FCK.GoogleMapsHandler.detectMapScript( oContent ) ) + { + var oMap = FCK.GoogleMapsHandler.createNew() ; + oMap.parse( oContent ) ; + oMap.createHtmlElement( oNode, index ) ; + } + else + { + if ( FCK.GoogleMapsHandler.detectGoogleScript( oContent ) ) + oNode.parentNode.removeChild( oNode ); + } +} + +FCKCommentsProcessor.AddParser( GoogleMaps_CommentsProcessorParser ); + + + +// Context menu +FCK.ContextMenu.RegisterListener( { + AddItems : function( menu, tag, tagName ) + { + // under what circumstances do we display this option + if ( tagName == 'IMG' && tag.getAttribute( 'MapNumber' ) ) + { + // No other options: + menu.RemoveAllItems() ; + // the command needs the registered command name, the title for the context menu, and the icon path + menu.AddItem( 'googlemaps', FCKLang.DlgGMapsTitle, oGoogleMapsButton.IconPath ) ; + } + }} +); + +// Double click +FCK.RegisterDoubleClickHandler( editMap, 'IMG' ) ; + +function editMap( oNode ) +{ + if ( !oNode.getAttribute( 'MapNumber' )) + return ; + + FCK.Commands.GetCommand( 'googlemaps' ).Execute() ; +} + + +// Object that handles the common functions about all the maps +FCK.GoogleMapsHandler = { + // Object to store a reference to each map + maps: {}, + + getMap: function(id){ + return this.maps[id]; + }, + + // Verify that the node is a script generated by this plugin. + detectMapScript: function( script ) + { + // We only know about version 1: + if ( !(/FCK googlemaps v1\.(\d+)/.test(script)) ) + return false; + + return true + }, + + // Self-executed function, we want to run it once at initialization only. + // Public key that will be used for the generated maps, + // while we are editing we will use only FCKConfig.GoogleMaps_Key + publicKey : function() { + // if FCKConfig.GoogleMaps_PublicKey is set to something, then use it + if ( FCKConfig.GoogleMaps_PublicKey ) + return FCKConfig.GoogleMaps_PublicKey ; + + // else we will use GoogleMaps_Key for both the public and private side. + return FCKConfig.GoogleMaps_Key ; + }(), + + // Detects both the google script as well as our ending block + // both must be removed and then added later only if neccesary + detectGoogleScript: function( script ) + { + // Our final script + if (/FCK googlemapsEnd v1\./.test(script) ) + return true ; + + // If it is the Google Maps script, get the public key from here: + if ( !/^' ; + }, + + // This can be called from the dialog + createNew: function() + { + var map = new FCKGoogleMap() ; + this.maps[ map.number ] = map; + return map; + }, + + BuildEndingScript: function() + { + var versionMarker = '// FCK googlemapsEnd v1.97'; + + var aScript = [] ; + aScript.push('\r\n'); + + return aScript.join('\r\n'); + }, + + // We will use this to track the number of maps that are generated + // This way we know if we must add the Google Script or not. + // We store their names so they are called properly from BuildEndingScript + CreatedMapsNames : [], + + // Function that will be injected into the normal core + GetXHTMLAfter: function( node, includeNode, format, Result ) + { + if (FCK.GoogleMapsHandler.CreatedMapsNames.length > 0) + { + Result += FCK.GoogleMapsHandler.BuildEndingScript() ; + } + // Reset the counter each time the GetXHTML function is called + FCK.GoogleMapsHandler.CreatedMapsNames = []; + + return Result ; + }, + + // Store any previous processor so nothing breaks + previousProcessor: FCKXHtml.TagProcessors[ 'img' ] +} + + +// Our object that will handle parsing of the script and creating the new one. +var FCKGoogleMap = function() +{ + var now = new Date() ; + this.number = '' + now.getFullYear() + now.getMonth() + now.getDate() + now.getHours() + now.getMinutes() + now.getSeconds() ; + + this.width = FCKConfig.GoogleMaps_Width || 400 ; + this.height = FCKConfig.GoogleMaps_Height || 240 ; + + this.centerLat = FCKConfig.GoogleMaps_CenterLat || 37.4419 ; + this.centerLon = FCKConfig.GoogleMaps_CenterLon || -122.1419 ; + this.zoom = FCKConfig.GoogleMaps_Zoom || 11 ; + + this.markerPoints = [] ; + + this.LinePoints = '' ; + this.LineLevels = '' ; + + this.mapType = 0 ; + + this.WrapperClass = FCKConfig.GoogleMaps_WrapperClass || '' ; +} + + +FCKGoogleMap.prototype.createHtmlElement = function( oReplacedNode, index) +{ + var oFakeNode = FCK.EditorDocument.createElement( 'IMG' ) ; + + // Are we creating a new map? + if ( !oReplacedNode ) + { + index = FCKTempBin.AddElement( this.BuildScript() ) ; + var prefix = ( FCKConfig.ProtectedSource._CodeTag || 'PS..' ) ; + oReplacedNode = FCK.EditorDocument.createComment( '{' + prefix + index + '}' ) ; + FCK.InsertElement(oReplacedNode); + } + oFakeNode.contentEditable = false ; +// oFakeNode.setAttribute( '_fckfakelement', 'true', 0 ) ; + + oFakeNode.setAttribute( '_fckrealelement', FCKTempBin.AddElement( oReplacedNode ), 0 ) ; + oFakeNode.setAttribute( '_fckBinNode', index, 0 ) ; + + oFakeNode.src = FCKConfig.FullBasePath + 'images/spacer.gif' ; + oFakeNode.style.display = 'block' ; + oFakeNode.style.border = '1px solid black' ; + oFakeNode.style.background = 'white center center url("' + FCKPlugins.Items['googlemaps'].Path + 'images/maps_res_logo.png' + '") no-repeat' ; + + oFakeNode.setAttribute("MapNumber", this.number, 0) ; + + oReplacedNode.parentNode.insertBefore( oFakeNode, oReplacedNode ) ; + oReplacedNode.parentNode.removeChild( oReplacedNode ) ; + + // dimensions + this.updateHTMLElement( oFakeNode ); + + return oFakeNode ; +} + +FCKGoogleMap.prototype.updateScript = function( oFakeNode ) +{ + this.updateDimensions( oFakeNode ) ; + + var index = oFakeNode.getAttribute( '_fckBinNode' ); + FCKTempBin.Elements[ index ] = this.BuildScript() ; +} + +FCKGoogleMap.prototype.updateHTMLElement = function( oFakeNode ) +{ + oFakeNode.width = this.width ; + oFakeNode.height = this.height ; + + // Static maps preview :-) + oFakeNode.src = this.generateStaticMap() ; + oFakeNode.style.border = 0 ; + + // The wrapper class is applied to the IMG not to a wrapping DIV !!! + if ( this.WrapperClass !== '') + oFakeNode.className = this.WrapperClass ; +} + +FCKGoogleMap.prototype.generateStaticMap = function() +{ + var w = Math.min(this.width, 640); + var h = Math.min(this.height, 640); + var staticMapTypes = ['roadmap', 'satellite', 'hybrid', 'terrain'] ; + + return 'http://maps.google.com/staticmap?center=' + this.centerLat + ',' + this.centerLon + + '&zoom=' + this.zoom + '&size=' + w + 'x' + h + + '&maptype=' + staticMapTypes[ this.mapType ] + + this.generateStaticMarkers() + + '&key=' + FCKConfig.GoogleMaps_Key +} + +FCKGoogleMap.prototype.generateStaticMarkers = function() +{ + if (this.markerPoints.length==0) + return ''; + + var aPoints = []; + for (var i=0; i.
'); + var regexpDimensions = /
/ ; + if (regexpDimensions.test( script ) ) + { + delete FCK.GoogleMapsHandler.maps[this.number] ; + this.number = RegExp.$1 ; + FCK.GoogleMapsHandler.maps[this.number] = this ; + + this.width = RegExp.$2 ; + this.height = RegExp.$3 ; + } + +// map.setCenter(new GLatLng(42.4298,-8.07756), 8); + var regexpPosition = /map\.setCenter\(new GLatLng\((-?\d{1,3}\.\d{1,6}),(-?\d{1,3}\.\d{1,6})\), (\d{1,2})\);/ ; + if (regexpPosition.test( script ) ) + { + this.centerLat = RegExp.$1 ; + this.centerLon = RegExp.$2 ; + this.zoom = RegExp.$3 ; + } + +// v <= 1.5 + if ( version<=5 ) + { + // var text = 'En O Carballino ha estado la d\'elegacion diplomatica japonesa'; + var markerText, markerLat=0, markerLon=0; + var regexpText = /var text\s*=\s*("|')(.*)\1;\s*\n/ ; + if (regexpText.test( script ) ) + { + markerText = RegExp.$2 ; + } + + // var point = new GLatLng(42.4298,-8.07756); + var regexpMarker = /var point\s*=\s*new GLatLng\((-?\d{1,3}\.\d{1,6}),(-?\d{1,3}\.\d{1,6})\)/ ; + if (regexpMarker.test( script ) ) + { + markerLat = RegExp.$1 ; + markerLon = RegExp.$2 ; + } + if (markerLat!=0 && markerLon!=0) + this.markerPoints.push( {lat:markerLat, lon:markerLon, text:this.decodeText(markerText)} ) ; + } + else + { + // v > 1.5. multiple points. + + // AddMarkers( [{lat:37.45088, lon:-122.21123, text:'Write your text'}] ) ; + var regexpMarkers = /\{lat\:(-?\d{1,3}\.\d{1,6}),\s*lon\:(-?\d{1,3}\.\d{1,6}),\s*text\:("|')(.*)\3}(?:,|])/ ; + var point; + var sampleText = script ; + var startIndex = 0; + var totalLength = sampleText.length; + var result, pos; + while (startIndex != totalLength) { + result = regexpMarkers.exec(sampleText); + if (result && result.length > 0) { + pos = sampleText.indexOf(result[0]); + startIndex += pos; + + this.markerPoints.push( {lat:result[1], lon:result[2], text:this.decodeText(result[4])} ) ; + + sampleText = sampleText.substr(pos + result[0].length); + startIndex += result[0].length; + } else { + break; + } + } + /* + while (result = regexpMarkers.exec( script ) ) + { + this.markerPoints.push( {lat:result[1], lon:result[2], text:result[4]} ) ; + } + */ + } + +// var encodedPoints = "iuowFf{kbMzH}N`IbJb@zBpYzO{dAvfF{LwDyN`_@`NzKqB|Ec@|L}BKmBbCoPjrBeEdy@uJ`Mn@zoAer@bjA~Xz{JczBa]pIps@de@tW}rCdxSwhPl`XgikCl{soA{dLdAaaF~cCyxCk_Aao@jp@kEvnCgoJ`]y[pVguKhCkUflAwrEzKk@yzCv^k@?mI"; + var regexpLinePoints = /var encodedPoints\s*=\s*("|')(.*)\1;\s*\n/ ; + if (regexpLinePoints.test( script ) ) + { + this.LinePoints = RegExp.$2 ; + } + +// var encodedLevels = "B????????????????????????????????????B"; + var regexpLineLevels = /var encodedLevels\s*=\s*("|')(.*)\1;\s*\n/ ; + if (regexpLineLevels.test( script ) ) + { + this.LineLevels = RegExp.$2 ; + } + +// 1.8 mapType +// map.setMapType( allMapTypes[ 1 ] ); + var regexpMapType = /setMapType\([^\[]*\[\s*(\d+)\s*\]\s*\)/ ; + if (regexpMapType.test( script ) ) + { + this.mapType = RegExp.$1 ; + } + +// 1.9 wrapper div with custom class + if ( version >= 9 ) + { + var regexpWrapper = /
') ; + aScript.push( versionMarker ) ; + + if ( this.WrapperClass !== '') + aScript.push('document.write(\'
\'); //wrapper'); + + aScript.push('document.write(\'
.<\\\/div>\');'); + + if ( this.WrapperClass !== '') + aScript.push('document.write(\'<\\\/div>\'); '); + + aScript.push('function CreateGMap' + this.number + '() {'); + aScript.push(' if(!GBrowserIsCompatible()) return;'); + + aScript.push(' var allMapTypes = [G_NORMAL_MAP, G_SATELLITE_MAP, G_HYBRID_MAP, G_PHYSICAL_MAP] ;'); + aScript.push(' var map = new GMap2(document.getElementById("gmap' + this.number + '"), {mapTypes:allMapTypes});'); + aScript.push(' map.setCenter(new GLatLng(' + this.centerLat + ',' + this.centerLon + '), ' + this.zoom + ');'); + + aScript.push(' map.setMapType( allMapTypes[ ' + this.mapType + ' ] );'); + + aScript.push(' map.addControl(new GSmallMapControl());'); + aScript.push(' map.addControl(new GMapTypeControl());'); + + + var aPoints = []; + for (var i=0; i'); + + return aScript.join('\r\n'); +} + + + +// Modifications of the core routines of FCKeditor: + +FCKXHtml.GetXHTML = Inject(FCKXHtml.GetXHTML, null, FCK.GoogleMapsHandler.GetXHTMLAfter ) ; + +FCKXHtml.TagProcessors.img = function( node, htmlNode, xmlNode ) +{ + if ( htmlNode.getAttribute( 'MapNumber' ) ) + { + var oMap = FCK.GoogleMapsHandler.getMap( htmlNode.getAttribute( 'MapNumber' ) ) ; + FCK.GoogleMapsHandler.CreatedMapsNames.push( oMap.number ) ; + + oMap.updateScript( htmlNode ); + node = FCK.GetRealElement( htmlNode ) ; + if ( FCK.GoogleMapsHandler.CreatedMapsNames.length == 1 ) + { + // If it is the first map, insert the google maps script + var index = FCKTempBin.AddElement( FCK.GoogleMapsHandler.GenerateGoogleScript() ) ; + var prefix = ( FCKConfig.ProtectedSource._CodeTag || 'PS..' ) ; + oScriptCommentNode = xmlNode.ownerDocument.createComment( '{' + prefix + index + '}' ) ; + xmlNode.appendChild( oScriptCommentNode ) ; + } + + return xmlNode.ownerDocument.createComment( node.nodeValue ) ; + } + + if (typeof FCK.GoogleMapsHandler.previousProcessor == 'function') + node = FCK.GoogleMapsHandler.previousProcessor( node, htmlNode, xmlNode ) ; + else + node = FCKXHtml._AppendChildNodes( node, htmlNode, false ) ; + + return node ; +}; + +/** + @desc inject the function + @author Aimingoo&Riceball +*/ +function Inject( aOrgFunc, aBeforeExec, aAtferExec ) { + return function() { + if (typeof(aBeforeExec) == 'function') arguments = aBeforeExec.apply(this, arguments) || arguments; + //convert arguments object to array + var Result, args = [].slice.call(arguments); + args.push(aOrgFunc.apply(this, args)); + if (typeof(aAtferExec) == 'function') Result = aAtferExec.apply(this, args); + return (typeof(Result) != 'undefined')?Result:args.pop(); + } ; +} diff --git a/main/inc/lib/fckeditor/editor/plugins/googlemaps/fckplugin_compressed.js b/main/inc/lib/fckeditor/editor/plugins/googlemaps/fckplugin_compressed.js old mode 100644 new mode 100755 index c699d62ec7..4ea42387ed --- a/main/inc/lib/fckeditor/editor/plugins/googlemaps/fckplugin_compressed.js +++ b/main/inc/lib/fckeditor/editor/plugins/googlemaps/fckplugin_compressed.js @@ -1 +1 @@ -if (typeof(FCKConfig.GoogleMaps_Key)!='string'){alert('Error.\r\nThe configuration doesn\'t contain the Google Maps key.\r\nPlease read the Configuration section.');window.open(FCKPlugins.Items['googlemaps'].Path+'docs/'+FCKLang.GMapsHelpFile+'#configure');};if (!FCKConfig.GoogleMaps_Key||FCKConfig.GoogleMaps_Key.length===0){for(var name in FCKConfig.ToolbarSets) RemoveButtonFromToolbarSet(FCKConfig.ToolbarSets[name],'googlemaps');};function RemoveButtonFromToolbarSet(A,B){if (!A) return;for (var x=0;x=0;i--){var C=B[i];if (C.nodeType==8) this.parseComment(C);}};FCKCommentsProcessor.findComments=function(A){if (A.nodeType==8){this.parseComment(A);}else{if (A.hasChildNodes()){var B=A.childNodes;for (var i=B.length-1;i>=0;i--) this.findComments(B[i]);}}};FCKCommentsProcessor.parseComment=function(A){var B=A.nodeValue;var C=(FCKConfig.ProtectedSource._CodeTag||'PS\\.\\.');var D=new RegExp("\\{"+C+"(\\d+)\\}","g");if (D.test(B)){var E=RegExp.$1;var F=FCKTempBin.Elements[E];var G=this.ParserHandlers;if (G){for (var i=0;i';},createNew:function(){var A=new FCKGoogleMap();this.maps[A.number]=A;return A;},BuildEndingScript:function(){var A='// FCK googlemapsEnd v1.97';var B=[];B.push('\r\n');return B.join('\r\n');},CreatedMapsNames:[],GetXHTMLAfter:function(A,B,C,D){if (FCK.GoogleMapsHandler.CreatedMapsNames.length>0){D+=FCK.GoogleMapsHandler.BuildEndingScript();};FCK.GoogleMapsHandler.CreatedMapsNames=[];return D;},previousProcessor:FCKXHtml.TagProcessors['img']};var FCKGoogleMap=function(){var A=new Date();this.number=''+A.getFullYear()+A.getMonth()+A.getDate()+A.getHours()+A.getMinutes()+A.getSeconds();this.width=FCKConfig.GoogleMaps_Width||400;this.height=FCKConfig.GoogleMaps_Height||240;this.centerLat=FCKConfig.GoogleMaps_CenterLat||37.4419;this.centerLon=FCKConfig.GoogleMaps_CenterLon||-122.1419;this.zoom=FCKConfig.GoogleMaps_Zoom||11;this.markerPoints=[];this.LinePoints='';this.LineLevels='';this.mapType=0;this.WrapperClass=FCKConfig.GoogleMaps_WrapperClass||'';};FCKGoogleMap.prototype.createHtmlElement=function(A,B){var C=FCK.EditorDocument.createElement('IMG');if (!A){B=FCKTempBin.AddElement(this.BuildScript());var D=(FCKConfig.ProtectedSource._CodeTag||'PS..');A=FCK.EditorDocument.createComment('{'+D+B+'}');FCK.InsertElement(A);};C.contentEditable=false;C.setAttribute('_fckrealelement',FCKTempBin.AddElement(A),0);C.setAttribute('_fckBinNode',B,0);C.src=FCKConfig.FullBasePath+'images/spacer.gif';C.style.display='block';C.style.border='1px solid black';C.style.background='white center center url("'+FCKPlugins.Items['googlemaps'].Path+'images/maps_res_logo.png") no-repeat';C.setAttribute("MapNumber",this.number,0);A.parentNode.insertBefore(C,A);A.parentNode.removeChild(A);this.updateHTMLElement(C);return C;};FCKGoogleMap.prototype.updateScript=function(A){this.updateDimensions(A);var B=A.getAttribute('_fckBinNode');FCKTempBin.Elements[B]=this.BuildScript();};FCKGoogleMap.prototype.updateHTMLElement=function(A){A.width=this.width;A.height=this.height;A.src=this.generateStaticMap();A.style.border=0;if (this.WrapperClass!=='') A.className=this.WrapperClass;};FCKGoogleMap.prototype.generateStaticMap=function(){var w=Math.min(this.width,640);var h=Math.min(this.height,640);var A=['roadmap','satellite','hybrid','terrain'];return 'http://maps.google.com/staticmap?center='+this.centerLat+','+this.centerLon+'&zoom='+this.zoom+'&size='+w+'x'+h+'&maptype='+A[this.mapType]+this.generateStaticMarkers()+'&key='+FCKConfig.GoogleMaps_Key};FCKGoogleMap.prototype.generateStaticMarkers=function(){if (this.markerPoints.length==0) return '';var A=[];for (var i=0;i/;if (C.test(A)){delete FCK.GoogleMapsHandler.maps[this.number];this.number=RegExp.$1;FCK.GoogleMapsHandler.maps[this.number]=this;this.width=RegExp.$2;this.height=RegExp.$3;};var D=/map\.setCenter\(new GLatLng\((-?\d{1,3}\.\d{1,6}),(-?\d{1,3}\.\d{1,6})\), (\d{1,2})\);/;if (D.test(A)){this.centerLat=RegExp.$1;this.centerLon=RegExp.$2;this.zoom=RegExp.$3;};if (B<=5){var E,F=0,G=0;var H=/var text\s*=\s*("|')(.*)\1;\s*\n/;if (H.test(A)){E=RegExp.$2;};var I=/var point\s*=\s*new GLatLng\((-?\d{1,3}\.\d{1,6}),(-?\d{1,3}\.\d{1,6})\)/;if (I.test(A)){F=RegExp.$1;G=RegExp.$2;};if (F!=0&&G!=0) this.markerPoints.push({lat:F,lon:G,text:this.decodeText(E)});}else{var J=/\{lat\:(-?\d{1,3}\.\d{1,6}),\s*lon\:(-?\d{1,3}\.\d{1,6}),\s*text\:("|')(.*)\3}(?:,|])/;var K;var L=A;var M=0;var N=L.length;var O,P;while (M!=N) {O=J.exec(L);if (O&&O.length>0) {P=L.indexOf(O[0]);M+=P;this.markerPoints.push({lat:O[1],lon:O[2],text:this.decodeText(O[4])});L=L.substr(P+O[0].length);M+=O[0].length;} else {break;}}};var Q=/var encodedPoints\s*=\s*("|')(.*)\1;\s*\n/;if (Q.test(A)){this.LinePoints=RegExp.$2;};var R=/var encodedLevels\s*=\s*("|')(.*)\1;\s*\n/;if (R.test(A)){this.LineLevels=RegExp.$2;};var S=/setMapType\([^\[]*\[\s*(\d+)\s*\]\s*\)/;if (S.test(A)){this.mapType=RegExp.$1;};if (B>=9){var T=/
');B.push(A);if (this.WrapperClass!=='') B.push('document.write(\'
\'); //wrapper');B.push('document.write(\'
.<\\\/div>\');');if (this.WrapperClass!=='') B.push('document.write(\'<\\\/div>\'); ');B.push('function CreateGMap'+this.number+'() {');B.push(' if(!GBrowserIsCompatible()) return;');B.push(' var allMapTypes = [G_NORMAL_MAP, G_SATELLITE_MAP, G_HYBRID_MAP, G_PHYSICAL_MAP] ;');B.push(' var map = new GMap2(document.getElementById("gmap'+this.number+'"), {mapTypes:allMapTypes});');B.push(' map.setCenter(new GLatLng('+this.centerLat+','+this.centerLon+'), '+this.zoom+');');B.push(' map.setMapType( allMapTypes[ '+this.mapType+' ] );');B.push(' map.addControl(new GSmallMapControl());');B.push(' map.addControl(new GMapTypeControl());');var C=[];for (var i=0;i');return B.join('\r\n');};FCKXHtml.GetXHTML=Inject(FCKXHtml.GetXHTML,null,FCK.GoogleMapsHandler.GetXHTMLAfter);FCKXHtml.TagProcessors.img=function(A,B,C){if (B.getAttribute('MapNumber')){var D=FCK.GoogleMapsHandler.getMap(B.getAttribute('MapNumber'));FCK.GoogleMapsHandler.CreatedMapsNames.push(D.number);D.updateScript(B);A=FCK.GetRealElement(B);if (FCK.GoogleMapsHandler.CreatedMapsNames.length==1){var E=FCKTempBin.AddElement(FCK.GoogleMapsHandler.GenerateGoogleScript());var F=(FCKConfig.ProtectedSource._CodeTag||'PS..');oScriptCommentNode=C.ownerDocument.createComment('{'+F+E+'}');C.appendChild(oScriptCommentNode);};return C.ownerDocument.createComment(A.nodeValue);};if (typeof FCK.GoogleMapsHandler.previousProcessor=='function') A=FCK.GoogleMapsHandler.previousProcessor(A,B,C);else A=FCKXHtml._AppendChildNodes(A,B,false);return A;};function Inject(A,B,C) {return function() {if (typeof(B)=='function') arguments=B.apply(this,arguments)||arguments;var D,E=[].slice.call(arguments);E.push(A.apply(this,E));if (typeof(C)=='function') D=C.apply(this,E);return (typeof(D)!='undefined')?D:E.pop();};}; +if (typeof(FCKConfig.GoogleMaps_Key)!='string'){alert('Error.\r\nThe configuration doesn\'t contain the Google Maps key.\r\nPlease read the Configuration section.');window.open(FCKPlugins.Items['googlemaps'].Path+'docs/'+FCKLang.GMapsHelpFile+'#configure');};if (!FCKConfig.GoogleMaps_Key||FCKConfig.GoogleMaps_Key.length===0){for(var name in FCKConfig.ToolbarSets) RemoveButtonFromToolbarSet(FCKConfig.ToolbarSets[name],'googlemaps');};function RemoveButtonFromToolbarSet(A,B){if (!A) return;for (var x=0;x=0;i--){var C=B[i];if (C.nodeType==8) this.parseComment(C);}};FCKCommentsProcessor.findComments=function(A){if (A.nodeType==8){this.parseComment(A);}else{if (A.hasChildNodes()){var B=A.childNodes;for (var i=B.length-1;i>=0;i--) this.findComments(B[i]);}}};FCKCommentsProcessor.parseComment=function(A){var B=A.nodeValue;var C=(FCKConfig.ProtectedSource._CodeTag||'PS\\.\\.');var D=new RegExp("\\{"+C+"(\\d+)\\}","g");if (D.test(B)){var E=RegExp.$1;var F=FCKTempBin.Elements[E];var G=this.ParserHandlers;if (G){for (var i=0;i';},createNew:function(){var A=new FCKGoogleMap();this.maps[A.number]=A;return A;},BuildEndingScript:function(){var A='// FCK googlemapsEnd v1.97';var B=[];B.push('\r\n');return B.join('\r\n');},CreatedMapsNames:[],GetXHTMLAfter:function(A,B,C,D){if (FCK.GoogleMapsHandler.CreatedMapsNames.length>0){D+=FCK.GoogleMapsHandler.BuildEndingScript();};FCK.GoogleMapsHandler.CreatedMapsNames=[];return D;},previousProcessor:FCKXHtml.TagProcessors['img']};var FCKGoogleMap=function(){var A=new Date();this.number=''+A.getFullYear()+A.getMonth()+A.getDate()+A.getHours()+A.getMinutes()+A.getSeconds();this.width=FCKConfig.GoogleMaps_Width||400;this.height=FCKConfig.GoogleMaps_Height||240;this.centerLat=FCKConfig.GoogleMaps_CenterLat||37.4419;this.centerLon=FCKConfig.GoogleMaps_CenterLon||-122.1419;this.zoom=FCKConfig.GoogleMaps_Zoom||11;this.markerPoints=[];this.LinePoints='';this.LineLevels='';this.mapType=0;this.WrapperClass=FCKConfig.GoogleMaps_WrapperClass||'';};FCKGoogleMap.prototype.createHtmlElement=function(A,B){var C=FCK.EditorDocument.createElement('IMG');if (!A){B=FCKTempBin.AddElement(this.BuildScript());var D=(FCKConfig.ProtectedSource._CodeTag||'PS..');A=FCK.EditorDocument.createComment('{'+D+B+'}');FCK.InsertElement(A);};C.contentEditable=false;C.setAttribute('_fckrealelement',FCKTempBin.AddElement(A),0);C.setAttribute('_fckBinNode',B,0);C.src=FCKConfig.FullBasePath+'images/spacer.gif';C.style.display='block';C.style.border='1px solid black';C.style.background='white center center url("'+FCKPlugins.Items['googlemaps'].Path+'images/maps_res_logo.png") no-repeat';C.setAttribute("MapNumber",this.number,0);A.parentNode.insertBefore(C,A);A.parentNode.removeChild(A);this.updateHTMLElement(C);return C;};FCKGoogleMap.prototype.updateScript=function(A){this.updateDimensions(A);var B=A.getAttribute('_fckBinNode');FCKTempBin.Elements[B]=this.BuildScript();};FCKGoogleMap.prototype.updateHTMLElement=function(A){A.width=this.width;A.height=this.height;A.src=this.generateStaticMap();A.style.border=0;if (this.WrapperClass!=='') A.className=this.WrapperClass;};FCKGoogleMap.prototype.generateStaticMap=function(){var w=Math.min(this.width,640);var h=Math.min(this.height,640);var A=['roadmap','satellite','hybrid','terrain'];return 'http://maps.google.com/staticmap?center='+this.centerLat+','+this.centerLon+'&zoom='+this.zoom+'&size='+w+'x'+h+'&maptype='+A[this.mapType]+this.generateStaticMarkers()+'&key='+FCKConfig.GoogleMaps_Key};FCKGoogleMap.prototype.generateStaticMarkers=function(){if (this.markerPoints.length==0) return '';var A=[];for (var i=0;i/;if (C.test(A)){delete FCK.GoogleMapsHandler.maps[this.number];this.number=RegExp.$1;FCK.GoogleMapsHandler.maps[this.number]=this;this.width=RegExp.$2;this.height=RegExp.$3;};var D=/map\.setCenter\(new GLatLng\((-?\d{1,3}\.\d{1,6}),(-?\d{1,3}\.\d{1,6})\), (\d{1,2})\);/;if (D.test(A)){this.centerLat=RegExp.$1;this.centerLon=RegExp.$2;this.zoom=RegExp.$3;};if (B<=5){var E,F=0,G=0;var H=/var text\s*=\s*("|')(.*)\1;\s*\n/;if (H.test(A)){E=RegExp.$2;};var I=/var point\s*=\s*new GLatLng\((-?\d{1,3}\.\d{1,6}),(-?\d{1,3}\.\d{1,6})\)/;if (I.test(A)){F=RegExp.$1;G=RegExp.$2;};if (F!=0&&G!=0) this.markerPoints.push({lat:F,lon:G,text:this.decodeText(E)});}else{var J=/\{lat\:(-?\d{1,3}\.\d{1,6}),\s*lon\:(-?\d{1,3}\.\d{1,6}),\s*text\:("|')(.*)\3}(?:,|])/;var K;var L=A;var M=0;var N=L.length;var O,P;while (M!=N) {O=J.exec(L);if (O&&O.length>0) {P=L.indexOf(O[0]);M+=P;this.markerPoints.push({lat:O[1],lon:O[2],text:this.decodeText(O[4])});L=L.substr(P+O[0].length);M+=O[0].length;} else {break;}}};var Q=/var encodedPoints\s*=\s*("|')(.*)\1;\s*\n/;if (Q.test(A)){this.LinePoints=RegExp.$2;};var R=/var encodedLevels\s*=\s*("|')(.*)\1;\s*\n/;if (R.test(A)){this.LineLevels=RegExp.$2;};var S=/setMapType\([^\[]*\[\s*(\d+)\s*\]\s*\)/;if (S.test(A)){this.mapType=RegExp.$1;};if (B>=9){var T=/
');B.push(A);if (this.WrapperClass!=='') B.push('document.write(\'
\'); //wrapper');B.push('document.write(\'
.<\\\/div>\');');if (this.WrapperClass!=='') B.push('document.write(\'<\\\/div>\'); ');B.push('function CreateGMap'+this.number+'() {');B.push(' if(!GBrowserIsCompatible()) return;');B.push(' var allMapTypes = [G_NORMAL_MAP, G_SATELLITE_MAP, G_HYBRID_MAP, G_PHYSICAL_MAP] ;');B.push(' var map = new GMap2(document.getElementById("gmap'+this.number+'"), {mapTypes:allMapTypes});');B.push(' map.setCenter(new GLatLng('+this.centerLat+','+this.centerLon+'), '+this.zoom+');');B.push(' map.setMapType( allMapTypes[ '+this.mapType+' ] );');B.push(' map.addControl(new GSmallMapControl());');B.push(' map.addControl(new GMapTypeControl());');var C=[];for (var i=0;i');return B.join('\r\n');};FCKXHtml.GetXHTML=Inject(FCKXHtml.GetXHTML,null,FCK.GoogleMapsHandler.GetXHTMLAfter);FCKXHtml.TagProcessors.img=function(A,B,C){if (B.getAttribute('MapNumber')){var D=FCK.GoogleMapsHandler.getMap(B.getAttribute('MapNumber'));FCK.GoogleMapsHandler.CreatedMapsNames.push(D.number);D.updateScript(B);A=FCK.GetRealElement(B);if (FCK.GoogleMapsHandler.CreatedMapsNames.length==1){var E=FCKTempBin.AddElement(FCK.GoogleMapsHandler.GenerateGoogleScript());var F=(FCKConfig.ProtectedSource._CodeTag||'PS..');oScriptCommentNode=C.ownerDocument.createComment('{'+F+E+'}');C.appendChild(oScriptCommentNode);};return C.ownerDocument.createComment(A.nodeValue);};if (typeof FCK.GoogleMapsHandler.previousProcessor=='function') A=FCK.GoogleMapsHandler.previousProcessor(A,B,C);else A=FCKXHtml._AppendChildNodes(A,B,false);return A;};function Inject(A,B,C) {return function() {if (typeof(B)=='function') arguments=B.apply(this,arguments)||arguments;var D,E=[].slice.call(arguments);E.push(A.apply(this,E));if (typeof(C)=='function') D=C.apply(this,E);return (typeof(D)!='undefined')?D:E.pop();};}; diff --git a/main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/en.js b/main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/en.js old mode 100644 new mode 100755 index c0361940a3..c69bef070f --- a/main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/en.js +++ b/main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/en.js @@ -1,45 +1,45 @@ -/* - * == BEGIN LICENSE == - * - * Licensed under the terms of any of the following licenses at your - * choice: - * - * - GNU General Public License Version 2 or later (the "GPL") - * http://www.gnu.org/licenses/gpl.html - * - * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") - * http://www.gnu.org/licenses/lgpl.html - * - * - Mozilla Public License Version 1.1 or later (the "MPL") - * http://www.mozilla.org/MPL/MPL-1.1.html - * - * == END LICENSE == - * - * Google Maps for FCKeditor, English language file. - */ - -FCKLang.DlgGMapsTitle = 'Google Maps properties' ; -FCKLang.GMapsBtn = 'Google Maps' ; -FCKLang.GMapsBtnTooltip = 'Insert/Edit a Google Map' ; -FCKLang.GMapsMap = 'Map' ; -FCKLang.GMapsZoomLevel = 'Zoom Level' ; -FCKLang.txtLatitude = 'Latitude' ; -FCKLang.txtLongitude = 'Longitude' ; -FCKLang.GMapsMarker = 'Marker' ; -FCKLang.GMapsSearchLabel = 'Search a direction' ; -FCKLang.GMapsSearch = 'Search' ; -FCKLang.GMapsNotFound = '%s not found.' ; -FCKLang.GMapsMarkerText = 'Text' ; -FCKLang.GMapsMarkerDefaultText = 'Write your text' ; -FCKLang.GMapsLine = 'Line' ; -FCKLang.GMapsLineInstructions = 'Click on the map to place the first point, and then keep on clicking to add more points.
You can drag them or delete them using "DEL" in your keyboard' ; - -FCKLang.GMapsHelpFile = 'install.html' ; -FCKLang.GMapsUserHelpFile = 'users.html' ; -FCKLang.Help = 'Help' ; - -FCKLang.GMapsClickToAddMarker = 'Click on the map to add a new marker' ; -FCKLang.GMapsDeleteMarker = 'Delete marker' ; -FCKLang.GMapsAddMarker = 'Add new marker' ; - +/* + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Google Maps for FCKeditor, English language file. + */ + +FCKLang.DlgGMapsTitle = 'Google Maps properties' ; +FCKLang.GMapsBtn = 'Google Maps' ; +FCKLang.GMapsBtnTooltip = 'Insert/Edit a Google Map' ; +FCKLang.GMapsMap = 'Map' ; +FCKLang.GMapsZoomLevel = 'Zoom Level' ; +FCKLang.txtLatitude = 'Latitude' ; +FCKLang.txtLongitude = 'Longitude' ; +FCKLang.GMapsMarker = 'Marker' ; +FCKLang.GMapsSearchLabel = 'Search a direction' ; +FCKLang.GMapsSearch = 'Search' ; +FCKLang.GMapsNotFound = '%s not found.' ; +FCKLang.GMapsMarkerText = 'Text' ; +FCKLang.GMapsMarkerDefaultText = 'Write your text' ; +FCKLang.GMapsLine = 'Line' ; +FCKLang.GMapsLineInstructions = 'Click on the map to place the first point, and then keep on clicking to add more points.
You can drag them or delete them using "DEL" in your keyboard' ; + +FCKLang.GMapsHelpFile = 'install.html' ; +FCKLang.GMapsUserHelpFile = 'users.html' ; +FCKLang.Help = 'Help' ; + +FCKLang.GMapsClickToAddMarker = 'Click on the map to add a new marker' ; +FCKLang.GMapsDeleteMarker = 'Delete marker' ; +FCKLang.GMapsAddMarker = 'Add new marker' ; + FCKLang.GMaps_MissingKey = 'You must enter the Google Maps Key for your domain.' ; \ No newline at end of file diff --git a/main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/es.js b/main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/es.js old mode 100644 new mode 100755 index eecd86d5a0..d89b10391e --- a/main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/es.js +++ b/main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/es.js @@ -1,45 +1,45 @@ -/* - * == BEGIN LICENSE == - * - * Licensed under the terms of any of the following licenses at your - * choice: - * - * - GNU General Public License Version 2 or later (the "GPL") - * http://www.gnu.org/licenses/gpl.html - * - * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") - * http://www.gnu.org/licenses/lgpl.html - * - * - Mozilla Public License Version 1.1 or later (the "MPL") - * http://www.mozilla.org/MPL/MPL-1.1.html - * - * == END LICENSE == - * - * Google Maps for FCKeditor, Spanish language file. - */ - -FCKLang.DlgGMapsTitle = 'Propiedades del mapa Google' ; -FCKLang.GMapsBtn = 'Mapas Google' ; -FCKLang.GMapsBtnTooltip = 'Insertar/Editar un mapa Google' ; -FCKLang.GMapsMap = 'Mapa' ; -FCKLang.GMapsZoomLevel = 'Zoom' ; -FCKLang.txtLatitude = 'Latitud' ; -FCKLang.txtLongitude = 'Longitud' ; -FCKLang.GMapsMarker = 'Marcador' ; -FCKLang.GMapsSearchLabel = 'Buscar una dirección' ; -FCKLang.GMapsSearch = 'Buscar' ; -FCKLang.GMapsNotFound = 'No se ha encontrado %s.' ; -FCKLang.GMapsMarkerText = 'Texto' ; -FCKLang.GMapsMarkerDefaultText = 'Escriba el texto' ; -FCKLang.GMapsLine = 'Linea' ; -FCKLang.GMapsLineInstructions = 'Haz click en el mapa para añadir un punto, sigue haciendo clicks para añadir más puntos a la linea.
Es posible arrastrarlos, o borrarlos pulsando "SUPR" en el teclado' ; - -FCKLang.GMapsHelpFile = 'install_es.html' ; -FCKLang.GMapsUserHelpFile = 'users_es.html' ; -FCKLang.Help = 'Ayuda' ; - -FCKLang.GMapsClickToAddMarker = 'Haz click en el mapa para añadir un nuevo marcador' ; -FCKLang.GMapsDeleteMarker = 'Borrar el marcador' ; -FCKLang.GMapsAddMarker = 'Añadir un nuevo marcador' ; - +/* + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Google Maps for FCKeditor, Spanish language file. + */ + +FCKLang.DlgGMapsTitle = 'Propiedades del mapa Google' ; +FCKLang.GMapsBtn = 'Mapas Google' ; +FCKLang.GMapsBtnTooltip = 'Insertar/Editar un mapa Google' ; +FCKLang.GMapsMap = 'Mapa' ; +FCKLang.GMapsZoomLevel = 'Zoom' ; +FCKLang.txtLatitude = 'Latitud' ; +FCKLang.txtLongitude = 'Longitud' ; +FCKLang.GMapsMarker = 'Marcador' ; +FCKLang.GMapsSearchLabel = 'Buscar una dirección' ; +FCKLang.GMapsSearch = 'Buscar' ; +FCKLang.GMapsNotFound = 'No se ha encontrado %s.' ; +FCKLang.GMapsMarkerText = 'Texto' ; +FCKLang.GMapsMarkerDefaultText = 'Escriba el texto' ; +FCKLang.GMapsLine = 'Linea' ; +FCKLang.GMapsLineInstructions = 'Haz click en el mapa para añadir un punto, sigue haciendo clicks para añadir más puntos a la linea.
Es posible arrastrarlos, o borrarlos pulsando "SUPR" en el teclado' ; + +FCKLang.GMapsHelpFile = 'install_es.html' ; +FCKLang.GMapsUserHelpFile = 'users_es.html' ; +FCKLang.Help = 'Ayuda' ; + +FCKLang.GMapsClickToAddMarker = 'Haz click en el mapa para añadir un nuevo marcador' ; +FCKLang.GMapsDeleteMarker = 'Borrar el marcador' ; +FCKLang.GMapsAddMarker = 'Añadir un nuevo marcador' ; + FCKLang.GMaps_MissingKey = 'You must enter the Google Maps Key for your domain.' ; \ No newline at end of file diff --git a/main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/fr.js b/main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/fr.js old mode 100644 new mode 100755 index dc9864a8c3..edc8252f90 --- a/main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/fr.js +++ b/main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/fr.js @@ -1,44 +1,44 @@ -/* - * == BEGIN LICENSE == - * - * Licensed under the terms of any of the following licenses at your - * choice: - * - * - GNU General Public License Version 2 or later (the "GPL") - * http://www.gnu.org/licenses/gpl.html - * - * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") - * http://www.gnu.org/licenses/lgpl.html - * - * - Mozilla Public License Version 1.1 or later (the "MPL") - * http://www.mozilla.org/MPL/MPL-1.1.html - * - * == END LICENSE == - * - * Google Maps for FCKeditor, French language file. - */ - -FCKLang.DlgGMapsTitle = 'Propriétés de Google Maps' ; -FCKLang.GMapsBtn = 'Google Maps' ; -FCKLang.GMapsBtnTooltip = 'Insérer/Editer un plan Google' ; -FCKLang.GMapsMap = 'Plan' ; -FCKLang.GMapsZoomLevel = 'Niveau de zoom' ; -FCKLang.txtLatitude = 'Latitude' ; -FCKLang.txtLongitude = 'Longitude' ; -FCKLang.GMapsMarker = 'Repère' ; -FCKLang.GMapsSearchLabel = 'Rechercher une direction' ; -FCKLang.GMapsSearch = 'Chercher' ; -FCKLang.GMapsNotFound = '%s non trouvé.' ; -FCKLang.GMapsMarkerText = 'Texte' ; -FCKLang.GMapsMarkerDefaultText = 'Ecrivez votre texte' ; -FCKLang.GMapsLine = 'Ligne' ; -FCKLang.GMapsLineInstructions = 'Cliquez sur la carte pour placer le premier point, et continuer a cliquez pour ajouter plus de points.
Vous pouvez les déplacer ou les effacer en utilisant "Suppr" sur votre clavier' ; - -FCKLang.GMapsHelpFile = 'install.html' ; -FCKLang.GMapsUserHelpFile = 'users.html' ; -FCKLang.Help = 'Aide' ; - -FCKLang.GMapsClickToAddMarker = 'Cliquez sur la carte pour ajouter un nouveau repère' ; -FCKLang.GMapsDeleteMarker = 'Effacer un repère' ; -FCKLang.GMapsAddMarker = 'Ajouter un nouveau repère' ; - +/* + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Google Maps for FCKeditor, French language file. + */ + +FCKLang.DlgGMapsTitle = 'Propriétés de Google Maps' ; +FCKLang.GMapsBtn = 'Google Maps' ; +FCKLang.GMapsBtnTooltip = 'Insérer/Editer un plan Google' ; +FCKLang.GMapsMap = 'Plan' ; +FCKLang.GMapsZoomLevel = 'Niveau de zoom' ; +FCKLang.txtLatitude = 'Latitude' ; +FCKLang.txtLongitude = 'Longitude' ; +FCKLang.GMapsMarker = 'Repère' ; +FCKLang.GMapsSearchLabel = 'Rechercher une direction' ; +FCKLang.GMapsSearch = 'Chercher' ; +FCKLang.GMapsNotFound = '%s non trouvé.' ; +FCKLang.GMapsMarkerText = 'Texte' ; +FCKLang.GMapsMarkerDefaultText = 'Ecrivez votre texte' ; +FCKLang.GMapsLine = 'Ligne' ; +FCKLang.GMapsLineInstructions = 'Cliquez sur la carte pour placer le premier point, et continuer a cliquez pour ajouter plus de points.
Vous pouvez les déplacer ou les effacer en utilisant "Suppr" sur votre clavier' ; + +FCKLang.GMapsHelpFile = 'install.html' ; +FCKLang.GMapsUserHelpFile = 'users.html' ; +FCKLang.Help = 'Aide' ; + +FCKLang.GMapsClickToAddMarker = 'Cliquez sur la carte pour ajouter un nouveau repère' ; +FCKLang.GMapsDeleteMarker = 'Effacer un repère' ; +FCKLang.GMapsAddMarker = 'Ajouter un nouveau repère' ; + diff --git a/main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/it.js b/main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/it.js old mode 100644 new mode 100755 index 62c075c2c4..3f89eed6c6 --- a/main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/it.js +++ b/main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/it.js @@ -1,45 +1,45 @@ -/* - * == BEGIN LICENSE == - * - * Licensed under the terms of any of the following licenses at your - * choice: - * - * - GNU General Public License Version 2 or later (the "GPL") - * http://www.gnu.org/licenses/gpl.html - * - * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") - * http://www.gnu.org/licenses/lgpl.html - * - * - Mozilla Public License Version 1.1 or later (the "MPL") - * http://www.mozilla.org/MPL/MPL-1.1.html - * - * == END LICENSE == - * - * Google Maps for FCKeditor, English language file. - */ - -FCKLang.DlgGMapsTitle = 'Google Maps Proprietà' ; -FCKLang.GMapsBtn = 'Google Maps' ; -FCKLang.GMapsBtnTooltip = 'Inserisci/Modifica una Google Maps' ; -FCKLang.GMapsMap = 'Mappa' ; -FCKLang.GMapsZoomLevel = 'Zoom' ; -FCKLang.txtLatitude = 'Latitudine' ; -FCKLang.txtLongitude = 'Longitudine' ; -FCKLang.GMapsMarker = 'Marker' ; -FCKLang.GMapsSearchLabel = 'Cerca una direzione' ; -FCKLang.GMapsSearch = 'Cerca una località' ; -FCKLang.GMapsNotFound = '%s non trovato.' ; -FCKLang.GMapsMarkerText = 'Testo' ; -FCKLang.GMapsMarkerDefaultText = 'Inserisci il testo' ; -FCKLang.GMapsLine = 'Tracciato' ; -FCKLang.GMapsLineInstructions = 'Clicca sulla mappa per scegliere il primo punto, e successivamente selezionare gli altri sulla mappa.
Puoi trascinare i punti già selezionati o cancellarli delete usando "CANC" dalla tua tastiera' ; - -FCKLang.GMapsHelpFile = 'install.html' ; -FCKLang.GMapsUserHelpFile = 'users.html' ; -FCKLang.Help = 'Aiuto' ; - -FCKLang.GMapsClickToAddMarker = 'Clicca sulla mappa per aggiungere un nuovo marker' ; -FCKLang.GMapsDeleteMarker = 'Cancella marker' ; -FCKLang.GMapsAddMarker = 'Aggiungi un nuovo marker' ; - +/* + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Google Maps for FCKeditor, English language file. + */ + +FCKLang.DlgGMapsTitle = 'Google Maps Proprietà' ; +FCKLang.GMapsBtn = 'Google Maps' ; +FCKLang.GMapsBtnTooltip = 'Inserisci/Modifica una Google Maps' ; +FCKLang.GMapsMap = 'Mappa' ; +FCKLang.GMapsZoomLevel = 'Zoom' ; +FCKLang.txtLatitude = 'Latitudine' ; +FCKLang.txtLongitude = 'Longitudine' ; +FCKLang.GMapsMarker = 'Marker' ; +FCKLang.GMapsSearchLabel = 'Cerca una direzione' ; +FCKLang.GMapsSearch = 'Cerca una località' ; +FCKLang.GMapsNotFound = '%s non trovato.' ; +FCKLang.GMapsMarkerText = 'Testo' ; +FCKLang.GMapsMarkerDefaultText = 'Inserisci il testo' ; +FCKLang.GMapsLine = 'Tracciato' ; +FCKLang.GMapsLineInstructions = 'Clicca sulla mappa per scegliere il primo punto, e successivamente selezionare gli altri sulla mappa.
Puoi trascinare i punti già selezionati o cancellarli delete usando "CANC" dalla tua tastiera' ; + +FCKLang.GMapsHelpFile = 'install.html' ; +FCKLang.GMapsUserHelpFile = 'users.html' ; +FCKLang.Help = 'Aiuto' ; + +FCKLang.GMapsClickToAddMarker = 'Clicca sulla mappa per aggiungere un nuovo marker' ; +FCKLang.GMapsDeleteMarker = 'Cancella marker' ; +FCKLang.GMapsAddMarker = 'Aggiungi un nuovo marker' ; + FCKLang.GMaps_MissingKey = 'You must enter the Google Maps Key for your domain.' ; \ No newline at end of file diff --git a/main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/nl.js b/main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/nl.js old mode 100644 new mode 100755 index 78af57ae18..965d20b92f --- a/main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/nl.js +++ b/main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/nl.js @@ -1,44 +1,44 @@ -/* - * == BEGIN LICENSE == - * - * Licensed under the terms of any of the following licenses at your - * choice: - * - * - GNU General Public License Version 2 or later (the "GPL") - * http://www.gnu.org/licenses/gpl.html - * - * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") - * http://www.gnu.org/licenses/lgpl.html - * - * - Mozilla Public License Version 1.1 or later (the "MPL") - * http://www.mozilla.org/MPL/MPL-1.1.html - * - * == END LICENSE == - * - * Google Maps for FCKeditor, English language file. - */ - -FCKLang.DlgGMapsTitle = 'Google Maps eigenschappen' ; -FCKLang.GMapsBtn = 'Google Maps' ; -FCKLang.GMapsBtnTooltip = 'Invoegen/Wijzigen een Google Map' ; -FCKLang.GMapsMap = 'Kaart' ; -FCKLang.GMapsZoomLevel = 'Zoom Level' ; -FCKLang.txtLatitude = 'Latitude' ; -FCKLang.txtLongitude = 'Longitude' ; -FCKLang.GMapsMarker = 'Marker' ; -FCKLang.GMapsSearchLabel = 'Zoek een locatie' ; -FCKLang.GMapsSearch = 'Zoeken' ; -FCKLang.GMapsNotFound = '%s is niet gevonden.' ; -FCKLang.GMapsMarkerText = 'Tekst' ; -FCKLang.GMapsMarkerDefaultText = 'Schrijf je eigen tekst' ; -FCKLang.GMapsLine = 'Lijn' ; -FCKLang.GMapsLineInstructions = 'Klik op de kaart om een een eerste marker te plaaten, blijf dan klikken om meer markers te plaatsen.
Je kunt ze slepen of verwijderen met de "DEL" toets' ; - -FCKLang.GMapsHelpFile = 'install.html' ; -FCKLang.GMapsUserHelpFile = 'users.html' ; -FCKLang.Help = 'Help' ; - -FCKLang.GMapsClickToAddMarker = 'klik op de kaart om de marker toe te voegen' ; -FCKLang.GMapsDeleteMarker = 'Verwijder marker' ; -FCKLang.GMapsAddMarker = 'Voeg nieuwe marker toe' ; - +/* + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Google Maps for FCKeditor, English language file. + */ + +FCKLang.DlgGMapsTitle = 'Google Maps eigenschappen' ; +FCKLang.GMapsBtn = 'Google Maps' ; +FCKLang.GMapsBtnTooltip = 'Invoegen/Wijzigen een Google Map' ; +FCKLang.GMapsMap = 'Kaart' ; +FCKLang.GMapsZoomLevel = 'Zoom Level' ; +FCKLang.txtLatitude = 'Latitude' ; +FCKLang.txtLongitude = 'Longitude' ; +FCKLang.GMapsMarker = 'Marker' ; +FCKLang.GMapsSearchLabel = 'Zoek een locatie' ; +FCKLang.GMapsSearch = 'Zoeken' ; +FCKLang.GMapsNotFound = '%s is niet gevonden.' ; +FCKLang.GMapsMarkerText = 'Tekst' ; +FCKLang.GMapsMarkerDefaultText = 'Schrijf je eigen tekst' ; +FCKLang.GMapsLine = 'Lijn' ; +FCKLang.GMapsLineInstructions = 'Klik op de kaart om een een eerste marker te plaaten, blijf dan klikken om meer markers te plaatsen.
Je kunt ze slepen of verwijderen met de "DEL" toets' ; + +FCKLang.GMapsHelpFile = 'install.html' ; +FCKLang.GMapsUserHelpFile = 'users.html' ; +FCKLang.Help = 'Help' ; + +FCKLang.GMapsClickToAddMarker = 'klik op de kaart om de marker toe te voegen' ; +FCKLang.GMapsDeleteMarker = 'Verwijder marker' ; +FCKLang.GMapsAddMarker = 'Voeg nieuwe marker toe' ; + diff --git a/main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/no.js b/main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/no.js old mode 100644 new mode 100755 index 3692c6b1b4..df7000ffd8 --- a/main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/no.js +++ b/main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/no.js @@ -1,46 +1,45 @@ -/* - * == BEGIN LICENSE == - * - * Licensed under the terms of any of the following licenses at your - * choice: - * - * - GNU General Public License Version 2 or later (the "GPL") - * http://www.gnu.org/licenses/gpl.html - * - * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") - * http://www.gnu.org/licenses/lgpl.html - * - * - Mozilla Public License Version 1.1 or later (the "MPL") - * http://www.mozilla.org/MPL/MPL-1.1.html - * - * == END LICENSE == - * - * Google Maps for FCKeditor. - * Norwegian language file. - */ - -FCKLang.DlgGMapsTitle = 'Google Maps properties' ; -FCKLang.GMapsBtn = 'Google Maps' ; -FCKLang.GMapsBtnTooltip = 'Insert/Edit a Google Map' ; -FCKLang.GMapsMap = 'Map' ; -FCKLang.GMapsZoomLevel = 'Zoom Level' ; -FCKLang.txtLatitude = 'Latitude' ; -FCKLang.txtLongitude = 'Longitude' ; -FCKLang.GMapsMarker = 'Marker' ; -FCKLang.GMapsSearchLabel = 'Search a direction' ; -FCKLang.GMapsSearch = 'Search' ; -FCKLang.GMapsNotFound = '%s not found.' ; -FCKLang.GMapsMarkerText = 'Text' ; -FCKLang.GMapsMarkerDefaultText = 'Write your text' ; -FCKLang.GMapsLine = 'Line' ; -FCKLang.GMapsLineInstructions = 'Click on the map to place the first point, and then keep on clicking to add more points.
You can drag them or delete them using "DEL" in your keyboard' ; - -FCKLang.GMapsHelpFile = 'install.html' ; -FCKLang.GMapsUserHelpFile = 'users.html' ; -FCKLang.Help = 'Help' ; - -FCKLang.GMapsClickToAddMarker = 'Click on the map to add a new marker' ; -FCKLang.GMapsDeleteMarker = 'Delete marker' ; -FCKLang.GMapsAddMarker = 'Add new marker' ; - -FCKLang.GMaps_MissingKey = 'You must enter the Google Maps Key for your domain.' ; +/* + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Google Maps for FCKeditor, Norwegian language file. + */ + +FCKLang.DlgGMapsTitle = 'Google Maps egenskaper' ; +FCKLang.GMapsBtn = 'Google Maps' ; +FCKLang.GMapsBtnTooltip = 'Legg til/Rediger et Google Map' ; +FCKLang.GMapsMap = 'Kart' ; +FCKLang.GMapsZoomLevel = 'Zoom Nivå' ; +FCKLang.txtLatitude = 'Lengdegrad' ; +FCKLang.txtLongitude = 'Breddegrad' ; +FCKLang.GMapsMarker = 'Markør' ; +FCKLang.GMapsSearchLabel = 'Søk etter sted' ; +FCKLang.GMapsSearch = 'Søk' ; +FCKLang.GMapsNotFound = 'Finner ikke %s.' ; +FCKLang.GMapsMarkerText = 'Tekst' ; +FCKLang.GMapsMarkerDefaultText = 'Skriv inn din beskrivelse' ; +FCKLang.GMapsLine = 'Linje' ; +FCKLang.GMapsLineInstructions = 'Klikk på kartet for å plassere det første punktet, og fortsett å klikke for å legge til flere punkter.
Du kan velge og dra punktene med musen eller slette dem ved hjelp av "DEL" tasten på tastaturet.'; + +FCKLang.GMapsHelpFile = 'install.html' ; +FCKLang.GMapsUserHelpFile = 'users.html' ; +FCKLang.Help = 'Hjelp' ; + +FCKLang.GMapsClickToAddMarker = 'Klikk på kartet for å legge til en ny markør'; +FCKLang.GMapsDeleteMarker = 'Slett markør' ; +FCKLang.GMapsAddMarker = 'Legg til markør' ; + +FCKLang.GMaps_MissingKey = 'Du må angi en Google Maps Key for ditt domene i konfigurasjonsfilen.' ; \ No newline at end of file diff --git a/main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/zh.js b/main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/zh.js old mode 100644 new mode 100755 index 67b2a09101..0f8c680abc --- a/main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/zh.js +++ b/main/inc/lib/fckeditor/editor/plugins/googlemaps/lang/zh.js @@ -1,46 +1,45 @@ -/* - * == BEGIN LICENSE == - * - * Licensed under the terms of any of the following licenses at your - * choice: - * - * - GNU General Public License Version 2 or later (the "GPL") - * http://www.gnu.org/licenses/gpl.html - * - * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") - * http://www.gnu.org/licenses/lgpl.html - * - * - Mozilla Public License Version 1.1 or later (the "MPL") - * http://www.mozilla.org/MPL/MPL-1.1.html - * - * == END LICENSE == - * - * Google Maps for FCKeditor. - * Chinese Traditional language file. - */ - -FCKLang.DlgGMapsTitle = 'Google Maps properties' ; -FCKLang.GMapsBtn = 'Google Maps' ; -FCKLang.GMapsBtnTooltip = 'Insert/Edit a Google Map' ; -FCKLang.GMapsMap = 'Map' ; -FCKLang.GMapsZoomLevel = 'Zoom Level' ; -FCKLang.txtLatitude = 'Latitude' ; -FCKLang.txtLongitude = 'Longitude' ; -FCKLang.GMapsMarker = 'Marker' ; -FCKLang.GMapsSearchLabel = 'Search a direction' ; -FCKLang.GMapsSearch = 'Search' ; -FCKLang.GMapsNotFound = '%s not found.' ; -FCKLang.GMapsMarkerText = 'Text' ; -FCKLang.GMapsMarkerDefaultText = 'Write your text' ; -FCKLang.GMapsLine = 'Line' ; -FCKLang.GMapsLineInstructions = 'Click on the map to place the first point, and then keep on clicking to add more points.
You can drag them or delete them using "DEL" in your keyboard' ; - -FCKLang.GMapsHelpFile = 'install.html' ; -FCKLang.GMapsUserHelpFile = 'users.html' ; -FCKLang.Help = 'Help' ; - -FCKLang.GMapsClickToAddMarker = 'Click on the map to add a new marker' ; -FCKLang.GMapsDeleteMarker = 'Delete marker' ; -FCKLang.GMapsAddMarker = 'Add new marker' ; - -FCKLang.GMaps_MissingKey = 'You must enter the Google Maps Key for your domain.' ; +/* + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Google Maps for FCKeditor, English language file. + */ + +FCKLang.DlgGMapsTitle = 'Google地圖內容' ; +FCKLang.GMapsBtn = 'Google圖資' ; +FCKLang.GMapsBtnTooltip = '新增/編輯地圖' ; +FCKLang.GMapsMap = '地圖' ; +FCKLang.GMapsZoomLevel = '縮放比率' ; +FCKLang.txtLatitude = '緯度' ; +FCKLang.txtLongitude = '經度' ; +FCKLang.GMapsMarker = '標竿' ; +FCKLang.GMapsSearchLabel = '目標搜尋' ; +FCKLang.GMapsSearch = '搜尋' ; +FCKLang.GMapsNotFound = '%s 尋找不到' ; +FCKLang.GMapsMarkerText = '文字' ; +FCKLang.GMapsMarkerDefaultText = '撰寫你的文字' ; +FCKLang.GMapsLine = '線標' ; +FCKLang.GMapsLineInstructions = '利用滑鼠在地圖上點選首要地點,你可隨時增加其它地點
也可拖曳標桿或利用鍵盤上刪除鍵(Del)刪除標竿' ; + +FCKLang.GMapsHelpFile = 'install.html' ; +FCKLang.GMapsUserHelpFile = 'users.html' ; +FCKLang.Help = '求助' ; + +FCKLang.GMapsClickToAddMarker = '在地圖上新增標竿' ; +FCKLang.GMapsDeleteMarker = '刪除標竿' ; +FCKLang.GMapsAddMarker = '新增標竿' ; + +FCKLang.GMaps_MissingKey = '請輸入Google授權給你的Maps Key' ; \ No newline at end of file