Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Croucherdigital 119 #4

Open
wants to merge 147 commits into
base: v0.12
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
147 commits
Select commit Hold shift + click to select a range
40f7181
folder slug protection (for hkfx) and authentiable user call (for yea…
will-r Oct 1, 2019
3215b66
acts_as_list
will-r Oct 1, 2019
dd63576
routing authenticable
will-r Oct 1, 2019
57623bd
Droom::UserAuthSerializer
will-r Oct 8, 2019
ec2bb15
more ensure_unique_session_id!
will-r Oct 8, 2019
067e7b2
cannot set_unique_session_id on creation so we do it before serialisi…
will-r Oct 8, 2019
3d375d5
more steps to avoid authentication requirement on authentication step
will-r Oct 8, 2019
d167547
more debugging lines
will-r Oct 8, 2019
ac2b46b
more debugging lines
will-r Oct 8, 2019
01d62db
don't do auth_cooking on cors check. d'oh
will-r Oct 8, 2019
0617dcb
more debugging lines
will-r Oct 8, 2019
dd2ecce
still looking for rogue logout in fragments controller
will-r Oct 8, 2019
53edd66
debug a little less, then
will-r Oct 8, 2019
8484c3d
confirmation not absolute requirement for users outside data room, eg…
will-r Oct 9, 2019
4046a1d
folder should not use Slugged concern because slug has runtime scope …
will-r Oct 10, 2019
16702de
restore past-events and events-by-year links to main calendar view
will-r Oct 11, 2019
53442cb
logic fix in user.internal?
will-r Oct 17, 2019
47c513d
noticeboard fixes
will-r Nov 8, 2019
f8d45ed
Use 403 as the unauthorized template
kirankarki Jan 9, 2020
be3ca09
Do not check mail-man db
kirankarki Jan 10, 2020
2209e68
touch user request_at on remote authentication: usual mechanism doesn…
will-r Jan 15, 2020
82754d1
form widget updates from CDR
will-r Jan 15, 2020
d082078
css and symbol fixes
will-r Jan 31, 2020
c495974
changes channel
will-r Feb 4, 2020
bfea5c9
simplify cable mounting a little
will-r Feb 4, 2020
594f300
not ready for 6.0: must fully webpackify first
will-r Feb 4, 2020
d7f09f1
provide cable machinery but allow application to implement
will-r Feb 4, 2020
5db37d0
broadcast_to...
will-r Feb 4, 2020
f43cb29
more experimentation with engine channels, ed symbols not needed most…
will-r Feb 5, 2020
e15a714
Fix issue of time not able to select n change
kirankarki Apr 17, 2020
264bfc5
Load Preferences view to update password of account
kirankarki May 18, 2020
26fd62c
Load proxy action in droom.js file
kirankarki May 20, 2020
05f4265
Load domain address from ENV
kirankarki May 20, 2020
1e68151
Get URL address from ENV only
kirankarki May 20, 2020
2c6011b
Load domain from Settings file
kirankarki May 20, 2020
d2bdf64
Ommit domain from url buidling
kirankarki May 20, 2020
cdd7f84
fixes to document indexing, chiefly to update the _changed? calls
will-r May 22, 2020
7e0c87d
typo
will-r May 22, 2020
d20f713
working on namespace issues in sidekiq jobs
will-r May 22, 2020
26e78f8
add respond_to line to OrganisationsController
will-r May 25, 2020
e603fb8
updated vcard generator
will-r May 25, 2020
7a93267
vcard can include multiple addresses
will-r May 25, 2020
033fe90
vcard can include multiple addresses
will-r May 25, 2020
4a55df5
no ? for association
will-r May 25, 2020
deae381
defaults for null address types
will-r May 25, 2020
9886760
include address properties
will-r May 25, 2020
412e446
...with the right column names
will-r May 25, 2020
2848cb0
endpoint to download all users as vcf
will-r May 25, 2020
66c4625
no nil.empty?
will-r May 25, 2020
4d30557
omit empty phone and email fields from vcf
will-r May 25, 2020
4f83bab
only internal users in address book download
will-r May 25, 2020
18b0b4e
pubsub has to be enabled in droom config
will-r May 25, 2020
58b412d
Check attribute exist or not first
kirankarki May 25, 2020
73d5b69
Organisation.for_selection_with_owner, subsume extendable
will-r May 28, 2020
f2cc4f2
Merge branch 'v0.12' of github.com:croucherfoundation/droom into v0.12
will-r May 28, 2020
7b2f363
missed one variable name :|
will-r May 28, 2020
562c356
would subsume only into an approved organisation
will-r May 28, 2020
1394ea4
specify method on merge call
will-r May 28, 2020
71e3f92
merge_params
will-r May 28, 2020
79666d1
popup success can remove element from page
will-r May 28, 2020
c3dd826
learn to cut and paste
will-r May 28, 2020
1744b09
cheating horribly by sending down refresh id after subsuming
will-r May 28, 2020
c7f192e
reload whole organisations page after merge
will-r May 28, 2020
fc22e45
Pass narrow variable to documents showing partial
kirankarki Jun 30, 2020
e773b24
Whitelist :last_request_at attribute of User model
kirankarki Aug 16, 2020
2522908
Append DROOM_URL if the calling repo is not dataroom
kirankarki Aug 22, 2020
565df76
Get url from Settings as first priority
kirankarki Aug 23, 2020
fb6e0a6
Static url to fetch asset
kirankarki Aug 23, 2020
bb8aad8
Fetch based URL based on environemnt
kirankarki Aug 23, 2020
696b464
Set static based url
kirankarki Aug 23, 2020
87a3e55
Add stream_events partial from Dataroom
kirankarki Nov 19, 2020
ed4d7d0
Add owner_id to allowed params list
kirankarki Nov 25, 2020
5bea634
Set session lifespan as 1 day
kirankarki Mar 24, 2021
26400d4
Add google recaptcha3 in hkfx registration page
kirankarki May 7, 2021
6a46f4f
Add condition for removing action menu of Applications system
kirankarki Jun 10, 2021
69ea2ee
Set 1 day as session life time
kirankarki Jun 12, 2021
6330bd0
Lock devise and devise-security version
kirankarki Jun 12, 2021
37e7a6b
Set session_timeout as 1 hour
kirankarki Jul 9, 2021
2d2173a
Add function of moving folder to under another folder
kirankarki Aug 11, 2021
a41fd5d
Change folder name when event name is changed
kirankarki Aug 14, 2021
a49e54f
Enable documents adding function in event detail too
kirankarki Aug 14, 2021
5448d02
allow staff to access event_types
zinmoee Aug 24, 2021
0e42b9e
Merge pull request #1 from croucherfoundation/CROUCHERDIGITAL-22
kirankarki Aug 25, 2021
e63b4a9
fixed assign user into groups
zinmoee Aug 25, 2021
6f26d72
add read permission
zinmoee Aug 26, 2021
3289984
add miss params
zinmoee Aug 27, 2021
e01ad9a
delete user permission before update
zinmoee Aug 27, 2021
b6348b9
fixed group_id nil error
zinmoee Aug 27, 2021
0c445c3
Merge pull request #2 from croucherfoundation/CROUCHERDIGITAL-15
kirankarki Aug 28, 2021
4a602d2
compelete permission upsert/delete
zinmoee Aug 30, 2021
98efad8
Ignore ruby version file
kirankarki Sep 6, 2021
a93bb3c
Upgrade to Rails 6
kirankarki Sep 6, 2021
b5f6d3d
Skipping deleting permission if group_ids is not passed
krishna9772 Sep 7, 2021
fa140a7
grant read access for dataroom user
zinmoee Sep 7, 2021
c7b0dfe
fixed read stream permissions
zinmoee Sep 8, 2021
992452e
changed pages_layout to page_layout
zinmoee Sep 10, 2021
4a6b244
changed update_attributes to update
yarzardev Sep 10, 2021
afebadd
Merge branch 'v0.12' into CROUCHERDIGITAL-19
kirankarki Sep 11, 2021
0cf9004
Add icons to menus
kirankarki Sep 12, 2021
f294b10
Merge pull request #3 from croucherfoundation/CROUCHERDIGITAL-19
kirankarki Sep 12, 2021
e966fa4
fixed read permission UI in services
zinmoee Sep 13, 2021
84e3a1d
Removing extra css for drop down menu editing which is also used in d…
krishna9772 Sep 14, 2021
8e50c63
Adding group id in menu helper view
krishna9772 Sep 14, 2021
dcc13cc
Passing instance group id
krishna9772 Sep 14, 2021
7d38671
Differentiating between views with available group_id and without
krishna9772 Sep 14, 2021
ec58544
Made the html_options first option in method call
krishna9772 Sep 14, 2021
03372b3
Refactor action_menu method
kirankarki Sep 15, 2021
244f25d
Merge pull request #4 from croucherfoundation/CROUCHERDIGITAL-36
kirankarki Sep 17, 2021
8b008e1
merged v0.12 into rails-6-upgrade
zinmoee Sep 20, 2021
9c2e0f0
Render html tags of locale
kirankarki Sep 28, 2021
84ccabe
fixed duplicate users and emails
yarzardev Sep 29, 2021
72e1511
Use try method to fetch user object
kirankarki Sep 29, 2021
6fb955e
delete droom email when droom user is deleted
yarzardev Sep 29, 2021
7a8cec4
fixed user setup issue
zinmoee Sep 29, 2021
45f9b49
Merge pull request #7 from croucherfoundation/CROUCHERDIGITAL-58
kirankarki Sep 29, 2021
0846276
Merge branch 'v0.12' into CROUCHERDIGITAL-30
kirankarki Sep 29, 2021
044ced1
Merge pull request #6 from croucherfoundation/CROUCHERDIGITAL-30
kirankarki Sep 29, 2021
f4f94f9
merged v0.12 into rails-6-upgrade
zinmoee Sep 30, 2021
9a9ad67
Fix password resetting page issue
yarzardev Dec 2, 2021
10f12bd
add new reset password expired view
yarzardev Dec 3, 2021
5418d7b
Modify UI of reset token expired page
kirankarki Jan 13, 2022
7d276ad
redirect to expired password token page when user is logged in
yarzardev Jan 13, 2022
02bf5de
Merge pull request #8 from croucherfoundation/CROUCHERDIGITAL-78
kirankarki Jan 13, 2022
2e6ce89
Merge branch 'v0.12' into rails-6-upgrade
kirankarki Jan 13, 2022
e435962
Merge pull request #9 from croucherfoundation/rails-6-upgrade
kirankarki Jan 14, 2022
96919c9
update event folder parent_id when event type change
zinmoee Mar 7, 2022
1af7982
Merge pull request #11 from croucherfoundation/CROUCHERDIGITAL-165
kirankarki Mar 7, 2022
fd23034
add ajax error handling and change at to location icon
yarzardev Mar 8, 2022
ba630bb
update destroy in document controller
zinmoee Mar 8, 2022
7652b0e
Merge pull request #12 from croucherfoundation/search-index
kirankarki Mar 10, 2022
8df4207
Merge pull request #13 from croucherfoundation/CROUCHERDIGITAL-161
kirankarki Mar 10, 2022
6a69299
add clock symbol in calendar
yarzardev Mar 15, 2022
52e836b
change clock symbol size
yarzardev Mar 15, 2022
e4e53b4
Temporary rollback of destroy feature
kirankarki Mar 16, 2022
0af9471
remove checking administrator when assigning to Group
zinmoee Mar 18, 2022
d6af1cb
change pdf icon and swap location and time in Event calendar
zinmoee Mar 21, 2022
7cbcbad
change location svg
zinmoee Mar 21, 2022
b5526ee
change location (black circle)
zinmoee Mar 21, 2022
07f57d0
merged CROUCHERDIGITAL-188
zinmoee Mar 21, 2022
2736f93
wrap event.description within div
zinmoee Mar 21, 2022
2054013
fix editor toolbars SVG icons disappearing
zinmoee Mar 21, 2022
665a17a
set location & clock icon to back / add event button In event page
zinmoee Mar 22, 2022
64c2151
fix location & time icon thickness. Sync events with calendar
zinmoee Mar 29, 2022
63d507f
change location & time color to pearl black
zinmoee Mar 29, 2022
539a573
Merge pull request #14 from croucherfoundation/CROUCHERDIGITAL-198
kirankarki Mar 29, 2022
dece98f
align buttons to right in events page
zinmoee Mar 30, 2022
e78c1b3
Gropu partial integrated in user's new form
krishna9772 Apr 5, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ spec/dummy/tmp/
/spec/dummy/public/system/*
/spec/dummy/webdav/*

/.idea/
/.idea/
.ruby-version
8 changes: 7 additions & 1 deletion app/assets/javascripts/droom.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#= require sortablejs/Sortable
#= require jquery.cookie/jquery.cookie
#= require ep-jquery-tokeninput/src/jquery.tokeninput
#= require imagesloaded/imagesloaded.pkgd

#= require droom/lib/jquery.datepicker
#= require droom/lib/jquery.animate-colors
Expand Down Expand Up @@ -67,8 +68,10 @@ jQuery ($) ->
@find_including_self('[data-action="toggle"]').toggle()
@find_including_self('[data-action="alternate"]').alternator()
@find_including_self('[data-action="replace"]').replace_with_remote_content()
@find_including_self('[data-action="update_content"]').update_main_content()
@find_including_self('[data-action="autofetch"]').replace_with_remote_content ".holder", {force: true}
@find_including_self('[data-action="slide"]').sliding_link()
@find_including_self('[data-action="proxy"]').click_proxy()
@find_including_self('[data-action="fit"]').self_sizes()
@find_including_self('form[data-action="filter"]').filter_form()
@find_including_self('form[data-action="quick_search"]').quick_search_form()
Expand Down Expand Up @@ -116,8 +119,11 @@ jQuery ($) ->
@find_including_self('.sortable_files').sortable_files()
@find_including_self('[data-draggable]').draggable()
@find_including_self('.gridbox:not(.notice)').gridBox()
@find_including_self('.notice').notice()
@find_including_self('.tagger').tagger()
@find_including_self('form.search.quick').quick_search_form()

@find_including_self('#noticeboard').imagesLoaded =>
console.log "imagesLoaded ", @
$('.notice').notice()

@
81 changes: 53 additions & 28 deletions app/assets/javascripts/droom/actions.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
# The basic approach here is PJAX: our remote calls always return chunks of html. There are no client-side templates
# or model classes. Instead we have defined a set of actions, by which page elements can interact with the server in
# structured ways. A tag will declare that it triggers an action, and may also declare that the action will replace or
# affect other elements.
# affect other elements.
#
# Many elements are refreshable, and an action that affects them will trigger their refreshment. Editing an event is
# a simple remote form operation with several consequences for the page:
#
# link_to t(:edit_event), edit_event_url(event), :class => 'edit minimal', :data => {
# :action => "popup",
# :replaced => "#event_#{event.id}",
# :action => "popup",
# :replaced => "#event_#{event.id}",
# :affected => ".minimonth"
# }
#
# When the `popup` action is complete - that is, the server returns a response with no form in it - the final response
# When the `popup` action is complete - that is, the server returns a response with no form in it - the final response
# will replace the original event container and the small calendar display will be refreshed to show the possibly revised
# date of the event.
#
Expand Down Expand Up @@ -50,7 +50,7 @@ jQuery ($) ->

if @_url
@_container.addClass('working')
params =
params =
dataType: "html"
beforeSend: @prep
success: @replace
Expand Down Expand Up @@ -87,7 +87,7 @@ jQuery ($) ->
# attribute. The delete link next to an event, for example:
#
# link_to t(:remove), event_url(event), :method => 'delete', :data => {
# :confirm => t(:confirm_delete_event, :name => event.name),
# :confirm => t(:confirm_delete_event, :name => event.name),
# :removes => ".holder",
# :affected => ".minimonth"}
#
Expand All @@ -99,9 +99,13 @@ jQuery ($) ->
affected = $(@).attr('data-affected')
$(@).remote
on_success: (response) =>
$(@).parents(removed).first().fadeOut 'fast', () ->
$(@).remove()
$(affected).trigger "refresh"
if $(@).parents('.menu').first().length == 1
$(@).parents('.menu').first().fadeOut 'fast', () ->
$(removed).remove()
else
$(@).parents(removed).first().fadeOut 'fast', () ->
$(@).remove()
$(affected).trigger "refresh"


# The 'remove_all' action takes out on success anything matching the given selector:
Expand All @@ -114,7 +118,7 @@ jQuery ($) ->
@each ->
removed = $(@).attr('data-removed')
affected = $(@).attr('data-affected')

$(@).remote
on_success: (response) =>
$(removed).fadeOut 'fast', () ->
Expand Down Expand Up @@ -156,6 +160,9 @@ jQuery ($) ->
response ?= e
replaced = if container is "self" then $el else $el.self_or_ancestor(container).last()
replacement = $(response).insertAfter(replaced)
console.log 'response', response
console.log 'replaced', replaced
console.log 'replacement', replacement
replaced?.remove()
replacement.activate()
replacement.hide().slideDown() if options.slide
Expand All @@ -166,6 +173,24 @@ jQuery ($) ->
$.rails.handleRemote($el)


# *update_main_content* is used in services page, action from popup and effected on main content
$.fn.update_main_content = (selector, opts) ->
selector ?= '.holder'
options = $.extend { force: false, confirm: false, slide: false, pjax: true, credentials: false }, opts
@each ->
$el = $(@)
container = selector
$el.remote
credentials: options.credentials
pjax: options.pjax
on_success: (e, response) =>
response ?= e
className = $(response).attr "class"
id = $(response).attr "id"
@_selector = $("[data-menu=\"#{id}\"]")
$(@_selector).removeClass().addClass(className)
$(".menu").hide()


# The reinviter is an ordinary remote link.
#
Expand Down Expand Up @@ -258,7 +283,7 @@ jQuery ($) ->
$.fn.setter = () ->
@each ->
new Setter(@)

class Setter
constructor: (element, @_root, @_property) ->
@_link = $(element)
Expand All @@ -273,7 +298,7 @@ jQuery ($) ->
data = {}
value = if @_link.hasClass('yes') then @_negative else @_positive
data[@_root] = {}
data[@_root][@_property] = value
data[@_root][@_property] = value
data['_method'] = "PUT"
data

Expand Down Expand Up @@ -328,7 +353,7 @@ jQuery ($) ->
else
@_showing = $(@_selector).is(":visible")
@store()

apply: (e) =>
e.preventDefault() if e
if @_showing then @show() else @hide()
Expand All @@ -349,19 +374,19 @@ jQuery ($) ->
@_container.text(@_showing_text)
@_showing = true
@store()

slideUp: =>
$(@_selector).slideUp () =>
@hide()
@_container.trigger('toggled')

hide: =>
$(@_selector).hide()
@_container.removeClass('showing')
@_container.text(@_hiding_text)
@_showing = false
@store()

store: () =>
if @_remembered
value = if @_showing then "showing" else "hidden"
Expand Down Expand Up @@ -390,18 +415,18 @@ jQuery ($) ->
@preview = @container.find(@options.preview)
@switch.click @toggle
@set()

set: () =>
if @container.hasClass("open") then @show() else @hide()

toggle: (e) =>
e.preventDefault() if e
if @container.hasClass("open") then @hide() else @show()

hide: () =>
@container.removeClass('open')
@preview.show().css('position', 'relative')
@body.stop().slideUp
@body.stop().slideUp
duration: 'slow'
easing: 'glide'
complete: =>
Expand Down Expand Up @@ -448,7 +473,7 @@ jQuery ($) ->



# The *alternator* action is a more extreme toggle. It allows an element to declare its alternate:
# The *alternator* action is a more extreme toggle. It allows an element to declare its alternate:
# when a link within the element is clicked, it will be removed from the DOM and its alternate
# inserted. Usually the relation is reciprocal, so that another link in the alternate will bring
# the original element back.
Expand All @@ -468,13 +493,13 @@ jQuery ($) ->
@_container.after(@_alternate)
@_container.remove()
@_alternate.find('a').click @revert

revert: (e) =>
e.preventDefault() if e
@_alternate.before(@_container)
@_alternate.remove()
@_container.find('a').click @flip

$.fn.alternator = ->
@each ->
new Alternator(@)
Expand All @@ -484,7 +509,7 @@ jQuery ($) ->
$.fn.hover_table = ->
@each ->
$(@).find('td').hover_cell()

$.fn.hover_cell = ->
@each ->
classes = @className.split(' ').join('.')
Expand Down Expand Up @@ -554,14 +579,14 @@ jQuery ($) ->
@_defilter.show()
else
@_defilter.hide()

setQuery: (e) =>
kc = e.which
# delete, backspace, alphanumerics, number pad, punctuation
if (kc is 8) or (kc is 46) or (47 < kc < 91) or (96 < kc < 112) or (kc > 145)
@setDefilter()
@filter()

clearQuery: (e) =>
e.preventDefault() if e
@_container.val("")
Expand All @@ -576,7 +601,7 @@ jQuery ($) ->


# A text input that sizes to fit will adjust its font size to suit the length of its content.
# At the moment this is done just by fitting a curve, but it ought really to be based on a
# At the moment this is done just by fitting a curve, but it ought really to be based on a
# calculation of area occupied.

$.size_to_fit = (e) ->
Expand All @@ -587,10 +612,10 @@ jQuery ($) ->
'font-size': "#{size}em"
width: 532
height: 290
,
,
queue: false
duration: 100

$.fn.self_sizes = () ->
@each ->
$(@).bind "keyup", $.size_to_fit
Expand Down
2 changes: 2 additions & 0 deletions app/assets/javascripts/droom/ajax.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ jQuery ($) ->
@_control.trigger "remote:progress", prog

fail: (event, xhr, status) =>
if xhr.status == 401
window.location.reload()
event.stopPropagation()
@_control.removeClass('waiting').addClass('erratic')
@_control.find('input[type=submit]').removeClass('waiting')
Expand Down
36 changes: 27 additions & 9 deletions app/assets/javascripts/droom/editors.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,45 @@ jQuery ($) ->
allowMultiParagraphSelection: true
buttons: [
name: 'bold'
contentDefault: '<svg><use xlink:href="#bold_button"></use></svg>'
contentDefault: '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-type-bold" viewBox="0 0 16 16">
<path d="M8.21 13c2.106 0 3.412-1.087 3.412-2.823 0-1.306-.984-2.283-2.324-2.386v-.055a2.176 2.176 0 0 0 1.852-2.14c0-1.51-1.162-2.46-3.014-2.46H3.843V13H8.21zM5.908 4.674h1.696c.963 0 1.517.451 1.517 1.244 0 .834-.629 1.32-1.73 1.32H5.908V4.673zm0 6.788V8.598h1.73c1.217 0 1.88.492 1.88 1.415 0 .943-.643 1.449-1.832 1.449H5.907z"/>
</svg>'
,
name: 'italic'
contentDefault: '<svg><use xlink:href="#italic_button"></use></svg>'
contentDefault: '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-type-italic" viewBox="0 0 16 16">
<path d="M7.991 11.674 9.53 4.455c.123-.595.246-.71 1.347-.807l.11-.52H7.211l-.11.52c1.06.096 1.128.212 1.005.807L6.57 11.674c-.123.595-.246.71-1.346.806l-.11.52h3.774l.11-.52c-1.06-.095-1.129-.211-1.006-.806z"/>
</svg>'
,
name: 'anchor'
contentDefault: '<svg><use xlink:href="#anchor_button"></use></svg>'
contentDefault: '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-link-45deg" viewBox="0 0 16 16">
<path d="M4.715 6.542 3.343 7.914a3 3 0 1 0 4.243 4.243l1.828-1.829A3 3 0 0 0 8.586 5.5L8 6.086a1.002 1.002 0 0 0-.154.199 2 2 0 0 1 .861 3.337L6.88 11.45a2 2 0 1 1-2.83-2.83l.793-.792a4.018 4.018 0 0 1-.128-1.287z"/>
<path d="M6.586 4.672A3 3 0 0 0 7.414 9.5l.775-.776a2 2 0 0 1-.896-3.346L9.12 3.55a2 2 0 1 1 2.83 2.83l-.793.792c.112.42.155.855.128 1.287l1.372-1.372a3 3 0 1 0-4.243-4.243L6.586 4.672z"/>
</svg>'
,
name: 'orderedlist'
contentDefault: '<svg><use xlink:href="#ol_button"></use></svg>'
contentDefault: '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-list-ol" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M5 11.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5z"/>
<path d="M1.713 11.865v-.474H2c.217 0 .363-.137.363-.317 0-.185-.158-.31-.361-.31-.223 0-.367.152-.373.31h-.59c.016-.467.373-.787.986-.787.588-.002.954.291.957.703a.595.595 0 0 1-.492.594v.033a.615.615 0 0 1 .569.631c.003.533-.502.8-1.051.8-.656 0-1-.37-1.008-.794h.582c.008.178.186.306.422.309.254 0 .424-.145.422-.35-.002-.195-.155-.348-.414-.348h-.3zm-.004-4.699h-.604v-.035c0-.408.295-.844.958-.844.583 0 .96.326.96.756 0 .389-.257.617-.476.848l-.537.572v.03h1.054V9H1.143v-.395l.957-.99c.138-.142.293-.304.293-.508 0-.18-.147-.32-.342-.32a.33.33 0 0 0-.342.338v.041zM2.564 5h-.635V2.924h-.031l-.598.42v-.567l.629-.443h.635V5z"/>
</svg>'
,
name: 'unorderedlist'
contentDefault: '<svg><use xlink:href="#ul_button"></use></svg>'
contentDefault: '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-list-ul" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M5 11.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm-3 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm0 4a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm0 4a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"/>
</svg>'
,
name: 'h2'
contentDefault: '<svg><use xlink:href="#h1_button"></use></svg>'
contentDefault: '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-type-h2" viewBox="0 0 16 16">
<path d="M7.638 13V3.669H6.38V7.62H1.759V3.67H.5V13h1.258V8.728h4.62V13h1.259zm3.022-6.733v-.048c0-.889.63-1.668 1.716-1.668.957 0 1.675.608 1.675 1.572 0 .855-.554 1.504-1.067 2.085l-3.513 3.999V13H15.5v-1.094h-4.245v-.075l2.481-2.844c.875-.998 1.586-1.784 1.586-2.953 0-1.463-1.155-2.556-2.919-2.556-1.941 0-2.966 1.326-2.966 2.74v.049h1.223z"/>
</svg>'
,
name: 'h3'
contentDefault: '<svg><use xlink:href="#h2_button"></use></svg>'
contentDefault: '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-type-h3" viewBox="0 0 16 16">
<path d="M7.637 13V3.669H6.379V7.62H1.758V3.67H.5V13h1.258V8.728h4.62V13h1.259zm3.625-4.272h1.018c1.142 0 1.935.67 1.949 1.674.013 1.005-.78 1.737-2.01 1.73-1.08-.007-1.853-.588-1.935-1.32H9.108c.069 1.327 1.224 2.386 3.083 2.386 1.935 0 3.343-1.155 3.309-2.789-.027-1.51-1.251-2.16-2.037-2.249v-.068c.704-.123 1.764-.91 1.723-2.229-.035-1.353-1.176-2.4-2.954-2.385-1.873.006-2.857 1.162-2.898 2.358h1.196c.062-.69.711-1.299 1.696-1.299.998 0 1.695.622 1.695 1.525.007.922-.718 1.592-1.695 1.592h-.964v1.074z"/>
</svg>'
,
name: 'removeFormat'
contentDefault: '<svg><use xlink:href="#clear_button"></use></svg>'
contentDefault: '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-lg" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M13.854 2.146a.5.5 0 0 1 0 .708l-11 11a.5.5 0 0 1-.708-.708l11-11a.5.5 0 0 1 .708 0Z"/>
<path fill-rule="evenodd" d="M2.146 2.146a.5.5 0 0 0 0 .708l11 11a.5.5 0 0 0 .708-.708l-11-11a.5.5 0 0 0-.708 0Z"/>
</svg>'
]

15 changes: 11 additions & 4 deletions app/assets/javascripts/droom/grid.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@ $.fn.autoGrid = ->
$.fn.gridBox = ->
@each ->
$el = $(@)
contents = $el.find('.content')
row = 20
space = 20
rows_touched = Math.ceil(contents.outerHeight() / (row + space))
$el.css "grid-row-end", "span #{rows_touched}"
$el.addClass('ready')
sizer = ->
contents = $el.find('.content')
console.log "sizer!", contents, contents.outerHeight()
rows_touched = Math.ceil(contents.outerHeight() / (row + space)) + 2
$el.css "grid-row-end", "span #{rows_touched}"
$el.addClass('ready')
sizer()
$el.find('img').on 'load', =>
console.log "resizer!"
sizer()


$.fn.highlight = ->
if @offset()
Expand Down
6 changes: 4 additions & 2 deletions app/assets/javascripts/droom/lib/assets.js.coffee.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
jQuery ($) ->

$.withZxcbvn = (fn) ->
url = "<%= URI.join(Settings.url, asset_path('droom/zxcvbn.js')) %>"
$.getScript(url).done (response) => fn?(response)
based_url = 'https://data.croucher.org.hk/'
asset_path = based_url + "<%=asset_path('droom/zxcvbn.js')%>"

$.getScript(asset_path).done (response) => fn?(response)
Loading