Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(596)

Side by Side Diff: samples/swarm/DataSource.dart

Issue 16019002: Merge the dart:uri library into dart:core and update the Uri class (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Final cleanup Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/vm.gypi ('k') | samples/swarm/swarm_ui_lib/util/Uri.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of swarmlib; 5 part of swarmlib;
6 6
7 /** The top-level collection of all sections for a user. */ 7 /** The top-level collection of all sections for a user. */
8 // TODO(jimhug): This is known as UserData in the server model. 8 // TODO(jimhug): This is known as UserData in the server model.
9 class Sections extends IterableBase<Section> { 9 class Sections extends IterableBase<Section> {
10 final List<Section> _sections; 10 final List<Section> _sections;
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 this.srcUrl, this.hasThumbnail, this.textBody, 180 this.srcUrl, this.hasThumbnail, this.textBody,
181 {htmlBody: null, bool unread: true, this.error: false}) 181 {htmlBody: null, bool unread: true, this.error: false})
182 : unread = new ObservableValue<bool>(unread), this._htmlBody = htmlBody; 182 : unread = new ObservableValue<bool>(unread), this._htmlBody = htmlBody;
183 183
184 String get htmlBody { 184 String get htmlBody {
185 _ensureLoaded(); 185 _ensureLoaded();
186 return _htmlBody; 186 return _htmlBody;
187 } 187 }
188 188
189 String get dataUri { 189 String get dataUri {
190 return Uri.encodeComponent(id).replaceAll('%2F', '/'). 190 return SwarmUri.encodeComponent(id).replaceAll('%2F', '/').
191 replaceAll('%253A', '%3A'); 191 replaceAll('%253A', '%3A');
192 } 192 }
193 193
194 String get thumbUrl { 194 String get thumbUrl {
195 if (!hasThumbnail) return null; 195 if (!hasThumbnail) return null;
196 196
197 var home; 197 var home;
198 if (Sections.runningFromFile) { 198 if (Sections.runningFromFile) {
199 home = 'http://dart.googleplex.com'; 199 home = 'http://dart.googleplex.com';
200 } else { 200 } else {
(...skipping 30 matching lines...) Expand all
231 final hasThumbnail = decoder.readBool(); 231 final hasThumbnail = decoder.readBool();
232 final author = decoder.readString(); 232 final author = decoder.readString();
233 final dateInSeconds = decoder.readInt(); 233 final dateInSeconds = decoder.readInt();
234 final snippet = decoder.readString(); 234 final snippet = decoder.readString();
235 final date = 235 final date =
236 new DateTime.fromMillisecondsSinceEpoch(dateInSeconds*1000, isUtc: true) ; 236 new DateTime.fromMillisecondsSinceEpoch(dateInSeconds*1000, isUtc: true) ;
237 return new Article(source, id, date, title, author, srcUrl, hasThumbnail, 237 return new Article(source, id, date, title, author, srcUrl, hasThumbnail,
238 snippet); 238 snippet);
239 } 239 }
240 } 240 }
OLDNEW
« no previous file with comments | « runtime/vm/vm.gypi ('k') | samples/swarm/swarm_ui_lib/util/Uri.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698