From 0ff48f79e4ddfc1f513f33f0b44f5d43e1948f2b Mon Sep 17 00:00:00 2001 From: Natalya Bronina Date: Wed, 24 Oct 2012 01:41:34 +0600 Subject: [PATCH 1/2] =?UTF-8?q?=D0=A1=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=BA=D0=BE=D0=BB=D0=BB=D0=B5=D0=BA=D1=86=D0=B8=D0=B8?= =?UTF-8?q?=20=D0=BE=D0=B1=D1=8A=D0=B5=D0=BA=D1=82=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Удалось создать только массив объектов, а не коллекцию. Эти объекты никак не связаны с типом объекта Event, который был реализован во 2ом задании, соответственно у этих объектов нет значений заданных по умолчанию. Нужно переделать. --- test.html | 30 ++++++++++++++++++++++ test_event.js | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 test.html create mode 100644 test_event.js diff --git a/test.html b/test.html new file mode 100644 index 0000000..318fffb --- /dev/null +++ b/test.html @@ -0,0 +1,30 @@ + + + + Вывод информации о событиях + + + + + +
+ Тестирование вывода информации в консоль +
+ + + + \ No newline at end of file diff --git a/test_event.js b/test_event.js new file mode 100644 index 0000000..ff3163c --- /dev/null +++ b/test_event.js @@ -0,0 +1,69 @@ +var participants = [["Саша", 891288734], ["Аня", 987462974], ["Паша", 987462974], ["Катя", 987462974], ["Даша", 987462974]]; +var place = ["Кафе", "Актовый зал", "Луначарского 92, кб.31", "дом пионеров"]; +var reminder = ["За день", "За неделю", "За час", "За 4 часа"]; +var n = ["Совещание", "Встреча", "Конференция", "Праздник", "Дела"]; +var type = ["Работа", "Отдых", "Дела"]; +var party = ["Участвую", "Не участвую"]; +var Work = {"name": "Совещание", + "start": new Date('2012-10-10 14:48:00'), + "end": new Date('2012-10-10 15:48:00'), + "participants": [["Саша", 891288734], ["Аня", 987462974], ["Паша", 987462974]], + "organizer": ["Паша", 8588264934], + "place": "Луначарского 92, кб.31", + "info": "Будут обсуждаться вопросы...", + "reminder": "За день до встречи", + "type": "Работа", + "party": "участвую" }; +var NewYear = {"name": "Праздник", + "start": new Date('2012-12-10 14:48:00'), + "end": new Date('2012-12-10 15:48:00'), + "participants": [["Саша", 891288734], ["Катя", 987462974], ["Даша", 987462974]], + "organizer": ["Оля", 8588264934], + "place": "Луначарского 92, кб.31", + "info": "Всем быть в костюмах...", + "reminder": "За неделю", + "type": "Отдых", + "party": "участвую" }; +var study = {"name": "Конференция", + "start": new Date('2011-11-10 14:48:00'), + "end": new Date('2011-11-10 15:48:00'), + "participants": [["Денис", 891288734], ["Аня", 987462974], ["Паша", 987462974]], + "organizer": ["Денис", 8588264934], + "place": "Луначарского 92, кб.31", + "info": "Анализ биологических последовательностей", + "reminder": "За день", + "type": "Дела", + "party": "участвую" }; +var conf = {"name": "Конференция", + "start": new Date('2011-11-08 14:48:00'), + "end": new Date('2011-11-08 15:48:00'), + "participants": [["Саша", 891288734], ["Аня", 987462974], ["Паша", 987462974]], + "organizer": ["Денис", 8588264934], + "place": "Луначарского 92, кб.31", + "info": "Матроиды и графы", + "reminder": "За день", + "type": "Дела", + "party": "не участвую" }; +var Sport = {"name": "Дополнительные тренировки", + "start": new Date('2011-09-10 14:48:00'), + "end": new Date('2011-11-10 15:48:00'), + "participants": [["Саша", 891288734], ["Аня", 987462974]], + "organizer": ["Паша", 8588264934], + "place": "Луначарского 92, кб.31", + "info": "Ура! У вас есть возможность посетить дополнительные тренировки", + "reminder": "За час", + "type": "Отдых", + "party": "участвую" }; +var collection = [Work]; +collection.push(Sport, conf, study, NewYear); +var i; +for (i = 0; i < 20; i = i + 1) { + var test = {"name": n[Math.floor(Math.random() * n.length)], + "organizer": participants[Math.floor(Math.random() * participants.length)], + "place": place[Math.floor(Math.random() * place.length)], + "reminder": reminder[Math.floor(Math.random() * reminder.length)], + "type": type[Math.floor(Math.random() * type.length)], + "party": party[Math.floor(Math.random() * party.length)]}; + collection.push(test); +} + From 594afaafdd2766900359e8d64b4350a655b6d77d Mon Sep 17 00:00:00 2001 From: Natalya Bronina Date: Sat, 27 Oct 2012 14:59:33 +0600 Subject: [PATCH 2/2] =?UTF-8?q?=D0=A4=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D0=B8?= =?UTF-8?q?=20=D1=84=D0=B8=D0=BB=D1=8C=D1=82=D1=80=D0=B0=D1=86=D0=B8=D0=B8?= =?UTF-8?q?=20=D0=B8=20=D1=81=D0=BE=D1=80=D1=82=D0=B8=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Переделано создание коллекции объектов. Написан ряд функций сортировки и фильтрации --- test.html | 5 +- test_event.js | 226 ++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 167 insertions(+), 64 deletions(-) diff --git a/test.html b/test.html index 318fffb..d1e8be4 100644 --- a/test.html +++ b/test.html @@ -2,9 +2,8 @@ Вывод информации о событиях - - + +