-
Notifications
You must be signed in to change notification settings - Fork 8
HW5 #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
RooshRoosh
wants to merge
3
commits into
cripi-javascript:master
Choose a base branch
from
RooshRoosh:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
HW5 #8
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| <!DOCTYPE html> | ||
| <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| <head> | ||
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
| <link href="main.css" type="text/css" rel="stylesheet" /> | ||
| <script src="events.js" type="text/javascript"></script> | ||
| <title>События</title> | ||
| </head> | ||
|
|
||
| <body> | ||
| <h1>Добро пожаловать в конструктор событий, <span id="username">Username</span><input type="text" name="username" id="userinput">!</h1> | ||
| <!-- Форма создания события--> | ||
| <div id="eventBuilder"> | ||
| <hr/> | ||
| <h2>Создайте своё собственное событие</h2> | ||
| <ul id="errors"> | ||
| <li>Написать валидацию формы</li> | ||
| </ul> | ||
| <table> | ||
| <form name="constructor"> | ||
| <tr> | ||
| <td>Название события</td> | ||
| <td><input type="text" name="call" id="call" value=''></td> | ||
| </tr> | ||
| <tr> | ||
| <td>Дата начала</td> | ||
| <td><input type="date" name="dateStart" id="dateStart" value=''></td> | ||
| </tr> | ||
| <tr> | ||
| <td>Дата окончания</td> | ||
| <td><input type="date" name="dateFinish" id="dateFinish" value=''></td> | ||
| </tr> | ||
| <tr> | ||
| <td>Описание события</td> | ||
| <td><input type="text" name="description" id="description" value=''></td> | ||
| </tr> | ||
| <tr> | ||
| <td>Предшествующие связанные события</td> | ||
| <td> | ||
| <select name="parents" id="parents"> | ||
| <option disabled>Выберите событие</option> | ||
| </select> | ||
| </td> | ||
| </tr> | ||
| <tr> | ||
| <td>Участники события</td> | ||
| <td><input type="text" name="people" id="people" value=''></td> | ||
| </tr> | ||
| <tr> | ||
| <td>Место проведения</td> | ||
| <td>Тут будет что-то что позволяет сохранить точку на яндекс картах</td> | ||
| </tr> | ||
| <tr> | ||
| <td>Приватность</td> | ||
| <td><input type="radio" name="private" value="Открытое" checked>Открытое<input type="radio" name="private" value="Приватное">Приватное<td> | ||
| </tr> | ||
| <tr> | ||
| <td>Возрастной рейтинг</td> | ||
| <td> | ||
| <input type="radio" name="EvRS" value="0+">0+ | ||
| <input type="radio" name="EvRS" value="3+">3+ | ||
| <input type="radio" name="EvRS" value="6+">6+ | ||
| <input type="radio" name="EvRS" value="12+">12+ | ||
| <input type="radio" name="EvRS" value="16+">16+ | ||
| <input type="radio" name="EvRS" value="18+" checked>18+ | ||
| </td> | ||
| </tr> | ||
| <tr> | ||
| <td>Внешняя ссылка</td> | ||
| <td><input type="text" name="Url" id="url" value=''></td> | ||
| </tr> | ||
| <tr> | ||
| <td> | ||
| <div><p id="createButton">Добавить событие</p></div> | ||
| </td> | ||
| </tr> | ||
| </form> | ||
| </table> | ||
| </div> | ||
|
|
||
| <!-- Конец формы --> | ||
| <!-- Таблица ввёденых событий--> | ||
| <div id="eventsContainer"> | ||
| <hr/> | ||
| <h2>Созданные события</h2> | ||
| <p>Двойной щелчок по заголовку - сортировка по выбранному столбцу.</p> | ||
| <table id="tableOfEvents"></table> | ||
| </div> | ||
| <!-- Конец таблицы --> | ||
| <!-- Разное--> | ||
| <div id="others"></div> | ||
| <script src="move.js" type="text/javascript"></script> | ||
| </body> | ||
| </html> |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,148 @@ | ||
| // JavaScript Document | ||
| function inherits(Constructor, SuperConstructor){ | ||
| var F = function () {}; | ||
| F.prototype = SuperConstructor.prototype; | ||
| Constructor.prototype = new F() | ||
| }; | ||
| function isDate(date){ | ||
| if (date === ''){ | ||
| return true | ||
| } | ||
| else { | ||
| return false | ||
| } | ||
| } | ||
|
|
||
| /*var Model = function (data) { | ||
| "use strict"; | ||
| var keyName; | ||
| for (keyName in data) { | ||
| if (data.hasOwnProperty(keyName)) { | ||
| this[keyName] = data[keyName]; | ||
| } | ||
| } | ||
| }; | ||
| /** | ||
| * Set - устанавливает аттрибуты и значения атрибутов, в соответсвии с принятым в качестве параметра объектом | ||
| * | ||
| * @param {Object} attributes | ||
| * | ||
| * @example | ||
| * item.set({title: "March 20", content: "In his eyes she eclipses..."}); | ||
| */ | ||
| /*Model.prototype.set = function (attributes) { | ||
| for (var key in attributes){ | ||
| if (attributes.hasOwnProperty(key)) { | ||
| this[key] = attributes[key]; | ||
| } | ||
| } | ||
| }; | ||
|
|
||
| /** | ||
| * Get возвращает запрашиваемое свойство у объекта | ||
| * | ||
| * @param {Object} attributes | ||
| */ | ||
| /*Model.prototype.get = function (attribute) { | ||
| if (this.hasOwnProperty(attribute)) { | ||
| return this[attribute]; | ||
| } | ||
| return undefined; | ||
| }; | ||
| /** | ||
| * | ||
| * @param {Object} attributes | ||
| */ | ||
| /*Model.prototype.validate = function (attributes) { | ||
| throw new Error('this is Abstract method'); | ||
| }; | ||
|
|
||
| */ | ||
| var Event = function(data){ | ||
| var keyName; | ||
| for (keyName in data) { | ||
| if (data.hasOwnProperty(keyName)) { | ||
| this[keyName] = data[keyName]; | ||
| } | ||
| } | ||
| }; | ||
| Event.prototype.r = function(){ | ||
| console.log('tratatatata') | ||
| } | ||
| Event.prototype.validate = function() { | ||
| //'use strict'; | ||
| var errorList = [];/* | ||
| if (this.name === undefined){ | ||
| this.name = 'Новое событие' | ||
| } | ||
| if (!isDate(this.start)){ | ||
| errorList.push('Неверно указана дата начала события.') | ||
| } | ||
| if (!isDate(this.end)){ | ||
| errorList.push('Неверно указана дата окончания события.') | ||
| } | ||
| /*if (this.start < this.end){ | ||
| errorList.push('Время начала события должно быть раньше времени окончания.') | ||
| } | ||
| */ | ||
| /** | ||
| return { | ||
| "start": DateStart || new Date(), | ||
| "end": DateFinish, | ||
| "name": Call || "Новое событие", | ||
| "description": Description || "Описание события", | ||
| "parent": Parent || {}, | ||
| "childs": Childs || [], | ||
| "comments": Comments || [], | ||
| "peoples": Peoples || [], | ||
| "location": Location || {}, | ||
| "private": Private || False, | ||
| "rank": Rank || 0, | ||
| "EvRS": EvRS || 18, | ||
| "Link": Link || '' | ||
| } | ||
| */ | ||
| return errorList | ||
|
|
||
| }; | ||
|
|
||
|
|
||
|
|
||
| var Collection = function(data){ | ||
| this.items = []; | ||
| var i | ||
| for (var i in data){ | ||
| this.items.push(data[i]); | ||
| } | ||
| }; | ||
| Collection.prototype.add = function(i){ | ||
| this.items.push(i); | ||
| } | ||
| //Collection.prototype = new Model(); | ||
|
|
||
| var Events = function(){}; | ||
| Events.prototype = new Collection() | ||
|
|
||
| Events.prototype.sortByStartTime = function(){} | ||
| Events.prototype.sortByEndTime = function(){} | ||
| Events.prototype.previos = function(){} | ||
| Events.prototype.futures = function(){} | ||
| Events.prototype.filterByField = function(){} | ||
| Events.prototype.myEvents = function(){} | ||
| Events.prototype.eventsWhithMe = function(){} | ||
|
|
||
| ///////////////////////////////////////////////////////////////////////// | ||
| e = new Event({"start": new Date(2012, 9, 3, 19, 00, 00), | ||
| "end": new Date(2012, 9, 3, 20, 00, 00), | ||
| "name": "1 лекция по JavaScript", | ||
| "description": "Обзор языка", | ||
| "parent": {}, | ||
| "childs": [], | ||
| "comments": ['Красивенько', 'А мы могли бы...'], | ||
| "people": [], | ||
| "location": {}, | ||
| "private": true, | ||
| "rank": 4, | ||
| "EvRS": 16, | ||
| "Link": 'http://cripi.ru/#javascript'}); | ||
|
|
||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| @charset "utf-8"; | ||
| /* CSS Document */ | ||
|
|
||
| #username {border-bottom:dotted thin;} | ||
| #createButton{padding: 10px 20px; | ||
| background:#0CF; | ||
| color:#FFF;} | ||
| /*#tableOfEvents {}*/ | ||
| #tableOfEvents tr td.nodata {border:#000 thin solid; | ||
| background:#FDD; | ||
| padding:5px; | ||
| } | ||
| #tableOfEvents tr td{border:#000 thin solid; | ||
| background:#DFFFED; | ||
| padding:5px; | ||
| min-width:100px; | ||
| max-width:250px;} | ||
| #tableOfEvents tr th{border:#000 thin solid; | ||
| background:#CFC; | ||
| padding:5px; | ||
| min-width:100px; | ||
| max-width:250px;} | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Вынеси каждый конструктор в отдельный файл