(function(transit){ var media_defaults = { swfPath: "<%= asset_path 'transit/jplayer.swf' %>", solution: "flash,html", idPrefix: "transit_media", preload: "auto", backgroundColor: "", cssSelector: { play: ".media-play", pause: ".media-pause", stop: ".media-stop", videoPlay: ".media-video-play", seekBar: ".media-seek-bar", playBar: ".media-play-bar", mute: ".media-mute", unmute: ".media-unmute", volumeBar: ".media-volume-bar", volumeBarValue: ".media-volume-bar-value", currentTime: ".media-current-time", duration: ".media-duration" } }; // HTML5 player... ignore for now. //transit.configure('video', jQuery.extend({}, media_defaults, { supplied: 'm4v' })); transit.configure('audio', jQuery.extend({}, media_defaults, { supplied: 'mp3,m4a,wav' })); transit.configure('video', { src: "<%= asset_path 'transit/video_player.swf' %>", image: '', movie: '', autoplay: 'false', loop: 'false', autohide: 'false', fullscreen: 'true', color_text: "0xffffff", color_seekbar: "0x108194", color_loadingbar: "0xe4f2f6", color_seekbarbg: "0x108194", color_button_out: "0x108194", color_button_over: "0xd15245", color_button_highlight: "0xffffff" }); transit.configure('richtext', { basePath:'assets/', skin:'compact', toolsItems: [], containersItems: [], classesItems: [] }); transit.configure('uploadify', { swf : "<%= asset_path 'transit/uploadify.swf' %>", auto : false, buttonClass : 'button', buttonCursor : 'hand', buttonImage : '', buttonText : 'Choose Files', cancelImage : '', checkExisting : false, debug : false, fileSizeLimit : 104857600, fileTypeDesc : 'Choose an Image or Video', fileTypeExts : '*.*', height : 30, method : 'post', multi : true, queueID : 'file_upload_queue', queueSizeLimit : 10, removeCompleted : false, requeueErrors : true, preventCaching : true, progressData : 'percentage', successTimeout : 30, scriptAccess : 'always', transparent : true, uploadLimit : 999, uploaderType : 'html5', width : 120, checkExisting : false }); <% Transit.contexts.map(&:to_s).map(&:classify).each do |context| %> transit.<%= context %>Context = Backbone.Model.extend({ defaults: { type: "<%= context %>", <%= context.constantize.new.to_js.collect{ |key, value| "#{key}: \"\" " }.join(",\n\t\t") %> }, url: function(){ "/transit/" + resource_url + "/" + package_id + "/" + "contexts/" }, build: function( element ){ this.attributes = transit.context.data( element, true ); } }); <% end %> })(transit);