diff options
| -rw-r--r-- | app/controllers/pages_controller.rb | 7 | ||||
| -rw-r--r-- | config/routes.rb | 1 | ||||
| -rw-r--r-- | public/javascripts/admin_interface.js | 83 | ||||
| -rw-r--r-- | public/stylesheets/admin.css | 29 |
4 files changed, 0 insertions, 120 deletions
diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 2d08dea..0b7e98f 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb | |||
| @@ -15,11 +15,4 @@ class PagesController < ApplicationController | |||
| 15 | ) | 15 | ) |
| 16 | end | 16 | end |
| 17 | end | 17 | end |
| 18 | |||
| 19 | def sort_images | ||
| 20 | page = Page.find(params[:id]) | ||
| 21 | page.update_assets(params[:images]) | ||
| 22 | |||
| 23 | head :ok | ||
| 24 | end | ||
| 25 | end | 18 | end |
diff --git a/config/routes.rb b/config/routes.rb index 6ddf48c..20602f7 100644 --- a/config/routes.rb +++ b/config/routes.rb | |||
| @@ -30,7 +30,6 @@ Cccms::Application.routes.draw do | |||
| 30 | end | 30 | end |
| 31 | 31 | ||
| 32 | get 'pages/:id/preview', to: 'pages#preview', as: :preview_page | 32 | get 'pages/:id/preview', to: 'pages#preview', as: :preview_page |
| 33 | put 'pages/:id/sort_images', to: 'pages#sort_images', as: :sort_images_page | ||
| 34 | 33 | ||
| 35 | get 'preview/:token', to: 'shared_previews#show', as: :shared_preview | 34 | get 'preview/:token', to: 'shared_previews#show', as: :shared_preview |
| 36 | 35 | ||
diff --git a/public/javascripts/admin_interface.js b/public/javascripts/admin_interface.js index f378c46..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 | ||
| 113 | meta_data = { | ||
| 114 | initialize : function() { | ||
| 115 | document.getElementById("metadata_details").addEventListener("toggle", function() { | ||
| 116 | if (this.open) image_interface.initialize(); | ||
| 117 | }); | ||
| 118 | } | ||
| 119 | }; | ||
| 120 | |||
| 121 | cccms = { | 109 | cccms = { |
| 122 | setup_autosave : function() { | 110 | setup_autosave : function() { |
| 123 | 111 | ||
| @@ -364,77 +352,6 @@ menu_item_sorter = { | |||
| 364 | } | 352 | } |
| 365 | } | 353 | } |
| 366 | 354 | ||
| 367 | image_interface = { | ||
| 368 | |||
| 369 | initialize : function() { | ||
| 370 | |||
| 371 | $("#image_browser").hide(); | ||
| 372 | image_interface.initialize_sortable_image_box(); | ||
| 373 | image_interface.connect_browser_and_box(); | ||
| 374 | image_interface.set_droppable_behavior(); | ||
| 375 | image_interface.bind_image_browser_toggle(); | ||
| 376 | }, | ||
| 377 | |||
| 378 | |||
| 379 | set_droppable_behavior : function() { | ||
| 380 | $("ul#image_box").droppable({ | ||
| 381 | out : function(event, ui) { | ||
| 382 | $(ui.draggable).fadeTo("fast", 0.4); | ||
| 383 | |||
| 384 | $(ui.draggable).bind("mouseup", function() { | ||
| 385 | $(this).remove(); | ||
| 386 | }); | ||
| 387 | }, | ||
| 388 | over : function(event, ui) { | ||
| 389 | $(ui.draggable).fadeTo("fast", 1.0); | ||
| 390 | $(ui.draggable).unbind("mouseup"); | ||
| 391 | } | ||
| 392 | }); | ||
| 393 | }, | ||
| 394 | |||
| 395 | connect_browser_and_box : function() { | ||
| 396 | $("#image_browser ul li").draggable({ | ||
| 397 | connectToSortable : 'ul#image_box', | ||
| 398 | helper : 'clone', | ||
| 399 | revert : 'invalid' | ||
| 400 | }); | ||
| 401 | }, | ||
| 402 | |||
| 403 | initialize_sortable_image_box : function() { | ||
| 404 | |||
| 405 | $("ul#image_box").sortable({ | ||
| 406 | revert : true, | ||
| 407 | update : function(event, ui) { | ||
| 408 | images = $("ul#image_box").sortable("serialize", {attribute : "rel"}); | ||
| 409 | |||
| 410 | $.ajax({ | ||
| 411 | type : "POST", | ||
| 412 | url : "/pages/" + $("ul#image_box").attr("rel") + "/sort_images", | ||
| 413 | dataType : "json", | ||
| 414 | data : images + "&_method=put", | ||
| 415 | success : function() { | ||
| 416 | } | ||
| 417 | }); | ||
| 418 | } | ||
| 419 | }); | ||
| 420 | }, | ||
| 421 | |||
| 422 | bind_image_browser_toggle : function() { | ||
| 423 | $("#image_browser_toggle").bind("click", function(){ | ||
| 424 | if ($("#image_browser_toggle").attr("class") == "unselected") { | ||
| 425 | $("#image_browser_toggle").attr("class", "selected"); | ||
| 426 | $("#image_browser").show(); | ||
| 427 | } | ||
| 428 | else { | ||
| 429 | $("#image_browser_toggle").attr("class", "unselected"); | ||
| 430 | $("#image_browser").hide(); | ||
| 431 | } | ||
| 432 | |||
| 433 | return false; | ||
| 434 | }); | ||
| 435 | } | ||
| 436 | } | ||
| 437 | |||
| 438 | rrule_builder = { | 355 | rrule_builder = { |
| 439 | initialize : function() { | 356 | initialize : function() { |
| 440 | rrule_builder.try_populate_from_rrule($("#event_rrule").val()); | 357 | rrule_builder.try_populate_from_rrule($("#event_rrule").val()); |
diff --git a/public/stylesheets/admin.css b/public/stylesheets/admin.css index 88c9c8b..ef6cb11 100644 --- a/public/stylesheets/admin.css +++ b/public/stylesheets/admin.css | |||
| @@ -1042,10 +1042,6 @@ div#page_editor { | |||
| 1042 | select { | 1042 | select { |
| 1043 | font-size: 1.5rem; | 1043 | font-size: 1.5rem; |
| 1044 | } | 1044 | } |
| 1045 | |||
| 1046 | #metadata ul#image_box { | ||
| 1047 | width: 100% !important; | ||
| 1048 | } | ||
| 1049 | } | 1045 | } |
| 1050 | 1046 | ||
| 1051 | /* ============================================================ | 1047 | /* ============================================================ |
| @@ -1264,31 +1260,6 @@ div#draft_list table td.actions a { | |||
| 1264 | Image box / browser | 1260 | Image box / browser |
| 1265 | ============================================================ */ | 1261 | ============================================================ */ |
| 1266 | 1262 | ||
| 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 | |||
| 1282 | div#image_browser { | ||
| 1283 | position: absolute; | ||
| 1284 | top: 40px; | ||
| 1285 | left: 800px; | ||
| 1286 | } | ||
| 1287 | |||
| 1288 | div#image_browser ul li { | ||
| 1289 | list-style-type: none; | ||
| 1290 | } | ||
| 1291 | |||
| 1292 | .thumbnail_list { | 1263 | .thumbnail_list { |
| 1293 | display: flex; | 1264 | display: flex; |
| 1294 | flex-wrap: wrap; | 1265 | flex-wrap: wrap; |
