diff --git a/CS/CalDAVServer.FileSystemStorage.AspNet/CalDAVServer.FileSystemStorage.AspNet.csproj b/CS/CalDAVServer.FileSystemStorage.AspNet/CalDAVServer.FileSystemStorage.AspNet.csproj index 2dc987bd..f72ad6bf 100644 --- a/CS/CalDAVServer.FileSystemStorage.AspNet/CalDAVServer.FileSystemStorage.AspNet.csproj +++ b/CS/CalDAVServer.FileSystemStorage.AspNet/CalDAVServer.FileSystemStorage.AspNet.csproj @@ -6,7 +6,7 @@ AnyCPU 9.0.30729 2.0 - D219E4C5-4DD9-45D5-B766-CBE6D8819F73 + 301ECB14-1BFB-47E5-84FE-1F8377D37088 {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} Library Properties @@ -123,10 +123,10 @@ - ..\packages\ITHit.WebDAV.Server.6.1.4279\lib\net451\ITHit.WebDAV.Server.dll + ..\packages\ITHit.WebDAV.Server.6.1.4285\lib\net451\ITHit.WebDAV.Server.dll - ..\packages\ITHit.WebDAV.Server.Web.6.1.4279\lib\net451\ITHit.WebDAV.Server.Web.dll + ..\packages\ITHit.WebDAV.Server.Web.6.1.4285\lib\net451\ITHit.WebDAV.Server.Web.dll @@ -144,7 +144,7 @@ True 9658 / - http://localhost:28113/ + http://localhost:18393/ True False diff --git a/CS/CalDAVServer.FileSystemStorage.AspNet/packages.config b/CS/CalDAVServer.FileSystemStorage.AspNet/packages.config index 5e581839..071a84c8 100644 --- a/CS/CalDAVServer.FileSystemStorage.AspNet/packages.config +++ b/CS/CalDAVServer.FileSystemStorage.AspNet/packages.config @@ -1,6 +1,6 @@ - - + + \ No newline at end of file diff --git a/CS/CalDAVServer.FileSystemStorage.AspNet/wwwroot/js/webdav-gridview.js b/CS/CalDAVServer.FileSystemStorage.AspNet/wwwroot/js/webdav-gridview.js deleted file mode 100644 index 4877b468..00000000 --- a/CS/CalDAVServer.FileSystemStorage.AspNet/wwwroot/js/webdav-gridview.js +++ /dev/null @@ -1,590 +0,0 @@ -(function () { - var Formatters = { - - /** - * - * @param {number} iSize - * @returns {string} - */ - FileSize: function (iSize) { - if (!iSize) { - return '0.00 B'; - } - var i = Math.floor(Math.log(iSize) / Math.log(1024)); - return (iSize / Math.pow(1024, i)).toFixed(2) + ' ' + ['B', 'kB', 'MB', 'GB', 'TB'][i]; - }, - - /** - * - * @param {Date} oDate - * @returns {string} - */ - Date: function (oDate) { - return [ - ('0' + (oDate.getMonth() + 1)).slice(-2), - ('0' + oDate.getDate()).slice(-2), - oDate.getFullYear() - ].join('/') + - ' ' + - [ - ('0' + oDate.getHours() % 12 || 12).slice(-2), - ('0' + oDate.getMinutes()).slice(-2), - ('0' + oDate.getSeconds()).slice(-2) - ].join(':') + - ' ' + - (oDate.getHours() > 12 ? 'PM' : 'AM'); - }, - - - /** - * - * @param {string} html - * @returns {string} - */ - Snippet: function (html) { - if (html) { - var safePrefix = '__b__tag' + (new Date()).getTime(); - html = html.replace(//g, safePrefix + '_0').replace(/<\/b>/g, safePrefix + '_1'); - html = $('
').text(html).text(); - html = html.replace(new RegExp(safePrefix + '_0', 'g'), ''). - replace(new RegExp(safePrefix + '_1', 'g'), ''); - } - return $('
').addClass('snippet').html(html); - } - - }; - - /////////////////// - // Folder Grid View - var FolderGridView = function (selector) { - this.$el = $(selector); - this.IsSearchMode = false; - - $(selector).on({ - mouseenter: function () { - if ($(this).hasClass('tr-snippet-url')) - $(this).addClass('hover').prev().addClass('hover'); - else - $(this).addClass('hover').next().addClass('hover'); - }, - mouseleave: function () { - if ($(this).hasClass('tr-snippet-url')) - $(this).removeClass('hover').prev().removeClass('hover'); - else - $(this).removeClass('hover').next().removeClass('hover'); - } - }, 'tr'); - }; - FolderGridView.prototype = { - - Render: function (aItems, bIsSearchMode) { - this.IsSearchMode = bIsSearchMode || false; - - // Sort by display name - if (''.localeCompare) { - aItems.sort(function (a, b) { - return a.DisplayName.localeCompare(b.DisplayName); - }); - } else { - aItems.sort(function (a, b) { - return a.DisplayName < b.DisplayName ? -1 : (a.DisplayName > b.DisplayName ? 1 : 0); - }); - } - - // Folders at first - aItems = [].concat(aItems.filter(function (oItem) { - return oItem.IsFolder(); - })).concat(aItems.filter(function (oItem) { - return !oItem.IsFolder(); - })); - - this.$el.find('tbody').html( - aItems.map(function (oItem, i) { - var locked = oItem.ActiveLocks.length > 0 - ? '' - : ''; - /** @type {ITHit.WebDAV.Client.HierarchyItem} oItem */ - return $('
').html([ - $('').html([ - $('').text(i + 1), - $(''). - html(oItem.IsFolder() ? '' + locked + - '' : locked), - this._RenderDisplayName(oItem), - $(''). - text(!oItem.IsFolder() ? Formatters.FileSize(oItem.ContentLength) : ''). - css('text-align', 'right'), - $('').text(Formatters.Date(oItem.LastModified)), - $('').html(this._RenderActions(oItem)) - ]), - $('').html([ - $(''), - $(''), - this._RenderSnippetAndUrl(oItem)])]).children(); - }.bind(this)) - ); - }, - - /** - * @param {ITHit.WebDAV.Client.HierarchyItem} oItem - **/ - _RenderDisplayName: function (oItem) { - var oElement = oItem.IsFolder() ? - $('').html($('').text(oItem.DisplayName).attr('href', oItem.Href)) : - $('').html($('').text(oItem.DisplayName)); - - return oElement; - }, - _RenderSnippetAndUrl: function (oItem) { - var oElement = $(''); - // Append path on search mode - if (this.IsSearchMode) { - new BreadcrumbsView($('
+
+
+ Drop files or folders to upload +
+
+ +
+ + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + +
Display NameSize
+
+ + +
+
+

