ipad detecting date as a telephone number and inserting a tel link - ios

I have the following for a responsive project:
<table>
<tr>
<td>Besteldatum</td>
<td itemprop="description">
24-2-2014
</td>
</tr>
<tr>
<td>Losse editie</td>
<td itemprop="description">
2014-02
</td>
</tr>
</table>
Strangely enough the ipad places a link in the first as if it were a telephone, check the image:
If I inspect in the ipad I see that the HTML is converted into the following:
<table>
<tbody><tr>
<td>Besteldatum</td>
<td itemprop="description">
24-2-2014
</td>
</tr>
<tr>
<td>Losse editie</td>
<td itemprop="description">
2014-02
</td>
</tr>
</table>
I think the ipad is detecting this date as a telephone number and placing this link automatically. I have other links with the tel link so I would like a solution that does not cancel the other tel links.
Never seen this, can anybody help?

This is default behaviour in iOS. It means that users can simply click a phone number on a web page to make a phone call. Unfortunately it does pick up some non-phone numbers sometimes depending on the formatting.
You have a few options. Here are a couple. Either disable iOS phone number detection by adding this meta tag:
<meta name="format-detection" content="telephone=no">
This maybe a bad idea because it will remove the phone number detection for the entire page making real phone numbers non-clickable.
or override the styles that are being applied with something like...
a[href^=tel] {
color: #your_color;
text-decoration: none;
pointer-events: none;
}
If you have some genuine phone numbers on the page, you may wish to add a class to the non-phone parent in order to differentiate:
.date a[href^=tel] {
color: #your_color;
text-decoration: none;
pointer-events: none;
}

Related

Avoid Url to be treated as hyperlinks in Rails Mailer

I'm sending a mailer to users that includes a link to their created post.
This link should be for copying and pasting only, however it delivers automatically as a blue underlined hyperlink.
Any suggestions?
Thanks
<td width="440" height="50" bgcolor="#f5f5f5" style="border:1px solid #e3e3e3; display: block; margin:40px auto;">
<div style="color:#666f67; font-size:16px; font-weight: 400; font-family:sans-serif; text-decoration: none; display:block; text-align:center; padding: 16px;">
url
</div>
</td>
The Bootstrap library is not included in emails as it would be in regular views. If you need to format emails, you'll have to do it inline. For example:
hello
Checkout Mailchimp, they have great resources on how to create email templates.
I hope this helps.
I found another way for future reference, by placing it inside an input field "readonly."
<input type="text" value="www.mylink.com" readonly>

Recommended approach to implementing inline editing for a MVC grid please?

