diff --git a/app/assets/javascripts/lib/items/items.js.erb b/app/assets/javascripts/lib/items/items.js.erb index 8296503e4..8fe1a55af 100644 --- a/app/assets/javascripts/lib/items/items.js.erb +++ b/app/assets/javascripts/lib/items/items.js.erb @@ -111,10 +111,27 @@ function customOpenSlide() { .closest('.navbar-inner') .addClass('active'); pageslide.find('.content').css('padding', 0); + iFrameContent() } }); } - +function iFrameContent() { + $('#pageslide_iframe').load(function() { + var $iContents = $(this).contents(), + $pc = $iContents.find('.page_content'); + $pc.each(function(index, el) { + if($(this).siblings('*').length == 0) { + var _parentH = $(this).parent('*').outerHeight(); + $(this).css('height', _parentH); + } + }); + $iContents.find('#orbit-bar').hide(); + $iContents.find('.main_wrap').css('margin-top', 0); + $iContents.find('a').not('.edit_link a').on('click', function(event) { + event.preventDefault(); + }); + }); +} function pageSetting(id, edit) { $pageModule = $('#pageslide #page_module_app_id'); $pageF2E = $('#pageslide #page_app_frontend_url'); @@ -149,7 +166,6 @@ function pageSetting(id, edit) { }); }; }); - $pageModule.append(''); $.each(_pageData.module, function(index, val) { $pageModule.append(''); if(_selectData.module.main && val.main[1] == _selectData.module.main) { @@ -193,7 +209,7 @@ function pageSetting(id, edit) { $('#pageslide .active-link.' + val[0]).find('input[type="radio"]').eq(val[2]).prop('checked', true); } }); - changeSetting(id); + changeSetting(id, _status); $('#pageslide').find('.nano').nanoScroller({ scrollTop: 0, iOSNativeScrolling: true }); }) .fail(function(jqXHR, textStatus) { @@ -211,11 +227,10 @@ function pageSetting(id, edit) { }); }; }); - $pageModule.append(''); $.each(_pageData.module, function(index, val) { $pageModule.append(''); }); - changeSetting(id); + changeSetting(id, _status); }; }; @@ -250,8 +265,8 @@ function linkSetting(id, edit) { } } -function changeSetting(id) { - getView(id); +function changeSetting(id, edit) { + edit ? getView(id) : ''; $pagePublishedTrue.prop('checked') ? $('.link-options').slideDown(300) : $('.link-options').slideUp(300); } @@ -368,7 +383,7 @@ $(function() { $subSelete.append(''); }); $.each(val.count, function(index, val) { - $pageCount.append(''); + $pageCount.append(''); }); $pageDivCount.show(); diff --git a/app/assets/javascripts/lib/pageslide.js b/app/assets/javascripts/lib/pageslide.js index ec5022504..610259ac9 100644 --- a/app/assets/javascripts/lib/pageslide.js +++ b/app/assets/javascripts/lib/pageslide.js @@ -54,7 +54,7 @@ // Load a URL. Into an iframe? if(settings.iframe) { window.console.log("iFrame"); - var iframe = $("").attr({ + var iframe = $('').attr({ src: settings.href, frameborder: 0, hspace: 0 @@ -63,7 +63,7 @@ width: "100%", height: "100%" }); - $pageslide.find('.content').html(iframe).show(); + $pageslide.find('.content').css('overflow', 'hidden').html(iframe).show(); if(settings.loadComplete)settings.loadComplete.call(this, $pageslide, $element); } else { window.console.log("Load"); diff --git a/app/assets/stylesheets/basic/global.css b/app/assets/stylesheets/basic/global.css index dbd9f01f3..6c9ce1829 100644 --- a/app/assets/stylesheets/basic/global.css +++ b/app/assets/stylesheets/basic/global.css @@ -191,7 +191,7 @@ legend { } #sidebar .sidebar-nav > li i { font-size: 1.6em; - line-height: 45px; + line-height: 60px; } #sidebar .sidebar-nav > li.active i { font-size: 2.2em; @@ -443,77 +443,72 @@ legend { /* Edit link in structure */ -.editable { - position: relative; - padding: 0px; - margin: 0px; - min-height: 50px; +.page_content { width: 100%; height: 100%; } +.editable { + position: relative; + width: 100%; + height: 100%; + min-height: 50px; +} .edit_link { position: absolute; - left: 2px; - right: 2px; top: 2px; + right: 2px; bottom: 2px; - border: 2px dashed #1769ff; - border-radius: 5px; + left: 2px; + outline: 1px dashed #0090D5; z-index: 1000; - opacity: .3; - filter: alpha(opacity = 30); - background-color: #FFF; - -webkit-transition: all .2s linear; - -moz-transition: all .2s linear; - -o-transition: all .2s linear; - transition: all .2s linear; } -.edit_link a { - color: #333; - position: absolute; - left: 0px; - top: 0px; - right: 0px; - bottom: 0px; +.edit_link:hover { + outline: 2px dashed #E47E6B; +} +.edit_link:hover > a:before { + display: block; +} +.edit_link > a { text-indent: -99999px; - text-align: left; + margin: 0!important; + padding: 0!important; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; } -.edit_link a:before { +.edit_link > a:before { + display: none; + text-indent: 0; + color: #FFF; + content: attr(title); + padding: 5px; + font-size: 12px; + line-height: 10px; + position: absolute; + top: -2px; + left: -2px; + height: 10px; + background-color: #E47E6B; +} +.edit_link > a:after { content: "\f044"; + color: #0090D5; font-family: FontAwesome; position: absolute; + font-style: normal; top: 50%; left: 50%; display: block; - font-size: 1.5em; + font-size: 1em; width: 24px; height: 24px; - margin: -12px 0 0 -12px; + margin: -8px 0 0 -12px; text-indent: 0px; - opacity: .4; - filter: alpha(opacity = 40); - -webkit-transition: all .2s linear; - -moz-transition: all .2s linear; - -o-transition: all .2s linear; - transition: all .2s linear; } -.editable:hover .edit_link { - opacity: .8; - border: 3px dashed #1769ff; - border-radius: 8px; - filter: alpha(opacity = 80); -} -.editable:hover .edit_link a:before { - font-size: 1.8em; - width: 28px; - height: 28px; - margin: -10px 0 0 -14px; - opacity: 1; - filter: alpha(opacity = 100); - -webkit-transition: all .2s linear; - -moz-transition: all .2s linear; - -o-transition: all .2s linear; - transition: all .2s linear; +.edit_link:hover > a:after { + color: #E47E6B; } /* tooltip */ @@ -702,4 +697,4 @@ legend { #main-wrap .wrap-inner { padding: 20px 0; } -} \ No newline at end of file +} diff --git a/app/assets/stylesheets/basic/nanoscroller.css b/app/assets/stylesheets/basic/nanoscroller.css index 251cc1c0c..9875b235e 100644 --- a/app/assets/stylesheets/basic/nanoscroller.css +++ b/app/assets/stylesheets/basic/nanoscroller.css @@ -20,6 +20,9 @@ .nano .content::-webkit-scrollbar { visibility: hidden; } +.nano .content iframe { + position: absolute; +} .has-scrollbar .content::-webkit-scrollbar { visibility: visible; } diff --git a/app/assets/stylesheets/lib/nanoscroller.css b/app/assets/stylesheets/lib/nanoscroller.css deleted file mode 100644 index 4f0b9e500..000000000 --- a/app/assets/stylesheets/lib/nanoscroller.css +++ /dev/null @@ -1,55 +0,0 @@ -/** initial setup **/ -.nano { - position : relative; - width : 100%; - height : 100%; - overflow : hidden; -} -.nano .content { - position : absolute; - overflow : scroll; - overflow-x : hidden; - top : 0; - right : 0; - bottom : 0; - left : 0; -} -.nano .content:focus { - outline: thin dotted; -} -.nano .content::-webkit-scrollbar { - visibility: hidden; -} -.has-scrollbar .content::-webkit-scrollbar { - visibility: visible; -} -.nano > .pane { - /*background : rgba(0,0,0,.25);*/ - position : absolute; - width : 10px; - right : 0; - top : 0; - bottom : 0; - visibility : hidden\9; /* Target only IE7 and IE8 with this hack */ - opacity : .01; - -webkit-transition : .2s; - -moz-transition : .2s; - -o-transition : .2s; - transition : .2s; - -moz-border-radius : 5px; - -webkit-border-radius : 5px; - border-radius : 5px; -} -.nano > .pane > .slider { - background: #444; - background: rgba(0,0,0,.5); - position : relative; - margin : 0 1px; - -moz-border-radius : 3px; - -webkit-border-radius : 3px; - border-radius : 3px; -} -.nano:hover > .pane, .pane.active, .pane.flashed { - visibility : visible\9; /* Target only IE7 and IE8 with this hack */ - opacity : 0.99; -} diff --git a/app/assets/stylesheets/lib/pageslide.css b/app/assets/stylesheets/lib/pageslide.css index be887b90d..9c482a5f8 100644 --- a/app/assets/stylesheets/lib/pageslide.css +++ b/app/assets/stylesheets/lib/pageslide.css @@ -135,4 +135,10 @@ margin-top: 5px; color: #8A8A8A; float: left; +} + + +/* iFrame */ +#pageslide_iframe .page_content { + background-color: #000; } \ No newline at end of file diff --git a/app/models/page_part.rb b/app/models/page_part.rb index c9e54eed1..9bf40c65d 100644 --- a/app/models/page_part.rb +++ b/app/models/page_part.rb @@ -52,6 +52,19 @@ class PagePart end end + def edit_title + case self.kind + when 'text' + I18n.t(:text) + when 'public_r_tag' + self.public_r_tag.humanize + when 'module_widget' + self.module_app.title + else + I18n.t(:undefined) + end + end + protected def delete_empty_widget_field diff --git a/app/views/admin/items/_form_page.html.erb b/app/views/admin/items/_form_page.html.erb index e89b277ae..9e564428c 100644 --- a/app/views/admin/items/_form_page.html.erb +++ b/app/views/admin/items/_form_page.html.erb @@ -18,10 +18,10 @@ <%= select_tag "page[design]", nil, class: "input-xlarge change" %> <%= f.label :theme, t(:theme) %> - <%= select_tag "page[theme_id]", nil, class: "input-xlarge" %> + <%= select_tag "page[theme_id]", nil, class: "input-xlarge", include_blank: true %> <%= f.label :module_app_id, t(:module) %> - <%= select_tag "page[module_app_id]", nil, class: "input-xlarge change" %> + <%= select_tag "page[module_app_id]", nil, class: "input-xlarge change", include_blank: true %>