+ This page is displayed when user accesses any folder on your WebDAV server in a web browser. + You can customize this page to your needs. +

+ +

+ Examine the MyCustomHandlerPage.html/aspx in your project to see how to list folder content + and to use IT Hit WebDAV Ajax Library to open documents for editing. +

+ +
+ +

Test Your Server

+ +

+ To test your WebDAV server you can run Ajax integration tests right from this page. +

+ Run Integration Tests + +
+ +

Manage Docs with Ajax File Browser

+ +

+ Use the IT Hit Ajax File Browser to browse your documents, open for editing from a web page and + uploading with pause/resume and auto-restore upload. +

+ Browse Using Ajax File Browser + +
+ +

Connect with WebDAV Client

+ +

+ Use a WebDAV client provided with almost any OS. Refer to Accessing WebDAV Server page for + detailed instructions. The button below is using IT Hit WebDAV Ajax Library to mount WebDAV + folder and open the default OS file manager. +

+ Browse Using OS File Manager + +
+ +

Client Version

+ +

+ IT Hit WebDAV AJAX Library: +

+ +
+
+
+
+ + + + + + + + + + + + diff --git a/CS/WebDAVServer.FileSystemStorage.AspNet.Cookies/MyCustomHandlerPage.cs b/CS/WebDAVServer.FileSystemStorage.AspNet.Cookies/MyCustomHandlerPage.cs new file mode 100644 index 00000000..28e2f099 --- /dev/null +++ b/CS/WebDAVServer.FileSystemStorage.AspNet.Cookies/MyCustomHandlerPage.cs @@ -0,0 +1,32 @@ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Web; +using System.Web.UI; +using System.Threading.Tasks; + +using ITHit.WebDAV.Server; + +namespace WebDAVServer.FileSystemStorage.AspNet.Cookies +{ + public class MyCustomHandlerPage : Page + { + protected MyCustomHandlerPage() + { + if (Type.GetType("Mono.Runtime") == null) + { + this.Load += Page_LoadAsync; + } + } + + void Page_LoadAsync(object sender, EventArgs e) + { + RegisterAsyncTask(new PageAsyncTask(GetPageDataAsync)); + } + + public async Task GetPageDataAsync() + { + } + } +} \ No newline at end of file diff --git a/CS/WebDAVServer.FileSystemStorage.AspNet.Cookies/Properties/AssemblyInfo.cs b/CS/WebDAVServer.FileSystemStorage.AspNet.Cookies/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..d7f09ee9 --- /dev/null +++ b/CS/WebDAVServer.FileSystemStorage.AspNet.Cookies/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("WebDAVServer.FileSystemStorage.AspNet.Cookies")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("WebDAVServer.FileSystemStorage.AspNet.Cookies")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("2627b8cc-be07-435c-8849-20321ed5217b")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/CS/WebDAVServer.FileSystemStorage.AspNet.Cookies/Scripts/bootstrap.js b/CS/WebDAVServer.FileSystemStorage.AspNet.Cookies/Scripts/bootstrap.js new file mode 100644 index 00000000..5aa9982e --- /dev/null +++ b/CS/WebDAVServer.FileSystemStorage.AspNet.Cookies/Scripts/bootstrap.js @@ -0,0 +1,2014 @@ +/* NUGET: BEGIN LICENSE TEXT + * + * Microsoft grants you the right to use these script files for the sole + * purpose of either: (i) interacting through your browser with the Microsoft + * website or online service, subject to the applicable licensing or use + * terms; or (ii) using the files as included with a Microsoft product subject + * to that product's license terms. Microsoft reserves all other rights to the + * files not expressly granted by Microsoft, whether by implication, estoppel + * or otherwise. Insofar as a script file is dual licensed under GPL, + * Microsoft neither took the code under GPL nor distributes it thereunder but + * under the terms set out in this paragraph. All notices and licenses + * below are for informational purposes only. + * + * NUGET: END LICENSE TEXT */ + +/** +* bootstrap.js v3.0.0 by @fat and @mdo +* Copyright 2013 Twitter Inc. +* http://www.apache.org/licenses/LICENSE-2.0 +*/ +if (!jQuery) { throw new Error("Bootstrap requires jQuery") } + +/* ======================================================================== + * Bootstrap: transition.js v3.0.0 + * http://twbs.github.com/bootstrap/javascript.html#transitions + * ======================================================================== + * Copyright 2013 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ======================================================================== */ + + ++function ($) { "use strict"; + + // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) + // ============================================================ + + function transitionEnd() { + var el = document.createElement('bootstrap') + + var transEndEventNames = { + 'WebkitTransition' : 'webkitTransitionEnd' + , 'MozTransition' : 'transitionend' + , 'OTransition' : 'oTransitionEnd otransitionend' + , 'transition' : 'transitionend' + } + + for (var name in transEndEventNames) { + if (el.style[name] !== undefined) { + return { end: transEndEventNames[name] } + } + } + } + + // http://blog.alexmaccaw.com/css-transitions + $.fn.emulateTransitionEnd = function (duration) { + var called = false, $el = this + $(this).one($.support.transition.end, function () { called = true }) + var callback = function () { if (!called) $($el).trigger($.support.transition.end) } + setTimeout(callback, duration) + return this + } + + $(function () { + $.support.transition = transitionEnd() + }) + +}(window.jQuery); + +/* ======================================================================== + * Bootstrap: alert.js v3.0.0 + * http://twbs.github.com/bootstrap/javascript.html#alerts + * ======================================================================== + * Copyright 2013 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ======================================================================== */ + + ++function ($) { "use strict"; + + // ALERT CLASS DEFINITION + // ====================== + + var dismiss = '[data-dismiss="alert"]' + var Alert = function (el) { + $(el).on('click', dismiss, this.close) + } + + Alert.prototype.close = function (e) { + var $this = $(this) + var selector = $this.attr('data-target') + + if (!selector) { + selector = $this.attr('href') + selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 + } + + var $parent = $(selector) + + if (e) e.preventDefault() + + if (!$parent.length) { + $parent = $this.hasClass('alert') ? $this : $this.parent() + } + + $parent.trigger(e = $.Event('close.bs.alert')) + + if (e.isDefaultPrevented()) return + + $parent.removeClass('in') + + function removeElement() { + $parent.trigger('closed.bs.alert').remove() + } + + $.support.transition && $parent.hasClass('fade') ? + $parent + .one($.support.transition.end, removeElement) + .emulateTransitionEnd(150) : + removeElement() + } + + + // ALERT PLUGIN DEFINITION + // ======================= + + var old = $.fn.alert + + $.fn.alert = function (option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.alert') + + if (!data) $this.data('bs.alert', (data = new Alert(this))) + if (typeof option == 'string') data[option].call($this) + }) + } + + $.fn.alert.Constructor = Alert + + + // ALERT NO CONFLICT + // ================= + + $.fn.alert.noConflict = function () { + $.fn.alert = old + return this + } + + + // ALERT DATA-API + // ============== + + $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) + +}(window.jQuery); + +/* ======================================================================== + * Bootstrap: button.js v3.0.0 + * http://twbs.github.com/bootstrap/javascript.html#buttons + * ======================================================================== + * Copyright 2013 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ======================================================================== */ + + ++function ($) { "use strict"; + + // BUTTON PUBLIC CLASS DEFINITION + // ============================== + + var Button = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, Button.DEFAULTS, options) + } + + Button.DEFAULTS = { + loadingText: 'loading...' + } + + Button.prototype.setState = function (state) { + var d = 'disabled' + var $el = this.$element + var val = $el.is('input') ? 'val' : 'html' + var data = $el.data() + + state = state + 'Text' + + if (!data.resetText) $el.data('resetText', $el[val]()) + + $el[val](data[state] || this.options[state]) + + // push to event loop to allow forms to submit + setTimeout(function () { + state == 'loadingText' ? + $el.addClass(d).attr(d, d) : + $el.removeClass(d).removeAttr(d); + }, 0) + } + + Button.prototype.toggle = function () { + var $parent = this.$element.closest('[data-toggle="buttons"]') + + if ($parent.length) { + var $input = this.$element.find('input') + .prop('checked', !this.$element.hasClass('active')) + .trigger('change') + if ($input.prop('type') === 'radio') $parent.find('.active').removeClass('active') + } + + this.$element.toggleClass('active') + } + + + // BUTTON PLUGIN DEFINITION + // ======================== + + var old = $.fn.button + + $.fn.button = function (option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.button') + var options = typeof option == 'object' && option + + if (!data) $this.data('bs.button', (data = new Button(this, options))) + + if (option == 'toggle') data.toggle() + else if (option) data.setState(option) + }) + } + + $.fn.button.Constructor = Button + + + // BUTTON NO CONFLICT + // ================== + + $.fn.button.noConflict = function () { + $.fn.button = old + return this + } + + + // BUTTON DATA-API + // =============== + + $(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) { + var $btn = $(e.target) + if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') + $btn.button('toggle') + e.preventDefault() + }) + +}(window.jQuery); + +/* ======================================================================== + * Bootstrap: carousel.js v3.0.0 + * http://twbs.github.com/bootstrap/javascript.html#carousel + * ======================================================================== + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ======================================================================== */ + + ++function ($) { "use strict"; + + // CAROUSEL CLASS DEFINITION + // ========================= + + var Carousel = function (element, options) { + this.$element = $(element) + this.$indicators = this.$element.find('.carousel-indicators') + this.options = options + this.paused = + this.sliding = + this.interval = + this.$active = + this.$items = null + + this.options.pause == 'hover' && this.$element + .on('mouseenter', $.proxy(this.pause, this)) + .on('mouseleave', $.proxy(this.cycle, this)) + } + + Carousel.DEFAULTS = { + interval: 5000 + , pause: 'hover' + , wrap: true + } + + Carousel.prototype.cycle = function (e) { + e || (this.paused = false) + + this.interval && clearInterval(this.interval) + + this.options.interval + && !this.paused + && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) + + return this + } + + Carousel.prototype.getActiveIndex = function () { + this.$active = this.$element.find('.item.active') + this.$items = this.$active.parent().children() + + return this.$items.index(this.$active) + } + + Carousel.prototype.to = function (pos) { + var that = this + var activeIndex = this.getActiveIndex() + + if (pos > (this.$items.length - 1) || pos < 0) return + + if (this.sliding) return this.$element.one('slid', function () { that.to(pos) }) + if (activeIndex == pos) return this.pause().cycle() + + return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos])) + } + + Carousel.prototype.pause = function (e) { + e || (this.paused = true) + + if (this.$element.find('.next, .prev').length && $.support.transition.end) { + this.$element.trigger($.support.transition.end) + this.cycle(true) + } + + this.interval = clearInterval(this.interval) + + return this + } + + Carousel.prototype.next = function () { + if (this.sliding) return + return this.slide('next') + } + + Carousel.prototype.prev = function () { + if (this.sliding) return + return this.slide('prev') + } + + Carousel.prototype.slide = function (type, next) { + var $active = this.$element.find('.item.active') + var $next = next || $active[type]() + var isCycling = this.interval + var direction = type == 'next' ? 'left' : 'right' + var fallback = type == 'next' ? 'first' : 'last' + var that = this + + if (!$next.length) { + if (!this.options.wrap) return + $next = this.$element.find('.item')[fallback]() + } + + this.sliding = true + + isCycling && this.pause() + + var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction }) + + if ($next.hasClass('active')) return + + if (this.$indicators.length) { + this.$indicators.find('.active').removeClass('active') + this.$element.one('slid', function () { + var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()]) + $nextIndicator && $nextIndicator.addClass('active') + }) + } + + if ($.support.transition && this.$element.hasClass('slide')) { + this.$element.trigger(e) + if (e.isDefaultPrevented()) return + $next.addClass(type) + $next[0].offsetWidth // force reflow + $active.addClass(direction) + $next.addClass(direction) + $active + .one($.support.transition.end, function () { + $next.removeClass([type, direction].join(' ')).addClass('active') + $active.removeClass(['active', direction].join(' ')) + that.sliding = false + setTimeout(function () { that.$element.trigger('slid') }, 0) + }) + .emulateTransitionEnd(600) + } else { + this.$element.trigger(e) + if (e.isDefaultPrevented()) return + $active.removeClass('active') + $next.addClass('active') + this.sliding = false + this.$element.trigger('slid') + } + + isCycling && this.cycle() + + return this + } + + + // CAROUSEL PLUGIN DEFINITION + // ========================== + + var old = $.fn.carousel + + $.fn.carousel = function (option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.carousel') + var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option) + var action = typeof option == 'string' ? option : options.slide + + if (!data) $this.data('bs.carousel', (data = new Carousel(this, options))) + if (typeof option == 'number') data.to(option) + else if (action) data[action]() + else if (options.interval) data.pause().cycle() + }) + } + + $.fn.carousel.Constructor = Carousel + + + // CAROUSEL NO CONFLICT + // ==================== + + $.fn.carousel.noConflict = function () { + $.fn.carousel = old + return this + } + + + // CAROUSEL DATA-API + // ================= + + $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) { + var $this = $(this), href + var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 + var options = $.extend({}, $target.data(), $this.data()) + var slideIndex = $this.attr('data-slide-to') + if (slideIndex) options.interval = false + + $target.carousel(options) + + if (slideIndex = $this.attr('data-slide-to')) { + $target.data('bs.carousel').to(slideIndex) + } + + e.preventDefault() + }) + + $(window).on('load', function () { + $('[data-ride="carousel"]').each(function () { + var $carousel = $(this) + $carousel.carousel($carousel.data()) + }) + }) + +}(window.jQuery); + +/* ======================================================================== + * Bootstrap: collapse.js v3.0.0 + * http://twbs.github.com/bootstrap/javascript.html#collapse + * ======================================================================== + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ======================================================================== */ + + ++function ($) { "use strict"; + + // COLLAPSE PUBLIC CLASS DEFINITION + // ================================ + + var Collapse = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, Collapse.DEFAULTS, options) + this.transitioning = null + + if (this.options.parent) this.$parent = $(this.options.parent) + if (this.options.toggle) this.toggle() + } + + Collapse.DEFAULTS = { + toggle: true + } + + Collapse.prototype.dimension = function () { + var hasWidth = this.$element.hasClass('width') + return hasWidth ? 'width' : 'height' + } + + Collapse.prototype.show = function () { + if (this.transitioning || this.$element.hasClass('in')) return + + var startEvent = $.Event('show.bs.collapse') + this.$element.trigger(startEvent) + if (startEvent.isDefaultPrevented()) return + + var actives = this.$parent && this.$parent.find('> .panel > .in') + + if (actives && actives.length) { + var hasData = actives.data('bs.collapse') + if (hasData && hasData.transitioning) return + actives.collapse('hide') + hasData || actives.data('bs.collapse', null) + } + + var dimension = this.dimension() + + this.$element + .removeClass('collapse') + .addClass('collapsing') + [dimension](0) + + this.transitioning = 1 + + var complete = function () { + this.$element + .removeClass('collapsing') + .addClass('in') + [dimension]('auto') + this.transitioning = 0 + this.$element.trigger('shown.bs.collapse') + } + + if (!$.support.transition) return complete.call(this) + + var scrollSize = $.camelCase(['scroll', dimension].join('-')) + + this.$element + .one($.support.transition.end, $.proxy(complete, this)) + .emulateTransitionEnd(350) + [dimension](this.$element[0][scrollSize]) + } + + Collapse.prototype.hide = function () { + if (this.transitioning || !this.$element.hasClass('in')) return + + var startEvent = $.Event('hide.bs.collapse') + this.$element.trigger(startEvent) + if (startEvent.isDefaultPrevented()) return + + var dimension = this.dimension() + + this.$element + [dimension](this.$element[dimension]()) + [0].offsetHeight + + this.$element + .addClass('collapsing') + .removeClass('collapse') + .removeClass('in') + + this.transitioning = 1 + + var complete = function () { + this.transitioning = 0 + this.$element + .trigger('hidden.bs.collapse') + .removeClass('collapsing') + .addClass('collapse') + } + + if (!$.support.transition) return complete.call(this) + + this.$element + [dimension](0) + .one($.support.transition.end, $.proxy(complete, this)) + .emulateTransitionEnd(350) + } + + Collapse.prototype.toggle = function () { + this[this.$element.hasClass('in') ? 'hide' : 'show']() + } + + + // COLLAPSE PLUGIN DEFINITION + // ========================== + + var old = $.fn.collapse + + $.fn.collapse = function (option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.collapse') + var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) + + if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) + if (typeof option == 'string') data[option]() + }) + } + + $.fn.collapse.Constructor = Collapse + + + // COLLAPSE NO CONFLICT + // ==================== + + $.fn.collapse.noConflict = function () { + $.fn.collapse = old + return this + } + + + // COLLAPSE DATA-API + // ================= + + $(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) { + var $this = $(this), href + var target = $this.attr('data-target') + || e.preventDefault() + || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 + var $target = $(target) + var data = $target.data('bs.collapse') + var option = data ? 'toggle' : $this.data() + var parent = $this.attr('data-parent') + var $parent = parent && $(parent) + + if (!data || !data.transitioning) { + if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed') + $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed') + } + + $target.collapse(option) + }) + +}(window.jQuery); + +/* ======================================================================== + * Bootstrap: dropdown.js v3.0.0 + * http://twbs.github.com/bootstrap/javascript.html#dropdowns + * ======================================================================== + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ======================================================================== */ + + ++function ($) { "use strict"; + + // DROPDOWN CLASS DEFINITION + // ========================= + + var backdrop = '.dropdown-backdrop' + var toggle = '[data-toggle=dropdown]' + var Dropdown = function (element) { + var $el = $(element).on('click.bs.dropdown', this.toggle) + } + + Dropdown.prototype.toggle = function (e) { + var $this = $(this) + + if ($this.is('.disabled, :disabled')) return + + var $parent = getParent($this) + var isActive = $parent.hasClass('open') + + clearMenus() + + if (!isActive) { + if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { + // if mobile we we use a backdrop because click events don't delegate + $('