AttachToPost/attach_to_post.min.css000064400000032266150212230430013431 0ustar00@font-face{font-family:Lato;src:url(../../products/photocrati_nextgen/modules/nextgen_admin/static/Lato-Regular.ttf) format('truetype')}body,html{width:100%!important;height:100%!important;padding:0!important;margin:0!important;max-width:100%!important;font-size:13px;overflow:hidden}body{position:absolute;visibility:hidden;opacity:0;height:100%}.entity_errors{color:red}.entity_errors ul{margin-left:30px}.entity_errors ul li{list-style-type:disc}.ui-helper-reset{font-size:13px}#attach_to_post_tabs{border:0;background:0 0;height:100%;overflow:hidden;padding:0;position:relative;visibility:visible}#attach_to_post_tabs.ui-tabs-hide{display:block!important;visibility:hidden;position:absolute;top:-5000px}#attach_to_post_tabs h3{text-transform:uppercase;color:#000;margin-top:0;letter-spacing:2px;font-size:18px;font-weight:900}h3#choose_display{margin-bottom:24px}#attach_to_post_tabs .main_menu_tab{padding:0;position:absolute;left:220px;right:0;top:0;bottom:0}#attach_to_post_tabs.ngg_atp_ios_detected{overflow-y:scroll;-webkit-overflow-scrolling:touch}#attach_to_post_tabs .ui-widget-header{border:0;border-bottom:1px solid #dfdfdf;background:0 0}iframe{width:100%;min-height:100%;border:none;padding:0;margin:0;background:0 0}.chrome_70_hack_frames{z-index:100000000!important}.chrome_70_hack_noframes{z-index:0!important}.clear{clear:both;float:none}table{font-size:13px}.select2-search input{width:100%!important}.select2-result-label{white-space:nowrap}.select2-results{font-family:'segoe ui',Arial,sans-serif;font-size:13px}.select2-container a{color:#444!important}#ngg_page_content .ngg_page_content_main .select2-container{width:100%!important;max-width:500px!important}#attach_to_post_tabs .ui-tabs-icon{box-sizing:border-box;color:#fff;font-family:Lato,sans-serif;float:none;font-size:20px;font-weight:700;height:100%;letter-spacing:1px;line-height:60px;margin-bottom:0;position:fixed;text-transform:uppercase;width:220px;padding:0}#attach_to_post_tabs img.attach_to_post_logo{height:80px;padding:50px 0 30px;float:right;margin-right:26px}#attach_to_post_tabs .ui-tabs-nav{border:none;background:0 0;padding:0;margin-top:110px;list-style:none}#attach_to_post_tabs .ui-tabs-nav li{background:0 0;border:none;display:block;height:auto;margin:0;width:100%;border-radius:0;box-sizing:border-box;padding:24px 30px 24px 20px}#attach_to_post_tabs .ui-tabs-nav li.active,#attach_to_post_tabs .ui-tabs-nav li.ui-state-active,#attach_to_post_tabs .ui-tabs-nav li.ui-state-focus,#attach_to_post_tabs .ui-tabs-nav li:focus{outline:0}#attach_to_post_tabs .ui-tabs-nav li a{display:list-item;color:#555;float:right;font-size:13px;font-weight:400;font-family:Lato,sans-serif;letter-spacing:1.5px;line-height:1;text-transform:uppercase;padding:0!important}#attach_to_post_tabs .ui-tabs-nav li.ui-tabs-active{border-left:6px solid #9dbd1b}#attach_to_post_tabs .ui-tabs-nav li.ui-state-disabled a,#attach_to_post_tabs .ui-tabs-nav li.ui-tabs-active a,#attach_to_post_tabs .ui-tabs-nav li.ui-tabs-loading a{cursor:pointer}#attach_to_post_tabs .ui-tabs-nav li a.active_tab{font-weight:800;color:#000}#displayed_tab.main_menu_tab{overflow-y:scroll;overflow-x:hidden}#displayed_tab #ngg_page_content{margin:0;width:100%}#displayed_tab #attach_to_post_tabs .ngg_page_content_header{display:none}#displayed_tab #ngg_page_content .ngg_page_content_menu{background:0 0;border:none;padding:0 20px 10px 27px;float:none;height:25px;margin-top:0;width:auto;position:relative;top:100px}#displayed_tab #ngg_page_content .ngg_page_content_menu a,#displayed_tab #ngg_page_content .ngg_page_content_menu a:active{border:none;color:#000;display:inline;font-weight:300;text-decoration:none;line-height:25px;padding:4px;font-size:12px;background:0 0;margin-right:10px}#displayed_tab #ngg_page_content .ngg_page_content_menu .ngg_page_content_menu_active{font-weight:500;color:#000;border-bottom:3px solid #9ebc1b}#displayed_tab #ngg_page_content .ngg_page_content_menu a:active:after{display:none}#displayed_tab #ngg_page_content .ngg_page_content_menu a:before{display:none}#displayed_tab #ngg_page_content .ngg_page_content_main{padding:20px 30px 30px;width:100%;box-shadow:none}#displayed_tab #ngg_page_content.ngg_settings_page{border:none}#displayed_tab .ngg_igw_promo{display:block!important;padding:15px 7px;color:#666;font-family:Lato,sans-serif;font-size:10pt;letter-spacing:.5px;box-sizing:border-box;height:172px}#displayed_tab .ngg_igw_promo p{text-align:center}#displayed_tab .ngg_igw_promo p:nth-of-type(1){margin-top:10px}#displayed_tab .ngg_igw_promo p:nth-of-type(2){margin:20px 0}#displayed_tab .ngg_igw_promo a{text-decoration:none;font-weight:600;background:#9ebc1b;color:#fff;padding:10px 16px;font-size:11px;text-transform:uppercase}#displayed_tab .ngg_igw_coupon{font-size:12px;margin-top:10px}#attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main>div.ngg_igw_video{display:block!important;position:absolute;left:280px;top:71px}#displayed_tab .ngg_igw_video_open{background:#000;cursor:pointer;margin:0;font-weight:400;height:28px!important;line-height:28px!important;font-size:10px}#displayed_tab .ngg_igw_video_inner{display:none;box-shadow:0 0 10px 5px rgba(0,0,0,.2);background:#fff}#displayed_tab .ngg_igw_video_close{width:100%;height:50px;display:block;text-align:center;line-height:50px;font-size:13px;font-weight:600;cursor:pointer;font-family:Lato,sans-serif;background:#000;color:#fff;text-transform:uppercase;letter-spacing:1.5px}#displayed_tab .ngg_igw_video iframe{width:630px;height:350px!important;min-height:auto;margin-bottom:-3px}#choose_display_content,#display_settings_tab_content,#preview_tab_content{margin-top:80px}#displayed_tab #displayed_gallery_source{width:400px}#displayed_tab #display_tip{color:rgba(42,52,61,.6);display:block;font-size:14px;width:960px;max-width:100%;padding:10px 0 0}#displayed_tab #slug_configuration{display:none}#displayed_tab #slug_configuration td,#displayed_tab #source_configuration td{vertical-align:top;padding:4px 0!important;min-width:200px}#displayed_tab #source_configuration label{color:#777!important;font-size:13px!important}#attach_to_post_tabs #displayed_tab #ngg_page_content #source_configuration tr td:first-of-type{white-space:normal;line-height:1.2;width:265px}#displayed_tab #ngg_page_content .select2-container{width:250px!important;line-height:20px}#displayed_tab #ngg_page_content .ngg_page_content_main .select2-selection--multiple,#displayed_tab #ngg_page_content .ngg_page_content_main .select2-selection--single{height:auto;line-height:21px}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#9fbb1a}#displayed_tab #slug_configuration #slug_label{width:52px}#displayed_tab #slug_configuration #slug_column input[type=text]{width:498px}#displayed_tab #display_type_selector{margin-top:14px}#displayed_tab .display_type_preview{float:left;margin:0 5px 5px 0;border:1px solid #ddd;background:#fff;width:145px;height:170px}#displayed_tab .display_type_preview .image_container{width:100%;vertical-align:middle;text-align:center;font-size:12px;font-weight:500;padding:8px;box-sizing:border-box}#displayed_tab .display_type_preview .image_container img{margin-top:10px;margin-bottom:10px;box-sizing:border-box;max-width:100px}#displayed_tab .display_type_preview .image_container p{display:inline-block}.display_type_preview label>div{font-size:12px}#displayed_tab .select2-chosen{color:#666!important}#ngg_page_content #save_displayed_gallery.button{font-weight:700;height:50px!important;line-height:50px!important;padding:0 30px!important;font-size:13px}#save_displayed_gallery:disabled{background:gray!important}#display_settings_tab #display_settings_form table tr td:first-child{vertical-align:top;text-align:right;padding-right:7px;width:180px}#display_settings_tab #display_settings_form table td{text-align:left}#display_settings_tab #display_settings_form table textarea{height:60px}#display_settings_tab #display_settings_form input[type=number],#display_settings_tab #display_settings_form input[type=text],#display_settings_tab #display_settings_form select,#display_settings_tab #display_settings_form textarea{width:157px}#display_settings_tab #display_settings_form .ngg_slideshow_gallery_height,#display_settings_tab #display_settings_form .ngg_slideshow_gallery_width,#display_settings_tab #display_settings_form .ngg_thumbnail_dimension_height,#display_settings_tab #display_settings_form .ngg_thumbnail_dimension_width{width:65px!important}#display_settings_tab #display_settings_form .nextgen_settings_colorpicker{width:85px!important;text-align:center}h3#preview_tab{margin-bottom:0}#preview_tab_content{padding:10px 0}#preview_tab_content a{text-decoration:none;font-weight:300}#preview_tab_content .previewed_entity{width:100%;border-bottom:solid 1px #e0e0d6;background-color:#fafaf0}#preview_tab_content .previewed_entity .container{padding-top:15px}#preview_tab_content .previewed_entity.header{background-color:#f0f0e6;padding-bottom:5px;padding-top:5px}#preview_tab_content .header label{font-size:12px;color:#649664;font-weight:600}#preview_tab_content .ui-sortable-helper{background:0 0}#preview_tab_content ul{list-style-type:none;display:block;padding:0;position:relative;margin-top:20px}#preview_tab_content .inclusion_checkbox{margin-right:7px;display:block;float:left}#preview_tab_content .preview_item{background-color:#fff;width:100px;padding:10px 10px 30px 10px;margin:0 5px 5px 0;border:solid 1px #eee;display:block;vertical-align:middle;text-align:center;position:relative}#preview_tab_content .image_container{background-repeat:no-repeat;background-position:center;background-size:cover;display:block;width:100%;height:75px}#preview_tab_content .image_container img{border:0}#preview_tab_content #entity_list li{float:left}#preview_tab_content #entity_list .ui-state-default{background:0 0;border:none}#preview_tab_content .placeholder{background-color:#e0ddc1;position:relative}#preview_tab_content #entity_list .exclude_container{background:#fff;display:block;text-align:center;margin:0 auto;color:#000;font-weight:400;height:1.4em;line-height:1.1em;font-size:.8em;position:absolute;bottom:.2em;left:0;width:100%;padding:5px 0}#preview_tab_content #entity_list .exclude_container input{vertical-align:middle;line-height:1.2em;margin:0 .5em}#preview_tab_content .header_row{margin-bottom:5px;font-weight:300}#preview_tab_content .header_row strong{width:70px;display:inline-block}#preview_tab_content .header_row .separator{display:inline-block;margin:0 5px}#preview_tab_content .header_row .selected{font-weight:700}#preview_tab_content #entity_list li.clear{float:none;clear:both}#preview_tab_content .refresh_button{float:right}@media (max-width:1120px){#displayed_tab .ngg_igw_promo{position:static;width:602px;height:125px;max-width:100%;margin-bottom:10px}#displayed_tab .ngg_igw_coupon{margin-top:10px}#attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main>div.ngg_igw_video,#displayed_tab .ngg_igw_video_inner{display:none!important}}@media (max-width:800px){#attach_to_post_tabs .ui-tabs-icon{width:100%;position:static;border-right:none;border-bottom:3px solid #9fbb1a;text-align:center;height:150px;padding:20px}#attach_to_post_tabs img.attach_to_post_logo{display:none}#attach_to_post_tabs .ui-tabs-nav{margin-top:0}#attach_to_post_tabs .ui-tabs-nav li{padding:5px;list-style:none!important;border-bottom:none;border-top:none!important}#attach_to_post_tabs .ui-tabs-nav li.ui-tabs-active{background:0 0}#attach_to_post_tabs:not(.ngg_atp_ios_detected) .ui-tabs-nav li:nth-of-type(2)::after{display:none}#attach_to_post_tabs .ui-tabs-nav li a{float:none;padding:0!important;font-weight:400}#attach_to_post_tabs .ui-tabs-nav li a.active_tab{color:#9ebc1b}#attach_to_post_tabs .ui-tabs-nav li a.active_tab::before{display:none}#attach_to_post_tabs .main_menu_tab{margin-left:0;min-height:auto;position:absolute;top:150px;right:0;left:0;bottom:0;height:auto}#displayed_tab #ngg_page_content .ngg_page_content_menu{padding:5px 0 0;background:0 0;border:none}#displayed_tab #ngg_page_content .ngg_page_content_menu a{display:block;width:100%;float:left;padding:0;text-align:center;box-sizing:border-box}#displayed_tab #ngg_page_content .ngg_page_content_menu .ngg_page_content_menu_active,#displayed_tab #ngg_page_content .ngg_page_content_menu a:active{background:0 0}#displayed_tab #ngg_page_content .ngg_page_content_menu .ngg_page_content_menu_active:after{display:none}#displayed_tab #ngg_page_content .ngg_page_content_menu a:last-of-type{padding-bottom:5px}#displayed_tab #slug_configuration tr,#displayed_tab #source_configuration tr{margin-bottom:24px}#ngg_page_content #save_displayed_gallery.button{position:static;margin-left:0;padding:0}}@media (max-width:781px){#attach_to_post_tabs.ngg_atp_ios_detected .ui-tabs-nav li:nth-of-type(1)::after{display:none}#attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main table tr td{width:100%!important}#attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main #source_configuration{display:table!important}#attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main #source_configuration tbody{display:table-row-group!important}#displayed_tab #ngg_page_content .responsive-menu-icon{padding:10px 0 15px!important}}.ngg-marketing-popup{font-family:Lato,sans-serif}@media (max-width:400px){#displayed_tab .display_type_preview{float:none;margin:20px auto;width:170px}}AttachToPost/attach_to_post.css000064400000042262150212230430012644 0ustar00/* * * This file contains CSS for: * 1. Overall IGW Window (dialog CSS is in attach_to_post_dialog.css) * 2. IGW Sidebar * 3. Display Tab: General CSS * 3a. Display Tab: "Choose Display" Subtab * 3b. Display Tab: "Customize Display Settings" Subtab * 3c. Display Tab: "Sort & Exclude Images" (ie, Preview) Subtab * 4. Other Tabs * 5. Media Queries * * Note that much of the CSS in #2 is duplicated in iframely.css. The css here cannot * reach into the iframe of the Add Gallery, Manage Gallery, and Manage Album pages. * So overrides for those pages go in iframely.css. * * Almost every time you make a change here, you may need to make an equivalent change * in iframely.css for the other main tabs in the IGW other than the Display Tab. * */ @font-face { font-family: 'Lato'; src: url('../../products/photocrati_nextgen/modules/nextgen_admin/static/Lato-Regular.ttf') format('truetype') } /* 1. Overall IGW Window */ html, body { width: 100% !important; height: 100% !important; padding: 0 !important; margin: 0 !important; max-width: 100% !important; font-size: 13px; overflow: hidden; } body { position: absolute; visibility: hidden; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter: alpha(opacity=0); opacity: 0.0; height: 100%; } .entity_errors { color: red; } .entity_errors ul { margin-left: 30px; } .entity_errors ul li{ list-style-type: disc; } .ui-helper-reset { font-size: 13px; } #attach_to_post_tabs { border: 0; background: none; height: 100%; overflow: hidden; padding: 0; position: relative; visibility: visible; } #attach_to_post_tabs.ui-tabs-hide { display: block !important; visibility: hidden; position: absolute; top: -5000px; } #attach_to_post_tabs h3 { text-transform: uppercase; color: black; margin-top: 0; letter-spacing: 2px; font-size: 18px; font-weight: 900; } h3#choose_display { margin-bottom: 24px; } #attach_to_post_tabs .main_menu_tab { padding: 0; position: absolute; left: 220px; right: 0; top: 0; bottom: 0; } #attach_to_post_tabs.ngg_atp_ios_detected { overflow-y: scroll; -webkit-overflow-scrolling: touch; } #attach_to_post_tabs .ui-widget-header { border: 0; border-bottom: 1px solid #dfdfdf; background: none; } iframe { width: 100%; min-height: 100%; border: none; padding: 0; margin: 0; background: transparent; } .chrome_70_hack_frames { z-index: 100000000 !important; } .chrome_70_hack_noframes { z-index: 0 !important; } .clear { clear: both; float: none; } table { font-size: 13px; } .select2-search input { width: 100% !important; } .select2-result-label { white-space: nowrap; } .select2-results { font-family: 'segoe ui', Arial, sans-serif; font-size: 13px; } .select2-container a { color: #444 !important; } /* thanks to nextgen_admin_page.css */ #ngg_page_content .ngg_page_content_main .select2-container { width: 100% !important; max-width: 500px !important; } /* 2. IGW Sidebar */ #attach_to_post_tabs .ui-tabs-icon { box-sizing: border-box; color: #fff; font-family: "Lato", sans-serif; float: none; font-size: 20px; font-weight: bold; height: 100%; letter-spacing: 1px; line-height: 60px; margin-bottom: 0; position: fixed; text-transform: uppercase; width: 220px; padding: 0; } #attach_to_post_tabs img.attach_to_post_logo { height: 80px; padding: 50px 0 30px; float: right; margin-right: 26px; } #attach_to_post_tabs .ui-tabs-nav { border: none; background: transparent; padding: 0; margin-top: 110px; list-style: none; } #attach_to_post_tabs .ui-tabs-nav li { background: transparent; border: none; display: block; height: auto; margin: 0; width: 100%; border-radius: 0; box-sizing: border-box; padding: 24px 30px 24px 20px; } #attach_to_post_tabs .ui-tabs-nav li.ui-state-focus, #attach_to_post_tabs .ui-tabs-nav li.ui-state-active, #attach_to_post_tabs .ui-tabs-nav li:focus, #attach_to_post_tabs .ui-tabs-nav li.active { outline: none; } #attach_to_post_tabs .ui-tabs-nav li a { display: list-item; color: #555; float: right; font-size: 13px; font-weight: 400; font-family: "Lato", sans-serif; letter-spacing: 1.5px; line-height: 1; text-transform: uppercase; padding: 0 !important; } #attach_to_post_tabs .ui-tabs-nav li.ui-tabs-active { border-left: 6px solid #9dbd1b; } #attach_to_post_tabs .ui-tabs-nav li.ui-tabs-active a, #attach_to_post_tabs .ui-tabs-nav li.ui-state-disabled a, #attach_to_post_tabs .ui-tabs-nav li.ui-tabs-loading a { cursor: pointer; } #attach_to_post_tabs .ui-tabs-nav li a.active_tab { font-weight: 800; color: black; } /* 3. Display Tab: General CSS */ #displayed_tab.main_menu_tab { overflow-y: scroll; overflow-x: hidden; } #displayed_tab #ngg_page_content { margin: 0; width: 100%; } #displayed_tab #attach_to_post_tabs .ngg_page_content_header { display: none; } #displayed_tab #ngg_page_content .ngg_page_content_menu { background: transparent; border: none; padding: 0 20px 10px 27px; float: none; height: 25px; margin-top: 0; width: auto; position: relative; top: 100px; } #displayed_tab #ngg_page_content .ngg_page_content_menu a, #displayed_tab #ngg_page_content .ngg_page_content_menu a:active { border: none; color: black; display: inline; font-weight: 300; text-decoration: none; line-height: 25px; padding: 4px; font-size: 12px; background: transparent; margin-right: 10px; } #displayed_tab #ngg_page_content .ngg_page_content_menu .ngg_page_content_menu_active { font-weight: 500; color: black; border-bottom: 3px solid #9ebc1b; } #displayed_tab #ngg_page_content .ngg_page_content_menu a:active:after { display:none; } #displayed_tab #ngg_page_content .ngg_page_content_menu a:before { display: none; } #displayed_tab #ngg_page_content .ngg_page_content_main { padding: 20px 30px 30px; width: 100%; box-shadow: none; } #displayed_tab #ngg_page_content.ngg_settings_page { border: none; } #displayed_tab .ngg_igw_promo { display: block !important; padding: 15px 7px; color: #666; font-family: "Lato", sans-serif; font-size: 10pt; letter-spacing: .5px; box-sizing: border-box; height: 172px; } #displayed_tab .ngg_igw_promo p { text-align: center; } #displayed_tab .ngg_igw_promo p:nth-of-type(1) { margin-top: 10px; } #displayed_tab .ngg_igw_promo p:nth-of-type(2) { margin: 20px 0; } #displayed_tab .ngg_igw_promo a { text-decoration: none; font-weight: 600; background: #9ebc1b; color: white; padding: 10px 16px; font-size: 11px; text-transform: uppercase; } #displayed_tab .ngg_igw_coupon { font-size: 12px; margin-top: 10px; } #attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main > div.ngg_igw_video { display: block !important; position: absolute; left: 280px; top: 71px; } #displayed_tab .ngg_igw_video_open { background: black; cursor: pointer; margin: 0; font-weight: 400; height: 28px !important; line-height: 28px !important; font-size: 10px; } #displayed_tab .ngg_igw_video_inner { display: none; box-shadow: 0 0 10px 5px rgba(0,0,0,.2); background: #fff; } #displayed_tab .ngg_igw_video_close { width: 100%; height: 50px; display: block; text-align: center; line-height: 50px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: "Lato", sans-serif; background: black; color: #fff; text-transform: uppercase; letter-spacing: 1.5px; } #displayed_tab .ngg_igw_video iframe { width: 630px; height: 350px !important; min-height: auto; margin-bottom: -3px; } #choose_display_content, #display_settings_tab_content, #preview_tab_content { margin-top: 80px; } /* 3a. Display Tab: "Choose Display" Subtab **/ #displayed_tab #displayed_gallery_source { width: 400px; } #displayed_tab #display_tip { color: rgba(42,52,61,.6); display: block; font-size: 14px; width: 960px; max-width: 100%; padding: 10px 0 0; } #displayed_tab #slug_configuration { display: none; } #displayed_tab #source_configuration td, #displayed_tab #slug_configuration td { vertical-align: top; padding: 4px 0 !important; min-width: 200px; } #displayed_tab #source_configuration label { color: #777 !important; font-size: 13px !important; } #attach_to_post_tabs #displayed_tab #ngg_page_content #source_configuration tr td:first-of-type { white-space: normal; line-height: 1.2; width: 265px; } #displayed_tab #ngg_page_content .select2-container { width: 250px !important; line-height: 20px; } #displayed_tab #ngg_page_content .ngg_page_content_main .select2-selection--multiple, #displayed_tab #ngg_page_content .ngg_page_content_main .select2-selection--single { height: auto; line-height: 21px; } .select2-container--default .select2-results__option--highlighted[aria-selected] { background-color: #9fbb1a; } #displayed_tab #slug_configuration #slug_label { width: 52px; } #displayed_tab #slug_configuration #slug_column input[type=text] { width: 498px; } #displayed_tab #display_type_selector { margin-top: 14px; } #displayed_tab .display_type_preview { float: left; margin: 0 5px 5px 0; border: 1px solid #ddd; background: #fff; width: 145px; height: 170px; } #displayed_tab .display_type_preview .image_container { width: 100%; vertical-align: middle; text-align: center; font-size: 12px; font-weight: 500; padding: 8px; box-sizing: border-box; } #displayed_tab .display_type_preview .image_container img { margin-top: 10px; margin-bottom: 10px; box-sizing: border-box; max-width: 100px; } #displayed_tab .display_type_preview .image_container p { display: inline-block; } .display_type_preview label > div { font-size: 12px; } #displayed_tab .select2-chosen { color: #666 !important; } #ngg_page_content #save_displayed_gallery.button { font-weight: 700; height: 50px!important; line-height: 50px!important; padding: 0 30px!important; font-size: 13px; } #save_displayed_gallery:disabled { background: gray !important; } /* 3b. Display Tab: "Customize Display Settings" Subtab */ #display_settings_tab #display_settings_form table tr td:first-child { vertical-align: top; text-align: right; padding-right: 7px; width: 180px; } #display_settings_tab #display_settings_form table td { text-align: left; } #display_settings_tab #display_settings_form table textarea { height: 60px; } #display_settings_tab #display_settings_form textarea, #display_settings_tab #display_settings_form input[type=text], #display_settings_tab #display_settings_form input[type=number], #display_settings_tab #display_settings_form select { width: 157px; } #display_settings_tab #display_settings_form .ngg_slideshow_gallery_width, #display_settings_tab #display_settings_form .ngg_slideshow_gallery_height, #display_settings_tab #display_settings_form .ngg_thumbnail_dimension_width, #display_settings_tab #display_settings_form .ngg_thumbnail_dimension_height { width: 65px !important; } #display_settings_tab #display_settings_form .nextgen_settings_colorpicker { width: 85px !important; text-align: center; } /* 3c. Display Tab: "Sort & Exclude Images" (ie, Preview) Subtab */ h3#preview_tab { margin-bottom: 0; } #preview_tab_content { padding: 10px 0; } #preview_tab_content a { text-decoration: none; font-weight: 300; } #preview_tab_content .previewed_entity { width: 100%; border-bottom: solid 1px #E0E0D6; background-color: #FAFAF0; } #preview_tab_content .previewed_entity .container { padding-top: 15px; } #preview_tab_content .previewed_entity.header { background-color: #F0F0E6; padding-bottom: 5px; padding-top: 5px; } #preview_tab_content .header label { font-size: 12px; color: rgb(100,150,100); font-weight: 600; } #preview_tab_content .ui-sortable-helper { background: none; } #preview_tab_content ul { list-style-type: none; display: block; padding: 0; position: relative; margin-top: 20px; } #preview_tab_content .inclusion_checkbox { margin-right: 7px; display: block; float: left; } #preview_tab_content .preview_item { background-color: white; width: 100px; padding: 10px 10px 30px 10px; margin: 0 5px 5px 0; border: solid 1px #eee; display: block; vertical-align: middle; text-align: center; position: relative; } #preview_tab_content .image_container { background-repeat: no-repeat; background-position: center; background-size: cover; display: block; width: 100%; height: 75px; } #preview_tab_content .image_container img { border: 0; } #preview_tab_content #entity_list li{ float: left; } #preview_tab_content #entity_list .ui-state-default { background: none; border: none; } #preview_tab_content .placeholder { background-color: #e0ddc1; position: relative; } #preview_tab_content #entity_list .exclude_container { background: white; display: block; text-align: center; margin: 0 auto; color: black; font-weight: normal; height: 1.4em; line-height: 1.1em; font-size: 0.8em; position: absolute; bottom: 0.2em; left: 0; width: 100%; padding: 5px 0; } #preview_tab_content #entity_list .exclude_container input { vertical-align: middle; line-height: 1.2em; margin: 0 0.5em; } #preview_tab_content .header_row { margin-bottom: 5px; font-weight: 300; } #preview_tab_content .header_row strong { width: 70px; display: inline-block; } #preview_tab_content .header_row .separator { display: inline-block; margin: 0 5px; } #preview_tab_content .header_row .selected { font-weight: bold; } #preview_tab_content #entity_list li.clear { float: none; clear: both; } #preview_tab_content .refresh_button { float: right; } /* 4. Overall IGW Window */ #ngg-iframe-galleries_tab { } /* 5. Media Queries */ @media (max-width: 1120px) { #displayed_tab .ngg_igw_promo { position: static; width: 602px; height: 125px; max-width: 100%; margin-bottom: 10px; } #displayed_tab .ngg_igw_coupon { margin-top: 10px; } #attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main > div.ngg_igw_video, #displayed_tab .ngg_igw_video_inner { display: none !important; } } @media (max-width: 800px) { #attach_to_post_tabs .ui-tabs-icon { width: 100%; position: static; border-right: none; border-bottom: 3px solid #9fbb1a; text-align: center; /* Also update #attach_to_post_tabs .main_menu_tab's top position when changing height */ /*height: 280px;*/ height: 150px; padding: 20px; } #attach_to_post_tabs img.attach_to_post_logo { display: none; } #attach_to_post_tabs .ui-tabs-nav { margin-top: 0; } #attach_to_post_tabs .ui-tabs-nav li { padding: 5px; list-style: none !important; border-bottom: none; border-top: none !important; } #attach_to_post_tabs .ui-tabs-nav li.ui-tabs-active { background: transparent; } #attach_to_post_tabs:not(.ngg_atp_ios_detected) .ui-tabs-nav li:nth-of-type(2)::after { display: none; } #attach_to_post_tabs .ui-tabs-nav li a { float: none; padding: 0 !important; font-weight: normal; } #attach_to_post_tabs .ui-tabs-nav li a.active_tab { color: #9ebc1b; } #attach_to_post_tabs .ui-tabs-nav li a.active_tab::before { display:none; } #attach_to_post_tabs .main_menu_tab { margin-left: 0; min-height: auto; position: absolute; top: 150px; right: 0; left: 0; bottom: 0; height: auto; } #displayed_tab #ngg_page_content .ngg_page_content_menu { padding: 5px 0 0; background: none; border: none; } #displayed_tab #ngg_page_content .ngg_page_content_menu a { display: block; width: 100%; float: left; padding: 0; text-align: center; box-sizing: border-box; } #displayed_tab #ngg_page_content .ngg_page_content_menu .ngg_page_content_menu_active, #displayed_tab #ngg_page_content .ngg_page_content_menu a:active { background: transparent; } #displayed_tab #ngg_page_content .ngg_page_content_menu .ngg_page_content_menu_active:after { display:none; } #displayed_tab #ngg_page_content .ngg_page_content_menu a:last-of-type { padding-bottom: 5px; } #displayed_tab #source_configuration tr, #displayed_tab #slug_configuration tr { margin-bottom: 24px; } #ngg_page_content #save_displayed_gallery.button { position: static; margin-left: 0; padding: 0; } } @media (max-width: 781px) { #attach_to_post_tabs.ngg_atp_ios_detected .ui-tabs-nav li:nth-of-type(1)::after { display:none; } #attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main table tr td { width: 100% !important; } #attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main #source_configuration { display: table !important; } #attach_to_post_tabs #displayed_tab #ngg_page_content .ngg_page_content_main #source_configuration tbody { display: table-row-group !important; } #displayed_tab #ngg_page_content .responsive-menu-icon { padding: 10px 0 15px !important; } } .ngg-marketing-popup { font-family: "Lato", sans-serif; } @media (max-width: 400px) { #displayed_tab .display_type_preview { float: none; margin: 20px auto; width: 170px; } } AttachToPost/spinner.gif000064400000003471150212230430011263 0ustar00GIF89aFFFzzzXXX$$$666hhh! NETSCAPE2.0!Created with ajaxload.info! ,w  !DBAH¬aD@ ^AXP@"UQ# B\; 1 o:2$v@ $|,3 _# d53" s5 e!! ,v i@e9DAA/`ph$Ca%@ pHxFuSx# .݄YfL_" p 3BW ]|L \6{|z87[7!! ,x  e9DE"2r,qPj`8@8bH, *0- mFW9LPE3+ (B"  f{*BW_/ @_$~Kr7Ar7!! ,v 4e9!H"* Q/@-4ép4R+-pȧ`P(6᠝U/  *,)(+/]"lO/*Ak K]A~666!! ,l ie9"* -80H=N; TEqe UoK2_WZ݌V1jgWe@tuH//w`?f~#6#!! ,~ ,e9"* ; pR%#0` 'c(J@@/1i4`VBV u}"caNi/ ] ))-Lel  mi} me[+!! ,y Ie9"M6*¨"7E͖@G((L&pqj@Z %@wZ) pl( ԭqu*R&c `))( s_J>_\'Gm7$+!! ,w Ie9*, (*(B5[1 ZIah!GexzJ0e6@V|U4Dm%$͛p \Gx }@+| =+ 1- Ea5l)+!! ,y )䨞'AKڍ,E\(l&;5 5D03a0--ÃpH4V % i p[R"| #  6iZwcw*!! ,y )䨞,K*0 a;׋аY8b`4n ¨Bbbx,( Ƚ  % >  2*i* /:+$v*!! ,u )䨞l[$ Jq[q 3`Q[5:IX!0rAD8 CvHPfiiQAP@pC %D PQ46  iciNj0w )#!! ,y ). q ,G Jr(J8 C*B,&< h W~-`, ,>; 8RN<, <1T] c' qk$ @)#!;AttachToPost/ngg_attach_to_post_tinymce_plugin.js000064400000023320150212230430016423 0ustar00// Self-executing function to create and register the TinyMCE plugin (function (siteurl, $) { window.id = "wordpress-post-page"; tinyMCE.addI18n("en.ngg_attach_to_post", { title: "Attach NextGEN Gallery to Post", }); // Create the plugin. We'll register it afterwards tinymce.create("tinymce.plugins.NextGEN_AttachToPost", { /** * The WordPress Site URL */ siteurl: siteurl, /** * Returns metadata about this plugin */ getInfo: function () { return { longname: "NextGEN Gallery", author: "Imagely", authorurl: "https://www.imagely.com", infourl: "https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/", version: "0.1", }; }, /** * Initializes the plugin, this will be executed after the plugin has been created. */ init: function (editor, plugin_url) { var self = this; // TinyMCE 4s events are a bit weird, but this lets us listen to the window-manager close event editor.windowManager.nggOldOpen = editor.windowManager.open; editor.windowManager.open = function (one, two) { var modal = editor.windowManager.nggOldOpen(one, two); modal.on("close", self.wm_close_event); return modal; }; // Register a new TinyMCE command editor.addCommand( "ngg_attach_to_post", this.render_attach_to_post_interface, { editor: editor, plugin: editor.plugins.NextGEN_AttachToPost, } ); // Add a button to trigger the above command editor.addButton("NextGEN_AttachToPost", { title: "ngg_attach_to_post.title", cmd: "ngg_attach_to_post", image: plugin_url + "/igw_button.png", }); /** * Listen for click events to our placeholder */ editor.on("mouseup touchend", function (e) { tinymce.extend(self, { editor: editor, plugin: editor.plugins.NextGEN_AttachToPost, }); // Support for IGW placeholder images. NGG <= 2.1.50 if (e.target.tagName === "IMG") { if ( self.get_class_name(e.target).indexOf("ngg_displayed_gallery") >= 0 ) { editor.dom.events.cancel(e); var id = e.target.src.match(/\d+$/); if (id) id = id.pop(); self.render_attach_to_post_interface({ key: "id", val: id, }); } } // Support for IGW Visual Shortcodes. NGG >= 2.1.50.1 else { var $target = $(e.target); if ($target.hasClass("nggPlaceholderButton")) { // Remove button if ($target.hasClass("nggIgwRemove")) { var $placeholder = $target.parents(".nggPlaceholder"); var shortcode = $placeholder[0].getAttribute("data-shortcode"); editor.fire("ngg-removed", { shortcode: shortcode }); $placeholder.remove(); } // Edit button else { // Do not use jQuery's .data() here: it will use cached data window.igw_shortcode = $(e.target) .parents(".nggPlaceholder")[0] .getAttribute("data-shortcode"); self.render_attach_to_post_interface({ key: "shortcode", val: Base64.encode(window.igw_shortcode), ref: $(e.target).parents(".nggPlaceholder").attr("id"), }); } } } }); /** * Find each shortcode and replace it with the placeholder, rendered using an underscore template * in templates/tinymce_placeholder.php */ editor.on("BeforeSetContent", function (event) { handle_shortcode(event, "[ngg_images "); handle_shortcode(event, "[ngg "); }); /** * Substitutes the IGW placeholders with the corresponding shortcode */ editor.on("PostProcess", function (event) { var $content = $("
").append(event.content); $content .find(".nggPlaceholder") .toArray() .forEach(function (placeholder) { var $placeholder = $(placeholder); var shortcode = $placeholder.data("shortcode"); shortcode = "[" + _.unescape(shortcode) + "]"; $placeholder.replaceWith(shortcode); }); event.content = $content[0].innerHTML; }); function handle_shortcode(event, shortcode_opening_tag) { while (event.content.indexOf(shortcode_opening_tag) >= 0) { var start_of_shortcode = event.content.indexOf(shortcode_opening_tag); var index = start_of_shortcode + shortcode_opening_tag.length; var found_attribute_assignment = false; var current_attribute_enclosure = null; var last_found_char = false; var content_length = event.content.length; while (true) { var char = event.content[index]; if (char == '"' || (char == "'" && last_found_char == "=")) { // Is this the closing quote for an already found attribute assignment? if ( found_attribute_assignment && current_attribute_enclosure == char ) { found_attribute_assignment = false; current_attribute_enclosure = null; } else { found_attribute_assignment = true; current_attribute_enclosure = char; } } else if (char == "]") { // we've found a shortcode closing tag. But, we need to ensure // that this ] isn't within the value of a shortcode attribute if (!found_attribute_assignment) { break; //exit loop - we've found the shortcode } } last_found_char = char; if (index == content_length) { break; } index++; } // Replace the shortcode with a placeholder var match = event.content.substring(start_of_shortcode, ++index); var shortcode = match.substring(1, match.length - 1); shortcode = shortcode.replace("[", "["); shortcode = shortcode.replace("]", "]"); var template = _.template($("#ngg-igw-placeholder").html()); event.content = event.content.replace( match, template( $.extend(ngg_igw_i18n, { shortcode: shortcode, ref: _.now(), }) ) ); } } }, get_class_name: function (node) { var class_name = node.getAttribute("class") ? node.getAttribute("class") : node.className; if (class_name) { return class_name; } else { return ""; } }, wm_close_event: function (e) { if ( e && e.target && e.target._id && e.target._id == "ngg_attach_to_post_dialog" ) { // Restore scrolling for the main content window when the attach to post interface is closed $("html,body").css("overflow", "auto"); tinyMCE.activeEditor.selection.select( tinyMCE.activeEditor.dom.select("p")[0] ); tinyMCE.activeEditor.selection.collapse(0); } }, /** * Renders the attach to post interface */ render_attach_to_post_interface: function (params) { // Determine the attach to post url var attach_to_post_url = window.igw.url; if (typeof params != "undefined") { attach_to_post_url += "&" + params.key + "=" + encodeURIComponent(params.val); if (typeof params["ref"] != "undefined") { attach_to_post_url += "&ref=" + encodeURIComponent(params.ref); } } attach_to_post_url += "&editor=" + this.editor.id; attach_to_post_url += "&nonce=" + window.ngg_tinymce_plugin.nonce; var win = window; while (win.parent != null && win.parent != win) { win = win.parent; } win = $(win); var winWidth = win.width(); var winHeight = win.height(); var popupWidth = 1600; var popupHeight = 1200; var minWidth = 800; var minHeight = 600; var maxWidth = winWidth - winWidth * 0.05; var maxHeight = winHeight - winHeight * 0.1; if (maxWidth < minWidth) { maxWidth = winWidth - 20; } if (maxHeight < minHeight) { maxHeight = winHeight - 40; } if (popupWidth > maxWidth) { popupWidth = maxWidth; } if (popupHeight > maxHeight) { popupHeight = maxHeight; } // for mobile devices: dismiss the keyboard by blurring any input with focus document.activeElement.blur(); Array.prototype.forEach.call( document.querySelectorAll("input, textarea"), function (it) { it.blur(); } ); // Open a window, occupying 90% of the screen real estate this.editor.windowManager.open({ url: attach_to_post_url, id: "ngg_attach_to_post_dialog", width: popupWidth, height: popupHeight, title: "NextGEN Gallery - Attach To Post", }); // Ensure that the window cannot be scrolled - XXX actually allow scrolling in the main window and disable it for the inner-windows/frames/elements as to create a single scrollbar $("html,body").css("overflow", "hidden"); $("#ngg_attach_to_post_dialog_ifr").css("overflow-y", "auto"); $("#ngg_attach_to_post_dialog_ifr").css("overflow-x", "hidden"); }, }); // Register plugin tinymce.PluginManager.add( "NextGEN_AttachToPost", tinymce.plugins.NextGEN_AttachToPost ); })(photocrati_ajax.wp_site_url, jQuery); AttachToPost/ngg_attach_to_post_tinymce_plugin.min.css000064400000002237150212230430017365 0ustar00@font-face{font-family:Lato;src:url(../../products/photocrati_nextgen/modules/nextgen_admin/static/Lato-Regular.ttf) format('truetype')}.nggPlaceholder{background-color:#143650;box-sizing:border-box;border-top:5px solid #9fbb1a;border-radius:3px;box-shadow:0 0 4px 1px rgba(0,0,0,.05);color:#9fbb1a;font-family:sans-serif;font-size:20px;height:230px;margin:5px;outline:0!important;padding:20px 30px 50px 30px;text-align:center;width:400px;max-width:98%}.nggPlaceholder h3{color:#fff;font-family:Lato,sans-serif;font-size:22px;margin:40px 0 8px 3px;text-transform:uppercase;font-weight:900;letter-spacing:1.5px}.nggPlaceholderButton{background:#9ebd00!important;border-radius:2px;border:none!important;box-shadow:none!important;color:#fff!important;display:inline-block!important;font-size:13px;font-weight:700;font-family:Lato,sans-serif!important;height:36px!important;line-height:36px!important;letter-spacing:1.2px;margin:4px;padding:0;width:106px;text-align:center;text-transform:uppercase!important;text-shadow:none!important;cursor:pointer}.nggPlaceholderButtonRow{display:flex;justify-content:center;align-items:center}.nggPlaceholderButton:hover{background:#a5c31a!important}AttachToPost/uploader-icons-2x.png000064400000007513150212230430013100 0ustar00PNG  IHDR 0EtEXtSoftwareAdobe ImageReadyqe<IDAThyxTUZTe!B!P0&TBXёeeUT& 3 26ӏ` Ҩ.a1l앪z珺u&TU3>?{9|9@ ROQA @ U̅Z&t~l m*Bh!5Ģ 2}TQD2#K-Ss\c9ٷ Īg#N E(b`<\1z"m:W "L;}e70byiaSma %N茫[6CM`PÞy2p4َt`Et^IG'C;).($AxaWAwB4@Ǣg\Pc9CPhQN9鸱W/R>Tal5A(иس)zZzHGo#8cI''YȮa]Y򤁓{ \~1֧Ǡkz-='ɟ6C "jw*{aBb G:e`:e4p{8AQIlN^~tXIQj#:{pbMUge~&PP,3 %,J.gXD[bW6yPA]_m5!TCnQsG1= 1#^'-~U)Lh˪ly@QOs-B^+XnۅH4IYk;ip[I!K9IB>'Ptz$ f OlNůQ~|k,h _q&k-<ŵjw-F(bksC!Fk(_9\9XBxLX|fXk(^\g K6+)y]neQqwфK Rcg#q9} ";PJjy8Y\Ó4r/eXo ⠀sƛ lQ 4ۼ%F|yrA=~c%f!kol/e*tXi/S~~}#4PAp+xʞwF"~F7k;頧Zhcm{X'-b,I0aǹT=<]-ͦ PW7 X‘d=λyNK$+b --ofhNaj*f8m͒yDP$#o(;Ax:$Rxj$kg#`6>c[iXq;0(a o4?Ѳ,Dzsi4(P8SG7W dl0z$@0,f1YIs/pc8sYZw.do?VCq-i&yizmupcQBd*-0#MKJ,jG1 ݡ |0kHѲ"g5na6CkNSeVVIPq['XHd,mfهőڹ4xf:C=q;MlJk뙈:6iȵ6֝:=ۃE^AZXb="oVַ>H>V -χ;EܔVfM'"eN%[˄5h\ } _(cDEQx =2-p9N"p9ۛD\^nhnI3\9_R3L?>$BM~'BKh5 e7E)[>s/_=_/eH3XUmShL;MJ .BУ(s9{p_v2q9rh$KA+QsXKՃ0*H*i3yl4_(s+bp&-<;̊V6y1͕ µ@> ["Hw$Lۇy-R01얉BBijz)s\Jp֪Ã'|NBȊ͎[f\Ne$4Ay(L NR@"[_^_F60c7darE#E:*:Q8%p o^Q.ÐYc#|#54p;=/涁5>X.0+f1RNϨFb W;ͮ8aV06̞t=@4Ζ DC$\#^ oe(Re԰rh\+RV <͵gp{}SֺSAF  v6Kwxn(}繋]uN.Pdĺy[x= jh1ٗ{+VKqjؓs7ѸX^te:1!&Zށ/:6YO&:G;W& ۆc Y/;Xp;+^vXMEp2>X Dl/sW`9imPTAq%yʯD{>l)Aq/"0uܫMV;b\_ (A:|mǶ0wYmn6V]7!!-@߼L$"BB8@?nDhexʯ9QHꓹuDz{{r~.-՟~2-Z\`$b=;H`\?ID rGB "y٘ą\ˇ<>GD<zD!o0USwrQ#A;u0M?"_(@IENDB`AttachToPost/iframely.min.js000064400000001532150212230430012042 0ustar00"use strict";function iframely_callback(t,a){var e=jQuery(a),e=(void 0===e.data("iframely")&&e.data("iframely",{attempts:1}),e.data("iframely"));3==e.attempts?jQuery("#iframely").css({position:"static",visibility:"visible"}).animate({opacity:1}):(e.attempts+=1,setTimeout(function(){t.adjust_height_for_frame(t,a,iframely_callback)},400))}window.frameElement&&(document.getElementsByTagName("html")[0].id="iframely",jQuery(function(t){var a=t("#ngg_page_content"),a=(t("#wpbody-content").html(a),t("#wpbody").html(a),t("#wpwrap").html(a),t("form").each(function(){t(this).append("")}),window.parent);null!=a&&void 0!==a.adjust_height_for_frame||null!=window&&void 0!==window.adjust_height_for_frame&&(a=window),void 0!==a.adjust_height_for_frame&&a.adjust_height_for_frame(a,window,iframely_callback)}));AttachToPost/display_tab.js000064400000201035150212230430011743 0ustar00jQuery(function($){ /***************************************************************************** ** NGG DEFINITION ***/ /** Setup a namespace for NextGEN-offered Backbone components **/ var Ngg = { Models: {}, Views: {} }; /***************************************************************************** ** NGG MODELS ***/ /** * Ngg.Models.SelectableItems * A collection of items that can be selectable. Commonly used with the * Ngg.Views.SelectTag widget (view) **/ Ngg.Models.SelectableItems = Backbone.Collection.extend({ selected: function(){ return this.filter(function(item){ return item.get('selected') == true; }); }, deselect_all: function(){ this.each(function(item){ item.set('selected', false); }); }, selected_ids: function(){ return _.pluck(this.selected(), 'id'); }, select: function(ids){ if (!_.isArray(ids)) ids = [ids]; this.each(function(item){ if (_.indexOf(ids, item.id) >= 0) { item.set('selected', true); } }); this.trigger('selected'); } }); /***************************************************************************** ** NGG VIEWS ***/ /** * Ngg.Views.SelectTag * Used to render a Select tag (drop-down list) **/ Ngg.Views.SelectTag = Backbone.View.extend({ tagName: 'select', collection: null, multiple: false, value_field: 'id', text_field: 'title', initialize: function(options) { this.options = options || {}; _.each(this.options, function(value, key){ this[key] = value; }, this); this.collection.on('add', this.render_new_option, this); this.collection.on('remove', this.remove_existing_option, this); this.collection.on('reset', this.empty_list, this); }, events: { 'change': 'selection_changed' }, empty_list: function(){ this.$el.empty(); }, render_new_option: function(item){ this.$el.append(new this.Option({ model: item, value_field: this.value_field, text_field: this.text_field }).render().el); }, remove_existing_option: function(item){ this.$el.find("option[value='"+item.id+"']").remove(); }, /** * After a selection has changed, set the 'selected' property for each item in the * collection * @triggers 'selected' **/ selection_changed: function(){ // Get selected options from DOM var selections = _.map(this.$el.find(':selected'), function(element){ return $(element).val(); }); // Set the 'selected' attribute for each item in the collection this.collection.each(function(item){ if (_.indexOf(selections, item.id) >= 0 || _.indexOf(selections, item.id.toString()) >= 0) item.set('selected', true); else item.set('selected', false); }); this.collection.trigger('selected'); if (this.onSelect) this.onSelect(); }, render: function(){ this.$el.empty(); if (this.multiple) { this.$el.prop('multiple', true); this.$el.attr('multiple', 'multiple'); } this.collection.each(function(item){ var option = new this.Option({ model: item, value_field: this.value_field, text_field: this.text_field }); this.$el.append(option.render().el); }, this); if (this.width) { this.$el.width(this.width); } return this; }, /** * Represents an option in the Select drop-down **/ Option: Backbone.View.extend({ tagName: 'option', model: null, initialize: function(options) { this.options = options || {}; _.each(this.options, function(value, key){ this[key] = value; }, this); this.model.on('change', this.render, this); }, render: function(){ var self = this; this.$el.html(this.model.get(this.text_field).replace(/\\&/g, '&').replace(/\\'/g, "'")); this.$el.prop({ value: this.value_field == 'id' ? this.model.id : this.model.get(this.value_field), }); if (self.model.get('selected') == true) { this.$el.prop('selected', true).attr('selected', 'selected'); } return this; } }) }); Ngg.Views.Chosen = Backbone.View.extend({ tagName: 'span', initialize: function(options) { this.options = options || {}; this.collection = this.options.collection; this.select_tag = new Ngg.Views.SelectTag(this.options); this.collection.on('change', this.selection_changed, this); }, selection_changed: function(e){ if (_.isUndefined(e.changed['selected'])) this.render(); }, render: function(){ this.$el.append(this.select_tag.render().$el); if (this.options.width) this.select_tag.$el.width(this.options.width); // Configure select2 options this.select2_opts = { placeholder: this.options.placeholder }; // Create the select2 drop-down this.select_tag.$el.select2(this.select2_opts); return this; } }); /***************************************************************************** ** DISPLAY TAB DEFINITION ***/ /** * Setup a namespace **/ Ngg.DisplayTab = { Models: {}, Views: {}, App: {} }; /***************************************************************************** * MODEL CLASSES **/ /** * A collection that can fetch it's entities from the server **/ Ngg.Models.Remote_Collection = Ngg.Models.SelectableItems.extend({ fetch_limit: 5000, in_progress: false, fetch_url: photocrati_ajax.rest_url, action: '', extra_data: {}, _create_request: function(limit, offset) { var request = { nonce: igw_data.nonce, }; for (var index in this.extra_data) { var value = this.extra_data[index]; if (typeof(request[index]) === 'undefined') { request[index] = {}; } if (typeof(value['toJSON']) !== 'undefined') { value = value.toJSON(); } request[index] = _.extend(request[index], value); } return request; }, _add_item: function(item) { this.push(item); }, fetch: function(limit, offset){ // Request the entities from the server var self = this; this.in_progress = true; $.ajax({ method: 'POST', url: this.fetch_url + this.action, data: this._create_request(limit, offset), beforeSend: function(xhr) { xhr.setRequestHeader('X-WP-Nonce', igw_data.nonce); } }).done(function(response) { if (typeof (_) == 'undefined') return; if (!_.isObject(response)) response = JSON.parse(response); if (response.items) { _.each(response.items, function (item) { self._add_item(item); }); self.in_progress = false; self.trigger('finished_fetching'); } }); } }); /** * Ngg.DisplayTab.Models.Displayed_Gallery * Represents the displayed gallery being edited or created by the Display Tab **/ Ngg.DisplayTab.Models.Displayed_Gallery = Backbone.Model.extend({ defaults: { source: null, container_ids: [], entity_ids: [], display_type: null, display_settings: {}, exclusions: [], sortorder: [], slug: null }, to_shortcode: function() { retval = null; var get_shortcode_attr = function(object, key) { var val = object[key]; // Prevent default shortcode attributes from being included if (typeof igw_data.shortcode_defaults[key] !== 'undefined' && igw_data.shortcode_defaults[key] == val) { val = null; } if (_.isArray(val)) { val = val.length > 0 ? val.join(',') : null; } if (val) { val = val.toString().replace('[', '['); val = val.toString().replace(']', ']'); // Some keys have aliases to be used when writing shortcodes if (typeof igw_data.shortcode_attr_replacements[key] !== 'undefined') { key = igw_data.shortcode_attr_replacements[key]; } return key + '="' + val +'"'; } }; // Convert the displayed gallery to a JSON object var display_type = Ngg.DisplayTab.instance.display_types.find_by_name_or_alias(this.get('display_type')); var obj = this.toJSON(); obj.display_type = display_type.get_shortcode_value(); // Convert the displayed gallery to a shortcode var snippet = '[ngg'; var val = null; if ((val = get_shortcode_attr(obj, 'source'))) snippet += ' ' + val; if ((val = get_shortcode_attr(obj, 'container_ids'))) snippet += ' ' + val; if ((val = get_shortcode_attr(obj, 'entity_ids'))) snippet += ' ' + val; if ((val = get_shortcode_attr(obj, 'exclusions'))) snippet += ' ' + val; if ((val = get_shortcode_attr(obj, 'sortorder'))) snippet += ' ' + val; for (var key in obj) { var skipped = [ 'source', 'container_ids', 'entity_ids', 'exclusions', 'sortorder', '__defaults_set', 'id_field', 'post_category', 'ID' ]; if (skipped.indexOf(key) > -1) { continue; } else if (key == 'display_settings') { for (var display_key in obj[key]) { if ((val = get_shortcode_attr(obj[key], display_key))) { snippet += ' ' + val; } } } else { val = get_shortcode_attr(obj, key); if (val) { snippet += ' ' + val; } } } snippet += ']'; return snippet; } }); /** * Ngg.DisplayTab.Models.Source * Represents an individual source used to collect displayable entities from **/ Ngg.DisplayTab.Models.Source = Backbone.Model.extend({ idAttribute: 'name', defaults: { title: '', name: '', selected: false } }); /** * Ngg.DisplayTab.Models.Source_Collection * Used as a collection of all the available sources for entities **/ Ngg.DisplayTab.Models.Source_Collection = Ngg.Models.SelectableItems.extend({ model: Ngg.DisplayTab.Models.Source, selected_value: function(){ var retval = null; var selected = this.selected(); if (selected.length > 0) { retval = selected[0].get('name'); } return retval; }, find_by_name_or_alias: function(name) { return this.find(function(source) { return source.get('name') == name || (_.isArray(source.get('aliases')) && source.get('aliases').indexOf(name) > -1); }); } }); /** * Ngg.DisplayTab.Models.Gallery * Represents an individual gallery entity **/ Ngg.DisplayTab.Models.Gallery = Backbone.Model.extend({ idAttribute: igw_data.gallery_primary_key, defaults: { title: '', name: '' } }); /** * Ngg.DisplayTab.Models.Gallery_Collection * Collection of gallery objects **/ Ngg.DisplayTab.Models.Gallery_Collection = Ngg.Models.Remote_Collection.extend({ model: Ngg.DisplayTab.Models.Gallery, action: 'ngg/v1/admin/attach_to_post/galleries' }); /** * Ngg.DisplayTab.Models.Album * Represents an individual Album object **/ Ngg.DisplayTab.Models.Album = Backbone.Model.extend({ defaults: { title: '', name: '' } }); /** * Ngg.DisplayTab.Models.Album_Collection * Used as a collection of album objects **/ Ngg.DisplayTab.Models.Album_Collection = Ngg.Models.Remote_Collection.extend({ model: Ngg.DisplayTab.Models.Album, action: 'ngg/v1/admin/attach_to_post/albums' }); /** * Ngg.DisplayTab.Models.Tag * Represents an individual tag object **/ Ngg.DisplayTab.Models.Tag = Backbone.Model.extend({ defaults: { title: '' } }); /** * Ngg.DisplayTab.Models.Tag_Collection * Represents a collection of tag objects **/ Ngg.DisplayTab.Models.Tag_Collection = Ngg.Models.Remote_Collection.extend({ model: Ngg.DisplayTab.Models.Tag, /* selected_ids: function(){ return this.selected().map(function(item){ return item.get('name'); }); }, */ action: 'ngg/v1/admin/attach_to_post/tags' }); /** * Ngg.DisplayTab.Models.Display_Type * Represents an individual display type **/ Ngg.DisplayTab.Models.Display_Type = Backbone.Model.extend({ idAttribute: 'name', defaults: { title: '' }, is_compatible_with_source: function(source){ var success = true; for (index in source.get('returns')) { var returned_entity_type = source.get('returns')[index]; if (_.indexOf(this.get('entity_types'), returned_entity_type) < 0) { success = false; break; } } return success; }, get_shortcode_value: function() { var retval = this.id; var aliases = this.get('aliases'); if (_.isArray(aliases) && aliases.length > 0) { retval = aliases[0]; } return retval; } }); /** * Ngg.DisplayTab.Models.Display_Type_Collection * Represents a collection of display type objects **/ Ngg.DisplayTab.Models.Display_Type_Collection = Ngg.Models.SelectableItems.extend({ model: Ngg.DisplayTab.Models.Display_Type, selected_value: function(){ var retval = null; var selected = this.selected(); if (selected.length > 0) { return selected[0].get('name'); } return retval; }, find_by_name_or_alias: function(name){ return this.find(function(display_type){ return display_type.get('name') == name || (_.isArray(display_type.get('aliases')) && display_type.get('aliases').indexOf(name) > -1); }); } }); /** * Ngg.DisplayTab.Models.Entity * Represents an entity to display on the front-end **/ Ngg.DisplayTab.Models.Entity = Backbone.Model.extend({ entity_id: function(){ return this.get(this.get('id_field')); }, is_excluded: function() { current_value = this.get('exclude'); if (_.isUndefined(current_value)) return false; else if (_.isBoolean(current_value)) return current_value; else return parseInt(current_value) == 0 ? false : true; }, is_included: function(){ return !this.is_excluded(); }, is_gallery: function(){ retval = false; if (this.get('is_gallery') == true) retval = true; return retval; }, is_album: function(){ retval = false; if (this.get('is_album') == true) retval = true; return retval; }, is_image: function(){ return !this.is_album() && !this.is_gallery(); }, alttext: function(){ if (this.is_image()) { return this.get('alttext'); } else if (this.is_gallery()) { return this.get('title'); } else if (this.is_album()) { return this.get('name'); } } }); /** * Ngg.DisplayTab.Models.Entity_Collection * Represents a collection of entities **/ Ngg.DisplayTab.Models.Entity_Collection = Ngg.Models.Remote_Collection.extend({ model: Ngg.DisplayTab.Models.Entity, action: 'ngg/v1/admin/attach_to_post/images', _add_item: function(item){ item.exclude = parseInt(item.exclude) == 1 ? true : false; item.is_gallery = parseInt(item.is_gallery) == 1 ? true : false; item.is_album = parseInt(item.is_album) == 1 ? true : false; this.push(item); }, entity_ids: function(){ return this.map(function(item){ return item.entity_id(); }); }, included_ids: function(){ return _.compact(this.map(function(item){ if (item.is_included()) return item.entity_id(); })); }, excluded_ids: function() { return _.compact(this.map(function(item) { if (!item.is_included()) { return item.entity_id(); } })); } }); Ngg.DisplayTab.Models.SortOrder = Backbone.Model.extend({ }); Ngg.DisplayTab.Models.SortOrder_Options = Ngg.Models.SelectableItems.extend({ model: Ngg.DisplayTab.Models.SortOrder }); Ngg.DisplayTab.Models.SortDirection = Backbone.Model.extend({ }); Ngg.DisplayTab.Models.SortDirection_Options = Backbone.Collection.extend({ model: Ngg.DisplayTab.Models.SortDirection }); Ngg.DisplayTab.Models.Slug = Backbone.Model.extend({}); /***************************************************************************** * VIEW CLASSES **/ /** * Ngg.DisplayTab.Views.Source_Config * Used to populate the source configuration tab **/ Ngg.DisplayTab.Views.Source_Config = Backbone.View.extend({ el: '#source_configuration', selected_view: null, /** * Bind to the "sources" collection to know when a selection has been made * and determine what sub-view to render **/ initialize: function(){ this.sources = Ngg.DisplayTab.instance.sources; this.sources.on('selected', this.render, this); _.bindAll(this, 'render'); this.render(); }, render: function(){ var chosen = new Ngg.Views.Chosen({ id: 'source_select', collection: this.sources, placeholder: 'Select a source', width: 500, onSelect: function(){ $('.main_menu_tab').off('scroll'); } }); var template = _.template(''); this.$el.html(template(igw_data.i18n)); this.$el.find('#source_column').append(chosen.render().el); var selected = this.sources.selected(); if (selected.length) { function capitalizeFirstLetter(text) { text = String(text); return text.charAt(0).toUpperCase() + text.slice(1); } var view_name = capitalizeFirstLetter(selected.pop().id) + "Source"; if (typeof(Ngg.DisplayTab.Views[view_name]) != 'undefined') { var selected_view = new Ngg.DisplayTab.Views[view_name]; this.$el.append(selected_view.render().el); } } return this; } }); Ngg.DisplayTab.Views.Slug_Config = Backbone.View.extend({ el: '#slug_configuration', selected_view: null, initialize: function() { this.displayed_gallery = Ngg.DisplayTab.instance.displayed_gallery; this.slug = Ngg.DisplayTab.instance.displayed_gallery.get('slug'); this.render(); }, render: function() { var self = this; var input = $('').prop({ type: 'text', name: 'slug', value: this.slug, placeholder: igw_data.i18n.optional, id: 'field_slug' }); input.on('input', function() { // Do not allow the following characters in the slug $(this).val($(this).val().replace(/\s|\?|\\|\/|&|=|\[|]|#/gm, '-')); self.displayed_gallery.set('slug', $(this).val()); }); // Trim extraneous leading/following dashes from the above sanitation input.on('change', function() { $(this).val( $(this).val() .replace(/^-*/gm, '') .replace(/-*$/gm, '') ); self.displayed_gallery.set('slug', $(this).val()); }); var template = _.template(''); this.$el.append(template(igw_data.i18n)); this.$el.find('#slug_column').append(input); return this; } }); Ngg.DisplayTab.Views.Display_Type_Selector = Backbone.View.extend({ el: '#display_type_selector', initialize: function(){ this.display_types = Ngg.DisplayTab.instance.display_types; this.display_type_order_base = Ngg.DisplayTab.instance.display_type_order_base; this.display_type_order_step = Ngg.DisplayTab.instance.display_type_order_step; this.sources = Ngg.DisplayTab.instance.sources; this.render(); }, selection_changed: function(value){ var selected_type = null; this.display_types.each(function(item){ if (item.get('name') == value) { selected_type = item; item.set('selected', true); } else { item.set('selected', false); } }); $('.display_settings_form').each(function(){ $this = $(this); if ($this.attr('rel') == value) $this.removeClass('hidden'); else $this.addClass('hidden'); }); }, render: function(){ var selected_source = this.sources.selected(); var current_step = 0; selected_source = selected_source.length > 0 ? selected_source[0] : false; this.$el.empty(); var order_base = this.display_type_order_base; var order_step = this.display_type_order_step; this.display_types.each(function(item){ if (selected_source && !item.is_compatible_with_source(selected_source)) { // Show all display types if we're viewing the display type // selector tab var display_tab = $('#display_type_tab_content:visible'); if (display_tab.length == 0) return; else if (display_tab.css('visibility') == 'hidden') return; } var display_type = new Ngg.DisplayTab.Views.DisplayType; display_type.model = item; display_type.on('selected', this.selection_changed, this); if (!this.display_types.selected_value()) { item.set('selected', true); this.selection_changed(item.id); } var display_order = item.get('view_order'); if (!display_order) display_order = order_base; var display_step = Math.floor(display_order / order_step); current_step = display_step; this.$el.append(display_type.render().el); }, this); this.$el.append('
  • '); return this; }, }); Ngg.DisplayTab.Views.DisplayType = Backbone.View.extend({ className: 'display_type_preview', events: { click: 'clicked' }, clicked: function(e){ this.trigger('selected', this.model.get('name')); }, render: function() { // Create all elements var image_container = $('