Permalink
Browse files

moved out of app folder

  • Loading branch information...
Leo Martel
Leo Martel committed Sep 25, 2014
1 parent 89aae16 commit bf0ea9c1f406cf29d019e2a453f4ca7a73e4fde1
Showing with 147 additions and 6 deletions.
  1. +1 −1 Rakefile
  2. +3 −3 {app → }/app.rb
  3. +2 −2 config.ru
  4. 0 {app → }/helpers/helpers.rb
  5. 0 {app → }/init.rb
  6. 0 {app → }/models/course.rb
  7. 0 {app → }/models/department.rb
  8. 0 {app → }/models/init.rb
  9. 0 {app → }/models/junctions.rb
  10. 0 {app → }/models/path.rb
  11. 0 {app → }/models/requirement.rb
  12. 0 {app → }/models/seeds/courses.rb
  13. 0 {app → }/models/seeds/departments.rb
  14. 0 {app → }/models/seeds/init.rb
  15. 0 {app → }/models/seeds/requirements.rb
  16. 0 {app → }/models/seeds/terms.rb
  17. 0 {app → }/models/seeds/tracks.rb
  18. 0 {app → }/models/term.rb
  19. 0 {app → }/models/track.rb
  20. 0 {app → }/models/user.rb
  21. 0 {app/assets → public}/css/application.css
  22. 0 {app/assets → public}/css/lib/context.bootstrap.css
  23. 0 {app/assets → public}/css/lib/cover.css
  24. BIN {app/assets → public}/css/lib/select2-spinner.gif
  25. 0 {app/assets → public}/css/lib/select2.css
  26. BIN {app/assets → public}/css/lib/select2.png
  27. BIN {app/assets → public}/css/lib/select2x2.png
  28. 0 {app/assets → public}/js/calendar.js
  29. +141 −0 public/js/lib/context.js
  30. 0 {app/assets → public}/js/lib/exclude/jquery-2.1.1.min.js
  31. 0 {app/assets → public}/js/lib/exclude/jquery-ui-1.10.4.js
  32. 0 {app/assets → public}/js/lib/exclude/jquery-ui-1.10.4.min.js
  33. 0 {app/assets → public}/js/lib/jquery-2.1.0.js
  34. 0 {app/assets → public}/js/lib/jquery-ui-1.10.4.custom.js
  35. 0 {app/assets → public}/js/lib/jquery.caret.js
  36. 0 {app/assets → public}/js/lib/select2.js
  37. 0 {app/assets → public}/js/nav.js
  38. 0 {app/assets → public}/js/requirements.js
  39. 0 {app/assets → public}/js/search.js
  40. 0 {app/assets → public}/js/user.js
  41. 0 {app → }/views/course/show.erb
  42. 0 {app → }/views/index.erb
  43. 0 {app → }/views/layout.erb
  44. 0 {app → }/views/path/new.erb
  45. 0 {app → }/views/path/show.erb
  46. 0 {app → }/views/user/new.erb
