This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.rails.allowAction = (element) -> | |
message = element.data("confirm") | |
answer = false | |
return true unless message | |
if $.rails.fire(element, "confirm") | |
myCustomConfirmBox message, element | |
false | |
myCustomConfirmBox = (message, element) -> | |
$('.modal .btn-primary').unbind "click" | |
$("#dialog-confirm .modal-body").html message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.prototype.unique = function() { | |
var a, i, j, l; | |
a = []; | |
l = this.length; | |
i = 0; | |
while (i < l) { | |
j = i + 1; | |
while (j < l) { | |
if (this[i] === this[j]) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var isMobile = { | |
Android: function() { | |
return navigator.userAgent.match(/Android/i) ? true : false; | |
}, | |
BlackBerry: function() { | |
return navigator.userAgent.match(/BlackBerry/i) ? true : false; | |
}, | |
iOS: function() { | |
return navigator.userAgent.match(/iPhone|iPad|iPod/i) ? true : false; | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery.fn.extend({ | |
insertAtCaret: function(myValue) { | |
return this.each(function(i) { | |
var endPos, scrollTop, sel, startPos; | |
if (document.selection) { | |
this.focus(); | |
sel = document.selection.createRange(); | |
sel.text = myValue; | |
return this.focus(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=banner | |
float: none | |
position: relative | |
width: 20% | |
font-size: 1.2em | |
font-weight: normal | |
padding: 6px 10px 6px 30px | |
margin: 0px 10px 10px -30px | |
color: #626262 | |
background-color: darken(#f5f5f5, 10%) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){var%20v=%221.8.0%22;if(window.jQuery===undefined%20||%20window.jQuery.fn.jquery%20%3C%20v){var%20done=false;var%20script=document.createElement(%22script%22);script.src=%22http://ajax.googleapis.com/ajax/libs/jquery/%22+v+%22/jquery.min.js%22;script.onload=script.onreadystatechange=function(){if(!done%20%26%26(!this.readyState%20||%20this.readyState==%22loaded%22%20||%20this.readyState==%22complete%22)){done=true;initMyBookmarklet();}};document.getElementsByTagName(%22head%22)[0].appendChild(script);}else{initMyBookmarklet();}function%20initMyBookmarklet(){var%20base_url='http://hd.dev.boardeffect.com';if(!$('%23lookup_container').length){$('head').append('%3Clink%20rel=%22stylesheet%22%20href=%22'+base_url+'/assets/bookmark.css%22%20type=%22text/css%22%20/%3E');$(%22%3Cdiv/%3E%22,{id:%22lookup_container%22,class:%22well%22,html:$(%22%3Cform/%3E%22,{id:%22lookup%22})}).appendTo(%22body%22);$('%3Ca%20/%3E',{href:%22%23%22,html:%22x%22,class:'close'}).prependTo('%23lookup_container%20');$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# routes.rb | |
resources :committees, as: :workrooms, path: :workrooms do | |
resources :meetings, concerns: :bookable | |
end | |
# Generates | |
# workroom_meeting_book GET /workrooms/:workroom_id/meetings/:meeting_id/books/:id( | |
polymorphic_path([@workroom, @meeting, @book]) | |
# But since @workroom is really a Committee model |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Efolder < ActiveRecord::Base | |
include Scopeable::Clientable | |
has_many :vfiles, as: :vfileable, dependent: :destroy | |
has_and_belongs_to_many :users, join_table: "efolders_users", foreign_key: "efolder_id" | |
has_and_belongs_to_many :committees | |
has_ancestry | |
validates :name, presence: true | |
before_save :share_me |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+----+-----------+-----------------------+-----------+----------------+----------------------------------------+------------+--------+---------------+------------+------------+------------+----------+ | |
| id | client_id | name | parent_id | efolders_count | description | toolkit_id | shared | pdf_encrypted | created_at | updated_at | importpath | ancestry | | |
+----+-----------+-----------------------+-----------+----------------+----------------------------------------+------------+--------+---------------+------------+------------+------------+----------+ | |
| 46 | 1 | Board Meeting Minutes | NULL | 3 | Description for board meeting minutes. | NULL | 0 | 0 | NULL | NULL | NULL | NULL | | |
| 47 | 1 | Committee Folders | NULL | 3 | Description for committee folders. | NULL | 0 | 0 | NULL | NULL | NULL | NULL | | |
| 48 | 1 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def map_style(field, args={}) | |
args.reverse_merge!(font: "Helvetica", color: "#000000", size: "18px", style: "normal") | |
(agenda, name, type) = field.split("_") | |
if self.agenda_styles.nil? or self.agenda_styles[name.to_sym].nil? | |
self.send("#{field}=", args[type.to_sym]) | |
else | |
self.send("#{field}=", self.agenda_styles[name.to_sym][type.to_sym]) | |
end |
OlderNewer