├── .gitignore ├── index.php ├── images └── icon │ ├── ft.png │ ├── 2hand.png │ ├── aed-2.png │ ├── algae.png │ ├── alien.png │ ├── apple.png │ ├── arch.png │ ├── army.png │ ├── atm-2.png │ ├── atv.png │ ├── audio.png │ ├── award.png │ ├── bags.png │ ├── bank.png │ ├── bar.png │ ├── bats.png │ ├── beach.png │ ├── blast.png │ ├── boat.png │ ├── bomb.png │ ├── bread.png │ ├── bus.png │ ├── candy.png │ ├── car.png │ ├── cctv.png │ ├── clock.png │ ├── coins.png │ ├── court.png │ ├── cup.png │ ├── dam.png │ ├── deer.png │ ├── eggs.png │ ├── exit.png │ ├── ferry.png │ ├── field.png │ ├── fire.png │ ├── flood.png │ ├── gifts.png │ ├── grass.png │ ├── hare1.png │ ├── hats.png │ ├── house.png │ ├── hut.png │ ├── jeep.png │ ├── judo.png │ ├── kebab.png │ ├── kiosk.png │ ├── lake.png │ ├── lock.png │ ├── mall.png │ ├── map.png │ ├── mine.png │ ├── mural.png │ ├── music.png │ ├── nanny.png │ ├── oil-2.png │ ├── paint.png │ ├── peace.png │ ├── pens.png │ ├── pets.png │ ├── photo.png │ ├── pig.png │ ├── poker.png │ ├── radar.png │ ├── rainy.png │ ├── rape.png │ ├── road.png │ ├── sauna.png │ ├── seals.png │ ├── share.png │ ├── shoes.png │ ├── sikh.png │ ├── skis.png │ ├── skull.png │ ├── snail.png │ ├── spa.png │ ├── stop.png │ ├── sunny.png │ ├── targ.png │ ├── taxi.png │ ├── text.png │ ├── theft.png │ ├── tires.png │ ├── tools.png │ ├── tower.png │ ├── toys.png │ ├── train.png │ ├── trash.png │ ├── tweet.png │ ├── ufo.png │ ├── van.png │ ├── vespa.png │ ├── video.png │ ├── villa.png │ ├── war.png │ ├── water.png │ ├── wifi.png │ ├── world.png │ ├── yoga.png │ ├── zoo.png │ ├── zoom.png │ ├── airport.png │ ├── archery.png │ ├── barber.png │ ├── barrier.png │ ├── bigcity.png │ ├── birds-2.png │ ├── bollie.png │ ├── bouddha.png │ ├── bowling.png │ ├── boxing.png │ ├── busstop.png │ ├── bustour.png │ ├── cabin-2.png │ ├── carwash.png │ ├── caution.png │ ├── cave-2.png │ ├── chart-2.png │ ├── cheese.png │ ├── cinema.png │ ├── circus.png │ ├── cloudy.png │ ├── coffee.png │ ├── comics.png │ ├── company.png │ ├── compost.png │ ├── corral.png │ ├── country.png │ ├── cricket.png │ ├── cross-2.png │ ├── customs.png │ ├── cycling.png │ ├── daycare.png │ ├── dentist.png │ ├── diving.png │ ├── embassy.png │ ├── expert.png │ ├── factory.png │ ├── family.png │ ├── farm-2.png │ ├── finish.png │ ├── firemen.png │ ├── fishing.png │ ├── fitness.png │ ├── fjord-2.png │ ├── flowers.png │ ├── ford-2.png │ ├── forest.png │ ├── forest2.png │ ├── fossils.png │ ├── freqchg.png │ ├── frog-2.png │ ├── fruits.png │ ├── glasses.png │ ├── golfing.png │ ├── grocery.png │ ├── group-2.png │ ├── harbor.png │ ├── haybale.png │ ├── highway.png │ ├── hiking.png │ ├── home-2.png │ ├── hunting.png │ ├── jacuzzi.png │ ├── jewelry.png │ ├── jogging.png │ ├── karate.png │ ├── karting.png │ ├── kayak1.png │ ├── kingair.png │ ├── laterne.png │ ├── library.png │ ├── liquor.png │ ├── male-2.png │ ├── mapicon.png │ ├── market.png │ ├── massage.png │ ├── mosquee.png │ ├── motel-2.png │ ├── nursery.png │ ├── oilrig2.png │ ├── outlet2.png │ ├── party-2.png │ ├── phantom.png │ ├── phones.png │ ├── pirates.png │ ├── police.png │ ├── postal.png │ ├── prayer.png │ ├── prison.png │ ├── pyramid.png │ ├── recycle.png │ ├── regroup.png │ ├── repair.png │ ├── resort.png │ ├── revolt.png │ ├── river-2.png │ ├── rodent.png │ ├── rowboat.png │ ├── ruins-2.png │ ├── sailing.png │ ├── school.png │ ├── segway.png │ ├── shore-2.png │ ├── shower.png │ ├── sight-2.png │ ├── skiing.png │ ├── skijump.png │ ├── sledge.png │ ├── slipway.png │ ├── smoking.png │ ├── snakes.png │ ├── snowy-2.png │ ├── soccer.png │ ├── spider.png │ ├── splice.png │ ├── stadium.png │ ├── stairs.png │ ├── star-3.png │ ├── strike.png │ ├── sumo-2.png │ ├── surfing.png │ ├── tailor.png │ ├── taxiway.png │ ├── tennis.png │ ├── terrace.png │ ├── theater.png │ ├── therapy.png │ ├── tiger-2.png │ ├── toilets.png │ ├── torture.png │ ├── tramway.png │ ├── trolley.png │ ├── truck3.png │ ├── tsunami.png │ ├── tunnel.png │ ├── waiting.png │ ├── webcam.png │ ├── wedding.png │ ├── weights.png │ ├── whale-2.png │ ├── wind-2.png │ ├── winebar.png │ ├── yooner.png │ ├── 360degrees.png │ ├── abduction.png │ ├── aboriginal.png │ ├── airshow-2.png │ ├── alligator.png │ ├── anchorpier.png │ ├── ant-export.png │ ├── anthropo.png │ ├── aquarium.png │ ├── artgallery.png │ ├── avalanche1.png │ ├── bar_juice.png │ ├── barbecue.png │ ├── baseball.png │ ├── basketball.png │ ├── beergarden.png │ ├── billiard-2.png │ ├── binoculars.png │ ├── boatcrane.png │ ├── bobsleigh.png │ ├── bomber-2.png │ ├── brewery1.png │ ├── bridge_old.png │ ├── bulldozer.png │ ├── bullfight.png │ ├── bunker-2-2.png │ ├── butcher-2.png │ ├── cablecar.png │ ├── cafetaria.png │ ├── calendar-3.png │ ├── campfire-2.png │ ├── camping-2.png │ ├── canyon-2.png │ ├── carrental.png │ ├── casino-2.png │ ├── castle-2.png │ ├── cathedral.png │ ├── cemetary.png │ ├── chapel-2.png │ ├── chicken-2.png │ ├── church-2.png │ ├── citysquare.png │ ├── citywalls.png │ ├── climbing.png │ ├── closedroad.png │ ├── comedyclub.png │ ├── computers.png │ ├── conference.png │ ├── congress.png │ ├── contract.png │ ├── convent-2.png │ ├── cow-export.png │ ├── craftstore.png │ ├── cramschool.png │ ├── crimescene.png │ ├── cromlech.png │ ├── cruiseship.png │ ├── curling-2.png │ ├── database.png │ ├── desert-2.png │ ├── dinopark.png │ ├── disability.png │ ├── dogs_leash.png │ ├── dolphins.png │ ├── drugstore.png │ ├── elephants.png │ ├── elevator.png │ ├── entrance.png │ ├── exchequer.png │ ├── farmstand.png │ ├── fastfood.png │ ├── female-2.png │ ├── festival.png │ ├── findajob.png │ ├── fireworks.png │ ├── firstaid.png │ ├── fishchips.png │ ├── folder-2.png │ ├── foodtruck.png │ ├── footprint.png │ ├── foundry-2.png │ ├── fountain-2.png │ ├── fourbyfour.png │ ├── gay-female.png │ ├── gay-male.png │ ├── geyser-2.png │ ├── ghosttown.png │ ├── glacier-2.png │ ├── gondola-2.png │ ├── handball.png │ ├── helicopter.png │ ├── highhills.png │ ├── highschool.png │ ├── homecenter.png │ ├── honeycomb.png │ ├── hotspring.png │ ├── icecream.png │ ├── icehockey.png │ ├── iceskating.png │ ├── icy_road.png │ ├── iobridge.png │ ├── jazzclub.png │ ├── jetfighter.png │ ├── junction.png │ ├── kayaking.png │ ├── laboratory.png │ ├── landfill.png │ ├── landmark.png │ ├── laundromat.png │ ├── linedown.png │ ├── lingerie.png │ ├── love_date.png │ ├── magicshow.png │ ├── mainroad.png │ ├── marina-2.png │ ├── mastcrane1.png │ ├── medicine.png │ ├── megalith.png │ ├── memorial.png │ ├── military.png │ ├── missile-2.png │ ├── monument.png │ ├── moonstar.png │ ├── mosquito-2.png │ ├── motorbike.png │ ├── motorcycle.png │ ├── mountains.png │ ├── museum_art.png │ ├── museum_war.png │ ├── mushroom.png │ ├── music_live.png │ ├── music_rock.png │ ├── ne_barn-2.png │ ├── newsagent.png │ ├── nordicski.png │ ├── notvisited.png │ ├── oyster-3.png │ ├── pagoda-2.png │ ├── paintball.png │ ├── palace-2.png │ ├── patisserie.png │ ├── penguin-2.png │ ├── perfumery.png │ ├── petanque.png │ ├── picnic-2.png │ ├── pin-export.png │ ├── pizzaria.png │ ├── planecrash.png │ ├── playground.png │ ├── powerplant.png │ ├── printer-2.png │ ├── publicart.png │ ├── radiation.png │ ├── rescue-2.png │ ├── restaurant.png │ ├── rockhouse.png │ ├── rugbyfield.png │ ├── sandwich-2.png │ ├── sawmill-2.png │ ├── scoutgroup.png │ ├── seniorsite.png │ ├── shipwreck.png │ ├── shooting.png │ ├── signpost-2.png │ ├── ski_shoe1.png │ ├── skilifting.png │ ├── smallcity.png │ ├── sneakers.png │ ├── snorkeling.png │ ├── speed_50.png │ ├── speedhump.png │ ├── spelunking.png │ ├── sportscar.png │ ├── squash-2.png │ ├── statue-2.png │ ├── steamtrain.png │ ├── stripclub2.png │ ├── summercamp.png │ ├── sunsetland.png │ ├── surfpaddle.png │ ├── swimming.png │ ├── takeaway.png │ ├── taxiboat.png │ ├── teahouse.png │ ├── telephone.png │ ├── temple-2.png │ ├── textiles.png │ ├── themepark.png │ ├── tornado-2.png │ ├── townhouse.png │ ├── treedown.png │ ├── triskelion.png │ ├── turtle-2.png │ ├── umbrella-2.png │ ├── university.png │ ├── usfootball.png │ ├── veterinary.png │ ├── videogames.png │ ├── vineyard-2.png │ ├── volcano-2.png │ ├── volleyball.png │ ├── watercraft.png │ ├── waterpark.png │ ├── watertower.png │ ├── waterwell.png │ ├── wetlands.png │ ├── windmill-2.png │ ├── woodshed.png │ ├── workoffice.png │ ├── workshop.png │ ├── accesdenied.png │ ├── acupuncture.png │ ├── agritourism.png │ ├── air_fixwing.png │ ├── amphitheater.png │ ├── anniversary.png │ ├── apartment-3.png │ ├── art-museum-2.png │ ├── badminton-2.png │ ├── bar_coktail.png │ ├── battlefield.png │ ├── battleship-3.png │ ├── beautysalon.png │ ├── bicycle_shop.png │ ├── bike_rising.png │ ├── boardercross.png │ ├── butterfly-2.png │ ├── caraccident.png │ ├── chemistry-2.png │ ├── chiropractor.png │ ├── cloudysunny.png │ ├── condominium.png │ ├── construction.png │ ├── convertible.png │ ├── cowabduction.png │ ├── cropcircles.png │ ├── cycling_feed.png │ ├── dance_class.png │ ├── dancinghall.png │ ├── downloadicon.png │ ├── duck-export.png │ ├── earthquake-3.png │ ├── elevator_up.png │ ├── fallingrocks.png │ ├── ferriswheel.png │ ├── fishingboat.png │ ├── fishingstore.png │ ├── flag-export.png │ ├── geocaching-3.png │ ├── hanggliding.png │ ├── headstone-2.png │ ├── hookah_final.png │ ├── horseriding.png │ ├── hostel_0star.png │ ├── hotairbaloon.png │ ├── hotel_0star.png │ ├── indoor-arena.png │ ├── information.png │ ├── jewishgrave.png │ ├── kitesurfing.png │ ├── lifeguard-2.png │ ├── lighthouse-2.png │ ├── lockerrental.png │ ├── loveinterest.png │ ├── medicalstore.png │ ├── metronetwork.png │ ├── moderntower.png │ ├── movierental.png │ ├── muffin_bagle.png │ ├── museum_naval.png │ ├── music_choral.png │ ├── music_hiphop.png │ ├── observatory.png │ ├── oilpumpjack.png │ ├── olympicsite.png │ ├── paragliding.png │ ├── parasailing.png │ ├── parkandride.png │ ├── photography.png │ ├── pleasurepier.png │ ├── poweroutage.png │ ├── presentation.png │ ├── quadrifoglio.png │ ├── rollerskate.png │ ├── ropescourse.png │ ├── schools_maps.png │ ├── scubadiving.png │ ├── septic_tank.png │ ├── shark-export.png │ ├── shintoshrine.png │ ├── sledgerental.png │ ├── smiley_happy.png │ ├── snowboarding.png │ ├── snowmobiling.png │ ├── snowpark_arc.png │ ├── snowshoeing.png │ ├── solarenergy.png │ ├── spaceport-2.png │ ├── speedriding.png │ ├── stargate-raw.png │ ├── start-race-2.png │ ├── submarine-2.png │ ├── sugar-shack.png │ ├── supermarket.png │ ├── surfacelift.png │ ├── surveying-2.png │ ├── synagogue-2.png │ ├── taekwondo-2.png │ ├── tebletennis.png │ ├── templehindu.png │ ├── thunderstorm.png │ ├── tidaldiamond.png │ ├── tollstation.png │ ├── trafficlight.png │ ├── u-pick_stand.png │ ├── underground.png │ ├── walkingtour.png │ ├── warehouse-2.png │ ├── waterfall-2.png │ ├── watermill-2.png │ ├── waterskiing.png │ ├── wiki-export.png │ ├── windsurfing.png │ ├── windturbine.png │ ├── winetasting.png │ ├── worldwildway.png │ ├── wrestling-2.png │ ├── youthhostel.png │ ├── administration.png │ ├── aircraftcarrier.png │ ├── aircraftsmall.png │ ├── airport_apron.png │ ├── airport_runway.png │ ├── amphitheater-2.png │ ├── anemometer_mono.png │ ├── beachvolleyball.png │ ├── beautifulview.png │ ├── bike_downhill.png │ ├── bridge_modern.png │ ├── catholicgrave.png │ ├── channelchange.png │ ├── childmuseum01.png │ ├── christmasmarket.png │ ├── clothers_female.png │ ├── clothers_male.png │ ├── communitycentre.png │ ├── crossingguard.png │ ├── cycling_sprint.png │ ├── deepseafishing.png │ ├── departmentstore.png │ ├── direction_down.png │ ├── doublebendright.png │ ├── drinkingwater.png │ ├── elevator_down.png │ ├── fillingstation.png │ ├── fire-hydrant-2.png │ ├── funicolar-22x22.png │ ├── gas_cylinder1.png │ ├── geothermal-site.png │ ├── gourmet_0star.png │ ├── gumball_machine.png │ ├── japanese-food.png │ ├── japanese-sake.png │ ├── japanese-temple.png │ ├── jewishquarter.png │ ├── levelcrossing.png │ ├── lobster-export.png │ ├── lodging_0star.png │ ├── modernmonument.png │ ├── monkey-export.png │ ├── museum_crafts.png │ ├── museum_industry.png │ ├── museum_openair.png │ ├── museum_science.png │ ├── music_classical.png │ ├── no-nuke-export.png │ ├── office-building.png │ ├── ophthalmologist.png │ ├── panoramicview.png │ ├── parkinggarage.png │ ├── petroglyphs-2.png │ ├── planetarium-2.png │ ├── powerlinepole.png │ ├── powersubstation.png │ ├── radio-station-2.png │ ├── restaurant_fish.png │ ├── restaurant_thai.png │ ├── riparianhabitat.png │ ├── roadtype_gravel.png │ ├── shootingrange.png │ ├── sledge_summer.png │ ├── spotlight-poi.png │ ├── square-compass.png │ ├── theravadapagoda.png │ ├── theravadatemple.png │ ├── ticket_office2.png │ ├── trafficcamera.png │ ├── travel_agency.png │ ├── treasure-mark.png │ ├── waterwellpump.png │ ├── you-are-here-2.png │ ├── airport_terminal.png │ ├── bed_breakfast1-2.png │ ├── comment-map-icon.png │ ├── constructioncrane.png │ ├── conveniencestore.png │ ├── currencyexchange.png │ ├── drinkingfountain.png │ ├── fireexstinguisher.png │ ├── historical_museum.png │ ├── historicalquarter.png │ ├── hospital-building.png │ ├── japanese-lantern.png │ ├── japanese-sweet-2.png │ ├── mobilephonetower.png │ ├── mountainbiking-3.png │ ├── nursing_home_icon.png │ ├── palm-tree-export.png │ ├── price-tag-export.png │ ├── restaurant_buffet.png │ ├── restaurant_greek.png │ ├── restaurant_indian.png │ ├── restaurant_korean.png │ ├── restaurant_tapas.png │ ├── schreibwaren_web.png │ ├── wildlifecrossing.png │ ├── worldheritagesite.png │ ├── zombie-outbreak1.png │ ├── australianfootball.png │ ├── fetalalcoholsyndrom.png │ ├── fooddeliveryservice.png │ ├── museum_archeological.png │ ├── parking-meter-export.png │ ├── pedestriancrossing.png │ ├── restaurant_african.png │ ├── restaurant_breakfast.png │ ├── restaurant_chinese.png │ ├── restaurant_italian.png │ ├── restaurant_mexican.png │ ├── restaurant_romantic.png │ ├── restaurant_turkish.png │ ├── sozialeeinrichtung.png │ ├── sportutilityvehicle.png │ ├── administrativeboundary.png │ ├── animal-shelter-export.png │ ├── conversation-map-icon.png │ ├── reatorlogowhite-22x22.png │ ├── restaurant_steakhouse.png │ ├── restaurant_vegetarian.png │ ├── hoergeraeteakustiker_22px.png │ ├── radio-control-model-car.png │ ├── restaurant_mediterranean.png │ ├── moving-walkway-enter-export.png │ ├── monument-historique-icon-white-22x22.png │ ├── mountain-pass-locator-diagonal-reverse-export.png │ └── _readme-license.txt ├── languages ├── inlocation-en.mo ├── inlocation-pt_BR.mo ├── inlocation-en.po └── inlocation-pt_BR.po ├── .editorconfig ├── README.MD ├── js ├── inlocation_map.js ├── plugins │ ├── image-picker │ │ ├── image-picker.css │ │ └── image-picker.min.js │ └── maskedinput │ │ ├── jquery.maskedinput.min.js │ │ └── jquery.maskedinput.js └── inlocationscript.js ├── css └── custom.css └── readme.txt /.gitignore: -------------------------------------------------------------------------------- 1 | *.svn -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | https://developers.google.com/maps/documentation/javascript/get-api-key 59 | 60 | 61 | ### FAQ em Português: ### 62 | 63 | = Qual é a licença do plugin? = 64 | 65 | Este plugin esta licenciado como GPL. 66 | 67 | = O que eu preciso para utilizar este plugin? = 68 | 69 | * Conta google com uma Api-KEY -> https://developers.google.com/maps/documentation/javascript/get-api-key 70 | 71 | == Screenshots == 72 | 1. Cadastro de Local. 73 | 2. Ícones e mais Ícones 74 | 3. Simulação do Mapa, e exibição do ShortCode. 75 | 76 | 77 | == Changelog == 78 | 1.8 Remove Bug of 'Edit Post', now has a specific jQuery selector 79 | 1.6 Add Icons (https://mapicons.mapsmarker.com) + Plugin (image-picker) 80 | 1.1 Fix SQL Injection with prepared 81 | 1.2 Improve generic function, defines and scripts 82 | 1.0 ShortCode add -------------------------------------------------------------------------------- /languages/inlocation-en.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: inlocation\n" 4 | "POT-Creation-Date: 2016-05-08 11:28-0300\n" 5 | "PO-Revision-Date: 2016-05-08 11:28-0300\n" 6 | "Last-Translator: Gabriel Darezzo \n" 7 | "Language-Team: inworkteam \n" 8 | "Language: en\n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "X-Generator: Poedit 1.8.7\n" 13 | "X-Poedit-Basepath: ..\n" 14 | "Plural-Forms: nplurals=2; plural=(n > 1);\n" 15 | "X-Poedit-SourceCharset: UTF-8\n" 16 | "X-Poedit-KeywordsList: __\n" 17 | "X-Poedit-SearchPath-0: inlocation.php\n" 18 | 19 | #: inlocation.php:40 inlocation.php:56 inlocation.php:113 inlocation.php:177 20 | msgid "Settings" 21 | msgstr "Settings" 22 | 23 | #: inlocation.php:53 inlocation.php:106 inlocation.php:153 24 | msgid "Register Location" 25 | msgstr "Register Location" 26 | 27 | #: inlocation.php:54 28 | msgid "Listing" 29 | msgstr "Listing" 30 | 31 | #: inlocation.php:55 32 | msgid "Simulate Map" 33 | msgstr "Simulate Map" 34 | 35 | #: inlocation.php:81 36 | msgid "No action correct." 37 | msgstr "No action correct." 38 | 39 | #: inlocation.php:106 inlocation.php:153 40 | msgid "You need register a location" 41 | msgstr "You need register a location" 42 | 43 | #: inlocation.php:113 inlocation.php:177 44 | msgid "You need a Google API, Go in \"Settings\"" 45 | msgstr "You need a Google API, Go in \"Settings\"" 46 | 47 | #: inlocation.php:160 48 | msgid "Locations:" 49 | msgstr "Locations:" 50 | 51 | #: inlocation.php:194 52 | msgid "Zip Code Empty" 53 | msgstr "Zip Code Empty" 54 | 55 | #: inlocation.php:198 56 | msgid "Number Empty" 57 | msgstr "Number Empty" 58 | 59 | #: inlocation.php:232 60 | msgid "Enter the location" 61 | msgstr "Enter the location" 62 | 63 | #: inlocation.php:234 64 | msgid "Zip code" 65 | msgstr "Zip code" 66 | 67 | #: inlocation.php:237 68 | msgid "Street Name" 69 | msgstr "Street Name" 70 | 71 | #: inlocation.php:240 72 | msgid "Neighborhood" 73 | msgstr "Neighborhood" 74 | 75 | #: inlocation.php:243 76 | msgid "City" 77 | msgstr "City" 78 | 79 | #: inlocation.php:246 80 | msgid "State" 81 | msgstr "State" 82 | 83 | #: inlocation.php:249 84 | msgid "Number" 85 | msgstr "Number" 86 | 87 | #: inlocation.php:253 88 | msgid "Add Location" 89 | msgstr "Add Location" 90 | 91 | #: inlocation.php:292 92 | msgid "Enter your Google api-key!" 93 | msgstr "Enter your Google api-key!" 94 | 95 | #: inlocation.php:298 96 | msgid "You can create Google Api-KEY in this link," 97 | msgstr "You can create Google Api-KEY in this link," 98 | 99 | #: inlocation.php:300 100 | msgid "Update API" 101 | msgstr "Update API" 102 | 103 | #: inlocation.php:345 inlocation.php:372 104 | msgid "You do not have permission to perform this!" 105 | msgstr "You do not have permission to perform this!" 106 | 107 | #: inlocation.php:361 108 | msgid "Addresses sequence updated!" 109 | msgstr "Addresses sequence updated!" 110 | 111 | #: inlocation.php:430 112 | msgid "ZipCode Not Found" 113 | msgstr "ZipCode Not Found" 114 | 115 | #: inlocation.php:431 116 | msgid "Error" 117 | msgstr "Error" 118 | 119 | #: inlocation.php:432 120 | msgid "Are you sure?" 121 | msgstr "Are you sure?" 122 | -------------------------------------------------------------------------------- /languages/inlocation-pt_BR.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: inlocation\n" 4 | "POT-Creation-Date: 2016-05-08 11:28-0300\n" 5 | "PO-Revision-Date: 2016-05-08 11:32-0300\n" 6 | "Language-Team: inworkteam \n" 7 | "MIME-Version: 1.0\n" 8 | "Content-Type: text/plain; charset=UTF-8\n" 9 | "Content-Transfer-Encoding: 8bit\n" 10 | "X-Generator: Poedit 1.8.7\n" 11 | "X-Poedit-Basepath: ..\n" 12 | "Plural-Forms: nplurals=2; plural=(n > 1);\n" 13 | "X-Poedit-SourceCharset: UTF-8\n" 14 | "X-Poedit-KeywordsList: __\n" 15 | "Last-Translator: Gabriel Darezzo \n" 16 | "Language: pt_BR\n" 17 | "X-Poedit-SearchPath-0: inlocation.php\n" 18 | 19 | #: inlocation.php:40 inlocation.php:56 inlocation.php:113 inlocation.php:177 20 | msgid "Settings" 21 | msgstr "Configurações" 22 | 23 | #: inlocation.php:53 inlocation.php:106 inlocation.php:153 24 | msgid "Register Location" 25 | msgstr "Cadastrar Localização" 26 | 27 | #: inlocation.php:54 28 | msgid "Listing" 29 | msgstr "Listagem" 30 | 31 | #: inlocation.php:55 32 | msgid "Simulate Map" 33 | msgstr "Simular Map" 34 | 35 | #: inlocation.php:81 36 | msgid "No action correct." 37 | msgstr "Url não encontrada" 38 | 39 | #: inlocation.php:106 inlocation.php:153 40 | msgid "You need register a location" 41 | msgstr "Você precisa cadastar ao menos um local" 42 | 43 | #: inlocation.php:113 inlocation.php:177 44 | msgid "You need a Google API, Go in \"Settings\"" 45 | msgstr "You need a Google API, Go in \"Settings\"" 46 | 47 | #: inlocation.php:160 48 | msgid "Locations:" 49 | msgstr "Localizações:" 50 | 51 | #: inlocation.php:194 52 | msgid "Zip Code Empty" 53 | msgstr "Cep Vazio." 54 | 55 | #: inlocation.php:198 56 | msgid "Number Empty" 57 | msgstr "Informe o Número" 58 | 59 | #: inlocation.php:232 60 | msgid "Enter the location" 61 | msgstr "Informe a Localização" 62 | 63 | #: inlocation.php:234 64 | msgid "Zip code" 65 | msgstr "Cep" 66 | 67 | #: inlocation.php:237 68 | msgid "Street Name" 69 | msgstr "Nome do Endereço" 70 | 71 | #: inlocation.php:240 72 | msgid "Neighborhood" 73 | msgstr "Bairro" 74 | 75 | #: inlocation.php:243 76 | msgid "City" 77 | msgstr "Cidade" 78 | 79 | #: inlocation.php:246 80 | msgid "State" 81 | msgstr "Estado" 82 | 83 | #: inlocation.php:249 84 | msgid "Number" 85 | msgstr "Número" 86 | 87 | #: inlocation.php:253 88 | msgid "Add Location" 89 | msgstr "Adicionar Localização" 90 | 91 | #: inlocation.php:292 92 | msgid "Enter your Google api-key!" 93 | msgstr "Informe sua Google-API Key" 94 | 95 | #: inlocation.php:298 96 | msgid "You can create Google Api-KEY in this link," 97 | msgstr "Você pode criar sua Google-Api Key neste link," 98 | 99 | #: inlocation.php:300 100 | msgid "Update API" 101 | msgstr "Atualizar API" 102 | 103 | #: inlocation.php:345 inlocation.php:372 104 | msgid "You do not have permission to perform this!" 105 | msgstr "Você não tem permissão para efetuar isto!" 106 | 107 | #: inlocation.php:361 108 | msgid "Addresses sequence updated!" 109 | msgstr "Ordem dos endereços atualizada." 110 | 111 | #: inlocation.php:430 112 | msgid "ZipCode Not Found" 113 | msgstr "Cep não encontrado" 114 | 115 | #: inlocation.php:431 116 | msgid "Error" 117 | msgstr "Ops... Ocorreu um erro." 118 | 119 | #: inlocation.php:432 120 | msgid "Are you sure?" 121 | msgstr "Você tem certeza?" 122 | -------------------------------------------------------------------------------- /js/plugins/maskedinput/jquery.maskedinput.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | Masked Input plugin for jQuery 3 | Copyright (c) 2007-2013 Josh Bush (digitalbush.com) 4 | Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license) 5 | Version: 1.3.1 6 | */ 7 | (function(e){function t(){var e=document.createElement("input"),t="onpaste";return e.setAttribute(t,""),"function"==typeof e[t]?"paste":"input"}var n,a=t()+".mask",r=navigator.userAgent,i=/iphone/i.test(r),o=/android/i.test(r);e.mask={definitions:{9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},dataName:"rawMaskFn",placeholder:"_"},e.fn.extend({caret:function(e,t){var n;if(0!==this.length&&!this.is(":hidden"))return"number"==typeof e?(t="number"==typeof t?t:e,this.each(function(){this.setSelectionRange?this.setSelectionRange(e,t):this.createTextRange&&(n=this.createTextRange(),n.collapse(!0),n.moveEnd("character",t),n.moveStart("character",e),n.select())})):(this[0].setSelectionRange?(e=this[0].selectionStart,t=this[0].selectionEnd):document.selection&&document.selection.createRange&&(n=document.selection.createRange(),e=0-n.duplicate().moveStart("character",-1e5),t=e+n.text.length),{begin:e,end:t})},unmask:function(){return this.trigger("unmask")},mask:function(t,r){var c,l,s,u,f,h;return!t&&this.length>0?(c=e(this[0]),c.data(e.mask.dataName)()):(r=e.extend({placeholder:e.mask.placeholder,completed:null},r),l=e.mask.definitions,s=[],u=h=t.length,f=null,e.each(t.split(""),function(e,t){"?"==t?(h--,u=e):l[t]?(s.push(RegExp(l[t])),null===f&&(f=s.length-1)):s.push(null)}),this.trigger("unmask").each(function(){function c(e){for(;h>++e&&!s[e];);return e}function d(e){for(;--e>=0&&!s[e];);return e}function m(e,t){var n,a;if(!(0>e)){for(n=e,a=c(t);h>n;n++)if(s[n]){if(!(h>a&&s[n].test(R[a])))break;R[n]=R[a],R[a]=r.placeholder,a=c(a)}b(),x.caret(Math.max(f,e))}}function p(e){var t,n,a,i;for(t=e,n=r.placeholder;h>t;t++)if(s[t]){if(a=c(t),i=R[t],R[t]=n,!(h>a&&s[a].test(i)))break;n=i}}function g(e){var t,n,a,r=e.which;8===r||46===r||i&&127===r?(t=x.caret(),n=t.begin,a=t.end,0===a-n&&(n=46!==r?d(n):a=c(n-1),a=46===r?c(a):a),k(n,a),m(n,a-1),e.preventDefault()):27==r&&(x.val(S),x.caret(0,y()),e.preventDefault())}function v(t){var n,a,i,l=t.which,u=x.caret();t.ctrlKey||t.altKey||t.metaKey||32>l||l&&(0!==u.end-u.begin&&(k(u.begin,u.end),m(u.begin,u.end-1)),n=c(u.begin-1),h>n&&(a=String.fromCharCode(l),s[n].test(a)&&(p(n),R[n]=a,b(),i=c(n),o?setTimeout(e.proxy(e.fn.caret,x,i),0):x.caret(i),r.completed&&i>=h&&r.completed.call(x))),t.preventDefault())}function k(e,t){var n;for(n=e;t>n&&h>n;n++)s[n]&&(R[n]=r.placeholder)}function b(){x.val(R.join(""))}function y(e){var t,n,a=x.val(),i=-1;for(t=0,pos=0;h>t;t++)if(s[t]){for(R[t]=r.placeholder;pos++a.length)break}else R[t]===a.charAt(pos)&&t!==u&&(pos++,i=t);return e?b():u>i+1?(x.val(""),k(0,h)):(b(),x.val(x.val().substring(0,i+1))),u?t:f}var x=e(this),R=e.map(t.split(""),function(e){return"?"!=e?l[e]?r.placeholder:e:void 0}),S=x.val();x.data(e.mask.dataName,function(){return e.map(R,function(e,t){return s[t]&&e!=r.placeholder?e:null}).join("")}),x.attr("readonly")||x.one("unmask",function(){x.unbind(".mask").removeData(e.mask.dataName)}).bind("focus.mask",function(){clearTimeout(n);var e;S=x.val(),e=y(),n=setTimeout(function(){b(),e==t.length?x.caret(0,e):x.caret(e)},10)}).bind("blur.mask",function(){y(),x.val()!=S&&x.change()}).bind("keydown.mask",g).bind("keypress.mask",v).bind(a,function(){setTimeout(function(){var e=y(!0);x.caret(e),r.completed&&e==x.val().length&&r.completed.call(x)},0)}),y()}))}})})(jQuery); -------------------------------------------------------------------------------- /js/inlocationscript.js: -------------------------------------------------------------------------------- 1 | (function($) { 2 | $(document).ready(function() { 3 | 4 | $("#icon_id").imagepicker(); 5 | 6 | 7 | 8 | $(".menu-expand").bind( "click", function() { 9 | 10 | var $li_this = $(this).parent(); 11 | var idx = $(this).parent().attr('id'); 12 | 13 | var conf = confirm(inlocation_def.confirm_delete); 14 | if(!conf){ 15 | return false; 16 | } 17 | 18 | 19 | var loaderContainer = $( '', { 20 | 'class': 'loader-image-container' 21 | ,'id' : 'ajax-img' 22 | }).insertAfter( pageTitle ); 23 | var loader = $( '', { 24 | src: inlocation_def.path_admin + 'images/loading.gif', 25 | 'class': 'loader-image' 26 | }).appendTo( loaderContainer ); 27 | 28 | 29 | $.ajax({ 30 | url: ajaxurl 31 | ,type:'POST' 32 | ,dataType: 'json' 33 | ,data: { 34 | action: 'inlocation_del_location' 35 | ,idx : idx 36 | } 37 | ,success: function(json){ 38 | $('#ajax-img').remove(); 39 | $li_this.hide(); 40 | 41 | },error: function(json){ 42 | $('#ajax-img').remove(); 43 | 44 | },beforeSend(){ 45 | 46 | } 47 | }); //End_ajax 48 | }); 49 | 50 | // var sortList = $('#custom-type-list'); 51 | var animation = $('#loading-animation'); 52 | var pageTitle = $('#lugares'); 53 | 54 | $('#custom-type-list').sortable({ 55 | update: function(event, ui){ 56 | var loaderContainer = $( '', { 57 | 'class': 'loader-image-container' 58 | ,'id' : 'ajax-img' 59 | }).insertAfter( pageTitle ); 60 | var loader = $( '', { 61 | src: inlocation_def.path_admin + 'images/loading.gif', 62 | 'class': 'loader-image' 63 | }).appendTo( loaderContainer ); 64 | 65 | $.ajax({ 66 | url: ajaxurl 67 | ,type:'POST' 68 | ,dataType: 'json' 69 | ,data: { 70 | action: 'inlocation_save_sort_order' 71 | ,order : $('#custom-type-list').sortable('toArray') 72 | } 73 | ,success: function(json){ 74 | $('#ajax-img').remove(); 75 | 76 | if(!json.success){ 77 | //Msg erro 78 | pageTitle.after('