I am using MVC3, C#, Razor, EF4.1
I have implemented grids in their most simple form ie Razor Tables. At present I have implemented editing of record fields off page ie Click "Edit" and the edit page appears, one then fills in data then save which returns user to main grid page.
I need an inline solution where only 1 or 2 fields need updating. Typically the user would either click on the row or on "edit" link and the row would change to "edit mode". One would then edit the data. One would then click on "Save" and the row would resort to read only, or the grid would refresh. Can you recommend a simple and robust solution for this. At present I am not thinking about 3rd party component solutions such as Telerik Kendo UI Grids , although in the near future I will no doubt upgrade to something like this. At present I want to keep it really simple.
Thoughts, wisdom, recommendations appreciated.
Many thanks.
EDIT:
Thanks all. I am going to give these suggestions a try.
Here is simplest way of doing it, see fiddle.
Save all your data using JSON web service. You'll end up having either array of cells or array of array of cells. (Alternatively you can put JSON in a hidden input box)
Use $.data api and put all information needed for server to save in data attributes.
You'll endup having something simple as
var f=$('#myform')
, t = $('table')
, inputs = t.find('input')
, b1 = $('button.save1')
, b2 = $('button.save2')
, ta = $('#save')
// update data-val attribute when value changed
t.on('change', 'input', (e) => $(e.target).data('val', e.target.value))
// store everything in $.data/data-* attributes
b1.on('click', () => {
var data = []
inputs.each((i,inp) => data.push($(inp).data()) )
ta.text(JSON.stringify(data))
})
// use $.serialize
b2.on('click', () => {
var data = f.serializeArray()
ta.text(JSON.stringify(data))
})
input {border : 1px solid #fff;margin:0; font-size:20px; }
input:focus { outline: 1px solid #eee; background-color:#eee; }
table { border : 1px solid #999; border-collapse:collapse;border-spacing:0; }
table td { padding:0; margin:0;border:1px solid #999; }
table th { background-color: #aaa; min-width:20px;border:1px solid #999; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<form name='myform' id='myform'>
<table>
<tr>
<th></th>
<th>A</th>
<th>B</th>
<th>C</th>
</tr>
<tr data-row="0">
<th>1</th>
<td><input type="text" data-row="0" data-col="0" data-val="a" value="a" name='data[0][0]'/></td>
<td><input type="text" data-row="0" data-col="1" data-val="b" value="b" name='data[0][1]'/></td>
<td><input type="text" data-row="0" data-col="2" data-val="c" value="c" name='data[0][2]'/></td>
</tr>
<tr data-row="1">
<th>2</th>
<td><input type="text" data-row="1" data-col="0" data-val="d" value="d" name='data[1][0]'/></td>
<td><input type="text" data-row="1" data-col="1" data-val="e" value="e" name='data[1][1]'/></td>
<td><input type="text" data-row="1" data-col="2" data-val="f" value="f" name='data[1][2]'/></td>
</tr>
<tr data-row="2">
<th>3</th>
<td><input type="text" data-row="2" data-col="0" data-val="g" value="g" name='data[2][0]' /></td>
<td><input type="text" data-row="2" data-col="1" data-val="h" value="h" name='data[2][1]' /></td>
<td><input type="text" data-row="2" data-col="2" data-val="i" value="i" name='data[2][2]' /></td>
</tr>
</table>
</form>
<div name="data" id="save" cols="30" rows="10"></div>
<button class='save1'>Save 1</button>
<button class='save2'>Save 2</button>
Given that you generate your table in Razor view and don't need to load data into table. So you "loading" data on the server and saving changes with tiny JS snippet above.
You can also style your input cells in the table so they would look different when with focus and not, making it look like Excel spreadsheet (without fancy Excel features though, just look).
Well in that case I will suggest you to add a div with a unique id with each grid row.
and on the click of edit button insert a row having text boxes with value using java script.
Using knockout.js is my preferred approach, and in my opinion, is simple to get started with but flexible enough to keep up with project demands.
Here are examples:
http://www.knockmeout.net/2011/03/guard-your-model-accept-or-cancel-edits.html
http://knockoutjs.com/examples/gridEditor.html
If you think this is for you then take an hour or two and go through the tutorials, it's well worth the time:
http://learn.knockoutjs.com/
I have implemented exactly what you are asking for, but I cannot assure you that it is robust. It definitely is not simple. Based on the article Get the Most out of WebGrid in ASP.NET MVC by Stuart Leeks I have created an MVC project which I have heavily modified with my own javascript. In the end I have come up with a solution that works but could be vastly improved. Took me at least a week to implement.
I write tutorial for implementing inline editable grid using mvc, knockoutjs with source code:
http://www.anhbui.net/blog?id=kojs-1

Google Fusion Tables Card Layout: How to format fields

I have the following template:
{template .contents}
<div class='googft-card-view' style='font-family: sans-serif; height: 17em; width: 450px; padding: 4px; border: 1px solid #ccc; overflow: hidden'>
<table border="0">
<tr>
<td>
<b>Village:</b> {$data.formatted.Village}<br>
<b>Location:</b> {$data.value.Location}<br>
<b>Location Accuracy:</b> {$data.value['Location:Accuracy']} meters<br>
</td>
</table>
</div>
{/template}
Which gives me:
Village: TestVillage
Location: <Point><coordinates>69.1782913000,34.5338741600,1787.5000000000</coordinates></Point>
Location Accuracy: 5.0 meters
I'd like to be able to get rid of the <point>, <coordinate> tags, and format the values. Javascript is disabled/stripped out in the card layout.
How can I manage this, if possible?
Try this:
{$data.value.Location |noAutoescape}
See Closure template docs for details.
You can't easily get to the individual lat/lng inside a KML snippet, but this should have the effect of clipping out the point and coordinate tags (I think).
If this not sufficient you can take over full formatting of the info windows in your own JavaScript code, though that's a bit more work.

Paginated, sortable, collapsible datarows (tables) in mobile application

I want to implement the Demo shown at http://tablesorter.com/docs/example-pager.html in a mobile application. I want each row in the Demo to be collapsible/expandable. What is the best way to achieve it? To my knowledge tables don't work well in mobile applications. Correct me if I am wrong. Thanks.
== EDIT ==
This is almost all I want
http://stokkers.mobi/jqm/tableview/demo.html
I'm not sure how this will do in a mobile application, but check out this demo. No need to download that mod as it was added to tablesorter 2.0.5.
The demo shows how to use an undocumented option named cssChildRow which contains the class name expand-child. This class name is added to a table row tr to attach it to the row before it (example code from that demo):
<tr>
<td rowspan="2" class="collapsible"></td>
<td rowspan="2" class="collapsible_alt">SO71774</td>
<td>Good Toys</td>
<td>PO348186287</td>
<td>Jul 20, 2007</td>
<td>$972.78</td>
</tr>
<tr class="expand-child">
<td colspan="4">
<div class="bold">Shipping Address</div>
<div>
99700 Bell Road<br /> Auburn, California 95603
</div>
</td>
</tr>
The code needed to make the rows collapsible in in this file: jquery.tablesorter.collapsible.js

Jquery mobile integration on plone

I'm working on a Plone site that has JQuery mobile and I have an issue with the medias.
JQuery mobiles creates a neat menu in the web page's home page that links to the differents views of the plone site. The problem is that the medias (like the images) are linked with a weird URL that doesn't exists.
What I mean is the following:
I have an image whose path would be: url/competitions-en/red-bull-monte-descend/horaire/red-bull-monte-descend/vignette_normal
But in the src param of the img tag what I see it's url / nameOfView competitions-en/red-bull-monte-descend/horaire/red-bull-monte-descend/vignette_normal
I have no idea why JQuery mobile adds the name of the view to the path of the image, tough I do know that if I load the view client side (so instead of going: main menu>view, I load the view in a new tab) there's no problem. JQuery mobile adds the name of the view to the path of the image only when I access the view trough the main page.
Any ideas on how to fix it?
Additional information:
This would be the block in the plone template with the first TD generating the img
<tr tal:repeat="el python: une_date[1]['horaires']">
<td tal:attributes="class string:categorie ${el/categorie/cls}">
<img tal:attributes="src el/horaire/vignette; alt el/horaire/title_short;" />
</td>
<td tal:attributes="class string:competition">
<a tal:content="el/competition/title" tal:attributes="href el/competition/url"></a>
</td>
<td class="emplacement">
<span tal:content="el/horaire/emplacement"></span>
</td>
<td class="debut_fin">
<span tal:content="el/horaire/debut">debut</span> - <span tal:content="el/horaire/fin">fin</span>
</td>
<td class="title" tal:content="el/horaire/title">un titre</td>
</tr>
Ty,
Axel

Resources