├── .gitignore ├── README.md ├── css └── backbone.upload-manager.css ├── docs └── options.md ├── images └── sprite.png ├── js └── backbone.upload-manager.js ├── psd └── sprite.psd ├── sample ├── index.html └── vendor │ ├── css │ ├── bootstrap-2.3.1.css │ └── bootstrap-responsive-2.3.1.css │ └── js │ ├── backbone-1.0.0.js │ ├── backbone.defered-view-loader.js │ ├── jquery-1.9.1.js │ ├── jquery.fileupload.js │ ├── jquery.iframe-transport.js │ ├── jquery.ui.widget.js │ └── underscore-1.4.4.js └── templates ├── upload-manager.file └── upload-manager.main /.gitignore: -------------------------------------------------------------------------------- 1 | /.settings 2 | /.project 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Backbone Upload Manager 2 | 3 | A simple upload manager written with Backbone.js. 4 | 5 | * [Demonstration and usage](http://sroze.github.io/backbone-upload-manager) 6 | 7 | 8 | 9 | [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/sroze/backbone-upload-manager/trend.png)](https://bitdeli.com/free "Bitdeli Badge") 10 | 11 | -------------------------------------------------------------------------------- /css/backbone.upload-manager.css: -------------------------------------------------------------------------------- 1 | .upload-manager { 2 | border: 1px solid #CCCCCC; 3 | border-radius: 4px 4px 4px 4px; 4 | -webkit-border-radius: 4px 4px 4px 4px; 5 | -moz-border-radius: 4px 4px 4px 4px; 6 | box-shadow: 0 0 5px rgba(0, 0, 0, 0.2); 7 | -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.2); 8 | -moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.2); 9 | text-align: left; 10 | } 11 | .upload-manager footer { 12 | background: #F4F4F4; 13 | border-top: 1px solid #DDDDDD; 14 | padding: 10px; 15 | } 16 | .upload-manager .fileinput-button input { 17 | cursor: pointer; 18 | direction: ltr; 19 | font-size: 23px; 20 | margin: 0; 21 | opacity: 0; 22 | -webkit-opacity: 0; 23 | -moz-opacity: 0; 24 | position: absolute; 25 | right: 0; 26 | top: 0; 27 | transform: translate(-300px, 0px) scale(4); 28 | -webkit-transform: translate(-300px, 0px) scale(4); 29 | -moz-transform: translate(-300px, 0px) scale(4); 30 | -ms-transform: translate(-300px, 0px) scale(4); 31 | -o-transform: translate(-300px, 0px) scale(4); 32 | } 33 | .upload-manager .fileinput-button { 34 | overflow: hidden; 35 | position: relative; 36 | } 37 | .upload-manager .message.error { 38 | color: #BD362F; 39 | } 40 | .upload-manager .message.done { 41 | color: #57ba48; 42 | } 43 | .upload-manager .progress { 44 | position: relative; 45 | } 46 | .upload-manager .progress .progress-label { 47 | position: absolute; 48 | width: 100%; 49 | text-align: center; 50 | text-shadow: 0 0 3px rgba(0, 0, 0, 0.9); 51 | color: #fff; 52 | } 53 | .upload-manager i { 54 | background: url("../images/sprite.png"); 55 | display: inline-block; 56 | vertical-align: middle; 57 | margin: 4px; 58 | height: 16px; 59 | width: 16px; 60 | } 61 | .upload-manager .icon-cancel { 62 | background-position: 0 0; 63 | } 64 | .upload-manager .icon-start { 65 | background-position: -32px 0; 66 | } 67 | .upload-manager .icon-plus { 68 | background-position: -80px 0; 69 | } 70 | .upload-manager .icon-error { 71 | background-position: -96px 0; 72 | } 73 | .upload-manager .icon-success { 74 | background-position: -112px 0; 75 | } 76 | .upload-manager .icon-remove { 77 | background-position: -144px 0; 78 | } 79 | 80 | -------------------------------------------------------------------------------- /docs/options.md: -------------------------------------------------------------------------------- 1 | # Options 2 | 3 | There is the list of available options. 4 | 5 | ## -------------------------------------------------------------------------------- /images/sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sroze/backbone-upload-manager/abcca1d0b253ab87a10867637c9e0d3aa3577353/images/sprite.png -------------------------------------------------------------------------------- /js/backbone.upload-manager.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Backbone Upload Manager v1.0.0 4 | * 5 | * Copyright (c) 2013 Samuel ROZE 6 | * 7 | * License and more information at: 8 | * http://github.com/sroze/backbone-upload-manager 9 | */ 10 | (function(Backbone){ 11 | Backbone.UploadManager = Backbone.DeferedView.extend({ 12 | /** 13 | * Default options, that will be merged with the passed. 14 | * 15 | */ 16 | defaults: { 17 | templates: { 18 | main: '/templates/upload-manager.main.default', 19 | file: '/templates/upload-manager.file.default' 20 | }, 21 | uploadUrl: '/upload', 22 | autoUpload: false, 23 | fileUploadId: 'fileupload', 24 | startUploadsId: 'start-uploads-button', 25 | cancelUploadsId: 'cancel-uploads-button', 26 | dataType: 'json' 27 | }, 28 | 29 | /** 30 | * An integer used to track the files by a unique 31 | * identifier. 32 | * 33 | */ 34 | file_id: 0, 35 | 36 | /** 37 | * View container class. 38 | * 39 | */ 40 | className: 'upload-manager', 41 | 42 | /** 43 | * Initialize upload manager options 44 | * 45 | */ 46 | initialize: function (options) 47 | { 48 | // Merge options 49 | this.options = $.extend(this.defaults, options); 50 | 51 | // Update template name 52 | this.templateName = this.options.templates.main; 53 | 54 | // Create the file list 55 | this.files = new Backbone.UploadManager.FileCollection(); 56 | 57 | // Create the file-upload wrapper 58 | this.uploadProcess = $('').fileupload({ 59 | dataType: this.options.dataType, 60 | url: this.options.uploadUrl, 61 | formData: this.options.formData, 62 | autoUpload: this.options.autoUpload, 63 | singleFileUploads: true 64 | }); 65 | 66 | // Add upload process events handlers 67 | this.bindProcessEvents(); 68 | 69 | // Add local events handlers 70 | this.bindLocal(); 71 | }, 72 | 73 | /** 74 | * Bind local events. 75 | * 76 | */ 77 | bindLocal: function () 78 | { 79 | var self = this; 80 | this.on('fileadd', function (file) { 81 | // Add it to current list 82 | self.files.add(file); 83 | 84 | // Create the view 85 | self.renderFile(file); 86 | }).on('fileprogress', function (file, progress) { 87 | file.progress(progress); 88 | }).on('filefail', function (file, error) { 89 | file.fail(error); 90 | }).on('filedone', function (file, data) { 91 | file.done(data.result); 92 | }); 93 | 94 | // When collection changes 95 | this.files.on('all', this.update, this); 96 | }, 97 | 98 | /** 99 | * Render a file. 100 | * 101 | */ 102 | renderFile: function (file) 103 | { 104 | var file_view = new Backbone.UploadManager.FileView($.extend(this.options, {model: file})); 105 | $('#file-list', self.el).append(file_view.deferedRender().el); 106 | }, 107 | 108 | /** 109 | * Update the view without full rendering. 110 | * 111 | */ 112 | update: function () 113 | { 114 | var with_files_elements = $('#' + this.options.cancelUploadsId + ', #' + this.options.startUploadsId, this.el); 115 | var without_files_elements = $('#file-list .no-data', this.el); 116 | if (this.files.length > 0) { 117 | with_files_elements.removeClass('hidden'); 118 | without_files_elements.addClass('hidden'); 119 | } else { 120 | with_files_elements.addClass('hidden'); 121 | without_files_elements.removeClass('hidden'); 122 | } 123 | }, 124 | 125 | /** 126 | * Bind events on the upload processor. 127 | * 128 | */ 129 | bindProcessEvents: function () 130 | { 131 | var self = this; 132 | this.uploadProcess.on('fileuploadadd', function (e, data) { 133 | // Create an array in which the file objects 134 | // will be stored. 135 | data.uploadManagerFiles = []; 136 | 137 | // A file is added, process for each file. 138 | // Note: every times, the data.files array length is 1 because 139 | // of "singleFileUploads" option. 140 | $.each(data.files, function (index, file_data) { 141 | // Create the file object 142 | file_data.id = self.file_id++; 143 | var file = new Backbone.UploadManager.File({ 144 | data: file_data, 145 | processor: data 146 | }); 147 | 148 | // Add file in data 149 | data.uploadManagerFiles.push(file); 150 | 151 | // Trigger event 152 | self.trigger('fileadd', file); 153 | }); 154 | }).on('fileuploadprogress', function (e, data) { 155 | $.each(data.uploadManagerFiles, function (index, file) { 156 | self.trigger('fileprogress', file, data); 157 | }); 158 | }).on('fileuploadfail', function (e, data) { 159 | $.each(data.uploadManagerFiles, function (index, file) { 160 | var error = "Unknown error"; 161 | if (typeof data.errorThrown == "string") { 162 | error = data.errorThrown; 163 | } else if (typeof data.errorThrown == "object") { 164 | error = data.errorThrown.message; 165 | } else if (data.result) { 166 | if (data.result.error) { 167 | error = data.result.error; 168 | } else if (data.result.files && data.result.files[index] && data.result.files[index].error) { 169 | error = data.result.files[index].error; 170 | } else { 171 | error = "Unknown remote error"; 172 | } 173 | } 174 | 175 | self.trigger('filefail', file, error); 176 | }); 177 | }).on('fileuploaddone', function (e, data) { 178 | $.each(data.uploadManagerFiles, function (index, file) { 179 | self.trigger('filedone', file, data); 180 | }); 181 | }); 182 | }, 183 | 184 | /** 185 | * Render the main part of upload manager. 186 | * 187 | */ 188 | render: function () 189 | { 190 | $(this.el).html(this.template()); 191 | 192 | // Update view 193 | this.update(); 194 | 195 | // Add add files handler 196 | var input = $('#' + this.options.fileUploadId, this.el), self = this; 197 | input.on('change', function (){ 198 | self.uploadProcess.fileupload('add', { 199 | fileInput: $(this) 200 | }); 201 | }); 202 | 203 | // Add cancel all handler 204 | $('#' + this.options.cancelUploadsId, this.el).click(function(){ 205 | while (self.files.length) { 206 | self.files.at(0).cancel(); 207 | } 208 | }); 209 | 210 | // Add start uploads handler 211 | $('#' + this.options.startUploadsId, this.el).click(function(){ 212 | self.files.each(function(file){ 213 | file.start(); 214 | }); 215 | }); 216 | 217 | // Render current files 218 | $.each(this.files, function (i, file) { 219 | self.renderFile(file); 220 | }); 221 | } 222 | }, { 223 | /** 224 | * This model represents a file. 225 | * 226 | */ 227 | File: Backbone.Model.extend({ 228 | state: "pending", 229 | 230 | /** 231 | * Start upload. 232 | * 233 | */ 234 | start: function () 235 | { 236 | if (this.isPending()) { 237 | this.get('processor').submit(); 238 | this.state = "running"; 239 | 240 | // Dispatch event 241 | this.trigger('filestarted', this); 242 | } 243 | }, 244 | 245 | /** 246 | * Cancel a file upload. 247 | * 248 | */ 249 | cancel: function () 250 | { 251 | this.get('processor').abort(); 252 | this.destroy(); 253 | 254 | // Dispatch event 255 | this.state = "canceled"; 256 | this.trigger('filecanceled', this); 257 | }, 258 | 259 | /** 260 | * Notify file that progress updated. 261 | * 262 | */ 263 | progress: function (data) 264 | { 265 | // Dispatch event 266 | this.trigger('fileprogress', this.get('processor').progress()); 267 | }, 268 | 269 | /** 270 | * Notify file that upload failed. 271 | * 272 | */ 273 | fail: function (error) 274 | { 275 | // Dispatch event 276 | this.state = "error"; 277 | this.trigger('filefailed', error); 278 | }, 279 | 280 | /** 281 | * Notify file that upload is done. 282 | * 283 | */ 284 | done: function (result) 285 | { 286 | // Dispatch event 287 | this.state = "error"; 288 | this.trigger('filedone', result); 289 | }, 290 | 291 | /** 292 | * Is this file pending to be uploaded ? 293 | * 294 | */ 295 | isPending: function () 296 | { 297 | return this.getState() == "pending"; 298 | }, 299 | 300 | /** 301 | * Is this file currently uploading ? 302 | * 303 | */ 304 | isRunning: function () 305 | { 306 | return this.getState() == "running"; 307 | }, 308 | 309 | /** 310 | * Is this file uploaded ? 311 | * 312 | */ 313 | isDone: function () 314 | { 315 | return this.getState() == "done"; 316 | }, 317 | 318 | /** 319 | * Is this upload in error ? 320 | * 321 | */ 322 | isError: function () 323 | { 324 | return this.getState() == "error" || this.getState == "canceled"; 325 | }, 326 | 327 | /** 328 | * Get the file state. 329 | * 330 | */ 331 | getState: function () 332 | { 333 | return this.state; 334 | } 335 | }), 336 | 337 | /** 338 | * This is a file collection, used to manage the selected 339 | * and processing files. 340 | * 341 | */ 342 | FileCollection: Backbone.Collection.extend({ 343 | model: this.File 344 | }), 345 | 346 | /** 347 | * A file view, which is the view that manage a single file 348 | * process in the upload manager. 349 | * 350 | */ 351 | FileView: Backbone.DeferedView.extend({ 352 | className: 'upload-manager-file row-fluid', 353 | 354 | initialize: function (options) { 355 | this.templateName = options.templates.file; 356 | this.processUploadMsg = options.processUploadMsg; 357 | this.doneMsg = options.doneMsg; 358 | 359 | // Bind model events 360 | this.model.on('destroy', this.close, this); 361 | this.model.on('fileprogress', this.updateProgress, this); 362 | this.model.on('filefailed', this.hasFailed, this); 363 | this.model.on('filedone', this.hasDone, this); 364 | 365 | // In each case, update view 366 | this.model.on('all', this.update, this); 367 | }, 368 | 369 | /** 370 | * Render the file item view. 371 | * 372 | */ 373 | render: function () 374 | { 375 | $(this.el).html(this.template(this.computeData())); 376 | 377 | // Bind events 378 | this.bindEvents(); 379 | 380 | // Update elements 381 | this.update(); 382 | }, 383 | 384 | /** 385 | * Update upload progress. 386 | * 387 | */ 388 | updateProgress: function (progress) 389 | { 390 | var percent = parseInt(progress.loaded / progress.total * 100, 10); 391 | var progressHTML = this.getHelpers().displaySize(progress.loaded)+' of '+this.getHelpers().displaySize(progress.total); 392 | if (percent >= 100 && this.processUploadMsg) { progressHTML = this.processUploadMsg; } 393 | 394 | $('.progress', this.el) 395 | .find('.bar') 396 | .css('width', percent+'%') 397 | .parent() 398 | .find('.progress-label') 399 | .html(progressHTML); 400 | }, 401 | 402 | /** 403 | * File upload has failed. 404 | * 405 | */ 406 | hasFailed: function (error) 407 | { 408 | $('.message', this.el).html(' '+error); 409 | }, 410 | 411 | /** 412 | * File upload is done. 413 | * 414 | */ 415 | hasDone: function (result) 416 | { 417 | $('.message', this.el).html(' ' + (this.doneMsg || 'Uploaded')); 418 | }, 419 | 420 | /** 421 | * Update view without complete rendering. 422 | * 423 | */ 424 | update: function () 425 | { 426 | var when_pending = $('.size, #btn-cancel', this.el), 427 | when_running = $('.progress, #btn-cancel', this.el), 428 | when_done = $('.message, #btn-clear', this.el); 429 | 430 | if (this.model.isPending()) { 431 | when_running.add(when_done).addClass('hidden'); 432 | when_pending.removeClass('hidden'); 433 | } else if (this.model.isRunning()) { 434 | when_pending.add(when_done).addClass('hidden'); 435 | when_running.removeClass('hidden'); 436 | } else if (this.model.isDone() || this.model.isError()) { 437 | when_pending.add(when_running).addClass('hidden'); 438 | when_done.removeClass('hidden'); 439 | } 440 | }, 441 | 442 | /** 443 | * Bind local elements events. 444 | * 445 | */ 446 | bindEvents: function () 447 | { 448 | var self = this; 449 | 450 | // DOM events 451 | $('#btn-cancel', this.el).click(function(){ 452 | self.model.cancel(); 453 | self.collection.remove(self.model); 454 | }); 455 | $('#btn-clear', this.el).click(function(){ 456 | self.model.destroy(); 457 | self.collection.remove(self.model); 458 | }); 459 | }, 460 | 461 | /** 462 | * Compute data to be passed to the view. 463 | * 464 | */ 465 | computeData: function () 466 | { 467 | return $.extend(this.getHelpers(), this.model.get('data')); 468 | } 469 | }) 470 | }); 471 | })(Backbone); 472 | -------------------------------------------------------------------------------- /psd/sprite.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sroze/backbone-upload-manager/abcca1d0b253ab87a10867637c9e0d3aa3577353/psd/sprite.psd -------------------------------------------------------------------------------- /sample/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Backbone Upload Manager Sample 6 | 7 | 8 | 9 | 10 | 11 | 12 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 54 | 55 | -------------------------------------------------------------------------------- /sample/vendor/css/bootstrap-responsive-2.3.1.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Responsive v2.3.1 3 | * 4 | * Copyright 2012 Twitter, Inc 5 | * Licensed under the Apache License v2.0 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Designed and built with all the love in the world @twitter by @mdo and @fat. 9 | */ 10 | 11 | .clearfix { 12 | *zoom: 1; 13 | } 14 | 15 | .clearfix:before, 16 | .clearfix:after { 17 | display: table; 18 | line-height: 0; 19 | content: ""; 20 | } 21 | 22 | .clearfix:after { 23 | clear: both; 24 | } 25 | 26 | .hide-text { 27 | font: 0/0 a; 28 | color: transparent; 29 | text-shadow: none; 30 | background-color: transparent; 31 | border: 0; 32 | } 33 | 34 | .input-block-level { 35 | display: block; 36 | width: 100%; 37 | min-height: 30px; 38 | -webkit-box-sizing: border-box; 39 | -moz-box-sizing: border-box; 40 | box-sizing: border-box; 41 | } 42 | 43 | @-ms-viewport { 44 | width: device-width; 45 | } 46 | 47 | .hidden { 48 | display: none; 49 | visibility: hidden; 50 | } 51 | 52 | .visible-phone { 53 | display: none !important; 54 | } 55 | 56 | .visible-tablet { 57 | display: none !important; 58 | } 59 | 60 | .hidden-desktop { 61 | display: none !important; 62 | } 63 | 64 | .visible-desktop { 65 | display: inherit !important; 66 | } 67 | 68 | @media (min-width: 768px) and (max-width: 979px) { 69 | .hidden-desktop { 70 | display: inherit !important; 71 | } 72 | .visible-desktop { 73 | display: none !important ; 74 | } 75 | .visible-tablet { 76 | display: inherit !important; 77 | } 78 | .hidden-tablet { 79 | display: none !important; 80 | } 81 | } 82 | 83 | @media (max-width: 767px) { 84 | .hidden-desktop { 85 | display: inherit !important; 86 | } 87 | .visible-desktop { 88 | display: none !important; 89 | } 90 | .visible-phone { 91 | display: inherit !important; 92 | } 93 | .hidden-phone { 94 | display: none !important; 95 | } 96 | } 97 | 98 | .visible-print { 99 | display: none !important; 100 | } 101 | 102 | @media print { 103 | .visible-print { 104 | display: inherit !important; 105 | } 106 | .hidden-print { 107 | display: none !important; 108 | } 109 | } 110 | 111 | @media (min-width: 1200px) { 112 | .row { 113 | margin-left: -30px; 114 | *zoom: 1; 115 | } 116 | .row:before, 117 | .row:after { 118 | display: table; 119 | line-height: 0; 120 | content: ""; 121 | } 122 | .row:after { 123 | clear: both; 124 | } 125 | [class*="span"] { 126 | float: left; 127 | min-height: 1px; 128 | margin-left: 30px; 129 | } 130 | .container, 131 | .navbar-static-top .container, 132 | .navbar-fixed-top .container, 133 | .navbar-fixed-bottom .container { 134 | width: 1170px; 135 | } 136 | .span12 { 137 | width: 1170px; 138 | } 139 | .span11 { 140 | width: 1070px; 141 | } 142 | .span10 { 143 | width: 970px; 144 | } 145 | .span9 { 146 | width: 870px; 147 | } 148 | .span8 { 149 | width: 770px; 150 | } 151 | .span7 { 152 | width: 670px; 153 | } 154 | .span6 { 155 | width: 570px; 156 | } 157 | .span5 { 158 | width: 470px; 159 | } 160 | .span4 { 161 | width: 370px; 162 | } 163 | .span3 { 164 | width: 270px; 165 | } 166 | .span2 { 167 | width: 170px; 168 | } 169 | .span1 { 170 | width: 70px; 171 | } 172 | .offset12 { 173 | margin-left: 1230px; 174 | } 175 | .offset11 { 176 | margin-left: 1130px; 177 | } 178 | .offset10 { 179 | margin-left: 1030px; 180 | } 181 | .offset9 { 182 | margin-left: 930px; 183 | } 184 | .offset8 { 185 | margin-left: 830px; 186 | } 187 | .offset7 { 188 | margin-left: 730px; 189 | } 190 | .offset6 { 191 | margin-left: 630px; 192 | } 193 | .offset5 { 194 | margin-left: 530px; 195 | } 196 | .offset4 { 197 | margin-left: 430px; 198 | } 199 | .offset3 { 200 | margin-left: 330px; 201 | } 202 | .offset2 { 203 | margin-left: 230px; 204 | } 205 | .offset1 { 206 | margin-left: 130px; 207 | } 208 | .row-fluid { 209 | width: 100%; 210 | *zoom: 1; 211 | } 212 | .row-fluid:before, 213 | .row-fluid:after { 214 | display: table; 215 | line-height: 0; 216 | content: ""; 217 | } 218 | .row-fluid:after { 219 | clear: both; 220 | } 221 | .row-fluid [class*="span"] { 222 | display: block; 223 | float: left; 224 | width: 100%; 225 | min-height: 30px; 226 | margin-left: 2.564102564102564%; 227 | *margin-left: 2.5109110747408616%; 228 | -webkit-box-sizing: border-box; 229 | -moz-box-sizing: border-box; 230 | box-sizing: border-box; 231 | } 232 | .row-fluid [class*="span"]:first-child { 233 | margin-left: 0; 234 | } 235 | .row-fluid .controls-row [class*="span"] + [class*="span"] { 236 | margin-left: 2.564102564102564%; 237 | } 238 | .row-fluid .span12 { 239 | width: 100%; 240 | *width: 99.94680851063829%; 241 | } 242 | .row-fluid .span11 { 243 | width: 91.45299145299145%; 244 | *width: 91.39979996362975%; 245 | } 246 | .row-fluid .span10 { 247 | width: 82.90598290598291%; 248 | *width: 82.8527914166212%; 249 | } 250 | .row-fluid .span9 { 251 | width: 74.35897435897436%; 252 | *width: 74.30578286961266%; 253 | } 254 | .row-fluid .span8 { 255 | width: 65.81196581196582%; 256 | *width: 65.75877432260411%; 257 | } 258 | .row-fluid .span7 { 259 | width: 57.26495726495726%; 260 | *width: 57.21176577559556%; 261 | } 262 | .row-fluid .span6 { 263 | width: 48.717948717948715%; 264 | *width: 48.664757228587014%; 265 | } 266 | .row-fluid .span5 { 267 | width: 40.17094017094017%; 268 | *width: 40.11774868157847%; 269 | } 270 | .row-fluid .span4 { 271 | width: 31.623931623931625%; 272 | *width: 31.570740134569924%; 273 | } 274 | .row-fluid .span3 { 275 | width: 23.076923076923077%; 276 | *width: 23.023731587561375%; 277 | } 278 | .row-fluid .span2 { 279 | width: 14.52991452991453%; 280 | *width: 14.476723040552828%; 281 | } 282 | .row-fluid .span1 { 283 | width: 5.982905982905983%; 284 | *width: 5.929714493544281%; 285 | } 286 | .row-fluid .offset12 { 287 | margin-left: 105.12820512820512%; 288 | *margin-left: 105.02182214948171%; 289 | } 290 | .row-fluid .offset12:first-child { 291 | margin-left: 102.56410256410257%; 292 | *margin-left: 102.45771958537915%; 293 | } 294 | .row-fluid .offset11 { 295 | margin-left: 96.58119658119658%; 296 | *margin-left: 96.47481360247316%; 297 | } 298 | .row-fluid .offset11:first-child { 299 | margin-left: 94.01709401709402%; 300 | *margin-left: 93.91071103837061%; 301 | } 302 | .row-fluid .offset10 { 303 | margin-left: 88.03418803418803%; 304 | *margin-left: 87.92780505546462%; 305 | } 306 | .row-fluid .offset10:first-child { 307 | margin-left: 85.47008547008548%; 308 | *margin-left: 85.36370249136206%; 309 | } 310 | .row-fluid .offset9 { 311 | margin-left: 79.48717948717949%; 312 | *margin-left: 79.38079650845607%; 313 | } 314 | .row-fluid .offset9:first-child { 315 | margin-left: 76.92307692307693%; 316 | *margin-left: 76.81669394435352%; 317 | } 318 | .row-fluid .offset8 { 319 | margin-left: 70.94017094017094%; 320 | *margin-left: 70.83378796144753%; 321 | } 322 | .row-fluid .offset8:first-child { 323 | margin-left: 68.37606837606839%; 324 | *margin-left: 68.26968539734497%; 325 | } 326 | .row-fluid .offset7 { 327 | margin-left: 62.393162393162385%; 328 | *margin-left: 62.28677941443899%; 329 | } 330 | .row-fluid .offset7:first-child { 331 | margin-left: 59.82905982905982%; 332 | *margin-left: 59.72267685033642%; 333 | } 334 | .row-fluid .offset6 { 335 | margin-left: 53.84615384615384%; 336 | *margin-left: 53.739770867430444%; 337 | } 338 | .row-fluid .offset6:first-child { 339 | margin-left: 51.28205128205128%; 340 | *margin-left: 51.175668303327875%; 341 | } 342 | .row-fluid .offset5 { 343 | margin-left: 45.299145299145295%; 344 | *margin-left: 45.1927623204219%; 345 | } 346 | .row-fluid .offset5:first-child { 347 | margin-left: 42.73504273504273%; 348 | *margin-left: 42.62865975631933%; 349 | } 350 | .row-fluid .offset4 { 351 | margin-left: 36.75213675213675%; 352 | *margin-left: 36.645753773413354%; 353 | } 354 | .row-fluid .offset4:first-child { 355 | margin-left: 34.18803418803419%; 356 | *margin-left: 34.081651209310785%; 357 | } 358 | .row-fluid .offset3 { 359 | margin-left: 28.205128205128204%; 360 | *margin-left: 28.0987452264048%; 361 | } 362 | .row-fluid .offset3:first-child { 363 | margin-left: 25.641025641025642%; 364 | *margin-left: 25.53464266230224%; 365 | } 366 | .row-fluid .offset2 { 367 | margin-left: 19.65811965811966%; 368 | *margin-left: 19.551736679396257%; 369 | } 370 | .row-fluid .offset2:first-child { 371 | margin-left: 17.094017094017094%; 372 | *margin-left: 16.98763411529369%; 373 | } 374 | .row-fluid .offset1 { 375 | margin-left: 11.11111111111111%; 376 | *margin-left: 11.004728132387708%; 377 | } 378 | .row-fluid .offset1:first-child { 379 | margin-left: 8.547008547008547%; 380 | *margin-left: 8.440625568285142%; 381 | } 382 | input, 383 | textarea, 384 | .uneditable-input { 385 | margin-left: 0; 386 | } 387 | .controls-row [class*="span"] + [class*="span"] { 388 | margin-left: 30px; 389 | } 390 | input.span12, 391 | textarea.span12, 392 | .uneditable-input.span12 { 393 | width: 1156px; 394 | } 395 | input.span11, 396 | textarea.span11, 397 | .uneditable-input.span11 { 398 | width: 1056px; 399 | } 400 | input.span10, 401 | textarea.span10, 402 | .uneditable-input.span10 { 403 | width: 956px; 404 | } 405 | input.span9, 406 | textarea.span9, 407 | .uneditable-input.span9 { 408 | width: 856px; 409 | } 410 | input.span8, 411 | textarea.span8, 412 | .uneditable-input.span8 { 413 | width: 756px; 414 | } 415 | input.span7, 416 | textarea.span7, 417 | .uneditable-input.span7 { 418 | width: 656px; 419 | } 420 | input.span6, 421 | textarea.span6, 422 | .uneditable-input.span6 { 423 | width: 556px; 424 | } 425 | input.span5, 426 | textarea.span5, 427 | .uneditable-input.span5 { 428 | width: 456px; 429 | } 430 | input.span4, 431 | textarea.span4, 432 | .uneditable-input.span4 { 433 | width: 356px; 434 | } 435 | input.span3, 436 | textarea.span3, 437 | .uneditable-input.span3 { 438 | width: 256px; 439 | } 440 | input.span2, 441 | textarea.span2, 442 | .uneditable-input.span2 { 443 | width: 156px; 444 | } 445 | input.span1, 446 | textarea.span1, 447 | .uneditable-input.span1 { 448 | width: 56px; 449 | } 450 | .thumbnails { 451 | margin-left: -30px; 452 | } 453 | .thumbnails > li { 454 | margin-left: 30px; 455 | } 456 | .row-fluid .thumbnails { 457 | margin-left: 0; 458 | } 459 | } 460 | 461 | @media (min-width: 768px) and (max-width: 979px) { 462 | .row { 463 | margin-left: -20px; 464 | *zoom: 1; 465 | } 466 | .row:before, 467 | .row:after { 468 | display: table; 469 | line-height: 0; 470 | content: ""; 471 | } 472 | .row:after { 473 | clear: both; 474 | } 475 | [class*="span"] { 476 | float: left; 477 | min-height: 1px; 478 | margin-left: 20px; 479 | } 480 | .container, 481 | .navbar-static-top .container, 482 | .navbar-fixed-top .container, 483 | .navbar-fixed-bottom .container { 484 | width: 724px; 485 | } 486 | .span12 { 487 | width: 724px; 488 | } 489 | .span11 { 490 | width: 662px; 491 | } 492 | .span10 { 493 | width: 600px; 494 | } 495 | .span9 { 496 | width: 538px; 497 | } 498 | .span8 { 499 | width: 476px; 500 | } 501 | .span7 { 502 | width: 414px; 503 | } 504 | .span6 { 505 | width: 352px; 506 | } 507 | .span5 { 508 | width: 290px; 509 | } 510 | .span4 { 511 | width: 228px; 512 | } 513 | .span3 { 514 | width: 166px; 515 | } 516 | .span2 { 517 | width: 104px; 518 | } 519 | .span1 { 520 | width: 42px; 521 | } 522 | .offset12 { 523 | margin-left: 764px; 524 | } 525 | .offset11 { 526 | margin-left: 702px; 527 | } 528 | .offset10 { 529 | margin-left: 640px; 530 | } 531 | .offset9 { 532 | margin-left: 578px; 533 | } 534 | .offset8 { 535 | margin-left: 516px; 536 | } 537 | .offset7 { 538 | margin-left: 454px; 539 | } 540 | .offset6 { 541 | margin-left: 392px; 542 | } 543 | .offset5 { 544 | margin-left: 330px; 545 | } 546 | .offset4 { 547 | margin-left: 268px; 548 | } 549 | .offset3 { 550 | margin-left: 206px; 551 | } 552 | .offset2 { 553 | margin-left: 144px; 554 | } 555 | .offset1 { 556 | margin-left: 82px; 557 | } 558 | .row-fluid { 559 | width: 100%; 560 | *zoom: 1; 561 | } 562 | .row-fluid:before, 563 | .row-fluid:after { 564 | display: table; 565 | line-height: 0; 566 | content: ""; 567 | } 568 | .row-fluid:after { 569 | clear: both; 570 | } 571 | .row-fluid [class*="span"] { 572 | display: block; 573 | float: left; 574 | width: 100%; 575 | min-height: 30px; 576 | margin-left: 2.7624309392265194%; 577 | *margin-left: 2.709239449864817%; 578 | -webkit-box-sizing: border-box; 579 | -moz-box-sizing: border-box; 580 | box-sizing: border-box; 581 | } 582 | .row-fluid [class*="span"]:first-child { 583 | margin-left: 0; 584 | } 585 | .row-fluid .controls-row [class*="span"] + [class*="span"] { 586 | margin-left: 2.7624309392265194%; 587 | } 588 | .row-fluid .span12 { 589 | width: 100%; 590 | *width: 99.94680851063829%; 591 | } 592 | .row-fluid .span11 { 593 | width: 91.43646408839778%; 594 | *width: 91.38327259903608%; 595 | } 596 | .row-fluid .span10 { 597 | width: 82.87292817679558%; 598 | *width: 82.81973668743387%; 599 | } 600 | .row-fluid .span9 { 601 | width: 74.30939226519337%; 602 | *width: 74.25620077583166%; 603 | } 604 | .row-fluid .span8 { 605 | width: 65.74585635359117%; 606 | *width: 65.69266486422946%; 607 | } 608 | .row-fluid .span7 { 609 | width: 57.18232044198895%; 610 | *width: 57.12912895262725%; 611 | } 612 | .row-fluid .span6 { 613 | width: 48.61878453038674%; 614 | *width: 48.56559304102504%; 615 | } 616 | .row-fluid .span5 { 617 | width: 40.05524861878453%; 618 | *width: 40.00205712942283%; 619 | } 620 | .row-fluid .span4 { 621 | width: 31.491712707182323%; 622 | *width: 31.43852121782062%; 623 | } 624 | .row-fluid .span3 { 625 | width: 22.92817679558011%; 626 | *width: 22.87498530621841%; 627 | } 628 | .row-fluid .span2 { 629 | width: 14.3646408839779%; 630 | *width: 14.311449394616199%; 631 | } 632 | .row-fluid .span1 { 633 | width: 5.801104972375691%; 634 | *width: 5.747913483013988%; 635 | } 636 | .row-fluid .offset12 { 637 | margin-left: 105.52486187845304%; 638 | *margin-left: 105.41847889972962%; 639 | } 640 | .row-fluid .offset12:first-child { 641 | margin-left: 102.76243093922652%; 642 | *margin-left: 102.6560479605031%; 643 | } 644 | .row-fluid .offset11 { 645 | margin-left: 96.96132596685082%; 646 | *margin-left: 96.8549429881274%; 647 | } 648 | .row-fluid .offset11:first-child { 649 | margin-left: 94.1988950276243%; 650 | *margin-left: 94.09251204890089%; 651 | } 652 | .row-fluid .offset10 { 653 | margin-left: 88.39779005524862%; 654 | *margin-left: 88.2914070765252%; 655 | } 656 | .row-fluid .offset10:first-child { 657 | margin-left: 85.6353591160221%; 658 | *margin-left: 85.52897613729868%; 659 | } 660 | .row-fluid .offset9 { 661 | margin-left: 79.8342541436464%; 662 | *margin-left: 79.72787116492299%; 663 | } 664 | .row-fluid .offset9:first-child { 665 | margin-left: 77.07182320441989%; 666 | *margin-left: 76.96544022569647%; 667 | } 668 | .row-fluid .offset8 { 669 | margin-left: 71.2707182320442%; 670 | *margin-left: 71.16433525332079%; 671 | } 672 | .row-fluid .offset8:first-child { 673 | margin-left: 68.50828729281768%; 674 | *margin-left: 68.40190431409427%; 675 | } 676 | .row-fluid .offset7 { 677 | margin-left: 62.70718232044199%; 678 | *margin-left: 62.600799341718584%; 679 | } 680 | .row-fluid .offset7:first-child { 681 | margin-left: 59.94475138121547%; 682 | *margin-left: 59.838368402492065%; 683 | } 684 | .row-fluid .offset6 { 685 | margin-left: 54.14364640883978%; 686 | *margin-left: 54.037263430116376%; 687 | } 688 | .row-fluid .offset6:first-child { 689 | margin-left: 51.38121546961326%; 690 | *margin-left: 51.27483249088986%; 691 | } 692 | .row-fluid .offset5 { 693 | margin-left: 45.58011049723757%; 694 | *margin-left: 45.47372751851417%; 695 | } 696 | .row-fluid .offset5:first-child { 697 | margin-left: 42.81767955801105%; 698 | *margin-left: 42.71129657928765%; 699 | } 700 | .row-fluid .offset4 { 701 | margin-left: 37.01657458563536%; 702 | *margin-left: 36.91019160691196%; 703 | } 704 | .row-fluid .offset4:first-child { 705 | margin-left: 34.25414364640884%; 706 | *margin-left: 34.14776066768544%; 707 | } 708 | .row-fluid .offset3 { 709 | margin-left: 28.45303867403315%; 710 | *margin-left: 28.346655695309746%; 711 | } 712 | .row-fluid .offset3:first-child { 713 | margin-left: 25.69060773480663%; 714 | *margin-left: 25.584224756083227%; 715 | } 716 | .row-fluid .offset2 { 717 | margin-left: 19.88950276243094%; 718 | *margin-left: 19.783119783707537%; 719 | } 720 | .row-fluid .offset2:first-child { 721 | margin-left: 17.12707182320442%; 722 | *margin-left: 17.02068884448102%; 723 | } 724 | .row-fluid .offset1 { 725 | margin-left: 11.32596685082873%; 726 | *margin-left: 11.219583872105325%; 727 | } 728 | .row-fluid .offset1:first-child { 729 | margin-left: 8.56353591160221%; 730 | *margin-left: 8.457152932878806%; 731 | } 732 | input, 733 | textarea, 734 | .uneditable-input { 735 | margin-left: 0; 736 | } 737 | .controls-row [class*="span"] + [class*="span"] { 738 | margin-left: 20px; 739 | } 740 | input.span12, 741 | textarea.span12, 742 | .uneditable-input.span12 { 743 | width: 710px; 744 | } 745 | input.span11, 746 | textarea.span11, 747 | .uneditable-input.span11 { 748 | width: 648px; 749 | } 750 | input.span10, 751 | textarea.span10, 752 | .uneditable-input.span10 { 753 | width: 586px; 754 | } 755 | input.span9, 756 | textarea.span9, 757 | .uneditable-input.span9 { 758 | width: 524px; 759 | } 760 | input.span8, 761 | textarea.span8, 762 | .uneditable-input.span8 { 763 | width: 462px; 764 | } 765 | input.span7, 766 | textarea.span7, 767 | .uneditable-input.span7 { 768 | width: 400px; 769 | } 770 | input.span6, 771 | textarea.span6, 772 | .uneditable-input.span6 { 773 | width: 338px; 774 | } 775 | input.span5, 776 | textarea.span5, 777 | .uneditable-input.span5 { 778 | width: 276px; 779 | } 780 | input.span4, 781 | textarea.span4, 782 | .uneditable-input.span4 { 783 | width: 214px; 784 | } 785 | input.span3, 786 | textarea.span3, 787 | .uneditable-input.span3 { 788 | width: 152px; 789 | } 790 | input.span2, 791 | textarea.span2, 792 | .uneditable-input.span2 { 793 | width: 90px; 794 | } 795 | input.span1, 796 | textarea.span1, 797 | .uneditable-input.span1 { 798 | width: 28px; 799 | } 800 | } 801 | 802 | @media (max-width: 767px) { 803 | body { 804 | padding-right: 20px; 805 | padding-left: 20px; 806 | } 807 | .navbar-fixed-top, 808 | .navbar-fixed-bottom, 809 | .navbar-static-top { 810 | margin-right: -20px; 811 | margin-left: -20px; 812 | } 813 | .container-fluid { 814 | padding: 0; 815 | } 816 | .dl-horizontal dt { 817 | float: none; 818 | width: auto; 819 | clear: none; 820 | text-align: left; 821 | } 822 | .dl-horizontal dd { 823 | margin-left: 0; 824 | } 825 | .container { 826 | width: auto; 827 | } 828 | .row-fluid { 829 | width: 100%; 830 | } 831 | .row, 832 | .thumbnails { 833 | margin-left: 0; 834 | } 835 | .thumbnails > li { 836 | float: none; 837 | margin-left: 0; 838 | } 839 | [class*="span"], 840 | .uneditable-input[class*="span"], 841 | .row-fluid [class*="span"] { 842 | display: block; 843 | float: none; 844 | width: 100%; 845 | margin-left: 0; 846 | -webkit-box-sizing: border-box; 847 | -moz-box-sizing: border-box; 848 | box-sizing: border-box; 849 | } 850 | .span12, 851 | .row-fluid .span12 { 852 | width: 100%; 853 | -webkit-box-sizing: border-box; 854 | -moz-box-sizing: border-box; 855 | box-sizing: border-box; 856 | } 857 | .row-fluid [class*="offset"]:first-child { 858 | margin-left: 0; 859 | } 860 | .input-large, 861 | .input-xlarge, 862 | .input-xxlarge, 863 | input[class*="span"], 864 | select[class*="span"], 865 | textarea[class*="span"], 866 | .uneditable-input { 867 | display: block; 868 | width: 100%; 869 | min-height: 30px; 870 | -webkit-box-sizing: border-box; 871 | -moz-box-sizing: border-box; 872 | box-sizing: border-box; 873 | } 874 | .input-prepend input, 875 | .input-append input, 876 | .input-prepend input[class*="span"], 877 | .input-append input[class*="span"] { 878 | display: inline-block; 879 | width: auto; 880 | } 881 | .controls-row [class*="span"] + [class*="span"] { 882 | margin-left: 0; 883 | } 884 | .modal { 885 | position: fixed; 886 | top: 20px; 887 | right: 20px; 888 | left: 20px; 889 | width: auto; 890 | margin: 0; 891 | } 892 | .modal.fade { 893 | top: -100px; 894 | } 895 | .modal.fade.in { 896 | top: 20px; 897 | } 898 | } 899 | 900 | @media (max-width: 480px) { 901 | .nav-collapse { 902 | -webkit-transform: translate3d(0, 0, 0); 903 | } 904 | .page-header h1 small { 905 | display: block; 906 | line-height: 20px; 907 | } 908 | input[type="checkbox"], 909 | input[type="radio"] { 910 | border: 1px solid #ccc; 911 | } 912 | .form-horizontal .control-label { 913 | float: none; 914 | width: auto; 915 | padding-top: 0; 916 | text-align: left; 917 | } 918 | .form-horizontal .controls { 919 | margin-left: 0; 920 | } 921 | .form-horizontal .control-list { 922 | padding-top: 0; 923 | } 924 | .form-horizontal .form-actions { 925 | padding-right: 10px; 926 | padding-left: 10px; 927 | } 928 | .media .pull-left, 929 | .media .pull-right { 930 | display: block; 931 | float: none; 932 | margin-bottom: 10px; 933 | } 934 | .media-object { 935 | margin-right: 0; 936 | margin-left: 0; 937 | } 938 | .modal { 939 | top: 10px; 940 | right: 10px; 941 | left: 10px; 942 | } 943 | .modal-header .close { 944 | padding: 10px; 945 | margin: -10px; 946 | } 947 | .carousel-caption { 948 | position: static; 949 | } 950 | } 951 | 952 | @media (max-width: 979px) { 953 | body { 954 | padding-top: 0; 955 | } 956 | .navbar-fixed-top, 957 | .navbar-fixed-bottom { 958 | position: static; 959 | } 960 | .navbar-fixed-top { 961 | margin-bottom: 20px; 962 | } 963 | .navbar-fixed-bottom { 964 | margin-top: 20px; 965 | } 966 | .navbar-fixed-top .navbar-inner, 967 | .navbar-fixed-bottom .navbar-inner { 968 | padding: 5px; 969 | } 970 | .navbar .container { 971 | width: auto; 972 | padding: 0; 973 | } 974 | .navbar .brand { 975 | padding-right: 10px; 976 | padding-left: 10px; 977 | margin: 0 0 0 -5px; 978 | } 979 | .nav-collapse { 980 | clear: both; 981 | } 982 | .nav-collapse .nav { 983 | float: none; 984 | margin: 0 0 10px; 985 | } 986 | .nav-collapse .nav > li { 987 | float: none; 988 | } 989 | .nav-collapse .nav > li > a { 990 | margin-bottom: 2px; 991 | } 992 | .nav-collapse .nav > .divider-vertical { 993 | display: none; 994 | } 995 | .nav-collapse .nav .nav-header { 996 | color: #777777; 997 | text-shadow: none; 998 | } 999 | .nav-collapse .nav > li > a, 1000 | .nav-collapse .dropdown-menu a { 1001 | padding: 9px 15px; 1002 | font-weight: bold; 1003 | color: #777777; 1004 | -webkit-border-radius: 3px; 1005 | -moz-border-radius: 3px; 1006 | border-radius: 3px; 1007 | } 1008 | .nav-collapse .btn { 1009 | padding: 4px 10px 4px; 1010 | font-weight: normal; 1011 | -webkit-border-radius: 4px; 1012 | -moz-border-radius: 4px; 1013 | border-radius: 4px; 1014 | } 1015 | .nav-collapse .dropdown-menu li + li a { 1016 | margin-bottom: 2px; 1017 | } 1018 | .nav-collapse .nav > li > a:hover, 1019 | .nav-collapse .nav > li > a:focus, 1020 | .nav-collapse .dropdown-menu a:hover, 1021 | .nav-collapse .dropdown-menu a:focus { 1022 | background-color: #f2f2f2; 1023 | } 1024 | .navbar-inverse .nav-collapse .nav > li > a, 1025 | .navbar-inverse .nav-collapse .dropdown-menu a { 1026 | color: #999999; 1027 | } 1028 | .navbar-inverse .nav-collapse .nav > li > a:hover, 1029 | .navbar-inverse .nav-collapse .nav > li > a:focus, 1030 | .navbar-inverse .nav-collapse .dropdown-menu a:hover, 1031 | .navbar-inverse .nav-collapse .dropdown-menu a:focus { 1032 | background-color: #111111; 1033 | } 1034 | .nav-collapse.in .btn-group { 1035 | padding: 0; 1036 | margin-top: 5px; 1037 | } 1038 | .nav-collapse .dropdown-menu { 1039 | position: static; 1040 | top: auto; 1041 | left: auto; 1042 | display: none; 1043 | float: none; 1044 | max-width: none; 1045 | padding: 0; 1046 | margin: 0 15px; 1047 | background-color: transparent; 1048 | border: none; 1049 | -webkit-border-radius: 0; 1050 | -moz-border-radius: 0; 1051 | border-radius: 0; 1052 | -webkit-box-shadow: none; 1053 | -moz-box-shadow: none; 1054 | box-shadow: none; 1055 | } 1056 | .nav-collapse .open > .dropdown-menu { 1057 | display: block; 1058 | } 1059 | .nav-collapse .dropdown-menu:before, 1060 | .nav-collapse .dropdown-menu:after { 1061 | display: none; 1062 | } 1063 | .nav-collapse .dropdown-menu .divider { 1064 | display: none; 1065 | } 1066 | .nav-collapse .nav > li > .dropdown-menu:before, 1067 | .nav-collapse .nav > li > .dropdown-menu:after { 1068 | display: none; 1069 | } 1070 | .nav-collapse .navbar-form, 1071 | .nav-collapse .navbar-search { 1072 | float: none; 1073 | padding: 10px 15px; 1074 | margin: 10px 0; 1075 | border-top: 1px solid #f2f2f2; 1076 | border-bottom: 1px solid #f2f2f2; 1077 | -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); 1078 | -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); 1079 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); 1080 | } 1081 | .navbar-inverse .nav-collapse .navbar-form, 1082 | .navbar-inverse .nav-collapse .navbar-search { 1083 | border-top-color: #111111; 1084 | border-bottom-color: #111111; 1085 | } 1086 | .navbar .nav-collapse .nav.pull-right { 1087 | float: none; 1088 | margin-left: 0; 1089 | } 1090 | .nav-collapse, 1091 | .nav-collapse.collapse { 1092 | height: 0; 1093 | overflow: hidden; 1094 | } 1095 | .navbar .btn-navbar { 1096 | display: block; 1097 | } 1098 | .navbar-static .navbar-inner { 1099 | padding-right: 10px; 1100 | padding-left: 10px; 1101 | } 1102 | } 1103 | 1104 | @media (min-width: 980px) { 1105 | .nav-collapse.collapse { 1106 | height: auto !important; 1107 | overflow: visible !important; 1108 | } 1109 | } 1110 | -------------------------------------------------------------------------------- /sample/vendor/js/backbone-1.0.0.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | var t = this; 3 | var e = t.Backbone; 4 | var i = []; 5 | var r = i.push; 6 | var s = i.slice; 7 | var n = i.splice; 8 | var a; 9 | if (typeof exports !== "undefined") { 10 | a = exports 11 | } else { 12 | a = t.Backbone = {} 13 | } 14 | a.VERSION = "1.0.0"; 15 | var h = t._; 16 | if (!h && typeof require !== "undefined") h = require("underscore"); 17 | a.$ = t.jQuery || t.Zepto || t.ender || t.$; 18 | a.noConflict = function () { 19 | t.Backbone = e; 20 | return this 21 | }; 22 | a.emulateHTTP = false; 23 | a.emulateJSON = false; 24 | var o = a.Events = { 25 | on: function (t, e, i) { 26 | if (!l(this, "on", t, [e, i]) || !e) return this; 27 | this._events || (this._events = {}); 28 | var r = this._events[t] || (this._events[t] = []); 29 | r.push({ 30 | callback: e, 31 | context: i, 32 | ctx: i || this 33 | }); 34 | return this 35 | }, 36 | once: function (t, e, i) { 37 | if (!l(this, "once", t, [e, i]) || !e) return this; 38 | var r = this; 39 | var s = h.once(function () { 40 | r.off(t, s); 41 | e.apply(this, arguments) 42 | }); 43 | s._callback = e; 44 | return this.on(t, s, i) 45 | }, 46 | off: function (t, e, i) { 47 | var r, s, n, a, o, u, c, f; 48 | if (!this._events || !l(this, "off", t, [e, i])) return this; 49 | if (!t && !e && !i) { 50 | this._events = {}; 51 | return this 52 | } 53 | a = t ? [t] : h.keys(this._events); 54 | for (o = 0, u = a.length; o < u; o++) { 55 | t = a[o]; 56 | if (n = this._events[t]) { 57 | this._events[t] = r = []; 58 | if (e || i) { 59 | for (c = 0, f = n.length; c < f; c++) { 60 | s = n[c]; 61 | if (e && e !== s.callback && e !== s.callback._callback || i && i !== s.context) { 62 | r.push(s) 63 | } 64 | } 65 | } 66 | if (!r.length) delete this._events[t] 67 | } 68 | } 69 | return this 70 | }, 71 | trigger: function (t) { 72 | if (!this._events) return this; 73 | var e = s.call(arguments, 1); 74 | if (!l(this, "trigger", t, e)) return this; 75 | var i = this._events[t]; 76 | var r = this._events.all; 77 | if (i) c(i, e); 78 | if (r) c(r, arguments); 79 | return this 80 | }, 81 | stopListening: function (t, e, i) { 82 | var r = this._listeners; 83 | if (!r) return this; 84 | var s = !e && !i; 85 | if (typeof e === "object") i = this; 86 | if (t)(r = {})[t._listenerId] = t; 87 | for (var n in r) { 88 | r[n].off(e, i, this); 89 | if (s) delete this._listeners[n] 90 | } 91 | return this 92 | } 93 | }; 94 | var u = /\s+/; 95 | var l = function (t, e, i, r) { 96 | if (!i) return true; 97 | if (typeof i === "object") { 98 | for (var s in i) { 99 | t[e].apply(t, [s, i[s]].concat(r)) 100 | } 101 | return false 102 | } 103 | if (u.test(i)) { 104 | var n = i.split(u); 105 | for (var a = 0, h = n.length; a < h; a++) { 106 | t[e].apply(t, [n[a]].concat(r)) 107 | } 108 | return false 109 | } 110 | return true 111 | }; 112 | var c = function (t, e) { 113 | var i, r = -1, 114 | s = t.length, 115 | n = e[0], 116 | a = e[1], 117 | h = e[2]; 118 | switch (e.length) { 119 | case 0: 120 | while (++r < s)(i = t[r]).callback.call(i.ctx); 121 | return; 122 | case 1: 123 | while (++r < s)(i = t[r]).callback.call(i.ctx, n); 124 | return; 125 | case 2: 126 | while (++r < s)(i = t[r]).callback.call(i.ctx, n, a); 127 | return; 128 | case 3: 129 | while (++r < s)(i = t[r]).callback.call(i.ctx, n, a, h); 130 | return; 131 | default: 132 | while (++r < s)(i = t[r]).callback.apply(i.ctx, e) 133 | } 134 | }; 135 | var f = { 136 | listenTo: "on", 137 | listenToOnce: "once" 138 | }; 139 | h.each(f, function (t, e) { 140 | o[e] = function (e, i, r) { 141 | var s = this._listeners || (this._listeners = {}); 142 | var n = e._listenerId || (e._listenerId = h.uniqueId("l")); 143 | s[n] = e; 144 | if (typeof i === "object") r = this; 145 | e[t](i, r, this); 146 | return this 147 | } 148 | }); 149 | o.bind = o.on; 150 | o.unbind = o.off; 151 | h.extend(a, o); 152 | var d = a.Model = function (t, e) { 153 | var i; 154 | var r = t || {}; 155 | e || (e = {}); 156 | this.cid = h.uniqueId("c"); 157 | this.attributes = {}; 158 | h.extend(this, h.pick(e, p)); 159 | if (e.parse) r = this.parse(r, e) || {}; 160 | if (i = h.result(this, "defaults")) { 161 | r = h.defaults({}, r, i) 162 | } 163 | this.set(r, e); 164 | this.changed = {}; 165 | this.initialize.apply(this, arguments) 166 | }; 167 | var p = ["url", "urlRoot", "collection"]; 168 | h.extend(d.prototype, o, { 169 | changed: null, 170 | validationError: null, 171 | idAttribute: "id", 172 | initialize: function () {}, 173 | toJSON: function (t) { 174 | return h.clone(this.attributes) 175 | }, 176 | sync: function () { 177 | return a.sync.apply(this, arguments) 178 | }, 179 | get: function (t) { 180 | return this.attributes[t] 181 | }, 182 | escape: function (t) { 183 | return h.escape(this.get(t)) 184 | }, 185 | has: function (t) { 186 | return this.get(t) != null 187 | }, 188 | set: function (t, e, i) { 189 | var r, s, n, a, o, u, l, c; 190 | if (t == null) return this; 191 | if (typeof t === "object") { 192 | s = t; 193 | i = e 194 | } else { 195 | (s = {})[t] = e 196 | } 197 | i || (i = {}); 198 | if (!this._validate(s, i)) return false; 199 | n = i.unset; 200 | o = i.silent; 201 | a = []; 202 | u = this._changing; 203 | this._changing = true; 204 | if (!u) { 205 | this._previousAttributes = h.clone(this.attributes); 206 | this.changed = {} 207 | } 208 | c = this.attributes, l = this._previousAttributes; 209 | if (this.idAttribute in s) this.id = s[this.idAttribute]; 210 | for (r in s) { 211 | e = s[r]; 212 | if (!h.isEqual(c[r], e)) a.push(r); 213 | if (!h.isEqual(l[r], e)) { 214 | this.changed[r] = e 215 | } else { 216 | delete this.changed[r] 217 | } 218 | n ? delete c[r] : c[r] = e 219 | } 220 | if (!o) { 221 | if (a.length) this._pending = true; 222 | for (var f = 0, d = a.length; f < d; f++) { 223 | this.trigger("change:" + a[f], this, c[a[f]], i) 224 | } 225 | } 226 | if (u) return this; 227 | if (!o) { 228 | while (this._pending) { 229 | this._pending = false; 230 | this.trigger("change", this, i) 231 | } 232 | } 233 | this._pending = false; 234 | this._changing = false; 235 | return this 236 | }, 237 | unset: function (t, e) { 238 | return this.set(t, void 0, h.extend({}, e, { 239 | unset: true 240 | })) 241 | }, 242 | clear: function (t) { 243 | var e = {}; 244 | for (var i in this.attributes) e[i] = void 0; 245 | return this.set(e, h.extend({}, t, { 246 | unset: true 247 | })) 248 | }, 249 | hasChanged: function (t) { 250 | if (t == null) return !h.isEmpty(this.changed); 251 | return h.has(this.changed, t) 252 | }, 253 | changedAttributes: function (t) { 254 | if (!t) return this.hasChanged() ? h.clone(this.changed) : false; 255 | var e, i = false; 256 | var r = this._changing ? this._previousAttributes : this.attributes; 257 | for (var s in t) { 258 | if (h.isEqual(r[s], e = t[s])) continue; 259 | (i || (i = {}))[s] = e 260 | } 261 | return i 262 | }, 263 | previous: function (t) { 264 | if (t == null || !this._previousAttributes) return null; 265 | return this._previousAttributes[t] 266 | }, 267 | previousAttributes: function () { 268 | return h.clone(this._previousAttributes) 269 | }, 270 | fetch: function (t) { 271 | t = t ? h.clone(t) : {}; 272 | if (t.parse === void 0) t.parse = true; 273 | var e = this; 274 | var i = t.success; 275 | t.success = function (r) { 276 | if (!e.set(e.parse(r, t), t)) return false; 277 | if (i) i(e, r, t); 278 | e.trigger("sync", e, r, t) 279 | }; 280 | R(this, t); 281 | return this.sync("read", this, t) 282 | }, 283 | save: function (t, e, i) { 284 | var r, s, n, a = this.attributes; 285 | if (t == null || typeof t === "object") { 286 | r = t; 287 | i = e 288 | } else { 289 | (r = {})[t] = e 290 | } if (r && (!i || !i.wait) && !this.set(r, i)) return false; 291 | i = h.extend({ 292 | validate: true 293 | }, i); 294 | if (!this._validate(r, i)) return false; 295 | if (r && i.wait) { 296 | this.attributes = h.extend({}, a, r) 297 | } 298 | if (i.parse === void 0) i.parse = true; 299 | var o = this; 300 | var u = i.success; 301 | i.success = function (t) { 302 | o.attributes = a; 303 | var e = o.parse(t, i); 304 | if (i.wait) e = h.extend(r || {}, e); 305 | if (h.isObject(e) && !o.set(e, i)) { 306 | return false 307 | } 308 | if (u) u(o, t, i); 309 | o.trigger("sync", o, t, i) 310 | }; 311 | R(this, i); 312 | s = this.isNew() ? "create" : i.patch ? "patch" : "update"; 313 | if (s === "patch") i.attrs = r; 314 | n = this.sync(s, this, i); 315 | if (r && i.wait) this.attributes = a; 316 | return n 317 | }, 318 | destroy: function (t) { 319 | t = t ? h.clone(t) : {}; 320 | var e = this; 321 | var i = t.success; 322 | var r = function () { 323 | e.trigger("destroy", e, e.collection, t) 324 | }; 325 | t.success = function (s) { 326 | if (t.wait || e.isNew()) r(); 327 | if (i) i(e, s, t); 328 | if (!e.isNew()) e.trigger("sync", e, s, t) 329 | }; 330 | if (this.isNew()) { 331 | t.success(); 332 | return false 333 | } 334 | R(this, t); 335 | var s = this.sync("delete", this, t); 336 | if (!t.wait) r(); 337 | return s 338 | }, 339 | url: function () { 340 | var t = h.result(this, "urlRoot") || h.result(this.collection, "url") || U(); 341 | if (this.isNew()) return t; 342 | return t + (t.charAt(t.length - 1) === "/" ? "" : "/") + encodeURIComponent(this.id) 343 | }, 344 | parse: function (t, e) { 345 | return t 346 | }, 347 | clone: function () { 348 | return new this.constructor(this.attributes) 349 | }, 350 | isNew: function () { 351 | return this.id == null 352 | }, 353 | isValid: function (t) { 354 | return this._validate({}, h.extend(t || {}, { 355 | validate: true 356 | })) 357 | }, 358 | _validate: function (t, e) { 359 | if (!e.validate || !this.validate) return true; 360 | t = h.extend({}, this.attributes, t); 361 | var i = this.validationError = this.validate(t, e) || null; 362 | if (!i) return true; 363 | this.trigger("invalid", this, i, h.extend(e || {}, { 364 | validationError: i 365 | })); 366 | return false 367 | } 368 | }); 369 | var v = ["keys", "values", "pairs", "invert", "pick", "omit"]; 370 | h.each(v, function (t) { 371 | d.prototype[t] = function () { 372 | var e = s.call(arguments); 373 | e.unshift(this.attributes); 374 | return h[t].apply(h, e) 375 | } 376 | }); 377 | var g = a.Collection = function (t, e) { 378 | e || (e = {}); 379 | if (e.url) this.url = e.url; 380 | if (e.model) this.model = e.model; 381 | if (e.comparator !== void 0) this.comparator = e.comparator; 382 | this._reset(); 383 | this.initialize.apply(this, arguments); 384 | if (t) this.reset(t, h.extend({ 385 | silent: true 386 | }, e)) 387 | }; 388 | var m = { 389 | add: true, 390 | remove: true, 391 | merge: true 392 | }; 393 | var y = { 394 | add: true, 395 | merge: false, 396 | remove: false 397 | }; 398 | h.extend(g.prototype, o, { 399 | model: d, 400 | initialize: function () {}, 401 | toJSON: function (t) { 402 | return this.map(function (e) { 403 | return e.toJSON(t) 404 | }) 405 | }, 406 | sync: function () { 407 | return a.sync.apply(this, arguments) 408 | }, 409 | add: function (t, e) { 410 | return this.set(t, h.defaults(e || {}, y)) 411 | }, 412 | remove: function (t, e) { 413 | t = h.isArray(t) ? t.slice() : [t]; 414 | e || (e = {}); 415 | var i, r, s, n; 416 | for (i = 0, r = t.length; i < r; i++) { 417 | n = this.get(t[i]); 418 | if (!n) continue; 419 | delete this._byId[n.id]; 420 | delete this._byId[n.cid]; 421 | s = this.indexOf(n); 422 | this.models.splice(s, 1); 423 | this.length--; 424 | if (!e.silent) { 425 | e.index = s; 426 | n.trigger("remove", n, this, e) 427 | } 428 | this._removeReference(n) 429 | } 430 | return this 431 | }, 432 | set: function (t, e) { 433 | e = h.defaults(e || {}, m); 434 | if (e.parse) t = this.parse(t, e); 435 | if (!h.isArray(t)) t = t ? [t] : []; 436 | var i, s, a, o, u, l; 437 | var c = e.at; 438 | var f = this.comparator && c == null && e.sort !== false; 439 | var d = h.isString(this.comparator) ? this.comparator : null; 440 | var p = [], 441 | v = [], 442 | g = {}; 443 | for (i = 0, s = t.length; i < s; i++) { 444 | if (!(a = this._prepareModel(t[i], e))) continue; 445 | if (u = this.get(a)) { 446 | if (e.remove) g[u.cid] = true; 447 | if (e.merge) { 448 | u.set(a.attributes, e); 449 | if (f && !l && u.hasChanged(d)) l = true 450 | } 451 | } else if (e.add) { 452 | p.push(a); 453 | a.on("all", this._onModelEvent, this); 454 | this._byId[a.cid] = a; 455 | if (a.id != null) this._byId[a.id] = a 456 | } 457 | } 458 | if (e.remove) { 459 | for (i = 0, s = this.length; i < s; ++i) { 460 | if (!g[(a = this.models[i]).cid]) v.push(a) 461 | } 462 | if (v.length) this.remove(v, e) 463 | } 464 | if (p.length) { 465 | if (f) l = true; 466 | this.length += p.length; 467 | if (c != null) { 468 | n.apply(this.models, [c, 0].concat(p)) 469 | } else { 470 | r.apply(this.models, p) 471 | } 472 | } 473 | if (l) this.sort({ 474 | silent: true 475 | }); 476 | if (e.silent) return this; 477 | for (i = 0, s = p.length; i < s; i++) { 478 | (a = p[i]).trigger("add", a, this, e) 479 | } 480 | if (l) this.trigger("sort", this, e); 481 | return this 482 | }, 483 | reset: function (t, e) { 484 | e || (e = {}); 485 | for (var i = 0, r = this.models.length; i < r; i++) { 486 | this._removeReference(this.models[i]) 487 | } 488 | e.previousModels = this.models; 489 | this._reset(); 490 | this.add(t, h.extend({ 491 | silent: true 492 | }, e)); 493 | if (!e.silent) this.trigger("reset", this, e); 494 | return this 495 | }, 496 | push: function (t, e) { 497 | t = this._prepareModel(t, e); 498 | this.add(t, h.extend({ 499 | at: this.length 500 | }, e)); 501 | return t 502 | }, 503 | pop: function (t) { 504 | var e = this.at(this.length - 1); 505 | this.remove(e, t); 506 | return e 507 | }, 508 | unshift: function (t, e) { 509 | t = this._prepareModel(t, e); 510 | this.add(t, h.extend({ 511 | at: 0 512 | }, e)); 513 | return t 514 | }, 515 | shift: function (t) { 516 | var e = this.at(0); 517 | this.remove(e, t); 518 | return e 519 | }, 520 | slice: function (t, e) { 521 | return this.models.slice(t, e) 522 | }, 523 | get: function (t) { 524 | if (t == null) return void 0; 525 | return this._byId[t.id != null ? t.id : t.cid || t] 526 | }, 527 | at: function (t) { 528 | return this.models[t] 529 | }, 530 | where: function (t, e) { 531 | if (h.isEmpty(t)) return e ? void 0 : []; 532 | return this[e ? "find" : "filter"](function (e) { 533 | for (var i in t) { 534 | if (t[i] !== e.get(i)) return false 535 | } 536 | return true 537 | }) 538 | }, 539 | findWhere: function (t) { 540 | return this.where(t, true) 541 | }, 542 | sort: function (t) { 543 | if (!this.comparator) throw new Error("Cannot sort a set without a comparator"); 544 | t || (t = {}); 545 | if (h.isString(this.comparator) || this.comparator.length === 1) { 546 | this.models = this.sortBy(this.comparator, this) 547 | } else { 548 | this.models.sort(h.bind(this.comparator, this)) 549 | } if (!t.silent) this.trigger("sort", this, t); 550 | return this 551 | }, 552 | sortedIndex: function (t, e, i) { 553 | e || (e = this.comparator); 554 | var r = h.isFunction(e) ? e : function (t) { 555 | return t.get(e) 556 | }; 557 | return h.sortedIndex(this.models, t, r, i) 558 | }, 559 | pluck: function (t) { 560 | return h.invoke(this.models, "get", t) 561 | }, 562 | fetch: function (t) { 563 | t = t ? h.clone(t) : {}; 564 | if (t.parse === void 0) t.parse = true; 565 | var e = t.success; 566 | var i = this; 567 | t.success = function (r) { 568 | var s = t.reset ? "reset" : "set"; 569 | i[s](r, t); 570 | if (e) e(i, r, t); 571 | i.trigger("sync", i, r, t) 572 | }; 573 | R(this, t); 574 | return this.sync("read", this, t) 575 | }, 576 | create: function (t, e) { 577 | e = e ? h.clone(e) : {}; 578 | if (!(t = this._prepareModel(t, e))) return false; 579 | if (!e.wait) this.add(t, e); 580 | var i = this; 581 | var r = e.success; 582 | e.success = function (s) { 583 | if (e.wait) i.add(t, e); 584 | if (r) r(t, s, e) 585 | }; 586 | t.save(null, e); 587 | return t 588 | }, 589 | parse: function (t, e) { 590 | return t 591 | }, 592 | clone: function () { 593 | return new this.constructor(this.models) 594 | }, 595 | _reset: function () { 596 | this.length = 0; 597 | this.models = []; 598 | this._byId = {} 599 | }, 600 | _prepareModel: function (t, e) { 601 | if (t instanceof d) { 602 | if (!t.collection) t.collection = this; 603 | return t 604 | } 605 | e || (e = {}); 606 | e.collection = this; 607 | var i = new this.model(t, e); 608 | if (!i._validate(t, e)) { 609 | this.trigger("invalid", this, t, e); 610 | return false 611 | } 612 | return i 613 | }, 614 | _removeReference: function (t) { 615 | if (this === t.collection) delete t.collection; 616 | t.off("all", this._onModelEvent, this) 617 | }, 618 | _onModelEvent: function (t, e, i, r) { 619 | if ((t === "add" || t === "remove") && i !== this) return; 620 | if (t === "destroy") this.remove(e, r); 621 | if (e && t === "change:" + e.idAttribute) { 622 | delete this._byId[e.previous(e.idAttribute)]; 623 | if (e.id != null) this._byId[e.id] = e 624 | } 625 | this.trigger.apply(this, arguments) 626 | } 627 | }); 628 | var _ = ["forEach", "each", "map", "collect", "reduce", "foldl", "inject", "reduceRight", "foldr", "find", "detect", "filter", "select", "reject", "every", "all", "some", "any", "include", "contains", "invoke", "max", "min", "toArray", "size", "first", "head", "take", "initial", "rest", "tail", "drop", "last", "without", "indexOf", "shuffle", "lastIndexOf", "isEmpty", "chain"]; 629 | h.each(_, function (t) { 630 | g.prototype[t] = function () { 631 | var e = s.call(arguments); 632 | e.unshift(this.models); 633 | return h[t].apply(h, e) 634 | } 635 | }); 636 | var w = ["groupBy", "countBy", "sortBy"]; 637 | h.each(w, function (t) { 638 | g.prototype[t] = function (e, i) { 639 | var r = h.isFunction(e) ? e : function (t) { 640 | return t.get(e) 641 | }; 642 | return h[t](this.models, r, i) 643 | } 644 | }); 645 | var b = a.View = function (t) { 646 | this.cid = h.uniqueId("view"); 647 | this._configure(t || {}); 648 | this._ensureElement(); 649 | this.initialize.apply(this, arguments); 650 | this.delegateEvents() 651 | }; 652 | var x = /^(\S+)\s*(.*)$/; 653 | var E = ["model", "collection", "el", "id", "attributes", "className", "tagName", "events"]; 654 | h.extend(b.prototype, o, { 655 | tagName: "div", 656 | $: function (t) { 657 | return this.$el.find(t) 658 | }, 659 | initialize: function () {}, 660 | render: function () { 661 | return this 662 | }, 663 | remove: function () { 664 | this.$el.remove(); 665 | this.stopListening(); 666 | return this 667 | }, 668 | setElement: function (t, e) { 669 | if (this.$el) this.undelegateEvents(); 670 | this.$el = t instanceof a.$ ? t : a.$(t); 671 | this.el = this.$el[0]; 672 | if (e !== false) this.delegateEvents(); 673 | return this 674 | }, 675 | delegateEvents: function (t) { 676 | if (!(t || (t = h.result(this, "events")))) return this; 677 | this.undelegateEvents(); 678 | for (var e in t) { 679 | var i = t[e]; 680 | if (!h.isFunction(i)) i = this[t[e]]; 681 | if (!i) continue; 682 | var r = e.match(x); 683 | var s = r[1], 684 | n = r[2]; 685 | i = h.bind(i, this); 686 | s += ".delegateEvents" + this.cid; 687 | if (n === "") { 688 | this.$el.on(s, i) 689 | } else { 690 | this.$el.on(s, n, i) 691 | } 692 | } 693 | return this 694 | }, 695 | undelegateEvents: function () { 696 | this.$el.off(".delegateEvents" + this.cid); 697 | return this 698 | }, 699 | _configure: function (t) { 700 | if (this.options) t = h.extend({}, h.result(this, "options"), t); 701 | h.extend(this, h.pick(t, E)); 702 | this.options = t 703 | }, 704 | _ensureElement: function () { 705 | if (!this.el) { 706 | var t = h.extend({}, h.result(this, "attributes")); 707 | if (this.id) t.id = h.result(this, "id"); 708 | if (this.className) t["class"] = h.result(this, "className"); 709 | var e = a.$("<" + h.result(this, "tagName") + ">").attr(t); 710 | this.setElement(e, false) 711 | } else { 712 | this.setElement(h.result(this, "el"), false) 713 | } 714 | } 715 | }); 716 | a.sync = function (t, e, i) { 717 | var r = k[t]; 718 | h.defaults(i || (i = {}), { 719 | emulateHTTP: a.emulateHTTP, 720 | emulateJSON: a.emulateJSON 721 | }); 722 | var s = { 723 | type: r, 724 | dataType: "json" 725 | }; 726 | if (!i.url) { 727 | s.url = h.result(e, "url") || U() 728 | } 729 | if (i.data == null && e && (t === "create" || t === "update" || t === "patch")) { 730 | s.contentType = "application/json"; 731 | s.data = JSON.stringify(i.attrs || e.toJSON(i)) 732 | } 733 | if (i.emulateJSON) { 734 | s.contentType = "application/x-www-form-urlencoded"; 735 | s.data = s.data ? { 736 | model: s.data 737 | } : {} 738 | } 739 | if (i.emulateHTTP && (r === "PUT" || r === "DELETE" || r === "PATCH")) { 740 | s.type = "POST"; 741 | if (i.emulateJSON) s.data._method = r; 742 | var n = i.beforeSend; 743 | i.beforeSend = function (t) { 744 | t.setRequestHeader("X-HTTP-Method-Override", r); 745 | if (n) return n.apply(this, arguments) 746 | } 747 | } 748 | if (s.type !== "GET" && !i.emulateJSON) { 749 | s.processData = false 750 | } 751 | if (s.type === "PATCH" && window.ActiveXObject && !(window.external && window.external.msActiveXFilteringEnabled)) { 752 | s.xhr = function () { 753 | return new ActiveXObject("Microsoft.XMLHTTP") 754 | } 755 | } 756 | var o = i.xhr = a.ajax(h.extend(s, i)); 757 | e.trigger("request", e, o, i); 758 | return o 759 | }; 760 | var k = { 761 | create: "POST", 762 | update: "PUT", 763 | patch: "PATCH", 764 | "delete": "DELETE", 765 | read: "GET" 766 | }; 767 | a.ajax = function () { 768 | return a.$.ajax.apply(a.$, arguments) 769 | }; 770 | var S = a.Router = function (t) { 771 | t || (t = {}); 772 | if (t.routes) this.routes = t.routes; 773 | this._bindRoutes(); 774 | this.initialize.apply(this, arguments) 775 | }; 776 | var $ = /\((.*?)\)/g; 777 | var T = /(\(\?)?:\w+/g; 778 | var H = /\*\w+/g; 779 | var A = /[\-{}\[\]+?.,\\\^$|#\s]/g; 780 | h.extend(S.prototype, o, { 781 | initialize: function () {}, 782 | route: function (t, e, i) { 783 | if (!h.isRegExp(t)) t = this._routeToRegExp(t); 784 | if (h.isFunction(e)) { 785 | i = e; 786 | e = "" 787 | } 788 | if (!i) i = this[e]; 789 | var r = this; 790 | a.history.route(t, function (s) { 791 | var n = r._extractParameters(t, s); 792 | i && i.apply(r, n); 793 | r.trigger.apply(r, ["route:" + e].concat(n)); 794 | r.trigger("route", e, n); 795 | a.history.trigger("route", r, e, n) 796 | }); 797 | return this 798 | }, 799 | navigate: function (t, e) { 800 | a.history.navigate(t, e); 801 | return this 802 | }, 803 | _bindRoutes: function () { 804 | if (!this.routes) return; 805 | this.routes = h.result(this, "routes"); 806 | var t, e = h.keys(this.routes); 807 | while ((t = e.pop()) != null) { 808 | this.route(t, this.routes[t]) 809 | } 810 | }, 811 | _routeToRegExp: function (t) { 812 | t = t.replace(A, "\\$&").replace($, "(?:$1)?").replace(T, function (t, e) { 813 | return e ? t : "([^/]+)" 814 | }).replace(H, "(.*?)"); 815 | return new RegExp("^" + t + "$") 816 | }, 817 | _extractParameters: function (t, e) { 818 | var i = t.exec(e).slice(1); 819 | return h.map(i, function (t) { 820 | return t ? decodeURIComponent(t) : null 821 | }) 822 | } 823 | }); 824 | var I = a.History = function () { 825 | this.handlers = []; 826 | h.bindAll(this, "checkUrl"); 827 | if (typeof window !== "undefined") { 828 | this.location = window.location; 829 | this.history = window.history 830 | } 831 | }; 832 | var N = /^[#\/]|\s+$/g; 833 | var P = /^\/+|\/+$/g; 834 | var O = /msie [\w.]+/; 835 | var C = /\/$/; 836 | I.started = false; 837 | h.extend(I.prototype, o, { 838 | interval: 50, 839 | getHash: function (t) { 840 | var e = (t || this).location.href.match(/#(.*)$/); 841 | return e ? e[1] : "" 842 | }, 843 | getFragment: function (t, e) { 844 | if (t == null) { 845 | if (this._hasPushState || !this._wantsHashChange || e) { 846 | t = this.location.pathname; 847 | var i = this.root.replace(C, ""); 848 | if (!t.indexOf(i)) t = t.substr(i.length) 849 | } else { 850 | t = this.getHash() 851 | } 852 | } 853 | return t.replace(N, "") 854 | }, 855 | start: function (t) { 856 | if (I.started) throw new Error("Backbone.history has already been started"); 857 | I.started = true; 858 | this.options = h.extend({}, { 859 | root: "/" 860 | }, this.options, t); 861 | this.root = this.options.root; 862 | this._wantsHashChange = this.options.hashChange !== false; 863 | this._wantsPushState = !! this.options.pushState; 864 | this._hasPushState = !! (this.options.pushState && this.history && this.history.pushState); 865 | var e = this.getFragment(); 866 | var i = document.documentMode; 867 | var r = O.exec(navigator.userAgent.toLowerCase()) && (!i || i <= 7); 868 | this.root = ("/" + this.root + "/").replace(P, "/"); 869 | if (r && this._wantsHashChange) { 870 | this.iframe = a.$('' 68 | ).bind('load', function () { 69 | var fileInputClones, 70 | paramNames = $.isArray(options.paramName) ? 71 | options.paramName : [options.paramName]; 72 | iframe 73 | .unbind('load') 74 | .bind('load', function () { 75 | var response; 76 | // Wrap in a try/catch block to catch exceptions thrown 77 | // when trying to access cross-domain iframe contents: 78 | try { 79 | response = iframe.contents(); 80 | // Google Chrome and Firefox do not throw an 81 | // exception when calling iframe.contents() on 82 | // cross-domain requests, so we unify the response: 83 | if (!response.length || !response[0].firstChild) { 84 | throw new Error(); 85 | } 86 | } catch (e) { 87 | response = undefined; 88 | } 89 | // The complete callback returns the 90 | // iframe content document as response object: 91 | completeCallback( 92 | 200, 93 | 'success', 94 | {'iframe': response} 95 | ); 96 | // Fix for IE endless progress bar activity bug 97 | // (happens on form submits to iframe targets): 98 | $('') 99 | .appendTo(form); 100 | window.setTimeout(function () { 101 | // Removing the form in a setTimeout call 102 | // allows Chrome's developer tools to display 103 | // the response result 104 | form.remove(); 105 | }, 0); 106 | }); 107 | form 108 | .prop('target', iframe.prop('name')) 109 | .prop('action', options.url) 110 | .prop('method', options.type); 111 | if (options.formData) { 112 | $.each(options.formData, function (index, field) { 113 | $('') 114 | .prop('name', field.name) 115 | .val(field.value) 116 | .appendTo(form); 117 | }); 118 | } 119 | if (options.fileInput && options.fileInput.length && 120 | options.type === 'POST') { 121 | fileInputClones = options.fileInput.clone(); 122 | // Insert a clone for each file input field: 123 | options.fileInput.after(function (index) { 124 | return fileInputClones[index]; 125 | }); 126 | if (options.paramName) { 127 | options.fileInput.each(function (index) { 128 | $(this).prop( 129 | 'name', 130 | paramNames[index] || options.paramName 131 | ); 132 | }); 133 | } 134 | // Appending the file input fields to the hidden form 135 | // removes them from their original location: 136 | form 137 | .append(options.fileInput) 138 | .prop('enctype', 'multipart/form-data') 139 | // enctype must be set as encoding for IE: 140 | .prop('encoding', 'multipart/form-data'); 141 | } 142 | form.submit(); 143 | // Insert the file input fields at their original location 144 | // by replacing the clones with the originals: 145 | if (fileInputClones && fileInputClones.length) { 146 | options.fileInput.each(function (index, input) { 147 | var clone = $(fileInputClones[index]); 148 | $(input).prop('name', clone.prop('name')); 149 | clone.replaceWith(input); 150 | }); 151 | } 152 | }); 153 | form.append(iframe).appendTo(document.body); 154 | }, 155 | abort: function () { 156 | if (iframe) { 157 | // javascript:false as iframe src aborts the request 158 | // and prevents warning popups on HTTPS in IE6. 159 | // concat is used to avoid the "Script URL" JSLint error: 160 | iframe 161 | .unbind('load') 162 | .prop('src', 'javascript'.concat(':false;')); 163 | } 164 | if (form) { 165 | form.remove(); 166 | } 167 | } 168 | }; 169 | } 170 | }); 171 | 172 | // The iframe transport returns the iframe content document as response. 173 | // The following adds converters from iframe to text, json, html, xml 174 | // and script. 175 | // Please note that the Content-Type for JSON responses has to be text/plain 176 | // or text/html, if the browser doesn't include application/json in the 177 | // Accept header, else IE will show a download dialog. 178 | // The Content-Type for XML responses on the other hand has to be always 179 | // application/xml or text/xml, so IE properly parses the XML response. 180 | // See also 181 | // https://github.com/blueimp/jQuery-File-Upload/wiki/Setup#content-type-negotiation 182 | $.ajaxSetup({ 183 | converters: { 184 | 'iframe text': function (iframe) { 185 | return iframe && $(iframe[0].body).text(); 186 | }, 187 | 'iframe json': function (iframe) { 188 | return iframe && $.parseJSON($(iframe[0].body).text()); 189 | }, 190 | 'iframe html': function (iframe) { 191 | return iframe && $(iframe[0].body).html(); 192 | }, 193 | 'iframe xml': function (iframe) { 194 | var xmlDoc = iframe && iframe[0]; 195 | return xmlDoc && $.isXMLDoc(xmlDoc) ? xmlDoc : 196 | $.parseXML((xmlDoc.XMLDocument && xmlDoc.XMLDocument.xml) || 197 | $(xmlDoc.body).html()); 198 | }, 199 | 'iframe script': function (iframe) { 200 | return iframe && $.globalEval($(iframe[0].body).text()); 201 | } 202 | } 203 | }); 204 | 205 | })); 206 | -------------------------------------------------------------------------------- /sample/vendor/js/jquery.ui.widget.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery UI Widget 1.10.3+amd 3 | * https://github.com/blueimp/jQuery-File-Upload 4 | * 5 | * Copyright 2013 jQuery Foundation and other contributors 6 | * Released under the MIT license. 7 | * http://jquery.org/license 8 | * 9 | * http://api.jqueryui.com/jQuery.widget/ 10 | */ 11 | 12 | (function (factory) { 13 | if (typeof define === "function" && define.amd) { 14 | // Register as an anonymous AMD module: 15 | define(["jquery"], factory); 16 | } else { 17 | // Browser globals: 18 | factory(jQuery); 19 | } 20 | }(function( $, undefined ) { 21 | 22 | var uuid = 0, 23 | slice = Array.prototype.slice, 24 | _cleanData = $.cleanData; 25 | $.cleanData = function( elems ) { 26 | for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { 27 | try { 28 | $( elem ).triggerHandler( "remove" ); 29 | // http://bugs.jquery.com/ticket/8235 30 | } catch( e ) {} 31 | } 32 | _cleanData( elems ); 33 | }; 34 | 35 | $.widget = function( name, base, prototype ) { 36 | var fullName, existingConstructor, constructor, basePrototype, 37 | // proxiedPrototype allows the provided prototype to remain unmodified 38 | // so that it can be used as a mixin for multiple widgets (#8876) 39 | proxiedPrototype = {}, 40 | namespace = name.split( "." )[ 0 ]; 41 | 42 | name = name.split( "." )[ 1 ]; 43 | fullName = namespace + "-" + name; 44 | 45 | if ( !prototype ) { 46 | prototype = base; 47 | base = $.Widget; 48 | } 49 | 50 | // create selector for plugin 51 | $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) { 52 | return !!$.data( elem, fullName ); 53 | }; 54 | 55 | $[ namespace ] = $[ namespace ] || {}; 56 | existingConstructor = $[ namespace ][ name ]; 57 | constructor = $[ namespace ][ name ] = function( options, element ) { 58 | // allow instantiation without "new" keyword 59 | if ( !this._createWidget ) { 60 | return new constructor( options, element ); 61 | } 62 | 63 | // allow instantiation without initializing for simple inheritance 64 | // must use "new" keyword (the code above always passes args) 65 | if ( arguments.length ) { 66 | this._createWidget( options, element ); 67 | } 68 | }; 69 | // extend with the existing constructor to carry over any static properties 70 | $.extend( constructor, existingConstructor, { 71 | version: prototype.version, 72 | // copy the object used to create the prototype in case we need to 73 | // redefine the widget later 74 | _proto: $.extend( {}, prototype ), 75 | // track widgets that inherit from this widget in case this widget is 76 | // redefined after a widget inherits from it 77 | _childConstructors: [] 78 | }); 79 | 80 | basePrototype = new base(); 81 | // we need to make the options hash a property directly on the new instance 82 | // otherwise we'll modify the options hash on the prototype that we're 83 | // inheriting from 84 | basePrototype.options = $.widget.extend( {}, basePrototype.options ); 85 | $.each( prototype, function( prop, value ) { 86 | if ( !$.isFunction( value ) ) { 87 | proxiedPrototype[ prop ] = value; 88 | return; 89 | } 90 | proxiedPrototype[ prop ] = (function() { 91 | var _super = function() { 92 | return base.prototype[ prop ].apply( this, arguments ); 93 | }, 94 | _superApply = function( args ) { 95 | return base.prototype[ prop ].apply( this, args ); 96 | }; 97 | return function() { 98 | var __super = this._super, 99 | __superApply = this._superApply, 100 | returnValue; 101 | 102 | this._super = _super; 103 | this._superApply = _superApply; 104 | 105 | returnValue = value.apply( this, arguments ); 106 | 107 | this._super = __super; 108 | this._superApply = __superApply; 109 | 110 | return returnValue; 111 | }; 112 | })(); 113 | }); 114 | constructor.prototype = $.widget.extend( basePrototype, { 115 | // TODO: remove support for widgetEventPrefix 116 | // always use the name + a colon as the prefix, e.g., draggable:start 117 | // don't prefix for widgets that aren't DOM-based 118 | widgetEventPrefix: existingConstructor ? basePrototype.widgetEventPrefix : name 119 | }, proxiedPrototype, { 120 | constructor: constructor, 121 | namespace: namespace, 122 | widgetName: name, 123 | widgetFullName: fullName 124 | }); 125 | 126 | // If this widget is being redefined then we need to find all widgets that 127 | // are inheriting from it and redefine all of them so that they inherit from 128 | // the new version of this widget. We're essentially trying to replace one 129 | // level in the prototype chain. 130 | if ( existingConstructor ) { 131 | $.each( existingConstructor._childConstructors, function( i, child ) { 132 | var childPrototype = child.prototype; 133 | 134 | // redefine the child widget using the same prototype that was 135 | // originally used, but inherit from the new version of the base 136 | $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto ); 137 | }); 138 | // remove the list of existing child constructors from the old constructor 139 | // so the old child constructors can be garbage collected 140 | delete existingConstructor._childConstructors; 141 | } else { 142 | base._childConstructors.push( constructor ); 143 | } 144 | 145 | $.widget.bridge( name, constructor ); 146 | }; 147 | 148 | $.widget.extend = function( target ) { 149 | var input = slice.call( arguments, 1 ), 150 | inputIndex = 0, 151 | inputLength = input.length, 152 | key, 153 | value; 154 | for ( ; inputIndex < inputLength; inputIndex++ ) { 155 | for ( key in input[ inputIndex ] ) { 156 | value = input[ inputIndex ][ key ]; 157 | if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) { 158 | // Clone objects 159 | if ( $.isPlainObject( value ) ) { 160 | target[ key ] = $.isPlainObject( target[ key ] ) ? 161 | $.widget.extend( {}, target[ key ], value ) : 162 | // Don't extend strings, arrays, etc. with objects 163 | $.widget.extend( {}, value ); 164 | // Copy everything else by reference 165 | } else { 166 | target[ key ] = value; 167 | } 168 | } 169 | } 170 | } 171 | return target; 172 | }; 173 | 174 | $.widget.bridge = function( name, object ) { 175 | var fullName = object.prototype.widgetFullName || name; 176 | $.fn[ name ] = function( options ) { 177 | var isMethodCall = typeof options === "string", 178 | args = slice.call( arguments, 1 ), 179 | returnValue = this; 180 | 181 | // allow multiple hashes to be passed on init 182 | options = !isMethodCall && args.length ? 183 | $.widget.extend.apply( null, [ options ].concat(args) ) : 184 | options; 185 | 186 | if ( isMethodCall ) { 187 | this.each(function() { 188 | var methodValue, 189 | instance = $.data( this, fullName ); 190 | if ( !instance ) { 191 | return $.error( "cannot call methods on " + name + " prior to initialization; " + 192 | "attempted to call method '" + options + "'" ); 193 | } 194 | if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) { 195 | return $.error( "no such method '" + options + "' for " + name + " widget instance" ); 196 | } 197 | methodValue = instance[ options ].apply( instance, args ); 198 | if ( methodValue !== instance && methodValue !== undefined ) { 199 | returnValue = methodValue && methodValue.jquery ? 200 | returnValue.pushStack( methodValue.get() ) : 201 | methodValue; 202 | return false; 203 | } 204 | }); 205 | } else { 206 | this.each(function() { 207 | var instance = $.data( this, fullName ); 208 | if ( instance ) { 209 | instance.option( options || {} )._init(); 210 | } else { 211 | $.data( this, fullName, new object( options, this ) ); 212 | } 213 | }); 214 | } 215 | 216 | return returnValue; 217 | }; 218 | }; 219 | 220 | $.Widget = function( /* options, element */ ) {}; 221 | $.Widget._childConstructors = []; 222 | 223 | $.Widget.prototype = { 224 | widgetName: "widget", 225 | widgetEventPrefix: "", 226 | defaultElement: "
", 227 | options: { 228 | disabled: false, 229 | 230 | // callbacks 231 | create: null 232 | }, 233 | _createWidget: function( options, element ) { 234 | element = $( element || this.defaultElement || this )[ 0 ]; 235 | this.element = $( element ); 236 | this.uuid = uuid++; 237 | this.eventNamespace = "." + this.widgetName + this.uuid; 238 | this.options = $.widget.extend( {}, 239 | this.options, 240 | this._getCreateOptions(), 241 | options ); 242 | 243 | this.bindings = $(); 244 | this.hoverable = $(); 245 | this.focusable = $(); 246 | 247 | if ( element !== this ) { 248 | $.data( element, this.widgetFullName, this ); 249 | this._on( true, this.element, { 250 | remove: function( event ) { 251 | if ( event.target === element ) { 252 | this.destroy(); 253 | } 254 | } 255 | }); 256 | this.document = $( element.style ? 257 | // element within the document 258 | element.ownerDocument : 259 | // element is window or document 260 | element.document || element ); 261 | this.window = $( this.document[0].defaultView || this.document[0].parentWindow ); 262 | } 263 | 264 | this._create(); 265 | this._trigger( "create", null, this._getCreateEventData() ); 266 | this._init(); 267 | }, 268 | _getCreateOptions: $.noop, 269 | _getCreateEventData: $.noop, 270 | _create: $.noop, 271 | _init: $.noop, 272 | 273 | destroy: function() { 274 | this._destroy(); 275 | // we can probably remove the unbind calls in 2.0 276 | // all event bindings should go through this._on() 277 | this.element 278 | .unbind( this.eventNamespace ) 279 | // 1.9 BC for #7810 280 | // TODO remove dual storage 281 | .removeData( this.widgetName ) 282 | .removeData( this.widgetFullName ) 283 | // support: jquery <1.6.3 284 | // http://bugs.jquery.com/ticket/9413 285 | .removeData( $.camelCase( this.widgetFullName ) ); 286 | this.widget() 287 | .unbind( this.eventNamespace ) 288 | .removeAttr( "aria-disabled" ) 289 | .removeClass( 290 | this.widgetFullName + "-disabled " + 291 | "ui-state-disabled" ); 292 | 293 | // clean up events and states 294 | this.bindings.unbind( this.eventNamespace ); 295 | this.hoverable.removeClass( "ui-state-hover" ); 296 | this.focusable.removeClass( "ui-state-focus" ); 297 | }, 298 | _destroy: $.noop, 299 | 300 | widget: function() { 301 | return this.element; 302 | }, 303 | 304 | option: function( key, value ) { 305 | var options = key, 306 | parts, 307 | curOption, 308 | i; 309 | 310 | if ( arguments.length === 0 ) { 311 | // don't return a reference to the internal hash 312 | return $.widget.extend( {}, this.options ); 313 | } 314 | 315 | if ( typeof key === "string" ) { 316 | // handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } } 317 | options = {}; 318 | parts = key.split( "." ); 319 | key = parts.shift(); 320 | if ( parts.length ) { 321 | curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] ); 322 | for ( i = 0; i < parts.length - 1; i++ ) { 323 | curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {}; 324 | curOption = curOption[ parts[ i ] ]; 325 | } 326 | key = parts.pop(); 327 | if ( value === undefined ) { 328 | return curOption[ key ] === undefined ? null : curOption[ key ]; 329 | } 330 | curOption[ key ] = value; 331 | } else { 332 | if ( value === undefined ) { 333 | return this.options[ key ] === undefined ? null : this.options[ key ]; 334 | } 335 | options[ key ] = value; 336 | } 337 | } 338 | 339 | this._setOptions( options ); 340 | 341 | return this; 342 | }, 343 | _setOptions: function( options ) { 344 | var key; 345 | 346 | for ( key in options ) { 347 | this._setOption( key, options[ key ] ); 348 | } 349 | 350 | return this; 351 | }, 352 | _setOption: function( key, value ) { 353 | this.options[ key ] = value; 354 | 355 | if ( key === "disabled" ) { 356 | this.widget() 357 | .toggleClass( this.widgetFullName + "-disabled ui-state-disabled", !!value ) 358 | .attr( "aria-disabled", value ); 359 | this.hoverable.removeClass( "ui-state-hover" ); 360 | this.focusable.removeClass( "ui-state-focus" ); 361 | } 362 | 363 | return this; 364 | }, 365 | 366 | enable: function() { 367 | return this._setOption( "disabled", false ); 368 | }, 369 | disable: function() { 370 | return this._setOption( "disabled", true ); 371 | }, 372 | 373 | _on: function( suppressDisabledCheck, element, handlers ) { 374 | var delegateElement, 375 | instance = this; 376 | 377 | // no suppressDisabledCheck flag, shuffle arguments 378 | if ( typeof suppressDisabledCheck !== "boolean" ) { 379 | handlers = element; 380 | element = suppressDisabledCheck; 381 | suppressDisabledCheck = false; 382 | } 383 | 384 | // no element argument, shuffle and use this.element 385 | if ( !handlers ) { 386 | handlers = element; 387 | element = this.element; 388 | delegateElement = this.widget(); 389 | } else { 390 | // accept selectors, DOM elements 391 | element = delegateElement = $( element ); 392 | this.bindings = this.bindings.add( element ); 393 | } 394 | 395 | $.each( handlers, function( event, handler ) { 396 | function handlerProxy() { 397 | // allow widgets to customize the disabled handling 398 | // - disabled as an array instead of boolean 399 | // - disabled class as method for disabling individual parts 400 | if ( !suppressDisabledCheck && 401 | ( instance.options.disabled === true || 402 | $( this ).hasClass( "ui-state-disabled" ) ) ) { 403 | return; 404 | } 405 | return ( typeof handler === "string" ? instance[ handler ] : handler ) 406 | .apply( instance, arguments ); 407 | } 408 | 409 | // copy the guid so direct unbinding works 410 | if ( typeof handler !== "string" ) { 411 | handlerProxy.guid = handler.guid = 412 | handler.guid || handlerProxy.guid || $.guid++; 413 | } 414 | 415 | var match = event.match( /^(\w+)\s*(.*)$/ ), 416 | eventName = match[1] + instance.eventNamespace, 417 | selector = match[2]; 418 | if ( selector ) { 419 | delegateElement.delegate( selector, eventName, handlerProxy ); 420 | } else { 421 | element.bind( eventName, handlerProxy ); 422 | } 423 | }); 424 | }, 425 | 426 | _off: function( element, eventName ) { 427 | eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + this.eventNamespace; 428 | element.unbind( eventName ).undelegate( eventName ); 429 | }, 430 | 431 | _delay: function( handler, delay ) { 432 | function handlerProxy() { 433 | return ( typeof handler === "string" ? instance[ handler ] : handler ) 434 | .apply( instance, arguments ); 435 | } 436 | var instance = this; 437 | return setTimeout( handlerProxy, delay || 0 ); 438 | }, 439 | 440 | _hoverable: function( element ) { 441 | this.hoverable = this.hoverable.add( element ); 442 | this._on( element, { 443 | mouseenter: function( event ) { 444 | $( event.currentTarget ).addClass( "ui-state-hover" ); 445 | }, 446 | mouseleave: function( event ) { 447 | $( event.currentTarget ).removeClass( "ui-state-hover" ); 448 | } 449 | }); 450 | }, 451 | 452 | _focusable: function( element ) { 453 | this.focusable = this.focusable.add( element ); 454 | this._on( element, { 455 | focusin: function( event ) { 456 | $( event.currentTarget ).addClass( "ui-state-focus" ); 457 | }, 458 | focusout: function( event ) { 459 | $( event.currentTarget ).removeClass( "ui-state-focus" ); 460 | } 461 | }); 462 | }, 463 | 464 | _trigger: function( type, event, data ) { 465 | var prop, orig, 466 | callback = this.options[ type ]; 467 | 468 | data = data || {}; 469 | event = $.Event( event ); 470 | event.type = ( type === this.widgetEventPrefix ? 471 | type : 472 | this.widgetEventPrefix + type ).toLowerCase(); 473 | // the original event may come from any element 474 | // so we need to reset the target on the new event 475 | event.target = this.element[ 0 ]; 476 | 477 | // copy original event properties over to the new event 478 | orig = event.originalEvent; 479 | if ( orig ) { 480 | for ( prop in orig ) { 481 | if ( !( prop in event ) ) { 482 | event[ prop ] = orig[ prop ]; 483 | } 484 | } 485 | } 486 | 487 | this.element.trigger( event, data ); 488 | return !( $.isFunction( callback ) && 489 | callback.apply( this.element[0], [ event ].concat( data ) ) === false || 490 | event.isDefaultPrevented() ); 491 | } 492 | }; 493 | 494 | $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) { 495 | $.Widget.prototype[ "_" + method ] = function( element, options, callback ) { 496 | if ( typeof options === "string" ) { 497 | options = { effect: options }; 498 | } 499 | var hasOptions, 500 | effectName = !options ? 501 | method : 502 | options === true || typeof options === "number" ? 503 | defaultEffect : 504 | options.effect || defaultEffect; 505 | options = options || {}; 506 | if ( typeof options === "number" ) { 507 | options = { duration: options }; 508 | } 509 | hasOptions = !$.isEmptyObject( options ); 510 | options.complete = callback; 511 | if ( options.delay ) { 512 | element.delay( options.delay ); 513 | } 514 | if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) { 515 | element[ method ]( options ); 516 | } else if ( effectName !== method && element[ effectName ] ) { 517 | element[ effectName ]( options.duration, options.easing, callback ); 518 | } else { 519 | element.queue(function( next ) { 520 | $( this )[ method ](); 521 | if ( callback ) { 522 | callback.call( element[ 0 ] ); 523 | } 524 | next(); 525 | }); 526 | } 527 | }; 528 | }); 529 | 530 | })); 531 | -------------------------------------------------------------------------------- /sample/vendor/js/underscore-1.4.4.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | var n = this, 3 | t = n._, 4 | r = {}, e = Array.prototype, 5 | u = Object.prototype, 6 | i = Function.prototype, 7 | a = e.push, 8 | o = e.slice, 9 | c = e.concat, 10 | l = u.toString, 11 | f = u.hasOwnProperty, 12 | s = e.forEach, 13 | p = e.map, 14 | h = e.reduce, 15 | v = e.reduceRight, 16 | d = e.filter, 17 | g = e.every, 18 | m = e.some, 19 | y = e.indexOf, 20 | b = e.lastIndexOf, 21 | x = Array.isArray, 22 | _ = Object.keys, 23 | j = i.bind, 24 | w = function (n) { 25 | return n instanceof w ? n : this instanceof w ? (this._wrapped = n, void 0) : new w(n) 26 | }; 27 | "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = w), exports._ = w) : n._ = w, w.VERSION = "1.4.4"; 28 | var A = w.each = w.forEach = function (n, t, e) { 29 | if (null != n) 30 | if (s && n.forEach === s) n.forEach(t, e); 31 | else if (n.length === +n.length) { 32 | for (var u = 0, i = n.length; i > u; u++) 33 | if (t.call(e, n[u], u, n) === r) return 34 | } else 35 | for (var a in n) 36 | if (w.has(n, a) && t.call(e, n[a], a, n) === r) return 37 | }; 38 | w.map = w.collect = function (n, t, r) { 39 | var e = []; 40 | return null == n ? e : p && n.map === p ? n.map(t, r) : (A(n, function (n, u, i) { 41 | e[e.length] = t.call(r, n, u, i) 42 | }), e) 43 | }; 44 | var O = "Reduce of empty array with no initial value"; 45 | w.reduce = w.foldl = w.inject = function (n, t, r, e) { 46 | var u = arguments.length > 2; 47 | if (null == n && (n = []), h && n.reduce === h) return e && (t = w.bind(t, e)), u ? n.reduce(t, r) : n.reduce(t); 48 | if (A(n, function (n, i, a) { 49 | u ? r = t.call(e, r, n, i, a) : (r = n, u = !0) 50 | }), !u) throw new TypeError(O); 51 | return r 52 | }, w.reduceRight = w.foldr = function (n, t, r, e) { 53 | var u = arguments.length > 2; 54 | if (null == n && (n = []), v && n.reduceRight === v) return e && (t = w.bind(t, e)), u ? n.reduceRight(t, r) : n.reduceRight(t); 55 | var i = n.length; 56 | if (i !== +i) { 57 | var a = w.keys(n); 58 | i = a.length 59 | } 60 | if (A(n, function (o, c, l) { 61 | c = a ? a[--i] : --i, u ? r = t.call(e, r, n[c], c, l) : (r = n[c], u = !0) 62 | }), !u) throw new TypeError(O); 63 | return r 64 | }, w.find = w.detect = function (n, t, r) { 65 | var e; 66 | return E(n, function (n, u, i) { 67 | return t.call(r, n, u, i) ? (e = n, !0) : void 0 68 | }), e 69 | }, w.filter = w.select = function (n, t, r) { 70 | var e = []; 71 | return null == n ? e : d && n.filter === d ? n.filter(t, r) : (A(n, function (n, u, i) { 72 | t.call(r, n, u, i) && (e[e.length] = n) 73 | }), e) 74 | }, w.reject = function (n, t, r) { 75 | return w.filter(n, function (n, e, u) { 76 | return !t.call(r, n, e, u) 77 | }, r) 78 | }, w.every = w.all = function (n, t, e) { 79 | t || (t = w.identity); 80 | var u = !0; 81 | return null == n ? u : g && n.every === g ? n.every(t, e) : (A(n, function (n, i, a) { 82 | return (u = u && t.call(e, n, i, a)) ? void 0 : r 83 | }), !! u) 84 | }; 85 | var E = w.some = w.any = function (n, t, e) { 86 | t || (t = w.identity); 87 | var u = !1; 88 | return null == n ? u : m && n.some === m ? n.some(t, e) : (A(n, function (n, i, a) { 89 | return u || (u = t.call(e, n, i, a)) ? r : void 0 90 | }), !! u) 91 | }; 92 | w.contains = w.include = function (n, t) { 93 | return null == n ? !1 : y && n.indexOf === y ? n.indexOf(t) != -1 : E(n, function (n) { 94 | return n === t 95 | }) 96 | }, w.invoke = function (n, t) { 97 | var r = o.call(arguments, 2), 98 | e = w.isFunction(t); 99 | return w.map(n, function (n) { 100 | return (e ? t : n[t]).apply(n, r) 101 | }) 102 | }, w.pluck = function (n, t) { 103 | return w.map(n, function (n) { 104 | return n[t] 105 | }) 106 | }, w.where = function (n, t, r) { 107 | return w.isEmpty(t) ? r ? null : [] : w[r ? "find" : "filter"](n, function (n) { 108 | for (var r in t) 109 | if (t[r] !== n[r]) return !1; 110 | return !0 111 | }) 112 | }, w.findWhere = function (n, t) { 113 | return w.where(n, t, !0) 114 | }, w.max = function (n, t, r) { 115 | if (!t && w.isArray(n) && n[0] === +n[0] && 65535 > n.length) return Math.max.apply(Math, n); 116 | if (!t && w.isEmpty(n)) return -1 / 0; 117 | var e = { 118 | computed: -1 / 0, 119 | value: -1 / 0 120 | }; 121 | return A(n, function (n, u, i) { 122 | var a = t ? t.call(r, n, u, i) : n; 123 | a >= e.computed && (e = { 124 | value: n, 125 | computed: a 126 | }) 127 | }), e.value 128 | }, w.min = function (n, t, r) { 129 | if (!t && w.isArray(n) && n[0] === +n[0] && 65535 > n.length) return Math.min.apply(Math, n); 130 | if (!t && w.isEmpty(n)) return 1 / 0; 131 | var e = { 132 | computed: 1 / 0, 133 | value: 1 / 0 134 | }; 135 | return A(n, function (n, u, i) { 136 | var a = t ? t.call(r, n, u, i) : n; 137 | e.computed > a && (e = { 138 | value: n, 139 | computed: a 140 | }) 141 | }), e.value 142 | }, w.shuffle = function (n) { 143 | var t, r = 0, 144 | e = []; 145 | return A(n, function (n) { 146 | t = w.random(r++), e[r - 1] = e[t], e[t] = n 147 | }), e 148 | }; 149 | var k = function (n) { 150 | return w.isFunction(n) ? n : function (t) { 151 | return t[n] 152 | } 153 | }; 154 | w.sortBy = function (n, t, r) { 155 | var e = k(t); 156 | return w.pluck(w.map(n, function (n, t, u) { 157 | return { 158 | value: n, 159 | index: t, 160 | criteria: e.call(r, n, t, u) 161 | } 162 | }).sort(function (n, t) { 163 | var r = n.criteria, 164 | e = t.criteria; 165 | if (r !== e) { 166 | if (r > e || r === void 0) return 1; 167 | if (e > r || e === void 0) return -1 168 | } 169 | return n.index < t.index ? -1 : 1 170 | }), "value") 171 | }; 172 | var F = function (n, t, r, e) { 173 | var u = {}, i = k(t || w.identity); 174 | return A(n, function (t, a) { 175 | var o = i.call(r, t, a, n); 176 | e(u, o, t) 177 | }), u 178 | }; 179 | w.groupBy = function (n, t, r) { 180 | return F(n, t, r, function (n, t, r) { 181 | (w.has(n, t) ? n[t] : n[t] = []).push(r) 182 | }) 183 | }, w.countBy = function (n, t, r) { 184 | return F(n, t, r, function (n, t) { 185 | w.has(n, t) || (n[t] = 0), n[t]++ 186 | }) 187 | }, w.sortedIndex = function (n, t, r, e) { 188 | r = null == r ? w.identity : k(r); 189 | for (var u = r.call(e, t), i = 0, a = n.length; a > i;) { 190 | var o = i + a >>> 1; 191 | u > r.call(e, n[o]) ? i = o + 1 : a = o 192 | } 193 | return i 194 | }, w.toArray = function (n) { 195 | return n ? w.isArray(n) ? o.call(n) : n.length === +n.length ? w.map(n, w.identity) : w.values(n) : [] 196 | }, w.size = function (n) { 197 | return null == n ? 0 : n.length === +n.length ? n.length : w.keys(n).length 198 | }, w.first = w.head = w.take = function (n, t, r) { 199 | return null == n ? void 0 : null == t || r ? n[0] : o.call(n, 0, t) 200 | }, w.initial = function (n, t, r) { 201 | return o.call(n, 0, n.length - (null == t || r ? 1 : t)) 202 | }, w.last = function (n, t, r) { 203 | return null == n ? void 0 : null == t || r ? n[n.length - 1] : o.call(n, Math.max(n.length - t, 0)) 204 | }, w.rest = w.tail = w.drop = function (n, t, r) { 205 | return o.call(n, null == t || r ? 1 : t) 206 | }, w.compact = function (n) { 207 | return w.filter(n, w.identity) 208 | }; 209 | var R = function (n, t, r) { 210 | return A(n, function (n) { 211 | w.isArray(n) ? t ? a.apply(r, n) : R(n, t, r) : r.push(n) 212 | }), r 213 | }; 214 | w.flatten = function (n, t) { 215 | return R(n, t, []) 216 | }, w.without = function (n) { 217 | return w.difference(n, o.call(arguments, 1)) 218 | }, w.uniq = w.unique = function (n, t, r, e) { 219 | w.isFunction(t) && (e = r, r = t, t = !1); 220 | var u = r ? w.map(n, r, e) : n, 221 | i = [], 222 | a = []; 223 | return A(u, function (r, e) { 224 | (t ? e && a[a.length - 1] === r : w.contains(a, r)) || (a.push(r), i.push(n[e])) 225 | }), i 226 | }, w.union = function () { 227 | return w.uniq(c.apply(e, arguments)) 228 | }, w.intersection = function (n) { 229 | var t = o.call(arguments, 1); 230 | return w.filter(w.uniq(n), function (n) { 231 | return w.every(t, function (t) { 232 | return w.indexOf(t, n) >= 0 233 | }) 234 | }) 235 | }, w.difference = function (n) { 236 | var t = c.apply(e, o.call(arguments, 1)); 237 | return w.filter(n, function (n) { 238 | return !w.contains(t, n) 239 | }) 240 | }, w.zip = function () { 241 | for (var n = o.call(arguments), t = w.max(w.pluck(n, "length")), r = Array(t), e = 0; t > e; e++) r[e] = w.pluck(n, "" + e); 242 | return r 243 | }, w.object = function (n, t) { 244 | if (null == n) return {}; 245 | for (var r = {}, e = 0, u = n.length; u > e; e++) t ? r[n[e]] = t[e] : r[n[e][0]] = n[e][1]; 246 | return r 247 | }, w.indexOf = function (n, t, r) { 248 | if (null == n) return -1; 249 | var e = 0, 250 | u = n.length; 251 | if (r) { 252 | if ("number" != typeof r) return e = w.sortedIndex(n, t), n[e] === t ? e : -1; 253 | e = 0 > r ? Math.max(0, u + r) : r 254 | } 255 | if (y && n.indexOf === y) return n.indexOf(t, r); 256 | for (; u > e; e++) 257 | if (n[e] === t) return e; 258 | return -1 259 | }, w.lastIndexOf = function (n, t, r) { 260 | if (null == n) return -1; 261 | var e = null != r; 262 | if (b && n.lastIndexOf === b) return e ? n.lastIndexOf(t, r) : n.lastIndexOf(t); 263 | for (var u = e ? r : n.length; u--;) 264 | if (n[u] === t) return u; 265 | return -1 266 | }, w.range = function (n, t, r) { 267 | 1 >= arguments.length && (t = n || 0, n = 0), r = arguments[2] || 1; 268 | for (var e = Math.max(Math.ceil((t - n) / r), 0), u = 0, i = Array(e); e > u;) i[u++] = n, n += r; 269 | return i 270 | }, w.bind = function (n, t) { 271 | if (n.bind === j && j) return j.apply(n, o.call(arguments, 1)); 272 | var r = o.call(arguments, 2); 273 | return function () { 274 | return n.apply(t, r.concat(o.call(arguments))) 275 | } 276 | }, w.partial = function (n) { 277 | var t = o.call(arguments, 1); 278 | return function () { 279 | return n.apply(this, t.concat(o.call(arguments))) 280 | } 281 | }, w.bindAll = function (n) { 282 | var t = o.call(arguments, 1); 283 | return 0 === t.length && (t = w.functions(n)), A(t, function (t) { 284 | n[t] = w.bind(n[t], n) 285 | }), n 286 | }, w.memoize = function (n, t) { 287 | var r = {}; 288 | return t || (t = w.identity), 289 | function () { 290 | var e = t.apply(this, arguments); 291 | return w.has(r, e) ? r[e] : r[e] = n.apply(this, arguments) 292 | } 293 | }, w.delay = function (n, t) { 294 | var r = o.call(arguments, 2); 295 | return setTimeout(function () { 296 | return n.apply(null, r) 297 | }, t) 298 | }, w.defer = function (n) { 299 | return w.delay.apply(w, [n, 1].concat(o.call(arguments, 1))) 300 | }, w.throttle = function (n, t) { 301 | var r, e, u, i, a = 0, 302 | o = function () { 303 | a = new Date, u = null, i = n.apply(r, e) 304 | }; 305 | return function () { 306 | var c = new Date, 307 | l = t - (c - a); 308 | return r = this, e = arguments, 0 >= l ? (clearTimeout(u), u = null, a = c, i = n.apply(r, e)) : u || (u = setTimeout(o, l)), i 309 | } 310 | }, w.debounce = function (n, t, r) { 311 | var e, u; 312 | return function () { 313 | var i = this, 314 | a = arguments, 315 | o = function () { 316 | e = null, r || (u = n.apply(i, a)) 317 | }, c = r && !e; 318 | return clearTimeout(e), e = setTimeout(o, t), c && (u = n.apply(i, a)), u 319 | } 320 | }, w.once = function (n) { 321 | var t, r = !1; 322 | return function () { 323 | return r ? t : (r = !0, t = n.apply(this, arguments), n = null, t) 324 | } 325 | }, w.wrap = function (n, t) { 326 | return function () { 327 | var r = [n]; 328 | return a.apply(r, arguments), t.apply(this, r) 329 | } 330 | }, w.compose = function () { 331 | var n = arguments; 332 | return function () { 333 | for (var t = arguments, r = n.length - 1; r >= 0; r--) t = [n[r].apply(this, t)]; 334 | return t[0] 335 | } 336 | }, w.after = function (n, t) { 337 | return 0 >= n ? t() : function () { 338 | return 1 > --n ? t.apply(this, arguments) : void 0 339 | } 340 | }, w.keys = _ || function (n) { 341 | if (n !== Object(n)) throw new TypeError("Invalid object"); 342 | var t = []; 343 | for (var r in n) w.has(n, r) && (t[t.length] = r); 344 | return t 345 | }, w.values = function (n) { 346 | var t = []; 347 | for (var r in n) w.has(n, r) && t.push(n[r]); 348 | return t 349 | }, w.pairs = function (n) { 350 | var t = []; 351 | for (var r in n) w.has(n, r) && t.push([r, n[r]]); 352 | return t 353 | }, w.invert = function (n) { 354 | var t = {}; 355 | for (var r in n) w.has(n, r) && (t[n[r]] = r); 356 | return t 357 | }, w.functions = w.methods = function (n) { 358 | var t = []; 359 | for (var r in n) w.isFunction(n[r]) && t.push(r); 360 | return t.sort() 361 | }, w.extend = function (n) { 362 | return A(o.call(arguments, 1), function (t) { 363 | if (t) 364 | for (var r in t) n[r] = t[r] 365 | }), n 366 | }, w.pick = function (n) { 367 | var t = {}, r = c.apply(e, o.call(arguments, 1)); 368 | return A(r, function (r) { 369 | r in n && (t[r] = n[r]) 370 | }), t 371 | }, w.omit = function (n) { 372 | var t = {}, r = c.apply(e, o.call(arguments, 1)); 373 | for (var u in n) w.contains(r, u) || (t[u] = n[u]); 374 | return t 375 | }, w.defaults = function (n) { 376 | return A(o.call(arguments, 1), function (t) { 377 | if (t) 378 | for (var r in t) null == n[r] && (n[r] = t[r]) 379 | }), n 380 | }, w.clone = function (n) { 381 | return w.isObject(n) ? w.isArray(n) ? n.slice() : w.extend({}, n) : n 382 | }, w.tap = function (n, t) { 383 | return t(n), n 384 | }; 385 | var I = function (n, t, r, e) { 386 | if (n === t) return 0 !== n || 1 / n == 1 / t; 387 | if (null == n || null == t) return n === t; 388 | n instanceof w && (n = n._wrapped), t instanceof w && (t = t._wrapped); 389 | var u = l.call(n); 390 | if (u != l.call(t)) return !1; 391 | switch (u) { 392 | case "[object String]": 393 | return n == t + ""; 394 | case "[object Number]": 395 | return n != +n ? t != +t : 0 == n ? 1 / n == 1 / t : n == +t; 396 | case "[object Date]": 397 | case "[object Boolean]": 398 | return +n == +t; 399 | case "[object RegExp]": 400 | return n.source == t.source && n.global == t.global && n.multiline == t.multiline && n.ignoreCase == t.ignoreCase 401 | } 402 | if ("object" != typeof n || "object" != typeof t) return !1; 403 | for (var i = r.length; i--;) 404 | if (r[i] == n) return e[i] == t; 405 | r.push(n), e.push(t); 406 | var a = 0, 407 | o = !0; 408 | if ("[object Array]" == u) { 409 | if (a = n.length, o = a == t.length) 410 | for (; a-- && (o = I(n[a], t[a], r, e));); 411 | } else { 412 | var c = n.constructor, 413 | f = t.constructor; 414 | if (c !== f && !(w.isFunction(c) && c instanceof c && w.isFunction(f) && f instanceof f)) return !1; 415 | for (var s in n) 416 | if (w.has(n, s) && (a++, !(o = w.has(t, s) && I(n[s], t[s], r, e)))) break; 417 | if (o) { 418 | for (s in t) 419 | if (w.has(t, s) && !a--) break; 420 | o = !a 421 | } 422 | } 423 | return r.pop(), e.pop(), o 424 | }; 425 | w.isEqual = function (n, t) { 426 | return I(n, t, [], []) 427 | }, w.isEmpty = function (n) { 428 | if (null == n) return !0; 429 | if (w.isArray(n) || w.isString(n)) return 0 === n.length; 430 | for (var t in n) 431 | if (w.has(n, t)) return !1; 432 | return !0 433 | }, w.isElement = function (n) { 434 | return !(!n || 1 !== n.nodeType) 435 | }, w.isArray = x || function (n) { 436 | return "[object Array]" == l.call(n) 437 | }, w.isObject = function (n) { 438 | return n === Object(n) 439 | }, A(["Arguments", "Function", "String", "Number", "Date", "RegExp"], function (n) { 440 | w["is" + n] = function (t) { 441 | return l.call(t) == "[object " + n + "]" 442 | } 443 | }), w.isArguments(arguments) || (w.isArguments = function (n) { 444 | return !(!n || !w.has(n, "callee")) 445 | }), "function" != typeof / . / && (w.isFunction = function (n) { 446 | return "function" == typeof n 447 | }), w.isFinite = function (n) { 448 | return isFinite(n) && !isNaN(parseFloat(n)) 449 | }, w.isNaN = function (n) { 450 | return w.isNumber(n) && n != +n 451 | }, w.isBoolean = function (n) { 452 | return n === !0 || n === !1 || "[object Boolean]" == l.call(n) 453 | }, w.isNull = function (n) { 454 | return null === n 455 | }, w.isUndefined = function (n) { 456 | return n === void 0 457 | }, w.has = function (n, t) { 458 | return f.call(n, t) 459 | }, w.noConflict = function () { 460 | return n._ = t, this 461 | }, w.identity = function (n) { 462 | return n 463 | }, w.times = function (n, t, r) { 464 | for (var e = Array(n), u = 0; n > u; u++) e[u] = t.call(r, u); 465 | return e 466 | }, w.random = function (n, t) { 467 | return null == t && (t = n, n = 0), n + Math.floor(Math.random() * (t - n + 1)) 468 | }; 469 | var M = { 470 | escape: { 471 | "&": "&", 472 | "<": "<", 473 | ">": ">", 474 | '"': """, 475 | "'": "'", 476 | "/": "/" 477 | } 478 | }; 479 | M.unescape = w.invert(M.escape); 480 | var S = { 481 | escape: RegExp("[" + w.keys(M.escape).join("") + "]", "g"), 482 | unescape: RegExp("(" + w.keys(M.unescape).join("|") + ")", "g") 483 | }; 484 | w.each(["escape", "unescape"], function (n) { 485 | w[n] = function (t) { 486 | return null == t ? "" : ("" + t).replace(S[n], function (t) { 487 | return M[n][t] 488 | }) 489 | } 490 | }), w.result = function (n, t) { 491 | if (null == n) return null; 492 | var r = n[t]; 493 | return w.isFunction(r) ? r.call(n) : r 494 | }, w.mixin = function (n) { 495 | A(w.functions(n), function (t) { 496 | var r = w[t] = n[t]; 497 | w.prototype[t] = function () { 498 | var n = [this._wrapped]; 499 | return a.apply(n, arguments), D.call(this, r.apply(w, n)) 500 | } 501 | }) 502 | }; 503 | var N = 0; 504 | w.uniqueId = function (n) { 505 | var t = ++N + ""; 506 | return n ? n + t : t 507 | }, w.templateSettings = { 508 | evaluate: /<%([\s\S]+?)%>/g, 509 | interpolate: /<%=([\s\S]+?)%>/g, 510 | escape: /<%-([\s\S]+?)%>/g 511 | }; 512 | var T = /(.)^/, 513 | q = { 514 | "'": "'", 515 | "\\": "\\", 516 | "\r": "r", 517 | "\n": "n", 518 | " ": "t", 519 | "\u2028": "u2028", 520 | "\u2029": "u2029" 521 | }, B = /\\|'|\r|\n|\t|\u2028|\u2029/g; 522 | w.template = function (n, t, r) { 523 | var e; 524 | r = w.defaults({}, r, w.templateSettings); 525 | var u = RegExp([(r.escape || T).source, (r.interpolate || T).source, (r.evaluate || T).source].join("|") + "|$", "g"), 526 | i = 0, 527 | a = "__p+='"; 528 | n.replace(u, function (t, r, e, u, o) { 529 | return a += n.slice(i, o).replace(B, function (n) { 530 | return "\\" + q[n] 531 | }), r && (a += "'+\n((__t=(" + r + "))==null?'':_.escape(__t))+\n'"), e && (a += "'+\n((__t=(" + e + "))==null?'':__t)+\n'"), u && (a += "';\n" + u + "\n__p+='"), i = o + t.length, t 532 | }), a += "';\n", r.variable || (a = "with(obj||{}){\n" + a + "}\n"), a = "var __t,__p='',__j=Array.prototype.join," + "print=function(){__p+=__j.call(arguments,'');};\n" + a + "return __p;\n"; 533 | try { 534 | e = Function(r.variable || "obj", "_", a) 535 | } catch (o) { 536 | throw o.source = a, o 537 | } 538 | if (t) return e(t, w); 539 | var c = function (n) { 540 | return e.call(this, n, w) 541 | }; 542 | return c.source = "function(" + (r.variable || "obj") + "){\n" + a + "}", c 543 | }, w.chain = function (n) { 544 | return w(n).chain() 545 | }; 546 | var D = function (n) { 547 | return this._chain ? w(n).chain() : n 548 | }; 549 | w.mixin(w), A(["pop", "push", "reverse", "shift", "sort", "splice", "unshift"], function (n) { 550 | var t = e[n]; 551 | w.prototype[n] = function () { 552 | var r = this._wrapped; 553 | return t.apply(r, arguments), "shift" != n && "splice" != n || 0 !== r.length || delete r[0], D.call(this, r) 554 | } 555 | }), A(["concat", "join", "slice"], function (n) { 556 | var t = e[n]; 557 | w.prototype[n] = function () { 558 | return D.call(this, t.apply(this._wrapped, arguments)) 559 | } 560 | }), w.extend(w.prototype, { 561 | chain: function () { 562 | return this._chain = !0, this 563 | }, 564 | value: function () { 565 | return this._wrapped 566 | } 567 | }) 568 | }).call(this); -------------------------------------------------------------------------------- /templates/upload-manager.file: -------------------------------------------------------------------------------- 1 |
<%= name %>
2 |
3 | <%= displaySize(size) %> 4 | 8 | 9 |
10 |
11 | 12 | 13 |
14 | -------------------------------------------------------------------------------- /templates/upload-manager.main: -------------------------------------------------------------------------------- 1 |

Upload files

2 |
3 |
Add files.
4 |
5 | --------------------------------------------------------------------------------