diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e8a0eda --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +.buildlog +.DS_Store +.idea +.pub/ +build/ +packages +pubspec.lock diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..791a857 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changelog + +## 0.0.1 + +- Initial version, created by Stagehand diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8cc2c1c --- /dev/null +++ b/LICENSE @@ -0,0 +1,24 @@ +Copyright (c) 2015, . +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..97c1b60 --- /dev/null +++ b/Procfile @@ -0,0 +1,2 @@ +web: /app/dart-sdk/bin/dart server.dart + diff --git a/README.md b/README.md new file mode 100644 index 0000000..eb5bba8 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# drails_sample_app + +A minimal command-line application. diff --git a/bin/controllers/employee_controller.dart b/bin/controllers/employee_controller.dart new file mode 100644 index 0000000..fad1898 --- /dev/null +++ b/bin/controllers/employee_controller.dart @@ -0,0 +1,25 @@ +part of drails_example; + +@AuthorizeRoles(const ['ADMIN']) +class EmployeesController { + + @AuthorizeRoles(const ['PUBLIC']) + Employee get(int id) => g_employees[id]; + + @AuthorizeRoles(const ['PUBLIC']) + List getAll() => g_employees.values.toList(); + + Employee save(int id, @RequestBody Employee employee) => g_employees[id] = employee; + + Iterable saveAll(@RequestBody List employees) => + employees..forEach((employee) { + if(employee.id == null) { + employee.id = ++lastEmployeeId; + } + g_employees[employee.id] = employee; + }); + + void delete(int id) { g_employees.remove(id); } + + void deleteAll(@RequestBody List ids) { ids.forEach((id) => g_employees.remove(id)); } +} \ No newline at end of file diff --git a/bin/controllers/persons_controller.dart b/bin/controllers/persons_controller.dart new file mode 100644 index 0000000..34e08cb --- /dev/null +++ b/bin/controllers/persons_controller.dart @@ -0,0 +1,21 @@ +part of drails_example; + +class PersonsController { + Person get(int id) => g_persons[id]; + + List getAll() => g_persons.values.toList(); + + Person save(int id, @RequestBody Person person) => g_persons[id] = person; + + Iterable saveAll(@RequestBody List persons) => + persons..forEach((person) { + if(person.id == null) { + person.id = ++lastId; + } + g_persons[person.id] = person; + }); + + void delete(int id) { g_persons.remove(id); } + + void deleteAll(@RequestBody List ids) { ids.forEach((id) => g_persons.remove(id)); } +} \ No newline at end of file diff --git a/bin/data/persons_data.dart b/bin/data/persons_data.dart new file mode 100644 index 0000000..ede304d --- /dev/null +++ b/bin/data/persons_data.dart @@ -0,0 +1,57 @@ +part of drails_example; + +int lastId = 3; +Map g_persons = { + 1: new Person() + ..id = 1 + ..firstName = 'Jhon' + ..lastName = 'Doe' + ..dob = new DateTime.utc(1988, 4, 1), + 2: new Person() + ..id = 2 + ..firstName = 'Jimmy' + ..lastName = 'Who' + ..dob = new DateTime.utc(1988, 4, 1), + 3: new Person() + ..id = 3 + ..firstName = 'Jake' + ..lastName = 'Britman' + ..dob = new DateTime.utc(1988, 8, 28) +}; + + +Map g_users = { + 1: new User() + ..id = 1 + ..name = 'jhon' + ..password = 'jhon' + ..roles = ['ADMIN'], + 2: new User() + ..id = 2 + ..name = 'jake' + ..password = 'jake' + ..roles = ['PUBLIC'] +}; + +int lastEmployeeId = 3; +Map g_employees = { + 1: new Employee() + ..id = 1 + ..firstName = 'Jade' + ..lastName = 'wan' + ..dob = new DateTime(1988, 4, 1) + ..salary = 1000, + 2: new Employee() + ..id = 2 + ..firstName = 'David' + ..lastName = 'Dolittle' + ..dob = new DateTime(1988, 4, 1) + ..salary = 1000, + 3: new Employee() + ..id = 3 + ..firstName = 'Mark' + ..lastName = 'Brito' + ..dob = new DateTime(1989, 8, 28) + ..salary = 3000 +}; + diff --git a/bin/server.dart b/bin/server.dart new file mode 100644 index 0000000..68af185 --- /dev/null +++ b/bin/server.dart @@ -0,0 +1,43 @@ +library drails_example; + +import 'package:drails/drails.dart'; +import 'package:logging/logging.dart'; +import 'dart:io'; +import 'package:drails_sample_app/models.dart'; + +part 'controllers/persons_controller.dart'; +part 'controllers/employee_controller.dart'; +part 'data/persons_data.dart'; + + +initLogger() { + Logger.root.level = Level.OFF; + hierarchicalLoggingEnabled = true; + new Logger('server_init').level = Level.INFO; + + Logger.root.onRecord.listen((LogRecord rec) { + print('${rec.level.name}: ${rec.time}: ${rec.message}'); + }); +} + +void main() { + initLogger(); + + ENV = 'prod'; + CLIENT_DIR['prod'] = '/../web/'; + + POST['/login'] = (HttpSession session, @RequestBody User user) { + var cu = g_users.values.singleWhere((u) => u.name == user.name && u.password == user.password); + if(cu == null) throw Exception; + session['user'] = cu; + return new User() + ..name = cu.name + ..roles = cu.roles; + }; + + GET['/logout'] = (HttpSession session) { + session['user'] = null; + }; + + initServer([#drails_example]); +} diff --git a/build.dart b/build.dart new file mode 100644 index 0000000..31bd844 --- /dev/null +++ b/build.dart @@ -0,0 +1,7 @@ +// Copyright (c) 2015, . All rights reserved. Use of this source code +// is governed by a BSD-style license that can be found in the LICENSE file. + +// This file is only used by Dart Editor. It displays errors and warnings after +// analyzing a polymer.dart app. + +export 'package:polymer/default_build.dart'; diff --git a/lib/PolymerElementExt.dart b/lib/PolymerElementExt.dart new file mode 100644 index 0000000..dc2d46e --- /dev/null +++ b/lib/PolymerElementExt.dart @@ -0,0 +1,38 @@ +import 'package:polymer/polymer.dart'; +import 'package:polymer_expressions/filter.dart'; +import 'package:sprintf/sprintf.dart' as SPRINTF; + + +class PolymerElementExt extends PolymerElement { + PolymerElementExt.created() : super.created(); + + String sprintf(String fmt, var args) => + SPRINTF.sprintf(fmt, args); + + final asInt = new _AsInt(); + + final asDate = new _AsDate(); + + String asSlashedDate(DateTime v) => + v == null ? '' : sprintf('%02d/%02d/%04d', [v.month, v.day, v.year]); +} + +class _AsInt extends Transformer { + String forward(int i) => '$i'; + int reverse(String s) => + s == null || s.isEmpty ? 0 : int.parse(s); +} + +class _AsDate extends Transformer { + + @override + String forward(DateTime v) { + if(v == null) + v = new DateTime.now(); + return SPRINTF.sprintf('%04d-%02d-%02d', [v.year, v.month, v.day]); + } + + @override + DateTime reverse(String t) => + t == null || t.isEmpty ? new DateTime.now() : DateTime.parse(t); +} diff --git a/lib/drails_sample_app.dart b/lib/drails_sample_app.dart new file mode 100644 index 0000000..4f23d80 --- /dev/null +++ b/lib/drails_sample_app.dart @@ -0,0 +1,9 @@ +// Copyright (c) 2015, . All rights reserved. Use of this source code +// is governed by a BSD-style license that can be found in the LICENSE file. + +/// The drails_sample_app library. +library drails_sample_app; + +int calculate() { + return 6 * 7; +} diff --git a/lib/main_app.dart b/lib/main_app.dart new file mode 100644 index 0000000..57cb999 --- /dev/null +++ b/lib/main_app.dart @@ -0,0 +1,40 @@ +// Copyright (c) 2015, . All rights reserved. Use of this source code +// is governed by a BSD-style license that can be found in the LICENSE file. + +import 'package:polymer/polymer.dart'; +import 'package:drails_sample_app/models.dart'; +import 'dart:html'; +import 'package:dson/dson.dart'; + +/// A Polymer `` element. +@CustomTag('main-app') +class MainApp extends PolymerElement { + + @observable User user; + + /// Constructor used to create instance of MainApp. + MainApp.created() : super.created(); + + ready() { + var usrStr = window.sessionStorage['user']; + if(usrStr != null) + user = deserialize(usrStr, User); + else + user = new User(); + } + + login(Event e, details, Element target) { + HttpRequest.request("login", method: 'POST', sendData: serialize(user)).then((request) { + window.sessionStorage['user'] = request.response; + user = deserialize(request.response, User); + }); + } + + logout(Event e, details, Element target) { + HttpRequest.request("logout", method: 'GET').then((req) { + user = new User(); + $['core_menu'].selected = 0; + window.sessionStorage.clear(); + }); + } +} diff --git a/lib/main_app.html b/lib/main_app.html new file mode 100644 index 0000000..25b638e --- /dev/null +++ b/lib/main_app.html @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/models.dart b/lib/models.dart new file mode 100644 index 0000000..d5872d3 --- /dev/null +++ b/lib/models.dart @@ -0,0 +1,11 @@ +// Copyright (c) 2015, . All rights reserved. Use of this source code +// is governed by a BSD-style license that can be found in the LICENSE file. + +/// The models library. +/// +/// This is an awesome library. More dartdocs go here. +library models; + +part 'src/user.dart'; +part 'src/person.dart'; +part 'src/employee.dart'; diff --git a/lib/sample_employees/sample_employees.dart b/lib/sample_employees/sample_employees.dart new file mode 100644 index 0000000..8d33f43 --- /dev/null +++ b/lib/sample_employees/sample_employees.dart @@ -0,0 +1,43 @@ +// Copyright (c) 2015, Luis Vargas. All rights reserved. Use of this source code +// is governed by a BSD-style license that can be found in the LICENSE file. + +import 'package:polymer/polymer.dart'; +import 'package:drails_sample_app/models.dart'; +import 'dart:html'; +import 'package:dson/dson.dart'; + +/// A Polymer `` element. +@CustomTag('sample-employees') +class SampleEmployees extends PolymerElement { + /// Constructor used to create instance of MainApp. + SampleEmployees.created() : super.created(); + + @published User user; + + @observable ObservableList employees; + + @observable Employee newEmployee; + + @observable bool adding; + + ready() { + HttpRequest.getString('http://localhost:4040/employees').then((response) { + employees = toObservable(deserializeList(response, Employee)); + }); + } + + deleteEmployee(Event e, Employee p, Element target) { + HttpRequest.request('http://localhost:4040/employees/${p.id}', method: 'DELETE').then((response) { + employees.remove(p); + }); + } + + saveEmployee(Event e, Employee p, Element target) { + var p1 = employees.firstWhere((e) => e.id == p.id); + employees[employees.indexOf(p1)] = p; + } + + beginAddingEmployee() => adding = true; + + addEmployee(Event e, Employee p, Element target) => employees.add(p); +} diff --git a/lib/sample_employees/sample_employees.html b/lib/sample_employees/sample_employees.html new file mode 100644 index 0000000..2c556c3 --- /dev/null +++ b/lib/sample_employees/sample_employees.html @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + diff --git a/lib/sample_employees/sample_employees_element.dart b/lib/sample_employees/sample_employees_element.dart new file mode 100644 index 0000000..82cc865 --- /dev/null +++ b/lib/sample_employees/sample_employees_element.dart @@ -0,0 +1,27 @@ +// Copyright (c) 2015, Luis Vargas. All rights reserved. Use of this source code +// is governed by a BSD-style license that can be found in the LICENSE file. + +import 'package:polymer/polymer.dart'; +import 'package:drails_sample_app/models.dart'; +import 'dart:html'; +import 'package:drails_sample_app/PolymerElementExt.dart'; + +/// A Polymer `` element. +@CustomTag('sample-employees-element') +class SampleEmployeesElement extends PolymerElementExt { + /// Constructor used to create instance of MainApp. + SampleEmployeesElement.created() : super.created(); + + @published Employee employee; + @published User user; + + @observable bool editing = false; + + editEmployee(Event e, detail, Element target) { + editing = true; + } + + deleteEmployee(Event e, detail, Element target) { + fire('delete-employee', detail: employee); + } +} \ No newline at end of file diff --git a/lib/sample_employees/sample_employees_element.html b/lib/sample_employees/sample_employees_element.html new file mode 100644 index 0000000..3dfbd43 --- /dev/null +++ b/lib/sample_employees/sample_employees_element.html @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + diff --git a/lib/sample_employees/sample_employees_form.dart b/lib/sample_employees/sample_employees_form.dart new file mode 100644 index 0000000..56ee048 --- /dev/null +++ b/lib/sample_employees/sample_employees_form.dart @@ -0,0 +1,42 @@ +// Copyright (c) 2015, Luis Vargas. All rights reserved. Use of this source code +// is governed by a BSD-style license that can be found in the LICENSE file. + +import 'package:polymer/polymer.dart'; +import 'package:drails_sample_app/models.dart'; +import 'dart:html'; +import 'package:dson/dson.dart'; +import 'package:drails_sample_app/PolymerElementExt.dart'; + +/// A Polymer `` element. +@CustomTag('sample-employees-form') +class SampleEmployeesForm extends PolymerElementExt { + /// Constructor used to create instance of MainApp. + SampleEmployeesForm.created() : super.created(); + + @published Employee employee; + @published bool editing; + @observable Employee employeeAux; + + ready() { + employeeAux = new Employee(); + if(employee != null) + employeeAux + ..id = employee.id + ..firstName = employee.firstName + ..lastName = employee.lastName + ..dob = employee.dob; + else + employeeAux.dob = new DateTime.now(); + } + + void cancelEditing(Event e, detail, Element target) { + editing = false; + } + + void saveEmployee(Event e, detail, Element target) { + HttpRequest.request('http://localhost:4040/employees', method: 'POST', sendData: serialize(employeeAux)).then((request) { + fire('employee-saved', detail: deserialize(request.response, Employee)); + editing = false; + }); + } +} diff --git a/lib/sample_employees/sample_employees_form.html b/lib/sample_employees/sample_employees_form.html new file mode 100644 index 0000000..d22bd56 --- /dev/null +++ b/lib/sample_employees/sample_employees_form.html @@ -0,0 +1,31 @@ + + + + + + + + + + + + + diff --git a/lib/sample_persons/sample_persons.dart b/lib/sample_persons/sample_persons.dart new file mode 100644 index 0000000..2448a4a --- /dev/null +++ b/lib/sample_persons/sample_persons.dart @@ -0,0 +1,41 @@ +// Copyright (c) 2015, Luis Vargas. All rights reserved. Use of this source code +// is governed by a BSD-style license that can be found in the LICENSE file. + +import 'package:polymer/polymer.dart'; +import 'package:drails_sample_app/models.dart'; +import 'dart:html'; +import 'package:dson/dson.dart'; + +/// A Polymer `` element. +@CustomTag('sample-persons') +class SamplePersons extends PolymerElement { + /// Constructor used to create instance of MainApp. + SamplePersons.created() : super.created(); + + @observable ObservableList persons; + + @observable Person newPerson; + + @observable bool adding; + + ready() { + HttpRequest.getString('http://localhost:4040/persons').then((response) { + persons = toObservable(deserializeList(response, Person)); + }); + } + + deletePerson(Event e, Person p, Element target) { + HttpRequest.request('http://localhost:4040/persons/${p.id}', method: 'DELETE').then((response) { + persons.remove(p); + }); + } + + savePerson(Event e, Person p, Element target) { + var p1 = persons.firstWhere((e) => e.id == p.id); + persons[persons.indexOf(p1)] = p; + } + + beginAddingPerson() => adding = true; + + addPerson(Event e, Person p, Element target) => persons.add(p); +} diff --git a/lib/sample_persons/sample_persons.html b/lib/sample_persons/sample_persons.html new file mode 100644 index 0000000..0164c95 --- /dev/null +++ b/lib/sample_persons/sample_persons.html @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + diff --git a/lib/sample_persons/sample_persons_element.dart b/lib/sample_persons/sample_persons_element.dart new file mode 100644 index 0000000..9d02c53 --- /dev/null +++ b/lib/sample_persons/sample_persons_element.dart @@ -0,0 +1,26 @@ +// Copyright (c) 2015, Luis Vargas. All rights reserved. Use of this source code +// is governed by a BSD-style license that can be found in the LICENSE file. + +import 'package:polymer/polymer.dart'; +import 'package:drails_sample_app/models.dart'; +import 'dart:html'; +import 'package:drails_sample_app/PolymerElementExt.dart'; + +/// A Polymer `` element. +@CustomTag('sample-persons-element') +class SamplePersonElement extends PolymerElementExt { + /// Constructor used to create instance of MainApp. + SamplePersonElement.created() : super.created(); + + @published Person person; + + @observable bool editing = false; + + editPerson(Event e, detail, Element target) { + editing = true; + } + + deletePerson(Event e, detail, Element target) { + fire('delete-person', detail: person); + } +} \ No newline at end of file diff --git a/lib/sample_persons/sample_persons_element.html b/lib/sample_persons/sample_persons_element.html new file mode 100644 index 0000000..7198f3c --- /dev/null +++ b/lib/sample_persons/sample_persons_element.html @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + diff --git a/lib/sample_persons/sample_persons_form.dart b/lib/sample_persons/sample_persons_form.dart new file mode 100644 index 0000000..3c040e2 --- /dev/null +++ b/lib/sample_persons/sample_persons_form.dart @@ -0,0 +1,42 @@ +// Copyright (c) 2015, Luis Vargas. All rights reserved. Use of this source code +// is governed by a BSD-style license that can be found in the LICENSE file. + +import 'package:polymer/polymer.dart'; +import 'package:drails_sample_app/models.dart'; +import 'dart:html'; +import 'package:dson/dson.dart'; +import 'package:drails_sample_app/PolymerElementExt.dart'; + +/// A Polymer `` element. +@CustomTag('sample-persons-form') +class SamplePersonsForm extends PolymerElementExt { + /// Constructor used to create instance of MainApp. + SamplePersonsForm.created() : super.created(); + + @published Person person; + @published bool editing; + @observable Person personAux; + + ready() { + personAux = new Person(); + if(person != null) + personAux + ..id = person.id + ..firstName = person.firstName + ..lastName = person.lastName + ..dob = person.dob; + else + personAux.dob = new DateTime.now(); + } + + void cancelEditing(Event e, detail, Element target) { + editing = false; + } + + void savePerson(Event e, detail, Element target) { + HttpRequest.request('http://localhost:4040/persons', method: 'POST', sendData: serialize(personAux)).then((request) { + fire('person-saved', detail: deserialize(request.response, Person)); + editing = false; + }); + } +} diff --git a/lib/sample_persons/sample_persons_form.html b/lib/sample_persons/sample_persons_form.html new file mode 100644 index 0000000..cc5011d --- /dev/null +++ b/lib/sample_persons/sample_persons_form.html @@ -0,0 +1,31 @@ + + + + + + + + + + + + + diff --git a/lib/src/employee.dart b/lib/src/employee.dart new file mode 100644 index 0000000..6aac5df --- /dev/null +++ b/lib/src/employee.dart @@ -0,0 +1,5 @@ +part of models; + +class Employee extends Person { + num salary; +} \ No newline at end of file diff --git a/lib/src/person.dart b/lib/src/person.dart new file mode 100644 index 0000000..5b04a18 --- /dev/null +++ b/lib/src/person.dart @@ -0,0 +1,8 @@ +part of models; + +class Person { + int id; + String firstName; + String lastName; + DateTime dob; +} diff --git a/lib/src/user.dart b/lib/src/user.dart new file mode 100644 index 0000000..cdfccfa --- /dev/null +++ b/lib/src/user.dart @@ -0,0 +1,8 @@ +part of models; + +class User { + int id; + String name; + String password; + List roles; +} \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml new file mode 100644 index 0000000..b9bbebb --- /dev/null +++ b/pubspec.yaml @@ -0,0 +1,13 @@ +name: drails_sample_app +version: 0.0.1 +description: A minimal command-line application. +environment: + sdk: '>=1.0.0 <2.0.0' +dependencies: + browser: any + drails: any + paper_elements: any + polymer: any + sprintf: any +dev_dependencies: + unittest: any diff --git a/test/all.dart b/test/all.dart new file mode 100644 index 0000000..8981daa --- /dev/null +++ b/test/all.dart @@ -0,0 +1,10 @@ +// Copyright (c) 2015, . All rights reserved. Use of this source code +// is governed by a BSD-style license that can be found in the LICENSE file. + +library all_tests; + +import 'drails_sample_app_test.dart' as drails_sample_app_test; + +void main() { + drails_sample_app_test.defineTests(); +} diff --git a/test/drails_sample_app_test.dart b/test/drails_sample_app_test.dart new file mode 100644 index 0000000..e0c14a4 --- /dev/null +++ b/test/drails_sample_app_test.dart @@ -0,0 +1,17 @@ +// Copyright (c) 2015, . All rights reserved. Use of this source code +// is governed by a BSD-style license that can be found in the LICENSE file. + +library drails_sample_app_test; + +import 'package:drails_sample_app/drails_sample_app.dart'; +import 'package:unittest/unittest.dart'; + +void main() => defineTests(); + +void defineTests() { + group('main tests', () { + test('calculate', () { + expect(calculate(), 42); + }); + }); +} diff --git a/web/apple-touch-icon-precomposed.png b/web/apple-touch-icon-precomposed.png new file mode 100644 index 0000000..76c482b Binary files /dev/null and b/web/apple-touch-icon-precomposed.png differ diff --git a/web/favicon.ico b/web/favicon.ico new file mode 100644 index 0000000..6132543 Binary files /dev/null and b/web/favicon.ico differ diff --git a/web/images/touch/chrome-touch-icon-192x192.png b/web/images/touch/chrome-touch-icon-192x192.png new file mode 100644 index 0000000..f6ba515 Binary files /dev/null and b/web/images/touch/chrome-touch-icon-192x192.png differ diff --git a/web/images/touch/ms-touch-icon-144x144-precomposed.png b/web/images/touch/ms-touch-icon-144x144-precomposed.png new file mode 100644 index 0000000..d7edfab Binary files /dev/null and b/web/images/touch/ms-touch-icon-144x144-precomposed.png differ diff --git a/web/index.dart b/web/index.dart new file mode 100644 index 0000000..25d4986 --- /dev/null +++ b/web/index.dart @@ -0,0 +1,10 @@ +import 'package:polymer/polymer.dart'; +import 'dart:html'; + +main() { + var href = window.location.href; + if(href.contains('4040')) + initPolymer(); + else + window.location.href = href.replaceFirst('808', '404'); +} diff --git a/web/index.html b/web/index.html new file mode 100644 index 0000000..e5dc844 --- /dev/null +++ b/web/index.html @@ -0,0 +1,45 @@ + + + + + + + + + + + client + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/robots.txt b/web/robots.txt new file mode 100644 index 0000000..d0e5f1b --- /dev/null +++ b/web/robots.txt @@ -0,0 +1,5 @@ +# www.robotstxt.org/ + +# Allow crawling of all content +User-agent: * +Disallow: diff --git a/web/styles.css b/web/styles.css new file mode 100644 index 0000000..fb31462 --- /dev/null +++ b/web/styles.css @@ -0,0 +1,14 @@ +/* Copyright (c) 2015, . All rights reserved. Use of this source code */ +/* is governed by a BSD-style license that can be found in the LICENSE file. */ + +body { + font-family: RobotoDraft, sans-serif; + color: #333; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + -webkit-tap-highlight-color: rgba(0,0,0,0); + -webkit-touch-callout: none; + margin: 0; +}