PageRenderTime 198ms queryTime 79ms sortTime 0ms getByIdsTime 23ms findMatchingLines 18ms

100+ results results for 'Backbone.Collection.extend repo:NickGardner/backbone' (198 ms)

Not the results you expected?
app.js git://github.com/mitreid-connect/OpenID-Connect-Java-Spring-Server.git | JavaScript | 342 lines
                    
78
                    
79    var ClientCollection = Backbone.Collection.extend({
                    
80
                    
                
feeds.js https://github.com/samuelclay/NewsBlur.git | JavaScript | 349 lines
                    
261
                    
262NEWSBLUR.Collections.Feeds = Backbone.Collection.extend({
                    
263    
                    
                
modelcollections.js git://github.com/jspears/bobamo.git | JavaScript | 125 lines
                    
41    });
                    
42    var Collection = Backbone.Collection.extend({
                    
43        model: Model,
                    
                
InstanceModel.js git://github.com/ging/horizon-js.git | JavaScript | 204 lines
                    
187
                    
188var Instances = Backbone.Collection.extend({
                    
189    
                    
                
default.htm git://github.com/ServiceStack/ServiceStack.git | HTML | 0 lines
                    
59            // server.
                    
60            window.TodoList = Backbone.Collection.extend({
                    
61
                    
                
SNB_004.js http://ownerpress.googlecode.com/svn/trunk/ | JavaScript | 1 lines
                    
1SNB.Models.Comment=Backbone.Model.extend({sync:function(a,b,c){switch(a){case"create":c.url=SNB.domain.apiBase+"/statuses/reply.json",c.type="post",c.data={id:b.get("statusId"),comment:b.get("comment"),forward:b.get("forward")},b.get("in_reply_to_comment_id")&&(c.data.cid=b.get("in_reply_to_comment_id"));break;case"delete":c.url=SNB.domain.apiBase+"/statuses/comment_destroy/"+b.get("id")+".json";break;case"update":c.url=SNB.domain.apiBase+"/comments/edit.json",c.data={text:b.get("text"),id:b.get("id")}}return $.ajax(c)},parse:function(a){var b=$.parseJSON(a),c=b.user,d=c.profile_image_url?c.profile_image_url.split(","):"",e={img:SNB.domain.photo+"/"+(d.length>3?d[3]:d.length==1?d[0]:"community/default/30x30.gif"),id:c.id,profile:c.profile,screen_name:c.screen_name,verified:c.verified,verified_description:c.verified_description},f=SNB.Util.parseTime(b.created_at);return b.user=e,b.createdAt=f,b},rtext:function(){return this.get("text")},head_img:function(){var a=this.get("user").profile_image_url?this.get("user").profile_image_url.split(","):"";return a.length>3?a[3]:a.length==1?a[0]:"community/default/30x30.gif"},screen_name:function(){return this.get("user").screen_name},profile:function(){return this.get("user").profile},verified:function(){return this.get("user").verified},verified_description:function(){return this.get("user").verified_description},created_time:function(){return SNB.Util.parseTime(this.get("created_at"))},isDelete:function(){return SNB.currentUser&&SNB.currentUser.id==this.get("user").id},isEdit:function(){return SNB.currentUser&&SNB.currentUser.id==this.get("user").id}}),SNB.Collections.Comments=Backbone.Collection.extend({model:SNB.Models.Comment,initialize:function(a,b){this.statusId=b.statusId,this.commentCount=b.commentCount,this.in_reply_to_comment_id=b.in_reply_to_comment_id,this.page=this.page?this.page:b.page?b.page:1,this.maxPage=this.maxPage?this.maxPage:b.maxPage?b.maxPage:1,this.url=SNB.domain.apiBase+"/statuses/commentlist.json?id="+b.statusId},updateCount:function(a){this.commentCount&&(this.commentCount.innerHTML=SNB.Util.updateCount(this.commentCount.innerHTML,a))},parse:function(a){var b=typeof a=="string"?$.parseJSON(a):a;return this.maxPage=b.maxPage,this.page=b.page,_.map(b.comments,function(a){var b=a.user,c=b.profile_image_url?b.profile_image_url.split(","):"",d={img:SNB.domain.photo+"/"+(c.length>3?c[3]:c.length==1?c[0]:"community/default/30x30.gif"),id:b.id,profile:b.profile,screen_name:b.screen_name,verified:b.verified,verified_description:b.verified_description},e=SNB.Util.parseTime(a.created_at);return a.user=d,a.createdAt=e,a}),b.comments}}),SNB.Templates.Comment='<div class="headpic"><a href="{{=it.user.profile}}"><img src="{{=it.user.img}}"></a></div><div class="content"><div class=\'comment\'><a href="{{=it.user.profile}}">{{=it.user.screen_name}}</a>{{ if (it.user.verified){ }}'+"<img width='15px' height='13px' title='{{=it.user.verified_description}}' src='"+SNB.domain["static"]+"/images/vipicon.png'/>"+"{{ } }}"+': <span class="cmt_con">{{=it.text}}</span>'+'<span class="time">(<span class="createAt" createdat="{{=it.created_at}}">{{=it.createdAt}}</span>)</span>'+"</div>"+'<div class="ops">'+"{{ if ((it.user.id == {{#def.uid}}) && it.canEdit) { }}"+'<a href="#" class="edit">\u4fee\u6539</a>'+"{{ } }}"+"{{ if (it.user.id == {{#def.uid}}) { }}"+'<a href="#" class="deleteComment">\u5220\u9664</a>'+"{{ } }}"+'<a href="#" class="reply">\u56de\u590d</a>'+"</div>"+"</div>"+"{{ if ((it.user.id == {{#def.uid}}) && it.canEdit) { }}"+'<div style="display:none" class="editarea">'+'<textarea class="comment_edit"></textarea>'+'<div class="ops">'+'<a href="#" class="comment_cancel">\u53d6\u6d88</a>'+'<input type="button" class="comment_save" value="\u4fdd\u5b58"/>'+"</div>"+"</div>"+"{{ } }}",SNB.Templates.commentFunc=doT.template(SNB.Templates.Comment,undefined,{uid:SNB.currentUser.id||0}),SNB.Views.Comment=Backbone.View.extend({initialize:function(a){this.editor=a.editor,_.bindAll(this,"render"),this.model.bind("change",this.render,this),this.model.bind("destroy",this.remove,this)},tagName:"li",events:{"click .edit":"edit","click .reply":"reply","click .deleteComment":"destroy","click .comment_cancel":"cancel","click .comment_save":"save"},render:function(){return $(this.el).html(SNB.Templates.commentFunc(this.model.toJSON())),this.$(".content").show(),this.$(".editarea").hide(),this},edit:function(a){a.preventDefault(),this.$(".content").hide();var b=SNB.Util.reparseContent(this.model.get("text").replace(/<br\/?>/g,"\n"));this.$(".editarea").show().find("textarea").val("").autoResize({minHeight:50,extraSpace:20}).insertString(b).trigger("keyup")},reply:function(a){a.preventDefault();if(!this.editor.attr("disabled")){var b=this,c="\u56de\u590d@"+b.model.get("user").screen_name+": ";b.editor.val(c).focus().setSelection(c.length,0),b.model.collection.in_reply_to_comment_id=b.model.id,b.model.get("statusId")&&(b.model.collection.statusId=b.model.get("statusId"),delete b.model.collection.in_reply_to_comment_id)}},destroy:function(a){var b=$("#dialog-delete-comment"),c=this;if($("#dialog-delete-comment").length===0){var d='<div id="dialog-delete-comment" class="dialog-wrapper"><div class="tipsdivcontent" style="text-align:center;"><p class="message" style="text-align:center;">\u786e\u5b9a\u5220\u9664\u5417\uff1f</p><div><input type="button" class="submit okButton" value="\u786e\u5b9a"/><input type="button" class="button cancelButton" value="\u53d6\u6d88"/></div></div></div>';$("body").append(d),b=$("#dialog-delete-comment")}b.find(".cancelButton").click(function(){b.dialog("close")}),b.find(".okButton").unbind("click").click(function(){b.dialog("close"),a.preventDefault(),c.model.collection.updateCount(-1),c.model.destroy(),c.remove()});var e=$(a.target);return b.dialog({modal:"true",minHeight:50,width:200,position:[e.offset().left-110,e.offset().top-$(document).scrollTop()-110]}).prev().hide(),!1},cancel:function(a){a.preventDefault(),this.$(".content").show(),this.$(".editarea").hide()},save:function(a){a.preventDefault();var b=this.$(".comment_edit").val().replace(/\n/g,"<br/>");this.model.save({text:b})}}),SNB.Templates.Comments='<div class="commentPostArea"><div class="commentTop"></div><div id="inputArea"><textarea class="commentEditor" ></textarea></div><p class="forbidden" style="display:none">\u7531\u4e8e\u5bf9\u65b9\u7684\u8bbe\u7f6e\uff0c\u60a8\u4e0d\u80fd\u8bc4\u8bba</p><span class="showFaceButton">&nbsp;</span><span class="addStock">&nbsp;</span><label><input type="checkbox" name="forward"/>\u540c\u65f6\u8f6c\u53d1\u5230\u6211\u7684\u9996\u9875 </label><input type="submit" class="commentSubmit button" value="\u53d1\u5e03"/><div class="fixit"></div></div><div class=\'loading\' style=\'display:none\'></div><ul class="commentList"></ul>',SNB.Views.Comments=Backbone.View.extend({initialize:function(a){this.collection.bind("reset",this.render,this),this.collection.bind("add",this.addComment,this),this.collection.commentTo=a.commentTo},events:{"click .commentSubmit":"submitComment","click .addStock":"addStock","click .showFaceButton":"showFace"},template:SNB.Templates.Comments,render:function(a){var b=this;if(!$(this.el).html()){$(this.el).append(this.template),this.$("textarea").autoResize({minHeight:50,extraSpace:30});var c=this.$("textarea"),b=this,d=this.submitComment;$.browser.msie&&c.live("keyup keydown mouseup",function(){$(this).data("start",$(this).getSelectionStart()),$(this).data("end",$(this).getSelectionEnd())}),function(){var a=!1;c.keydown(function(c){if(c.keyCode==17||c.keyCode==91)a=!0;if(a&&c.keyCode===13)return d.call(b,{}),!1}).keyup(function(b){if(b.keyCode==17||b.keyCode==91)a=!1})}()}(!a||this.collection&&$(this.collection.commentCount).text().match(/\d+/ig))&&this.$(".loading").show(),SNB.currentUser.isGuest||$.getJSON(SNB.domain.apiBase+"/statuses/comment/allow.json",{id:this.collection.statusId},function(a){a.allow||(b.$("textarea").attr("disabled","disabled"),b.$(".forbidden").show())});var e=$("<ul class='commentList'></ul>");this.collection.each(function(a){e.append((new SNB.Views.Comment({model:a,id:"comment_"+a.id,editor:b.$(".commentEditor").filter(":last")})).render().el)});var b=this;this.collection.maxPage>1&&e.append($(SNB.Pager(this.collection.page,this.collection.maxPage)).find("a").click(function(a){a.preventDefault();var c=$(this).attr("data-page");b.$(".commentList").html(""),b.$(".loading").show(),b.collection.fetch({data:{page:c}}),$("html, body").animate({scrollTop:b.$(".commentPostArea").offset().top},200)}).end());var f=this.collection.commentTo?"\u56de\u590d @"+this.collection.commentTo.user.screen_name+": ":"";this.$(".commentEditor").val(),f&&(this.collection.$textarea=this.$(".commentEditor").insertString(f)),this.$(".commentList").replaceWith(e),a!=1&&this.$(".loading").hide()},display:!0,toggle:function(a){this.display?($(this.el).hide(),this.display=!1):(this.$(".commentList").html(""),a||(this.$(".loading").show(),this.collection.fetch()),$(this.el).show(),this.display=!0)},addComment:function(a){this.$(".commentList").prepend((new SNB.Views.Comment({model:a})).render().el)},submitComment:function(a){var b=this;SNB.Util.checkLogin(function(){$.getJSON(SNB.domain.apiBase+"/statuses/comment/allow.json",{id:b.collection.statusId},function(a){if(a.allow){var c=b.$(".commentEditor").filter(":last"),d=c.val();if($.trim(d)==="")return alert("\u8bc4\u8bba\u4e0d\u80fd\u4e3a\u7a7a\uff01"),!1;c.val("").trigger("keyup");var e=b.$("input[name=forward]:checked").length>0?1:0;b.$(".commentSubmit").attr("disabled","disabled"),b.collection.create({statusId:b.collection.statusId,comment:d.replace(/\n/g,"<br/>"),in_reply_to_comment_id:b.collection.in_reply_to_comment_id,forward:e},{success:function(a){var c=b.$(".commentSubmit").attr("disabled");b.$(".commentSubmit").removeAttr("disabled"),b.collection.updateCount()},error:function(a){b.$(".commentSubmit").removeAttr("disabled"),alert("\u8bc4\u8bba\u5931\u8d25")}})}else alert("\u5bf9\u65b9\u4e0d\u5141\u8bb8\u8bc4\u8bba")})},a)},addStock:function(a){var b=$(this.el).find(".commentEditor").filter(":last"),c=[b.offset().left-$(window).scrollLeft(),b.offset().top-$(window).scrollTop()+b.height()];SNB.Util.insertStock(c,function(a){b.insertString("$"+a.name+"("+a.value+")$").focus()})},showFace:function(a){var b=$(this.el).find(".commentEditor").filter(":last");SNB.Util.emotion(a,function(a){b.insertString(a).focus()})}})
                    
                
apiTokensView.js git://github.com/reviewboard/reviewboard.git | JavaScript | 606 lines
                    
180 */
                    
181APITokenItemCollection = Backbone.Collection.extend({
                    
182    model: APITokenItem,
                    
                
wsperf_commander.html git://github.com/zaphoyd/websocketpp.git | HTML | 387 lines
                    
126  
                    
127    window.ServerList = Backbone.Collection.extend({
                    
128        model: Server,
                    
                
spiro-models.js https://hg.codeplex.com/restfulobjects | JavaScript | 256 lines
                    
219    // matches a list representation 11.0 
                    
220    roc.LinkList = Backbone.Collection.extend({
                    
221        model: roc.Link,
                    
                
address.js https://git01.codeplex.com/mobileshop | JavaScript | 290 lines
                    
13
                    
14window.CityList = Backbone.Collection.extend({
                    
15    model: City,
                    
21
                    
22window.AddressList = Backbone.Collection.extend({
                    
23    model: Address,
                    
                
model.js git://github.com/documentcloud/backbone.git | JavaScript | 1470 lines
                    
3  var ProxyModel = Backbone.Model.extend();
                    
4  var Klass = Backbone.Collection.extend({
                    
5    url: function() { return '/collection'; }
                    
401
                    
402    var Collection = Backbone.Collection.extend({
                    
403      model: Model
                    
                
collection.js git://github.com/documentcloud/backbone.git | JavaScript | 2112 lines
                    
48    assert.expect(3);
                    
49    var Collection = Backbone.Collection.extend({
                    
50      parse: function(data) {
                    
204    assert.expect(1);
                    
205    var Col = Backbone.Collection.extend({
                    
206      comparator: function(m1, m2) {
                    
287
                    
288    var Col = Backbone.Collection.extend({model: Model});
                    
289    var collection = new Col;
                    
                
todos.html git://github.com/documentcloud/backbone.git | HTML | 791 lines
                    
193            
                    
194            <div class="content"><div class='highlight'><pre>  <span class="hljs-keyword">var</span> TodoList = Backbone.Collection.extend({</pre></div></div>
                    
195            
                    
                
model.js.tpl git://github.com/jasonhinkle/phreeze.git | Smarty Template | 163 lines
                    
29 */
                    
30model.AbstractCollection = Backbone.Collection.extend({
                    
31	totalResults: 0,
                    
                
sync.js git://github.com/documentcloud/backbone.git | JavaScript | 239 lines
                    
2
                    
3  var Library = Backbone.Collection.extend({
                    
4    url: function() { return '/library'; }
                    
                
TestBackbone.js https://hg.codeplex.com/nakedobjects | JavaScript | 298 lines
                    
150
                    
151    var ActionList = Backbone.Collection.extend({
                    
152        model: Action,
                    
169
                    
170    var ServiceList = Backbone.Collection.extend({
                    
171        model: Service,
                    
                
code-comments.js git://pkgs.fedoraproject.org/trac-code-comments-plugin | JavaScript | 215 lines
                    
20
                    
21	window.CommentsList = Backbone.Collection.extend({
                    
22		model: Comment,
                    
                
todos.js git://github.com/addyosmani/todomvc.git | JavaScript | 0 lines
                    
45  // server.
                    
46  window.TodoList = Backbone.Collection.extend({
                    
47
                    
                
application.coffee git://github.com/simukis/django-bfm.git | CoffeeScript | 0 lines
                    
86
                    
87    Files = Backbone.Collection.extend
                    
88        url: 'list_files/'
                    
143
                    
144    Directories = Backbone.Collection.extend
                    
145        url: 'list_directories/'
                    
                
myMessage.js https://git01.codeplex.com/mobileshop | JavaScript | 103 lines
                    
4
                    
5window.MessageList = Backbone.Collection.extend({
                    
6    model: Message,
                    
                
chat.js https://bitbucket.org/nakamura/tai | JavaScript | 1486 lines
                    
177
                    
178var MessageCollection = Backbone.Collection.extend({
                    
179    model: Message,
                    
                
TG_Timeline.js git://github.com/khaneh/Orders.git | JavaScript | 377 lines
                    
31
                    
32	tg.TG_EventCollection = Backbone.Collection.extend({
                    
33		
                    
119	
                    
120	tg.TG_TimelineCollection = Backbone.Collection.extend({
                    
121		model: tg.TG_Timeline
                    
                
sessions.js git://github.com/NancyFx/Nancy.git | JavaScript | 60 lines
                    
5
                    
6    Session.Collection = Backbone.Collection.extend({
                    
7        model: Session.Model,
                    
                
Todo.js git://github.com/radekstepan/fundamental.js.git | JavaScript | 59 lines
                    
24// The collection of todos is backed by *localStorage* instead of a remote server.
                    
25var TodoList = Backbone.Collection.extend({
                    
26
                    
                
myOrder.js https://git01.codeplex.com/mobileshop | JavaScript | 101 lines
                    
47
                    
48window.OrderList = Backbone.Collection.extend({
                    
49    model: Order,
                    
                
client.js git://github.com/LockerProject/Locker.git | JavaScript | 553 lines
                    
45    // Contact Collection
                    
46    var AddressBook = Backbone.Collection.extend({
                    
47        model: Contact
                    
                
app.js git://github.com/andrewdavey/cassette.git | JavaScript | 172 lines
                    
21
                    
22  window.TodoList = Backbone.Collection.extend({
                    
23
                    
                
folders.js https://github.com/samuelclay/NewsBlur.git | JavaScript | 379 lines
                    
132
                    
133NEWSBLUR.Collections.Folders = Backbone.Collection.extend({
                    
134    
                    
                
proposal-edit.js https://bitbucket.org/dwaiter/proposalmatic/ | JavaScript | 206 lines
                    
59    // Library Snippets ------------------------------------------------------------
                    
60    window.LibrarySnipList = Backbone.Collection.extend({
                    
61        model: SnippetVersion,
                    
106    // Proposal Snippets -----------------------------------------------------------
                    
107    window.ProposalSnipList = Backbone.Collection.extend({
                    
108        model: SnippetVersion,
                    
                
employee.js git://github.com/jspears/bobamo.git | JavaScript | 64 lines
                    
34
                    
35    var EmployeeCollection = Backbone.Collection.extend({
                    
36
                    
                
app.js git://github.com/mdp/middlefiddle.git | JavaScript | 203 lines
                    
51
                    
52  window.Requests = Backbone.Collection.extend({
                    
53    model: Request,
                    
                
nodewatch.models.js git://github.com/hyperthunk/nodewatch.git | JavaScript | 265 lines
                    
82
                    
83SubscriptionList = Backbone.Collection.extend({
                    
84    debuggerTag: 'SubscriptionList',
                    
108
                    
109NodeSet = Backbone.Collection.extend({
                    
110    debuggerTag: 'NodeSet',
                    
120
                    
121SystemStats = Backbone.Collection.extend({
                    
122    debuggerTag: 'SystemStats',
                    
                
todos.js git://github.com/addyosmani/todomvc.git | JavaScript | 256 lines
                    
44  // server.
                    
45  var TodoList = Backbone.Collection.extend({
                    
46
                    
                
ImageModel.js git://github.com/ging/horizon-js.git | JavaScript | 41 lines
                    
25
                    
26	var Images = Backbone.Collection.extend({
                    
27    	model: Image,
                    
                
production-admin.js git://github.com/tekpub/mvc3.git | JavaScript | 298 lines
                    
16});
                    
17Episodes = Backbone.Collection.extend({
                    
18    model: Episode,
                    
51});
                    
52Productions = Backbone.Collection.extend({
                    
53    model : Production,
                    
                
models.js https://bitbucket.org/wez/mtrack/ | JavaScript | 311 lines
                    
42
                    
43var MTrackProjectCollection = Backbone.Collection.extend({
                    
44  model: MTrackProject,
                    
65
                    
66var MTrackRepoList = Backbone.Collection.extend({
                    
67  model: MTrackRepo,
                    
81
                    
82var MTrackTicketAttachmentCollection = Backbone.Collection.extend({
                    
83  model: MTrackAttachment,
                    
89
                    
90var MTrackTicketChangesCollection = Backbone.Collection.extend({
                    
91  model: MTrackTicketChange,
                    
178
                    
179MTrackTicketCollection = Backbone.Collection.extend({
                    
180  model: MTrackTicket,
                    
                
main.js https://bitbucket.org/ldavismead/backbone-twitter-search | JavaScript | 191 lines
                    
41
                    
42	var Tweets = Backbone.Collection.extend({
                    
43		model: Tweet
                    
                
traces.js git://github.com/NancyFx/Nancy.git | JavaScript | 81 lines
                    
5
                    
6    Trace.Collection = Backbone.Collection.extend({
                    
7        model: Trace.Model,
                    
                
TG_Timeline.js https://hg.codeplex.com/visualizeweb | JavaScript | 333 lines
                    
30
                    
31	tg.TG_EventCollection = Backbone.Collection.extend({
                    
32		model: tg.TG_Event
                    
110
                    
111	tg.TG_TimelineCollection = Backbone.Collection.extend({
                    
112
                    
                
todos.js git://github.com/maccman/book-assets.git | JavaScript | 164 lines
                    
13  
                    
14  window.TodoList = Backbone.Collection.extend({
                    
15    model: Todo,
                    
                
social_subscription.js https://github.com/samuelclay/NewsBlur.git | JavaScript | 114 lines
                    
53
                    
54NEWSBLUR.Collections.SocialSubscriptions = Backbone.Collection.extend({
                    
55    
                    
                
ui.js https://bitbucket.org/galaxy/galaxy-central | JavaScript | 1 lines
                    
1var IconButton=Backbone.Model.extend({defaults:{title:"",icon_class:"",on_click:null,menu_options:null,tooltip_config:{},isMenuButton:true,id:null,href:null,target:null,enabled:true,visible:true}});var IconButtonView=Backbone.View.extend({initialize:function(){this.model.attributes.tooltip_config={placement:"bottom"};this.model.bind("change",this.render,this)},render:function(){this.$el.tooltip("hide");var a=$(Handlebars.partials.iconButton(this.model.toJSON()));a.tooltip(this.model.get("tooltip_config"));this.$el.replaceWith(a);this.setElement(a);return this},events:{click:"click"},click:function(a){if(this.model.attributes.on_click){this.model.attributes.on_click(a);return false}return true}});IconButtonView.templates={iconButton:Handlebars.partials.iconButton};var IconButtonCollection=Backbone.Collection.extend({model:IconButton});var IconButtonMenuView=Backbone.View.extend({tagName:"div",initialize:function(){this.render()},render:function(){var a=this;this.collection.each(function(d){var b=$("<a/>").attr("href","javascript:void(0)").attr("title",d.attributes.title).addClass("icon-button menu-button").addClass(d.attributes.icon_class).appendTo(a.$el).click(d.attributes.on_click);if(d.attributes.tooltip_config){b.tooltip(d.attributes.tooltip_config)}var c=d.get("options");if(c){make_popupmenu(b,c)}});return this}});var create_icon_buttons_menu=function(b,a){if(!a){a={}}var c=new IconButtonCollection(_.map(b,function(d){return new IconButton(_.extend(d,a))}));return new IconButtonMenuView({collection:c})};var Grid=Backbone.Collection.extend({});var GridView=Backbone.View.extend({});var GalaxyPaths=Backbone.Model.extend({defaults:{root_path:"",image_path:""}});var PopupMenu=Backbone.View.extend({initialize:function(b,a){this.$button=b||$("<div/>");this.options=a||[];var c=this;this.$button.click(function(d){c._renderAndShow(d);return false});this.$button.data("PopupMenu",this)},render:function(){var a=this;this.$el.addClass("popmenu-wrapper").css({position:"absolute",display:"none"});this.$el.html(PopupMenu.templates.menu({options:this.options,id:this.$button.attr("id")}));if(this.options.length){this.$el.find("li").each(function(c,b){var f=$(b),e=f.children("a.popupmenu-option"),d=a.options[c].func;if(e.length&&d){e.click(function(g){d(g,a.options[c])})}a.options[c].$li=f})}return this},_getShownPosition:function(b){var c=this.$el.width(),a=b.pageX-c/2;a=Math.min(a,$(document).scrollLeft()+$(window).width()-c-5);a=Math.max(a,$(document).scrollLeft()+5);return{top:b.pageY,left:a}},_renderAndShow:function(a){this.render();this.$el.appendTo("body");this.$el.css(this._getShownPosition(a));this._setUpCloseBehavior();this.$el.show()},_setUpCloseBehavior:function(){var b=this,a=function(c){c.bind("click.close_popup",function(){b.remove();c.unbind("click.close_popup")})};a($(window.document));a($(window.top.document));_.each(window.top.frames,function(c){a($(c.document))})},addItem:function(b,a){a=(a>=0)?(a):(this.options.length);this.options.splice(a,0,b);return this},removeItem:function(a){if(a>=0){this.options.splice(a,1)}return this},findIndexByHtml:function(b){for(var a=0;a<this.options.length;a++){if((_.has(this.options[a],"html"))&&(this.options[a].html===b)){return a}}return null},findItemByHtml:function(a){return this.options[(this.findIndexByHtml(a))]},toString:function(){return"PopupMenu"}});PopupMenu.templates={menu:Handlebars.templates["template-popupmenu-menu"]};PopupMenu.make_popupmenu=function(b,c){var a=[];_.each(c,function(f,d){var e={html:d};if(f===null){e.header=true}else{if(jQuery.type(f)==="function"){e.func=f}}a.push(e)});return new PopupMenu($(b),a)};PopupMenu.convertLinksToOptions=function(c,a){c=$(c);a=a||"a";var b=[];c.find(a).each(function(g,e){var f={},d=$(g);f.html=d.text();if(j){var j=d.attr("href"),k=d.attr("target"),h=d.attr("confirm");f.func=function(){if((h)&&(!confirm(h))){return}var i;switch(k){case"_parent":window.parent.location=j;break;case"_top":window.top.location=j;break;case"demo":if(i===undefined||i.closed){i=window.open(j,k);i.creator=self}break;default:window.location=j}}}b.push(f)});return b};PopupMenu.fromExistingDom=function(d,c,a){d=$(d);c=$(c);var b=PopupMenu.convertLinksToOptions(c,a);c.remove();return new PopupMenu(d,b)};PopupMenu.make_popup_menus=function(c,b,d){c=c||document;b=b||"div[popupmenu]";d=d||function(e,f){return"#"+e.attr("popupmenu")};var a=[];$(c).find(b).each(function(){var e=$(this),f=$(c).find(d(e,c));a.push(PopupMenu.fromDom(f,e));f.addClass("popup")});return a};
                    
                
providers.js git://github.com/NancyFx/Nancy.git | JavaScript | 60 lines
                    
5
                    
6    Provider.Collection = Backbone.Collection.extend({
                    
7        model: Provider.Model,
                    
                
methods.js git://github.com/NancyFx/Nancy.git | JavaScript | 100 lines
                    
5
                    
6    Method.Collection = Backbone.Collection.extend({
                    
7        model: Method.Model,
                    
                
VolumeSnapshotModel.js git://github.com/ging/horizon-js.git | JavaScript | 59 lines
                    
42
                    
43var VolumeSnapshots = Backbone.Collection.extend({
                    
44    
                    
                
productDetail.js https://git01.codeplex.com/mobileshop | JavaScript | 324 lines
                    
20
                    
21window.CommentList = Backbone.Collection.extend({
                    
22    model: Comment,
                    
37
                    
38window.OrderCommentList = Backbone.Collection.extend({
                    
39    model: OrderComment,
                    
                
comments.js https://github.com/samuelclay/NewsBlur.git | JavaScript | 48 lines
                    
27
                    
28NEWSBLUR.Collections.Comments = Backbone.Collection.extend({
                    
29    
                    
43
                    
44NEWSBLUR.Collections.CommentReplies = Backbone.Collection.extend({
                    
45    
                    
                
starred_counts.js https://github.com/samuelclay/NewsBlur.git | JavaScript | 89 lines
                    
33
                    
34NEWSBLUR.Collections.StarredFeeds = Backbone.Collection.extend({
                    
35    
                    
                
myCart.js https://git01.codeplex.com/mobileshop | JavaScript | 206 lines
                    
7
                    
8window.MyCartList = Backbone.Collection.extend({
                    
9    model: MyCart,
                    
                
dispatchMode.js https://git01.codeplex.com/mobileshop | JavaScript | 62 lines
                    
2
                    
3window.DispatchModeList = Backbone.Collection.extend({
                    
4    model: DispatchMode,
                    
                
coupon.js https://git01.codeplex.com/mobileshop | JavaScript | 96 lines
                    
2
                    
3window.ActivityList = Backbone.Collection.extend({
                    
4    model: Activity,
                    
                
customize-widgets.js https://bitbucket.org/Thane2376/death-edge.ru.git | JavaScript | 1883 lines
                    
50	 */
                    
51	api.Widgets.WidgetCollection = Backbone.Collection.extend({
                    
52		model: api.Widgets.WidgetModel,
                    
129	 */
                    
130	api.Widgets.SidebarCollection = Backbone.Collection.extend({
                    
131		model: api.Widgets.SidebarModel
                    
                
theme.js https://bitbucket.org/Thane2376/death-edge.ru.git | JavaScript | 1692 lines
                    
129// @has 'id' 'name' 'screenshot' 'author' 'authorURI' 'version' 'active' ...
                    
130themes.Collection = Backbone.Collection.extend({
                    
131
                    
                
revisions.js https://bitbucket.org/Thane2376/death-edge.ru.git | JavaScript | 1111 lines
                    
181
                    
182	revisions.model.Revisions = Backbone.Collection.extend({
                    
183		model: revisions.model.Revision,
                    
207
                    
208	revisions.model.Fields = Backbone.Collection.extend({
                    
209		model: revisions.model.Field
                    
220
                    
221	revisions.model.Diffs = Backbone.Collection.extend({
                    
222		initialize: function( models, options ) {
                    
                
composer-automapper.js https://bitbucket.org/acipriani/madeinapulia.com | JavaScript | 599 lines
                    
131  });
                    
132  var ShortcodesCollection = Backbone.Collection.extend({
                    
133    model: ShortcodeModel,
                    
                
theme.min.js https://bitbucket.org/acipriani/madeinapulia.com | JavaScript | 1 lines
                    
1window.wp=window.wp||{},function(a){var b,c;b=wp.themes=wp.themes||{},b.data=_wpThemeSettings,c=b.data.l10n,b.isInstall=!!b.data.settings.isInstall,_.extend(b,{model:{},view:{},routes:{},router:{},template:wp.template}),b.Model=Backbone.Model.extend({initialize:function(){var a;-1!==_.indexOf(b.data.installedThemes,this.get("slug"))&&this.set({installed:!0}),this.set({id:this.get("slug")||this.get("id")}),this.has("sections")&&(a=this.get("sections").description,this.set({description:a}))}}),b.view.Appearance=wp.Backbone.View.extend({el:"#wpbody-content .wrap .theme-browser",window:a(window),page:0,initialize:function(a){_.bindAll(this,"scroller"),this.SearchView=a.SearchView?a.SearchView:b.view.Search,this.window.bind("scroll",_.throttle(this.scroller,300))},render:function(){this.view=new b.view.Themes({collection:this.collection,parent:this}),this.search(),this.view.render(),this.$el.empty().append(this.view.el).addClass("rendered"),this.$el.append('<br class="clear"/>')},searchContainer:a("#wpbody h2:first"),search:function(){var d,e=this;1!==b.data.themes.length&&(d=new this.SearchView({collection:e.collection,parent:this}),d.render(),this.searchContainer.append(a.parseHTML('<label class="screen-reader-text" for="wp-filter-search-input">'+c.search+"</label>")).append(d.el))},scroller:function(){var a,b,c=this;a=this.window.scrollTop()+c.window.height(),b=c.$el.offset().top+c.$el.outerHeight(!1)-c.window.height(),b=Math.round(.9*b),a>b&&this.trigger("theme:scroll")}}),b.Collection=Backbone.Collection.extend({model:b.Model,terms:"",doSearch:function(a){this.terms!==a&&(this.terms=a,this.terms.length>0&&this.search(this.terms),""===this.terms&&this.reset(b.data.themes),this.trigger("update"))},search:function(c){var d,e,f;this.reset(b.data.themes,{silent:!0}),c=c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),c=c.replace(/ /g,")(?=.*"),d=new RegExp("^(?=.*"+c+").+","i"),e=this.filter(function(a){return f=_.union(a.get("name"),a.get("id"),a.get("description"),a.get("author"),a.get("tags")),d.test(a.get("author"))&&c.length>2&&a.set("displayAuthor",!0),d.test(f)}),0===e.length?this.trigger("query:empty"):a("body").removeClass("no-results"),this.reset(e)},paginate:function(a){var b=this;return a=a||0,b=_(b.rest(20*a)),b=_(b.first(20))},count:!1,query:function(b){var c,d,e,f=this.queries,g=this;if(this.currentQuery.request=b,c=_.find(f,function(a){return _.isEqual(a.request,b)}),d=_.has(b,"page"),d||(this.currentQuery.page=1),c||d){if(d)return this.apiCall(b,d).done(function(a){g.add(a.themes),g.trigger("query:success"),g.loadingThemes=!1}).fail(function(){g.trigger("query:fail")});0===c.themes.length?g.trigger("query:empty"):a("body").removeClass("no-results"),_.isNumber(c.total)&&(this.count=c.total),this.reset(c.themes),c.total||(this.count=this.length),this.trigger("update"),this.trigger("query:success",this.count)}else c=this.apiCall(b).done(function(a){a.themes&&(g.reset(a.themes),e=a.info.results,f.push({themes:a.themes,request:b,total:e})),g.trigger("update"),g.trigger("query:success",e),a.themes&&0===a.themes.length&&g.trigger("query:empty")}).fail(function(){g.trigger("query:fail")})},queries:[],currentQuery:{page:1,request:{}},apiCall:function(b,c){return wp.ajax.send("query-themes",{data:{request:_.extend({per_page:100,fields:{description:!0,tested:!0,requires:!0,rating:!0,downloaded:!0,downloadLink:!0,last_updated:!0,homepage:!0,num_ratings:!0}},b)},beforeSend:function(){c||a("body").addClass("loading-content").removeClass("no-results")}})},loadingThemes:!1}),b.view.Theme=wp.Backbone.View.extend({className:"theme",state:"grid",html:b.template("theme"),events:{click:b.isInstall?"preview":"expand",keydown:b.isInstall?"preview":"expand",touchend:b.isInstall?"preview":"expand",keyup:"addFocus",touchmove:"preventExpand"},touchDrag:!1,render:function(){var a=this.model.toJSON();this.$el.html(this.html(a)).attr({tabindex:0,"aria-describedby":a.id+"-action "+a.id+"-name"}),this.activeTheme(),this.model.get("displayAuthor")&&this.$el.addClass("display-author"),this.model.get("installed")&&this.$el.addClass("is-installed")},activeTheme:function(){this.model.get("active")&&this.$el.addClass("active")},addFocus:function(){var b=a(":focus").hasClass("theme")?a(":focus"):a(":focus").parents(".theme");a(".theme.focus").removeClass("focus"),b.addClass("focus")},expand:function(c){var d=this;return c=c||window.event,"keydown"!==c.type||13===c.which||32===c.which?this.touchDrag===!0?this.touchDrag=!1:void(a(c.target).is(".theme-actions a")||(b.focusedTheme=this.$el,this.trigger("theme:expand",d.model.cid))):void 0},preventExpand:function(){this.touchDrag=!0},preview:function(c){var d,e,f=this;return this.touchDrag===!0?this.touchDrag=!1:void(a(c.target).hasClass("button-primary")||("keydown"!==c.type||13===c.which||32===c.which)&&("keydown"===c.type&&13!==c.which&&a(":focus").hasClass("button")||(c.preventDefault(),c=c||window.event,b.focusedTheme=this.$el,e=new b.view.Preview({model:this.model}),e.render(),this.setNavButtonsState(),1===this.model.collection.length?e.$el.addClass("no-navigation"):e.$el.removeClass("no-navigation"),a("div.wrap").append(e.el),this.listenTo(e,"theme:next",function(){return d=f.model,_.isUndefined(f.current)||(d=f.current),f.current=f.model.collection.at(f.model.collection.indexOf(d)+1),_.isUndefined(f.current)?(f.options.parent.parent.trigger("theme:end"),f.current=d):(e.model=f.current,e.render(),this.setNavButtonsState(),void a(".next-theme").focus())}).listenTo(e,"theme:previous",function(){d=f.model,0!==f.model.collection.indexOf(f.current)&&(_.isUndefined(f.current)||(d=f.current),f.current=f.model.collection.at(f.model.collection.indexOf(d)-1),_.isUndefined(f.current)||(e.model=f.current,e.render(),this.setNavButtonsState(),a(".previous-theme").focus()))}),this.listenTo(e,"preview:close",function(){f.current=f.model}))))},setNavButtonsState:function(){var b=a(".theme-install-overlay"),c=_.isUndefined(this.current)?this.model:this.current;0===this.model.collection.indexOf(c)&&b.find(".previous-theme").addClass("disabled"),_.isUndefined(this.model.collection.at(this.model.collection.indexOf(c)+1))&&b.find(".next-theme").addClass("disabled")}}),b.view.Details=wp.Backbone.View.extend({className:"theme-overlay",events:{click:"collapse","click .delete-theme":"deleteTheme","click .left":"previousTheme","click .right":"nextTheme"},html:b.template("theme-single"),render:function(){var a=this.model.toJSON();this.$el.html(this.html(a)),this.activeTheme(),this.navigation(),this.screenshotCheck(this.$el),this.containFocus(this.$el)},activeTheme:function(){this.$el.toggleClass("active",this.model.get("active"))},containFocus:function(b){var c;_.delay(function(){a(".theme-wrap a.button-primary:visible").focus()},500),b.on("keydown.wp-themes",function(d){9===d.which&&(c=a(d.target),c.is("button.left")&&d.shiftKey?(b.find(".theme-actions a:last-child").focus(),d.preventDefault()):c.is(".theme-actions a:last-child")&&(b.find("button.left").focus(),d.preventDefault()))})},collapse:function(c){var d,e=this;c=c||window.event,1!==b.data.themes.length&&(a(c.target).is(".theme-backdrop")||a(c.target).is(".close")||27===c.keyCode)&&(a("body").addClass("closing-overlay"),this.$el.fadeOut(130,function(){a("body").removeClass("closing-overlay"),e.closeOverlay(),d=document.body.scrollTop,b.router.navigate(b.router.baseUrl("")),document.body.scrollTop=d,b.focusedTheme&&b.focusedTheme.focus()}))},navigation:function(){this.model.cid===this.model.collection.at(0).cid&&this.$el.find(".left").addClass("disabled"),this.model.cid===this.model.collection.at(this.model.collection.length-1).cid&&this.$el.find(".right").addClass("disabled")},closeOverlay:function(){a("body").removeClass("modal-open"),this.remove(),this.unbind(),this.trigger("theme:collapse")},deleteTheme:function(){return confirm(b.data.settings.confirmDelete)},nextTheme:function(){var a=this;return a.trigger("theme:next",a.model.cid),!1},previousTheme:function(){var a=this;return a.trigger("theme:previous",a.model.cid),!1},screenshotCheck:function(a){var b,c;b=a.find(".screenshot img"),c=new Image,c.src=b.attr("src"),c.width&&c.width<=300&&a.addClass("small-screenshot")}}),b.view.Preview=b.view.Details.extend({className:"wp-full-overlay expanded",el:".theme-install-overlay",events:{"click .close-full-overlay":"close","click .collapse-sidebar":"collapse","click .previous-theme":"previousTheme","click .next-theme":"nextTheme",keyup:"keyEvent"},html:b.template("theme-preview"),render:function(){var c=this.model.toJSON();this.$el.html(this.html(c)),b.router.navigate(b.router.baseUrl(b.router.themePath+this.model.get("id")),{replace:!0}),this.$el.fadeIn(200,function(){a("body").addClass("theme-installer-active full-overlay-active"),a(".close-full-overlay").focus()})},close:function(){return this.$el.fadeOut(200,function(){a("body").removeClass("theme-installer-active full-overlay-active"),b.focusedTheme&&b.focusedTheme.focus()}),b.router.navigate(b.router.baseUrl("")),this.trigger("preview:close"),this.undelegateEvents(),this.unbind(),!1},collapse:function(){return this.$el.toggleClass("collapsed").toggleClass("expanded"),!1},keyEvent:function(a){27===a.keyCode&&(this.undelegateEvents(),this.close()),39===a.keyCode&&_.once(this.nextTheme()),37===a.keyCode&&this.previousTheme()}}),b.view.Themes=wp.Backbone.View.extend({className:"themes",$overlay:a("div.theme-overlay"),index:0,count:a(".wp-filter .theme-count"),initialize:function(b){var c=this;this.parent=b.parent,this.setView("grid"),c.currentTheme(),this.listenTo(c.collection,"update",function(){c.parent.page=0,c.currentTheme(),c.render(this)}),this.listenTo(c.collection,"query:success",function(a){c.count.text(_.isNumber(a)?a:c.collection.length)}),this.listenTo(c.collection,"query:empty",function(){a("body").addClass("no-results")}),this.listenTo(this.parent,"theme:scroll",function(){c.renderThemes(c.parent.page)}),this.listenTo(this.parent,"theme:close",function(){c.overlay&&c.overlay.closeOverlay()}),a("body").on("keyup",function(a){c.overlay&&(39===a.keyCode&&c.overlay.nextTheme(),37===a.keyCode&&c.overlay.previousTheme(),27===a.keyCode&&c.overlay.collapse(a))})},render:function(){this.$el.html(""),1===b.data.themes.length&&(this.singleTheme=new b.view.Details({model:this.collection.models[0]}),this.singleTheme.render(),this.$el.addClass("single-theme"),this.$el.append(this.singleTheme.el)),this.options.collection.size()>0&&this.renderThemes(this.parent.page),this.count.text(this.collection.count?this.collection.count:this.collection.length)},renderThemes:function(d){var e=this;return e.instance=e.collection.paginate(d),0===e.instance.size()?void this.parent.trigger("theme:end"):(d>=1&&a(".add-new-theme").remove(),e.instance.each(function(a){e.theme=new b.view.Theme({model:a,parent:e}),e.theme.render(),e.$el.append(e.theme.el),e.listenTo(e.theme,"theme:expand",e.expand,e)}),b.data.settings.canInstall&&this.$el.append('<div class="theme add-new-theme"><a href="'+b.data.settings.installURI+'"><div class="theme-screenshot"><span></span></div><h3 class="theme-name">'+c.addNew+"</h3></a></div>"),void this.parent.page++)},currentTheme:function(){var a,b=this;a=b.collection.findWhere({active:!0}),a&&(b.collection.remove(a),b.collection.add(a,{at:0}))},setView:function(a){return a},expand:function(c){var d=this;this.model=d.collection.get(c),b.router.navigate(b.router.baseUrl(b.router.themePath+this.model.id)),this.setView("detail"),a("body").addClass("modal-open"),this.overlay=new b.view.Details({model:d.model}),this.overlay.render(),this.$overlay.html(this.overlay.el),this.listenTo(this.overlay,"theme:next",function(){d.next([d.model.cid])}).listenTo(this.overlay,"theme:previous",function(){d.previous([d.model.cid])})},next:function(a){var b,c,d=this;b=d.collection.get(a[0]),c=d.collection.at(d.collection.indexOf(b)+1),void 0!==c&&(this.overlay.closeOverlay(),d.theme.trigger("theme:expand",c.cid))},previous:function(a){var b,c,d=this;b=d.collection.get(a[0]),c=d.collection.at(d.collection.indexOf(b)-1),void 0!==c&&(this.overlay.closeOverlay(),d.theme.trigger("theme:expand",c.cid))}}),b.view.Search=wp.Backbone.View.extend({tagName:"input",className:"wp-filter-search",id:"wp-filter-search-input",searching:!1,attributes:{placeholder:c.searchPlaceholder,type:"search"},events:{input:"search",keyup:"search",change:"search",search:"search",blur:"pushState"},initialize:function(a){this.parent=a.parent,this.listenTo(this.parent,"theme:close",function(){this.searching=!1})},search:function(a){var c={};"keyup"===a.type&&27===a.which&&(a.target.value=""),13===a.which&&this.$el.trigger("blur"),this.collection.doSearch(a.target.value),this.searching&&13!==a.which?c.replace=!0:this.searching=!0,a.target.value?b.router.navigate(b.router.baseUrl(b.router.searchPath+a.target.value),c):b.router.navigate(b.router.baseUrl(""))},pushState:function(a){var c=b.router.baseUrl("");a.target.value&&(c=b.router.baseUrl(b.router.searchPath+a.target.value)),this.searching=!1,b.router.navigate(c)}}),b.Router=Backbone.Router.extend({routes:{"themes.php?theme=:slug":"theme","themes.php?search=:query":"search","themes.php?s=:query":"search","themes.php":"themes","":"themes"},baseUrl:function(a){return"themes.php"+a},themePath:"?theme=",searchPath:"?search=",search:function(b){a(".wp-filter-search").val(b)},themes:function(){a(".wp-filter-search").val("")},navigate:function(){Backbone.history._hasPushState&&Backbone.Router.prototype.navigate.apply(this,arguments)}}),b.Run={init:function(){this.themes=new b.Collection(b.data.themes),this.view=new b.view.Appearance({collection:this.themes}),this.render()},render:function(){this.view.render(),this.routes(),Backbone.history.start({root:b.data.settings.adminUrl,pushState:!0,hashChange:!1})},routes:function(){var c=this;b.router=new b.Router,b.router.on("route:theme",function(a){c.view.view.expand(a)}),b.router.on("route:themes",function(){c.themes.doSearch(""),c.view.trigger("theme:close")}),b.router.on("route:search",function(){a(".wp-filter-search").trigger("keyup")}),this.extraRoutes()},extraRoutes:function(){return!1}},b.view.InstallerSearch=b.view.Search.extend({events:{keyup:"search"},search:function(a){("keyup"!==a.type||9!==a.which&&16!==a.which)&&(this.collection=this.options.parent.view.collection,"keyup"===a.type&&27===a.which&&(a.target.value=""),_.debounce(_.bind(this.doSearch,this),300)(a.target.value))},doSearch:_.debounce(function(c){var d={};d.search=c,"author:"===c.substring(0,7)&&(d.search="",d.author=c.slice(7)),"tag:"===c.substring(0,4)&&(d.search="",d.tag=[c.slice(4)]),a(".filter-links li > a.current").removeClass("current"),a("body").removeClass("show-filters filters-applied"),this.collection.query(d),b.router.navigate(b.router.baseUrl(b.router.searchPath+c),{replace:!0})},300)}),b.view.Installer=b.view.Appearance.extend({el:"#wpbody-content .wrap",events:{"click .filter-links li > a":"onSort","click .theme-filter":"onFilter","click .drawer-toggle":"moreFilters","click .filter-dra
                    
                
customize-widgets.min.js https://bitbucket.org/acipriani/madeinapulia.com | JavaScript | 1 lines
                    
1!function(a,b){function c(a){var b,c={number:null,id_base:null};return b=a.match(/^(.+)-(\d+)$/),b?(c.id_base=b[1],c.number=parseInt(b[2],10)):c.id_base=a,c}function d(a){var b,d=c(a);return b="widget_"+d.id_base,d.number&&(b+="["+d.number+"]"),b}if(a&&a.customize){var e,f=a.customize;f.Widgets=f.Widgets||{},f.Widgets.data=_wpCustomizeWidgetsSettings||{},e=f.Widgets.data.l10n,delete f.Widgets.data.l10n,f.Widgets.WidgetModel=Backbone.Model.extend({id:null,temp_id:null,classname:null,control_tpl:null,description:null,is_disabled:null,is_multi:null,multi_number:null,name:null,id_base:null,transport:"refresh",params:[],width:null,height:null,search_matched:!0}),f.Widgets.WidgetCollection=Backbone.Collection.extend({model:f.Widgets.WidgetModel,doSearch:function(a){this.terms!==a&&(this.terms=a,this.terms.length>0&&this.search(this.terms),""===this.terms&&this.each(function(a){a.set("search_matched",!0)}))},search:function(a){var b,c;a=a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),a=a.replace(/ /g,")(?=.*"),b=new RegExp("^(?=.*"+a+").+","i"),this.each(function(a){c=[a.get("name"),a.get("id"),a.get("description")].join(" "),a.set("search_matched",b.test(c))})}}),f.Widgets.availableWidgets=new f.Widgets.WidgetCollection(f.Widgets.data.availableWidgets),f.Widgets.SidebarModel=Backbone.Model.extend({after_title:null,after_widget:null,before_title:null,before_widget:null,"class":null,description:null,id:null,name:null,is_rendered:!1}),f.Widgets.SidebarCollection=Backbone.Collection.extend({model:f.Widgets.SidebarModel}),f.Widgets.registeredSidebars=new f.Widgets.SidebarCollection(f.Widgets.data.registeredSidebars),f.Widgets.AvailableWidgetsPanelView=a.Backbone.View.extend({el:"#available-widgets",events:{"input #widgets-search":"search","keyup #widgets-search":"search","change #widgets-search":"search","search #widgets-search":"search","focus .widget-tpl":"focus","click .widget-tpl":"_submit","keypress .widget-tpl":"_submit",keydown:"keyboardAccessible"},selected:null,currentSidebarControl:null,$search:null,initialize:function(){var a=this;this.$search=b("#widgets-search"),_.bindAll(this,"close"),this.listenTo(this.collection,"change",this.updateList),this.updateList(),b("#customize-controls").on("click keydown",function(c){var d=b(c.target).is(".add-new-widget, .add-new-widget *");b("body").hasClass("adding-widget")&&!d&&a.close()}),f.previewer.bind("url",this.close)},search:function(a){var b;this.collection.doSearch(a.target.value),this.selected&&!this.selected.is(":visible")&&(this.selected.removeClass("selected"),this.selected=null),this.selected&&!a.target.value&&(this.selected.removeClass("selected"),this.selected=null),!this.selected&&a.target.value&&(b=this.$el.find("> .widget-tpl:visible:first"),b.length&&this.select(b))},updateList:function(){this.collection.each(function(a){var c=b("#widget-tpl-"+a.id);c.toggle(a.get("search_matched")&&!a.get("is_disabled")),a.get("is_disabled")&&c.is(this.selected)&&(this.selected=null)})},select:function(a){this.selected=b(a),this.selected.siblings(".widget-tpl").removeClass("selected"),this.selected.addClass("selected")},focus:function(a){this.select(b(a.currentTarget))},_submit:function(a){("keypress"!==a.type||13===a.which||32===a.which)&&this.submit(b(a.currentTarget))},submit:function(a){var c,d;a||(a=this.selected),a&&this.currentSidebarControl&&(this.select(a),c=b(this.selected).data("widget-id"),d=this.collection.findWhere({id:c}),d&&(this.currentSidebarControl.addWidget(d.get("id_base")),this.close()))},open:function(a){this.currentSidebarControl=a,_(this.currentSidebarControl.getWidgetFormControls()).each(function(a){a.params.is_wide&&a.collapseForm()}),b("body").addClass("adding-widget"),this.$el.find(".selected").removeClass("selected"),this.collection.doSearch(""),this.$search.focus()},close:function(a){a=a||{},a.returnFocus&&this.currentSidebarControl&&this.currentSidebarControl.container.find(".add-new-widget").focus(),this.currentSidebarControl=null,this.selected=null,b("body").removeClass("adding-widget"),this.$search.val("")},keyboardAccessible:function(a){var c=13===a.which,d=27===a.which,e=40===a.which,f=38===a.which,g=9===a.which,h=a.shiftKey,i=null,j=this.$el.find("> .widget-tpl:visible:first"),k=this.$el.find("> .widget-tpl:visible:last"),l=b(a.target).is(this.$search),m=b(a.target).is(".widget-tpl:visible:last");return e||f?(e?l?i=j:this.selected&&0!==this.selected.nextAll(".widget-tpl:visible").length&&(i=this.selected.nextAll(".widget-tpl:visible:first")):f&&(l?i=k:this.selected&&0!==this.selected.prevAll(".widget-tpl:visible").length&&(i=this.selected.prevAll(".widget-tpl:visible:first"))),this.select(i),void(i?i.focus():this.$search.focus())):void((!c||this.$search.val())&&(c?this.submit():d&&this.close({returnFocus:!0}),g&&(h&&l||!h&&m)&&(this.currentSidebarControl.container.find(".add-new-widget").focus(),a.preventDefault())))}}),f.Widgets.formSyncHandlers={rss:function(a,c,d){var e=c.find(".widget-error:first"),f=b("<div>"+d+"</div>").find(".widget-error:first");e.length&&f.length?e.replaceWith(f):e.length?e.remove():f.length&&c.find(".widget-content:first").prepend(f)}},f.Widgets.WidgetControl=f.Control.extend({defaultExpandedArguments:{duration:"fast",completeCallback:b.noop},initialize:function(a,c){var d=this;f.Control.prototype.initialize.call(d,a,c),d.expanded=new f.Value,d.expandedArgumentsQueue=[],d.expanded.bind(function(a){var c=d.expandedArgumentsQueue.shift();c=b.extend({},d.defaultExpandedArguments,c),d.onChangeExpanded(a,c)}),d.expanded.set(!1)},ready:function(){this._setupModel(),this._setupWideWidget(),this._setupControlToggle(),this._setupWidgetTitle(),this._setupReorderUI(),this._setupHighlightEffects(),this._setupUpdateUI(),this._setupRemoveUI(),b(document).trigger("widget-added",[this.container.find(".widget:first")])},_setupModel:function(){var a,b=this;f.Widgets.savedWidgetIds=f.Widgets.savedWidgetIds||[],a=function(){f.Widgets.savedWidgetIds[b.params.widget_id]=!0},f.bind("ready",a),f.bind("saved",a),this._updateCount=0,this.isWidgetUpdating=!1,this.liveUpdateMode=!0,this.setting.bind(function(a,c){_(c).isEqual(a)||b.isWidgetUpdating||b.updateWidget({instance:a})})},_setupWideWidget:function(){var a,c,d,e,g,h=this;this.params.is_wide&&(a=this.container.find(".widget-inside"),c=a.find("> .form"),d=b(".wp-full-overlay-sidebar-content:first"),this.container.addClass("wide-widget-control"),this.container.find(".widget-content:first").css({"max-width":this.params.width,"min-height":this.params.height}),g=function(){var d,e=h.container.offset().top,f=b(window).height(),g=c.outerHeight();a.css("max-height",f),d=Math.max(0,Math.min(Math.max(e,0),f-g)),a.css("top",d)},e=b("#customize-theme-controls"),this.container.on("expand",function(){g(),d.on("scroll",g),b(window).on("resize",g),e.on("expanded collapsed",g)}),this.container.on("collapsed",function(){d.off("scroll",g),b(window).off("resize",g),e.off("expanded collapsed",g)}),f.each(function(a){0===a.id.indexOf("sidebars_widgets[")&&a.bind(function(){h.container.hasClass("expanded")&&g()})}))},_setupControlToggle:function(){var a,b=this;this.container.find(".widget-top").on("click",function(a){a.preventDefault();var c=b.getSidebarWidgetsControl();c.isReordering||b.expanded(!b.expanded())}),a=this.container.find(".widget-control-close"),a.on("click",function(a){a.preventDefault(),b.collapse(),b.container.find(".widget-top .widget-action:first").focus()})},_setupWidgetTitle:function(){var a,b=this;a=function(){var a=b.setting().title,c=b.container.find(".in-widget-title");c.text(a?": "+a:"")},this.setting.bind(a),a()},_setupReorderUI:function(){var a,c,d,g,h=this;a=function(a){a.siblings(".selected").removeClass("selected"),a.addClass("selected");var b=a.data("id")===h.params.sidebar_id;h.container.find(".move-widget-btn").prop("disabled",b)},this.container.find(".widget-title-action").after(b(f.Widgets.data.tpl.widgetReorderNav)),c=b(_.template(f.Widgets.data.tpl.moveWidgetArea,{sidebars:_(f.Widgets.registeredSidebars.toArray()).pluck("attributes")})),this.container.find(".widget-top").after(c),g=function(){var d,e=c.find("li");d=e.filter(function(){return b(this).data("id")===h.params.sidebar_id}),e.each(function(){var c,e,g=b(this);c=g.data("id"),e=f.Widgets.registeredSidebars.get(c),g.toggle(e.get("is_rendered")),g.hasClass("selected")&&!e.get("is_rendered")&&a(d)})},g(),f.Widgets.registeredSidebars.on("change:is_rendered",g),d=this.container.find(".widget-reorder-nav"),d.find(".move-widget, .move-widget-down, .move-widget-up").each(function(){b(this).prepend(h.container.find(".widget-title").text()+": ")}).on("click keypress",function(a){if("keypress"!==a.type||13===a.which||32===a.which)if(b(this).focus(),b(this).is(".move-widget"))h.toggleWidgetMoveArea();else{var c=b(this).is(".move-widget-down"),d=b(this).is(".move-widget-up"),f=h.getWidgetSidebarPosition();if(d&&0===f||c&&f===h.getSidebarWidgetsControl().setting().length-1)return;d?(h.moveUp(),b("#screen-reader-messages").text(e.widgetMovedUp)):(h.moveDown(),b("#screen-reader-messages").text(e.widgetMovedDown)),b(this).focus()}}),this.container.find(".widget-area-select").on("click keypress","li",function(c){("keypress"!==event.type||13===event.which||32===event.which)&&(c.preventDefault(),a(b(this)))}),this.container.find(".move-widget-btn").click(function(){h.getSidebarWidgetsControl().toggleReordering(!1);var a,b,c,d,e,g=h.params.sidebar_id,i=h.container.find(".widget-area-select li.selected").data("id");a=f("sidebars_widgets["+g+"]"),b=f("sidebars_widgets["+i+"]"),c=Array.prototype.slice.call(a()),d=Array.prototype.slice.call(b()),e=h.getWidgetSidebarPosition(),c.splice(e,1),d.push(h.params.widget_id),a(c),b(d),h.focus()})},_setupHighlightEffects:function(){var a=this;this.container.on("mouseenter click",function(){a.setting.previewer.send("highlight-widget",a.params.widget_id)}),this.setting.bind(function(){a.setting.previewer.send("highlight-widget",a.params.widget_id)})},_setupUpdateUI:function(){var a,c,d,g,h,i=this;a=this.container.find(".widget:first"),c=a.find(".widget-content:first"),d=this.container.find(".widget-control-save"),d.val(e.saveBtnLabel),d.attr("title",e.saveBtnTooltip),d.removeClass("button-primary").addClass("button-secondary"),d.on("click",function(a){a.preventDefault(),i.updateWidget({disable_form:!0})}),g=_.debounce(function(){i.updateWidget()},250),c.on("keydown","input",function(a){13===a.which&&(a.preventDefault(),i.updateWidget({ignoreActiveElement:!0}))}),c.on("change input propertychange",":input",function(a){i.liveUpdateMode&&("change"===a.type?i.updateWidget():this.checkValidity&&this.checkValidity()&&g())}),this.setting.previewer.channel.bind("synced",function(){i.container.removeClass("previewer-loading")}),f.previewer.bind("widget-updated",function(a){a===i.params.widget_id&&i.container.removeClass("previewer-loading")}),h=f.Widgets.formSyncHandlers[this.params.widget_id_base],h&&b(document).on("widget-synced",function(b,c){a.is(c)&&h.apply(document,arguments)})},onChangeActive:function(a,b){this.container.toggleClass("widget-rendered",a),b.completeCallback&&b.completeCallback()},_setupRemoveUI:function(){var a,b,c=this;a=this.container.find("a.widget-control-remove"),a.on("click",function(a){a.preventDefault();var b;b=c.container.next().is(".customize-control-widget_form")?c.container.next().find(".widget-action:first"):c.container.prev().is(".customize-control-widget_form")?c.container.prev().find(".widget-action:first"):c.container.next(".customize-control-sidebar_widgets").find(".add-new-widget:first"),c.container.slideUp(function(){var a,d,e=f.Widgets.getSidebarWidgetControlContainingWidget(c.params.widget_id);e&&(a=e.setting().slice(),d=_.indexOf(a,c.params.widget_id),-1!==d&&(a.splice(d,1),e.setting(a),b.focus()))})}),b=function(){a.text(e.removeBtnLabel),a.attr("title",e.removeBtnTooltip)},this.params.is_new?f.bind("saved",b):b()},_getInputs:function(a){return b(a).find(":input[name]")},_getInputsSignature:function(a){var c=_(a).map(function(a){var c,d=b(a);return c=d.is(":checkbox, :radio")?[d.attr("id"),d.attr("name"),d.prop("value")]:[d.attr("id"),d.attr("name")],c.join(",")});return c.join(";")},_getInputStatePropertyName:function(a){var c=b(a);return c.is(":radio, :checkbox")?"checked":"value"},getSidebarWidgetsControl:function(){var a,b;return a="sidebars_widgets["+this.params.sidebar_id+"]",(b=f.control(a))?b:void 0},updateWidget:function(c){var d,g,h,i,j,k,l,m,n,o,p,q=this;c=b.extend({instance:null,complete:null,ignoreActiveElement:!1},c),d=c.instance,g=c.complete,this._updateCount+=1,j=this._updateCount,h=this.container.find(".widget:first"),i=h.find(".widget-content:first"),i.find(".widget-error").remove(),this.container.addClass("widget-form-loading"),this.container.addClass("previewer-loading"),n=f.state("processing"),n(n()+1),this.liveUpdateMode||this.container.addClass("widget-form-disabled"),k={},k.action="update-widget",k.wp_customize="on",k.nonce=f.Widgets.data.nonce,k.theme=f.settings.theme.stylesheet,l=b.param(k),m=this._getInputs(i),m.each(function(){var a=b(this),c=q._getInputStatePropertyName(this);a.data("state"+j,a.prop(c))}),l+=d?"&"+b.param({sanitized_widget_setting:JSON.stringify(d)}):"&"+m.serialize(),l+="&"+i.find("~ :input").serialize(),o=b.post(a.ajax.settings.url,l),o.done(function(a){var d,k,l,n,o=!1;return"0"===a?(f.previewer.preview.iframe.hide(),void f.previewer.login().done(function(){q.updateWidget(c),f.previewer.preview.iframe.show()})):"-1"===a?void f.previewer.cheatin():void(a.success?(k=b("<div>"+a.data.form+"</div>"),l=q._getInputs(k),n=q._getInputsSignature(m)===q._getInputsSignature(l),n&&!q.liveUpdateMode&&(q.liveUpdateMode=!0,q.container.removeClass("widget-form-disabled"),q.container.find('input[name="savewidget"]').hide()),n&&q.liveUpdateMode?(m.each(function(a){var d,e,f,g=b(this),h=b(l[a]),i=q._getInputStatePropertyName(this);d=g.data("state"+j),e=h.prop(i),g.data("sanitized",e),f=d!==e&&(c.ignoreActiveElement||!g.is(document.activeElement)),f&&g.prop(i,e)}),b(document).trigger("widget-synced",[h,a.data.form])):q.liveUpdateMode?(q.liveUpdateMode=!1,q.container.find('input[name="savewidget"]').show(),o=!0):(i.html(a.data.form),q.container.removeClass("widget-form-disabled"),b(document).trigger("widget-updated",[h])),p=!o&&!_(q.setting()).isEqual(a.data.instance),p?(q.isWidgetUpdating=!0,q.setting(a.data.instance),q.isWidgetUpdating=!1):q.container.removeClass("previewer-loading"),g&&g.call(q,null,{noChange:!p,ajaxFinished:!0})):(d=e.error,a.data&&a.data.message&&(d=a.data.message),g?g.call(q,d):i.prepend('<p class="widget-error"><strong>'+d+"</strong></p>")))}),o.fail(function(a,b){g&&g.call(q,b)}),o.always(function(){q.container.removeClass("widget-form-loading"),m.each(function(){b(this).removeData("state"+j)}),n(n()-1)})},expandControlSection:function(){f.Control.prototype.expand.call(this)},_toggleExpanded:f.Section.prototype._toggleExpanded,expand:f.Section.prototype.expand,expandForm:function(){this.expand()},collapse:f.S
                    
                
revisions.js https://bitbucket.org/acipriani/madeinapulia.com | JavaScript | 1167 lines
                    
187	 */
                    
188	revisions.model.Revisions = Backbone.Collection.extend({
                    
189		model: revisions.model.Revision,
                    
213
                    
214	revisions.model.Fields = Backbone.Collection.extend({
                    
215		model: revisions.model.Field
                    
226
                    
227	revisions.model.Diffs = Backbone.Collection.extend({
                    
228		initialize: function( models, options ) {
                    
                
FlavorModel.js git://github.com/ging/horizon-js.git | JavaScript | 49 lines
                    
29
                    
30var Flavors = Backbone.Collection.extend({
                    
31    model: Flavor,
                    
                
KeypairModel.js git://github.com/ging/horizon-js.git | JavaScript | 40 lines
                    
19
                    
20var Keypairs = Backbone.Collection.extend({
                    
21    model: Keypair,
                    
                
page.js https://git01.codeplex.com/mobileshop | JavaScript | 285 lines
                    
48
                    
49window.PageCollection = Backbone.Collection.extend({
                    
50    model: Page
                    
                
app.js git://github.com/funkatron/WildGarlic-jqmobile.git | JavaScript | 201 lines
                    
15		*/
                    
16		var Results = Backbone.Collection.extend({
                    
17			initialize: function(models, options) {
                    
                
VolumeModel.js git://github.com/ging/horizon-js.git | JavaScript | 57 lines
                    
40
                    
41var Volumes = Backbone.Collection.extend({
                    
42    
                    
                
backbone-d3.js git://github.com/jspears/bobamo.git | JavaScript | 78 lines
                    
66        }),
                    
67        PlotCollection:Backbone.Collection.extend({
                    
68            initialize:function (models, settings) {
                    
                
UserModel.js git://github.com/ging/horizon-js.git | JavaScript | 38 lines
                    
22
                    
23var Users = Backbone.Collection.extend({
                    
24    model: User,
                    
                
model.js https://bitbucket.org/okfn/wdmmg/ | JavaScript | 68 lines
                    
22    });
                    
23    var DataStoreCollection = Backbone.Collection.extend({
                    
24        url: function(){
                    
                
model.js https://bitbucket.org/deximer/generalwill | JavaScript | 246 lines
                    
53
                    
54window.GroupPriorities = Backbone.Collection.extend({
                    
55    model : window.Priority,
                    
                
collections.js https://bitbucket.org/sqr3/dabbawala.git | JavaScript | 100 lines
                    
6
                    
7 app.searchTiffinboxSupplier = Backbone.Collection.extend({
                    
8    initialize: function(options) {
                    
17 
                    
18 app.GetMenuDate = Backbone.Collection.extend({
                    
19    initialize: function(options) {
                    
27/////////////////////////////////
                    
28app.ProcessOrder = Backbone.Collection.extend({
                    
29    initialize: function(options) {
                    
37///////////////////////////////////
                    
38app.CartCollections = Backbone.Collection.extend({
                    
39    initialize: function(options) {
                    
50
                    
51app.orderCollections = Backbone.Collection.extend({
                    
52    initialize: function(options) {
                    
                
enum.php https://bitbucket.org/wez/mtrack/ | PHP | 148 lines
                    
35  });
                    
36  var ECOL = Backbone.Collection.extend({
                    
37    model: MODEL
                    
                
rib.js https://github.com/pozadi/mf2.git | JavaScript | 321 lines
                    
99	 */
                    
100	Rib.Collection = Backbone.Collection.extend({
                    
101		newEntity: function() {
                    
                
ProjectModel.js git://github.com/ging/horizon-js.git | JavaScript | 35 lines
                    
19
                    
20var Projects = Backbone.Collection.extend({
                    
21    model: Project,
                    
                
app.js git://github.com/pieter-vanderwerff/backbone-require-wire.git | JavaScript | 68 lines
                    
24      var view = new View(),
                    
25        collection = new ( Backbone.Collection.extend( {
                    
26          done: function() { return []; },
                    
                
client.js git://github.com/cmpolis/Apples-and-Oranges.git | JavaScript | 215 lines
                    
17  
                    
18  var NounCollection = Backbone.Collection.extend({
                    
19    model: Noun
                    
73  
                    
74  var UserCollection = Backbone.Collection.extend({
                    
75    model: User
                    
113  
                    
114  var PlayedNounCollection = Backbone.Collection.extend({
                    
115    model: PlayedNoun
                    
                
users.js https://github.com/samuelclay/NewsBlur.git | JavaScript | 45 lines
                    
32
                    
33NEWSBLUR.Collections.Users = Backbone.Collection.extend({
                    
34    
                    
                
main.js https://bitbucket.org/KarlisLukstins/sticky-fork.git | JavaScript | 329 lines
                    
139
                    
140	var notesCollection = Backbone.Collection.extend({ model: noteModel });
                    
141	var notes = new notesCollection();
                    
154	var desktopModel = Backbone.Model.extend({ defaults:{ id: null, name: null, selected: null } });
                    
155	var desktopsCollection = Backbone.Collection.extend({ model: desktopModel });
                    
156	var desktops = new desktopsCollection();
                    
                
data.js https://bitbucket.org/galaxy/galaxy-central | JavaScript | 1 lines
                    
1define(["libs/backbone/backbone-relational"],function(){var d=Backbone.RelationalModel.extend({});var e=Backbone.RelationalModel.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var i=new d();_.each(_.keys(this.attributes),function(j){if(j.indexOf("metadata_")===0){var l=j.split("metadata_")[1];i.set(l,this.attributes[j]);delete this.attributes[j]}},this);this.set("metadata",i,{silent:true})},get_metadata:function(i){return this.attributes.metadata.get(i)},urlRoot:galaxy_paths.get("datasets_url")});var c=e.extend({defaults:_.extend({},e.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(i){e.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var i=this,j=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:i.attributes.chunk_index++}).success(function(k){var l;if(k.ck_data!==""){l=k}else{i.attributes.at_eof=true;l=null}j.resolve(l)});return j}});var g=Backbone.Collection.extend({model:e});var f=Backbone.View.extend({initialize:function(i){(new b(i)).render()},render:function(){var m=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(m);var i=this.model.get_metadata("column_names");if(i){m.append("<tr><th>"+i.join("</th><th>")+"</th></tr>")}var k=this.model.get("first_data_chunk");if(k){this._renderChunk(k)}var j=this,n=_.find(this.$el.parents(),function(o){return $(o).css("overflow")==="auto"}),l=false;if(!n){n=window}n=$(n);n.scroll(function(){if(!l&&(j.$el.height()-n.scrollTop()-n.height()<=0)){l=true;$.when(j.model.get_next_chunk()).then(function(o){if(o){j._renderChunk(o);l=false}})}});$("#loading_indicator").ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()})},_renderCell:function(k,i,l){var j=this.model.get_metadata("column_types");if(l!==undefined){return $("<td>").attr("colspan",l).addClass("stringalign").text(k)}else{if(j[i]==="str"||j==="list"){return $("<td>").addClass("stringalign").text(k)}else{return $("<td>").text(k)}}},_renderRow:function(i){var j=i.split("\t"),l=$("<tr>"),k=this.model.get_metadata("columns");if(j.length===k){_.each(j,function(n,m){l.append(this._renderCell(n,m))},this)}else{if(j.length>k){_.each(j.slice(0,k-1),function(n,m){l.append(this._renderCell(n,m))},this);l.append(this._renderCell(j.slice(k-1).join("\t"),k-1))}else{if(k>5&&j.length===k-1){_.each(j,function(n,m){l.append(this._renderCell(n,m))},this);l.append($("<td>"))}else{l.append(this._renderCell(i,0,k))}}}return l},_renderChunk:function(i){var j=this.$el.find("table");_.each(i.ck_data.split("\n"),function(k,l){j.append(this._renderRow(k))},this)}});var b=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,initialize:function(i){var j=i.model.attributes.metadata.attributes;if(typeof j.chromCol==="undefined"||typeof j.startCol==="undefined"||typeof j.endCol==="undefined"){console.log("TabularButtonTrackster : Metadata for column identification is missing.")}else{this.col.chrom=j.chromCol-1;this.col.start=j.startCol-1;this.col.end=j.endCol-1}if(this.col.chrom===null){return}if(typeof i.model.attributes.id==="undefined"){console.log("TabularButtonTrackster : Dataset identification is missing.")}else{this.dataset_id=i.model.attributes.id}if(typeof i.model.attributes.url_viz==="undefined"){console.log("TabularButtonTrackster : Url for visualization controller is missing.")}else{this.url_viz=i.model.attributes.url_viz}if(typeof i.model.attributes.genome_build!=="undefined"){this.genome_build=i.model.attributes.genome_build}},events:{"mouseover tr":"btn_viz_show",mouseleave:"btn_viz_hide"},btn_viz_show:function(m){if(this.col.chrom===null){return}var q=$(m.target).parent();var n=q.children().eq(this.col.chrom).html();var i=q.children().eq(this.col.start).html();var k=q.children().eq(this.col.end).html();if(n!==""&&i!==""&&k!==""){var p={dataset_id:this.dataset_id,gene_region:n+":"+i+"-"+k};var l=q.offset();var j=l.left-10;var o=l.top;$("#btn_viz").css({position:"fixed",top:o+"px",left:j+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,p,this.genome_build));$("#btn_viz").show()}},btn_viz_hide:function(){$("#btn_viz").hide()},create_trackster_action:function(i,k,j){return function(){var l={};if(j){l["f-dbkey"]=j}$.ajax({url:i+"/list_tracks?"+$.param(l),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(m){var n=window.parent;n.show_modal(("View Data in a New or Saved Visualization"),"",{Cancel:function(){n.hide_modal()},"View in saved visualization":function(){n.show_modal(("Add Data to Saved Visualization"),m,{Cancel:function(){n.hide_modal()},"Add to visualization":function(){$(n.document).find("input[name=id]:checked").each(function(){var o=$(this).val();k.id=o;n.frame_manager.frame_new({title:"Trackster",type:"url",content:i+"/trackster?"+$.param(k)});n.hide_modal()})}})},"View in new visualization":function(){var o=i+"/trackster?"+$.param(k);n.frame_manager.frame_new({title:"Trackster",type:"url",content:o});n.hide_modal()}})}});return false}},render:function(){var i=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.$el.append(i.render().$el);$("#btn_viz").hide()}});var a=function(l,j,m,i){var k=new j({model:new l(m)});k.render();if(i){i.append(k.$el)}return k};var h=function(k,i){var j=$("<div/>").appendTo(i);return new f({el:j,model:new c(k)}).render()};return{Dataset:e,TabularDataset:c,DatasetCollection:g,TabularDatasetChunkedView:f,createTabularDatasetChunkedView:h}});
                    
                
seepy.js https://bitbucket.org/spo6/seepy | JavaScript | 510 lines
                    
254
                    
255Classes = Backbone.Collection.extend({
                    
256	model : Class
                    
258
                    
259Variables = Backbone.Collection.extend({
                    
260	model : Variable
                    
262
                    
263Functions = Backbone.Collection.extend({
                    
264	model : FunctionM
                    
266
                    
267Parameters = Backbone.Collection.extend({
                    
268	model : Variable
                    
270
                    
271Inheritances = Backbone.Collection.extend({
                    
272	model : Inheritance
                    
                
backbone-tests.ts https://hg.codeplex.com/mypet | TypeScript | 113 lines
                    
89    var Book: Backbone.Model;
                    
90    var Library = Backbone.Collection.extend({
                    
91        model: Book
                    
                
models.js git://pkgs.fedoraproject.org/aeolus-conductor | JavaScript | 88 lines
                    
17
                    
18Conductor.Models.Pools = Backbone.Collection.extend({
                    
19  model: Backbone.Model.Pool,
                    
34
                    
35Conductor.Models.Instances = Backbone.Collection.extend({
                    
36  model: Backbone.Model.Instance,
                    
71
                    
72Conductor.Models.Deployments = Backbone.Collection.extend({
                    
73  model: Backbone.Model.Deployment,
                    
                
payment.js https://git01.codeplex.com/mobileshop | JavaScript | 63 lines
                    
2
                    
3window.PaymentList = Backbone.Collection.extend({
                    
4    model: PaymentStyle,
                    
                
backbone-paginated-collection-spec.js https://github.com/dlikhten/paginated-collection.git | JavaScript | 374 lines
                    
5
                    
6  var RegularModelCollection = Backbone.Collection.extend({
                    
7    model: TehModel
                    
                
productList.js https://git01.codeplex.com/mobileshop | JavaScript | 173 lines
                    
4
                    
5window.ProductList = Backbone.Collection.extend({
                    
6    model: Product,
                    
                
searchList.js https://git01.codeplex.com/mobileshop | JavaScript | 172 lines
                    
3
                    
4window.SearchList = Backbone.Collection.extend({
                    
5    model: Product,
                    
                
todos.js git://github.com/pieter-vanderwerff/backbone-require-wire.git | JavaScript | 88 lines
                    
10  // Todos Collection
                    
11  return Backbone.Collection.extend( {
                    
12
                    
                
speed.min.js https://bitbucket.org/builtbyclick/new-speed-evidence.git | JavaScript | 1 lines
                    
1Backbone.View.prototype.close=function(){this.remove();this.unbind();if(this.onClose){this.onClose()}};var Report=Backbone.Model.extend({forView:function(){var e={1:"Web",2:"SMS",3:"Email",4:"Twitter"};var t=this.toJSON();t.id=t.incident.incidentid;t.link=baseURL+"/reports/view/"+t.incident.incidentid;t.name=t.incident.incidenttitle;t.description=$("<div>"+t.incident.incidentdescription+"</div>").text();t.date=moment(t.incident.incidentdate,"YYYY-MM-DD HH:mm:ss");t.site=t.incident.sharingsourceid;t.source=e[t.incident.incidentmode];t.category=[];_.each(t.categories,function(e){t.category.push(e.category.title)});t.category=t.category.join(", ");t.thumbnail=false;_.each(t.media,function(e){if(e.type==1&&!t.thumbnail)t.thumbnail=e.link_url});t.icon="icon-globe";if(t.incident.incidentmode==4){t.icon="icon-twitter"}else if(t.incident.incidentmode==3){t.icon="icon-envelope"}else if(t.incident.incidentmode==2){t.icon="icon-mobile-phone"}else if(t.incident.incidentmode==1){t.icon="icon-globe";_.each(t.media,function(e){if(e.type==2)t.icon="icon-facetime-video";if(e.type==1&&(t.icon=="icon-globe"||t.icon=="icon-file-text"))t.icon="icon-camera";if(e.type==4&&t.icon=="icon-globe")t.icon="icon-rss"})}if(t.site&&t.site!=="main"){t.url=baseURL+"/reports/sharing/view/"+t.id}else{t.url=baseURL+"/reports/view/"+t.id}return t}});var ReportCollection=Backbone.Collection.extend({model:Report,initialize:function(e,t){}});var ReportListView=Backbone.View.extend({template:_.template($("#reports-list-template").html()),emptyItemTemplate:_.template($("#empty-item-template").html()),initialize:function(e){_.bindAll(this,"addReport","addAll","loading","saveFilter","removeReport");this.model.bind("add",this.addReport);this.model.bind("remove",this.removeReport);this.model.bind("reset",this.addAll);this.container=$(e.container);this.liveReports=e.liveReports},events:{"click .paused":function(){this.liveReports.toggle()},"click .filter-button":function(){$("#middle").toggleClass("filterOpen")},"submit form":"saveFilter","click form input#reset":function(e){liveReports.filter({c:null,m:null,mode:null,q:null,sharing:null});liveReports.updateFormFromFilter()}},render:function(){this.$el.html(this.template({}));this.reportList=this.$("ul.reports-list");if(this.model.length>0){this.addAll()}else{this.reportList.append(this.emptyItemTemplate())}this.container.html(this.el);return this},addReport:function(e){var t=new ReportListLiView({model:e,id:"update_"+e.id,parent:this});this.reportList.append(t.render().el);e.view=t;this.$("li.no-reports").remove()},removeReport:function(){if(this.model.length==0){this.reportList.empty();this.reportList.append(this.emptyItemTemplate())}},addAll:function(){this.reportList.empty();this.model.each(this.addReport)},onClose:function(){this.model.unbind("add",this.addReport);this.model.unbind("reset",this.addAll);this.model.each(function(e){e.view.close()})},loading:function(e){if(e){this.$(".loading").show();this.$("li.no-reports").hide()}else{this.$(".loading").hide();this.$("li.no-reports").hide()}},saveFilter:function(e){filter=$("#latest-updates form").toJSON();filter=_.extend({c:[],m:[],mode:[],q:null,sharing:null},filter);delete filter.form_auth_token;liveReports.filter(filter);e.preventDefault()}});var ReportListLiView=Backbone.View.extend({initialize:function(e){_.bindAll(this,"update","remove","close","togglePopup");this.model.bind("change",this.update);this.model.bind("remove",this.close);this.parent=e.parent;$(document).on("click",function(t){e.parent.$("ul.reports-list li").popover("destroy").removeClass("popped")});$(".popover").on("click",function(e){e.stopPropagation()})},tagName:"li",className:"clearfix",events:{click:"togglePopup"},attributes:function(){var e=this.model.forView();return{"data-placement":"right",title:e.name,"data-content":_.template($("#report-popover-template").html(),e)}},template:_.template($("#report-item-template").html()),render:function(){var e=this.model.forView();this.$el.html(this.template(e));return this},remove:function(){this.$el.popover("destroy");this.$el.remove()},update:function(e){this.render()},onClose:function(){this.model.unbind("change",this.update);this.model.unbind("remove",this.remove)},togglePopup:function(e){var t=this.$el;if(!t.hasClass("popped")){this.parent.$("ul.reports-list li").not("#"+t.attr("id")).popover("destroy").removeClass("popped");t.popover({html:"true",trigger:"manual"}).popover("show").addClass("popped")}else{t.popover("destroy").removeClass("popped")}e.stopPropagation()}});var liveReports={request:null,pollTimeout:null,loaded:null,latestid:0,delay:2e4,filters:{},initialize:function(e){_.bindAll(this,"fetch","startPolling","update","stopPolling","toggle","updateFormFromFilter");dfd=$.Deferred();this.request=dfd.promise();dfd.resolve();this.loaded=$.Deferred();try{var t=JSON.parse(localStorage.getItem("updateFilters"))}catch(n){t={}}t=_.extend({c:[],m:[],mode:[]},t);this.filters=t;this.reports=new ReportCollection;this.listView=new ReportListView({model:this.reports,container:"#latest-updates",liveReports:this});this.listView.render();this.reports.view=this.listView;this.updateFormFromFilter();this.listView.loading(true);liveReports.loaded.done(_.bind(function(){this.listView.loading(false)},this));e=_.extend({},e);if(typeof e.delay!=="undefined"){this.delay==e.delay}},fetch:function(){this.clearPollingTimeout();if(this.request.state()=="pending")return this.request;var e=baseURL+"/api?task=incidents&limit=20";var t=[];for(var n in this.filters){if(this.filters[n]!=null){t.push(n+"="+this.filters[n])}}if(e.indexOf("?")!==-1){var r=e.indexOf("?");var i=e.substr(r+1,e.length).split("&");e=e.substring(0,r);for(var s=0;s<i.length;s++){t.push(i[s])}}e+=t.length>0?"?"+t.join("&"):"";dfd=$.getJSON(e).done(this.update).always(_.bind(function(){this.startPolling();this.loaded.resolve()},this));this.request=dfd.promise();return this.request},startPolling:function(e){if(this.pollTimeout==null||typeof e!=="undefined"){e=typeof e!=="undefined"?e:this.delay;this.clearPollingTimeout();this.pollTimeout=_.delay(this.fetch,e);$("#latest-updates .paused .pause").show();$("#latest-updates .paused .resume").hide()}},clearPollingTimeout:function(){clearTimeout(this.pollTimeout);this.pollTimeout=null},stopPolling:function(){this.clearPollingTimeout();$("#latest-updates .paused .pause").hide();$("#latest-updates .paused .resume").show()},isPolling:function(){if(this.pollTimeout==null)return false;return true},filter:function(e){if(e==undefined){throw"Missing filters"}var t=false;$.each(e,_.bind(function(e,n){var r=this.filters[e];if(r==undefined&&r==null||r!==n){t=true;this.filters[e]=n}},this));localStorage.setItem("updateFilters",JSON.stringify(this.filters));if(t){this.startPolling(0)}},update:function(e){var t=this;if(typeof e.payload!="undefined"){if(typeof e.payload.incidents!="undefined"){_.each(e.payload.incidents,function(t,n){e.payload.incidents[n].id=t.incident.incidentid});this.reports.set(e.payload.incidents)}else{this.reports.set([])}}},toggle:function(e){if(this.pollTimeout==null)this.startPolling();else this.stopPolling();e.preventDefault()},updateFormFromFilter:function(){var e=this.filters;$("#latest-updates form input").attr("checked",false);if(typeof e.q!=="undefined")$("#latest-updates form #q").val(e.q);if(typeof e.m!=="undefined"){_.each(e.m,function(e){$('#latest-updates form input[name="m[]"][value="'+e+'"]').attr("checked","checked")})}if(typeof e.mode!=="undefined"){_.each(e.mode,function(e){$('#latest-updates form input[name="mode[]"][value="'+e+'"]').attr("checked","checked")})}if(typeof e.c!=="undefined"){_.each(e.c,function(e){$('#latest-updates form input[name="c[]"][value="'+e+'"]').attr("checked","checked")})}if(typeof e.sharing!=="undefined"){_.each(e.sharing,function(e){$('#latest-updates form input[name="sharing[]"][value="'+e+'"]').attr("checked","checked")})}}};$(document).ready(function(){liveReports.initialize();liveReports.loaded.done(function(){var e=false;$("#latest-updates").hover(function(){$("#latest-updates .paused").show();$("#latest-updates .filter-button").show();e=liveReports.isPolling();liveReports.stopPolling()},function(){$("#latest-updates .paused").hide();$("#latest-updates .filter-button").hide();if(e)liveReports.startPolling()})});liveReports.startPolling(0)})
                    
                
images.js git://github.com/saaperezru/Zentity.git | JavaScript | 136 lines
                    
16  // ---------------
                    
17  window.ImageCollection = Backbone.Collection.extend({
                    
18    model: Image,
                    
                
myFilter.js https://git01.codeplex.com/mobileshop | JavaScript | 50 lines
                    
6
                    
7window.BrandList = Backbone.Collection.extend({
                    
8    model: BrandModel,
                    
                
data.js https://bitbucket.org/galaxy/galaxy-central | JavaScript | 468 lines
                    
107
                    
108var DatasetCollection = Backbone.Collection.extend({
                    
109    model: Dataset
                    
                
tools.js https://bitbucket.org/galaxy/galaxy-central | JavaScript | 708 lines
                    
213 */
                    
214var ToolCollection = Backbone.Collection.extend({
                    
215    model: Tool
                    
333 */
                    
334var ToolPanel = Backbone.Collection.extend({
                    
335    // TODO: need to generate this using url_for
                    
                
ui.js https://bitbucket.org/galaxy/galaxy-central | JavaScript | 479 lines
                    
78
                    
79var IconButtonCollection = Backbone.Collection.extend({
                    
80    model: IconButton
                    
145 */
                    
146var Grid = Backbone.Collection.extend({
                    
147    
                    
                
models.js https://bitbucket.org/aktivecortex/aktivecortex.git | JavaScript | 196 lines
                    
13
                    
14window.CustomerCollection = Backbone.Collection.extend({
                    
15    model: Customer,
                    
89
                    
90window.AccountCollection = Backbone.Collection.extend({
                    
91    model: Account
                    
168
                    
169window.MovementCollection = Backbone.Collection.extend({
                    
170    model: Movement
                    
191
                    
192window.TaskCollection = Backbone.Collection.extend({
                    
193    model: Task,
                    
                
MusicPlayer.js https://bitbucket.org/zappan/backbone.musicplayer.git | JavaScript | 326 lines
                    
7  
                    
8  MusicPlayer.Library = Backbone.Collection.extend({   // this is collection
                    
9    model: MusicPlayer.Track,
                    
                
hda-model.js https://bitbucket.org/andreyto/mgtaxa-galaxy | JavaScript | 1 lines
                    
1var HistoryDatasetAssociation=BaseModel.extend(LoggableMixin).extend({defaults:{history_id:null,model_class:"HistoryDatasetAssociation",hid:0,id:null,name:"",state:"",data_type:null,file_size:0,meta_files:[],misc_blurb:"",misc_info:"",deleted:false,purged:false,visible:false,accessible:false},urlRoot:"api/histories/",url:function(){return"api/histories/"+this.get("history_id")+"/contents/"+this.get("id")},initialize:function(){this.log(this+".initialize",this.attributes);this.log("\tparent history_id: "+this.get("history_id"));if(!this.get("accessible")){this.set("state",HistoryDatasetAssociation.STATES.NOT_VIEWABLE)}this.on("change:state",function(b,a){this.log(this+" has changed state:",b,a);if(this.inReadyState()){this.trigger("state:ready",this.get("id"),a,this.previous("state"),b)}})},isDeletedOrPurged:function(){return(this.get("deleted")||this.get("purged"))},isVisible:function(b,c){var a=true;if((!b)&&(this.get("deleted")||this.get("purged"))){a=false}if((!c)&&(!this.get("visible"))){a=false}return a},inReadyState:function(){var a=this.get("state");return((a===HistoryDatasetAssociation.STATES.NEW)||(a===HistoryDatasetAssociation.STATES.OK)||(a===HistoryDatasetAssociation.STATES.EMPTY)||(a===HistoryDatasetAssociation.STATES.FAILED_METADATA)||(a===HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(a===HistoryDatasetAssociation.STATES.DISCARDED)||(a===HistoryDatasetAssociation.STATES.ERROR))},hasData:function(){return(this.get("file_size")>0)},toString:function(){var a=this.get("id")||"";if(this.get("name")){a+=':"'+this.get("name")+'"'}return"HistoryDatasetAssociation("+a+")"}});HistoryDatasetAssociation.STATES={UPLOAD:"upload",QUEUED:"queued",PAUSED:"paused",RUNNING:"running",SETTING_METADATA:"setting_metadata",NEW:"new",EMPTY:"empty",OK:"ok",FAILED_METADATA:"failed_metadata",NOT_VIEWABLE:"noPermission",DISCARDED:"discarded",ERROR:"error"};var HDACollection=Backbone.Collection.extend(LoggableMixin).extend({model:HistoryDatasetAssociation,initialize:function(){},ids:function(){return this.map(function(a){return a.id})},getVisible:function(a,b){return this.filter(function(c){return c.isVisible(a,b)})},getStateLists:function(){var a={};_.each(_.values(HistoryDatasetAssociation.STATES),function(b){a[b]=[]});this.each(function(b){a[b.get("state")].push(b.get("id"))});return a},running:function(){var a=[];this.each(function(b){if(!b.inReadyState()){a.push(b.get("id"))}});return a},update:function(a){this.log(this+"update:",a);if(!(a&&a.length)){return}var b=this;_.each(a,function(e,c){var d=b.get(e);d.fetch()})},toString:function(){return("HDACollection("+this.ids().join(",")+")")}});
                    
                
myCollect.js https://git01.codeplex.com/mobileshop | JavaScript | 107 lines
                    
7
                    
8window.MyCollectList = Backbone.Collection.extend({
                    
9    model: MyCollect,
                    
                
index.html https://bitbucket.org/ilumin/backbone-example-todolist.git | HTML | 176 lines
                    
53
                    
54    var TodoList = Backbone.Collection.extend({
                    
55        model: TodoItem,
                    
                
todos.js git://github.com/addyosmani/todomvc.git | JavaScript | 41 lines
                    
7	  
                    
8	var TodosCollection = Backbone.Collection.extend({
                    
9
                    
                
sidebar-nav.js http://docdoku.googlecode.com/svn/trunk/ | JavaScript | 222 lines
                    
55
                    
56FolderList = Backbone.Collection.extend({
                    
57		
                    
                
invoice.js https://git01.codeplex.com/mobileshop | JavaScript | 127 lines
                    
10
                    
11window.InvoiceTypeList = Backbone.Collection.extend({
                    
12    model: InvoiceType,
                    
                
Things.js https://bitbucket.org/boatkorachal/faak.git | JavaScript | 42 lines
                    
10	// server.
                    
11	app.Things = Backbone.Collection.extend({
                    
12		url: 'things',
                    
                
app.js https://bitbucket.org/doubleface/doubleface.bitbucket.org | JavaScript | 198 lines
                    
66    });
                    
67    var OperationCollection = Backbone.Collection.extend({
                    
68        localStorage: new Backbone.LocalStorage("operations")
                    
                
user-model.js https://bitbucket.org/andreyto/mgtaxa-galaxy | JavaScript | 1 lines
                    
1var User=BaseModel.extend(LoggableMixin).extend({urlRoot:"api/users",defaults:{id:null,username:"("+_l("anonymous user")+")",email:"",total_disk_usage:0,nice_total_disk_usage:"0 bytes",quota_percent:null},initialize:function(a){this.log("User.initialize:",a);this.on("loaded",function(b,c){this.log(this+" has loaded:",b,c)});this.on("change",function(b,c){this.log(this+" has changed:",b,c.changes)})},isAnonymous:function(){return(!this.get("email"))},loadFromApi:function(d,b){d=d||User.CURRENT_ID_STR;b=b||{};var a=this,c=b.success;b.success=function(f,e){a.trigger("loaded",f,e);if(c){c(f,e)}};if(d===User.CURRENT_ID_STR){b.url=this.urlRoot+"/"+User.CURRENT_ID_STR}return BaseModel.prototype.fetch.call(this,b)},toString:function(){var a=[this.get("username")];if(this.get("id")){a.unshift(this.get("id"));a.push(this.get("email"))}return"User("+a.join(":")+")"}});User.CURRENT_ID_STR="current";User.getCurrentUserFromApi=function(b){var a=new User();a.loadFromApi(User.CURRENT_ID_STR,b);return a};var UserCollection=Backbone.Collection.extend(LoggableMixin).extend({model:User,urlRoot:"api/users"});
                    
                
speed.js https://bitbucket.org/builtbyclick/new-speed-evidence.git | JavaScript | 497 lines
                    
72
                    
73var ReportCollection = Backbone.Collection.extend(
                    
74{
                    
                
category.js https://git01.codeplex.com/mobileshop | JavaScript | 154 lines
                    
8
                    
9window.ProductCategoryCollection = Backbone.Collection.extend({
                    
10    model: Category,
                    
                
status_list_spec.js git://github.com/bkeepers/monologue.git | JavaScript | 30 lines
                    
7    $el = $('<div/>');
                    
8    collection = new (Backbone.Collection.extend({url: '/mock'}));
                    
9    // prevent collection from trying to refresh from the server
                    
                
matching.js https://bitbucket.org/satook/krum_server.git | JavaScript | 426 lines
                    
35
                    
36var ContentList = Backbone.Collection.extend({
                    
37  model: Content,
                    
                
catalog.js https://git01.codeplex.com/mobileshop | JavaScript | 43 lines
                    
17
                    
18window.CatalogCollection = Backbone.Collection.extend({
                    
19    model: Catalog
                    
                
composer-models.js https://bitbucket.org/acipriani/madeinapulia.com | JavaScript | 188 lines
                    
94     */
                    
95    var Shortcodes = vc.shortcodes_collection = Backbone.Collection.extend({
                    
96        model:vc.shortcode,
                    
                
folder.js http://docdoku.googlecode.com/svn/trunk/ | JavaScript | 41 lines
                    
5) {
                    
6	var FolderList = Backbone.Collection.extend({
                    
7		model: Folder,
                    
                
models.js https://bitbucket.org/acipriani/madeinapulia.com | JavaScript | 75 lines
                    
44   */
                    
45  var Shortcodes = Backbone.Collection.extend({
                    
46    model: Shortcode,
                    
                
hda-model.js https://bitbucket.org/lance_parsons/galaxy-central_installed-tools-functional-tests-fix | JavaScript | 328 lines
                    
201 */
                    
202var HDACollection = Backbone.Collection.extend( LoggableMixin ).extend(
                    
203/** @lends HDACollection.prototype */{
                    
                
config.js https://bitbucket.org/james_taylor/galaxy-central | JavaScript | 280 lines
                    
68 */
                    
69var ConfigSettingCollection = Backbone.Collection.extend({
                    
70    model: ConfigSetting,
                    
                
Faaks.js https://bitbucket.org/boatkorachal/faak.git | JavaScript | 38 lines
                    
10	// server.
                    
11	app.Faaks = Backbone.Collection.extend({
                    
12		url: 'faaks',
                    
                
library.js.coffee https://bitbucket.org/satook/krum_server.git | CoffeeScript | 285 lines
                    
98Player = Backbone.Model.extend()
                    
99PlayerCollection = Backbone.Collection.extend(
                    
100	model: Player,
                    
211MediaTypes = Backbone.Model.extend()
                    
212MediaTypeCollection = Backbone.Collection.extend(
                    
213	model: MediaTypes,
                    
223)
                    
224MediaCollection = Backbone.Collection.extend(
                    
225	model: Media
                    
                
stream.js git://github.com/diaspora/diaspora.git | JavaScript | 58 lines
                    
1app.models.Stream = Backbone.Collection.extend({
                    
2  initialize : function(){
                    
                
Tunes.js https://bitbucket.org/edwardstlouis/backbonepeep1.git | JavaScript | 346 lines
                    
20
                    
21    window.Albums = Backbone.Collection.extend({
                    
22        model: Album,
                    
                
latent.js git://github.com/saaperezru/Zentity.git | JavaScript | 123 lines
                    
16  // ---------------
                    
17  window.TopicCollection = Backbone.Collection.extend({
                    
18    model: Topic,
                    
                
collections.js https://bitbucket.org/sqr3/dabbawala.git | JavaScript | 74 lines
                    
6
                    
7  app.TiffinBoxSuppliers = Backbone.Collection.extend({
                    
8    url: function(){
                    
12  
                    
13 app.searchTiffinboxSupplier = Backbone.Collection.extend({
                    
14    initialize: function(options) {
                    
21  });
                    
22 app.GetMenuDate = Backbone.Collection.extend({
                    
23    initialize: function(options) {
                    
31
                    
32app.CartCollections = Backbone.Collection.extend({
                    
33    initialize: function(options) {
                    
44
                    
45  app.SearchFilterResult = Backbone.Collection.extend({
                    
46    initialize: function(options ,search) {
                    
                
index.html https://bitbucket.org/doubleface/doubleface.bitbucket.org | HTML | 185 lines
                    
57
                    
58    var CompanyCollection = Backbone.Collection.extend({
                    
59        model: CompanyModel,
                    
                
config.js https://bitbucket.org/james_taylor/galaxy-central | JavaScript | 1 lines
                    
1define(["libs/underscore","viz/trackster/util"],function(b,e){var c=Backbone.Model.extend({initialize:function(f){var g=this.get("key");this.set("id",g);var h=b.find(c.known_settings_defaults,function(i){return i.key===g});if(h){this.set(b.extend({},h,f))}if(this.get("type")==="color"&&!this.get("value")){this.set("value",e.get_random_color())}this.on("change:value",this.cast_value,this)},cast_value:function(){var f=this.get("type"),g=this.get("value");if(f==="float"){g=parseFloat(g)}else{if(f==="int"){g=parseInt(g,10)}}this.set("value")}},{known_settings_defaults:[{key:"name",label:"Name",type:"text",default_value:""},{key:"color",label:"Color",type:"color",default_value:null},{key:"min_value",label:"Min Value",type:"float",default_value:null},{key:"max_value",label:"Max Value",type:"float",default_value:null},{key:"mode",type:"string",default_value:this.mode,hidden:true},{key:"height",type:"int",default_value:32,hidden:true},{key:"pos_color",label:"Positive Color",type:"color",default_value:"#FF8C00"},{key:"neg_color",label:"Negative Color",type:"color",default_value:"#4169E1"},{key:"block_color",label:"Block color",type:"color",default_value:null},{key:"label_color",label:"Label color",type:"color",default_value:"black"},{key:"show_insertions",label:"Show insertions",type:"bool",default_value:false},{key:"show_counts",label:"Show summary counts",type:"bool",default_value:true},{key:"mode",type:"string",default_value:this.mode,hidden:true},{key:"reverse_strand_color",label:"Antisense strand color",type:"color",default_value:null},{key:"show_differences",label:"Show differences only",type:"bool",default_value:true},{key:"histogram_max",label:"Histogram maximum",type:"float",default_value:null,help:"Clear value to set automatically"},{key:"mode",type:"string",default_value:this.mode,hidden:true}]});var d=Backbone.Collection.extend({model:c,to_key_value_dict:function(){var f={};this.each(function(g){f[g.get("key")]=g.get("value")});return f},get_value:function(f){var g=this.get(f);if(g){return g.get("value")}return undefined}},{from_config_dict:function(g){var f=b.map(b.keys(g),function(h){return{key:h,value:g[h]}});return new d(f)}});var a=Backbone.View.extend({className:"config-settings-view",render:function(){var i=this.model;var f=this.$el;var h;function g(n,j){for(var r=0;r<n.length;r++){h=n[r];if(h.hidden){continue}var l="param_"+r;var v=i.values[h.key];var x=$("<div class='form-row' />").appendTo(j);x.append($("<label />").attr("for",l).text(h.label+":"));if(type==="bool"){x.append($('<input type="checkbox" />').attr("id",l).attr("name",l).attr("checked",v))}else{if(type==="text"){x.append($('<input type="text"/>').attr("id",l).val(v).click(function(){$(this).select()}))}else{if(type==="select"){var t=$("<select />").attr("id",l);for(var p=0;p<h.options.length;p++){$("<option/>").text(h.options[p].label).attr("value",h.options[p].value).appendTo(t)}t.val(v);x.append(t)}else{if(type==="color"){var w=$("<div/>").appendTo(x),s=$("<input />").attr("id",l).attr("name",l).val(v).css("float","left").appendTo(w).click(function(z){$(".bs-tooltip").removeClass("in");var y=$(this).siblings(".bs-tooltip").addClass("in");y.css({left:$(this).position().left+$(this).width()+5,top:$(this).position().top-($(y).height()/2)+($(this).height()/2)}).show();y.click(function(A){A.stopPropagation()});$(document).bind("click.color-picker",function(){y.hide();$(document).unbind("click.color-picker")});z.stopPropagation()}),q=$("<a href='javascript:void(0)'/>").addClass("icon-button arrow-circle").appendTo(w).attr("title","Set new random color").tooltip(),u=$("<div class='bs-tooltip right' style='position: absolute;' />").appendTo(w).hide(),m=$("<div class='tooltip-inner' style='text-align: inherit'></div>").appendTo(u),k=$("<div class='tooltip-arrow'></div>").appendTo(u),o=$.farbtastic(m,{width:100,height:100,callback:s,color:v});w.append($("<div/>").css("clear","both"));(function(y){q.click(function(){y.setColor(e.get_random_color())})})(o)}else{x.append($("<input />").attr("id",l).attr("name",l).val(v))}}}}if(h.help){x.append($("<div class='help'/>").text(h.help))}}}g(this.params,f);return this},render_in_modal:function(){var h=function(){hide_modal();$(window).unbind("keypress.check_enter_esc")},f=function(){this.update_from_form();hide_modal();$(window).unbind("keypress.check_enter_esc")},g=function(i){if((i.keyCode||i.which)===27){h()}else{if((i.keyCode||i.which)===13){f()}}};$(window).bind("keypress.check_enter_esc",g);if(this.$el.children().length===0){this.render()}show_modal("Configure",drawable.config.build_form(),{Cancel:h,OK:f})},update_from_form:function(){var f=this;this.collection.each(function(h,g){if(!h.get("hidden")){var j="param_"+g;var i=f.$el.find("#"+j).val();if(type==="bool"){i=container.find("#"+j).is(":checked")}h.set("value",i)}})}});return{ConfigSettingCollection:d,ConfigSettingCollectionView:a}});
                    
                
history.js https://bitbucket.org/andreyto/mgtaxa-galaxy | JavaScript | 1 lines
                    
1var HistoryDatasetAssociation=BaseModel.extend(LoggableMixin).extend({defaults:{history_id:null,model_class:"HistoryDatasetAssociation",hid:0,id:null,name:"",state:"",data_type:null,file_size:0,meta_files:[],misc_blurb:"",misc_info:"",deleted:false,purged:false,visible:false,accessible:false,for_editing:true},url:function(){return"api/histories/"+this.get("history_id")+"/contents/"+this.get("id")},initialize:function(){this.log(this+".initialize",this.attributes);this.log("\tparent history_id: "+this.get("history_id"));if(!this.get("accessible")){this.set("state",HistoryDatasetAssociation.STATES.NOT_VIEWABLE)}this.on("change:state",function(b,a){this.log(this+" has changed state:",b,a);if(this.inReadyState()){this.trigger("state:ready",this.get("id"),a,this.previous("state"),b)}})},isDeletedOrPurged:function(){return(this.get("deleted")||this.get("purged"))},isVisible:function(b,c){var a=true;if((!b)&&(this.get("deleted")||this.get("purged"))){a=false}if((!c)&&(!this.get("visible"))){a=false}return a},inReadyState:function(){var a=this.get("state");return((a===HistoryDatasetAssociation.STATES.NEW)||(a===HistoryDatasetAssociation.STATES.OK)||(a===HistoryDatasetAssociation.STATES.EMPTY)||(a===HistoryDatasetAssociation.STATES.FAILED_METADATA)||(a===HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(a===HistoryDatasetAssociation.STATES.DISCARDED)||(a===HistoryDatasetAssociation.STATES.ERROR))},hasData:function(){return(this.get("file_size")>0)},toString:function(){var a=this.get("id")||"";if(this.get("name")){a+=':"'+this.get("name")+'"'}return"HistoryDatasetAssociation("+a+")"}});HistoryDatasetAssociation.STATES={UPLOAD:"upload",QUEUED:"queued",RUNNING:"running",SETTING_METADATA:"setting_metadata",NEW:"new",OK:"ok",EMPTY:"empty",FAILED_METADATA:"failed_metadata",NOT_VIEWABLE:"noPermission",DISCARDED:"discarded",ERROR:"error"};var HDACollection=Backbone.Collection.extend(LoggableMixin).extend({model:HistoryDatasetAssociation,initialize:function(){},ids:function(){return this.map(function(a){return a.id})},getVisible:function(a,b){return this.filter(function(c){return c.isVisible(a,b)})},getStateLists:function(){var a={};_.each(_.values(HistoryDatasetAssociation.STATES),function(b){a[b]=[]});this.each(function(b){a[b.get("state")].push(b.get("id"))});return a},running:function(){var a=[];this.each(function(b){if(!b.inReadyState()){a.push(b.get("id"))}});return a},update:function(a){this.log(this+"update:",a);if(!(a&&a.length)){return}var b=this;_.each(a,function(e,c){var d=b.get(e);d.fetch()})},toString:function(){return("HDACollection("+this.ids().join(",")+")")}});var History=BaseModel.extend(LoggableMixin).extend({defaults:{id:"",name:"",state:"",show_deleted:false,show_hidden:false,diskSize:0,deleted:false,tags:[],annotation:null,message:null,quotaMsg:false},url:function(){return"api/histories/"+this.get("id")},initialize:function(a,b){this.log(this+".initialize:",a,b);this.hdas=new HDACollection();if(b&&b.length){this.hdas.reset(b);this.checkForUpdates()}},loadFromApi:function(a,c){var b=this;b.attributes.id=a;jQuery.when(jQuery.ajax("api/users/current"),b.fetch()).then(function(e,d){b.attributes.user=e[0];b.log(b)}).then(function(){jQuery.ajax(b.url()+"/contents?"+jQuery.param({ids:b.itemIdsFromStateIds().join(",")})).success(function(d){b.hdas.reset(d);b.checkForUpdates();c()})})},hdaIdsFromStateIds:function(){return _.reduce(_.values(this.get("state_ids")),function(b,a){return b.concat(a)})},checkForUpdates:function(a){if(this.hdas.running().length){this.stateUpdater()}return this},stateUpdater:function(){var c=this,a=this.get("state"),b=this.get("state_ids");jQuery.ajax("api/histories/"+this.get("id")).success(function(d){c.set(d);c.log("current history state:",c.get("state"),"(was)",a,"new size:",c.get("nice_size"));var e=[];_.each(_.keys(d.state_ids),function(g){var f=_.difference(d.state_ids[g],b[g]);e=e.concat(f)});if(e.length){c.hdas.update(e)}if((c.get("state")===HistoryDatasetAssociation.STATES.RUNNING)||(c.get("state")===HistoryDatasetAssociation.STATES.QUEUED)){setTimeout(function(){c.stateUpdater()},4000)}}).error(function(f,d,e){if(console&&console.warn){console.warn("Error getting history updates from the server:",f,d,e)}alert("Error getting history updates from the server.\n"+e)})},toString:function(){var a=(this.get("name"))?(","+this.get("name")):("");return"History("+this.get("id")+a+")"}});var HDAView=BaseView.extend(LoggableMixin).extend({tagName:"div",className:"historyItemContainer",initialize:function(a){this.log(this+".initialize:",a);if(!a.urlTemplates){throw ("HDAView needs urlTemplates on initialize")}this.urls=this.renderUrls(a.urlTemplates,this.model.toJSON());this.expanded=a.expanded||false;this.model.bind("change",this.render,this)},renderUrls:function(d,a){var b=this,c={};_.each(d,function(e,f){if(_.isObject(e)){c[f]=b.renderUrls(e,a)}else{if(f==="meta_download"){c[f]=b.renderMetaDownloadUrls(e,a)}else{c[f]=_.template(e,a)}}});return c},renderMetaDownloadUrls:function(b,a){return _.map(a.meta_files,function(c){return{url:_.template(b,{id:a.id,file_type:c.file_type}),file_type:c.file_type}})},render:function(){var b=this,e=this.model.get("id"),c=this.model.get("state"),a=$("<div/>").attr("id","historyItem-"+e),d=(this.$el.children().size()===0);this._clearReferences();this.$el.attr("id","historyItemContainer-"+e);a.addClass("historyItemWrapper").addClass("historyItem").addClass("historyItem-"+c);a.append(this._render_warnings());a.append(this._render_titleBar());this.body=$(this._render_body());a.append(this.body);make_popup_menus(a);a.find(".tooltip").tooltip({placement:"bottom"});this.$el.fadeOut("fast",function(){b.$el.children().remove();b.$el.append(a).fadeIn("fast",function(){b.log(b+" rendered:",b.$el);var f="rendered";if(d){f+=":initial"}else{if(b.model.inReadyState()){f+=":ready"}}b.trigger(f)})});return this},_clearReferences:function(){this.displayButton=null;this.editButton=null;this.deleteButton=null;this.errButton=null;this.showParamsButton=null;this.rerunButton=null;this.visualizationsButton=null;this.tagButton=null;this.annotateButton=null},_render_warnings:function(){return $(jQuery.trim(HDAView.templates.messages(_.extend(this.model.toJSON(),{urls:this.urls}))))},_render_titleBar:function(){var a=$('<div class="historyItemTitleBar" style="overflow: hidden"></div>');a.append(this._render_titleButtons());a.append('<span class="state-icon"></span>');a.append(this._render_titleLink());return a},_render_titleButtons:function(){var a=$('<div class="historyItemButtons"></div>');a.append(this._render_displayButton());a.append(this._render_editButton());a.append(this._render_deleteButton());return a},_render_displayButton:function(){if((!this.model.inReadyState())||(this.model.get("state")===HistoryDatasetAssociation.STATES.ERROR)||(this.model.get("state")===HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var a={icon_class:"display"};if(this.model.get("purged")){a.enabled=false;a.title="Cannot display datasets removed from disk"}else{a.title="Display data in browser";a.href=this.urls.display}if(this.model.get("for_editing")){a.target="galaxy_main"}this.displayButton=new IconButtonView({model:new IconButton(a)});return this.displayButton.render().$el},_render_editButton:function(){if((this.model.get("state")===HistoryDatasetAssociation.STATES.UPLOAD)||(this.model.get("state")===HistoryDatasetAssociation.STATES.ERROR)||(this.model.get("state")===HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))||(!this.model.get("for_editing"))){return null}var c=this.model.get("purged"),a=this.model.get("deleted"),b={title:"Edit attributes",href:this.urls.edit,target:"galaxy_main",icon_class:"edit"};if(a||c){b.enabled=false;if(c){b.title="Cannot edit attributes of datasets removed from disk"}else{if(a){b.title="Undelete dataset to edit attributes"}}}this.editButton=new IconButtonView({model:new IconButton(b)});return this.editButton.render().$el},_render_deleteButton:function(){if((!this.model.get("for_editing"))||(this.model.get("state")===HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var a={title:"Delete",href:this.urls["delete"],id:"historyItemDeleter-"+this.model.get("id"),icon_class:"delete"};if(this.model.get("deleted")||this.model.get("purged")){a={title:"Dataset is already deleted",icon_class:"delete",enabled:false}}this.deleteButton=new IconButtonView({model:new IconButton(a)});return this.deleteButton.render().$el},_render_titleLink:function(){return $(jQuery.trim(HDAView.templates.titleLink(_.extend(this.model.toJSON(),{urls:this.urls}))))},_render_hdaSummary:function(){var a=_.extend(this.model.toJSON(),{urls:this.urls});if(this.model.get("metadata_dbkey")==="?"&&!this.model.isDeletedOrPurged()){_.extend(a,{dbkey_unknown_and_editable:true})}return HDAView.templates.hdaSummary(a)},_render_primaryActionButtons:function(c){var b=$("<div/>").attr("id","primary-actions-"+this.model.get("id")),a=this;_.each(c,function(d){b.append(d.call(a))});return b},_render_downloadButton:function(){if(this.model.get("purged")){return null}var a=HDAView.templates.downloadLinks(_.extend(this.model.toJSON(),{urls:this.urls}));return $(a)},_render_errButton:function(){if((this.model.get("state")!==HistoryDatasetAssociation.STATES.ERROR)||(!this.model.get("for_editing"))){return null}this.errButton=new IconButtonView({model:new IconButton({title:"View or report this error",href:this.urls.report_error,target:"galaxy_main",icon_class:"bug"})});return this.errButton.render().$el},_render_showParamsButton:function(){this.showParamsButton=new IconButtonView({model:new IconButton({title:"View details",href:this.urls.show_params,target:"galaxy_main",icon_class:"information"})});return this.showParamsButton.render().$el},_render_rerunButton:function(){if(!this.model.get("for_editing")){return null}this.rerunButton=new IconButtonView({model:new IconButton({title:"Run this job again",href:this.urls.rerun,target:"galaxy_main",icon_class:"arrow-circle"})});return this.rerunButton.render().$el},_render_visualizationsButton:function(){var c=this.model.get("dbkey"),a=this.model.get("visualizations"),f=this.urls.visualization,d={},g={dataset_id:this.model.get("id"),hda_ldda:"hda"};if(!(this.model.hasData())||!(this.model.get("for_editing"))||!(a&&a.length)||!(f)){return null}this.visualizationsButton=new IconButtonView({model:new IconButton({title:"Visualize",href:f,icon_class:"chart_curve"})});var b=this.visualizationsButton.render().$el;b.addClass("visualize-icon");if(c){g.dbkey=c}function e(h){switch(h){case"trackster":return create_trackster_action_fn(f,g,c);case"scatterplot":return create_scatterplot_action_fn(f,g);default:return function(){window.parent.location=f+"/"+h+"?"+$.param(g)}}}if(a.length===1){b.attr("title",a[0]);b.click(e(a[0]))}else{_.each(a,function(i){var h=i.charAt(0).toUpperCase()+i.slice(1);d[h]=e(i)});make_popupmenu(b,d)}return b},_render_secondaryActionButtons:function(b){var c=$("<div/>"),a=this;c.attr("style","float: right;").attr("id","secondary-actions-"+this.model.get("id"));_.each(b,function(d){c.append(d.call(a))});return c},_render_tagButton:function(){if(!(this.model.hasData())||!(this.model.get("for_editing"))||(!this.urls.tags.get)){return null}this.tagButton=new IconButtonView({model:new IconButton({title:"Edit dataset tags",target:"galaxy_main",href:this.urls.tags.get,icon_class:"tags"})});return this.tagButton.render().$el},_render_annotateButton:function(){if(!(this.model.hasData())||!(this.model.get("for_editing"))||(!this.urls.annotation.get)){return null}this.annotateButton=new IconButtonView({model:new IconButton({title:"Edit dataset annotation",target:"galaxy_main",icon_class:"annotate"})});return this.annotateButton.render().$el},_render_displayApps:function(){if(!this.model.hasData()){return null}var a=$("<div/>").addClass("display-apps");if(!_.isEmpty(this.model.get("display_types"))){a.append(HDAView.templates.displayApps({displayApps:this.model.get("display_types")}))}if(!_.isEmpty(this.model.get("display_apps"))){a.append(HDAView.templates.displayApps({displayApps:this.model.get("display_apps")}))}return a},_render_tagArea:function(){if(!this.urls.tags.set){return null}return $(HDAView.templates.tagArea(_.extend(this.model.toJSON(),{urls:this.urls})))},_render_annotationArea:function(){if(!this.urls.annotation.get){return null}return $(HDAView.templates.annotationArea(_.extend(this.model.toJSON(),{urls:this.urls})))},_render_peek:function(){if(!this.model.get("peek")){return null}return $("<div/>").append($("<pre/>").attr("id","peek"+this.model.get("id")).addClass("peek").append(this.model.get("peek")))},_render_body_not_viewable:function(a){a.append($("<div>You do not have permission to view dataset.</div>"))},_render_body_uploading:function(a){a.append($("<div>Dataset is uploading</div>"))},_render_body_queued:function(a){a.append($("<div>Job is waiting to run.</div>"));a.append(this._render_primaryActionButtons([this._render_showParamsButton,this._render_rerunButton]))},_render_body_running:function(a){a.append("<div>Job is currently running.</div>");a.append(this._render_primaryActionButtons([this._render_showParamsButton,this._render_rerunButton]))},_render_body_error:function(a){if(!this.model.get("purged")){a.append($("<div>"+this.model.get("misc_blurb")+"</div>"))}a.append(("An error occurred running this job: <i>"+$.trim(this.model.get("misc_info"))+"</i>"));a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_errButton,this._render_showParamsButton,this._render_rerunButton]))},_render_body_discarded:function(a){a.append("<div>The job creating this dataset was cancelled before completion.</div>");a.append(this._render_primaryActionButtons([this._render_showParamsButton,this._render_rerunButton]))},_render_body_setting_metadata:function(a){a.append($("<div>Metadata is being auto-detected.</div>"))},_render_body_empty:function(a){a.append($("<div>No data: <i>"+this.model.get("misc_blurb")+"</i></div>"));a.append(this._render_primaryActionButtons([this._render_showParamsButton,this._render_rerunButton]))},_render_body_failed_metadata:function(a){a.append($(HDAView.templates.failedMetadata(this.model.toJSON())));this._render_body_ok(a)},_render_body_ok:function(a){a.append(this._render_hdaSummary());if(this.model.isDeletedOrPurged()){a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_showParamsButton,this._render_rerunButton]));return}a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_errButton,this._render_showParamsButton,this._render_rerunButton,this._render_visualizationsButton]));a.append(this._render_secondaryActionButtons([this._render_tagButton,this._render_annotateButton]));a.append('<div class="clear"/>');a.append(this._render_tagArea());a.append(this._render_annotationArea());a.append(this._render_displayApps());a.append(this._rende
                    
                
EquipmentCollection.js https://bitbucket.org/chepdev/better-portfolio-new-skills-workshop.git | JavaScript | 79 lines
                    
8  ], function(_, Backbone, EquipmentModel){
                    
9    var EquipmentCollection = Backbone.Collection.extend({
                    
10      model: EquipmentModel
                    
                
Collections.js https://bitbucket.org/farmas/hangman.git | JavaScript | 31 lines
                    
2
                    
3    ns.Challenges = Backbone.Collection.extend({
                    
4        model: ns.Challenge,
                    
20
                    
21    ns.ChallengeResults = Backbone.Collection.extend({
                    
22        model: ns.ChallengeResult,
                    
                
history-model.js https://bitbucket.org/andreyto/mgtaxa-galaxy | JavaScript | 229 lines
                    
213 */
                    
214var HistoryCollection = Backbone.Collection.extend( LoggableMixin ).extend(
                    
215/** @lends HistoryCollection.prototype */{
                    
                
Participant.js https://bitbucket.org/taxilian/racecontrol5.git | JavaScript | 565 lines
                    
377
                    
378    Participants = Backbone.Collection.extend({
                    
379        model: Participant,
                    
                
data.js https://bitbucket.org/cistrome/cistrome-harvard/ | JavaScript | 1 lines
                    
1define(["mvc/ui/ui-modal","mvc/ui/ui-frames"],function(j,i){var g=Backbone.Model.extend({});var b=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var m=new g();_.each(_.keys(this.attributes),function(n){if(n.indexOf("metadata_")===0){var o=n.split("metadata_")[1];m.set(o,this.attributes[n]);delete this.attributes[n]}},this);this.set("metadata",m,{silent:true})},get_metadata:function(m){return this.attributes.metadata.get(m)},urlRoot:galaxy_config.root+"api/datasets"});var h=b.extend({defaults:_.extend({},b.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(m){b.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var m=this,n=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:m.attributes.chunk_index++}).success(function(o){var p;if(o.ck_data!==""){p=o}else{m.attributes.at_eof=true;p=null}n.resolve(p)});return n}});var e=Backbone.Collection.extend({model:b});var a=Backbone.View.extend({initialize:function(m){this.row_count=0;this.header_color="#AAA";this.dark_row_color="#DDD";new d({model:m.model,$el:this.$el})},render:function(){var q=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(q);var m=this.model.get_metadata("column_names"),r=$("<tr/>").css("background-color",this.header_color).appendTo(q);if(m){r.append("<th>"+m.join("</th><th>")+"</th>")}var o=this.model.get("first_data_chunk");if(o){this._renderChunk(o)}var n=this,p=false;this.scroll_elt.scroll(function(){if(!p&&n.scrolled_to_bottom()){p=true;$.when(n.model.get_next_chunk()).then(function(s){if(s){n._renderChunk(s);p=false}})}});$("#loading_indicator").ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()})},scrolled_to_bottom:function(){return false},_renderCell:function(p,m,q){var n=$("<td>").text(p);var o=this.model.get_metadata("column_types");if(q!==undefined){n.attr("colspan",q).addClass("stringalign")}else{if(o){if(m<o.length){if(o[m]==="str"||o[m]==="list"){n.addClass("stringalign")}}}}return n},_renderRow:function(m){var n=m.split("\t"),p=$("<tr>"),o=this.model.get_metadata("columns");if(this.row_count%2!==0){p.css("background-color",this.dark_row_color)}if(n.length===o){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this)}else{if(n.length>o){_.each(n.slice(0,o-1),function(r,q){p.append(this._renderCell(r,q))},this);p.append(this._renderCell(n.slice(o-1).join("\t"),o-1))}else{if(o>5&&n.length===o-1){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this);p.append($("<td>"))}else{p.append(this._renderCell(m,0,o))}}}this.row_count++;return p},_renderChunk:function(m){var n=this.$el.find("table");_.each(m.ck_data.split("\n"),function(o,p){n.append(this._renderRow(o))},this)}});var f=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);scroll_elt=_.find(this.$el.parents(),function(n){return $(n).css("overflow")==="auto"});if(!scroll_elt){scroll_elt=window}this.scroll_elt=$(scroll_elt)},scrolled_to_bottom:function(){return(this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0)}});var l=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:this.options.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}});var d=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(o){var r=parent.Galaxy;if(r&&r.modal){this.modal=r.modal}if(r&&r.frame){this.frame=r.frame}if(!this.modal||!this.frame){return}var n=o.model;var q=n.get("metadata");if(!n.get("data_type")){return}this.data_type=n.get("data_type");if(this.data_type=="bed"){if(q.get("chromCol")&&q.get("startCol")&&q.get("endCol")){this.col.chrom=q.get("chromCol")-1;this.col.start=q.get("startCol")-1;this.col.end=q.get("endCol")-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.");return}}if(this.data_type=="vcf"){function p(t,u){for(var s=0;s<u.length;s++){if(u[s].match(t)){return s}}return -1}this.col.chrom=p("Chrom",q.get("column_names"));this.col.start=p("Pos",q.get("column_names"));this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.");return}}if(this.col.chrom===undefined){return}if(n.id){this.dataset_id=n.id}else{console.log("TabularButtonTrackster : Dataset identification is missing.");return}if(n.get("url_viz")){this.url_viz=n.get("url_viz")}else{console.log("TabularButtonTrackster : Url for visualization controller is missing.");return}if(n.get("genome_build")){this.genome_build=n.get("genome_build")}var m=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.setElement(o.$el);this.$el.append(m.render().$el);this.hide()},events:{"mouseover tr":"show",mouseleave:"hide"},show:function(r){function q(w){return !isNaN(parseFloat(w))&&isFinite(w)}if(this.col.chrom===null){return}var v=$(r.target).parent();var s=v.children().eq(this.col.chrom).html();var m=v.children().eq(this.col.start).html();var o=this.col.end?v.children().eq(this.col.end).html():m;if(!s.match("^#")&&s!==""&&q(m)){var u={dataset_id:this.dataset_id,gene_region:s+":"+m+"-"+o};var p=v.offset();var n=p.left-10;var t=p.top-$(window).scrollTop()+3;$("#btn_viz").css({position:"fixed",top:t+"px",left:n+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,u,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},hide:function(){this.$el.find("#btn_viz").hide()},create_trackster_action:function(m,p,o){var n=this;return function(){var q={};if(o){q["f-dbkey"]=o}$.ajax({url:m+"/list_tracks?"+$.param(q),dataType:"html",error:function(){n.modal.show({title:"Something went wrong!",body:"Unfortunately we could not add this dataset to the track browser. Please try again or contact us.",buttons:{Cancel:function(){n.modal.hide()}}})},success:function(r){n.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.modal.hide()},"View in saved visualization":function(){n.modal.show({title:"Add Data to Saved Visualization",body:r,buttons:{Cancel:function(){n.modal.hide()},"Add to visualization":function(){n.modal.hide();n.modal.$el.find("input[name=id]:checked").each(function(){var s=$(this).val();p.id=s;n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})})}}})},"View in new visualization":function(){n.modal.hide();n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})}}})}});return false}}});var k=function(p,n,q,m){var o=new n({model:new p(q)});o.render();if(m){m.append(o.$el)}return o};var c=function(o){o.model=new h(o.dataset_config);var n=o.parent_elt;var p=o.embedded;delete o.embedded;delete o.parent_elt;delete o.dataset_config;var m=(p?new l(o):new f(o));m.render();if(n){n.append(m.$el)}return m};return{Dataset:b,TabularDataset:h,DatasetCollection:e,TabularDatasetChunkedView:a,createTabularDatasetChunkedView:c}});
                    
                
customize-models.min.js https://bitbucket.org/AFelipeTrujillo/goblog | JavaScript | 1 lines
                    
1!function(a,b){var c=b.customize;c.HeaderTool={},c.HeaderTool.ImageModel=Backbone.Model.extend({defaults:function(){return{header:{attachment_id:0,url:"",timestamp:_.now(),thumbnail_url:""},choice:"",selected:!1,random:!1}},initialize:function(){this.on("hide",this.hide,this)},hide:function(){this.set("choice",""),c("header_image").set("remove-header"),c("header_image_data").set("remove-header")},destroy:function(){var a=this.get("header"),d=c.HeaderTool.currentHeader.get("header").attachment_id;d&&a.attachment_id===d&&c.HeaderTool.currentHeader.trigger("hide"),b.ajax.post("custom-header-remove",{nonce:_wpCustomizeHeader.nonces.remove,wp_customize:"on",theme:c.settings.theme.stylesheet,attachment_id:a.attachment_id}),this.trigger("destroy",this,this.collection)},save:function(){this.get("random")?(c("header_image").set(this.get("header").random),c("header_image_data").set(this.get("header").random)):this.get("header").defaultName?(c("header_image").set(this.get("header").url),c("header_image_data").set(this.get("header").defaultName)):(c("header_image").set(this.get("header").url),c("header_image_data").set(this.get("header"))),c.HeaderTool.combinedList.trigger("control:setImage",this)},importImage:function(){var a=this.get("header");void 0!==a.attachment_id&&b.ajax.post("custom-header-add",{nonce:_wpCustomizeHeader.nonces.add,wp_customize:"on",theme:c.settings.theme.stylesheet,attachment_id:a.attachment_id})},shouldBeCropped:function(){return this.get("themeFlexWidth")===!0&&this.get("themeFlexHeight")===!0?!1:this.get("themeFlexWidth")===!0&&this.get("themeHeight")===this.get("imageHeight")?!1:this.get("themeFlexHeight")===!0&&this.get("themeWidth")===this.get("imageWidth")?!1:this.get("themeWidth")===this.get("imageWidth")&&this.get("themeHeight")===this.get("imageHeight")?!1:!0}}),c.HeaderTool.ChoiceList=Backbone.Collection.extend({model:c.HeaderTool.ImageModel,comparator:function(a){return-a.get("header").timestamp},initialize:function(){var a=c.HeaderTool.currentHeader.get("choice").replace(/^https?:\/\//,""),b=this.isRandomChoice(c.get().header_image);this.type||(this.type="uploaded"),"undefined"==typeof this.data&&(this.data=_wpCustomizeHeader.uploads),b&&(a=c.get().header_image),this.on("control:setImage",this.setImage,this),this.on("control:removeImage",this.removeImage,this),this.on("add",this.maybeAddRandomChoice,this),_.each(this.data,function(b,c){b.attachment_id||(b.defaultName=c),"undefined"==typeof b.timestamp&&(b.timestamp=0),this.add({header:b,choice:b.url.split("/").pop(),selected:a===b.url.replace(/^https?:\/\//,"")},{silent:!0})},this),this.size()>0&&this.addRandomChoice(a)},maybeAddRandomChoice:function(){1===this.size()&&this.addRandomChoice()},addRandomChoice:function(a){var b=RegExp(this.type).test(a),c="random-"+this.type+"-image";this.add({header:{timestamp:0,random:c,width:245,height:41},choice:c,random:!0,selected:b})},isRandomChoice:function(a){return/^random-(uploaded|default)-image$/.test(a)},shouldHideTitle:function(){return this.size()<2},setImage:function(a){this.each(function(a){a.set("selected",!1)}),a&&a.set("selected",!0)},removeImage:function(){this.each(function(a){a.set("selected",!1)})}}),c.HeaderTool.DefaultsList=c.HeaderTool.ChoiceList.extend({initialize:function(){this.type="default",this.data=_wpCustomizeHeader.defaults,c.HeaderTool.ChoiceList.prototype.initialize.apply(this)}})}(jQuery,window.wp);
                    
                
theme.min.js https://bitbucket.org/cubeee/wp-fin.git | JavaScript | 1 lines
                    
1window.wp=window.wp||{},function(a){var b,c;b=wp.themes=wp.themes||{},b.data=_wpThemeSettings,c=b.data.l10n,_.extend(b,{model:{},view:{},routes:{},router:{},template:wp.template}),b.model=Backbone.Model.extend({}),b.view.Appearance=wp.Backbone.View.extend({el:"#wpbody-content .wrap .theme-browser",window:a(window),page:0,initialize:function(){_.bindAll(this,"scroller"),this.window.bind("scroll",_.throttle(this.scroller,300))},render:function(){this.view=new b.view.Themes({collection:this.collection,parent:this}),this.search(),this.view.render(),this.$el.empty().append(this.view.el).addClass("rendered"),this.$el.append('<br class="clear"/>')},search:function(){var d,e=this;1!==b.data.themes.length&&(d=new b.view.Search({collection:e.collection}),d.render(),a("#wpbody h2:first").append(a.parseHTML('<label class="screen-reader-text" for="theme-search-input">'+c.search+"</label>")).append(d.el))},scroller:function(){var a,b,c=this;a=this.window.scrollTop()+c.window.height(),b=c.$el.offset().top+c.$el.outerHeight(!1)-c.window.height(),b=Math.round(.9*b),a>b&&this.trigger("theme:scroll")}}),b.Collection=Backbone.Collection.extend({model:b.model,terms:"",doSearch:function(a){this.terms!==a&&(this.terms=a,this.terms.length>0&&this.search(this.terms),""===this.terms&&this.reset(b.data.themes),this.trigger("update"))},search:function(a){var c,d,e;this.reset(b.data.themes,{silent:!0}),a=a.replace(" ",")(?=.*"),c=new RegExp("^(?=.*"+a+").+","i"),d=this.filter(function(b){return e=_.union(b.get("name"),b.get("description"),b.get("author"),b.get("tags")),c.test(b.get("author"))&&a.length>2&&b.set("displayAuthor",!0),c.test(e)}),this.reset(d)},paginate:function(a){var b=this;return a=a||0,b=_(b.rest(15*a)),b=_(b.first(15))}}),b.view.Theme=wp.Backbone.View.extend({className:"theme",state:"grid",html:b.template("theme"),events:{click:"expand",touchend:"expand",touchmove:"preventExpand"},touchDrag:!1,render:function(){var a=this.model.toJSON();this.$el.html(this.html(a)),this.activeTheme(),this.model.get("displayAuthor")&&this.$el.addClass("display-author")},activeTheme:function(){this.model.get("active")&&this.$el.addClass("active")},expand:function(b){var c=this;return this.touchDrag===!0?this.touchDrag=!1:(b=b||window.event,a(b.target).is(".theme-actions a")||this.trigger("theme:expand",c.model.cid),void 0)},preventExpand:function(){this.touchDrag=!0}}),b.view.Details=wp.Backbone.View.extend({className:"theme-overlay",events:{click:"collapse","click .delete-theme":"deleteTheme","click .left":"previousTheme","click .right":"nextTheme"},html:b.template("theme-single"),render:function(){var a=this.model.toJSON();this.$el.html(this.html(a)),this.activeTheme(),this.navigation(),this.screenshotCheck(this.$el)},activeTheme:function(){this.$el.toggleClass("active",this.model.get("active"))},collapse:function(c){var d,e=this;c=c||window.event,1!==b.data.themes.length&&(a(c.target).is(".theme-backdrop")||a(c.target).is("div.close")||27===c.keyCode)&&(a("body").addClass("closing-overlay"),this.$el.fadeOut(130,function(){a("body").removeClass("theme-overlay-open closing-overlay"),e.closeOverlay(),d=document.body.scrollTop,b.router.navigate(b.router.baseUrl(""),{replace:!0}),document.body.scrollTop=d}))},navigation:function(){this.model.cid===this.model.collection.at(0).cid&&this.$el.find(".left").addClass("disabled"),this.model.cid===this.model.collection.at(this.model.collection.length-1).cid&&this.$el.find(".right").addClass("disabled")},closeOverlay:function(){this.remove(),this.unbind(),this.trigger("theme:collapse")},deleteTheme:function(){return confirm(b.data.settings.confirmDelete)},nextTheme:function(){var a=this;a.trigger("theme:next",a.model.cid)},previousTheme:function(){var a=this;a.trigger("theme:previous",a.model.cid)},screenshotCheck:function(a){var b,c;b=a.find(".screenshot img"),c=new Image,c.src=b.attr("src"),c.width&&c.width<=300&&a.addClass("small-screenshot")}}),b.view.Themes=wp.Backbone.View.extend({className:"themes",$overlay:a("div.theme-overlay"),index:0,count:a(".theme-count"),initialize:function(b){var c=this;this.parent=b.parent,this.setView("grid"),c.currentTheme(),this.listenTo(c.collection,"update",function(){c.parent.page=0,c.currentTheme(),c.render(this)}),this.listenTo(this.parent,"theme:scroll",function(){c.renderThemes(c.parent.page)}),a("body").on("keyup",function(a){c.overlay&&(39===a.keyCode&&c.overlay.nextTheme(),37===a.keyCode&&c.overlay.previousTheme(),27===a.keyCode&&c.overlay.collapse(a))})},render:function(){this.$el.html(""),1===b.data.themes.length&&(this.singleTheme=new b.view.Details({model:this.collection.models[0]}),this.singleTheme.render(),this.$el.addClass("single-theme"),this.$el.append(this.singleTheme.el)),this.renderThemes(this.parent.page),this.count.text(this.collection.length)},renderThemes:function(d){var e=this;e.instance=e.collection.paginate(d),0!==e.instance.length&&(d>=1&&a(".add-new-theme").remove(),e.instance.each(function(a){e.theme=new b.view.Theme({model:a}),e.theme.render(),e.$el.append(e.theme.el),e.listenTo(e.theme,"theme:expand",e.expand,e)}),b.data.settings.canInstall&&this.$el.append('<div class="theme add-new-theme"><a href="'+b.data.settings.installURI+'"><div class="theme-screenshot"><span></span></div><h3 class="theme-name">'+c.addNew+"</h3></a></div>"),this.parent.page++)},currentTheme:function(){var a,b=this;a=b.collection.findWhere({active:!0}),a&&(b.collection.remove(a),b.collection.add(a,{at:0}))},setView:function(a){return a},expand:function(c){var d=this;this.model=d.collection.get(c),b.router.navigate(b.router.baseUrl("?theme="+this.model.id),{replace:!0}),this.setView("detail"),a("body").addClass("theme-overlay-open"),this.overlay=new b.view.Details({model:d.model}),this.overlay.render(),this.$overlay.html(this.overlay.el),this.listenTo(this.overlay,"theme:next",function(){d.next([d.model.cid])}).listenTo(this.overlay,"theme:previous",function(){d.previous([d.model.cid])})},next:function(a){var b,c,d=this;b=d.collection.get(a[0]),c=d.collection.at(d.collection.indexOf(b)+1),void 0!==c&&(this.overlay.closeOverlay(),d.theme.trigger("theme:expand",c.cid))},previous:function(a){var b,c,d=this;b=d.collection.get(a[0]),c=d.collection.at(d.collection.indexOf(b)-1),void 0!==c&&(this.overlay.closeOverlay(),d.theme.trigger("theme:expand",c.cid))}}),b.view.Search=wp.Backbone.View.extend({tagName:"input",className:"theme-search",attributes:{placeholder:c.searchPlaceholder,type:"search"},events:{input:"search",keyup:"search",change:"search",search:"search"},search:function(a){"keyup"===a.type&&27===a.which&&(a.target.value=""),this.collection.doSearch(a.target.value),a.target.value?b.router.navigate(b.router.baseUrl("?search="+a.target.value),{replace:!0}):b.router.navigate(b.router.baseUrl(""),{replace:!0})}}),b.routes=Backbone.Router.extend({initialize:function(){this.routes=_.object([])},baseUrl:function(a){return b.data.settings.root+a}}),b.Run={init:function(){this.themes=new b.Collection(b.data.themes),this.view=new b.view.Appearance({collection:this.themes}),this.render()},render:function(){this.view.render(),this.routes(),"undefined"!=typeof b.data.settings.theme&&""!==b.data.settings.theme&&this.view.view.theme.trigger("theme:expand",this.view.collection.findWhere({id:b.data.settings.theme})),"undefined"!=typeof b.data.settings.search&&""!==b.data.settings.search&&(a(".theme-search").val(b.data.settings.search),this.themes.doSearch(b.data.settings.search)),window.history&&window.history.pushState&&Backbone.history.start({pushState:!0,silent:!0})},routes:function(){b.router=new b.routes}},jQuery(document).ready(_.bind(b.Run.init,b.Run))}(jQuery);var tb_position;jQuery(document).ready(function(a){tb_position=function(){var b=a("#TB_window"),c=a(window).width(),d=a(window).height(),e=c>1040?1040:c,f=0;a("body.admin-bar").length&&(f=parseInt(jQuery("#wpadminbar").css("height"),10)),b.size()&&(b.width(e-50).height(d-45-f),a("#TB_iframeContent").width(e-50).height(d-75-f),b.css({"margin-left":"-"+parseInt((e-50)/2,10)+"px"}),"undefined"!=typeof document.body.style.maxWidth&&b.css({top:20+f+"px","margin-top":"0"}))},a(window).resize(function(){tb_position()})});
                    
                
UserCollection.js https://bitbucket.org/chepdev/better-portfolio-new-skills-workshop.git | JavaScript | 53 lines
                    
6  ], function(_, Backbone, UserModel){
                    
7    var UserCollection = Backbone.Collection.extend({
                    
8      model: UserModel
                    
                
collectionViewTests.js git://github.com/reviewboard/reviewboard.git | JavaScript | 165 lines
                    
14
                    
15    TestCollection = Backbone.Collection.extend({
                    
16        model: TestModel
                    
                
demo.js http://jquery-ui-map.googlecode.com/svn/trunk/ | JavaScript | 34 lines
                    
14				$('#forum').append('<h2>Forum</h2><ul id="forum_posts"></ul><h2>Subscribe</h2><form id="forum_subscribe" class="subscribe" action="#"><label for="email">E-mail:</label><input id="email" type="text" name="email" /><input type="submit" name="sub" value="Subscribe" /></form>');
                    
15				ForumCollection = Backbone.Collection.extend({ 'url': 'http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&callback=?&q={0}'.format(encodeURIComponent(demo.forum)), 'parse': function(response) { return response.responseData.feed.entries; } });
                    
16				ForumPost = Backbone.View.extend({ 'tagName': 'li', 'className': 'group-item', 'template': _.template('<a href="<%=link%>"><%=title%></a></h3>'), 'render': function() { $(this.el).html(this.template(this.model.toJSON())); return this; } }); 
                    
                
whitelist.js git://github.com/mitreid-connect/OpenID-Connect-Java-Spring-Server.git | JavaScript | 596 lines
                    
28
                    
29var WhiteListCollection = Backbone.Collection.extend({
                    
30	initialize: function() {
                    
                
models.js https://github.com/JeromeParadis/live-notify.git | JavaScript | 157 lines
                    
50
                    
51    models.Events = Backbone.Collection.extend({
                    
52        model: models.Event
                    
147
                    
148    models.EventThreads = Backbone.Collection.extend({
                    
149        model: models.EventThread,
                    
                
 

Source

Language