Created
November 1, 2012 05:39
-
-
Save geckotang/3992050 to your computer and use it in GitHub Desktop.
LINEを起動したりする
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 説明 | |
LINEがインストールされている端末のみ | |
* line:// で LINEを起動 | |
* line://msg/text/メッセージ で LINEを起動してユーザーを選ぶと *メッセージ* が既に入力されている | |
## 参考 | |
* http://www.msng.info/archives/2012/10/line.php | |
## 余談 | |
* 仕様変更等あったら使えなくなるかもしれません。 | |
* 怒られても知りません。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.line { | |
display:block; | |
margin:10px auto; | |
padding:20px 10px; | |
text-align:center; | |
border-radius:10px; | |
color:#fff; | |
background: #8fc800; /* Old browsers */ | |
/* IE9 SVG, needs conditional override of 'filter' to 'none' */ | |
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzhmYzgwMCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiM2ZDk5MDAiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); | |
background: -moz-linear-gradient(top, #8fc800 0%, #6d9900 100%); /* FF3.6+ */ | |
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#8fc800), color-stop(100%,#6d9900)); /* Chrome,Safari4+ */ | |
background: -webkit-linear-gradient(top, #8fc800 0%,#6d9900 100%); /* Chrome10+,Safari5.1+ */ | |
background: -o-linear-gradient(top, #8fc800 0%,#6d9900 100%); /* Opera 11.10+ */ | |
background: -ms-linear-gradient(top, #8fc800 0%,#6d9900 100%); /* IE10+ */ | |
background: linear-gradient(to bottom, #8fc800 0%,#6d9900 100%); /* W3C */ | |
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#8fc800', endColorstr='#6d9900',GradientType=0 ); /* IE6-8 */ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> | |
<a class="line" href="line://">LINE起動する</a> | |
<a class="line" href="line://msg/text/こんにちはこんにちは! http://jsdo.it/GeckoTang/vBUZ">LINEにメッセージを送る</a> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(ua){ | |
if ( | |
(ua.indexOf('iPhone') > 0 && ua.indexOf('iPad') == -1) | |
|| ua.indexOf('iPod') > 0 | |
|| ua.indexOf('Android') > 0 | |
) { | |
if(!confirm("LINEを起動しますか?")){ | |
return; | |
} | |
location.href = "line://msg/text/(`ω?)グフフ"; | |
} | |
}(navigator.userAgent)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment