Skip to content

Commit

Permalink
wider input field
Browse files Browse the repository at this point in the history
  • Loading branch information
RolandStuder committed Jan 30, 2017
1 parent fe71d73 commit a76c833
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
14 changes: 4 additions & 10 deletions forwarder.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ if (Meteor.isClient) {
before: function(){
var url = Urls.findOne().url;
if (!(typeof url == "undefined")) {
document.write("forwarding");
setTimeout(function() { window.location.replace(url); }, 2000);
}
else {
Expand All @@ -18,15 +19,7 @@ if (Meteor.isClient) {
this.render('home');
});

// Router.route('/forward', function(){
// this.render('home');
// // before: function(){
// // var url = Urls.findOne().url;
// // window.location.replace(url);
// // };
// });

Template.url.helpers({
Template.home.helpers({
url: function () {
return Urls.findOne().url;
}
Expand All @@ -44,6 +37,7 @@ if (Meteor.isClient) {
if (Meteor.isServer) {
Meteor.startup(function () {
// code to run on server at startup
Urls.insert({});
Urls.remove({});
Urls.insert({url: "http://"});
});
}
7 changes: 1 addition & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,17 @@

<template name="home">
<h1>Share this url to all devices in the Open Device Lab Bern!</h1>
{{> url}}

<form action="#">
<label for="url">URL</label><br>
<input name="url" type="url" value="http://" placeholder="url">
<input name="url" type="url" value="{{url}}" placeholder="url">
</form>

<p>
<a href="/forward">Point your devices to this link</a>
</p>
</template>

<template name="url">
<h2><a href="{{url}}">{{url}}</a></h2>
</template>

<template name="forward">
Forwarding...
</template>
6 changes: 5 additions & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ h1 {

input {
font-size: 1.5em;
border: none;
border-bottom: 1px solid #ccc;
width: 80%;
text-align: center;
}

a, a:visited, a:active{
color:#798c1f;
}
}

0 comments on commit a76c833

Please sign in to comment.