芝麻web文件管理V1.00

编辑当前文件:/home/qrafawbu/rentandbuyrealty.com/rentandbuyrealty.com/public/assets/js/custom/custom.js
' ) ); } if ( param[ 0 ].type_of_parameter == "file" ) { $( '#parameter_type' ).append( $( '
' ) ); } } } ); } ); function initMap() { var latitude = parseFloat( $( '#latitude' ).val() ); var longitude = parseFloat( $( '#longitude' ).val() ); var map = new google.maps.Map( document.getElementById( 'map' ), { center: { lat: latitude, lng: longitude }, zoom: 13 } ); var marker = new google.maps.Marker( { position: { lat: latitude, lng: longitude }, map: map, draggable: true, title: 'Marker Title' } ); google.maps.event.addListener( marker, 'dragend', function ( event ) { var geocoder = new google.maps.Geocoder(); geocoder.geocode( { 'latLng': event.latLng }, function ( results, status ) { if ( status == google.maps.GeocoderStatus.OK ) { if ( results[ 0 ] ) { var address_components = results[ 0 ].address_components; var city, state, country, full_address; for ( var i = 0; i < address_components.length; i++ ) { var types = address_components[ i ].types; if ( types.indexOf( 'locality' ) != -1 ) { city = address_components[ i ].long_name; } else if ( types.indexOf( 'administrative_area_level_1' ) != -1 ) { state = address_components[ i ].long_name; } else if ( types.indexOf( 'country' ) != -1 ) { country = address_components[ i ].long_name; } } full_address = results[ 0 ].formatted_address; // Do something with the city, state, country, and full address $( '#city' ).val( city ); $( '#country' ).val( state ); $( '#state' ).val( country ); $( '#address' ).val( full_address ); $( '#latitude' ).val( event.latLng.lat() ); $( '#longitude' ).val( event.latLng.lng() ); } else { console.log( 'No results found' ); } } else { console.log( 'Geocoder failed due to: ' + status ); } } ); } ); var input = document.getElementById( 'searchInput' ); map.controls[ google.maps.ControlPosition.TOP_LEFT ].push( input ); var autocomplete = new google.maps.places.Autocomplete( input ); autocomplete.bindTo( 'bounds', map ); var infowindow = new google.maps.InfoWindow(); var marker = new google.maps.Marker( { map: map, anchorPoint: new google.maps.Point( 0, -29 ) } ); autocomplete.addListener( 'place_changed', function () { infowindow.close(); marker.setVisible( false ); var place = autocomplete.getPlace(); if ( !place.geometry ) { window.alert( "Autocomplete's returned place contains no geometry" ); return; } // If the place has a geometry, then present it on a map. if ( place.geometry.viewport ) { map.fitBounds( place.geometry.viewport ); } else { map.setCenter( place.geometry.location ); map.setZoom( 17 ); } marker.setIcon( ( { url: place.icon, size: new google.maps.Size( 71, 71 ), origin: new google.maps.Point( 0, 0 ), anchor: new google.maps.Point( 17, 34 ), scaledSize: new google.maps.Size( 35, 35 ) } ) ); marker.setPosition( place.geometry.location ); marker.setVisible( true ); var address = ''; if ( place.address_components ) { address = [ ( place.address_components[ 0 ] && place.address_components[ 0 ].short_name || '' ), ( place.address_components[ 1 ] && place.address_components[ 1 ].short_name || '' ), ( place.address_components[ 2 ] && place.address_components[ 2 ].short_name || '' ) ].join( ' ' ); } infowindow.setContent( '
' + place.name + '
' + address ); infowindow.open( map, marker ); // Location details for ( var i = 0; i < place.address_components.length; i++ ) { console.log( place ); if ( place.address_components[ i ].types[ 0 ] == 'locality' ) { $( '#city' ).val( place.address_components[ i ].long_name ); } if ( place.address_components[ i ].types[ 0 ] == 'country' ) { $( '#country' ).val( place.address_components[ i ].long_name ); } if ( place.address_components[ i ].types[ 0 ] == 'administrative_area_level_1' ) { console.log( place.address_components[ i ].long_name ); $( '#state' ).val( place.address_components[ i ].long_name ); } } var latitude = place.geometry.location.lat(); var longitude = place.geometry.location.lng(); $( '#address' ).val( place.formatted_address ); $( '#latitude' ).val( place.geometry.location.lat() ); $( '#longitude' ).val( place.geometry.location.lng() ); } ); } $( document ).ready( function () { FilePond.registerPlugin( FilePondPluginImagePreview, FilePondPluginFileValidateSize, FilePondPluginFileValidateType ); $( '.filepond' ).filepond( { credits: null, allowFileSizeValidation: "true", maxFileSize: '25MB', labelMaxFileSizeExceeded: 'File is too large', labelMaxFileSize: 'Maximum file size is {filesize}', allowFileTypeValidation: true, acceptedFileTypes: [ 'image/*' ], labelFileTypeNotAllowed: 'File of invalid type', fileValidateTypeLabelExpectedTypes: 'Expects {allButLastType} or {lastType}', storeAsFile: true, allowPdfPreview: true, pdfPreviewHeight: 320, pdfComponentExtraParams: 'toolbar=0&navpanes=0&scrollbar=0&view=fitH', allowVideoPreview: true, // default true allowAudioPreview: true // default true } ); } ); function getWordCount( fiels_type = "", field_counter = "", font = "0px arial" ) { console.log( "getWordCount called for", fiels_type ); let textArea = document.getElementById( fiels_type ); let characterCounter = document.getElementById( field_counter ); const text = textArea.value; const canvas = document.createElement( "canvas" ); const context = canvas.getContext( "2d" ); context.font = font; const width = context.measureText( text ).width; const finalWidth = Math.ceil( width ); textdata = ""; info_data = ""; var fiels_type_value = ""; if ( fiels_type == "meta_title" ) { fiels_type_value = "Meta title"; } else if ( fiels_type == "meta_description" ) { fiels_type_value = "Meta description"; } else if ( fiels_type == "edit_meta_title" ) { fiels_type_value = "Meta title"; } else if ( fiels_type == "edit_meta_description" ) { fiels_type_value = "Meta description"; } if ( fiels_type == "meta_title" ) { less_equal = 240; less_equal2 = 580; textdata = "Title " + textdata + " is " + finalWidth + " pixel(s) long"; } else if ( fiels_type == "meta_description" ) { less_equal = 395; less_equal2 = 920; textdata = "Meta Description " + textdata + " is " + finalWidth + " pixel(s) long"; } else if ( fiels_type == "edit_meta_title" ) { less_equal = 240; less_equal2 = 580; textdata = "Title " + textdata + " is " + finalWidth + " pixel(s) long"; } else if ( fiels_type == "edit_meta_description" ) { less_equal = 395; less_equal2 = 920; textdata = "Meta Description " + textdata + " is " + finalWidth + " pixel(s) long"; } if ( finalWidth <= less_equal ) { info_class = "text-danger"; info_icon = ''; info_data = "--Your page " + fiels_type_value + " is too short."; } else if ( finalWidth > less_equal && finalWidth <= less_equal2 ) { info_class = "text-success"; info_icon = ''; info_data = "--Your page " + fiels_type_value + " is an acceptable length."; } else if ( finalWidth > less_equal2 ) { info_class = "text-danger"; info_icon = ''; info_data = "--Page " + fiels_type_value + " should be around " + less_equal2 + " pixels in length."; } // let numOfEnteredChars = textArea.value.length; // characterCounter.textContent = numOfEnteredChars; characterCounter.innerHTML = info_icon + " " + textdata + info_data; }