malm 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +5 -0
- data/Gemfile.lock +24 -0
- data/README.md +37 -0
- data/VERSION +1 -1
- data/bin/malm +31 -35
- data/lib/malm/message_db.rb +33 -0
- data/lib/malm/smtp_server.rb +95 -0
- data/lib/malm/web.rb +63 -0
- data/lib/malm.rb +42 -0
- data/malm.gemspec +34 -8
- data/spec/bin/malm_test_message +206 -9
- data/web/static/css/style.css +136 -0
- data/web/static/favicon.ico +0 -0
- data/web/static/index.html +35 -0
- data/web/static/js/backbone-min.js +32 -0
- data/web/static/js/backbone.js +1149 -0
- data/web/static/js/jquery-1.6.2.js +8981 -0
- data/web/static/js/jquery-1.6.2.min.js +18 -0
- data/web/views/hello_world.coffee +2 -0
- metadata +152 -135
- data/lib/malm_smtp_server.rb +0 -93
- data/lib/malm_web.rb +0 -20
- data/lib/message_db.rb +0 -31
data/spec/bin/malm_test_message
CHANGED
@@ -2,16 +2,213 @@
|
|
2
2
|
|
3
3
|
require 'net/smtp'
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
5
|
+
message1 = <<-END_OF_MESSAGE
|
6
|
+
Delivered-To: julian.doherty.ml@gmail.com
|
7
|
+
Received: by 10.205.65.11 with SMTP id xk11cs235015bkb;
|
8
|
+
Fri, 8 Jul 2011 04:13:29 -0700 (PDT)
|
9
|
+
Received: by 10.236.180.38 with SMTP id i26mr2405055yhm.205.1310123608196;
|
10
|
+
Fri, 08 Jul 2011 04:13:28 -0700 (PDT)
|
11
|
+
Return-Path: <qybsao@galeriestills.nl>
|
12
|
+
Received: from kiver.site5.com (kiver.site5.com [174.132.150.130])
|
13
|
+
by mx.google.com with ESMTPS id g63si36654835yhn.48.2011.07.08.04.13.26
|
14
|
+
(version=TLSv1/SSLv3 cipher=OTHER);
|
15
|
+
Fri, 08 Jul 2011 04:13:26 -0700 (PDT)
|
16
|
+
Received-SPF: neutral (google.com: 174.132.150.130 is neither permitted nor denied by best guess record for domain of qybsao@galeriestills.nl) client-ip=174.132.150.130;
|
17
|
+
Authentication-Results: mx.google.com; spf=neutral (google.com: 174.132.150.130 is neither permitted nor denied by best guess record for domain of qybsao@galeriestills.nl) smtp.mail=qybsao@galeriestills.nl
|
18
|
+
Received: from akf90.internetdsl.tpnet.pl ([83.17.9.90] helo=galeriestills.nl)
|
19
|
+
by kiver.site5.com with esmtp (Exim 4.69)
|
20
|
+
(envelope-from <qybsao@galeriestills.nl>)
|
21
|
+
id 1Qf8zt-0007aO-I9
|
22
|
+
for madlep@ubercharged.net; Fri, 08 Jul 2011 06:13:26 -0500
|
23
|
+
Message-ID: <2ac901cc3d5f$2983c8b0$3b29bc19@galeriestills.nl>
|
24
|
+
From: "Precision Crafted and Low Priced Watches" <qybsao@galeriestills.nl>
|
25
|
+
To: <madlep@ubercharged.net>
|
26
|
+
Subject: Casual Watches at Low Prices
|
27
|
+
Date: Fri, 8 Jul 2011 13:11:17 +0200
|
28
|
+
MIME-Version: 1.0
|
29
|
+
Content-Type: multipart/alternative;
|
30
|
+
boundary="----=_NextPart_000_0023_28_01CC3D6E.A8D734EC"
|
31
|
+
X-Priority: 3
|
32
|
+
X-MSMail-Priority: Normal
|
33
|
+
X-Mailer: Microsoft Outlook Express 6.00.2900.2180
|
34
|
+
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
|
35
|
+
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
|
36
|
+
X-AntiAbuse: Primary Hostname - kiver.site5.com
|
37
|
+
X-AntiAbuse: Original Domain - ubercharged.net
|
38
|
+
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
|
39
|
+
X-AntiAbuse: Sender Address Domain - galeriestills.nl
|
40
|
+
X-Source:
|
41
|
+
X-Source-Args:
|
42
|
+
X-Source-Dir:
|
43
|
+
|
44
|
+
This is a multi-part message in MIME format.
|
45
|
+
|
46
|
+
------=_NextPart_000_0023_28_01CC3D6E.A8D734EC
|
47
|
+
Content-Type: text/plain;
|
48
|
+
charset="iso-8859-1"
|
49
|
+
Content-Transfer-Encoding: quoted-printable
|
50
|
+
|
51
|
+
Reward Yourself with a New Toy Order Now
|
52
|
+
|
53
|
+
------=_NextPart_000_0023_28_01CC3D6E.A8D734EC
|
54
|
+
Content-Type: text/html;
|
55
|
+
charset="iso-8859-1"
|
56
|
+
Content-Transfer-Encoding: quoted-printable
|
57
|
+
|
58
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
59
|
+
<HTML><HEAD>
|
60
|
+
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Diso-8859=
|
61
|
+
-1">
|
62
|
+
<META content=3D"MSHTML 6.00.6000.16788" name=3DGENERATOR>
|
63
|
+
<STYLE></STYLE>
|
64
|
+
</HEAD>
|
65
|
+
<BODY bgColor=3D#ffffff>
|
66
|
+
<div style=3D"font-family: Tahoma;color: rgb(255, 3, 3);font-size: large=
|
67
|
+
r;"><strong>Reward Yourself with a New Toy</strong></div>
|
68
|
+
<div> </div>
|
69
|
+
<div style=3D"font-family: Tahoma;font-size: larger;"><strong><a href=3D=
|
70
|
+
"http://poundtax.ru/">Order Now</a></strong><span style=3D"font-family: =
|
71
|
+
Tahoma;"> </span></div>
|
72
|
+
</BODY></HTML>
|
73
|
+
|
74
|
+
------=_NextPart_000_0023_28_01CC3D6E.A8D734EC--
|
13
75
|
END_OF_MESSAGE
|
14
76
|
|
77
|
+
message2 = <<-END_OF_MESSAGE
|
78
|
+
Received: from mail01.is.devint.lpo (10.61.45.25) by lpozpwexc02.lpint.net
|
79
|
+
(10.61.38.9) with Microsoft SMTP Server id 8.2.176.0; Fri, 15 Jul 2011
|
80
|
+
09:18:52 +1000
|
81
|
+
Received: from app01.groups.devint.lpo (app01.groups.devint.lpo [10.61.42.91])
|
82
|
+
by mail01.is.devint.lpo (Postfix) with ESMTP id 1795E249EC for
|
83
|
+
<madlep0715@devint.lpo>; Thu, 14 Jul 2011 23:18:53 +0000 (UTC)
|
84
|
+
Received: from localhost (localhost.localdomain [127.0.0.1]) by
|
85
|
+
app01.groups.devint.lpo (Postfix) with ESMTP id 9F77C2E73F for
|
86
|
+
<madlep0715@devint.lpo>; Thu, 14 Jul 2011 23:18:52 +0000 (UTC)
|
87
|
+
From: Registration <registration@lonelyplanet.com.au>
|
88
|
+
To: "madlep0715@devint.lpo" <madlep0715@devint.lpo>
|
89
|
+
Content-Class: urn:content-classes:message
|
90
|
+
Date: Fri, 15 Jul 2011 09:18:49 +1000
|
91
|
+
Subject: Welcome to Lonely Planet
|
92
|
+
Thread-Topic: Welcome to Lonely Planet
|
93
|
+
Thread-Index: AcxCfGU39s1C5HHOQ/2O1Ro4yrIL6g==
|
94
|
+
Message-ID: <4e1f79598aac0_508010ee224@app01.groups.devint.lpo.tmail>
|
95
|
+
X-MS-Exchange-Organization-AuthAs: Anonymous
|
96
|
+
X-MS-Exchange-Organization-AuthSource: lpozpwexc02.lpint.net
|
97
|
+
X-MS-Has-Attach:
|
98
|
+
X-MS-TNEF-Correlator:
|
99
|
+
Content-Type: multipart/alternative;
|
100
|
+
boundary="_000_4e1f79598aac0508010ee224app01groupsdevintlpotmail_"
|
101
|
+
MIME-Version: 1.0
|
102
|
+
|
103
|
+
--_000_4e1f79598aac0508010ee224app01groupsdevintlpotmail_
|
104
|
+
Content-Type: text/plain; charset="utf-8"
|
105
|
+
Content-Transfer-Encoding: base64
|
106
|
+
|
107
|
+
W2h0dHA6Ly9zdGF0aWMuZGV2aW50Lmxwby9zdGF0aWMtdWkvaW1hZ2VzL2xwLWxvZ28tZW1haWwu
|
108
|
+
Z2lmXTxodHRwOi8vd3d3LmRldmludC5scG8+DQoNCkRlYXIgbWFkbGVwMDcxNSwNCg0KV2VsY29t
|
109
|
+
ZSEgWW91J3JlIG5lYXJseSB0aGVyZS4NCg0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tYWlsLCBpbmNsdWRpbmcgYXR0YWNobWVudHMsIGlzIGludGVuZGVk
|
135
|
+
IG9ubHkgZm9yIHRoZSBhZGRyZXNzZWUgYW5kIG1heSBiZSBjb25maWRlbnRpYWwsIHByaXZpbGVn
|
136
|
+
ZWQgYW5kIHN1YmplY3QgdG8gY29weXJpZ2h0LiBJZiB5b3UgaGF2ZSByZWNlaXZlZCB0aGlzIGVt
|
137
|
+
YWlsIGluIGVycm9yLCBwbGVhc2UgYWR2aXNlIHRoZSBzZW5kZXIgYW5kIGRlbGV0ZSBpdC4gSWYg
|
138
|
+
eW91IGFyZSBub3QgdGhlIGludGVuZGVkIHJlY2lwaWVudCBvZiB0aGlzIGVtYWlsLCB5b3UgbXVz
|
139
|
+
dCBub3QgY29tbXVuaWNhdGUgdG8gb3RoZXJzIGNvbnRlbnQgdGhhdCBpcyBjb25maWRlbnRpYWwg
|
140
|
+
b3Igc3ViamVjdCB0byBjb3B5cmlnaHQsIHVubGVzcyB5b3UgaGF2ZSB0aGUgY29uc2VudCBvZiB0
|
141
|
+
aGUgY29udGVudCBvd25lci4NCg0K
|
142
|
+
|
143
|
+
--_000_4e1f79598aac0508010ee224app01groupsdevintlpotmail_
|
144
|
+
Content-Type: text/html; charset="utf-8"
|
145
|
+
Content-Transfer-Encoding: base64
|
146
|
+
|
147
|
+
PGh0bWw+DQogICAgPGhlYWQ+DQogICAgPHRpdGxlPkxvbmVseSBQbGFuZXQ6IEFjdGl2YXRlIHlv
|
148
|
+
dXIgYWNjb3VudDwvdGl0bGU+DQogICAgPC9oZWFkPg0KDQogICAgPGJvZHk+DQogICAgICAgIDx0
|
149
|
+
YWJsZSBib3JkZXI9IjAiIGNlbGxwYWRkaW5nPSIwIiBjZWxsc3BhY2luZz0iMCIgd2lkdGg9IjYw
|
150
|
+
MyI+DQogICAgICAgICAgICA8dHI+DQogICAgICAgICAgICAgICAgPHRkIGJnY29sb3I9IiMwYTRm
|
151
|
+
OWMiIHN0eWxlPSJiYWNr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wgdW5sZXNzIHlvdSBoYXZlIHRoZSBjb25z
|
202
|
+
ZW50IG9mIHRoZSBjb250ZW50IG93bmVyLjwvcD4NCiAgICAgICAgICAgICAgICA8L3RkPg0KICAg
|
203
|
+
ICAgICAgICAgPC90cj4NCiAgICAgICAgPC90YWJsZT4NCiAgICA8L2JvZHk+DQo8L2h0bWw+DQo=
|
204
|
+
|
205
|
+
--_000_4e1f79598aac0508010ee224app01groupsdevintlpotmail_--
|
206
|
+
END_OF_MESSAGE
|
207
|
+
|
208
|
+
Net::SMTP.start('localhost', 2525) do |smtp|
|
209
|
+
smtp.send_message(message1,"francis@example.com","bill@example.com")
|
210
|
+
end
|
211
|
+
|
15
212
|
Net::SMTP.start('localhost', 2525) do |smtp|
|
16
|
-
smtp.send_message(
|
213
|
+
smtp.send_message(message2,"registration@lonelyplanet.com.au","madlep0715@devint.lpo")
|
17
214
|
end
|
@@ -0,0 +1,136 @@
|
|
1
|
+
/* HTML5 ✰ Boilerplate */
|
2
|
+
|
3
|
+
html, body, div, span, object, iframe,
|
4
|
+
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
5
|
+
abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp,
|
6
|
+
small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li,
|
7
|
+
fieldset, form, label, legend,
|
8
|
+
table, caption, tbody, tfoot, thead, tr, th, td,
|
9
|
+
article, aside, canvas, details, figcaption, figure,
|
10
|
+
footer, header, hgroup, menu, nav, section, summary,
|
11
|
+
time, mark, audio, video {
|
12
|
+
margin: 0;
|
13
|
+
padding: 0;
|
14
|
+
border: 0;
|
15
|
+
font-size: 100%;
|
16
|
+
font: inherit;
|
17
|
+
vertical-align: baseline;
|
18
|
+
}
|
19
|
+
|
20
|
+
article, aside, details, figcaption, figure,
|
21
|
+
footer, header, hgroup, menu, nav, section {
|
22
|
+
display: block;
|
23
|
+
}
|
24
|
+
|
25
|
+
blockquote, q { quotes: none; }
|
26
|
+
blockquote:before, blockquote:after,
|
27
|
+
q:before, q:after { content: ""; content: none; }
|
28
|
+
ins { background-color: #ff9; color: #000; text-decoration: none; }
|
29
|
+
mark { background-color: #ff9; color: #000; font-style: italic; font-weight: bold; }
|
30
|
+
del { text-decoration: line-through; }
|
31
|
+
abbr[title], dfn[title] { border-bottom: 1px dotted; cursor: help; }
|
32
|
+
table { border-collapse: collapse; border-spacing: 0; }
|
33
|
+
hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; }
|
34
|
+
input, select { vertical-align: middle; }
|
35
|
+
|
36
|
+
body { font:13px/1.231 sans-serif; *font-size:small; }
|
37
|
+
select, input, textarea, button { font:99% sans-serif; }
|
38
|
+
pre, code, kbd, samp { font-family: monospace, sans-serif; }
|
39
|
+
|
40
|
+
html { overflow-y: scroll; }
|
41
|
+
a:hover, a:active { outline: none; }
|
42
|
+
ul, ol { margin-left: 2em; }
|
43
|
+
ol { list-style-type: decimal; }
|
44
|
+
nav ul, nav li { margin: 0; list-style:none; list-style-image: none; }
|
45
|
+
small { font-size: 85%; }
|
46
|
+
strong, th { font-weight: bold; }
|
47
|
+
td { vertical-align: top; }
|
48
|
+
sub, sup { font-size: 75%; line-height: 0; position: relative; }
|
49
|
+
sup { top: -0.5em; }
|
50
|
+
sub { bottom: -0.25em; }
|
51
|
+
|
52
|
+
pre { white-space: pre; white-space: pre-wrap; word-wrap: break-word; padding: 15px; }
|
53
|
+
textarea { overflow: auto; }
|
54
|
+
.ie6 legend, .ie7 legend { margin-left: -7px; }
|
55
|
+
input[type="radio"] { vertical-align: text-bottom; }
|
56
|
+
input[type="checkbox"] { vertical-align: bottom; }
|
57
|
+
.ie7 input[type="checkbox"] { vertical-align: baseline; }
|
58
|
+
.ie6 input { vertical-align: text-bottom; }
|
59
|
+
label, input[type="button"], input[type="submit"], input[type="image"], button { cursor: pointer; }
|
60
|
+
button, input, select, textarea { margin: 0; }
|
61
|
+
input:valid, textarea:valid { }
|
62
|
+
input:invalid, textarea:invalid { border-radius: 1px; -moz-box-shadow: 0px 0px 5px red; -webkit-box-shadow: 0px 0px 5px red; box-shadow: 0px 0px 5px red; }
|
63
|
+
.no-boxshadow input:invalid, .no-boxshadow textarea:invalid { background-color: #f0dddd; }
|
64
|
+
|
65
|
+
|
66
|
+
::-moz-selection{ background: #FF5E99; color:#fff; text-shadow: none; }
|
67
|
+
::selection { background:#FF5E99; color:#fff; text-shadow: none; }
|
68
|
+
a:link { -webkit-tap-highlight-color: #FF5E99; }
|
69
|
+
button { width: auto; overflow: visible; }
|
70
|
+
.ie7 img { -ms-interpolation-mode: bicubic; }
|
71
|
+
|
72
|
+
body, select, input, textarea { color: #444; }
|
73
|
+
h1, h2, h3, h4, h5, h6 { font-weight: bold; }
|
74
|
+
a, a:active, a:visited { color: #607890; }
|
75
|
+
a:hover { color: #036; }
|
76
|
+
|
77
|
+
|
78
|
+
/**
|
79
|
+
* Primary styles
|
80
|
+
*
|
81
|
+
* Author:
|
82
|
+
*/
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
.ir { display: block; text-indent: -999em; overflow: hidden; background-repeat: no-repeat; text-align: left; direction: ltr; }
|
98
|
+
.hidden { display: none; visibility: hidden; }
|
99
|
+
.visuallyhidden { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; }
|
100
|
+
.visuallyhidden.focusable:active,
|
101
|
+
.visuallyhidden.focusable:focus { clip: auto; height: auto; margin: 0; overflow: visible; position: static; width: auto; }
|
102
|
+
.invisible { visibility: hidden; }
|
103
|
+
.clearfix:before, .clearfix:after { content: "\0020"; display: block; height: 0; overflow: hidden; }
|
104
|
+
.clearfix:after { clear: both; }
|
105
|
+
.clearfix { zoom: 1; }
|
106
|
+
|
107
|
+
|
108
|
+
@media all and (orientation:portrait) {
|
109
|
+
|
110
|
+
}
|
111
|
+
|
112
|
+
@media all and (orientation:landscape) {
|
113
|
+
|
114
|
+
}
|
115
|
+
|
116
|
+
@media screen and (max-device-width: 480px) {
|
117
|
+
|
118
|
+
/* html { -webkit-text-size-adjust:none; -ms-text-size-adjust:none; } */
|
119
|
+
}
|
120
|
+
|
121
|
+
|
122
|
+
@media print {
|
123
|
+
* { background: transparent !important; color: black !important; text-shadow: none !important; filter:none !important;
|
124
|
+
-ms-filter: none !important; }
|
125
|
+
a, a:visited { color: #444 !important; text-decoration: underline; }
|
126
|
+
a[href]:after { content: " (" attr(href) ")"; }
|
127
|
+
abbr[title]:after { content: " (" attr(title) ")"; }
|
128
|
+
.ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; }
|
129
|
+
pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
|
130
|
+
thead { display: table-header-group; }
|
131
|
+
tr, img { page-break-inside: avoid; }
|
132
|
+
@page { margin: 0.5cm; }
|
133
|
+
p, h2, h3 { orphans: 3; widows: 3; }
|
134
|
+
h2, h3{ page-break-after: avoid; }
|
135
|
+
}
|
136
|
+
|
Binary file
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<head>
|
3
|
+
<meta charset="utf-8">
|
4
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
5
|
+
|
6
|
+
<title>malm</title>
|
7
|
+
<meta name="description" content="malm mail server web view">
|
8
|
+
<meta name="author" content="">
|
9
|
+
|
10
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
11
|
+
<link rel="shortcut icon" href="/favicon.ico">
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css?v=2">
|
14
|
+
|
15
|
+
</head>
|
16
|
+
|
17
|
+
<body>
|
18
|
+
|
19
|
+
<div id="container">
|
20
|
+
<header>
|
21
|
+
<h1>malm</h1>
|
22
|
+
</header>
|
23
|
+
<div id="main" role="main">
|
24
|
+
<h2>messages...</h2>
|
25
|
+
</div>
|
26
|
+
<footer>
|
27
|
+
<p>I blame <a href="https://twitter.com/#!/madlep">@madlep</a> for <a href="https://github.com/madlep/malm">malm</a></p>
|
28
|
+
</footer>
|
29
|
+
</div> <!-- eo #container -->
|
30
|
+
|
31
|
+
|
32
|
+
<script src="/js/jquery-1.6.2.min.js"></script>
|
33
|
+
<script src="/js/backbone-min.js"></script>
|
34
|
+
</body>
|
35
|
+
</html>
|
@@ -0,0 +1,32 @@
|
|
1
|
+
// Backbone.js 0.5.1
|
2
|
+
// (c) 2010 Jeremy Ashkenas, DocumentCloud Inc.
|
3
|
+
// Backbone may be freely distributed under the MIT license.
|
4
|
+
// For all details and documentation:
|
5
|
+
// http://documentcloud.github.com/backbone
|
6
|
+
(function(){var h=this,p=h.Backbone,e;e=typeof exports!=="undefined"?exports:h.Backbone={};e.VERSION="0.5.1";var f=h._;if(!f&&typeof require!=="undefined")f=require("underscore")._;var g=h.jQuery||h.Zepto;e.noConflict=function(){h.Backbone=p;return this};e.emulateHTTP=!1;e.emulateJSON=!1;e.Events={bind:function(a,b){var c=this._callbacks||(this._callbacks={});(c[a]||(c[a]=[])).push(b);return this},unbind:function(a,b){var c;if(a){if(c=this._callbacks)if(b){c=c[a];if(!c)return this;for(var d=0,e=c.length;d<
|
7
|
+
e;d++)if(b===c[d]){c[d]=null;break}}else c[a]=[]}else this._callbacks={};return this},trigger:function(a){var b,c,d,e,f=2;if(!(c=this._callbacks))return this;for(;f--;)if(b=f?a:"all",b=c[b])for(var g=0,h=b.length;g<h;g++)(d=b[g])?(e=f?Array.prototype.slice.call(arguments,1):arguments,d.apply(this,e)):(b.splice(g,1),g--,h--);return this}};e.Model=function(a,b){var c;a||(a={});if(c=this.defaults)f.isFunction(c)&&(c=c()),a=f.extend({},c,a);this.attributes={};this._escapedAttributes={};this.cid=f.uniqueId("c");
|
8
|
+
this.set(a,{silent:!0});this._changed=!1;this._previousAttributes=f.clone(this.attributes);if(b&&b.collection)this.collection=b.collection;this.initialize(a,b)};f.extend(e.Model.prototype,e.Events,{_previousAttributes:null,_changed:!1,idAttribute:"id",initialize:function(){},toJSON:function(){return f.clone(this.attributes)},get:function(a){return this.attributes[a]},escape:function(a){var b;if(b=this._escapedAttributes[a])return b;b=this.attributes[a];return this._escapedAttributes[a]=(b==null?"":
|
9
|
+
""+b).replace(/&(?!\w+;|#\d+;|#x[\da-f]+;)/gi,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")},has:function(a){return this.attributes[a]!=null},set:function(a,b){b||(b={});if(!a)return this;if(a.attributes)a=a.attributes;var c=this.attributes,d=this._escapedAttributes;if(!b.silent&&this.validate&&!this._performValidation(a,b))return!1;if(this.idAttribute in a)this.id=a[this.idAttribute];var e=this._changing;this._changing=!0;
|
10
|
+
for(var g in a){var h=a[g];if(!f.isEqual(c[g],h))c[g]=h,delete d[g],this._changed=!0,b.silent||this.trigger("change:"+g,this,h,b)}!e&&!b.silent&&this._changed&&this.change(b);this._changing=!1;return this},unset:function(a,b){if(!(a in this.attributes))return this;b||(b={});var c={};c[a]=void 0;if(!b.silent&&this.validate&&!this._performValidation(c,b))return!1;delete this.attributes[a];delete this._escapedAttributes[a];a==this.idAttribute&&delete this.id;this._changed=!0;b.silent||(this.trigger("change:"+
|
11
|
+
a,this,void 0,b),this.change(b));return this},clear:function(a){a||(a={});var b,c=this.attributes,d={};for(b in c)d[b]=void 0;if(!a.silent&&this.validate&&!this._performValidation(d,a))return!1;this.attributes={};this._escapedAttributes={};this._changed=!0;if(!a.silent){for(b in c)this.trigger("change:"+b,this,void 0,a);this.change(a)}return this},fetch:function(a){a||(a={});var b=this,c=a.success;a.success=function(d,e,f){if(!b.set(b.parse(d,f),a))return!1;c&&c(b,d)};a.error=i(a.error,b,a);return(this.sync||
|
12
|
+
e.sync).call(this,"read",this,a)},save:function(a,b){b||(b={});if(a&&!this.set(a,b))return!1;var c=this,d=b.success;b.success=function(a,e,f){if(!c.set(c.parse(a,f),b))return!1;d&&d(c,a,f)};b.error=i(b.error,c,b);var f=this.isNew()?"create":"update";return(this.sync||e.sync).call(this,f,this,b)},destroy:function(a){a||(a={});if(this.isNew())return this.trigger("destroy",this,this.collection,a);var b=this,c=a.success;a.success=function(d){b.trigger("destroy",b,b.collection,a);c&&c(b,d)};a.error=i(a.error,
|
13
|
+
b,a);return(this.sync||e.sync).call(this,"delete",this,a)},url:function(){var a=k(this.collection)||this.urlRoot||l();if(this.isNew())return a;return a+(a.charAt(a.length-1)=="/"?"":"/")+encodeURIComponent(this.id)},parse:function(a){return a},clone:function(){return new this.constructor(this)},isNew:function(){return this.id==null},change:function(a){this.trigger("change",this,a);this._previousAttributes=f.clone(this.attributes);this._changed=!1},hasChanged:function(a){if(a)return this._previousAttributes[a]!=
|
14
|
+
this.attributes[a];return this._changed},changedAttributes:function(a){a||(a=this.attributes);var b=this._previousAttributes,c=!1,d;for(d in a)f.isEqual(b[d],a[d])||(c=c||{},c[d]=a[d]);return c},previous:function(a){if(!a||!this._previousAttributes)return null;return this._previousAttributes[a]},previousAttributes:function(){return f.clone(this._previousAttributes)},_performValidation:function(a,b){var c=this.validate(a);if(c)return b.error?b.error(this,c,b):this.trigger("error",this,c,b),!1;return!0}});
|
15
|
+
e.Collection=function(a,b){b||(b={});if(b.comparator)this.comparator=b.comparator;f.bindAll(this,"_onModelEvent","_removeReference");this._reset();a&&this.reset(a,{silent:!0});this.initialize.apply(this,arguments)};f.extend(e.Collection.prototype,e.Events,{model:e.Model,initialize:function(){},toJSON:function(){return this.map(function(a){return a.toJSON()})},add:function(a,b){if(f.isArray(a))for(var c=0,d=a.length;c<d;c++)this._add(a[c],b);else this._add(a,b);return this},remove:function(a,b){if(f.isArray(a))for(var c=
|
16
|
+
0,d=a.length;c<d;c++)this._remove(a[c],b);else this._remove(a,b);return this},get:function(a){if(a==null)return null;return this._byId[a.id!=null?a.id:a]},getByCid:function(a){return a&&this._byCid[a.cid||a]},at:function(a){return this.models[a]},sort:function(a){a||(a={});if(!this.comparator)throw Error("Cannot sort a set without a comparator");this.models=this.sortBy(this.comparator);a.silent||this.trigger("reset",this,a);return this},pluck:function(a){return f.map(this.models,function(b){return b.get(a)})},
|
17
|
+
reset:function(a,b){a||(a=[]);b||(b={});this.each(this._removeReference);this._reset();this.add(a,{silent:!0});b.silent||this.trigger("reset",this,b);return this},fetch:function(a){a||(a={});var b=this,c=a.success;a.success=function(d,f,e){b[a.add?"add":"reset"](b.parse(d,e),a);c&&c(b,d)};a.error=i(a.error,b,a);return(this.sync||e.sync).call(this,"read",this,a)},create:function(a,b){var c=this;b||(b={});a=this._prepareModel(a,b);if(!a)return!1;var d=b.success;b.success=function(a,e,f){c.add(a,b);
|
18
|
+
d&&d(a,e,f)};a.save(null,b);return a},parse:function(a){return a},chain:function(){return f(this.models).chain()},_reset:function(){this.length=0;this.models=[];this._byId={};this._byCid={}},_prepareModel:function(a,b){if(a instanceof e.Model){if(!a.collection)a.collection=this}else{var c=a;a=new this.model(c,{collection:this});a.validate&&!a._performValidation(c,b)&&(a=!1)}return a},_add:function(a,b){b||(b={});a=this._prepareModel(a,b);if(!a)return!1;var c=this.getByCid(a)||this.get(a);if(c)throw Error(["Can't add the same model to a set twice",
|
19
|
+
c.id]);this._byId[a.id]=a;this._byCid[a.cid]=a;this.models.splice(b.at!=null?b.at:this.comparator?this.sortedIndex(a,this.comparator):this.length,0,a);a.bind("all",this._onModelEvent);this.length++;b.silent||a.trigger("add",a,this,b);return a},_remove:function(a,b){b||(b={});a=this.getByCid(a)||this.get(a);if(!a)return null;delete this._byId[a.id];delete this._byCid[a.cid];this.models.splice(this.indexOf(a),1);this.length--;b.silent||a.trigger("remove",a,this,b);this._removeReference(a);return a},
|
20
|
+
_removeReference:function(a){this==a.collection&&delete a.collection;a.unbind("all",this._onModelEvent)},_onModelEvent:function(a,b,c,d){(a=="add"||a=="remove")&&c!=this||(a=="destroy"&&this._remove(b,d),b&&a==="change:"+b.idAttribute&&(delete this._byId[b.previous(b.idAttribute)],this._byId[b.id]=b),this.trigger.apply(this,arguments))}});f.each(["forEach","each","map","reduce","reduceRight","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max",
|
21
|
+
"min","sortBy","sortedIndex","toArray","size","first","rest","last","without","indexOf","lastIndexOf","isEmpty"],function(a){e.Collection.prototype[a]=function(){return f[a].apply(f,[this.models].concat(f.toArray(arguments)))}});e.Router=function(a){a||(a={});if(a.routes)this.routes=a.routes;this._bindRoutes();this.initialize.apply(this,arguments)};var q=/:([\w\d]+)/g,r=/\*([\w\d]+)/g,s=/[-[\]{}()+?.,\\^$|#\s]/g;f.extend(e.Router.prototype,e.Events,{initialize:function(){},route:function(a,b,c){e.history||
|
22
|
+
(e.history=new e.History);f.isRegExp(a)||(a=this._routeToRegExp(a));e.history.route(a,f.bind(function(d){d=this._extractParameters(a,d);c.apply(this,d);this.trigger.apply(this,["route:"+b].concat(d))},this))},navigate:function(a,b){e.history.navigate(a,b)},_bindRoutes:function(){if(this.routes){var a=[],b;for(b in this.routes)a.unshift([b,this.routes[b]]);b=0;for(var c=a.length;b<c;b++)this.route(a[b][0],a[b][1],this[a[b][1]])}},_routeToRegExp:function(a){a=a.replace(s,"\\$&").replace(q,"([^/]*)").replace(r,
|
23
|
+
"(.*?)");return RegExp("^"+a+"$")},_extractParameters:function(a,b){return a.exec(b).slice(1)}});e.History=function(){this.handlers=[];f.bindAll(this,"checkUrl")};var j=/^#*/,t=/msie [\w.]+/,m=!1;f.extend(e.History.prototype,{interval:50,getFragment:function(a,b){if(a==null)if(this._hasPushState||b){a=window.location.pathname;var c=window.location.search;c&&(a+=c);a.indexOf(this.options.root)==0&&(a=a.substr(this.options.root.length))}else a=window.location.hash;return a.replace(j,"")},start:function(a){if(m)throw Error("Backbone.history has already been started");
|
24
|
+
this.options=f.extend({},{root:"/"},this.options,a);this._wantsPushState=!!this.options.pushState;this._hasPushState=!(!this.options.pushState||!window.history||!window.history.pushState);a=this.getFragment();var b=document.documentMode;if(b=t.exec(navigator.userAgent.toLowerCase())&&(!b||b<=7))this.iframe=g('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow,this.navigate(a);this._hasPushState?g(window).bind("popstate",this.checkUrl):"onhashchange"in window&&!b?
|
25
|
+
g(window).bind("hashchange",this.checkUrl):setInterval(this.checkUrl,this.interval);this.fragment=a;m=!0;a=window.location;b=a.pathname==this.options.root;if(this._wantsPushState&&!this._hasPushState&&!b)this.fragment=this.getFragment(null,!0),window.location.replace(this.options.root+"#"+this.fragment);else if(this._wantsPushState&&this._hasPushState&&b&&a.hash)this.fragment=a.hash.replace(j,""),window.history.replaceState({},document.title,a.protocol+"//"+a.host+this.options.root+this.fragment);
|
26
|
+
return this.loadUrl()},route:function(a,b){this.handlers.unshift({route:a,callback:b})},checkUrl:function(){var a=this.getFragment();a==this.fragment&&this.iframe&&(a=this.getFragment(this.iframe.location.hash));if(a==this.fragment||a==decodeURIComponent(this.fragment))return!1;this.iframe&&this.navigate(a);this.loadUrl()||this.loadUrl(window.location.hash)},loadUrl:function(a){var b=this.fragment=this.getFragment(a);return f.any(this.handlers,function(a){if(a.route.test(b))return a.callback(b),!0})},
|
27
|
+
navigate:function(a,b){var c=(a||"").replace(j,"");if(!(this.fragment==c||this.fragment==decodeURIComponent(c))){if(this._hasPushState){var d=window.location;c.indexOf(this.options.root)!=0&&(c=this.options.root+c);this.fragment=c;window.history.pushState({},document.title,d.protocol+"//"+d.host+c)}else if(window.location.hash=this.fragment=c,this.iframe&&c!=this.getFragment(this.iframe.location.hash))this.iframe.document.open().close(),this.iframe.location.hash=c;b&&this.loadUrl(a)}}});e.View=function(a){this.cid=
|
28
|
+
f.uniqueId("view");this._configure(a||{});this._ensureElement();this.delegateEvents();this.initialize.apply(this,arguments)};var u=/^(\S+)\s*(.*)$/,n=["model","collection","el","id","attributes","className","tagName"];f.extend(e.View.prototype,e.Events,{tagName:"div",$:function(a){return g(a,this.el)},initialize:function(){},render:function(){return this},remove:function(){g(this.el).remove();return this},make:function(a,b,c){a=document.createElement(a);b&&g(a).attr(b);c&&g(a).html(c);return a},delegateEvents:function(a){if(a||
|
29
|
+
(a=this.events))for(var b in g(this.el).unbind(".delegateEvents"+this.cid),a){var c=this[a[b]];if(!c)throw Error('Event "'+a[b]+'" does not exist');var d=b.match(u),e=d[1];d=d[2];c=f.bind(c,this);e+=".delegateEvents"+this.cid;d===""?g(this.el).bind(e,c):g(this.el).delegate(d,e,c)}},_configure:function(a){this.options&&(a=f.extend({},this.options,a));for(var b=0,c=n.length;b<c;b++){var d=n[b];a[d]&&(this[d]=a[d])}this.options=a},_ensureElement:function(){if(this.el){if(f.isString(this.el))this.el=
|
30
|
+
g(this.el).get(0)}else{var a=this.attributes||{};if(this.id)a.id=this.id;if(this.className)a["class"]=this.className;this.el=this.make(this.tagName,a)}}});e.Model.extend=e.Collection.extend=e.Router.extend=e.View.extend=function(a,b){var c=v(this,a,b);c.extend=this.extend;return c};var w={create:"POST",update:"PUT","delete":"DELETE",read:"GET"};e.sync=function(a,b,c){var d=w[a];c=f.extend({type:d,dataType:"json",processData:!1},c);if(!c.url)c.url=k(b)||l();if(!c.data&&b&&(a=="create"||a=="update"))c.contentType=
|
31
|
+
"application/json",c.data=JSON.stringify(b.toJSON());if(e.emulateJSON)c.contentType="application/x-www-form-urlencoded",c.processData=!0,c.data=c.data?{model:c.data}:{};if(e.emulateHTTP&&(d==="PUT"||d==="DELETE")){if(e.emulateJSON)c.data._method=d;c.type="POST";c.beforeSend=function(a){a.setRequestHeader("X-HTTP-Method-Override",d)}}return g.ajax(c)};var o=function(){},v=function(a,b,c){var d;d=b&&b.hasOwnProperty("constructor")?b.constructor:function(){return a.apply(this,arguments)};f.extend(d,
|
32
|
+
a);o.prototype=a.prototype;d.prototype=new o;b&&f.extend(d.prototype,b);c&&f.extend(d,c);d.prototype.constructor=d;d.__super__=a.prototype;return d},k=function(a){if(!a||!a.url)return null;return f.isFunction(a.url)?a.url():a.url},l=function(){throw Error('A "url" property or function must be specified');},i=function(a,b,c){return function(d){a?a(b,d,c):b.trigger("error",b,d,c)}}}).call(this);
|