' + json.data + '

'); 79 | } else { 80 | //Mensagem sucesso 81 | pageTitle.after('

' + json.data +'

'); 82 | } 83 | },error: function(json){ 84 | $('#ajax-img').remove(); 85 | pageTitle.after('

Ocorreu um erro

'); 86 | },beforeSend(){ 87 | $('#msg-ajax').remove(); 88 | } 89 | }); //End_ajax 90 | } 91 | }); 92 | 93 | //begin_get_location 94 | 95 | var cep_type = '99999-999'; //Varia de Pais pra pais 96 | 97 | $("#cep").mask(cep_type,{completed:function(){ 98 | var ccep = $.trim($("#cep").val()); 99 | if(ccep == ''){ 100 | return false; 101 | } 102 | 103 | var loaderContainer = $( '', { 104 | 'class': 'loader-image-container' 105 | ,'id' : 'ajax-img' 106 | }).insertAfter( $("#cep") ); 107 | var loader = $( '', { 108 | src: inlocation_def.path_admin + 'images/loading.gif', 109 | 'class': 'loader-image' 110 | }).appendTo( loaderContainer ); 111 | 112 | 113 | 114 | $.ajax({ 115 | url: ajaxurl 116 | ,type:'POST' 117 | ,dataType: 'json' 118 | ,data: { 119 | action : 'inlocation_endbycep' 120 | ,cep : $('#cep').val() 121 | } 122 | 123 | ,success: function(json){ 124 | 125 | $('#ajax-img').remove(); 126 | 127 | // $('#cep')val(); 128 | $('#logr_end').val(json.logradouro); 129 | $('#logr_bairro').val(json.bairro); 130 | $('#logr_cidade').val(json.localidade); 131 | $('#logr_estado').val(json.uf); 132 | 133 | 134 | if(json.logradouro && json.logradouro !== ''){ 135 | $("#logr_nr").focus(); 136 | } 137 | },error: function(json){ 138 | $('#ajax-img').remove(); 139 | pageTitle.after('

