summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
Diffstat (limited to 'public')
-rw-r--r--public/javascripts/admin_interface.js89
-rw-r--r--public/javascripts/public.js21
-rw-r--r--public/javascripts/related_assets.js1
-rw-r--r--public/stylesheets/admin.css60
-rw-r--r--public/stylesheets/ccc.css83
5 files changed, 131 insertions, 123 deletions
diff --git a/public/javascripts/admin_interface.js b/public/javascripts/admin_interface.js
index 7fb1dc2..f6d915f 100644
--- a/public/javascripts/admin_interface.js
+++ b/public/javascripts/admin_interface.js
@@ -45,10 +45,6 @@ $(document).ready(function () {
45 menu_item_sorter.initialize(); 45 menu_item_sorter.initialize();
46 } 46 }
47 47
48 if ($("#metadata").length != 0) {
49 meta_data.initialize();
50 }
51
52 if ($("#parent_search_term").length != 0) { 48 if ($("#parent_search_term").length != 0) {
53 parent_search.initialize_search(); 49 parent_search.initialize_search();
54 } 50 }
@@ -110,14 +106,6 @@ $(document).ready(function () {
110}); 106});
111 107
112 108
113meta_data = {
114 initialize : function() {
115 document.getElementById("metadata_details").addEventListener("toggle", function() {
116 if (this.open) image_interface.initialize();
117 });
118 }
119};
120
121cccms = { 109cccms = {
122 setup_autosave : function() { 110 setup_autosave : function() {
123 111
@@ -282,6 +270,7 @@ cccms = {
282 large: $(this).data('large-url'), 270 large: $(this).data('large-url'),
283 original: $(this).data('original-url'), 271 original: $(this).data('original-url'),
284 name: $(this).data('name'), 272 name: $(this).data('name'),
273 hasCredit: $(this).data('has-credit') === true,
285 headline: $(this).data('headline') === true 274 headline: $(this).data('headline') === true
286 }; 275 };
287 }).get(); 276 }).get();
@@ -320,8 +309,11 @@ cccms = {
320 : 'inline-image inline-image--half inline-image--' + placement; 309 : 'inline-image inline-image--half inline-image--' + placement;
321 310
322 var esc = cccms.inline_images.escape_attr; 311 var esc = cccms.inline_images.escape_attr;
312 var titleForGlightbox = (item.name || '').replace(/;/g, ',');
313 var glightboxOpts = 'title: ' + esc(titleForGlightbox) +
314 (item.hasCredit ? '; description: #credit_for_asset_' + esc(item.id) : '') + ';';
323 var html = '<a href="' + esc(item.original) + '" class="glightbox" data-gallery="page-' + esc(cccms.inline_images.node_id) + '"' + 315 var html = '<a href="' + esc(item.original) + '" class="glightbox" data-gallery="page-' + esc(cccms.inline_images.node_id) + '"' +
324 ' data-title="' + esc(item.name) + '" data-description="#credit_for_asset_' + esc(item.id) + '">' + 316 ' data-glightbox="' + glightboxOpts + '">' +
325 '<img src="' + esc(item.large) + '" class="' + classes + '" alt="' + esc(item.name) + '"></a>'; 317 '<img src="' + esc(item.large) + '" class="' + classes + '" alt="' + esc(item.name) + '"></a>';
326 318
327 cccms.inline_images.editor.insertContent(html); 319 cccms.inline_images.editor.insertContent(html);
@@ -360,77 +352,6 @@ menu_item_sorter = {
360 } 352 }
361} 353}
362 354
363image_interface = {
364
365 initialize : function() {
366
367 $("#image_browser").hide();
368 image_interface.initialize_sortable_image_box();
369 image_interface.connect_browser_and_box();
370 image_interface.set_droppable_behavior();
371 image_interface.bind_image_browser_toggle();
372 },
373
374
375 set_droppable_behavior : function() {
376 $("ul#image_box").droppable({
377 out : function(event, ui) {
378 $(ui.draggable).fadeTo("fast", 0.4);
379
380 $(ui.draggable).bind("mouseup", function() {
381 $(this).remove();
382 });
383 },
384 over : function(event, ui) {
385 $(ui.draggable).fadeTo("fast", 1.0);
386 $(ui.draggable).unbind("mouseup");
387 }
388 });
389 },
390
391 connect_browser_and_box : function() {
392 $("#image_browser ul li").draggable({
393 connectToSortable : 'ul#image_box',
394 helper : 'clone',
395 revert : 'invalid'
396 });
397 },
398
399 initialize_sortable_image_box : function() {
400
401 $("ul#image_box").sortable({
402 revert : true,
403 update : function(event, ui) {
404 images = $("ul#image_box").sortable("serialize", {attribute : "rel"});
405
406 $.ajax({
407 type : "POST",
408 url : "/pages/" + $("ul#image_box").attr("rel") + "/sort_images",
409 dataType : "json",
410 data : images + "&_method=put",
411 success : function() {
412 }
413 });
414 }
415 });
416 },
417
418 bind_image_browser_toggle : function() {
419 $("#image_browser_toggle").bind("click", function(){
420 if ($("#image_browser_toggle").attr("class") == "unselected") {
421 $("#image_browser_toggle").attr("class", "selected");
422 $("#image_browser").show();
423 }
424 else {
425 $("#image_browser_toggle").attr("class", "unselected");
426 $("#image_browser").hide();
427 }
428
429 return false;
430 });
431 }
432}
433
434rrule_builder = { 355rrule_builder = {
435 initialize : function() { 356 initialize : function() {
436 rrule_builder.try_populate_from_rrule($("#event_rrule").val()); 357 rrule_builder.try_populate_from_rrule($("#event_rrule").val());
diff --git a/public/javascripts/public.js b/public/javascripts/public.js
index a9250ca..7f38f66 100644
--- a/public/javascripts/public.js
+++ b/public/javascripts/public.js
@@ -1,6 +1,25 @@
1document.addEventListener('DOMContentLoaded', function(){ 1document.addEventListener('DOMContentLoaded', function(){
2 2
3 GLightbox({ selector: '.glightbox' }); 3 GLightbox({
4 selector: '.glightbox',
5 afterSlideLoad: function(slideData) {
6 var trigger = document.querySelectorAll('.glightbox')[slideData.index];
7 var selector = trigger && trigger.dataset.creditSelector;
8 if (!selector) return;
9
10 var source = document.querySelector(selector);
11 var container = slideData.slide.querySelector('.gdesc-inner');
12 if (!source || !container) return;
13
14 var target = container.querySelector('.gslide-desc');
15 if (!target) {
16 target = document.createElement('div');
17 target.className = 'gslide-desc';
18 container.appendChild(target);
19 }
20 target.innerHTML = source.innerHTML;
21 }
22 });
4 23
5 document.getElementById("light-mode").addEventListener("change", () => { 24 document.getElementById("light-mode").addEventListener("change", () => {
6 if (document.getElementById("light-mode").checked) 25 if (document.getElementById("light-mode").checked)
diff --git a/public/javascripts/related_assets.js b/public/javascripts/related_assets.js
index cc07d86..c6c6a19 100644
--- a/public/javascripts/related_assets.js
+++ b/public/javascripts/related_assets.js
@@ -87,6 +87,7 @@ related_assets = {
87 var item = $($("#related_asset_template").html().trim()); 87 var item = $($("#related_asset_template").html().trim());
88 item.attr("data-url", related.url); 88 item.attr("data-url", related.url);
89 item.attr("data-asset-id", related.asset_id); 89 item.attr("data-asset-id", related.asset_id);
90 item.attr("data-has-credit", related.has_credit);
90 item.attr("data-large-url", related.large_url); 91 item.attr("data-large-url", related.large_url);
91 item.attr("data-original-url", related.original_url); 92 item.attr("data-original-url", related.original_url);
92 item.attr("data-name", related.name); 93 item.attr("data-name", related.name);
diff --git a/public/stylesheets/admin.css b/public/stylesheets/admin.css
index 086e73d..7b06c7d 100644
--- a/public/stylesheets/admin.css
+++ b/public/stylesheets/admin.css
@@ -1002,14 +1002,9 @@ div#page_editor {
1002 padding-right: 5px; 1002 padding-right: 5px;
1003 } 1003 }
1004 1004
1005 /* Fixed 800px width will overflow narrow viewports despite
1006 border-box -- every sibling rule in this block uses 100% instead.
1007 Worth checking on an actual phone; looks unfinished rather than
1008 intentional. Not changed here since it wasn't part of what you
1009 asked to fix. */
1010 #page_editor textarea#page_body { 1005 #page_editor textarea#page_body {
1011 box-sizing: border-box; 1006 box-sizing: border-box;
1012 width: 800px; 1007 width: 100%;
1013 height: 50rem; 1008 height: 50rem;
1014 } 1009 }
1015 1010
@@ -1042,10 +1037,6 @@ div#page_editor {
1042 select { 1037 select {
1043 font-size: 1.5rem; 1038 font-size: 1.5rem;
1044 } 1039 }
1045
1046 #metadata ul#image_box {
1047 width: 100% !important;
1048 }
1049} 1040}
1050 1041
1051/* ============================================================ 1042/* ============================================================
@@ -1264,31 +1255,6 @@ div#draft_list table td.actions a {
1264 Image box / browser 1255 Image box / browser
1265 ============================================================ */ 1256 ============================================================ */
1266 1257
1267#metadata ul#image_box {
1268 box-sizing: border-box;
1269 margin: 0;
1270 padding: 10px 5px 10px 5px;
1271 height: 100px;
1272 width: 702px;
1273 border: 1px solid #989898;
1274}
1275
1276#metadata ul#image_box li {
1277 float: left;
1278 list-style-type: none;
1279 margin: 5px;
1280}
1281
1282div#image_browser {
1283 position: absolute;
1284 top: 40px;
1285 left: 800px;
1286}
1287
1288div#image_browser ul li {
1289 list-style-type: none;
1290}
1291
1292.thumbnail_list { 1258.thumbnail_list {
1293 display: flex; 1259 display: flex;
1294 flex-wrap: wrap; 1260 flex-wrap: wrap;
@@ -1316,6 +1282,30 @@ div#image_browser ul li {
1316 border-radius: 4px; 1282 border-radius: 4px;
1317} 1283}
1318 1284
1285.thumbnail_list li {
1286 position: relative;
1287}
1288
1289.thumbnail_list li .headline_indicator {
1290 position: absolute;
1291 top: 4px;
1292 right: 4px;
1293 width: 1.4rem;
1294 height: 1.4rem;
1295 display: flex;
1296 align-items: center;
1297 justify-content: center;
1298 border-radius: 50%;
1299 background: rgba(255, 255, 255, 0.85);
1300 color: #f5b400;
1301}
1302
1303.thumbnail_list li .headline_indicator svg {
1304 width: 0.9rem;
1305 height: 0.9rem;
1306 fill: currentColor;
1307}
1308
1319.related_asset_handle { 1309.related_asset_handle {
1320 display: flex; 1310 display: flex;
1321 color: #969696; 1311 color: #969696;
diff --git a/public/stylesheets/ccc.css b/public/stylesheets/ccc.css
index 8358d06..91f7a06 100644
--- a/public/stylesheets/ccc.css
+++ b/public/stylesheets/ccc.css
@@ -727,7 +727,6 @@ div.teaser_ruler {
727 min-width: 0; 727 min-width: 0;
728} 728}
729 729
730
731.inline-image--full { 730.inline-image--full {
732 width: 100%; 731 width: 100%;
733 margin: 1rem 0; 732 margin: 1rem 0;
@@ -748,10 +747,88 @@ div.teaser_ruler {
748 margin-left: 1rem; 747 margin-left: 1rem;
749} 748}
750 749
751#asset_credits .glightbox-desc { 750#asset_credits .asset_credit_block {
752 display: none; 751 display: none;
753} 752}
754 753
755#asset_credits .headline_credit { 754#asset_credits .asset_credit_block.headline_credit {
756 display: block; 755 display: block;
757} 756}
757
758#asset_credits {
759 border-top: dotted 1px silver;
760}
761
762#asset_credits,
763.right {
764 font-style: italic;
765 font-family: Georgia;
766 font-size: 0.9rem;
767 color: color-mix(in srgb, CanvasText, #808080);
768}
769
770.glightbox-clean .gslide-description {
771 background: Canvas !important;
772}
773
774.glightbox-clean .gslide-title,
775.glightbox-clean .gslide-desc {
776 color: CanvasText !important;
777}
778
779.headline_document_card {
780 display: flex;
781 gap: 1rem;
782 align-items: flex-start;
783 border: 1px solid color-mix(in srgb, CanvasText, #808080 25%);
784 border-radius: 6px;
785 padding: 1rem;
786 text-decoration: none;
787 color: inherit;
788}
789
790.headline_document_card:hover {
791 border-color: CanvasText;
792}
793
794.headline_document_card_thumb {
795 max-width: 120px;
796 max-height: 160px;
797 border: 1px solid color-mix(in srgb, CanvasText, #808080 25%);
798 flex-shrink: 0;
799}
800
801.headline_document_card_info {
802 display: flex;
803 align-items: center;
804 gap: 0.5rem;
805}
806
807.headline_document_card_title {
808 font-weight: bold;
809}
810
811.related_documents {
812 margin-top: 1rem;
813}
814
815.related_documents_label {
816 font-style: italic;
817 font-family: Georgia;
818 font-size: 0.9rem;
819 color: color-mix(in srgb, CanvasText, #808080);
820 margin-bottom: 0.3rem;
821}
822
823.related_documents_list {
824 list-style: none;
825 padding: 0;
826 margin: 0;
827}
828
829.related_document_link {
830 display: inline-flex;
831 align-items: center;
832 gap: 0.4rem;
833 text-decoration: none;
834}