From a423a93464c63c91ffb57d15efd7127c39660f46 Mon Sep 17 00:00:00 2001 From: Deac Date: Mon, 7 Nov 2016 21:45:54 -0500 Subject: [PATCH] bumping version numbers --- README.md | 8 +++++++- bower.json | 2 +- google-places.js | 52 +++++++++++++++++++++++++++++++++--------------- 3 files changed, 44 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 1c00c3e..f445391 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Include these files in the head | Optional | Type | Description | Default | |----------|----------|-------------|----------| -| **render** | Array | Currently only supports reviews and schema | ['reviews'] +| **render** | Array | supports reviews, schema, phone, address, hours, staticMap | ['reviews','phone','hours','address,'staticMap'] | **min_rating** | Int | Only display reviews with a minimum rating (not applicable for schema)| 0 | **max_rows** | Int | Maximum number of rows to show - 0 for all (not applicable for schema)| 0 | **rotateTime** | Int | Time in MS to show review before rotating or false for no rotate | false @@ -80,5 +80,11 @@ $("#google-reviews").googlePlaces({ , phone:{ displayElement: "#custom-phone-id" // optional, will use "#google-phone" by default } + , staticMap:{ + displayElement: "#google-static-map" // optional, will use "#google-static-map" by default + } + , hours:{ + displayElement: "#google-hours" // optional, will use "#google-hours" by default + } }); ``` diff --git a/bower.json b/bower.json index 637c97b..8556064 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "google-places", - "version": "0.0.9", + "version": "0.1.0", "authors": [ "Deac " ], diff --git a/google-places.js b/google-places.js index 63a1892..82bf513 100644 --- a/google-places.js +++ b/google-places.js @@ -22,6 +22,12 @@ , phone:{ displayElement: "#google-phone" } + , staticMap:{ + displayElement: "#google-static-map" + } + , hours:{ + displayElement: "#google-hours" + } }; var plugin = this; @@ -56,27 +62,25 @@ , plugin.place_data.formatted_phone_number ); } + if(plugin.settings.render.indexOf('staticMap') > -1){ + renderStaticMap( + capture_element(plugin.settings.staticMap.displayElement) + , plugin.place_data.formatted_address + ); + } + if(plugin.settings.render.indexOf('hours') > -1){ + renderHours( + capture_element(plugin.settings.hours.displayElement) + , plugin.place_data.opening_hours + ); + } + // render schema markup - addSchemaMarkup( capture_element(plugin.settings.schema.displayElement) , plugin.place_data ); - /*if(plugin.settings.schema.displayElement instanceof jQuery){ - addSchemaMarkup(plugin.place_data); - }else if(typeof plugin.settings.schema.displayElement == 'string'){ - try{ - var ele = $(plugin.settings.schema.displayElement); - if( ele.length ){ - plugin.settings.schema.displayElement = ele; - addSchemaMarkup(plugin.place_data); - }else{ - throw 'Element [' + plugin.settings.schema.displayElement + '] couldnt be found in the DOM. Skipping schema markup generation.'; - } - }catch(e){ - console.warn(e); - } - }*/ + }); } @@ -149,6 +153,22 @@ $element.append(html); } + var renderHours = function(element, data){ + if(element instanceof jQuery){ + var html = ""; + element.append(html); + } + } + + var renderStaticMap = function(element, data){ + if(element instanceof jQuery){ + element.append(""); + } + } var renderAddress = function(element, data){ if(element instanceof jQuery){