' + inlocation_def.error_ajax + '

'); 140 | },beforeSend(){ 141 | $('#msg-ajax').remove(); 142 | } 143 | }); //End_ajax 144 | }}); 145 | 146 | $("#cep").focus(); 147 | 148 | }); 149 | })(jQuery); 150 | -------------------------------------------------------------------------------- /js/plugins/image-picker/image-picker.min.js: -------------------------------------------------------------------------------- 1 | // Image Picker 2 | // by Rodrigo Vera 3 | // 4 | // Version 0.2.4 5 | // Full source at https://github.com/rvera/image-picker 6 | // MIT License, https://github.com/rvera/image-picker/blob/master/LICENSE 7 | (function(){var t,e,i,s,l=function(t,e){return function(){return t.apply(e,arguments)}},n=[].indexOf||function(t){for(var e=0,i=this.length;i>e;e++)if(e in this&&this[e]===t)return e;return-1};jQuery.fn.extend({imagepicker:function(e){return null==e&&(e={}),this.each(function(){var i;return i=jQuery(this),i.data("picker")&&i.data("picker").destroy(),i.data("picker",new t(this,s(e))),null!=e.initialized?e.initialized.call(i.data("picker")):void 0})}}),s=function(t){var e;return e={hide_select:!0,show_label:!1,initialized:void 0,changed:void 0,clicked:void 0,selected:void 0,limit:void 0,limit_reached:void 0},jQuery.extend(e,t)},i=function(t,e){return 0===jQuery(t).not(e).length&&0===jQuery(e).not(t).length},t=function(){function t(t,e){this.opts=null!=e?e:{},this.sync_picker_with_select=l(this.sync_picker_with_select,this),this.select=jQuery(t),this.multiple="multiple"===this.select.attr("multiple"),null!=this.select.data("limit")&&(this.opts.limit=parseInt(this.select.data("limit"))),this.build_and_append_picker()}return t.prototype.destroy=function(){var t,e,i,s;for(s=this.picker_options,e=0,i=s.length;i>e;e++)t=s[e],t.destroy();return this.picker.remove(),this.select.unbind("change"),this.select.removeData("picker"),this.select.show()},t.prototype.build_and_append_picker=function(){var t=this;return this.opts.hide_select&&this.select.hide(),this.select.change(function(){return t.sync_picker_with_select()}),null!=this.picker&&this.picker.remove(),this.create_picker(),this.select.after(this.picker),this.sync_picker_with_select()},t.prototype.sync_picker_with_select=function(){var t,e,i,s,l;for(s=this.picker_options,l=[],e=0,i=s.length;i>e;e++)t=s[e],t.is_selected()?l.push(t.mark_as_selected()):l.push(t.unmark_as_selected());return l},t.prototype.create_picker=function(){return this.picker=jQuery("
    "),this.picker_options=[],this.recursively_parse_option_groups(this.select,this.picker),this.picker},t.prototype.recursively_parse_option_groups=function(t,i){var s,l,n,r,c,o,h,a,p,u;for(a=t.children("optgroup"),r=0,o=a.length;o>r;r++)n=a[r],n=jQuery(n),s=jQuery("
      "),s.append(jQuery("
    • "+n.attr("label")+"
    • ")),i.append(jQuery("
    • ").append(s)),this.recursively_parse_option_groups(n,s);for(p=function(){var i,s,n,r;for(n=t.children("option"),r=[],i=0,s=n.length;s>i;i++)l=n[i],r.push(new e(l,this,this.opts));return r}.call(this),u=[],c=0,h=p.length;h>c;c++)l=p[c],this.picker_options.push(l),l.has_image()&&u.push(i.append(l.node));return u},t.prototype.has_implicit_blanks=function(){var t;return function(){var e,i,s,l;for(s=this.picker_options,l=[],e=0,i=s.length;i>e;e++)t=s[e],t.is_blank()&&!t.has_image()&&l.push(t);return l}.call(this).length>0},t.prototype.selected_values=function(){return this.multiple?this.select.val()||[]:[this.select.val()]},t.prototype.toggle=function(t){var e,s,l;return s=this.selected_values(),l=""+t.value(),this.multiple?n.call(this.selected_values(),l)>=0?(e=this.selected_values(),e.splice(jQuery.inArray(l,s),1),this.select.val([]),this.select.val(e)):null!=this.opts.limit&&this.selected_values().length>=this.opts.limit?null!=this.opts.limit_reached&&this.opts.limit_reached.call(this.select):this.select.val(this.selected_values().concat(l)):this.has_implicit_blanks()&&t.is_selected()?this.select.val(""):this.select.val(l),i(s,this.selected_values())||(this.select.change(),null==this.opts.changed)?void 0:this.opts.changed.call(this.select,s,this.selected_values())},t}(),e=function(){function t(t,e,i){this.picker=e,this.opts=null!=i?i:{},this.clicked=l(this.clicked,this),this.option=jQuery(t),this.create_node()}return t.prototype.destroy=function(){return this.node.find(".thumbnail").unbind()},t.prototype.has_image=function(){return null!=this.option.data("img-src")},t.prototype.is_blank=function(){return!(null!=this.value()&&""!==this.value())},t.prototype.is_selected=function(){var t;return t=this.picker.select.val(),this.picker.multiple?jQuery.inArray(this.value(),t)>=0:this.value()===t},t.prototype.mark_as_selected=function(){return this.node.find(".thumbnail").addClass("selected")},t.prototype.unmark_as_selected=function(){return this.node.find(".thumbnail").removeClass("selected")},t.prototype.value=function(){return this.option.val()},t.prototype.label=function(){return this.option.data("img-label")?this.option.data("img-label"):this.option.text()},t.prototype.clicked=function(){return this.picker.toggle(this),null!=this.opts.clicked&&this.opts.clicked.call(this.picker.select,this),null!=this.opts.selected&&this.is_selected()?this.opts.selected.call(this.picker.select,this):void 0},t.prototype.create_node=function(){var t,e;return this.node=jQuery("
    • "),t=jQuery(""),t.attr("src",this.option.data("img-src")),e=jQuery("
      "),e.click({option:this},function(t){return t.data.option.clicked()}),e.append(t),this.opts.show_label&&e.append(jQuery("

      ").html(this.label())),this.node.append(e),this.node},t}()}).call(this); -------------------------------------------------------------------------------- /js/plugins/maskedinput/jquery.maskedinput.js: -------------------------------------------------------------------------------- 1 | /* 2 | Masked Input plugin for jQuery 3 | Copyright (c) 2007-2013 Josh Bush (digitalbush.com) 4 | Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license) 5 | Version: 1.3.1 6 | */ 7 | (function($) { 8 | function getPasteEvent() { 9 | var el = document.createElement('input'), 10 | name = 'onpaste'; 11 | el.setAttribute(name, ''); 12 | return (typeof el[name] === 'function')?'paste':'input'; 13 | } 14 | 15 | var pasteEventName = getPasteEvent() + ".mask", 16 | ua = navigator.userAgent, 17 | iPhone = /iphone/i.test(ua), 18 | android=/android/i.test(ua), 19 | caretTimeoutId; 20 | 21 | $.mask = { 22 | //Predefined character definitions 23 | definitions: { 24 | '9': "[0-9]", 25 | 'a': "[A-Za-z]", 26 | '*': "[A-Za-z0-9]" 27 | }, 28 | dataName: "rawMaskFn", 29 | placeholder: '_' 30 | }; 31 | 32 | $.fn.extend({ 33 | //Helper Function for Caret positioning 34 | caret: function(begin, end) { 35 | var range; 36 | 37 | if (this.length === 0 || this.is(":hidden")) { 38 | return; 39 | } 40 | 41 | if (typeof begin == 'number') { 42 | end = (typeof end === 'number') ? end : begin; 43 | return this.each(function() { 44 | if (this.setSelectionRange) { 45 | this.setSelectionRange(begin, end); 46 | } else if (this.createTextRange) { 47 | range = this.createTextRange(); 48 | range.collapse(true); 49 | range.moveEnd('character', end); 50 | range.moveStart('character', begin); 51 | range.select(); 52 | } 53 | }); 54 | } else { 55 | if (this[0].setSelectionRange) { 56 | begin = this[0].selectionStart; 57 | end = this[0].selectionEnd; 58 | } else if (document.selection && document.selection.createRange) { 59 | range = document.selection.createRange(); 60 | begin = 0 - range.duplicate().moveStart('character', -100000); 61 | end = begin + range.text.length; 62 | } 63 | return { begin: begin, end: end }; 64 | } 65 | }, 66 | unmask: function() { 67 | return this.trigger("unmask"); 68 | }, 69 | mask: function(mask, settings) { 70 | var input, 71 | defs, 72 | tests, 73 | partialPosition, 74 | firstNonMaskPos, 75 | len; 76 | 77 | if (!mask && this.length > 0) { 78 | input = $(this[0]); 79 | return input.data($.mask.dataName)(); 80 | } 81 | settings = $.extend({ 82 | placeholder: $.mask.placeholder, // Load default placeholder 83 | completed: null 84 | }, settings); 85 | 86 | 87 | defs = $.mask.definitions; 88 | tests = []; 89 | partialPosition = len = mask.length; 90 | firstNonMaskPos = null; 91 | 92 | $.each(mask.split(""), function(i, c) { 93 | if (c == '?') { 94 | len--; 95 | partialPosition = i; 96 | } else if (defs[c]) { 97 | tests.push(new RegExp(defs[c])); 98 | if (firstNonMaskPos === null) { 99 | firstNonMaskPos = tests.length - 1; 100 | } 101 | } else { 102 | tests.push(null); 103 | } 104 | }); 105 | 106 | return this.trigger("unmask").each(function() { 107 | var input = $(this), 108 | buffer = $.map( 109 | mask.split(""), 110 | function(c, i) { 111 | if (c != '?') { 112 | return defs[c] ? settings.placeholder : c; 113 | } 114 | }), 115 | focusText = input.val(); 116 | 117 | function seekNext(pos) { 118 | while (++pos < len && !tests[pos]); 119 | return pos; 120 | } 121 | 122 | function seekPrev(pos) { 123 | while (--pos >= 0 && !tests[pos]); 124 | return pos; 125 | } 126 | 127 | function shiftL(begin,end) { 128 | var i, 129 | j; 130 | 131 | if (begin<0) { 132 | return; 133 | } 134 | 135 | for (i = begin, j = seekNext(end); i < len; i++) { 136 | if (tests[i]) { 137 | if (j < len && tests[i].test(buffer[j])) { 138 | buffer[i] = buffer[j]; 139 | buffer[j] = settings.placeholder; 140 | } else { 141 | break; 142 | } 143 | 144 | j = seekNext(j); 145 | } 146 | } 147 | writeBuffer(); 148 | input.caret(Math.max(firstNonMaskPos, begin)); 149 | } 150 | 151 | function shiftR(pos) { 152 | var i, 153 | c, 154 | j, 155 | t; 156 | 157 | for (i = pos, c = settings.placeholder; i < len; i++) { 158 | if (tests[i]) { 159 | j = seekNext(i); 160 | t = buffer[i]; 161 | buffer[i] = c; 162 | if (j < len && tests[j].test(t)) { 163 | c = t; 164 | } else { 165 | break; 166 | } 167 | } 168 | } 169 | } 170 | 171 | function keydownEvent(e) { 172 | var k = e.which, 173 | pos, 174 | begin, 175 | end; 176 | 177 | //backspace, delete, and escape get special treatment 178 | if (k === 8 || k === 46 || (iPhone && k === 127)) { 179 | pos = input.caret(); 180 | begin = pos.begin; 181 | end = pos.end; 182 | 183 | if (end - begin === 0) { 184 | begin=k!==46?seekPrev(begin):(end=seekNext(begin-1)); 185 | end=k===46?seekNext(end):end; 186 | } 187 | clearBuffer(begin, end); 188 | shiftL(begin, end - 1); 189 | 190 | e.preventDefault(); 191 | } else if (k == 27) {//escape 192 | input.val(focusText); 193 | input.caret(0, checkVal()); 194 | e.preventDefault(); 195 | } 196 | } 197 | 198 | function keypressEvent(e) { 199 | var k = e.which, 200 | pos = input.caret(), 201 | p, 202 | c, 203 | next; 204 | 205 | if (e.ctrlKey || e.altKey || e.metaKey || k < 32) {//Ignore 206 | return; 207 | } else if (k) { 208 | if (pos.end - pos.begin !== 0){ 209 | clearBuffer(pos.begin, pos.end); 210 | shiftL(pos.begin, pos.end-1); 211 | } 212 | 213 | p = seekNext(pos.begin - 1); 214 | if (p < len) { 215 | c = String.fromCharCode(k); 216 | if (tests[p].test(c)) { 217 | shiftR(p); 218 | 219 | buffer[p] = c; 220 | writeBuffer(); 221 | next = seekNext(p); 222 | 223 | if(android){ 224 | setTimeout($.proxy($.fn.caret,input,next),0); 225 | }else{ 226 | input.caret(next); 227 | } 228 | 229 | if (settings.completed && next >= len) { 230 | settings.completed.call(input); 231 | } 232 | } 233 | } 234 | e.preventDefault(); 235 | } 236 | } 237 | 238 | function clearBuffer(start, end) { 239 | var i; 240 | for (i = start; i < end && i < len; i++) { 241 | if (tests[i]) { 242 | buffer[i] = settings.placeholder; 243 | } 244 | } 245 | } 246 | 247 | function writeBuffer() { input.val(buffer.join('')); } 248 | 249 | function checkVal(allow) { 250 | //try to place characters where they belong 251 | var test = input.val(), 252 | lastMatch = -1, 253 | i, 254 | c; 255 | 256 | for (i = 0, pos = 0; i < len; i++) { 257 | if (tests[i]) { 258 | buffer[i] = settings.placeholder; 259 | while (pos++ < test.length) { 260 | c = test.charAt(pos - 1); 261 | if (tests[i].test(c)) { 262 | buffer[i] = c; 263 | lastMatch = i; 264 | break; 265 | } 266 | } 267 | if (pos > test.length) { 268 | break; 269 | } 270 | } else if (buffer[i] === test.charAt(pos) && i !== partialPosition) { 271 | pos++; 272 | lastMatch = i; 273 | } 274 | } 275 | if (allow) { 276 | writeBuffer(); 277 | } else if (lastMatch + 1 < partialPosition) { 278 | input.val(""); 279 | clearBuffer(0, len); 280 | } else { 281 | writeBuffer(); 282 | input.val(input.val().substring(0, lastMatch + 1)); 283 | } 284 | return (partialPosition ? i : firstNonMaskPos); 285 | } 286 | 287 | input.data($.mask.dataName,function(){ 288 | return $.map(buffer, function(c, i) { 289 | return tests[i]&&c!=settings.placeholder ? c : null; 290 | }).join(''); 291 | }); 292 | 293 | if (!input.attr("readonly")) 294 | input 295 | .one("unmask", function() { 296 | input 297 | .unbind(".mask") 298 | .removeData($.mask.dataName); 299 | }) 300 | .bind("focus.mask", function() { 301 | clearTimeout(caretTimeoutId); 302 | var pos, 303 | moveCaret; 304 | 305 | focusText = input.val(); 306 | pos = checkVal(); 307 | 308 | caretTimeoutId = setTimeout(function(){ 309 | writeBuffer(); 310 | if (pos == mask.length) { 311 | input.caret(0, pos); 312 | } else { 313 | input.caret(pos); 314 | } 315 | }, 10); 316 | }) 317 | .bind("blur.mask", function() { 318 | checkVal(); 319 | if (input.val() != focusText) 320 | input.change(); 321 | }) 322 | .bind("keydown.mask", keydownEvent) 323 | .bind("keypress.mask", keypressEvent) 324 | .bind(pasteEventName, function() { 325 | setTimeout(function() { 326 | var pos=checkVal(true); 327 | input.caret(pos); 328 | if (settings.completed && pos == input.val().length) 329 | settings.completed.call(input); 330 | }, 0); 331 | }); 332 | checkVal(); //Perform initial check for existing values 333 | }); 334 | } 335 | }); 336 | 337 | 338 | })(jQuery); --------------------------------------------------------------------------------