commit e154bb0cb7ba3aff077957a0d8ba2eb49f05aac7 Author: 邱博亞 Date: Mon Apr 19 09:56:04 2021 +0800 first commit diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..9b8b3b8 Binary files /dev/null and b/.DS_Store differ diff --git a/assets/.DS_Store b/assets/.DS_Store new file mode 100644 index 0000000..32cd6bd Binary files /dev/null and b/assets/.DS_Store differ diff --git a/assets/fonts/bootstrap/glyphicons-halflings-regular.eot b/assets/fonts/bootstrap/glyphicons-halflings-regular.eot new file mode 100644 index 0000000..4a4ca86 Binary files /dev/null and b/assets/fonts/bootstrap/glyphicons-halflings-regular.eot differ diff --git a/assets/fonts/bootstrap/glyphicons-halflings-regular.svg b/assets/fonts/bootstrap/glyphicons-halflings-regular.svg new file mode 100644 index 0000000..e3e2dc7 --- /dev/null +++ b/assets/fonts/bootstrap/glyphicons-halflings-regular.svg @@ -0,0 +1,229 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf b/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf new file mode 100644 index 0000000..67fa00b Binary files /dev/null and b/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf differ diff --git a/assets/fonts/bootstrap/glyphicons-halflings-regular.woff b/assets/fonts/bootstrap/glyphicons-halflings-regular.woff new file mode 100644 index 0000000..8c54182 Binary files /dev/null and b/assets/fonts/bootstrap/glyphicons-halflings-regular.woff differ diff --git a/assets/images/01.wma b/assets/images/01.wma new file mode 100644 index 0000000..b706073 Binary files /dev/null and b/assets/images/01.wma differ diff --git a/assets/images/LOGO-3.png b/assets/images/LOGO-3.png new file mode 100644 index 0000000..33520ab Binary files /dev/null and b/assets/images/LOGO-3.png differ diff --git a/assets/images/Thumbs.db b/assets/images/Thumbs.db new file mode 100644 index 0000000..b15ebf2 Binary files /dev/null and b/assets/images/Thumbs.db differ diff --git a/assets/images/album_bg.gif b/assets/images/album_bg.gif new file mode 100644 index 0000000..91f66b1 Binary files /dev/null and b/assets/images/album_bg.gif differ diff --git a/assets/images/album_bg_sm.gif b/assets/images/album_bg_sm.gif new file mode 100644 index 0000000..8ddd2c1 Binary files /dev/null and b/assets/images/album_bg_sm.gif differ diff --git a/assets/images/album_list_bg.jpg b/assets/images/album_list_bg.jpg new file mode 100644 index 0000000..f71fb8f Binary files /dev/null and b/assets/images/album_list_bg.jpg differ diff --git a/assets/images/announcement-default.jpg b/assets/images/announcement-default.jpg new file mode 100644 index 0000000..b6b82f0 Binary files /dev/null and b/assets/images/announcement-default.jpg differ diff --git a/assets/images/ar1.png b/assets/images/ar1.png new file mode 100644 index 0000000..bab3329 Binary files /dev/null and b/assets/images/ar1.png differ diff --git a/assets/images/ar2.png b/assets/images/ar2.png new file mode 100644 index 0000000..7f729f7 Binary files /dev/null and b/assets/images/ar2.png differ diff --git a/assets/images/bg.png b/assets/images/bg.png new file mode 100644 index 0000000..6610ebf Binary files /dev/null and b/assets/images/bg.png differ diff --git a/assets/images/bg_caption.gif b/assets/images/bg_caption.gif new file mode 100644 index 0000000..8a3d8fe Binary files /dev/null and b/assets/images/bg_caption.gif differ diff --git a/assets/images/bottom.jpg b/assets/images/bottom.jpg new file mode 100644 index 0000000..0f51778 Binary files /dev/null and b/assets/images/bottom.jpg differ diff --git a/assets/images/boxa_b.jpg b/assets/images/boxa_b.jpg new file mode 100644 index 0000000..6bef55b Binary files /dev/null and b/assets/images/boxa_b.jpg differ diff --git a/assets/images/boxa_y.jpg b/assets/images/boxa_y.jpg new file mode 100644 index 0000000..88fc028 Binary files /dev/null and b/assets/images/boxa_y.jpg differ diff --git a/assets/images/buttfy.jpg b/assets/images/buttfy.jpg new file mode 100644 index 0000000..687d3cf Binary files /dev/null and b/assets/images/buttfy.jpg differ diff --git a/assets/images/buttom.jpg b/assets/images/buttom.jpg new file mode 100644 index 0000000..428425d Binary files /dev/null and b/assets/images/buttom.jpg differ diff --git a/assets/images/caption.gif b/assets/images/caption.gif new file mode 100644 index 0000000..d479c91 Binary files /dev/null and b/assets/images/caption.gif differ diff --git a/assets/images/center.jpg b/assets/images/center.jpg new file mode 100644 index 0000000..98c3fde Binary files /dev/null and b/assets/images/center.jpg differ diff --git a/assets/images/design_thumb.png b/assets/images/design_thumb.png new file mode 100644 index 0000000..16a1b3b Binary files /dev/null and b/assets/images/design_thumb.png differ diff --git a/assets/images/dt.gif b/assets/images/dt.gif new file mode 100644 index 0000000..87d7cf9 Binary files /dev/null and b/assets/images/dt.gif differ diff --git a/assets/images/dt_bg.gif b/assets/images/dt_bg.gif new file mode 100644 index 0000000..a787f92 Binary files /dev/null and b/assets/images/dt_bg.gif differ diff --git a/assets/images/eventbottom_bg.png b/assets/images/eventbottom_bg.png new file mode 100644 index 0000000..1a50d35 Binary files /dev/null and b/assets/images/eventbottom_bg.png differ diff --git a/assets/images/eventtop_bg.png b/assets/images/eventtop_bg.png new file mode 100644 index 0000000..16db50d Binary files /dev/null and b/assets/images/eventtop_bg.png differ diff --git a/assets/images/fh.gif b/assets/images/fh.gif new file mode 100644 index 0000000..6eb9c94 Binary files /dev/null and b/assets/images/fh.gif differ diff --git a/assets/images/fh.png b/assets/images/fh.png new file mode 100644 index 0000000..5d33e33 Binary files /dev/null and b/assets/images/fh.png differ diff --git a/assets/images/fh2.gif b/assets/images/fh2.gif new file mode 100644 index 0000000..4cb912a Binary files /dev/null and b/assets/images/fh2.gif differ diff --git a/assets/images/fhi.gif b/assets/images/fhi.gif new file mode 100644 index 0000000..940436d Binary files /dev/null and b/assets/images/fhi.gif differ diff --git a/assets/images/fhi.png b/assets/images/fhi.png new file mode 100644 index 0000000..5d33e33 Binary files /dev/null and b/assets/images/fhi.png differ diff --git a/assets/images/folder.gif b/assets/images/folder.gif new file mode 100644 index 0000000..f5f5dd1 Binary files /dev/null and b/assets/images/folder.gif differ diff --git a/assets/images/footer.png b/assets/images/footer.png new file mode 100644 index 0000000..8b07cae Binary files /dev/null and b/assets/images/footer.png differ diff --git a/assets/images/google_bg.gif b/assets/images/google_bg.gif new file mode 100644 index 0000000..8b89879 Binary files /dev/null and b/assets/images/google_bg.gif differ diff --git a/assets/images/google_bg.jpg b/assets/images/google_bg.jpg new file mode 100644 index 0000000..6a9e664 Binary files /dev/null and b/assets/images/google_bg.jpg differ diff --git a/assets/images/h2.gif b/assets/images/h2.gif new file mode 100644 index 0000000..f515e83 Binary files /dev/null and b/assets/images/h2.gif differ diff --git a/assets/images/h3.gif b/assets/images/h3.gif new file mode 100644 index 0000000..118c115 Binary files /dev/null and b/assets/images/h3.gif differ diff --git a/assets/images/headerbg.png b/assets/images/headerbg.png new file mode 100644 index 0000000..0a0a956 Binary files /dev/null and b/assets/images/headerbg.png differ diff --git a/assets/images/headerinner_bg.png b/assets/images/headerinner_bg.png new file mode 100644 index 0000000..57cf223 Binary files /dev/null and b/assets/images/headerinner_bg.png differ diff --git a/assets/images/hide.gif b/assets/images/hide.gif new file mode 100644 index 0000000..845433e Binary files /dev/null and b/assets/images/hide.gif differ diff --git a/assets/images/hide_folder.gif b/assets/images/hide_folder.gif new file mode 100644 index 0000000..9db12f3 Binary files /dev/null and b/assets/images/hide_folder.gif differ diff --git a/assets/images/hide_post.gif b/assets/images/hide_post.gif new file mode 100644 index 0000000..f9cb4c1 Binary files /dev/null and b/assets/images/hide_post.gif differ diff --git a/assets/images/hide_topic.gif b/assets/images/hide_topic.gif new file mode 100644 index 0000000..9de2545 Binary files /dev/null and b/assets/images/hide_topic.gif differ diff --git a/assets/images/icon-g.jpg b/assets/images/icon-g.jpg new file mode 100644 index 0000000..e2cdcaf Binary files /dev/null and b/assets/images/icon-g.jpg differ diff --git a/assets/images/icon-r.jpg b/assets/images/icon-r.jpg new file mode 100644 index 0000000..332d9d9 Binary files /dev/null and b/assets/images/icon-r.jpg differ diff --git a/assets/images/keyword.gif b/assets/images/keyword.gif new file mode 100644 index 0000000..7bf6cd9 Binary files /dev/null and b/assets/images/keyword.gif differ diff --git a/assets/images/level.gif b/assets/images/level.gif new file mode 100644 index 0000000..7cee1b9 Binary files /dev/null and b/assets/images/level.gif differ diff --git a/assets/images/li.gif b/assets/images/li.gif new file mode 100644 index 0000000..f0e8182 Binary files /dev/null and b/assets/images/li.gif differ diff --git a/assets/images/lili.gif b/assets/images/lili.gif new file mode 100644 index 0000000..701fe25 Binary files /dev/null and b/assets/images/lili.gif differ diff --git a/assets/images/linklist_bottom.jpg b/assets/images/linklist_bottom.jpg new file mode 100644 index 0000000..02e89b9 Binary files /dev/null and b/assets/images/linklist_bottom.jpg differ diff --git a/assets/images/linklist_center.jpg b/assets/images/linklist_center.jpg new file mode 100644 index 0000000..2fb39ee Binary files /dev/null and b/assets/images/linklist_center.jpg differ diff --git a/assets/images/linklist_li.jpg b/assets/images/linklist_li.jpg new file mode 100644 index 0000000..5d33e33 Binary files /dev/null and b/assets/images/linklist_li.jpg differ diff --git a/assets/images/linklist_top.jpg b/assets/images/linklist_top.jpg new file mode 100644 index 0000000..c303aea Binary files /dev/null and b/assets/images/linklist_top.jpg differ diff --git a/assets/images/login_button.jpg b/assets/images/login_button.jpg new file mode 100644 index 0000000..de0045d Binary files /dev/null and b/assets/images/login_button.jpg differ diff --git a/assets/images/login_form_bg.jpg b/assets/images/login_form_bg.jpg new file mode 100644 index 0000000..8cd02c7 Binary files /dev/null and b/assets/images/login_form_bg.jpg differ diff --git a/assets/images/logo-W.png b/assets/images/logo-W.png new file mode 100644 index 0000000..dd1933c Binary files /dev/null and b/assets/images/logo-W.png differ diff --git a/assets/images/logo.jpg b/assets/images/logo.jpg new file mode 100644 index 0000000..cd8d9d7 Binary files /dev/null and b/assets/images/logo.jpg differ diff --git a/assets/images/logo.png b/assets/images/logo.png new file mode 100644 index 0000000..7d254db Binary files /dev/null and b/assets/images/logo.png differ diff --git a/assets/images/logo2.png b/assets/images/logo2.png new file mode 100644 index 0000000..82a8ae1 Binary files /dev/null and b/assets/images/logo2.png differ diff --git a/assets/images/logobg.jpg b/assets/images/logobg.jpg new file mode 100644 index 0000000..dfbb47b Binary files /dev/null and b/assets/images/logobg.jpg differ diff --git a/assets/images/m_bottom.jpg b/assets/images/m_bottom.jpg new file mode 100644 index 0000000..a80962e Binary files /dev/null and b/assets/images/m_bottom.jpg differ diff --git a/assets/images/m_center.jpg b/assets/images/m_center.jpg new file mode 100644 index 0000000..1ad2066 Binary files /dev/null and b/assets/images/m_center.jpg differ diff --git a/assets/images/m_top.jpg b/assets/images/m_top.jpg new file mode 100644 index 0000000..4bf4097 Binary files /dev/null and b/assets/images/m_top.jpg differ diff --git a/assets/images/mainbg.jpg b/assets/images/mainbg.jpg new file mode 100644 index 0000000..9ad6d8f Binary files /dev/null and b/assets/images/mainbg.jpg differ diff --git a/assets/images/mark.gif b/assets/images/mark.gif new file mode 100644 index 0000000..faa1f49 Binary files /dev/null and b/assets/images/mark.gif differ diff --git a/assets/images/menubottom_bg.png b/assets/images/menubottom_bg.png new file mode 100644 index 0000000..b878354 Binary files /dev/null and b/assets/images/menubottom_bg.png differ diff --git a/assets/images/menutop_bg.png b/assets/images/menutop_bg.png new file mode 100644 index 0000000..e8f7c5f Binary files /dev/null and b/assets/images/menutop_bg.png differ diff --git a/assets/images/morebtn.png b/assets/images/morebtn.png new file mode 100644 index 0000000..1be9ea4 Binary files /dev/null and b/assets/images/morebtn.png differ diff --git a/assets/images/morebtn2.png b/assets/images/morebtn2.png new file mode 100644 index 0000000..9c9fbaa Binary files /dev/null and b/assets/images/morebtn2.png differ diff --git a/assets/images/newarticle_bg.jpg b/assets/images/newarticle_bg.jpg new file mode 100644 index 0000000..e318f36 Binary files /dev/null and b/assets/images/newarticle_bg.jpg differ diff --git a/assets/images/overdue.jpg b/assets/images/overdue.jpg new file mode 100644 index 0000000..e9ba7e0 Binary files /dev/null and b/assets/images/overdue.jpg differ diff --git a/assets/images/personal_album_bg.jpg b/assets/images/personal_album_bg.jpg new file mode 100644 index 0000000..d34374b Binary files /dev/null and b/assets/images/personal_album_bg.jpg differ diff --git a/assets/images/question.jpg b/assets/images/question.jpg new file mode 100644 index 0000000..f32ead2 Binary files /dev/null and b/assets/images/question.jpg differ diff --git a/assets/images/randarticle_b.jpg b/assets/images/randarticle_b.jpg new file mode 100644 index 0000000..a546371 Binary files /dev/null and b/assets/images/randarticle_b.jpg differ diff --git a/assets/images/randarticle_t.gif b/assets/images/randarticle_t.gif new file mode 100644 index 0000000..b3967d4 Binary files /dev/null and b/assets/images/randarticle_t.gif differ diff --git a/assets/images/randarticle_t.jpg b/assets/images/randarticle_t.jpg new file mode 100644 index 0000000..225c376 Binary files /dev/null and b/assets/images/randarticle_t.jpg differ diff --git a/assets/images/randarticle_t2.gif b/assets/images/randarticle_t2.gif new file mode 100644 index 0000000..945648e Binary files /dev/null and b/assets/images/randarticle_t2.gif differ diff --git a/assets/images/randarticle_t2.jpg b/assets/images/randarticle_t2.jpg new file mode 100644 index 0000000..e735fe6 Binary files /dev/null and b/assets/images/randarticle_t2.jpg differ diff --git a/assets/images/randblog2_bg.jpg b/assets/images/randblog2_bg.jpg new file mode 100644 index 0000000..6bcb9a8 Binary files /dev/null and b/assets/images/randblog2_bg.jpg differ diff --git a/assets/images/randblog_bg.jpg b/assets/images/randblog_bg.jpg new file mode 100644 index 0000000..f88343b Binary files /dev/null and b/assets/images/randblog_bg.jpg differ diff --git a/assets/images/rlogo.png b/assets/images/rlogo.png new file mode 100644 index 0000000..bfcd96e Binary files /dev/null and b/assets/images/rlogo.png differ diff --git a/assets/images/ruling_logo.jpg b/assets/images/ruling_logo.jpg new file mode 100644 index 0000000..6f51cad Binary files /dev/null and b/assets/images/ruling_logo.jpg differ diff --git a/assets/images/search.gif b/assets/images/search.gif new file mode 100644 index 0000000..23573c1 Binary files /dev/null and b/assets/images/search.gif differ diff --git a/assets/images/searchbg.png b/assets/images/searchbg.png new file mode 100644 index 0000000..3c84a65 Binary files /dev/null and b/assets/images/searchbg.png differ diff --git a/assets/images/site-logo.png b/assets/images/site-logo.png new file mode 100644 index 0000000..695bdf4 Binary files /dev/null and b/assets/images/site-logo.png differ diff --git a/assets/images/submenu_b.gif b/assets/images/submenu_b.gif new file mode 100644 index 0000000..54b3943 Binary files /dev/null and b/assets/images/submenu_b.gif differ diff --git a/assets/images/submenu_b2.gif b/assets/images/submenu_b2.gif new file mode 100644 index 0000000..54b3943 Binary files /dev/null and b/assets/images/submenu_b2.gif differ diff --git a/assets/images/submenu_bg.jpg b/assets/images/submenu_bg.jpg new file mode 100644 index 0000000..1896c36 Binary files /dev/null and b/assets/images/submenu_bg.jpg differ diff --git a/assets/images/submenu_bg2.jpg b/assets/images/submenu_bg2.jpg new file mode 100644 index 0000000..e520ee7 Binary files /dev/null and b/assets/images/submenu_bg2.jpg differ diff --git a/assets/images/submenu_li.gif b/assets/images/submenu_li.gif new file mode 100644 index 0000000..7b938d7 Binary files /dev/null and b/assets/images/submenu_li.gif differ diff --git a/assets/images/super_list_li.gif b/assets/images/super_list_li.gif new file mode 100644 index 0000000..8d7b32c Binary files /dev/null and b/assets/images/super_list_li.gif differ diff --git a/assets/images/tag_a.gif b/assets/images/tag_a.gif new file mode 100644 index 0000000..68e36e0 Binary files /dev/null and b/assets/images/tag_a.gif differ diff --git a/assets/images/tag_bg.jpg b/assets/images/tag_bg.jpg new file mode 100644 index 0000000..1ee43cb Binary files /dev/null and b/assets/images/tag_bg.jpg differ diff --git a/assets/images/teacher_list_info.gif b/assets/images/teacher_list_info.gif new file mode 100644 index 0000000..91a2646 Binary files /dev/null and b/assets/images/teacher_list_info.gif differ diff --git a/assets/images/teacher_list_info.jpg b/assets/images/teacher_list_info.jpg new file mode 100644 index 0000000..750144c Binary files /dev/null and b/assets/images/teacher_list_info.jpg differ diff --git a/assets/images/th_bg.gif b/assets/images/th_bg.gif new file mode 100644 index 0000000..b95ad1e Binary files /dev/null and b/assets/images/th_bg.gif differ diff --git a/assets/images/thumb_bg.gif b/assets/images/thumb_bg.gif new file mode 100644 index 0000000..347b7d9 Binary files /dev/null and b/assets/images/thumb_bg.gif differ diff --git a/assets/images/titlebg1.png b/assets/images/titlebg1.png new file mode 100644 index 0000000..87b6e4a Binary files /dev/null and b/assets/images/titlebg1.png differ diff --git a/assets/images/titlebg2.png b/assets/images/titlebg2.png new file mode 100644 index 0000000..dc7309e Binary files /dev/null and b/assets/images/titlebg2.png differ diff --git a/assets/images/titlebg3.png b/assets/images/titlebg3.png new file mode 100644 index 0000000..2b26f08 Binary files /dev/null and b/assets/images/titlebg3.png differ diff --git a/assets/images/top.jpg b/assets/images/top.jpg new file mode 100644 index 0000000..579bcab Binary files /dev/null and b/assets/images/top.jpg differ diff --git a/assets/images/topnav_bg.png b/assets/images/topnav_bg.png new file mode 100644 index 0000000..0f98acf Binary files /dev/null and b/assets/images/topnav_bg.png differ diff --git a/assets/images/vstyle_bg.gif b/assets/images/vstyle_bg.gif new file mode 100644 index 0000000..f53794c Binary files /dev/null and b/assets/images/vstyle_bg.gif differ diff --git a/assets/images/warning.gif b/assets/images/warning.gif new file mode 100644 index 0000000..873bbb5 Binary files /dev/null and b/assets/images/warning.gif differ diff --git a/assets/images/webreg-1.gif b/assets/images/webreg-1.gif new file mode 100644 index 0000000..cf6c5f5 Binary files /dev/null and b/assets/images/webreg-1.gif differ diff --git a/assets/images/webreg-2.gif b/assets/images/webreg-2.gif new file mode 100644 index 0000000..f1bb0e9 Binary files /dev/null and b/assets/images/webreg-2.gif differ diff --git a/assets/images/webreg-3.gif b/assets/images/webreg-3.gif new file mode 100644 index 0000000..e6cdd65 Binary files /dev/null and b/assets/images/webreg-3.gif differ diff --git a/assets/javascripts/app.js b/assets/javascripts/app.js new file mode 100644 index 0000000..15c244c --- /dev/null +++ b/assets/javascripts/app.js @@ -0,0 +1,323 @@ +(function($, win, undefined) { + + 'use strict'; + + function init() { + var doc = document; + var lang = doc.documentElement.lang; + var pageModule = doc.body.getAttribute('data-module'); + var resizeTimer = -1; + + var orbit = { + + helpers: { + // Cross-browser class manipulation + addClass: function(el, className) { + if (el.classList) { + el.classList.add(className); + } else { + el.className += ' ' + className; + } + }, + hasClass: function(el, cls) { + return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1; + }, + removeEmpty: function(els, parent) { + var $els = $(els); + $.each($els, function(i, val) { + if ($els.eq(i).text().trim() === '') { + // check if there's parent el + if (typeof parent === 'string') { + $els + .closest($(parent)) + .addClass('hide'); + } else { + $els.eq(i).addClass('hide'); + } + } + }); + } + }, + + plugins: { + // RWD image resize script + bullEye: function() { + $('.bullseye').bullseye({ + fadeEffect: false + }); + } + }, + + nav: { + // Add class name to the menu item when its child items are more than 8 items + addMegaDropdownClass: function(els, len, className) { + var els = doc.querySelectorAll(els), + elsLen = els.length, + i = -1; + + if (elsLen > 1) { + for (i = 0; i < elsLen; i++) { + if (els[i].children.length > len) { + this.helpers.addClass(els[i].parentNode, className || 'mega-dropdown'); + } + } + } + }, + // set up mobile dropdown + setDropdown: function() { + var $caret1 = $(''); + var $caret2 = $(''); + var $li = null; + var $this = null; + var cls = 'active'; + + // add class and caret on element that has dropdown + $('.nav-level-1') + .parent('li') + .addClass('has-dropdown level-1'); + + // check if the DOM exists + if ($('.has-dropdown.level-1 > .dropdown-toggle-icon').length < 1) { + $caret1.appendTo('.has-dropdown.level-1'); + + $('.nav-level-2') + .parent('li') + .addClass('has-dropdown level-2'); + $caret2.appendTo('.has-dropdown.level-2'); + } + + // same click event for first and second level dropdown + $('.dropdown-toggle-icon.level-1, .dropdown-toggle-icon.level-2').on('click', function() { + $this = $(this); + $li = $this.parent('li'); + + // toggle els class + if ($li.hasClass(cls)) { + $li.removeClass(cls); + } else { + $li.siblings('li').removeClass(cls) + $li.addClass(cls); + } + }); + }, + // remove mobile dropdown + removeDropdown: function() { + $('.dropdown-toggle-icon').remove(); + } + }, + // Modules + announcement: { + // Announcement text truncation + truncateAnnouncement: function(els, maxLen) { + var els = doc.querySelectorAll(els), + newTitle = ''; + i = -1, + elsLen = els.length; + + for (i = 0; i < elsLen; i++) { + if (els[i].firstChild !== null) { + if (els[i].firstChild.length > maxLen) { + newTitle = els[i].firstChild.textContent; + els[i].textContent = newTitle.substring(0, maxLen) + '...'; + } + } + } + }, + + // Print page + printPage: function(el) { + var $el = $(el); + + $el.on('click', function(e) { + e.preventDefault(); + window.print(); + }); + + if (lang === 'en') { + $el + .find('.print-txt') + .text('Print this page'); + } + } + }, + + member: { + equalHeight: function() { + var bigbrother = -1; + $('.i-member-item').each(function() { + bigbrother = bigbrother > $('.i-member-item').height() ? bigbrother : $('.i-member-item').height(); + }); + + $('.i-member-item').each(function() { + $('.i-member-item').height(bigbrother); + }); + }, + + // Remove table row, list item if it only has sigle title or value not in pair + removeEmptyRow: function() { + // Remove index page empty item + $('.i-member-profile-item .i-member-value').each(function() { + if ($(this).text().trim() === '' || $(this).text().trim() === ':') { + $(this).parent().addClass('hide'); + } + }); + + // Remove empty table cell on show page + $('.show-member .member-data th, .show-member .member-data td').each(function() { + if ($(this).text().trim() === '') { + $(this).parent('tr').addClass('hide'); + } + }); + }, + }, + archives: { + removeEmptyTitle: function(el) { + var $el = $(el); + var $els = $el.children(); + + $.each($els, function(i, val) { + if ($els.eq(i).text().trim() === '') { + $els.eq(i).addClass('hide'); + } + }); + + $.each($el, function(i, val) { + if ($el.eq(i).children('.hide').length >= 2) { + $el.eq(i).addClass('hide'); + } + }); + } + }, + + // Add link and cursor class name on element that has data-link attribute + addLinkOnADBanner: function(els) { + $.each(els, function() { + if ($(this).data('link') !== '' && !$(this).hasClass('youtube')) { + $(this).on('click', function() { + var target = $(this).data('target'), + link = $(this).data('link'); + if (target === '_blank') { + window.open(link, target); + } else { + window.location.href = link; + } + }).addClass('cursor'); + } + }); + }, + + // Sitemenu dropdown + sitemenuDropdown: function(els) { + var els = doc.querySelectorAll('.sitemenu-list.level-2'), + len = els.length, + i = -1; + for (i = 0; i < len; i++) { + if (els[i].children.length) { + var caret = doc.createElement('span'); + caret.className = 'sitemenu-dropdown-toggle fa fa-caret-down'; + caret.setAttribute('data-toggle', 'dropdown'); + + els[i].parentNode.insertBefore(caret, els[i]); + this.helpers.addClass(els[i], 'dropdown-menu'); + } + } + }, + + // Go back top button + goBackTop: function(txt, speed) { + var top = document.createElement('div'); + top.className = 'go-back-top no-print'; + top.textContent = txt; + doc.body.appendChild(top); + + $(window).scroll(function() { + if ($(this).scrollTop() != 0) { + $('.go-back-top').fadeIn(); + } else { + $('.go-back-top').fadeOut(); + } + }); + + $('.go-back-top').click(function() { + $('body, html').animate({ + scrollTop: 0 + }, speed); + return false; + }); + } + }; + + // add to window object + win.ORBITFRONT = orbit; + + // Specific functions that will be running on homepage + switch (pageModule) { + case 'home': + break; + case 'announcement': + orbit.announcement.printPage('.print-button'); + break; + case 'member': + orbit.member.removeEmptyRow(); + break; + case 'archive': + orbit.archives.removeEmptyTitle('.i-archive__category-item'); + default: + break; + } + // Functions that will be running on every page + orbit.sitemenuDropdown(); + orbit.goBackTop('top', 800); + orbit.plugins.bullEye(); + + if ($(window).width() < 768) { + orbit.nav.setDropdown(); + } + + // Responsive specific + $(window).resize(function() { + if ($(window).width() < 768) { + clearTimeout(resizeTimer); + resizeTimer = setTimeout(orbit.nav.setDropdown, 500); + } else { + resizeTimer = setTimeout(orbit.nav.removeDropdown, 500) + } + }); + } + + // Run the init function when DOM is ready + $(document).ready(function() { + var leftC = $('.layout-content-box.left-column'); + var rightC = $('.layout-content-box.right-column'); + if( $('.layout-content-box.left-column').children().is(':empty') ) { + leftC.removeClass('col-sm-3'); + rightC.removeClass('col-sm-9'); + rightC.addClass('col-sm-12'); + } + $('.i-member-value').each(function(){ $(this).find('br').remove(); }) + $('.member-data-value-positions').each(function(){ $(this).find('br').remove(); }) + $('.member-data-value-expertise').each(function(){ $(this).find('br').remove(); }) + init(); + $('.navbar-toggle').click(function(){ + $('.navbar-expand-lg').toggleClass('width-controler') + }) + }); + +}(jQuery, window)); +$(document).ready(function(){ + if(window.location.search.indexOf('editmode=on') == -1){ + $(".nav-tabs").each(function(i,v){ + $(v).nextAll("*").not("script").addClass("tab-pane fade"); + $(v).nextAll("*").not("script").eq(0).addClass("active in"); + var tab_content = $("
") + $(v).nextAll("*").not("script").appendTo(tab_content); + $(v).after(tab_content); + $(v).find("li").off('click').click(function(){ + $(this).parent().nextAll(".tab-content").eq(0).find(".tab-pane").removeClass("active in"); + $(this).parent().nextAll(".tab-content").eq(0).find(".tab-pane").eq($(this).index()).addClass("active in"); + $(this).addClass('active'); + $(this).siblings('li').removeClass('active'); + }) + }) + } + }) \ No newline at end of file diff --git a/assets/javascripts/bootstrap.js b/assets/javascripts/bootstrap.js new file mode 100644 index 0000000..592bb0f --- /dev/null +++ b/assets/javascripts/bootstrap.js @@ -0,0 +1,12 @@ +//= require bootstrap/affix +//= require bootstrap/alert +//= require bootstrap/button +//= require bootstrap/carousel +//= require bootstrap/collapse +//= require bootstrap/dropdown +//= require bootstrap/tab +//= require bootstrap/transition +//= require bootstrap/scrollspy +//= require bootstrap/modal +//= require bootstrap/tooltip +//= require bootstrap/popover diff --git a/assets/javascripts/bootstrap/affix.js b/assets/javascripts/bootstrap/affix.js new file mode 100644 index 0000000..05c909e --- /dev/null +++ b/assets/javascripts/bootstrap/affix.js @@ -0,0 +1,137 @@ +/* ======================================================================== + * Bootstrap: affix.js v3.1.1 + * http://getbootstrap.com/javascript/#affix + * ======================================================================== + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // AFFIX CLASS DEFINITION + // ====================== + + var Affix = function (element, options) { + this.options = $.extend({}, Affix.DEFAULTS, options) + this.$window = $(window) + .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this)) + .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this)) + + this.$element = $(element) + this.affixed = + this.unpin = + this.pinnedOffset = null + + this.checkPosition() + } + + Affix.RESET = 'affix affix-top affix-bottom' + + Affix.DEFAULTS = { + offset: 0 + } + + Affix.prototype.getPinnedOffset = function () { + if (this.pinnedOffset) return this.pinnedOffset + this.$element.removeClass(Affix.RESET).addClass('affix') + var scrollTop = this.$window.scrollTop() + var position = this.$element.offset() + return (this.pinnedOffset = position.top - scrollTop) + } + + Affix.prototype.checkPositionWithEventLoop = function () { + setTimeout($.proxy(this.checkPosition, this), 1) + } + + Affix.prototype.checkPosition = function () { + if (!this.$element.is(':visible')) return + + var scrollHeight = $(document).height() + var scrollTop = this.$window.scrollTop() + var position = this.$element.offset() + var offset = this.options.offset + var offsetTop = offset.top + var offsetBottom = offset.bottom + + if (this.affixed == 'top') position.top += scrollTop + + if (typeof offset != 'object') offsetBottom = offsetTop = offset + if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element) + if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element) + + var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false : + offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' : + offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false + + if (this.affixed === affix) return + if (this.unpin) this.$element.css('top', '') + + var affixType = 'affix' + (affix ? '-' + affix : '') + var e = $.Event(affixType + '.bs.affix') + + this.$element.trigger(e) + + if (e.isDefaultPrevented()) return + + this.affixed = affix + this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null + + this.$element + .removeClass(Affix.RESET) + .addClass(affixType) + .trigger($.Event(affixType.replace('affix', 'affixed'))) + + if (affix == 'bottom') { + this.$element.offset({ top: scrollHeight - offsetBottom - this.$element.height() }) + } + } + + + // AFFIX PLUGIN DEFINITION + // ======================= + + var old = $.fn.affix + + $.fn.affix = function (option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.affix') + var options = typeof option == 'object' && option + + if (!data) $this.data('bs.affix', (data = new Affix(this, options))) + if (typeof option == 'string') data[option]() + }) + } + + $.fn.affix.Constructor = Affix + + + // AFFIX NO CONFLICT + // ================= + + $.fn.affix.noConflict = function () { + $.fn.affix = old + return this + } + + + // AFFIX DATA-API + // ============== + + $(window).on('load', function () { + $('[data-spy="affix"]').each(function () { + var $spy = $(this) + var data = $spy.data() + + data.offset = data.offset || {} + + if (data.offsetBottom) data.offset.bottom = data.offsetBottom + if (data.offsetTop) data.offset.top = data.offsetTop + + $spy.affix(data) + }) + }) + +}(jQuery); diff --git a/assets/javascripts/bootstrap/alert.js b/assets/javascripts/bootstrap/alert.js new file mode 100644 index 0000000..516fe4f --- /dev/null +++ b/assets/javascripts/bootstrap/alert.js @@ -0,0 +1,88 @@ +/* ======================================================================== + * Bootstrap: alert.js v3.1.1 + * http://getbootstrap.com/javascript/#alerts + * ======================================================================== + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/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) + +}(jQuery); diff --git a/assets/javascripts/bootstrap/button.js b/assets/javascripts/bootstrap/button.js new file mode 100644 index 0000000..f4d8d8b --- /dev/null +++ b/assets/javascripts/bootstrap/button.js @@ -0,0 +1,107 @@ +/* ======================================================================== + * Bootstrap: button.js v3.1.1 + * http://getbootstrap.com/javascript/#buttons + * ======================================================================== + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // BUTTON PUBLIC CLASS DEFINITION + // ============================== + + var Button = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, Button.DEFAULTS, options) + this.isLoading = false + } + + 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($.proxy(function () { + if (state == 'loadingText') { + this.isLoading = true + $el.addClass(d).attr(d, d) + } else if (this.isLoading) { + this.isLoading = false + $el.removeClass(d).removeAttr(d) + } + }, this), 0) + } + + Button.prototype.toggle = function () { + var changed = true + var $parent = this.$element.closest('[data-toggle="buttons"]') + + if ($parent.length) { + var $input = this.$element.find('input') + if ($input.prop('type') == 'radio') { + if ($input.prop('checked') && this.$element.hasClass('active')) changed = false + else $parent.find('.active').removeClass('active') + } + if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change') + } + + if (changed) 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() + }) + +}(jQuery); diff --git a/assets/javascripts/bootstrap/carousel.js b/assets/javascripts/bootstrap/carousel.js new file mode 100644 index 0000000..19e9af1 --- /dev/null +++ b/assets/javascripts/bootstrap/carousel.js @@ -0,0 +1,205 @@ +/* ======================================================================== + * Bootstrap: carousel.js v3.1.1 + * http://getbootstrap.com/javascript/#carousel + * ======================================================================== + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/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.bs.carousel', 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) { + 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]() + } + + if ($next.hasClass('active')) return this.sliding = false + + var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction }) + this.$element.trigger(e) + if (e.isDefaultPrevented()) return + + this.sliding = true + + isCycling && this.pause() + + if (this.$indicators.length) { + this.$indicators.find('.active').removeClass('active') + this.$element.one('slid.bs.carousel', function () { + var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()]) + $nextIndicator && $nextIndicator.addClass('active') + }) + } + + if ($.support.transition && this.$element.hasClass('slide')) { + $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.bs.carousel') }, 0) + }) + .emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000) + } else { + $active.removeClass('active') + $next.addClass('active') + this.sliding = false + this.$element.trigger('slid.bs.carousel') + } + + 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()) + }) + }) + +}(jQuery); diff --git a/assets/javascripts/bootstrap/collapse.js b/assets/javascripts/bootstrap/collapse.js new file mode 100644 index 0000000..7130282 --- /dev/null +++ b/assets/javascripts/bootstrap/collapse.js @@ -0,0 +1,170 @@ +/* ======================================================================== + * Bootstrap: collapse.js v3.1.1 + * http://getbootstrap.com/javascript/#collapse + * ======================================================================== + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/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('collapse 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 && options.toggle && option == 'show') option = !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) + }) + +}(jQuery); diff --git a/assets/javascripts/bootstrap/dropdown.js b/assets/javascripts/bootstrap/dropdown.js new file mode 100644 index 0000000..43d7ae3 --- /dev/null +++ b/assets/javascripts/bootstrap/dropdown.js @@ -0,0 +1,147 @@ +/* ======================================================================== + * Bootstrap: dropdown.js v3.1.1 + * http://getbootstrap.com/javascript/#dropdowns + * ======================================================================== + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // DROPDOWN CLASS DEFINITION + // ========================= + + var backdrop = '.dropdown-backdrop' + var toggle = '[data-toggle=dropdown]' + var Dropdown = function (element) { + $(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 use a backdrop because click events don't delegate + $('