PageRenderTime 752ms queryTime 83ms sortTime 1ms getByIdsTime 247ms findMatchingLines 284ms

100+ results results for 'Backbone.Collection.extend repo:lutashi/node12306' (752 ms)

Not the results you expected?
wsperf_commander.html https://gitlab.com/vectorci/rippled | HTML | 387 lines
                    
126  
                    
127    window.ServerList = Backbone.Collection.extend({
                    
128        model: Server,
                    
                
course-lesson.js https://gitlab.com/gregtyka/lfmawordpress | JavaScript | 202 lines
                    
123	});
                    
124	$.LP_Course_Item.Collection = Backbone.Collection.extend({
                    
125		model     : $.LP_Course_Item.Model,
                    
                
whitelist.js https://gitlab.com/jslee1/OpenID-Connect-Java-Spring-Server | JavaScript | 421 lines
                    
26
                    
27var WhiteListCollection = Backbone.Collection.extend({
                    
28	initialize: function() {
                    
                
grant.js https://gitlab.com/jslee1/OpenID-Connect-Java-Spring-Server | JavaScript | 275 lines
                    
25
                    
26var ApprovedSiteCollection = Backbone.Collection.extend({
                    
27	initialize: function() { },
                    
                
todos.js https://gitlab.com/Rockyspade/backbone | JavaScript | 234 lines
                    
35  // server.
                    
36  var TodoList = Backbone.Collection.extend({
                    
37
                    
                
media-models.js https://gitlab.com/Gashler/dp | JavaScript | 862 lines
                    
273	 */
                    
274	Attachments = media.model.Attachments = Backbone.Collection.extend({
                    
275		model: Attachment,
                    
                
flickrbomb.js https://gitlab.com/Mirros/jsdelivr | JavaScript | 419 lines
                    
178
                    
179        FlickrImages = Backbone.Collection.extend({
                    
180            sync: localSync,
                    
                
backbone.paginator.js https://gitlab.com/Mirros/jsdelivr | JavaScript | 1050 lines
                    
24  //
                    
25  Paginator.clientPager = Backbone.Collection.extend({
                    
26
                    
                
revisions.js https://gitlab.com/Blueprint-Marketing/wordpress-unit-tests | JavaScript | 974 lines
                    
155
                    
156	revisions.model.Revisions = Backbone.Collection.extend({
                    
157		model: revisions.model.Revision,
                    
179
                    
180	revisions.model.Fields = Backbone.Collection.extend({
                    
181		model: revisions.model.Field
                    
192
                    
193	revisions.model.Diffs = Backbone.Collection.extend({
                    
194		initialize: function( models, options ) {
                    
                
theme.js https://gitlab.com/Blueprint-Marketing/WordPress-1 | JavaScript | 787 lines
                    
95// @has 'id' 'name' 'screenshot' 'author' 'authorURI' 'version' 'active' ...
                    
96themes.Collection = Backbone.Collection.extend({
                    
97
                    
                
LookupEditView.js https://gitlab.com/Blueprint-Marketing/lookup-editor | JavaScript | 1434 lines
                    
65	
                    
66	var Backups = Backbone.Collection.extend({
                    
67	    url: Splunk.util.make_full_url("/custom/lookup_editor/lookup_edit/get_lookup_backups_list"),
                    
                
backbone-pageable.js https://gitlab.com/Blueprint-Marketing/cdnjs | JavaScript | 1353 lines
                    
127  */
                    
128  var PageableCollection = Backbone.PageableCollection = Backbone.Collection.extend({
                    
129
                    
364
                    
365      var fullCollection = new (Backbone.Collection.extend(proto))(models, options);
                    
366
                    
                
backbone-pageable.js https://gitlab.com/Blueprint-Marketing/cdnjs | JavaScript | 1293 lines
                    
131  */
                    
132  var PageableCollection = Backbone.Collection.extend({
                    
133
                    
362
                    
363      var fullCollection = new (Backbone.Collection.extend(proto))(models, options);
                    
364
                    
                
editor.js https://gitlab.com/webkod3r/tripolis | JavaScript | 477 lines
                    
26    // Selected Element collection, it act as array for all selected elements
                    
27    Editor.SelectedElements = Backbone.Collection.extend(
                    
28        {
                    
                
revisions.js https://gitlab.com/webkod3r/tripolis | JavaScript | 1166 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 ) {
                    
                
customize-widgets.js https://gitlab.com/webkod3r/tripolis | JavaScript | 1694 lines
                    
51	 */
                    
52	api.Widgets.WidgetCollection = Backbone.Collection.extend({
                    
53		model: api.Widgets.WidgetModel,
                    
130	 */
                    
131	api.Widgets.SidebarCollection = Backbone.Collection.extend({
                    
132		model: api.Widgets.SidebarModel
                    
                
customize-nav-menus.js https://gitlab.com/webkod3r/tripolis | JavaScript | 1625 lines
                    
66	 */
                    
67	api.Menus.AvailableItemCollection = Backbone.Collection.extend({
                    
68		model: api.Menus.AvailableItemModel,
                    
                
model.js https://gitlab.com/pidlisnyi/lisbon | JavaScript | 1413 lines
                    
3  var ProxyModel = Backbone.Model.extend();
                    
4  var Klass = Backbone.Collection.extend({
                    
5    url: function() { return '/collection'; }
                    
378
                    
379    var Collection = Backbone.Collection.extend({
                    
380      model: Model
                    
                
collection.js https://gitlab.com/pidlisnyi/lisbon | JavaScript | 1477 lines
                    
48    assert.expect(3);
                    
49    var Collection = Backbone.Collection.extend({
                    
50      parse: function(data) {
                    
209    assert.expect(1);
                    
210    var Col = Backbone.Collection.extend({
                    
211      comparator: function(m1, m2) {
                    
292
                    
293    var Col = Backbone.Collection.extend({model: Model});
                    
294    var collection = new Col;
                    
                
covers.js https://gitlab.com/wilane/Booktype | JavaScript | 410 lines
                    
50
                    
51    var CoverCollection = Backbone.Collection.extend({
                    
52      model: CoverItem
                    
                
composer-automapper.js https://gitlab.com/juanito.abelo/nlmobile | JavaScript | 598 lines
                    
128  });
                    
129  var ShortcodesCollection = Backbone.Collection.extend({
                    
130    model: ShortcodeModel,
                    
                
shortcode-ui.js https://gitlab.com/level-level/gravityforms | JavaScript | 762 lines
                    
31     */
                    
32    sui.models.ShortcodeAttributes = Backbone.Collection.extend({
                    
33        model: sui.models.ShortcodeAttribute,
                    
154    // Shortcode Collection
                    
155    sui.collections.Shortcodes = Backbone.Collection.extend({
                    
156        model: sui.models.Shortcode
                    
                
search_view.js https://gitlab.com/thanhchatvn/cloud-odoo | JavaScript | 960 lines
                    
18
                    
19var FacetValues = Backbone.Collection.extend({
                    
20    model: FacetValue
                    
60
                    
61var SearchQuery = Backbone.Collection.extend({
                    
62    model: Facet,
                    
                
model.js https://gitlab.com/Rockyspade/grunt-bower-concat | JavaScript | 1073 lines
                    
3  var proxy = Backbone.Model.extend();
                    
4  var klass = Backbone.Collection.extend({
                    
5    url : function() { return '/collection'; }
                    
                
collection.js https://gitlab.com/Rockyspade/grunt-bower-concat | JavaScript | 1016 lines
                    
50  test("new and parse", 3, function() {
                    
51    var Collection = Backbone.Collection.extend({
                    
52      parse : function(data) {
                    
83
                    
84    var Col2 = Backbone.Collection.extend({ model: MongoModel });
                    
85    var col2 = new Col2();
                    
151  test("add; at should have preference over comparator", 1, function() {
                    
152    var Col = Backbone.Collection.extend({
                    
153      comparator: function(a,b) {
                    
222
                    
223    var Col = Backbone.Collection.extend({model: Model});
                    
224    var col = new Col;
                    
427    });
                    
428    var ValidatingCollection = Backbone.Collection.extend({
                    
429      model: ValidatingModel
                    
                
model.js https://gitlab.com/Rockyspade/backbone | JavaScript | 1312 lines
                    
3  var proxy = Backbone.Model.extend();
                    
4  var klass = Backbone.Collection.extend({
                    
5    url : function() { return '/collection'; }
                    
356
                    
357    var Collection = Backbone.Collection.extend({
                    
358      model: Model
                    
                
collection.js https://gitlab.com/Rockyspade/backbone | JavaScript | 1601 lines
                    
45  test("new and parse", 3, function() {
                    
46    var Collection = Backbone.Collection.extend({
                    
47      parse : function(data) {
                    
177  test("add; at should have preference over comparator", 1, function() {
                    
178    var Col = Backbone.Collection.extend({
                    
179      comparator: function(a,b) {
                    
248
                    
249    var Col = Backbone.Collection.extend({model: Model});
                    
250    var col = new Col;
                    
                
todos.html https://gitlab.com/Rockyspade/backbone | 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            
                    
                
configs.js https://gitlab.com/dannywillems/laverna | JavaScript | 153 lines
                    
10
                    
11    var Configs = Backbone.Collection.extend({
                    
12
                    
                
ArchivosIntranet.js https://gitlab.com/Alberto.SS/crm_verquet | JavaScript | 321 lines
                    
44//Colecciones
                    
45var ArchivosIntranetCollection = Backbone.Collection.extend({
                    
46	model: ArchivoIntranet,
                    
58
                    
59var TiposArchivoIntranetCollection = Backbone.Collection.extend({
                    
60	model: TipoArchivoIntranet,
                    
                
model.js https://gitlab.com/jslee1/pump.io | JavaScript | 980 lines
                    
280
                    
281    Pump.Items = Backbone.Collection.extend({
                    
282        constructor: function(models, options) {
                    
                
policy.js https://gitlab.com/jslee1/OpenID-Connect-Java-Spring-Server | JavaScript | 649 lines
                    
21
                    
22var ResourceSetCollection = Backbone.Collection.extend({
                    
23	model: ResourceSetModel,
                    
35
                    
36var PolicyCollection = Backbone.Collection.extend({
                    
37	model: PolicyModel,
                    
                
token.js https://gitlab.com/jslee1/OpenID-Connect-Java-Spring-Server | JavaScript | 508 lines
                    
34
                    
35var AccessTokenCollection = Backbone.Collection.extend({
                    
36	idAttribute: 'id',
                    
185
                    
186var RefreshTokenCollection = Backbone.Collection.extend({
                    
187	idAttribute: 'id',
                    
                
client.js https://gitlab.com/jslee1/OpenID-Connect-Java-Spring-Server | JavaScript | 1229 lines
                    
183
                    
184var ClientCollection = Backbone.Collection.extend({
                    
185
                    
                
single-quiz.js https://gitlab.com/gregtyka/lfmawordpress | JavaScript | 731 lines
                    
198
                    
199	var LearnPress_Collection_Questions = window.LearnPress_Collection_Questions = Backbone.Collection.extend({
                    
200		url  : 'admin-ajax.php',
                    
                
builder.js https://gitlab.com/gregtyka/lfmawordpress | JavaScript | 1499 lines
                    
285
                    
286		ET_PageBuilder.Modules = Backbone.Collection.extend( {
                    
287
                    
291
                    
292		ET_PageBuilder.SavedTemplates = Backbone.Collection.extend( {
                    
293
                    
297
                    
298		ET_PageBuilder.Histories = Backbone.Collection.extend( {
                    
299
                    
                
socrates.js https://gitlab.com/gregtyka/KhanLatest | JavaScript | 1009 lines
                    
212
                    
213Socrates.QuestionCollection = Backbone.Collection.extend({
                    
214    model: Socrates.Question
                    
                
badges.js https://gitlab.com/gregtyka/KhanLatest | JavaScript | 689 lines
                    
121 */
                    
122Badges.BadgeList = Backbone.Collection.extend({
                    
123    model: Badges.Badge,
                    
186 */
                    
187Badges.UserBadgeList = Backbone.Collection.extend({
                    
188    model: Badges.UserBadge
                    
                
stacks.js https://gitlab.com/gregtyka/KhanLatest | JavaScript | 1046 lines
                    
56 */
                    
57Exercises.StackCollection = Backbone.Collection.extend({
                    
58
                    
                
models.js https://gitlab.com/gregtyka/ka-lite | JavaScript | 656 lines
                    
230
                    
231var AttemptLogCollection = Backbone.Collection.extend({
                    
232
                    
414
                    
415var TestLogCollection = Backbone.Collection.extend({
                    
416
                    
                
RestClient.js https://gitlab.com/essere.lab.public/qualitas.class-corpus | JavaScript | 378 lines
                    
83    // Collection class for Manufacturer entities
                    
84    models.ManufacturerCollection = Backbone.Collection.extend({
                    
85        model: models.Manufacturer,
                    
                
filterList.js https://gitlab.com/Alberto.SS/crm_verquet | JavaScript | 456 lines
                    
13
                    
14var DescuentosCollection = Backbone.Collection.extend({
                    
15	model: Descuento
                    
65
                    
66var ProductosCollection = Backbone.Collection.extend({
                    
67	model: ProductoPrecio,
                    
84
                    
85var CarritoCollection = Backbone.Collection.extend({
                    
86	model: ProductoCompra,
                    
                
composite-view.spec.js https://gitlab.com/CodeYellowBV/backbone.marionette | JavaScript | 839 lines
                    
24
                    
25    this.Collection = Backbone.Collection.extend({
                    
26      model: this.Model
                    
28
                    
29    this.UserCollection = Backbone.Collection.extend({
                    
30      model: this.User
                    
32
                    
33    this.NodeCollection = Backbone.Collection.extend({
                    
34      model: this.Node
                    
                
config.jsp https://gitlab.com/apachipa/uportal | JavaServer Pages | 382 lines
                    
131
                    
132   up.analytics.config.model.SettingsList = Backbone.Collection.extend({
                    
133      model : up.analytics.config.model.Setting,
                    
148
                    
149   up.analytics.config.model.PropertyConfigurationList = Backbone.Collection.extend({
                    
150      model : up.analytics.config.model.PropertyConfiguration,
                    
                
posts-selector.js https://gitlab.com/mostafame/team_website | JavaScript | 720 lines
                    
19    // A collection of posts
                    
20    PostCollection = self.PostCollection = Backbone.Collection.extend( {
                    
21        model: Post,
                    
                
siteorigin-panels-24.js https://gitlab.com/mostafame/team_website | JavaScript | 1845 lines
                    
3
                    
4module.exports = Backbone.Collection.extend( {
                    
5	model: panels.model.cell,
                    
41
                    
42module.exports = Backbone.Collection.extend( {
                    
43	model: panels.model.historyEntry,
                    
112
                    
113module.exports = Backbone.Collection.extend( {
                    
114	model: panels.model.row,
                    
149
                    
150module.exports = Backbone.Collection.extend( {
                    
151	model: panels.model.widget,
                    
                
notes.js https://gitlab.com/dannywillems/laverna | JavaScript | 143 lines
                    
10
                    
11    var Notes = Backbone.Collection.extend({
                    
12        model: Note,
                    
                
palette.js https://gitlab.com/webkod3r/tripolis | JavaScript | 116 lines
                    
48	// Palette Elements collection, it will have all categories elements, it act as an array for all cateogies elements
                    
49	Palette.Elements = Backbone.Collection.extend({
                    
50		model: Palette.Element,
                    
                
oc-backbone-webdav.js https://gitlab.com/wuhang2003/core | JavaScript | 328 lines
                    
40 *
                    
41 *     var PersonCollection = OC.Backbone.Collection.extend({
                    
42 *         // make it use the DAV transport
                    
                
customize-models.js https://gitlab.com/webkod3r/tripolis | JavaScript | 247 lines
                    
130	 */
                    
131	api.HeaderTool.ChoiceList = Backbone.Collection.extend({
                    
132		model: api.HeaderTool.ImageModel,
                    
                
collection.js https://gitlab.com/132nd-etcher/dcs-witchcraft | JavaScript | 1277 lines
                    
48  test("new and parse", 3, function() {
                    
49    var Collection = Backbone.Collection.extend({
                    
50      parse : function(data) {
                    
149  test("add; at should have preference over comparator", 1, function() {
                    
150    var Col = Backbone.Collection.extend({
                    
151      comparator: function(a,b) {
                    
220
                    
221    var Col = Backbone.Collection.extend({model: Model});
                    
222    var col = new Col;
                    
478    });
                    
479    var ValidatingCollection = Backbone.Collection.extend({
                    
480      model: ValidatingModel
                    
495    });
                    
496    var ValidatingCollection = Backbone.Collection.extend({
                    
497      model: ValidatingModel
                    
                
composer-models.js https://gitlab.com/juanito.abelo/nlmobile | JavaScript | 197 lines
                    
94     */
                    
95    var Shortcodes = vc.shortcodes_collection = Backbone.Collection.extend({
                    
96        model:vc.shortcode,
                    
                
publish.js https://gitlab.com/wilane/Booktype | JavaScript | 628 lines
                    
260    // A List of People
                    
261    var ExportCollection = Backbone.Collection.extend({
                    
262      model: ExportModel
                    
                
builder.js https://gitlab.com/stevie007/cinostaging | JavaScript | 519 lines
                    
142// Collection to hold our fields.
                    
143var nfFields = Backbone.Collection.extend({
                    
144	model: nfField,
                    
                
backbone-super.js https://gitlab.com/Mirros/cdnjs | JavaScript | 107 lines
                    
25}(this, function factory(_, Backbone) {
                    
26	Backbone.Model.extend = Backbone.Collection.extend = Backbone.Router.extend = Backbone.View.extend = function(protoProps, classProps) {
                    
27		var child = inherits(this, protoProps, classProps);
                    
                
blacklist.js https://gitlab.com/jslee1/OpenID-Connect-Java-Spring-Server | JavaScript | 211 lines
                    
22
                    
23var BlackListCollection = Backbone.Collection.extend({
                    
24	initialize: function() { },
                    
                
scratchpads.js https://gitlab.com/gregtyka/KhanLatest | JavaScript | 125 lines
                    
83
                    
84window.ScratchpadList = Backbone.Collection.extend({
                    
85    model: Scratchpad,
                    
                
customize-widgets.js https://gitlab.com/VTTE/sitios-vtte | JavaScript | 1691 lines
                    
57	 */
                    
58	api.Widgets.WidgetCollection = Backbone.Collection.extend(/** @lends wp.customize.Widgets.WidgetCollection.prototype */{
                    
59		model: api.Widgets.WidgetModel,
                    
135	 */
                    
136	api.Widgets.SidebarCollection = Backbone.Collection.extend(/** @lends wp.customize.Widgets.SidebarCollection.prototype */{
                    
137		model: api.Widgets.SidebarModel
                    
                
customize-nav-menus.js https://gitlab.com/VTTE/sitios-vtte | JavaScript | 1664 lines
                    
75	 */
                    
76	api.Menus.AvailableItemCollection = Backbone.Collection.extend(/** @lends wp.customize.Menus.AvailableItemCollection.prototype */{
                    
77		model: api.Menus.AvailableItemModel,
                    
                
notes.js https://gitlab.com/kaouech/theme | JavaScript | 263 lines
                    
25
                    
26  var NoteList = Backbone.Collection.extend({
                    
27
                    
                
coaches.js https://gitlab.com/gregtyka/KhanLatest | JavaScript | 383 lines
                    
168
                    
169Coaches.CoachCollection = Backbone.Collection.extend({
                    
170    model: Coaches.Coach,
                    
                
admin.js https://gitlab.com/hop23typhu/list-theme | JavaScript | 1055 lines
                    
115	// Model: Menu Items
                    
116	media.model.mi.MenuItems = Backbone.Collection.extend({
                    
117		props : new Backbone.Model({ item : '' }),
                    
127	// Model: Settings fields
                    
128	media.model.mi.MenuItems.Settings = Backbone.Collection.extend({
                    
129		model : Backbone.Model.extend({
                    
606	// Font icon collection
                    
607	media.controller.miFont.Library = Backbone.Collection.extend({
                    
608		props : new Backbone.Model({
                    
                
todos.html https://gitlab.com/jaf/across-mold | HTML | 729 lines
                    
155            
                    
156            <div class="content"><div class='highlight'><pre>  <span class="keyword">var</span> TodoList = Backbone.Collection.extend({</pre></div></div>
                    
157            
                    
                
main.js https://gitlab.com/bandana/Astro-Veda | JavaScript | 459 lines
                    
36
                    
37    PolygonC = Backbone.Collection.extend({
                    
38      model: PolygonM,
                    
                
sync.js https://gitlab.com/Rockyspade/backbone | JavaScript | 221 lines
                    
2
                    
3  var Library = Backbone.Collection.extend({
                    
4    url : function() { return '/library'; }
                    
                
backbone.localforage.js https://gitlab.com/Blueprint-Marketing/cdnjs | JavaScript | 256 lines
                    
9//
                    
10//     var MyModel = Backbone.Collection.extend({})
                    
11//     var MyCollection = Backbone.Collection.extend({\
                    
16//
                    
17//     var MyModel = Backbone.Collection.extend({
                    
18//         sync: Backbone.localforage.sync()
                    
19//     });
                    
20//     var MyCollection = Backbone.Collection.extend({
                    
21//         model: MyModel,
                    
                
ComentariosIntranet.js https://gitlab.com/Alberto.SS/crm_verquet | JavaScript | 280 lines
                    
23//Colecciones
                    
24var ComentariosIntranetCollection = Backbone.Collection.extend({
                    
25	model: ComentarioIntranet,
                    
                
files.js https://gitlab.com/gregtyka/prose | JavaScript | 304 lines
                    
12
                    
13module.exports = Backbone.Collection.extend({
                    
14  model: function(attributes, options) {
                    
                
collection.js https://gitlab.com/johanlindberg/irvato-crm | JavaScript | 147 lines
                    
30
                    
31    var Collection = Backbone.Collection.extend({
                    
32
                    
                
oc-backbone-webdavSpec.js https://gitlab.com/wuhang2003/core | JavaScript | 390 lines
                    
66			});
                    
67			TestCollection = OC.Backbone.Collection.extend({
                    
68				sync: OC.Backbone.davSync,
                    
                
paginated_collection.js https://gitlab.com/ykazemi/canvas-lms | JavaScript | 205 lines
                    
63   *
                    
64   *     var Collection = Backbone.Collection.extend({
                    
65   *       // install the mixin
                    
                
models.js https://gitlab.com/gregtyka/ka-lite | JavaScript | 171 lines
                    
125
                    
126var ContentLogCollection = Backbone.Collection.extend({
                    
127
                    
                
simpleCall.js https://gitlab.com/essere.lab.public/qualitas.class-corpus | JavaScript | 43 lines
                    
41 */
                    
42window.ManufacturerList = Backbone.Collection.extend();
                    
43
                    
                
NodeListModel.js https://gitlab.com/zouxc/elasticsearch-cn-out-of-box | JavaScript | 63 lines
                    
27
                    
28var NodeListModel = Backbone.Collection.extend({
                    
29    model:NodeSimple,
                    
                
backbone-extensions.js https://gitlab.com/gregtyka/server | JavaScript | 87 lines
                    
9 has been loaded from the server. */
                    
10window.IncrementalCollection = Backbone.Collection.extend({
                    
11    fetchByID: function(id, callback, args) {
                    
                
category.js https://gitlab.com/webkod3r/tripolis | JavaScript | 89 lines
                    
11	// Category collection, it act as array for elements
                    
12	Category.Elements = Backbone.Collection.extend({
                    
13		model: Category.ElementEntry
                    
                
sync.js https://gitlab.com/pidlisnyi/lisbon | JavaScript | 239 lines
                    
2
                    
3  var Library = Backbone.Collection.extend({
                    
4    url: function() { return '/library'; }
                    
                
baton-conductor.js https://gitlab.com/diegoduncan21/geogrim | JavaScript | 433 lines
                    
107	baton_conductor.collections = {
                    
108		output: Backbone.Collection.extend( {
                    
109			model: baton_conductor.models.output
                    
                
files.js https://gitlab.com/dannywillems/laverna | JavaScript | 82 lines
                    
14     */
                    
15    var Files = Backbone.Collection.extend({
                    
16        model: File,
                    
                
app.js git://github.com/mitreid-connect/OpenID-Connect-Java-Spring-Server.git | JavaScript | 342 lines
                    
78
                    
79    var ClientCollection = Backbone.Collection.extend({
                    
80
                    
                
room.js https://gitlab.com/ChristopherFunk/Whiteboard | JavaScript | 128 lines
                    
13
                    
14    var DrawModelsList = Backbone.Collection.extend({
                    
15        model: DrawModel
                    
17
                    
18    var UsersList = Backbone.Collection.extend({
                    
19        model: User
                    
                
feeds.js https://github.com/samuelclay/NewsBlur.git | JavaScript | 349 lines
                    
261
                    
262NEWSBLUR.Collections.Feeds = Backbone.Collection.extend({
                    
263    
                    
                
scope.js https://gitlab.com/jslee1/OpenID-Connect-Java-Spring-Server | JavaScript | 391 lines
                    
34
                    
35var SystemScopeCollection = Backbone.Collection.extend({
                    
36	idAttribute: 'id',
                    
                
EntityModel.js git://github.com/drupal/drupal.git | JavaScript | 329 lines
                    
325
                    
326  Drupal.quickedit.EntityCollection = Backbone.Collection.extend({
                    
327    model: Drupal.quickedit.EntityModel
                    
                
repos.js https://gitlab.com/gregtyka/prose | JavaScript | 64 lines
                    
10
                    
11module.exports = Backbone.Collection.extend({
                    
12  model: Repo,
                    
                
stock.js https://bitbucket.org/aswinvk28/smartpan-stock-drupal.git | JavaScript | 428 lines
                    
105    
                    
106//    Stock.StockData = Backbone.Collection.extend({
                    
107//        url: null,
                    
120//    
                    
121//    Stock.StockPriceCollection = Backbone.Collection.extend({
                    
122//        sync: Backbone.localforage.sync('Stock.StockPriceCollection'),
                    
127//    
                    
128//    Stock.StockVolumeCollection = Backbone.Collection.extend({
                    
129//        sync: Backbone.localforage.sync('Stock.StockVolumeCollection'),
                    
181    
                    
182    var StockChoiceList = Backbone.Collection.extend({
                    
183        model: StockChoice,
                    
                
removed.js https://gitlab.com/dannywillems/laverna | JavaScript | 65 lines
                    
13     */
                    
14    var RemovedObjects = Backbone.Collection.extend({
                    
15
                    
                
vie-collectionmanager.js https://gitlab.com/klausmig/CloudSemanticWeb | JavaScript | 70 lines
                    
24
                    
25        var Collection = Backbone.Collection.extend({
                    
26            model: VIE.ContainerManager.getModelForContainer(preparedNewElement)
                    
                
test_crap.py https://gitlab.com/padjis/mapan | Python | 75 lines
                    
60        exports.Bar = Backbone.Model.extend({});
                    
61        var BarCollection = Backbone.Collection.extend({
                    
62            model: exports.Bar,
                    
                
models.js https://gitlab.com/gregtyka/ka-lite | JavaScript | 97 lines
                    
27
                    
28var FacilityCollection = Backbone.Collection.extend({
                    
29    url: window.FACILITY_RESOURCE_URL
                    
31
                    
32var GroupCollection = Backbone.Collection.extend({
                    
33    url: window.GROUP_RESOURCE_URL
                    
                
commentcollection.js https://gitlab.com/wuhang2003/core | JavaScript | 167 lines
                    
19	 */
                    
20	var CommentCollection = OC.Backbone.Collection.extend(
                    
21		/** @lends OCA.Comments.CommentCollection.prototype */ {
                    
                
NodesStats.js https://gitlab.com/zouxc/elasticsearch-cn-out-of-box | JavaScript | 95 lines
                    
23
                    
24var NodeStatsCollection = Backbone.Collection.extend({
                    
25    model: NodeStats
                    
40
                    
41var NodesStats = Backbone.Collection.extend({
                    
42    model: NodeStatsTimestamp,
                    
                
todos.js https://gitlab.com/x33n/todomvc | JavaScript | 41 lines
                    
11	// server.
                    
12	var Todos = Backbone.Collection.extend({
                    
13		// Reference to this collection's model.
                    
                
AuthsCollection.js https://gitlab.com/atomfrede/jhipster-ci-example-gradle | JavaScript | 91 lines
                    
2
                    
3SwaggerUi.Collections.AuthsCollection = Backbone.Collection.extend({
                    
4    constructor: function() {
                    
                
models.js https://gitlab.com/gregtyka/ka-lite | JavaScript | 40 lines
                    
8// Collections
                    
9var PlaylistProgressCollection = Backbone.Collection.extend({
                    
10    model: PlaylistProgressModel,
                    
20
                    
21var PlaylistProgressDetailCollection = Backbone.Collection.extend({
                    
22    model: PlaylistProgressDetailModel,
                    
                
apiTokensView.es6.js git://github.com/reviewboard/reviewboard.git | JavaScript | 707 lines
                    
214 */
                    
215const APITokenItemCollection = Backbone.Collection.extend({
                    
216    model: APITokenItem,
                    
                
revisions.min.js git://github.com/wordpress/wordpress.git | JavaScript | 1 lines
                    
1window.wp=window.wp||{},function(a){var b;b=wp.revisions={model:{},view:{},controller:{}},b.settings=window._wpRevisionsSettings||{},b.debug=!1,b.log=function(){window.console&&b.debug&&window.console.log.apply(window.console,arguments)},a.fn.allOffsets=function(){var b=this.offset()||{top:0,left:0},c=a(window);return _.extend(b,{right:c.width()-b.left-this.outerWidth(),bottom:c.height()-b.top-this.outerHeight()})},a.fn.allPositions=function(){var a=this.position()||{top:0,left:0},b=this.parent();return _.extend(a,{right:b.outerWidth()-a.left-this.outerWidth(),bottom:b.outerHeight()-a.top-this.outerHeight()})},b.model.Slider=Backbone.Model.extend({defaults:{value:null,values:null,min:0,max:1,step:1,range:!1,compareTwoMode:!1},initialize:function(a){this.frame=a.frame,this.revisions=a.revisions,this.listenTo(this.frame,"update:revisions",this.receiveRevisions),this.listenTo(this.frame,"change:compareTwoMode",this.updateMode),this.on("change:from",this.handleLocalChanges),this.on("change:to",this.handleLocalChanges),this.on("change:compareTwoMode",this.updateSliderSettings),this.on("update:revisions",this.updateSliderSettings),this.on("change:hoveredRevision",this.hoverRevision),this.set({max:this.revisions.length-1,compareTwoMode:this.frame.get("compareTwoMode"),from:this.frame.get("from"),to:this.frame.get("to")}),this.updateSliderSettings()},getSliderValue:function(a,b){return isRtl?this.revisions.length-this.revisions.indexOf(this.get(a))-1:this.revisions.indexOf(this.get(b))},updateSliderSettings:function(){this.get("compareTwoMode")?this.set({values:[this.getSliderValue("to","from"),this.getSliderValue("from","to")],value:null,range:!0}):this.set({value:this.getSliderValue("to","to"),values:null,range:!1}),this.trigger("update:slider")},hoverRevision:function(a,b){this.trigger("hovered:revision",b)},updateMode:function(a,b){this.set({compareTwoMode:b})},handleLocalChanges:function(){this.frame.set({from:this.get("from"),to:this.get("to")})},receiveRevisions:function(a,b){this.get("from")===a&&this.get("to")===b||(this.set({from:a,to:b},{silent:!0}),this.trigger("update:revisions",a,b))}}),b.model.Tooltip=Backbone.Model.extend({defaults:{revision:null,offset:{},hovering:!1,scrubbing:!1},initialize:function(a){this.frame=a.frame,this.revisions=a.revisions,this.slider=a.slider,this.listenTo(this.slider,"hovered:revision",this.updateRevision),this.listenTo(this.slider,"change:hovering",this.setHovering),this.listenTo(this.slider,"change:scrubbing",this.setScrubbing)},updateRevision:function(a){this.set({revision:a})},setHovering:function(a,b){this.set({hovering:b})},setScrubbing:function(a,b){this.set({scrubbing:b})}}),b.model.Revision=Backbone.Model.extend({}),b.model.Revisions=Backbone.Collection.extend({model:b.model.Revision,initialize:function(){_.bindAll(this,"next","prev")},next:function(a){var b=this.indexOf(a);return-1!==b&&b!==this.length-1?this.at(b+1):void 0},prev:function(a){var b=this.indexOf(a);return-1!==b&&0!==b?this.at(b-1):void 0}}),b.model.Field=Backbone.Model.extend({}),b.model.Fields=Backbone.Collection.extend({model:b.model.Field}),b.model.Diff=Backbone.Model.extend({initialize:function(){var a=this.get("fields");this.unset("fields"),this.fields=new b.model.Fields(a)}}),b.model.Diffs=Backbone.Collection.extend({initialize:function(a,b){_.bindAll(this,"getClosestUnloaded"),this.loadAll=_.once(this._loadAll),this.revisions=b.revisions,this.postId=b.postId,this.requests={}},model:b.model.Diff,ensure:function(b,c){var d=this.get(b),e=this.requests[b],f=a.Deferred(),g={},h=b.split(":")[0],i=b.split(":")[1];return g[b]=!0,wp.revisions.log("ensure",b),this.trigger("ensure",g,h,i,f.promise()),d?f.resolveWith(c,[d]):(this.trigger("ensure:load",g,h,i,f.promise()),_.each(g,_.bind(function(a){this.requests[a]&&delete g[a],this.get(a)&&delete g[a]},this)),e||(g[b]=!0,e=this.load(_.keys(g))),e.done(_.bind(function(){f.resolveWith(c,[this.get(b)])},this)).fail(_.bind(function(){f.reject()}))),f.promise()},getClosestUnloaded:function(a,b){var c=this;return _.chain([0].concat(a)).initial().zip(a).sortBy(function(a){return Math.abs(b-a[1])}).map(function(a){return a.join(":")}).filter(function(a){return _.isUndefined(c.get(a))&&!c.requests[a]}).value()},_loadAll:function(b,c,d){var e=this,f=a.Deferred(),g=_.first(this.getClosestUnloaded(b,c),d);return _.size(g)>0?this.load(g).done(function(){e._loadAll(b,c,d).done(function(){f.resolve()})}).fail(function(){1===d?f.reject():e._loadAll(b,c,Math.ceil(d/2)).done(function(){f.resolve()})}):f.resolve(),f},load:function(a){return wp.revisions.log("load",a),this.fetch({data:{compare:a},remove:!1}).done(function(){wp.revisions.log("load:complete",a)})},sync:function(a,b,c){if("read"===a){c=c||{},c.context=this,c.data=_.extend(c.data||{},{action:"get-revision-diffs",post_id:this.postId});var d=wp.ajax.send(c),e=this.requests;return c.data.compare&&_.each(c.data.compare,function(a){e[a]=d}),d.always(function(){c.data.compare&&_.each(c.data.compare,function(a){delete e[a]})}),d}return Backbone.Model.prototype.sync.apply(this,arguments)}}),b.model.FrameState=Backbone.Model.extend({defaults:{loading:!1,error:!1,compareTwoMode:!1},initialize:function(a,c){var d=this.get("initialDiffState");_.bindAll(this,"receiveDiff"),this._debouncedEnsureDiff=_.debounce(this._ensureDiff,200),this.revisions=c.revisions,this.diffs=new b.model.Diffs([],{revisions:this.revisions,postId:this.get("postId")}),this.diffs.set(this.get("diffData")),this.listenTo(this,"change:from",this.changeRevisionHandler),this.listenTo(this,"change:to",this.changeRevisionHandler),this.listenTo(this,"change:compareTwoMode",this.changeMode),this.listenTo(this,"update:revisions",this.updatedRevisions),this.listenTo(this.diffs,"ensure:load",this.updateLoadingStatus),this.listenTo(this,"update:diff",this.updateLoadingStatus),this.set({to:this.revisions.get(d.to),from:this.revisions.get(d.from),compareTwoMode:d.compareTwoMode}),window.history&&window.history.pushState&&(this.router=new b.Router({model:this}),Backbone.history.start({pushState:!0}))},updateLoadingStatus:function(){this.set("error",!1),this.set("loading",!this.diff())},changeMode:function(a,b){var c=this.revisions.indexOf(this.get("to"));b&&0===c&&this.set({from:this.revisions.at(c),to:this.revisions.at(c+1)}),b||0===c||this.set({from:this.revisions.at(c-1),to:this.revisions.at(c)})},updatedRevisions:function(a,b){this.get("compareTwoMode")||this.diffs.loadAll(this.revisions.pluck("id"),b.id,40)},diff:function(){return this.diffs.get(this._diffId)},updateDiff:function(b){var c,d,e,f;return b=b||{},c=this.get("from"),d=this.get("to"),e=(c?c.id:0)+":"+d.id,this._diffId===e?a.Deferred().reject().promise():(this._diffId=e,this.trigger("update:revisions",c,d),f=this.diffs.get(e),f?(this.receiveDiff(f),a.Deferred().resolve().promise()):b.immediate?this._ensureDiff():(this._debouncedEnsureDiff(),a.Deferred().reject().promise()))},changeRevisionHandler:function(){this.updateDiff()},receiveDiff:function(a){_.isUndefined(a)||_.isUndefined(a.id)?this.set({loading:!1,error:!0}):this._diffId===a.id&&this.trigger("update:diff",a)},_ensureDiff:function(){return this.diffs.ensure(this._diffId,this).always(this.receiveDiff)}}),b.view.Frame=wp.Backbone.View.extend({className:"revisions",template:wp.template("revisions-frame"),initialize:function(){this.listenTo(this.model,"update:diff",this.renderDiff),this.listenTo(this.model,"change:compareTwoMode",this.updateCompareTwoMode),this.listenTo(this.model,"change:loading",this.updateLoadingStatus),this.listenTo(this.model,"change:error",this.updateErrorStatus),this.views.set(".revisions-control-frame",new b.view.Controls({model:this.model}))},render:function(){return wp.Backbone.View.prototype.render.apply(this,arguments),a("html").css("overflow-y","scroll"),a("#wpbody-content .wrap").append(this.el),this.updateCompareTwoMode(),this.renderDiff(this.model.diff()),this.views.ready(),this},renderDiff:function(a){this.views.set(".revisions-diff-frame",new b.view.Diff({model:a}))},updateLoadingStatus:function(){this.$el.toggleClass("loading",this.model.get("loading"))},updateErrorStatus:function(){this.$el.toggleClass("diff-error",this.model.get("error"))},updateCompareTwoMode:function(){this.$el.toggleClass("comparing-two-revisions",this.model.get("compareTwoMode"))}}),b.view.Controls=wp.Backbone.View.extend({className:"revisions-controls",initialize:function(){_.bindAll(this,"setWidth"),this.views.add(new b.view.Buttons({model:this.model})),this.views.add(new b.view.Checkbox({model:this.model}));var a=new b.model.Slider({frame:this.model,revisions:this.model.revisions}),c=new b.model.Tooltip({frame:this.model,revisions:this.model.revisions,slider:a});this.views.add(new b.view.Tooltip({model:c})),this.views.add(new b.view.Tickmarks({model:c})),this.views.add(new b.view.Slider({model:a})),this.views.add(new b.view.Metabox({model:this.model}))},ready:function(){this.top=this.$el.offset().top,this.window=a(window),this.window.on("scroll.wp.revisions",{controls:this},function(a){var b=a.data.controls,c=b.$el.parent(),d=b.window.scrollTop(),e=b.views.parent;d>=b.top?(e.$el.hasClass("pinned")||(b.setWidth(),c.css("height",c.height()+"px"),b.window.on("resize.wp.revisions.pinning click.wp.revisions.pinning",{controls:b},function(a){a.data.controls.setWidth()})),e.$el.addClass("pinned")):e.$el.hasClass("pinned")?(b.window.off(".wp.revisions.pinning"),b.$el.css("width","auto"),e.$el.removeClass("pinned"),c.css("height","auto"),b.top=b.$el.offset().top):b.top=b.$el.offset().top})},setWidth:function(){this.$el.css("width",this.$el.parent().width()+"px")}}),b.view.Tickmarks=wp.Backbone.View.extend({className:"revisions-tickmarks",direction:isRtl?"right":"left",initialize:function(){this.listenTo(this.model,"change:revision",this.reportTickPosition)},reportTickPosition:function(a,b){var c,d,e,f,g=this.model.revisions.indexOf(b);d=this.$el.allOffsets(),e=this.$el.parent().allOffsets(),g===this.model.revisions.length-1?c={rightPlusWidth:d.left-e.left+1,leftPlusWidth:d.right-e.right+1}:(f=this.$("div:nth-of-type("+(g+1)+")"),c=f.allPositions(),_.extend(c,{left:c.left+d.left-e.left,right:c.right+d.right-e.right}),_.extend(c,{leftPlusWidth:c.left+f.outerWidth(),rightPlusWidth:c.right+f.outerWidth()})),this.model.set({offset:c})},ready:function(){var a,b;a=this.model.revisions.length-1,b=1/a,this.$el.css("width",50*this.model.revisions.length+"px"),_(a).times(function(a){this.$el.append('<div style="'+this.direction+": "+100*b*a+'%"></div>')},this)}}),b.view.Metabox=wp.Backbone.View.extend({className:"revisions-meta",initialize:function(){this.views.add(new b.view.MetaFrom({model:this.model,className:"diff-meta diff-meta-from"})),this.views.add(new b.view.MetaTo({model:this.model}))}}),b.view.Meta=wp.Backbone.View.extend({template:wp.template("revisions-meta"),events:{"click .restore-revision":"restoreRevision"},initialize:function(){this.listenTo(this.model,"update:revisions",this.render)},prepare:function(){return _.extend(this.model.toJSON()[this.type]||{},{type:this.type})},restoreRevision:function(){document.location=this.model.get("to").attributes.restoreUrl}}),b.view.MetaFrom=b.view.Meta.extend({className:"diff-meta diff-meta-from",type:"from"}),b.view.MetaTo=b.view.Meta.extend({className:"diff-meta diff-meta-to",type:"to"}),b.view.Checkbox=wp.Backbone.View.extend({className:"revisions-checkbox",template:wp.template("revisions-checkbox"),events:{"click .compare-two-revisions":"compareTwoToggle"},initialize:function(){this.listenTo(this.model,"change:compareTwoMode",this.updateCompareTwoMode)},ready:function(){this.model.revisions.length<3&&a(".revision-toggle-compare-mode").hide()},updateCompareTwoMode:function(){this.$(".compare-two-revisions").prop("checked",this.model.get("compareTwoMode"))},compareTwoToggle:function(){this.model.set({compareTwoMode:a(".compare-two-revisions").prop("checked")})}}),b.view.Tooltip=wp.Backbone.View.extend({className:"revisions-tooltip",template:wp.template("revisions-meta"),initialize:function(){this.listenTo(this.model,"change:offset",this.render),this.listenTo(this.model,"change:hovering",this.toggleVisibility),this.listenTo(this.model,"change:scrubbing",this.toggleVisibility)},prepare:function(){return _.isNull(this.model.get("revision"))?void 0:_.extend({type:"tooltip"},{attributes:this.model.get("revision").toJSON()})},render:function(){var a,b,c,d,e={},f=this.model.revisions.indexOf(this.model.get("revision"))+1;d=f/this.model.revisions.length>.5,isRtl?(b=d?"left":"right",c=d?"leftPlusWidth":b):(b=d?"right":"left",c=d?"rightPlusWidth":b),a="right"===b?"left":"right",wp.Backbone.View.prototype.render.apply(this,arguments),e[b]=this.model.get("offset")[c]+"px",e[a]="",this.$el.toggleClass("flipped",d).css(e)},visible:function(){return this.model.get("scrubbing")||this.model.get("hovering")},toggleVisibility:function(){this.visible()?this.$el.stop().show().fadeTo(100-100*this.el.style.opacity,1):this.$el.stop().fadeTo(300*this.el.style.opacity,0,function(){a(this).hide()})}}),b.view.Buttons=wp.Backbone.View.extend({className:"revisions-buttons",template:wp.template("revisions-buttons"),events:{"click .revisions-next .button":"nextRevision","click .revisions-previous .button":"previousRevision"},initialize:function(){this.listenTo(this.model,"update:revisions",this.disabledButtonCheck)},ready:function(){this.disabledButtonCheck()},gotoModel:function(a){var b={to:this.model.revisions.at(a)};a?b.from=this.model.revisions.at(a-1):this.model.unset("from",{silent:!0}),this.model.set(b)},nextRevision:function(){var a=this.model.revisions.indexOf(this.model.get("to"))+1;this.gotoModel(a)},previousRevision:function(){var a=this.model.revisions.indexOf(this.model.get("to"))-1;this.gotoModel(a)},disabledButtonCheck:function(){var b=this.model.revisions.length-1,c=0,d=a(".revisions-next .button"),e=a(".revisions-previous .button"),f=this.model.revisions.indexOf(this.model.get("to"));d.prop("disabled",b===f),e.prop("disabled",c===f)}}),b.view.Slider=wp.Backbone.View.extend({className:"wp-slider",direction:isRtl?"right":"left",events:{mousemove:"mouseMove"},initialize:function(){_.bindAll(this,"start","slide","stop","mouseMove","mouseEnter","mouseLeave"),this.listenTo(this.model,"update:slider",this.applySliderSettings)},ready:function(){this.$el.css("width",50*this.model.revisions.length+"px"),this.$el.slider(_.extend(this.model.toJSON(),{start:this.start,slide:this.slide,stop:this.stop})),this.$el.hoverIntent({over:this.mouseEnter,out:this.mouseLeave,timeout:800}),this.applySliderSettings()},mouseMove:function(b){var c=this.model.revisions.length-1,d=this.$el.allOffsets()[this.direction],e=this.$el.width(),f=e/c,g=(isRtl?a(window).width()-b.pageX:b.pageX)-d,h=Math.floor((g+f/2)/f);0>h?h=0:h>=this.model.revisions.length&&(h=this.model.revisions.length-1),this.model.set({hoveredRevision:this.model.revisions.at(h)})},mouseLeave:function(){this.model.set({hovering:!1})},mouseEnter:function(){this.model.set({hovering:!
                    
                
customize-nav-menus.min.js git://github.com/wordpress/wordpress.git | JavaScript | 2 lines
                    
1!function(a,b,c){"use strict";function d(a){return"nav_menu_item["+a+"]"}function e(b){return b=b||"",b=c("<div>").text(b).html(),b=c.trim(b),b||a.Menus.data.l10n.unnamed}wpNavMenu.originalInit=wpNavMenu.init,wpNavMenu.options.menuItemDepthPerLevel=20,wpNavMenu.options.sortableItems="> .customize-control-nav_menu_item",wpNavMenu.options.targetTolerance=10,wpNavMenu.init=function(){this.jQueryExtensions()},a.Menus=a.Menus||{},a.Menus.data={itemTypes:[],l10n:{},settingTransport:"refresh",phpIntMax:0,defaultSettingValues:{nav_menu:{},nav_menu_item:{}},locationSlugMappedToName:{}},"undefined"!=typeof _wpCustomizeNavMenusSettings&&c.extend(a.Menus.data,_wpCustomizeNavMenusSettings),a.Menus.generatePlaceholderAutoIncrementId=function(){return-Math.ceil(a.Menus.data.phpIntMax*Math.random())},a.Menus.AvailableItemModel=Backbone.Model.extend(c.extend({id:null},a.Menus.data.defaultSettingValues.nav_menu_item)),a.Menus.AvailableItemCollection=Backbone.Collection.extend({model:a.Menus.AvailableItemModel,sort_key:"order",comparator:function(a){return-a.get(this.sort_key)},sortByField:function(a){this.sort_key=a,this.sort()}}),a.Menus.availableMenuItems=new a.Menus.AvailableItemCollection(a.Menus.data.availableMenuItems),a.Menus.AvailableMenuItemsPanelView=b.Backbone.View.extend({el:"#available-menu-items",events:{"input #menu-items-search":"debounceSearch","keyup #menu-items-search":"debounceSearch","focus .menu-item-tpl":"focus","click .menu-item-tpl":"_submit","click #custom-menu-item-submit":"_submitLink","keypress #custom-menu-item-name":"_submitLink",keydown:"keyboardAccessible"},selected:null,currentMenuControl:null,debounceSearch:null,$search:null,searchTerm:"",rendered:!1,pages:{},sectionContent:"",loading:!1,initialize:function(){var b=this;a.panel.has("nav_menus")&&(this.$search=c("#menu-items-search"),this.sectionContent=this.$el.find(".accordion-section-content"),this.debounceSearch=_.debounce(b.search,500),_.bindAll(this,"close"),c("#customize-controls, .customize-section-back").on("click keydown",function(a){var d=c(a.target).is(".item-delete, .item-delete *"),e=c(a.target).is(".add-new-menu-item, .add-new-menu-item *");!c("body").hasClass("adding-menu-items")||d||e||b.close()}),c(".clear-results").on("click",function(){b.$search.val("").focus().trigger("keyup")}),this.$el.on("input","#custom-menu-item-name.invalid, #custom-menu-item-url.invalid",function(){c(this).removeClass("invalid")}),a.panel("nav_menus").container.bind("expanded",function(){b.rendered||(b.initList(),b.rendered=!0)}),this.sectionContent.scroll(function(){var a=b.$el.find(".accordion-section.open .accordion-section-content").prop("scrollHeight"),d=b.$el.find(".accordion-section.open").height();if(!b.loading&&c(this).scrollTop()>.75*a-d){var e=c(this).data("type"),f=c(this).data("object");"search"===e?b.searchTerm&&b.doSearch(b.pages.search):b.loadItems(e,f)}}),a.previewer.bind("url",this.close),b.delegateEvents())},search:function(a){var b=c("#available-menu-items-search"),d=c("#available-menu-items .accordion-section").not(b);a&&this.searchTerm!==a.target.value&&(""===a.target.value||b.hasClass("open")?""===a.target.value&&(b.removeClass("open"),d.show(),b.find(".clear-results").removeClass("is-visible")):(d.fadeOut(100),b.find(".accordion-section-content").slideDown("fast"),b.addClass("open"),b.find(".clear-results").addClass("is-visible")),this.searchTerm=a.target.value,this.pages.search=1,this.doSearch(1))},doSearch:function(d){var e,f=this,g=c("#available-menu-items-search"),h=g.find(".accordion-section-content"),i=b.template("available-menu-item");if(f.currentRequest&&f.currentRequest.abort(),!(0>d)){if(d>1)g.addClass("loading-more"),h.attr("aria-busy","true"),b.a11y.speak(a.Menus.data.l10n.itemsLoadingMore);else if(""===f.searchTerm)return h.html(""),void b.a11y.speak("");g.addClass("loading"),f.loading=!0,e={"customize-menus-nonce":a.settings.nonce["customize-menus"],wp_customize:"on",search:f.searchTerm,page:d},f.currentRequest=b.ajax.post("search-available-menu-items-customizer",e),f.currentRequest.done(function(c){var e;1===d&&h.empty(),g.removeClass("loading loading-more"),h.attr("aria-busy","false"),g.addClass("open"),f.loading=!1,e=new a.Menus.AvailableItemCollection(c.items),f.collection.add(e.models),e.each(function(a){h.append(i(a.attributes))}),20>e.length?f.pages.search=-1:f.pages.search=f.pages.search+1,e&&d>1?b.a11y.speak(a.Menus.data.l10n.itemsFoundMore.replace("%d",e.length)):e&&1===d&&b.a11y.speak(a.Menus.data.l10n.itemsFound.replace("%d",e.length))}),f.currentRequest.fail(function(a){a.message&&(h.empty().append(c('<p class="nothing-found"></p>').text(a.message)),b.a11y.speak(a.message)),f.pages.search=-1}),f.currentRequest.always(function(){g.removeClass("loading loading-more"),h.attr("aria-busy","false"),f.loading=!1,f.currentRequest=null})}},initList:function(){var b=this;_.each(a.Menus.data.itemTypes,function(a){b.pages[a.type+":"+a.object]=0,b.loadItems(a.type,a.object)})},loadItems:function(d,e){var f,g,h,i,j=this;h=b.template("available-menu-item"),-1!==j.pages[d+":"+e]&&(i=c("#available-menu-items-"+d+"-"+e),i.find(".accordion-section-title").addClass("loading"),j.loading=!0,f={"customize-menus-nonce":a.settings.nonce["customize-menus"],wp_customize:"on",type:d,object:e,page:j.pages[d+":"+e]},g=b.ajax.post("load-available-menu-items-customizer",f),g.done(function(b){var c,f;return c=b.items,0===c.length?(0===j.pages[d+":"+e]&&i.addClass("cannot-expand").removeClass("loading").find(".accordion-section-title > button").prop("tabIndex",-1),void(j.pages[d+":"+e]=-1)):(c=new a.Menus.AvailableItemCollection(c),j.collection.add(c.models),f=i.find(".accordion-section-content"),c.each(function(a){f.append(h(a.attributes))}),void(j.pages[d+":"+e]+=1))}),g.fail(function(a){"undefined"!=typeof console&&console.error&&console.error(a)}),g.always(function(){i.find(".accordion-section-title").removeClass("loading"),j.loading=!1}))},itemSectionHeight:function(){var a,b,c,d;b=window.innerHeight,a=this.$el.find(".accordion-section:not( #available-menu-items-search ) .accordion-section-content"),c=46*(2+a.length)-13,d=b-c,d>120&&290>d&&a.css("max-height",d)},select:function(a){this.selected=c(a),this.selected.siblings(".menu-item-tpl").removeClass("selected"),this.selected.addClass("selected")},focus:function(a){this.select(c(a.currentTarget))},_submit:function(a){"keypress"===a.type&&13!==a.which&&32!==a.which||this.submit(c(a.currentTarget))},submit:function(a){var b,d;a||(a=this.selected),a&&this.currentMenuControl&&(this.select(a),b=c(this.selected).data("menu-item-id"),d=this.collection.findWhere({id:b}),d&&(this.currentMenuControl.addItemToMenu(d.attributes),c(a).find(".menu-item-handle").addClass("item-added")))},_submitLink:function(a){"keypress"===a.type&&13!==a.which||this.submitLink()},submitLink:function(){var b,d=c("#custom-menu-item-name"),e=c("#custom-menu-item-url");if(this.currentMenuControl){if(""===d.val())return void d.addClass("invalid");if(""===e.val()||"http://"===e.val())return void e.addClass("invalid");b={title:d.val(),url:e.val(),type:"custom",type_label:a.Menus.data.l10n.custom_label,object:""},this.currentMenuControl.addItemToMenu(b),e.val("http://"),d.val("")}},open:function(a){this.currentMenuControl=a,this.itemSectionHeight(),c("body").addClass("adding-menu-items"),_(this.currentMenuControl.getMenuItemControls()).each(function(a){a.collapseForm()}),this.$el.find(".selected").removeClass("selected"),this.$search.focus()},close:function(a){a=a||{},a.returnFocus&&this.currentMenuControl&&this.currentMenuControl.container.find(".add-new-menu-item").focus(),this.currentMenuControl=null,this.selected=null,c("body").removeClass("adding-menu-items"),c("#available-menu-items .menu-item-handle.item-added").removeClass("item-added"),this.$search.val("")},keyboardAccessible:function(a){var b=13===a.which,d=27===a.which,e=9===a.which&&a.shiftKey,f=c(a.target).is(this.$search);b&&!this.$search.val()||(f&&e?(this.currentMenuControl.container.find(".add-new-menu-item").focus(),a.preventDefault()):d&&this.close({returnFocus:!0}))}}),a.Menus.MenusPanel=a.Panel.extend({attachEvents:function(){a.Panel.prototype.attachEvents.call(this);var b=this,d=b.container.find(".panel-meta"),e=d.find(".customize-help-toggle"),f=d.find(".customize-panel-description"),g=c("#screen-options-wrap"),h=d.find(".customize-screen-options-toggle");h.on("click keydown",function(b){return a.utils.isKeydownButNotEnterEvent(b)?void 0:(b.preventDefault(),f.not(":hidden")&&(f.slideUp("fast"),e.attr("aria-expanded","false")),"true"===h.attr("aria-expanded")?(h.attr("aria-expanded","false"),d.removeClass("open"),d.removeClass("active-menu-screen-options"),g.slideUp("fast")):(h.attr("aria-expanded","true"),d.addClass("open"),d.addClass("active-menu-screen-options"),g.slideDown("fast")),!1)}),e.on("click keydown",function(b){a.utils.isKeydownButNotEnterEvent(b)||(b.preventDefault(),"true"===h.attr("aria-expanded")&&(h.attr("aria-expanded","false"),e.attr("aria-expanded","true"),d.addClass("open"),d.removeClass("active-menu-screen-options"),g.slideUp("fast"),f.slideDown("fast")))})},ready:function(){var a=this;this.container.find(".hide-column-tog").click(function(){var b=c(this),d=b.val();b.prop("checked")?a.checked(d):a.unchecked(d),a.saveManageColumnsState()}),this.container.find(".hide-column-tog").each(function(){var b=c(this),d=b.val();b.prop("checked")?a.checked(d):a.unchecked(d)})},saveManageColumnsState:_.debounce(function(){var a=this;a._updateHiddenColumnsRequest&&a._updateHiddenColumnsRequest.abort(),a._updateHiddenColumnsRequest=b.ajax.post("hidden-columns",{hidden:a.hidden(),screenoptionnonce:c("#screenoptionnonce").val(),page:"nav-menus"}),a._updateHiddenColumnsRequest.always(function(){a._updateHiddenColumnsRequest=null})},2e3),checked:function(a){this.container.addClass("field-"+a+"-active")},unchecked:function(a){this.container.removeClass("field-"+a+"-active")},hidden:function(){return c(".hide-column-tog").not(":checked").map(function(){var a=this.id;return a.substring(0,a.length-5)}).get().join(",")}}),a.Menus.MenuSection=a.Section.extend({initialize:function(b,d){var e=this;a.Section.prototype.initialize.call(e,b,d),e.deferred.initSortables=c.Deferred()},ready:function(){var b=this;if("undefined"==typeof b.params.menu_id)throw new Error("params.menu_id was not defined");b.active.validate=function(){return a.has(b.id)?!!a(b.id).get():!1},b.populateControls(),b.navMenuLocationSettings={},b.assignedLocations=new a.Value([]),a.each(function(a,c){var d=c.match(/^nav_menu_locations\[(.+?)]/);d&&(b.navMenuLocationSettings[d[1]]=a,a.bind(function(){b.refreshAssignedLocations()}))}),b.assignedLocations.bind(function(a){b.updateAssignedLocationsInSectionTitle(a)}),b.refreshAssignedLocations(),a.bind("pane-contents-reflowed",function(){b.container.parent().length&&(b.container.find(".menu-item .menu-item-reorder-nav button").attr({tabindex:"0","aria-hidden":"false"}),b.container.find(".menu-item.move-up-disabled .menus-move-up").attr({tabindex:"-1","aria-hidden":"true"}),b.container.find(".menu-item.move-down-disabled .menus-move-down").attr({tabindex:"-1","aria-hidden":"true"}),b.container.find(".menu-item.move-left-disabled .menus-move-left").attr({tabindex:"-1","aria-hidden":"true"}),b.container.find(".menu-item.move-right-disabled .menus-move-right").attr({tabindex:"-1","aria-hidden":"true"}))})},populateControls:function(){var b,c,d,e,f,g=this;b=g.id+"[name]",e=a.control(b),e||(e=new a.controlConstructor.nav_menu_name(b,{params:{type:"nav_menu_name",content:'<li id="customize-control-'+g.id.replace("[","-").replace("]","")+'-name" class="customize-control customize-control-nav_menu_name"></li>',label:a.Menus.data.l10n.menuNameLabel,active:!0,section:g.id,priority:0,settings:{"default":g.id}}}),a.control.add(e.id,e),e.active.set(!0)),d=a.control(g.id),d||(d=new a.controlConstructor.nav_menu(g.id,{params:{type:"nav_menu",content:'<li id="customize-control-'+g.id.replace("[","-").replace("]","")+'" class="customize-control customize-control-nav_menu"></li>',section:g.id,priority:998,active:!0,settings:{"default":g.id},menu_id:g.params.menu_id}}),a.control.add(d.id,d),d.active.set(!0)),c=g.id+"[auto_add]",f=a.control(c),f||(f=new a.controlConstructor.nav_menu_auto_add(c,{params:{type:"nav_menu_auto_add",content:'<li id="customize-control-'+g.id.replace("[","-").replace("]","")+'-auto-add" class="customize-control customize-control-nav_menu_auto_add"></li>',label:"",active:!0,section:g.id,priority:999,settings:{"default":g.id}}}),a.control.add(f.id,f),f.active.set(!0))},refreshAssignedLocations:function(){var a=this,b=a.params.menu_id,c=[];_.each(a.navMenuLocationSettings,function(a,d){a()===b&&c.push(d)}),a.assignedLocations.set(c)},updateAssignedLocationsInSectionTitle:function(b){var d,e=this;d=e.container.find(".accordion-section-title:first"),d.find(".menu-in-location").remove(),_.each(b,function(b){var e,f;e=c('<span class="menu-in-location"></span>'),f=a.Menus.data.locationSlugMappedToName[b],e.text(a.Menus.data.l10n.menuLocation.replace("%s",f)),d.append(e)}),e.container.toggleClass("assigned-to-menu-location",0!==b.length)},onChangeExpanded:function(b,d){var e=this;b&&(wpNavMenu.menuList=e.container.find(".accordion-section-content:first"),wpNavMenu.targetList=wpNavMenu.menuList,c("#menu-to-edit").removeAttr("id"),wpNavMenu.menuList.attr("id","menu-to-edit").addClass("menu"),_.each(a.section(e.id).controls(),function(a){"nav_menu_item"===a.params.type&&a.actuallyEmbed()}),"resolved"!==e.deferred.initSortables.state()&&(wpNavMenu.initSortables(),e.deferred.initSortables.resolve(wpNavMenu.menuList),a.control("nav_menu["+String(e.params.menu_id)+"]").reflowMenuItems())),a.Section.prototype.onChangeExpanded.call(e,b,d)}}),a.Menus.NewMenuSection=a.Section.extend({attachEvents:function(){var a=this;this.container.on("click",".add-menu-toggle",function(){a.expanded()?a.collapse():a.expand()})},onChangeExpanded:function(a){var b=this,c=b.container.find(".add-menu-toggle"),d=b.container.find(".new-menu-section-content"),e=b.container.closest(".wp-full-overlay-sidebar-content");a?(c.addClass("open"),c.attr("aria-expanded","true"),d.slideDown("fast",function(){e.scrollTop(e.height())})):(c.removeClass("open"),c.attr("aria-expanded","false"),d.slideUp("fast"),d.find(".menu-name-field").removeClass("invalid"))}}),a.Menus.MenuLocationControl=a.Control.extend({initialize:function(b,c){var d=this,e=b.match(/^nav_menu_locations\[(.+?)]/);d.themeLocation=e[1],a.Control.prototype.initialize.call(d,b,c)},ready:function(){var b=this,c=/^nav_menu\[(-?\d+)]/;b.setting.validate=function(a){return parseInt(a,10)},b.container.find(".edit-menu").on("click",function(){var c=b.setting();a.section("nav_menu["+c+"]").focus()}),b.setting.bind("change",function(){0===b.setting()?b.container.find(".edit-menu").addClass("hidden"):b.container.find(".edit-menu").removeClass("hidden")}),a.bind("add",function(a){var d,f,g=a.id.match(c);g&&!1!==a()&&(f=g[1],d=new Opt
                    
                
theme.min.js git://github.com/wordpress/wordpress.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,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")},searchContainer:a("#wpbody h1: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(c){this.terms!==c&&(this.terms=c,this.terms.length>0&&this.search(this.terms),""===this.terms&&(this.reset(b.data.themes),a("body").removeClass("no-results")),this.trigger("themes:update"))},search:function(c){var d,e,f,g,h,i;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 g=a.get("name").replace(/(<([^>]+)>)/gi,""),h=a.get("description").replace(/(<([^>]+)>)/gi,""),i=a.get("author").replace(/(<([^>]+)>)/gi,""),f=_.union([g,a.get("id"),h,i,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("themes: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("themes: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","click .theme-install":"installTheme","click .update-message":"updateTheme"},touchDrag:!1,initialize:function(){this.model.on("change",this.render,this)},render:function(){var a=this.model.toJSON();this.$el.html(this.html(a)).attr({tabindex:0,"aria-describedby":a.id+"-action "+a.id+"-name","data-slug":a.id}),this.activeTheme(),this.model.get("displayAuthor")&&this.$el.addClass("display-author")},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")||a(c.target).is(".theme-actions a, .update-message, .button-link, .notice-dismiss")||(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 c=c||window.event,this.touchDrag===!0?this.touchDrag=!1:void(a(c.target).not(".install-theme-preview").parents(".theme-actions").length||"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")},installTheme:function(b){var c=this;b.preventDefault(),wp.updates.maybeRequestFilesystemCredentials(b),a(document).on("wp-theme-install-success",function(a,b){c.model.get("id")===b.slug&&c.model.set({installed:!0})}),wp.updates.installTheme({slug:a(b.target).data("slug")})},updateTheme:function(b){var c=this;b.preventDefault(),wp.updates.maybeRequestFilesystemCredentials(b),a(document).on("wp-theme-update-success",function(a,b){c.model.off("change",c.render,c),c.model.get("id")===b.slug&&c.model.set({hasUpdate:!1,version:b.newVersion}),c.model.on("change",c.render,c)}),wp.updates.updateTheme({slug:a(b.target).parents("div.theme").first().data("slug")})}}),b.view.Details=wp.Backbone.View.extend({className:"theme-overlay",events:{click:"collapse","click .delete-theme":"deleteTheme","click .left":"previousTheme","click .right":"nextTheme","click #update-theme":"updateTheme"},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){_.delay(function(){a(".theme-wrap a.button-primary:visible").focus()},100),b.on("keydown.wp-themes",function(a){var c=b.find(".theme-header button:not(.disabled)").first(),d=b.find(".theme-actions a:visible").last();9===a.which&&(c[0]===a.target&&a.shiftKey?(d.focus(),a.preventDefault()):d[0]!==a.target||a.shiftKey||(c.focus(),a.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").prop("disabled",!0),this.model.cid===this.model.collection.at(this.model.collection.length-1).cid&&this.$el.find(".right").addClass("disabled").prop("disabled",!0)},closeOverlay:function(){a("body").removeClass("modal-open"),this.remove(),this.unbind(),this.trigger("theme:collapse")},updateTheme:function(b){var c=this;b.preventDefault(),wp.updates.maybeRequestFilesystemCredentials(b),a(document).on("wp-theme-update-success",function(a,b){c.model.get("id")===b.slug&&c.model.set({hasUpdate:!1,version:b.newVersion}),c.render()}),wp.updates.updateTheme({slug:a(b.target).data("slug")})},deleteTheme:function(c){var d=this,e=d.model.collection,f=b;c.preventDefault(),window.confirm(wp.themes.data.settings.confirmDelete)&&(wp.updates.maybeRequestFilesystemCredentials(c),a(document).one("wp-theme-delete-success",function(b,c){d.$el.find(".close").trigger("click"),a('[data-slug="'+c.slug+'"').css({backgroundColor:"#faafaa"}).fadeOut(350,function(){a(this).remove(),f.data.themes=_.without(f.data.themes,_.findWhere(f.data.themes,{id:c.slug})),a(".wp-filter-search").val(""),e.doSearch(""),e.remove(d.model),e.trigger("themes:update")})}),wp.updates.deleteTheme({slug:this.model.get("id")}))},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 .devices button":"previewDevice","click .previous-theme":"previousTheme","click .next-theme":"nextTheme",keyup:"keyEvent","click .theme-install":"installTheme"},html:b.template("theme-preview"),render:function(){var c,d=this,e=this.model.toJSON();this.$el.removeClass("iframe-ready").html(this.html(e)),c=this.$el.data("current-preview-device"),c&&d.tooglePreviewDeviceButtons(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()}),this.$el.find("iframe").one("load",function(){d.iframeLoaded()})},iframeLoaded:function(){this.$el.addClass("iframe-ready")},close:function(){return this.$el.fadeOut(200,function(){a("body").removeClass("theme-installer-active full-overlay-active"),b.focusedTheme&&b.focusedTheme.focus()}).removeClass("iframe-ready"),b.router.navigate(b.router.baseUrl("")),this.trigger("preview:close"),this.undelegateEvents(),this.unbind(),!1},collapse:function(b){var d=a(b.currentTarget);return"true"===d.attr("aria-expanded")?d.attr({"aria-expanded":"false","aria-label":c.expandSidebar}):d.attr({"aria-expanded":"true","aria-label":c.collapseSidebar}),this.$el.toggleClass("collapsed").toggleClass("expanded"),!1},previewDevice:function(b){var c=a(b.currentTarget).data("device");this.$el.removeClass("preview-desktop preview-tablet preview-mobile").addClass("preview-"+c).data("current-preview-device",c),this.tooglePreviewDeviceButtons(c)},tooglePreviewDeviceButtons:function(b){var c=a(".wp-full-overlay-footer .devices");c.find("button").removeClass("active").attr("aria-pressed",!1),c.find("button.preview-"+b).addClass("active").attr("aria-pressed",!0)},keyEvent:function(a){27===a.keyCode&&(this.undelegateEvents(),this.close()),39===a.keyCode&&_.once(this.nextTheme()),37===a.keyCode&&this.previousTheme()},installTheme:function(b){var c=this,d=a(b.target);b.preventDefault(),d.hasClass("disabled")||(wp.updates.maybeRequestFilesystemCredentials(b),a(document).on("wp-theme-install-success",function(){c.model.set({installed:!0})}),wp.updates.installTheme({slug:d.data("slug")}))}}),b.view.Themes=wp.Backbone.View.extend({className:"themes wp-clearfix",$overlay:a("div.theme-overlay"),index:0,count:a(".wrap .theme-count"),liveThemeCount:0,initialize:function(b){var c=this;this.parent=b.parent,this.setView("grid"),c.currentTheme(),this.listenTo(c.collection,"themes:update",function(){c.parent.page=0,c.currentTheme(),c.render(this)}),this.listenTo(c.collection,"query:success",function(a){_.isNumber(a)?(c.count.text(a),c.announceSearchResults(a)):(c.count.text(c.collection.length),c.announceSearchResults(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(b){c.overlay&&(a("#request-filesystem-credentials-dialog").is(":visible")||(39===b.keyCode&&c.overlay.nextTheme(),37===b.keyCode&&c.overlay.previousTheme(),27===b.keyCode&&c.overlay.collapse(b)))})},render:function(){this.$el.empty(),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.liveThemeCount=this.collection.count?this.collection.count:this.collection.length,this.count.text(this.liveThemeCount),b.isInstall||this.announceSearchResults(this.liveThemeCount)},renderThemes:function(d){var e=this;return e.instance=e.collection.paginate(d),0===e.instance.size()?void this.parent.trigger("theme:end"):(!b.isInstall&&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.isInstall&&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><h2 class="theme-name">'+c.addNew+"</h2></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,e,f=this;this.model=f.collection.get(c),b.router.navigate(b.router.baseUrl(b.router.themePath+this.model.id)),this.setView("detail"),a("body").addClass("modal-open"),this.ove
                    
                
customize-widgets.min.js git://github.com/wordpress/wordpress.git | JavaScript | 1 lines
                    
1!function(a,b){function c(a,b){function c(d){d||(a.expanded.unbind(c),b.focus())}a.focus(),a.expanded.bind(c)}function d(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 e(a){var b,c=d(a);return b="widget_"+c.id_base,c.number&&(b+="["+c.number+"]"),b}if(a&&a.customize){var f,g=a.customize;g.Widgets=g.Widgets||{},g.Widgets.savedWidgetIds={},g.Widgets.data=_wpCustomizeWidgetsSettings||{},f=g.Widgets.data.l10n,delete g.Widgets.data.l10n,g.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:null,params:[],width:null,height:null,search_matched:!0}),g.Widgets.WidgetCollection=Backbone.Collection.extend({model:g.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))})}}),g.Widgets.availableWidgets=new g.Widgets.WidgetCollection(g.Widgets.data.availableWidgets),g.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}),g.Widgets.SidebarCollection=Backbone.Collection.extend({model:g.Widgets.SidebarModel}),g.Widgets.registeredSidebars=new g.Widgets.SidebarCollection(g.Widgets.data.registeredSidebars),g.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, #available-widgets .customize-section-title").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()}),g.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,e;a||(a=this.selected),a&&this.currentSidebarControl&&(this.select(a),c=b(this.selected).data("widget-id"),d=this.collection.findWhere({id:c}),d&&(e=this.currentSidebarControl.addWidget(d.get("id_base")),e&&e.focus(),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(""),g.settings.browser.mobile||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}),this.currentSidebarControl&&g&&(h&&l||!h&&m)&&(this.currentSidebarControl.container.find(".add-new-widget").focus(),a.preventDefault())))}}),g.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)}},g.Widgets.WidgetControl=g.Control.extend({defaultExpandedArguments:{duration:"fast",completeCallback:b.noop},initialize:function(a,c){var d=this;d.widgetControlEmbedded=!1,d.widgetContentEmbedded=!1,d.expanded=new g.Value(!1),d.expandedArgumentsQueue=[],d.expanded.bind(function(a){var c=d.expandedArgumentsQueue.shift();c=b.extend({},d.defaultExpandedArguments,c),d.onChangeExpanded(a,c)}),d.altNotice=!0,g.Control.prototype.initialize.call(d,a,c)},ready:function(){var a=this;a.section()?g.section(a.section(),function(b){var c=function(d){d&&(a.embedWidgetControl(),b.expanded.unbind(c))};b.expanded()?c(!0):b.expanded.bind(c)}):a.embedWidgetControl()},embedWidgetControl:function(){var a,c=this;c.widgetControlEmbedded||(c.widgetControlEmbedded=!0,a=b(c.params.widget_control),c.container.append(a),c._setupModel(),c._setupWideWidget(),c._setupControlToggle(),c._setupWidgetTitle(),c._setupReorderUI(),c._setupHighlightEffects(),c._setupUpdateUI(),c._setupRemoveUI())},embedWidgetContent:function(){var a,c=this;c.embedWidgetControl(),c.widgetContentEmbedded||(c.widgetContentEmbedded=!0,a=b(c.params.widget_content),c.container.find(".widget-content:first").append(a),b(document).trigger("widget-added",[c.container.find(".widget:first")]))},_setupModel:function(){var a,b=this;a=function(){g.Widgets.savedWidgetIds[b.params.widget_id]=!0},g.bind("ready",a),g.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,f,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}),f=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(){f(),d.on("scroll",f),b(window).on("resize",f),e.on("expanded collapsed",f)}),this.container.on("collapsed",function(){d.off("scroll",f),b(window).off("resize",f),e.off("expanded collapsed",f)}),g.each(function(a){0===a.id.indexOf("sidebars_widgets[")&&a.bind(function(){h.container.hasClass("expanded")&&f()})}))},_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");a?c.text(": "+a):c.text("")},this.setting.bind(a),a()},_setupReorderUI:function(){var c,d,e,h,i,j=this;c=function(a){a.siblings(".selected").removeClass("selected"),a.addClass("selected");var b=a.data("id")===j.params.sidebar_id;j.container.find(".move-widget-btn").prop("disabled",b)},this.container.find(".widget-title-action").after(b(g.Widgets.data.tpl.widgetReorderNav)),i=_.template(g.Widgets.data.tpl.moveWidgetArea),d=b(i({sidebars:_(g.Widgets.registeredSidebars.toArray()).pluck("attributes")})),this.container.find(".widget-top").after(d),h=function(){var a,e=d.find("li"),f=0;a=e.filter(function(){return b(this).data("id")===j.params.sidebar_id}),e.each(function(){var d,e,h,i=b(this);d=i.data("id"),e=g.Widgets.registeredSidebars.get(d),h=e.get("is_rendered"),i.toggle(h),h&&(f+=1),i.hasClass("selected")&&!h&&c(a)}),f>1?j.container.find(".move-widget").show():j.container.find(".move-widget").hide()},h(),g.Widgets.registeredSidebars.on("change:is_rendered",h),e=this.container.find(".widget-reorder-nav"),e.find(".move-widget, .move-widget-down, .move-widget-up").each(function(){b(this).prepend(j.container.find(".widget-title").text()+": ")}).on("click keypress",function(c){if("keypress"!==c.type||13===c.which||32===c.which)if(b(this).focus(),b(this).is(".move-widget"))j.toggleWidgetMoveArea();else{var d=b(this).is(".move-widget-down"),e=b(this).is(".move-widget-up"),g=j.getWidgetSidebarPosition();if(e&&0===g||d&&g===j.getSidebarWidgetsControl().setting().length-1)return;e?(j.moveUp(),a.a11y.speak(f.widgetMovedUp)):(j.moveDown(),a.a11y.speak(f.widgetMovedDown)),b(this).focus()}}),this.container.find(".widget-area-select").on("click keypress","li",function(a){"keypress"===a.type&&13!==a.which&&32!==a.which||(a.preventDefault(),c(b(this)))}),this.container.find(".move-widget-btn").click(function(){j.getSidebarWidgetsControl().toggleReordering(!1);var a,b,c,d,e,f=j.params.sidebar_id,h=j.container.find(".widget-area-select li.selected").data("id");a=g("sidebars_widgets["+f+"]"),b=g("sidebars_widgets["+h+"]"),c=Array.prototype.slice.call(a()),d=Array.prototype.slice.call(b()),e=j.getWidgetSidebarPosition(),c.splice(e,1),d.push(j.params.widget_id),a(c),b(d),j.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,e,h,i=this;a=this.container.find(".widget:first"),c=a.find(".widget-content:first"),d=this.container.find(".widget-control-save"),d.val(f.saveBtnLabel),d.attr("title",f.saveBtnTooltip),d.removeClass("button-primary").addClass("button-secondary"),d.on("click",function(a){a.preventDefault(),i.updateWidget({disable_form:!0})}),e=_.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||this.checkValidity&&this.checkValidity())&&e()}),this.setting.previewer.channel.bind("synced",function(){i.container.removeClass("previewer-loading")}),g.previewer.bind("widget-updated",function(a){a===i.params.widget_id&&i.container.removeClass("previewer-loading")}),h=g.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=g.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(f.removeBtnLabel),a.attr("title",f.removeBtnTooltip)},this.params.is_new?g.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(";")},_getInputState:function(a){return a=b(a),a.is(":radio, :checkbox")?a.prop("checked"):a.is("select[multiple]")?a.find("option:selected").map(function(){return b(this).val()}).get():a.val()},_setInputState:function(a,c){a=b(a),a.is(":radio, :checkbox")?a.prop("checked",c):a.is("select[multiple]")?(c=b.isArray(c)?_.map(c,function(a){return String(a)}):[],a.find("option").each(function(){b(this).prop("selected",-1!==_.indexOf(c,String(this.value)))})):a.val(c)},getSidebarWidgetsControl:function(){var a,b;return a="sidebars_widgets["+this.params.sidebar_id+"]",(b=g.control(a))?b:void 0},updateWidget:function(c){var d,e,h,i,j,k,l,m,n,o,p,q=this;q.embedWidgetContent(),c=b.extend({instance:null,complete:null,ignoreActiveElement:!1},c),d=c.instance,e=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=g.state("processing"),n(n()+1),this.liveUpdateMode||this.container.addClass("widget-form-disabled"),k={},k.action="update-widget",k.wp_customize="on",k.nonce=g.settings.nonce["update-widget"],k.theme=g.settings.theme.stylesheet,k.customized=a.customize.previewer.query().customized,l=b.param(k),m=this._getInputs(i),m.each(function(){b(this).data("state"+j,q._getInputState(this))}),l+=d?"&"+b.param({sanitized_widget_setting:JSON.stringify(d)}):"&"+m.serialize(),l+="&"+i.find("~ :input").serialize(),this._previousUpdateRequest&&this._previousUpdateRequest.abort(),o=b.post(a.ajax.settings.url,l),this._previousUpdateRequest=o,o.done(function(a){var d,k,l,n,o=!1;return"0"===a?(g.previewer.preview.iframe.hide(),void g.previewer.login().done(function(){q.updateWidget(c),g.previewer.preview.iframe.show()})):"-1"===a?void g.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"
                    
                
calendar.js https://gitlab.com/oytunistrator/92five | JavaScript | 80 lines
                    
22var EventListModel = Backbone.Model.extend({});
                    
23var EventsList = Backbone.Collection.extend({
                    
24    model: EventListModel,
                    
                
ModelUtil.js https://gitlab.com/zouxc/elasticsearch-cn-out-of-box | JavaScript | 97 lines
                    
61 */
                    
62Backbone.Collection = Backbone.Collection.extend({
                    
63    sync:function (method, model, options) {
                    
                
CategoriesCollection.js https://gitlab.com/0072016/Polymer-cdnjs- | JavaScript | 98 lines
                    
7    // Extends Backbone.Router
                    
8    var Collection = Backbone.Collection.extend( {
                    
9
                    
                
SlideCollection.js https://gitlab.com/yutiansut/Strut | JavaScript | 88 lines
                    
23		 */
                    
24		return Backbone.Collection.extend({
                    
25			model: Slide,
                    
                
media.js https://gitlab.com/wilane/Booktype | JavaScript | 293 lines
                    
48
                    
49    var MediaCollection = Backbone.Collection.extend({
                    
50      model: MediaItem
                    
                
modelcollections.js git://github.com/jspears/bobamo.git | JavaScript | 125 lines
                    
41    });
                    
42    var Collection = Backbone.Collection.extend({
                    
43        model: Model,
                    
                
NodesState.js https://gitlab.com/zouxc/elasticsearch-cn-out-of-box | JavaScript | 84 lines
                    
27
                    
28var NodesState = Backbone.Collection.extend({
                    
29
                    
                
main.js https://gitlab.com/x33n/Backbone-Music-Store | JavaScript | 118 lines
                    
30
                    
31window.Genres = Backbone.Collection.extend({
                    
32	model: Genre
                    
                
Calcium.js https://gitlab.com/yutiansut/Strut | JavaScript | 72 lines
                    
41
                    
42	var Collection = Backbone.Collection.extend({
                    
43		toJSON: function(dontRecurse, inspectArrays) {
                    
                
systemtagsmappingcollection.js https://gitlab.com/wuhang2003/core | JavaScript | 87 lines
                    
18	 */
                    
19	var SystemTagsMappingCollection = OC.Backbone.Collection.extend(
                    
20		/** @lends OC.SystemTags.SystemTagsMappingCollection.prototype */ {
                    
                
systemtagscollection.js https://gitlab.com/wuhang2003/core | JavaScript | 89 lines
                    
23	 */
                    
24	var SystemTagsCollection = OC.Backbone.Collection.extend(
                    
25		/** @lends OC.SystemTags.SystemTagsCollection.prototype */ {
                    
                
Store.js https://gitlab.com/devlocker/frontend | JavaScript | 59 lines
                    
6  load() {
                    
7    var TodoItemsCollection = Backbone.Collection.extend({
                    
8      url: window.location.pathname + "/todo/items"
                    
                
tags.js https://gitlab.com/dannywillems/laverna | JavaScript | 106 lines
                    
14     */
                    
15    var Tags = Backbone.Collection.extend({
                    
16        model: Tag,
                    
                
localforage.backbone.js https://bitbucket.org/aswinvk28/smartpan-stock-drupal.git | JavaScript | 183 lines
                    
10//     var MyModel = Backbone.Model.extend({})
                    
11//     var MyCollection = Backbone.Collection.extend({
                    
12//         model: MyModel
                    
16//
                    
17//     var MyModel = Backbone.Collection.extend({
                    
18//         sync: Backbone.localforage.sync('ModelNamespace')
                    
19//     });
                    
20//     var MyCollection = Backbone.Collection.extend({
                    
21//         model: MyModel,
                    
                
graph.js https://gitlab.com/comptrans/VisualGraphX | JavaScript | 312 lines
                    
25        });
                    
26        var nodes = Backbone.Collection.extend({
                    
27            model: node
                    
36        });
                    
37        var links = Backbone.Collection.extend({
                    
38            mode: link
                    
51        });
                    
52        var graphs = Backbone.Collection.extend({
                    
53            model: graph
                    
                
notebooks.js https://gitlab.com/dannywillems/laverna | JavaScript | 94 lines
                    
13     */
                    
14    var Notebooks = Backbone.Collection.extend({
                    
15        model: Notebook,
                    
                
todos.js https://gitlab.com/oytunistrator/92five | JavaScript | 105 lines
                    
34    });
                    
35    var TodoList = Backbone.Collection.extend({
                    
36        model: TodoModel,
                    
                
models.js https://gitlab.com/juanito.abelo/nlmobile | JavaScript | 75 lines
                    
44   */
                    
45  var Shortcodes = Backbone.Collection.extend({
                    
46    model: Shortcode,
                    
                
client.coffee https://github.com/setdirection/viewjs.git | CoffeeScript | 478 lines
                    
128  Item = Backbone.Model.extend()
                    
129  List = new (Backbone.Collection.extend(model: Item))
                    
130  render_count = 0
                    
                
quiz_reports.js https://gitlab.com/ykazemi/canvas-lms | JavaScript | 45 lines
                    
12
                    
13  return Backbone.Collection.extend({
                    
14    model: QuizReport,
                    
                
app.js https://bitbucket.org/aswinvk28/smartpan-stock-drupal.git | JavaScript | 747 lines
                    
280    
                    
281    Stock.WidgetCollection = Backbone.Collection.extend({
                    
282        initialize: function() {
                    
                
InstanceModel.js git://github.com/ging/horizon-js.git | JavaScript | 204 lines
                    
187
                    
188var Instances = Backbone.Collection.extend({
                    
189    
                    
                
FieldModel.js https://bitbucket.org/aswinvk28/smartpan-stock-drupal.git | JavaScript | 260 lines
                    
255
                    
256  Drupal.edit.FieldCollection = Backbone.Collection.extend({
                    
257    model: Drupal.edit.FieldModel
                    
                
bigdesk_extension.js https://gitlab.com/zouxc/elasticsearch-cn-out-of-box | JavaScript | 59 lines
                    
39
                    
40Backbone.Collection = Backbone.Collection.extend({
                    
41    sync: function(method, model, options) {
                    
                
NodeStatsListModel.js https://gitlab.com/zouxc/elasticsearch-cn-out-of-box | JavaScript | 53 lines
                    
24 */
                    
25var NodeStatsListModel = Backbone.Model.extend({//Backbone.Collection.extend({
                    
26    defaults:{
                    
                
MappingsModel.js https://gitlab.com/zouxc/elasticsearch-cn-out-of-box | JavaScript | 50 lines
                    
18
                    
19var MappingsModel = Backbone.Collection.extend({
                    
20    model:MappingSimple,
                    
                
default.htm git://github.com/ServiceStack/ServiceStack.git | HTML | 0 lines
                    
59            // server.
                    
60            window.TodoList = Backbone.Collection.extend({
                    
61
                    
                
nuxibaCalls.js https://gitlab.com/Alberto.SS/crm_verquet | JavaScript | 40 lines
                    
13
                    
14var NuxibaCallCollection = Backbone.Collection.extend({
                    
15	model: NuxibaCall,
                    
                
ClusterState.js https://gitlab.com/zouxc/elasticsearch-cn-out-of-box | JavaScript | 63 lines
                    
23
                    
24var ClusterState = Backbone.Collection.extend({
                    
25
                    
                
posts.js https://gitlab.com/craftbynick/Circular | JavaScript | 28 lines
                    
1Circular.Collections.Posts = Backbone.Collection.extend({
                    
2	url: "api/posts",
                    
                
projectusers.js https://gitlab.com/oytunistrator/92five | JavaScript | 44 lines
                    
11});
                    
12var UserCollection = Backbone.Collection.extend({
                    
13    model: UserModel,
                    
                
sandboxes_adapter.js https://gitlab.com/wilane/heka | JavaScript | 122 lines
                    
22    */
                    
23    var Sandboxes = Backbone.Collection.extend({
                    
24      model: Sandbox,
                    
                
models.js https://github.com/jedp/pondr.git | JavaScript | 515 lines
                    
78
                    
79var ResponseCollection = Backbone.Collection.extend({
                    
80  model: Response
                    
173
                    
174var CommentCollection = Backbone.Collection.extend({
                    
175  model: Comment
                    
300
                    
301var WishCollection = Backbone.Collection.extend({ model: Wish });
                    
302
                    
                
timesheet.js https://gitlab.com/oytunistrator/92five | JavaScript | 65 lines
                    
3var TimesheetEntryModel = Backbone.Model.extend({});
                    
4var TimesheetEntryList = Backbone.Collection.extend({
                    
5    model: TimesheetEntryModel,
                    
                
TodoToDay.js https://gitlab.com/Dakarlug/backbonejs_tutorial_server_client | JavaScript | 168 lines
                    
15//Collection 
                    
16TodoDodayCollection = Backbone.Collection.extend({
                    
17   model : ToDoToDay ,
                    
                
collectors.js https://gitlab.com/geeta7/drupal | JavaScript | 35 lines
                    
4
                    
5  Drupal.webprofiler.collectors.Collectors = Backbone.Collection.extend({
                    
6    model: Drupal.webprofiler.models.Collector,
                    
                
IndicesStatus.js https://gitlab.com/zouxc/elasticsearch-cn-out-of-box | JavaScript | 97 lines
                    
23
                    
24var IndicesStatus = Backbone.Collection.extend({
                    
25
                    
                
collections.html https://gitlab.com/foxtori8946/Redis-Node.js | HTML | 33 lines
                    
14    var Chat = Backbone.Model.extend({});
                    
15    var ChatCollection = Backbone.Collection.extend({
                    
16        model: Chat
                    
                
entry-collection.js https://gitlab.com/mlnkv/keeweb | JavaScript | 47 lines
                    
6
                    
7var EntryCollection = Backbone.Collection.extend({
                    
8    model: EntryModel,
                    
                
versioncollection.js https://gitlab.com/wuhang2003/core | JavaScript | 97 lines
                    
14	 */
                    
15	var VersionCollection = OC.Backbone.Collection.extend({
                    
16		model: OCA.Versions.VersionModel,
                    
                
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,
                    
                
plugins.js https://gitlab.com/karouf/heka | JavaScript | 58 lines
                    
14    */
                    
15    var Plugins = Backbone.Collection.extend({
                    
16      model: Plugin,
                    
                
collections.js https://gitlab.com/matt-oakes/photo_project | JavaScript | 55 lines
                    
2
                    
3App.collections.SetStore = Backbone.Collection.extend({
                    
4    model: App.models.Set,
                    
27
                    
28App.collections.PhotoStore = Backbone.Collection.extend({
                    
29    model: App.models.Photo,
                    
                
test.js https://github.com/setdirection/viewjs.git | JavaScript | 1056 lines
                    
215    Item = Backbone.Model.extend();
                    
216    List = new (Backbone.Collection.extend({
                    
217      model: Item
                    
                
projectuserlist.js https://gitlab.com/oytunistrator/92five | JavaScript | 74 lines
                    
9    });
                    
10    var PluginCollection = Backbone.Collection.extend({
                    
11        model: Plugin,
                    
                
backbonejs-router-sample.html https://github.com/id774/sandbox.git | HTML | 149 lines
                    
41            // ブログ。
                    
42            var Blog = Backbone.Collection.extend({
                    
43                model: Entry
                    
                
PedidosList.js https://gitlab.com/Alberto.SS/crm_verquet | JavaScript | 93 lines
                    
28
                    
29var ProductoPedidoCollection = Backbone.Collection.extend({
                    
30 model: ProductoPedido,
                    
46
                    
47var PedidosCobroCollection = Backbone.Collection.extend({
                    
48 model: PedidoCobro,
                    
                
 

Source

Language