View
@@ -3,7 +3,7 @@ def exec_ruby(script, *args) # Execute ruby script with live stdout
end
namespace :db do
require_relative 'app/models/init' # opens DB connection, loads Sequel models
require_relative 'models/init' # opens DB connection, loads Sequel models
Sequel.extension :migration
desc "Opens ruby console with database connection"
View
@@ -14,9 +14,9 @@ class TrackTracker < Sinatra::Base
use Rack::Csrf, :raise => true
assets do
serve '/js', from: 'assets/js' # Default
serve '/css', from: 'assets/css' # Default
# serve '/images', from: 'app/images' # Default
serve '/js', from: 'public/js'
serve '/css', from: 'public/css'
# serve '/images', from: 'public/images'
js :app, '/js/app.js', [
'/js/lib/*.js',
View
@@ -1,2 +1,2 @@
require './app/app'
run TrackTracker
require './app'
run TrackTracker
File renamed without changes.
View
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View
@@ -0,0 +1,141 @@
/*
* Context.js
* Copyright Jacob Kelley
* MIT License
*/
var context = context || (function () {
var options = {
fadeSpeed: 100,
filter: function ($obj) {
// Modify $obj, Do not return
},
above: 'auto',
preventDoubleContext: true,
compress: false
};
function initialize(opts) {
options = $.extend({}, options, opts);
$(document).on('click', 'html', function () {
$('.dropdown-context').fadeOut(options.fadeSpeed, function(){
$('.dropdown-context').css({display:''}).find('.drop-left').removeClass('drop-left');
});
});
if(options.preventDoubleContext){
$(document).on('contextmenu', '.dropdown-context', function (e) {
e.preventDefault();
});
}
$(document).on('mouseenter', '.dropdown-submenu', function(){
var $sub = $(this).find('.dropdown-context-sub:first'),
subWidth = $sub.width(),
subLeft = $sub.offset().left,
collision = (subWidth+subLeft) > window.innerWidth;
if(collision){
$sub.addClass('drop-left');
}
});
}
function updateOptions(opts){
options = $.extend({}, options, opts);
}
function buildMenu(data, id, subMenu) {
var subClass = (subMenu) ? ' dropdown-context-sub' : '',
compressed = options.compress ? ' compressed-context' : '',
$menu = $('<ul class="dropdown-menu dropdown-context' + subClass + compressed+'" id="dropdown-' + id + '"></ul>');
var i = 0, linkTarget = '';
for(i; i<data.length; i++) {
if (typeof data[i].divider !== 'undefined') {
$menu.append('<li class="divider"></li>');
} else if (typeof data[i].header !== 'undefined') {
$menu.append('<li class="nav-header">' + data[i].header + '</li>');
} else {
if (typeof data[i].href == 'undefined') {
data[i].href = '#';
}
if (typeof data[i].target !== 'undefined') {
linkTarget = ' target="'+data[i].target+'"';
}
if (typeof data[i].subMenu !== 'undefined') {
$sub = ('<li class="dropdown-submenu"><a tabindex="-1" href="' + data[i].href + '">' + data[i].text + '</a></li>');
} else {
$sub = $('<li><a tabindex="-1" href="' + data[i].href + '"'+linkTarget+'>' + data[i].text + '</a></li>');
}
if (typeof data[i].action !== 'undefined') {
var actiond = new Date(),
actionID = 'event-' + actiond.getTime() * Math.floor(Math.random()*100000),
eventAction = data[i].action;
$sub.find('a').attr('id', actionID);
$('#' + actionID).addClass('context-event');
$(document).on('click', '#' + actionID, eventAction);
}
$menu.append($sub);
if (typeof data[i].subMenu != 'undefined') {
var subMenuData = buildMenu(data[i].subMenu, id, true);
$menu.find('li:last').append(subMenuData);
}
}
if (typeof options.filter == 'function') {
options.filter($menu.find('li:last'));
}
}
return $menu;
}
function addContext(selector, data) {
var d = new Date(),
id = d.getTime(),
$menu = buildMenu(data, id);
$('body').append($menu);
$(document).on('contextmenu', selector, function (e) {
e.preventDefault();
e.stopPropagation();
$('.dropdown-context:not(.dropdown-context-sub)').hide();
$dd = $('#dropdown-' + id);
if (typeof options.above == 'boolean' && options.above) {
$dd.addClass('dropdown-context-up').css({
top: e.pageY - 20 - $('#dropdown-' + id).height(),
left: e.pageX - 13
}).fadeIn(options.fadeSpeed);
} else if (typeof options.above == 'string' && options.above == 'auto') {
$dd.removeClass('dropdown-context-up');
var autoH = $dd.height() + 12;
if ((e.pageY + autoH) > $('html').height()) {
$dd.addClass('dropdown-context-up').css({
top: e.pageY - 20 - autoH,
left: e.pageX - 13
}).fadeIn(options.fadeSpeed);
} else {
$dd.css({
top: e.pageY + 10,
left: e.pageX - 13
}).fadeIn(options.fadeSpeed);
}
}
});
}
function destroyContext(selector) {
$(document).off('contextmenu', selector).off('click', '.context-event');
}
return {
init: initialize,
settings: updateOptions,
attach: addContext,
destroy: destroyContext
};
})();
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit bf0ea9c

Please sign in to comment.